<?php
  ///////////////////////////////////////////////////
  //Добавление издательств
  //Карпухин Павел
  //2010 (C)
  ///////////////////////////////////////////////////

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

  $title = $TEXT['menu-btn22-film'];

  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();}
  if(empty($_POST['film_id'])) {puterror($result2['skin'],$TEXT['error-film5']); require_once "../utils/bottom_adm_film.php"; exit();}
  if(strlen($_POST['film_id'])>255) {puterror($result2['skin'],$TEXT['error-film6']); require_once "../utils/bottom_adm_film.php"; exit();}
  $_POST['film_id'] = rep($_POST['film_id']);
  $film_id = $_POST['film_id'];

//function disabled by php > 5.5.3
////import_request_variables("gP", "in_");
// before using only ->  while(list($id,$value) = each($in_izdatelstvo))

  while(list($id2,$value2) = each($_POST))
   {
    if($id2 == "izdatelstvo")
    {
     while(list($id,$value) = each($value2))
      {
       if($id > 0 && $value == 'on')
       {
       //echo $id."".$value."<br />"; //.. некие действия
       $query = "INSERT INTO tbl_s_film_izd (`s_film_izd` , `izd_id` , `film_id`) VALUES ( NULL , '$id' , '$film_id')";
        $result = mysqli_query($dbcnx,$query);
         if (!$result) {puterror($result2['skin'],$TEXT['error-tbl15']); require_once "../utils/bottom_adm_film.php"; exit();}
     }
   }
  }
 }
    echo "<html><head><meta HTTP-EQUIV='Refresh' CONTENT='0; URL=index.php' /></head></html>";
   require_once "../utils/bottom_adm_film.php";
?>