Location: PHPKode > projects > Library Accounting System > library/movie_module/m_editing.php
<?php if($url_blocker != "75726C00"){Header("Location: ./"); exit;}?> 
<?
// format the records so they display properly when recalled, and make them xhtml valid and make them secure
include("functions.php");
	$medium= addslashes($_REQUEST['medium']);
	$title= process($_REQUEST['title']);
	$actors= process3($_REQUEST['actors']);
	$director= process3($_REQUEST['director']);
	$writer= process3($_REQUEST['writer']);
        $rating= addslashes($_REQUEST['rating']);
        if(count($_REQUEST['genre']) > 0){$genres= implode(' & ', $_REQUEST['genre']);}
	$prodcomp= process2($_REQUEST['prodcomp']);
	$studio= process($_REQUEST['studio']);
	$length= addslashes($_REQUEST['length']);
	$release= addslashes($_REQUEST['release']);
	$discnum= addslashes($_REQUEST['discnum']);
	if(count($_REQUEST['subtitles']) > 0){$subtitles = implode(' & ', $_REQUEST['subtitles']);}
	$format= process($_REQUEST['format']);
	$outline= process2($_REQUEST['outline']);
	$synopsis= process2($_REQUEST['synopsis']);
	$audio= process($_REQUEST['audio']);
	$encoding= process($_REQUEST['encoding']);
        $callnum= addslashes($_REQUEST['callnum']);


//Check to see if there is a need for a suffix (":(1)") on the end of the call number
// and if so, what number.
	$count = mysql_num_rows(mysql_query("SELECT `callnum` FROM `visual` WHERE callnum = '$callnum'"));
	  if ($count != 0){
//checks to see if there is already a suffix added
	    $count = mysql_num_rows(mysql_query("SELECT `callnum` FROM `visual` WHERE callnum LIKE '$callnum%'"));
	    If ($count != 0){
//ensures that if a new suffix is added it does not include the current record in its count
	     $count -= 1;
	      if ($count != 0){
	     $callnum .= ":($count)";
	     }
	    }
	 }

	mysql_query("UPDATE `visual` SET `medium`= '$medium',  `title`='$title',  `actors`='$actors',  `director`='$director',  `writer`='$writer', `rating`='$rating', `genre`='$genres', `prodcomp`='$prodcomp', `studio`='$studio', `length`='$length', `release`='$release', `discnum`='$discnum', `subtitles`='$subtitles', `format`='$format', `outline`='$outline', `synopsis`='$synopsis', `audio`='$audio', `encoding`='$encoding', `callnum`='$callnum' WHERE refurl = '$refurl' LIMIT 1") or die ('I cannot connect to the database because: ' . mysql_error());

mysql_query("UPDATE `id_list` SET `medium` = '$medium' WHERE refurl = '$refurl' LIMIT 1") or die ('I cannot connect to the database because: ' . mysql_error());
	include "./movie_module/m_edit.php";
?> 
Return current item: Library Accounting System