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

$title = $TEXT['menu-btn37-title'];

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

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

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

if(strlen($_GET['bl_id'])>5) {puterror($result2['skin'],$TEXT['error-booklang6']); require_once "../utils/bottom_adm_film.php"; exit();}
$_GET['bl_id'] = rep($_GET['bl_id']);
  
$old_bl_id = $_GET['bl_id'];

$query10 = "SELECT * FROM `tbl_booklang` WHERE `bl_id`='".$_GET['bl_id']."' AND `use_prog`='2' ";
$result10 = mysqli_query($dbcnx,$query10);
 if(!$result10) {puterror($result2['skin'],$TEXT['error-tbl23']); require_once "../utils/bottom_adm_film.php"; exit();}
   $result_bl = mysqli_fetch_array($result10);
    $booklang = $result_bl['booklang'];
    $pos = $result_bl['position'];
    $old_pho = $result_bl['picture'];

    if(!empty($result_bl['picture']) && is_file($result_bl['picture'])) {$img = "<img alt='".$result_bl['booklang']."' src='".$result_bl['picture']."' />";}
     else {$img = "";}
?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table align="center" border="0" width=40%>
    <tr><td valign="center"><?php echo $img; ?></td>
    <td>
<table align="center" border="0">
<tr><td class="inform"><?php echo $TEXT['menu-btn37']; ?>:</td><td><input size=30 maxlength=127 type=text name=booklang value='<?php echo $booklang; ?>' /></td></tr>
<tr><td class="inform"><?php echo $TEXT['book-lang-pos']; ?>:</td><td><input size=5 maxlength=5 type=text name=position value="<?php echo $pos; ?>" ></td></tr>
<tr><td class="inform"><?php echo $TEXT['global-alt']; ?>:</td><td><input size=30 type=file name=photo ></td></tr>
<tr><td class="inform"><?php echo $TEXT['book-lang-delpho']; ?></td><td><input type=checkbox name=delphoto /></td></tr>
<tr><td>&nbsp;</td><td><input class="button2" type=submit value='<?php echo $button; ?>' />
<input type=hidden name=bl_id value='<?php echo $old_bl_id; ?>' />
<input type=hidden name=old_pho value='<?php echo $old_pho; ?>' />
</td></tr>
</table>
</td></tr>
</table>
</form>
<?php
require_once "../utils/bottom_adm_film.php";
?>