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

  require_once "../utils/chlang.php";

  $title = $TEXT['aut-title'];
  $button = $TEXT['btn_save'];
  $action = "edit.php";

require_once "../config_a.php";
require_once "../utils/functions.php";
require_once "../utils/top_adm.php";

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

 if(empty($_GET['autor_id'])) {puterror($result2['skin'],$TEXT['error-aut15']); require_once "../utils/bottom_adm.php"; exit();}
  if(strlen($_GET['autor_id'])>15) {puterror($result2['skin'],$TEXT['error-aut14']); require_once "../utils/bottom_adm.php"; exit();}
  $_GET['autor_id'] = rep ($_GET['autor_id']);

$query_iskh = "SELECT * FROM `tbl_autor` WHERE `autor_id`='".$_GET['autor_id']."' ";
  $result_iskh = mysqli_query($dbcnx,$query_iskh);
  if(!$result_iskh) {puterror($result2['skin'],$TEXT['error-tbl1']); require_once "../utils/bottom_adm.php"; exit();}
      $result_iskh2 = mysqli_fetch_array($result_iskh);
      $prt = $result_iskh2['site_protocol'];
      $old_pho = $result_iskh2['photo_autor'];
      $old_autor_id = $_GET['autor_id'];

  //Переменная для фото
  if(!empty($result_iskh2['photo_autor']) && file_exists($result_iskh2['photo_autor'])) {$result_image = "<img src='".$result_iskh2['photo_autor']."' />";}
   else {$result_image =  "<img align='center' with='130px' heigh='185px' src='../skins/".$result2['skin']."/nophoto.png')' />";}

?>
<table align="center" width="80%">
<tr><td>
<form enctype="multipart/form-data" action="<?php echo $action; ?>" method="post">
<table align="center" border=0 width=95%>
    <tr><td valign="top"><?php echo $result_image; ?></td>
    <td>
<table align="left" >
<tr><td class="inform"><?php echo $TEXT['login-familiya']; ?>:</td><td><input size="50" maxlength="100" type="text" name="familiya" value="<?php echo rep_back($result_iskh2['familiya']); ?>"></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-name']; ?>:</td><td><input size="50" maxlength="100" type="text" name="name" value="<?php echo rep_back($result_iskh2['name']); ?>"></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-otchestvo']; ?>:</td><td><input size="50" maxlength="100" type="text" name="otchestvo" value="<?php echo rep_back($result_iskh2['otchestvo']); ?>"></td></tr>
<tr><td class="inform"><?php echo $TEXT['data_rozdeniya']; ?>:</td><td><input size="50" maxlength="4" type="text" title="<?php echo $TEXT['data_rozdeniya_ex']; ?>" name="data_rozdeniya" value="<?php echo $result_iskh2['data_rozdeniya']; ?>"></td></tr>
<tr><td class="inform"><?php echo $TEXT['mesto_rozdeniya']; ?>:</td><td><input size="50" maxlength="127" type="text" name="mesto_rozdeniya" value="<?php echo rep_back($result_iskh2['mesto_rozdeniya']); ?>"></td></tr>
<tr><td class="inform"><?php echo $TEXT['real_name']; ?>:</td><td><input size="50" maxlength="127" type="text" name="real_name" value="<?php echo rep_back($result_iskh2['real_name']); ?>"></td></tr>
<tr><td class="inform"><?php echo $TEXT['aut-site']; ?>:</td><td>
    <select name="tip_pr">
    <option value="http" <?php if ($prt =='http') {echo "selected";} ?>>http
    <option value="https" <?php if ($prt =='https') {echo "selected";} ?>>https
    <option value="ftp" <?php if ($prt =='ftp') {echo "selected";} ?>>ftp
    </select>
    ://
    <input size="30" maxlength="127" type="text" name="addr" value="<?php echo $result_iskh2['site_name']; ?>"></td></tr>
<tr><td class="inform"><?php echo $TEXT['user-photo']; ?>:</td><td><input size="30" type="file" name="photo" ></td></tr>
<tr><td class="inform"><?php echo $TEXT['photo_obr']; ?>:</td><td>
    <select name="photo_obr">
    <option value="1" selected><?php echo $TEXT['photo_no']; ?>
    <option value="2" ><?php echo $TEXT['photo_rec_l']; ?>
    <option value="4" ><?php echo $TEXT['photo_rec_l_t']; ?>
    <option value="6" ><?php echo $TEXT['photo_rec_l_r']; ?>
    </select>
   </td></tr>
<tr><td class="inform"><?php echo $TEXT['user-photo-del']; ?></td><td><input type="checkbox" name="delphoto" ></td></tr>
<tr><td></td><td>
<input class="button2" type="submit" value="<?php echo $button; ?>">
<input type="hidden" name="autor_id" value="<?php echo $old_autor_id; ?>">
<input type="hidden" name="old_pho" value="<?php echo $old_pho; ?>">
</td></tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<?php
  require_once "../utils/bottom_adm.php";
?>