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

  require_once "utils/chlang_osn.php";

  $title = $TEXT['search-title'];

  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();}

  if(strlen($_POST['film_name'])>255) {puterror2($result2['skin'],$TEXT['error-film2']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['autors'])>255) {puterror2($result2['skin'],$TEXT['error-film9']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['opisanie'])>1000) {puterror2($result2['skin'],$TEXT['error-film10']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['oglavlenie'])>1500){puterror2($result2['skin'],$TEXT['error-film11']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['zhanr_id'])>5){puterror2($result2['skin'],$TEXT['error-zhanr6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['cicle_id'])>5) {puterror2($result2['skin'],$TEXT['error-cicle6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['tip_izd_id'])>5) {puterror2($result2['skin'],$TEXT['error-tip-izd6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['bibl_id'])>5) {puterror2($result2['skin'],$TEXT['error-libr6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['photo_obr'])>1) {puterror2($result2['skin'],$TEXT['error-pic2']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['zal_id'])>5) {puterror2($result2['skin'],$TEXT['error-zal6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['shkaf_id'])>5) {puterror2($result2['skin'],$TEXT['error-shkaf6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['polka_id'])>5) {puterror2($result2['skin'],$TEXT['error-polka6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['izd_id'])>5) {puterror2($result2['skin'],$TEXT['error-izd6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['data_izdaniya'])>10) {puterror2($result2['skin'],$TEXT['error-film21']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['data_postupleniya'])>10) {puterror2($result2['skin'],$TEXT['error-film22']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['data_postupleniya_bol'])>10) {puterror2($result2['skin'],$TEXT['error-film22']); require_once "utils/bottom_film.php"; exit();}
  //if(strlen($_POST['autor_id'])>15) {puterror2($result2['skin'],$TEXT['error-aut14']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['ser_id'])>5) {puterror2($result2['skin'],$TEXT['error-ser6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['vozr_id'])>5) {puterror($result2['skin'],$TEXT['error-filmlang6']); require_once "../utils/bottom_film.php"; exit();}
  //if(strlen($_GET['vozr_id'])>5) {puterror($result2['skin'],$TEXT['error-filmlang6']); require_once "../utils/bottom_film.php"; exit();}
  //if(strlen($_GET['autor_id'])>15) {puterror2($result2['skin'],$TEXT['error-aut14']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['film_id'])>255) {puterror22($result2['skin'],$TEXT['error-film6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['bibl_id'])>5) {puterror2($result2['skin'],$TEXT['error-libr6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['cicle_id'])>5) {puterror2($result2['skin'],$TEXT['error-cicle6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['zhanr_id'])>5){puterror2($result2['skin'],$TEXT['error-zhanr6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['bibl_id'])>5) {puterror2($result2['skin'],$TEXT['error-libr6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['zal_id'])>5) {puterror2($result2['skin'],$TEXT['error-zal6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['shkaf_id'])>5) {puterror2($result2['skin'],$TEXT['error-shkaf6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['polka_id'])>5) {puterror2($result2['skin'],$TEXT['error-polka6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['izd_id'])>5) {puterror2($result2['skin'],$TEXT['error-izd6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['tip_izd_id'])>5) {puterror2($result2['skin'],$TEXT['error-tip-izd6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_GET['ser_id'])>5) {puterror2($result2['skin'],$TEXT['error-ser6']); require_once "utils/bottom_film.php"; exit();}
  if(strlen($_POST['typepar'])>2) {puterror2($result2['skin'],$TEXT['param_err12']); require_once "utils/bottom_film.php"; exit();}

  if(empty($_POST['typepar'])) {
   if(empty($_GET['typepar'])) {$_POST['typepar'] = "";}
    else {$_POST['typepar'] = $_GET['typepar'];}
    } else {$_POST['typepar'] = $_POST['typepar'];}

  if(empty($_POST['search'])) {
   if(empty($_GET['search'])) {$_POST['search'] = "";}
    else {$_POST['search'] = $_GET['search'];}
    } else {$_POST['search'] = $_POST['search'];}

  if(empty($_POST['izd_id'])) {
   if(empty($_GET['izd_id'])) {$_POST['izd_id'] = "";}
    else {$_POST['izd_id'] = $_GET['izd_id'];}
    } else {$_POST['izd_id'] = $_POST['izd_id'];}

  if(strlen($_POST['bl_id'])>5) {puterror($result2['skin'],$TEXT['error-filmlang6']); require_once "../utils/bottom_film_adm.php"; exit();}

  $_POST['typepar'] = rep($_POST['typepar']);
  $_POST['ser_id'] = rep($_POST['ser_id']);
  $_POST['bibl_id'] = rep($_POST['bibl_id']);
  $_POST['film_id'] = rep($_POST['film_id']);
  $_POST['cicle_id'] = rep($_POST['cicle_id']);
  $_POST['cicle_ch'] = rep($_POST['cicle_ch']);
  $_POST['bibl_ch'] = rep($_POST['bibl_ch']);
  $_POST['zhanr_ch'] = rep($_POST['zhanr_ch']);
  $_POST['spisano'] = rep($_POST['spisano']);
  $_POST['film_name'] = rep($_POST['film_name']);
  $_POST['opisanie'] = rep($_POST['opisanie']);
  $_POST['oglavlenie'] = rep($_POST['oglavlenie']);
  $_POST['vozr_id'] = rep($_POST['vozr_id']);
  $_POST['zhanr_id'] = rep($_POST['zhanr_id']);
  $_POST['cicle_id'] = rep($_POST['cicle_id']);
  $_POST['tip_izd_id'] = rep($_POST['tip_izd_id']);
  $_POST['bibl_id'] = rep($_POST['bibl_id']);
  $_POST['photo_obr'] = rep($_POST['photo_obr']);
  $_POST['zal_id'] = rep($_POST['zal_id']);
  $_POST['shkaf_id'] = rep($_POST['shkaf_id']);
  $_POST['polka_id'] = rep($_POST['polka_id']);
  $_POST['data_izdaniya'] = rep($_POST['data_izdaniya']);
  $_POST['data_postupleniya'] = rep($_POST['data_postupleniya']);
  $_POST['data_postupleniya_bol'] = rep($_POST['data_postupleniya_bol']);
  $_POST['ser_id'] = rep($_POST['ser_id']);
  $_POST['vozr_id'] = rep($_POST['vozr_id']);
  $_POST['izd_id'] = rep($_POST['izd_id']);
  $_POST['bl_id'] = rep($_POST['bl_id']);
  $_GET['bibl_id'] = rep($_GET['bibl_id']);
  $_GET['zal_id'] = rep($_GET['zal_id']);
  $_GET['shkaf_id'] = rep($_GET['shkaf_id']);
  $_GET['polka_id'] = rep($_GET['polka_id']);
  $_GET['tip_izd_id'] = rep($_GET['tip_izd_id']);
  $_GET['vozr_id'] = rep($_GET['vozr_id']);
  $_GET['zhanr_id'] = rep($_GET['zhanr_id']);
  $_GET['ser_id'] = rep($_GET['ser_id']);
  $_GET['bibl_id'] = rep($_GET['bibl_id']);
  $_GET['film_id'] = rep($_GET['film_id']);
  $_GET['cicle_id'] = rep($_GET['cicle_id']);
  $_GET['cicle_ch'] = rep($_GET['cicle_ch']);
  $_GET['bibl_ch'] = rep($_GET['bibl_ch']);
  $_GET['zhanr_ch'] = rep($_GET['zhanr_ch']); 

  if($_POST['search'] !== '')
  {
    switch($_POST['typepar'])
      {
      case 1:
      $_POST['film_name'] = trim($_POST['search']);
      break;
      case 2:
      $_POST['oglavlenie'] = trim($_POST['search']);
      break;
      case 3:
      $_POST['opisanie'] = trim($_POST['search']);
      break;
      case 4:
      $_POST['isbn'] = trim($_POST['search']);
      break;
      case 5:
      $univ_srch = trim($_POST['search']);
      break;
      }
   }

  if(!empty($univ_srch)) {$univ_srch2 = " AND LOWER(tbl_film.film_name) LIKE LOWER('%".$univ_srch."%') OR LOWER(tbl_film.opisanie) LIKE LOWER('%".$univ_srch."%') OR LOWER(tbl_film.oglavlenie) LIKE LOWER('%".$univ_srch."%') OR LOWER(tbl_cicle.cicle) LIKE LOWER('%".$univ_srch."%') ";}
    else {$univ_srch2 = "";}

  if(!empty($_GET['film_id'])) {$film_id = " tbl_film.film_id = '".$_POST['film_id']."' ";}
    else {$film_id = " tbl_film.film_id != '0' ";}

  if(!empty($_POST['film_name'])) {$film_name = "AND LOWER(tbl_film.film_name) LIKE LOWER('%".$_POST['film_name']."%') ";}
    else {$film_name = "";}

  if(!empty($_POST['autors'])) {$autors = "AND LOWER(tbl_film.autors) LIKE LOWER('%".$_POST['autors']."%') ";}
    else {$autors = "";}

  if(!empty($_POST['opisanie'])) {$opisanie = "AND LOWER(tbl_film.opisanie) LIKE LOWER('%".$_POST['opisanie']."%') ";}
    else {$opisanie = "";}

  if(!empty($_POST['oglavlenie'])) {$oglavlenie = "AND LOWER(tbl_film.oglavlenie) LIKE LOWER('%".$_POST['oglavlenie']."%') ";}
    else {$oglavlenie = "";}

  if(!empty($_POST['data_izdaniya'])) {$data_izdaniya = "AND tbl_film.data_izdaniya LIKE '%".$_POST['data_izdaniya']."%' ";}
    else {$data_izdaniya = "";}

  if(!empty($_POST['data_postupleniya']))
   {
   if(!empty($_POST['data_postupleniya_bol'])) {$data_postupleniya = "AND tbl_film.data_postupleniya BETWEEN '".$_POST['data_postupleniya_bol']."' AND '".$_POST['data_postupleniya']."' ";}
    else {$data_postupleniya = "AND tbl_film.data_postupleniya = '".$_POST['data_postupleniya']."' ";}
   }
   else {
     if(!empty($_POST['data_postupleniya_bol'])) {$data_postupleniya = "AND tbl_film.data_postupleniya > '".$_POST['data_postupleniya_bol']."' ";}
      else {$data_postupleniya = "";}
    }

  if(empty($_POST['izd_ch'])) {
   if(empty($_GET['izd_ch'])) {$_POST['izd_ch'] = "";}
    else {$_POST['izd_ch'] = $_GET['izd_ch'];}
    } else {$_POST['izd_ch'] = $_POST['izd_ch'];}

  if(empty($_POST['ser_ch'])) {$_POST['ser_ch'] = "";}
  if(empty($_POST['zhanr_ch'])) {$_POST['zhanr_ch'] = "";}
  if(empty($_POST['cicle_ch'])) {$_POST['cicle_ch'] = "";}
  if(empty($_POST['tip_izd_ch'])) {$_POST['tip_izd_ch'] = "";}
  if(empty($_POST['bibl_ch'])) {$_POST['bibl_ch'] = "";}
  if(empty($_POST['zal_ch'])) {$_POST['zal_ch'] = "";}
  if(empty($_POST['shkaf_ch'])) {$_POST['shkaf_ch'] = "";}
  if(empty($_POST['polka_ch'])) {$_POST['polka_ch'] = "";}
  if(empty($_POST['spisano'])) {$_POST['spisano'] = "";}
  if(empty($_POST['bl_ch'])) {$_POST['bl_ch'] = "";}
  if(empty($_GET['cicle_ch'])) {$_GET['cicle_ch'] = "";}
  if(empty($_GET['bibl_ch'])) {$_GET['bibl_ch'] = "";}
  if(empty($_GET['zhanr_ch'])) {$_GET['zhanr_ch'] = "";}
  if(empty($_GET['bibl_ch'])) {$_GET['bibl_ch'] = "";}
  if(empty($_GET['zal_ch'])) {$_GET['zal_ch'] = "";}
  if(empty($_GET['shkaf_ch'])) {$_GET['shkaf_ch'] = "";}
  if(empty($_GET['polka_ch'])) {$_GET['polka_ch'] = "";}
  if(empty($_GET['tip_izd_ch'])) {$_GET['tip_izd_ch'] = "";}
  if(empty($_GET['ser_ch'])) {$_GET['ser_ch'] = "";}
  if(empty($_GET['bl_ch'])) {$_GET['bl_ch'] = "";}
  if(empty($_POST['vozr_ch'])) {$_POST['vozr_ch'] = "";}
  if(empty($_GET['vozr_ch'])) {$_GET['vozr_ch'] = "";}

  if($_POST['spisano'] == "on") {$spisano = "AND tbl_film.vidano = '2' ";}
   else {$spisano = "";}

  if($_POST['zakupka'] == "on") {$zakupka = "AND tbl_film.vidano = '3' ";}
   else {$zakupka = "";}

  if($_POST['ser_ch'] == "on") {$ser = "AND tbl_film.ser_id = '".$_POST['ser_id']."' ";}
   else
     {
       if($_GET['ser_ch'] == "on") {$ser = "AND tbl_film.ser_id = '".$_GET['ser_id']."' ";}
       else {$ser = "";}
     }

  if($_POST['zhanr_ch'] == "on") {$zhanr = "AND tbl_film.zhanr_id = '".$_POST['zhanr_id']."' ";}
   else
     {
       if($_GET['zhanr_ch'] == "on") {$zhanr = "AND tbl_film.zhanr_id = '".$_GET['zhanr_id']."' ";}
       else {$zhanr = "";}
     }

  if($_POST['cicle_ch'] == "on") {$cicle = "AND tbl_film.cicle_id = '".$_POST['cicle_id']."' ";}
   else
     {
       if($_GET['cicle_ch'] == "on") {$cicle = "AND tbl_film.cicle_id = '".$_GET['cicle_id']."' ";}
       else {$cicle = "";}
     }

  if($_POST['tip_izd_ch'] == "on") {$tip_izd = "AND tbl_film.tip_izd_id = '".$_POST['tip_izd_id']."' ";}
   else
     {
       if($_GET['tip_izd_ch'] == "on") {$tip_izd = "AND tbl_film.tip_izd_id = '".$_GET['tip_izd_id']."' ";}
       else {$tip_izd = "";}
     }

  if($_POST['bibl_ch'] == "on") {$bibl = "AND tbl_film.bibl_id = '".$_POST['bibl_id']."' ";}
   else
     {
       if($_GET['bibl_ch'] == "on") {$bibl = "AND tbl_film.bibl_id = '".$_GET['bibl_id']."' ";}
       else {$bibl = "";}
     }

  if($_POST['zal_ch'] == "on") {$zal = "AND tbl_film.zal_id = '".$_POST['zal_id']."' ";}
   else
     {
       if($_GET['zal_ch'] == "on") {$zal = "AND tbl_film.zal_id = '".$_GET['zal_id']."' ";}
       else {$zal = "";}
     }

  if($_POST['shkaf_ch'] == "on") {$shkaf = "AND tbl_film.shkaf_id = '".$_POST['shkaf_id']."' ";}
   else
     {
       if($_GET['shkaf_ch'] == "on") {$shkaf = "AND tbl_film.shkaf_id = '".$_GET['shkaf_id']."' ";}
       else {$shkaf = "";}
     }

  if($_POST['polka_ch'] == "on") {$polka = "AND tbl_film.polka_id = '".$_POST['polka_id']."' ";}
   else
     {
       if($_GET['polka_ch'] == "on") {$polka = "AND tbl_film.polka_id = '".$_GET['polka_id']."' ";}
       else {$polka = "";}
     }

  if($_POST['bl_ch'] == "on") {$bl = "AND tbl_film.bl_id = '".$_POST['bl_id']."' ";}
   else
     {
       if($_GET['bl_ch'] == "on") {$bl = "AND tbl_film.bl_id = '".$_GET['bl_id']."' ";}
       else {$bl = "";}
     }

  if($_POST['vozr_ch'] == "on") {$vozr = "AND tbl_film.vozr_id = '".$_POST['vozr_id']."' ";}
   else
     {
       if($_GET['vozr_ch'] == "on") {$vozr = "AND tbl_film.vozr_id = '".$_GET['vozr_id']."' ";}
       else {$vozr = "";}
     }

if($_POST['izd_ch'] == "on")
{
$izdatelstvo = " AND tbl_s_film_izd.izd_id = '".$_POST['izd_id']."' ";
$query_iskh = "SELECT
tbl_s_film_izd.*,
tbl_film.*,
tbl_film.cicle_id AS cicl_film,
tbl_cicle.cicle
FROM tbl_s_film_izd
JOIN tbl_film ON tbl_s_film_izd.film_id=tbl_film.film_id
LEFT JOIN tbl_cicle ON tbl_film.cicle_id=tbl_cicle.cicle_id
WHERE $film_id $film_name $autors $vozr $opisanie $oglavlenie $data_izdaniya $data_postupleniya $ser $zhanr $cicle $tip_izd $bibl $zal $shkaf $polka $bl $izdatelstvo $spisano $zakupka
ORDER BY tbl_film.cicle_id, tbl_film.film_num, tbl_film.film_name";
}
else
{
$query_iskh = "SELECT 
tbl_film.*,
tbl_film.cicle_id AS cicl_film,
tbl_cicle.cicle
FROM tbl_film
LEFT JOIN tbl_cicle ON tbl_film.cicle_id=tbl_cicle.cicle_id
WHERE $film_id $univ_srch2 $film_name $autors $vozr $opisanie $oglavlenie $data_izdaniya $data_postupleniya $ser $zhanr $cicle $tip_izd $bibl $zal $shkaf $polka $bl $spisano $zakupka
ORDER BY tbl_film.cicle_id, tbl_film.film_num, tbl_film.film_name";
}
$result_iskh = mysqli_query($dbcnx,$query_iskh);
  if(!$result_iskh) {puterror2($result2['skin'],$TEXT['error-tbl26']); require_once "utils/bottom_film.php"; exit();}
    $res_rows = mysqli_num_rows($result_iskh);
     if($res_rows == 0) {puterror2($result2['skin'],$TEXT['search-err4']); require_once "utils/bottom_film.php"; exit();}
      elseif($res_rows == 1)
       {
        $result_iskh2 = mysqli_fetch_array($result_iskh);
        echo "<html><head><meta HTTP-EQUIV='Refresh' CONTENT='0; URL=film-info.php?film_id=".$result_iskh2['film_id']."' /></head></html>";
       }
      elseif($res_rows > 1) {echo "<table align='center' border='0' cellpadding='3' cellspacing='0' width='90%' ><tbody id='tab'>";}
       while($result_body_film = mysqli_fetch_array($result_iskh))
       {
        $result_body_film['film_name'] = rep_back($result_body_film['film_name']);

        if($result_body_film['cicle'] !== '---')
         {
         $query_film_cicle = mysqli_query($dbcnx,"SELECT COUNT(tbl_film.film_id) AS c_film_id FROM tbl_film WHERE tbl_film.cicle_id='".$result_body_film['cicl_film']."'");
	  $coun_film_cicle = mysqli_fetch_array($query_film_cicle);

          if($result_body_film['film_num'] == 0) {$film_num = "";}
           else
            {
            $bnt = substr($result_body_film['film_num'],0,1);
             if($bnt == '0')
             {
             $film_n = substr($result_body_film['film_num'],1,1);
              if($film_n == '0')
               {
               $film_num = ", ".$TEXT['film-num']." - ".substr($result_body_film['film_num'],2,3);
               } else {$film_num = ", ".$TEXT['film-num']." - ".substr($result_body_film['film_num'],1,3);}
             } else {$film_num = ", ".$TEXT['film-num']." - ".$result_body_film['film_num'];}
           }

           $film = "<a href='film-extsearch.php?cicle_id=".$result_body_film['cicl_film']."&cicle_ch=on' title='".$TEXT['search-all-cicl']."'>  (".$TEXT['film-cicle']." - ".$result_body_film['cicle'].", ".$TEXT['global-now-film']." - ".$coun_film_cicle['c_film_id'].$film_num.")</a>";

           $move_up = "<a href='film-up-down.php?cicle_id=".$result_body_film['cicl_film']."&amp;film_id=".$result_body_film['film_id']."&amp;position=".$result_body_film['film_num']."&amp;moving=up' title='".$TEXT['global-up-down-tit']."'>&uArr;</a>";
           $move_down = "<a href='film-up-down.php?cicle_id=".$result_body_film['cicl_film']."&amp;film_id=".$result_body_film['film_id']."&amp;position=".$result_body_film['film_num']."&amp;moving=down' title='".$TEXT['global-up-down-tit']."'>&dArr;</a>";

         if($result_body_film['vidano'] == '3') {$film_name = "<a href='film-info.php?film_id=".$result_body_film['film_id']."' title='".$TEXT['aut-viewtit']."'><span class='zagolovok_zak'>".$result_body_film['film_name']."</span></a>";}
         elseif($result_body_film['vidano'] == '2') {$film_name = "<a href='film-info.php?film_id=".$result_body_film['film_id']."' title='".$TEXT['aut-viewtit']."'><span class='zagolovok_sp'>".$result_body_film['film_name']."</span></a>";}
         elseif($result_body_film['vidano'] == '1') {$film_name = "<a href='film-info.php?film_id=".$result_body_film['film_id']."' title='".$TEXT['aut-viewtit']."'><span class='zagolovok_vid'>".$result_body_film['film_name']."</span></a>";}
         else {$film_name = "<a href='film-info.php?film_id=".$result_body_film['film_id']."' title='".$TEXT['aut-viewtit']."'><span class='zagolovok'>".$result_body_film['film_name']."</span></a>";}
         if($result_body_film['zakazano'] == '1') {$film_name = "<a href='film-info.php?film_id=".$result_body_film['film_id']."' title='".$TEXT['aut-viewtit']."'><span class='zagolovok_rez'>".$result_body_film['film_name']."</span></a>";}

         echo "<tr>";
         echo "<td align= 'right' width='50%'>".$film_name."</td>";
         if($coun_film_cicle['c_film_id'] > 0 && $result2['administrator'] == 1) {echo "<td align= 'left' width='50%'>".$film."&nbsp;".$move_up."&frasl;".$move_down."</td>";}
          else {echo "<td align= 'left' width='50%'>".$film."</td>";}
         echo "</tr>";
         }
          else
           {
            $film = "";

            if($result_body_film['vidano'] == '3') {$film_name = "<a href='film-info.php?film_id=".$result_body_film['film_id']."' title='".$TEXT['aut-viewtit']."'><span class='zagolovok_zak'>".$result_body_film['film_name']."</span></a>";}
            elseif($result_body_film['vidano'] == '2') {$film_name = "<a href='film-info.php?film_id=".$result_body_film['film_id']."' title='".$TEXT['aut-viewtit']."'><span class='zagolovok_sp'>".$result_body_film['film_name']."</span></a>";}
            elseif($result_body_film['vidano'] == '1') {$film_name = "<a href='film-info.php?film_id=".$result_body_film['film_id']."' title='".$TEXT['aut-viewtit']."'><span class='zagolovok_vid'>".$result_body_film['film_name']."</span></a>";}
            else {$film_name = "<a href='film-info.php?film_id=".$result_body_film['film_id']."' title='".$TEXT['aut-viewtit']."'><span class='zagolovok'>".$result_body_film['film_name']."</span></a>";}
            if($result_body_film['zakazano'] == '1') {$film_name = "<a href='film-info.php?film_id=".$result_body_film['film_id']."' title='".$TEXT['aut-viewtit']."'><span class='zagolovok_rez'>".$result_body_film['film_name']."</span></a>";}

            echo "<tr>";
            echo "<td colspan='2' align= 'center' width='50%'>".$film_name."</td>";
            echo "</tr>";
          }
        }
        echo "</table>";

  require_once "utils/bottom_film.php";
?>