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

require_once "utils/chlang_osn.php";

$title = $TEXT['aut-title-info'];

require_once "config.php";
require_once "utils/functions.php";
require_once "utils/top.php";

if($result2['administrator'] == 0 && $result2['user'] == 0) {puterror2($result2['skin'],$TEXT['error-loginform5']); require_once "utils/bottom.php"; exit();}

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

$query_iskh = "SELECT data_rozdeniya, name, familiya, otchestvo, mesto_rozdeniya, real_name, photo_autor, site_protocol, site_name FROM `tbl_autor` WHERE `autor_id`='".$_GET['autor_id']."' ";
  $result_iskh = mysqli_query($dbcnx,$query_iskh);
  if(!$result_iskh) {puterror2($result2['skin'],$TEXT['error-tbl1']); require_once "utils/bottom.php"; exit();}
      $result_iskh2 = mysqli_fetch_array($result_iskh);
      $year = $TEXT['year'];
      if($result_iskh2['data_rozdeniya'] == 0) {$data_r = "";}
       else {$data_r = $result_iskh2['data_rozdeniya']." ".$TEXT['year'];}

      if(!empty($result_iskh2['site_name'])) {$address_aut = "<a href='".$result_iskh2['site_protocol']."://".$result_iskh2['site_name']."' target=_blank title=".$TEXT['aut-site'].">".$result_iskh2['site_protocol']."://".$result_iskh2['site_name']."</a>";}
       else {$address_aut = "";}

     $sm = preg_replace("/\.\.+./","",$result_iskh2['photo_autor']);
     //Переменная для фото
      if(!empty($result_iskh2['photo_autor']) && file_exists($sm)) {$result_image = "<div id='author-container'><img alt='Фото автора' src='".$sm."' /></div>";}
       else {$result_image =  "<img alt='Фото отсутствует' align='center' src='skins/".$result2['skin']."/nophoto.png' />";}

?>
<table align="center" width="80%">
<tr><td>
<table align="center" border="0" width="90%">
 <tr><td valign="top"><?php echo $result_image; ?></td>
 <td>
<table align="left">
<tr><td class="inform"><?php echo $TEXT['login-familiya']; ?>:&nbsp;</td><td class="input"><?php echo rep_back($result_iskh2['familiya']); ?></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-name']; ?>:&nbsp;</td><td class="input"><?php echo rep_back($result_iskh2['name']); ?></td></tr>
<?php
if(!empty($result_iskh2['otchestvo'])) {echo "<tr><td class='inform'>".$TEXT['login-otchestvo'].":&nbsp;</td><td class='input'>".rep_back($result_iskh2['otchestvo'])."</td></tr>";}
if($data_r !== "") {echo "<tr><td class='inform'>".$TEXT['data_rozdeniya'].":&nbsp;</td><td class='input'>".$data_r."</td></tr>";}
if(!empty($result_iskh2['mesto_rozdeniya'])) {echo "<tr><td class='inform'>".$TEXT['mesto_rozdeniya'].":&nbsp;</td><td class='input'>".rep_back($result_iskh2['mesto_rozdeniya'])."</td></tr>";}
if(!empty($result_iskh2['real_name'])) {echo "<tr><td class='inform'>".$TEXT['real_name'].":&nbsp;</td><td class='input'>".rep_back($result_iskh2['real_name'])."</td></tr>";}
if($address_aut !== "") {echo "<tr><td class='inform'>".$TEXT['aut-site'].":&nbsp;</td><td class='input'>".$address_aut."</td></tr>";}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php
  require_once "utils/bottom.php";
?>