<?php
  ///////////////////////////////////////////////////
  //2010 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////
require_once "../utils/chlang.php";

$title = $TEXT['login-title-add'];
$button = $TEXT['btn_add'];
$action = "add.php";

require_once "../config_a.php";
require_once "../utils/functions.php";
require_once "../utils/top_adm_film.php";
require_once "../utils/pass.php";

if($result2['administrator'] == 0) {puterror($result2['skin'],$TEXT['error-loginform2']); require_once "../utils/bottom_adm_film.php"; exit();}
$passwd=passgen($usr_pass);

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table align="center" >
<tr><td class="inform"><?php echo $TEXT['login-login']; ?>:</td><td><input class="inputmandatory" size=50 maxlength=100 type=text name=login ></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-familiya']; ?>:</td><td><input size=50 maxlength=100 type=text name=familiya ></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-name']; ?>:</td><td><input size=50 maxlength=100 type=text name=name ></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-otchestvo']; ?>:</td><td><input size=50 maxlength=100 type=text name=otchestvo ></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-password']; ?>:</td><td><input class="inputmandatory" size=50 maxlength=100 type=text name=password value='<?php echo $passwd; ?>'></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-password2']; ?>:</td><td><input class="inputmandatory" size=50 maxlength=100 type=text name=password2 ></td></tr>
<tr><td class="inform"><?php echo $TEXT['user-tel-mob']; ?>:</td><td><input size=50 maxlength=20 type=text name=phone ></td></tr>
<tr><td class="inform"><?php echo $TEXT['user-e-mail']; ?>:</td><td><input size=20 maxlength=40 type=text name=mail > @
<select class=input name="dom_id">
    <?php
        $query = "SELECT * FROM `tbl_domain` ORDER BY domain";
        $domain_tmp = mysqli_query($dbcnx,$query);
          if(!$domain_tmp) {puterror($result2['skin'],$TEXT['error-tbl5']); require_once "../utils/bottom_adm_film.php"; exit();}
              while($domain = mysqli_fetch_array($domain_tmp))
                {
		$chk = "<option value=".$domain['dom_id'].">".$domain['domain']."";
                 echo $chk;
                }
    ?>
    </select></td>
</tr>
<tr><td class="inform"><?php echo $TEXT['user-icq']; ?>:</td><td><input size=50 maxlength=20 type=text name=icq ></td></tr>
<tr><td class="inform"><?php echo $TEXT['user-adrr']; ?>:</td><td><input size=50 maxlength=255 type=text name=address ></td></tr>
<tr><td class="inform"><?php echo $TEXT['global-tema']; ?>:</td><td>
<select class=input name="skin">
    <?php
        $skin_dir = opendir("../skins");
             while(($dir = readdir($skin_dir)))
                {
                 if(is_dir("../skins/".$dir) && $dir != "." && $dir != "..")
                 {
		 $tema = "<option value=".$dir.">".$dir."";
                 echo $tema;
                 }
                }
                closedir($skin_dir);
    ?>
    </select></td></tr>
<tr><td class="inform"><?php echo $TEXT['global-film-tema']; ?>:</td><td>
<select class=input name="skin2">
    <?php
        $skin_dir2 = opendir("../skins");
             while(($dir2 = readdir($skin_dir2)))
                {
                 if(is_dir("../skins/".$dir2) && $dir2 != "." && $dir2 != "..")
                 {
		 $tema2 = "<option value=".$dir2.">".$dir2."";
                 echo $tema2;
                 }
                }
                closedir($skin_dir2);
    ?>
    </select></td></tr>
<tr><td class="inform"><?php echo $TEXT['user-photo']; ?>:</td><td><input size=10 type=file name=photo ></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-administrator']; ?></td><td><input type=checkbox name=administrator ></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-user']; ?></td><td><input type=checkbox name=user ></td></tr>
<tr><td></td><td><input type=submit value='<?php echo $button; ?>'></td></tr>
</table>
</form>
<?php
  require_once "../utils/bottom_adm_film.php";
?>