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

  require_once "utils/chlang_osn.php";

  $title = $TEXT['menu-btn33-title'];
  $button = $TEXT['menu-btn33-3'];
  $action = "film-print.php";

?>
<script type="text/javascript" language="JavaScript" src="lang/<?php echo $lang; ?>/calendar_usr.js"></script>
<?php
require_once "config.php";
require_once "utils/functions.php";
require_once "utils/top_film.php";

if($result2['administrator'] == 0 && $result2['user'] == 0) {puterror2($result2['skin'],$TEXT['error-loginform2']); require_once "utils/bottom_film.php"; exit();}
?>
<form name='film' enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table align="center" width="60%" border="0">
<tr>
<td>
<fieldset>
    <legend align="left" title="<?php echo $TEXT['menu-btn33']; ?>"><?php echo $TEXT['menu-btn33-title2']; ?></legend>
<table align="right" width="100%" border="0">
<tr><td class="inform"><?php echo $TEXT['book-data']; ?>:</td><td><input size=4 maxlength=4 type=text name=data_izdaniya /></td></tr>
<tr><td class="inform"><?php echo $TEXT['book-data2']; ?>:</td><td><input size=10 maxlength=10 type=text name=data_postupleniya />
<script type="text/javascript" language="JavaScript">
	var o_cal = new tcal ({
		// form name
		'formname': 'film',
		// input name
		'controlname': 'data_postupleniya'
	});
	</script></td></tr>
<tr><td class="inform"><?php echo $TEXT['login-fullname']; ?>:</td><td>
    <select name="login_id">
    <?php
        $querylgn = "SELECT login_id, name, familiya, otchestvo FROM `tbl_logins` ORDER BY familiya, name, otchestvo ";
          $resultlgn = mysqli_query($dbcnx,$querylgn);
            if(!$resultlgn) {puterror2($result2['skin'],$TEXT['error-tbl7']); require_once "utils/bottom_film.php"; exit();}
              while($result_login = mysqli_fetch_array($resultlgn))
                {
                 $chk_login = "<option value=".$result_login['login_id'].">".$result_login['familiya']." ".$result_login['name']." ".$result_login['otchestvo']."";
                 echo $chk_login;
                }
    ?>
    </select><input type=checkbox name=login_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['menu-btn22-film']; ?>:</td><td>
    <select name="izd_id">
    <?php
        $queryizd = "SELECT izd_id, izdatelstvo FROM `tbl_izdatelstvo` WHERE use_prog='2' ORDER BY `izdatelstvo` ";
          $resultizd = mysqli_query($dbcnx,$queryizd);
            if(!$resultizd) {puterror2($result2['skin'],$TEXT['error-tbl6']); require_once "utils/bottom_film.php"; exit();}
              while($result_izdatelstvo = mysqli_fetch_array($resultizd))
                {
                 $chk_izdatelstvo = "<option value=".$result_izdatelstvo['izd_id'].">".$result_izdatelstvo['izdatelstvo']."";
                 echo $chk_izdatelstvo;
                }
    ?>
    </select><input type=checkbox name=izd_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['menu-btn29']; ?>:</td><td>
    <select name="ser_id">
    <?php
        $queryser = "SELECT * FROM `tbl_seriya` WHERE use_prog='2' ORDER BY `seriya` ";
          $resultser = mysqli_query($dbcnx,$queryser);
            if(!$resultser) {puterror2($result2['skin'],$TEXT['error-tbl21']); require_once "utils/bottom_film.php"; exit();}
              while($result_seriya = mysqli_fetch_array($resultser))
                {
                 $chk_seriya = "<option value=".$result_seriya['ser_id'].">".$result_seriya['seriya']."";
                 echo $chk_seriya;
                }
    ?>
    </select><input type=checkbox name=ser_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['zhanr-title']; ?>:</td><td>
    <select name="zhanr_id">
    <?php
        $query10 = "SELECT * FROM `tbl_zhanr` WHERE use_prog='2' ORDER BY `zhanr` ";
          $result10 = mysqli_query($dbcnx,$query10);
            if(!$result10) {puterror2($result2['skin'],$TEXT['error-tbl14']); require_once "utils/bottom_film.php"; exit();}
              while($result_zhanr = mysqli_fetch_array($result10))
                {
                 $chk_zhanr = "<option value=".$result_zhanr['zhanr_id'].">".$result_zhanr['zhanr']."";
                 echo $chk_zhanr;
                }
    ?>
    </select><input type=checkbox name=zhanr_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['menu-btn17']; ?>:</td><td>
    <select name="cicle_id">
    <?php
        $query11 = "SELECT * FROM `tbl_cicle` WHERE use_prog='2' ORDER BY `cicle` ";
          $result11 = mysqli_query($dbcnx,$query11);
            if(!$result11) {puterror2($result2['skin'],$TEXT['error-tbl5']); require_once "utils/bottom_film.php"; exit();}
              while($result_cicle = mysqli_fetch_array($result11))
                {
                 $chk_cicle = "<option value=".$result_cicle['cicle_id'].">".$result_cicle['cicle']."";
                 echo $chk_cicle;
                }
    ?>
    </select><input type=checkbox name=cicle_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['menu-btn37']; ?>:</td><td>
    <select name="bl_id">
    <?php
        $query17 = "SELECT `bl_id`,`booklang` FROM `tbl_booklang` WHERE use_prog='2' ORDER BY `position`, `booklang` ";
          $result17 = mysqli_query($dbcnx,$query17);
            if (!$result17) {puterror($result2['skin'],$TEXT['error-tbl23']); require_once "../utils/bottom_film_adm.php"; exit();}
              while($result_bl = mysqli_fetch_array($result17))
                {
                 $chk_bl = "<option value=".$result_bl['bl_id'].">".$result_bl['booklang']."";
                 echo $chk_bl;
                }
    ?>
    </select><input type=checkbox name=bl_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['menu-btn38-title']; ?></td><td>
    <select name="vozr_id">
    <?php
        $query18 = "SELECT * FROM `tbl_vozrast` ORDER BY `vozrast`";
          $result18 = mysqli_query($dbcnx,$query18);
            if(!$result18) {puterror($result2['skin'],$TEXT['error-tbl24']); require_once "../utils/bottom_film.php"; exit();}
              while($result_bl = mysqli_fetch_array($result18))
                {
                 if($result_iskh2['vozr_id'] == $result_bl['vozr_id']) {$chk_bl = "<option selected value=".$result_bl['vozr_id'].">".$result_bl['vozrast']."";}
                 else {$chk_bl = "<option value=".$result_bl['vozr_id'].">".$result_bl['vozrast']."";}
                 echo $chk_bl;
                }
    ?>
    </select><input type=checkbox name=vozr_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['menu-btn36']; ?>:</td><td>
    <select name="tip_izd_id">
    <?php
        $query12 = "SELECT * FROM `tbl_tip_izd` WHERE use_prog='2' ORDER BY `tip_izd` ";
          $result12 = mysqli_query($dbcnx,$query12);
            if(!$result12) {puterror2($result2['skin'],$TEXT['error-tbl15']); require_once "utils/bottom_film.php"; exit();}
              while($result_izd = mysqli_fetch_array($result12))
                {
                 $chk_izd = "<option value=".$result_izd['tip_izd_id'].">".$result_izd['tip_izd']."";
                 echo $chk_izd;
                }
    ?>
    </select><input type=checkbox name=tip_izd_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['global-film']; ?>:</td><td>
    <select name="bibl_id">
    <?php
        $query13 = "SELECT name, bibl_id FROM `tbl_biblioteka` ORDER BY `name` ";
          $result13 = mysqli_query($dbcnx,$query13);
            if(!$result13) {puterror2($result2['skin'],$TEXT['error-tbl2']); require_once "utils/bottom_film.php"; exit();}
              while($result_libr = mysqli_fetch_array($result13))
                {
                 $chk_libr = "<option value=".$result_libr['bibl_id'].">".$result_libr['name']."";
                 echo $chk_libr;
                }
    ?>
    </select><input type=checkbox name=bibl_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['book-zal']; ?>:</td><td>
    <select name="zal_id">
    <?php
        $query14 = "SELECT * FROM `tbl_zal` ORDER BY `zal` ";
          $result14 = mysqli_query($dbcnx,$query14);
            if(!$result14) {puterror2($result2['skin'],$TEXT['error-tbl11']); require_once "utils/bottom_film.php"; exit();}
              while($result_zal = mysqli_fetch_array($result14))
                {
                 $chk_zal = "<option value=".$result_zal['zal_id'].">".$result_zal['zal']."";
                 echo $chk_zal;
                }
    ?>
    </select><input type=checkbox name=zal_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['book-shkaf']; ?>:</td><td>
    <select name="shkaf_id">
    <?php
        $query15 = "SELECT * FROM `tbl_shkaf` ORDER BY `shkaf` ";
          $result15 = mysqli_query($dbcnx,$query15);
            if(!$result15) {puterror2($result2['skin'],$TEXT['error-tbl9']); require_once "utils/bottom_film.php"; exit();}
              while($result_shkaf = mysqli_fetch_array($result15))
                {
                 $chk_shkaf = "<option value=".$result_shkaf['shkaf_id'].">".$result_shkaf['shkaf']."";
                 echo $chk_shkaf;
                }
    ?>
    </select><input type=checkbox name=shkaf_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['book-polka']; ?>:</td><td>
    <select name="polka_id">
    <?php
        $query16 = "SELECT * FROM `tbl_polka` ORDER BY `polka` ";
          $result16 = mysqli_query($dbcnx,$query16);
            if(!$result16) {puterror2($result2['skin'],$TEXT['error-tbl8']); require_once "utils/bottom_film.php"; exit();}
              while($result_polka = mysqli_fetch_array($result16))
                {
                 $chk_polka = "<option value=".$result_polka['polka_id'].">".$result_polka['polka']."";
                 echo $chk_polka;
                }
    ?>
    </select><input type=checkbox name=polka_ch /></td></tr>
<tr><td class="inform"><?php echo $TEXT['book-vidano']; ?>:</td><td><input type=radio name=vidano value=1></td></tr>
<tr><td class="inform"><?php echo $TEXT['book-show4']; ?>:</td><td><input type=radio name=vidano value=2></td></tr>
<tr><td class="inform"><?php echo $TEXT['book-show5']; ?>:</td><td><input type=radio name=vidano value=3></td></tr>
<tr><td class="inform"><?php echo $TEXT['film-oglavl2']; ?>:</td><td><input type=checkbox name=oglavlenie /></td></tr>
<tr><td class="inform"><?php echo $TEXT['film-org-viv']; ?>:</td><td><input type=checkbox name=org_viv /></td></tr>
</table>
</fieldset>
</td></tr>
<tr><td><input type=submit value='<?php echo $button; ?>' /></td></tr>
</table>
</form>
<?php
  require_once "utils/bottom_film.php";
?>