session_start(); global $scode; $linkID = mysql_connect("localhost", "root", "zangtang"); mysql_select_db("SciPark"); function findexts ($filename) { $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } //------------------------------------------------------------------------------------------------------------------------------------ // VERIFY FORM FUNCTION //--------------------------------------------------------------------------------------------------------------------------------------- function VerifyForm(&$values, &$errors) { if (htmlentities($values['BranchName']) == "Select") $errors['BranchName'] = "Branch Name Required"; if (htmlentities($values['SubCatName']) == "Select") $errors['SubCatName'] = "Theme/Topic Required"; if(htmlentities($values['SubCatName']) == "00") { if(strlen($values['SubCatOther'])== 0) $errors['SubCatOther'] = "Theme/Topic Required"; } $CatOther = htmlentities($values['SubCatOther']); $query1 = "SELECT * FROM `ExhbtCountMaster` where SubCatName='$CatOther'"; echo $query1; $result1 = mysql_db_query("SciPark", $query1) or die ("could not query" . mysql_error()); $tung1=mysql_affected_rows(); if($tung1 != 0) $errors['SubCatOther'] = "The entered Sub-Category already listed in the drop down menu of Theme"; if(strlen($values['ExhbtEName'])== 0) $errors['ExhbtEName'] = "Exhibit Name Required"; // if(strlen($values['ExhbtMName'])== 0) $errors['ExhbtMName'] = "Exhibit Name Required"; if(strlen($values['ExhbtEPrincipal'])== 0) $errors['ExhbtEPrincipal'] = "Exhibit Principal Required"; // if(strlen($values['ExhbtMPrincipal'])== 0) $errors['ExhbtMPrincipal'] = "Exhibit Principal Required"; // if(strlen($values['ExhbtScientist'])== 0) $errors['ExhbtScientist'] = "Inventor/Researcher's Name Required"; if(strlen($values['ExhbtEDescription'])== 0) $errors['ExhbtEDescription'] = "Exhibit Description Required"; // if(strlen($values['ExhbtMDescription'])== 0) $errors['ExhbtMDescription'] = "Exhibit Description Required"; if(strlen($values['ExhbtCount'])== 0 || !is_Numeric($values['ExhbtCount'])) $errors['ExhbtCount'] = "Numeric value in Exhibit Count Required"; if(strlen($values['ExhbtWCount'])== 0 || !is_Numeric($values['ExhbtWCount'])) $errors['ExhbtWCount'] = "Numeric value in Exhibit Working Count Required"; if (htmlentities($values['Vendor_Name']) == "Select") $errors['Vendor_Name'] = "Vendor Name Required"; if(htmlentities($values['Vendor_Name']) == "V001") { if(strlen($values['VendorArtist'])== 0) $errors['VendorArtist'] = "Artist Name Required"; } if(strlen($values['ExhbtPopularity'])== 0) $errors['ExhbtPopularity'] = "Exhibit Popularity Required"; if(strlen($values['WebVisible'])== 0) $errors['WebVisible'] = "Web Visibility Yes/No Required"; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FILE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ print_r($errors); return (count($errors) == 0); } //--------------------------------------------------------------------------------------------------------------------------------------- // DISPLAY FORM FUNCTION //--------------------------------------------------------------------------------------------------------------------------------------- function outputOptionList($list, $selected) { foreach ($list as $item) echo "\n"; } function DisplayForm($values, $errors) { // $chars = "abcdefghijkmnopqrstuvwxyz023456789"; $i=0; $d=date(d); $m=date(F); $n=date(n); $y=date(Y); $OptionTypes = array( array('Value' => 'Select', 'Text' => "(select Type)"), array('Value' => 'E', 'Text' => "Exhibit"), array('Value' => 'T', 'Text' => "Teaching Aid"), array('Value' => 'K', 'Text' => "Kits"), array('Value' => 'D', 'Text' => "Demo Experiements"), array('Value' => 'O', 'Text' => "Other"), ); ?>