<?php
  ///////////////////////////////////////////////////
  //2010 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

  $lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0,2);
  if(is_file ("../lang/".$lang."/".$lang.".php")) {include "../lang/".$lang."/".$lang.".php";}
     else {include "../lang/ru/ru.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.php";
require_once "../utils/pass.php";

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

?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table align="center" >
<tr><td class="bold_it_page"><?php echo $TEXT['login-login']; ?>*</td><td><input size=50 maxlength=100 type=text name=login ></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['login-familiya']; ?></td><td><input size=50 maxlength=100 type=text name=familiya ></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['login-name']; ?></td><td><input size=50 maxlength=100 type=text name=name ></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['login-otchestvo']; ?></td><td><input size=50 maxlength=100 type=text name=otchestvo ></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['login-password']; ?>*</td><td><input size=50 maxlength=100 type=text name=password value='<?php echo $passwd; ?>'></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['login-password2']; ?>*</td><td><input size=50 maxlength=100 type=text name=password2 ></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['user-tel-mob']; ?></td><td><input size=50 maxlength=20 type=text name=phone ></td></tr>
<tr><td class="bold_it_page"><?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.php"; exit();}
              while($domain = mysqli_fetch_array($domain_tmp,MYSQLI_ASSOC))
                {
		$chk = "<option value=".$domain['dom_id'].">".$domain['domain']."";
                 echo $chk;
                }
    ?>
    </select></td>
</tr>
<tr><td class="bold_it_page"><?php echo $TEXT['login-fltr']; ?></td><td><input size=4 maxlength=4 type=text name=fltr_size ></td></tr>
<tr><td class="bold_it_page"><?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="bold_it_page"><?php echo $TEXT['login-administrator']; ?></td><td><input type=checkbox name=administrator ></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['login-user']; ?></td><td><input type=checkbox name=user ></td></tr>
<tr><td class="bold_it_page"><?php echo $TEXT['global-chk-updates']; ?></td><td><input type=checkbox name=chk_upd ></td></tr>
<tr><td></td><td><input class="button2" type=submit value='<?php echo $button; ?>'></td></tr>
</table>
</form>
<?php
  require_once "../utils/bottom_adm.php";
?>