Please Confirm...\n"; if ($_REQUEST['item_type'] == 'rob') { $message .= "
You are about to insert: ROB #".$_REQUEST['serial']; $message .= ", type ".$_REQUEST['type']."
\n"; } else if ($_REQUEST['item_type'] == 'roc') { $message .= "
You are about to insert: ROC "; $message .= $_REQUEST['type']."_".$_REQUEST['serial']; } else if ($_REQUEST['item_type'] == 'dcs') { $message .= "
You are about to insert: DCS Board #".$_REQUEST['serial']; $message .= "
\n"; } else if ($_REQUEST['item_type'] == 'ori') { $message .= "
You are about to insert: ORI_V".$_REQUEST['version']. "_N".$_REQUEST['serial']; $message .= "
\n"; }else if ($_REQUEST['item_type'] == 'loc') { $message .= "
You are about to insert a new location:".$_REQUEST['name']; $message .= "
\n"; } gate_check_confirmation("insert.php",$message); ?>

Insertion of new item

Insertion failed
"; } else { echo "Successfully entered F".$_REQUEST["form"]. "_T".$_REQUEST["type"]. "_V".$_REQUEST["ver"]. "_N".$_REQUEST["serial"]. " into database. Current location is ". $_REQUEST["loc"]."\n"; } } else if ($_REQUEST["item_type"] == 'roc') { $query = "INSERT INTO roc(roc_type,roc_serial,loc_id,person) VALUES ". "('".$_REQUEST["type"]."',".$_REQUEST["serial"].",". "(SELECT loc_id FROM loc WHERE name='".$_REQUEST["loc"]."'),'". $_SESSION["person"]."');"; $result = pg_query ($query); if ( ! $result ) echo "
Insertion failed
"; else echo "Successfully entered " .$_REQUEST["type"]."_".$_REQUEST["serial"]. " into database. Current location is ". $_REQUEST["loc"]."\n"; } else if ($_REQUEST["item_type"] == 'dcs') { $query = "INSERT INTO dcs(dcs_id,type,loc_id,person) VALUES ". "(".$_REQUEST["serial"].",'".$_REQUEST["type"]."',". "(SELECT loc_id FROM loc WHERE name='".$_REQUEST["loc"]."'),'". $_SESSION["person"]."');"; $result = pg_query ($query); if ( ! $result ) echo "
Insertion failed
"; else echo "Successfully entered DCS Board #".$_REQUEST["serial"]. " into database. Current location is ". $_REQUEST["loc"]."\n"; } else if ($_REQUEST["item_type"] == 'ori') { $query = "INSERT INTO ori(ori_id,version,loc_id,person) VALUES ". "(".$_REQUEST["serial"].",'".$_REQUEST["version"]."',". "(SELECT loc_id FROM loc WHERE name='".$_REQUEST["loc"]."'),'". $_SESSION["person"]."');"; $result = pg_query ($query); if ( ! $result ) echo "
Insertion failed
"; else echo "Successfully entered ". hrefname("ORI_V".$_REQUEST["version"]."_N".$_REQUEST["serial"]). "into database. Current location is ". $_REQUEST["loc"]."\n"; } else if ($_REQUEST["item_type"] == 'loc') { $query = "INSERT INTO loc(name,description) VALUES ". "('".$_REQUEST["name"]."','".$_REQUEST["desc"]."');"; $result = pg_query ($query); if ( ! $result ) echo "
Insertion failed
"; else echo "

Successfully entered location '". $_REQUEST["name"]."' into database.

\n"; } else { echo '
Insertion of unknown item type '. $_REQUEST["item_type"].' failed!
'; require('gate_footer.php'); exit(1); } ?>