Location: PHPKode > projects > Library Accounting System > library/movie_module/m_adding.php
<?php if($url_blocker != "75726C00"){Header("Location: ./"); exit;}?> 

<?
$config = mysql_fetch_array(mysql_query("SELECT option1 FROM config WHERE config = 'images'"));

include "functions.php";
$refurl = func_generate_string();

	
// format the options so they display properly when recalled, and make them xhtml valid
	$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']);
	// use this to get the image url
	$doing= process2($_REQUEST['doing']);

//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 LIKE '$callnum%'"));
	If ($count != 0){
	$callnum = preg_replace('/:\(.*\)/','', $callnum);
	$callnum .= ":($count)";
}


if($_REQUEST['image'] == 1 && $config['option1'] == 1){
$image_url = addslashes($doing);
$image = addslashes(file_get_contents("$image_url"));
    if (strlen ($image) > 1051){
    mysql_query("INSERT INTO `images` (`refurl`,`type`, `content` ) VALUES ('$refurl', 'image/jpg', '$image')") or die(mysql_error());
}
}

//Insert main record
mysql_query("INSERT INTO `visual` (`refurl`, `medium`, `title`, `actors`, `director`, `writer`, `rating`, `genre`, `prodcomp`, `studio`, `length`, `release`, `discnum`, `subtitles`, `format`, `outline`, `synopsis`, `audio`, `encoding`, `callnum`, `status`) VALUES ('$refurl', '$medium', '$title', '$actors', '$director', '$writer', '$rating', '$genres', '$prodcomp', '$studio', '$length', '$release', '$discnum', '$subtitles', '$format', '$outline', '$synopsis', '$audio', '$encoding', '$callnum', '1')") or die(mysql_error());
	
mysql_query("INSERT INTO `id_list` (`medium` , `refurl`) VALUES ('$medium', '$refurl')") or die(mysql_error());
Print("<span class=\"forText\">$title added.</span>");

// show add.php again with all the inserted values.

include "./movie_module/m_add.php";

 ?> 

Return current item: Library Accounting System