\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "

Redirecting to login page...

\n"; echo "\n"; echo "\n"; } # Set default configuration $gate_dbname = 'gateDB'; $gate_bgcolor = 'white'; # Include a local config file, if one exists if (file_exists("local_conf.php")) include ("local_conf.php"); $gate_conn = pg_connect ("dbname=$gate_dbname user=alice"); ?> \n"; echo "\n"; echo "gateDB: $title\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
$title
\n"; echo "
\n"; echo "
\n"; echo "

Navigation

\n"; echo "

Inventory

\n"; echo "

New Item

\n"; echo "
\n"; echo "
\n"; echo "

Your initials are:

\n"; echo "

".$_SESSION['person']."

\n"; echo "

Change

\n"; echo "

 

\n"; if ($gate_dbname != 'gateDB') { echo "

Current DB:

\n"; echo "

$gate_dbname

\n"; } echo "
\n"; echo "
\n"; } function gate_footer() { pg_close(); echo "\n"; echo "\n"; } function gate_redirect_page($url) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "

Redirecting to $url...

\n"; echo "\n"; echo "\n"; } function gate_error_page($title, $message) { gate_header($title); echo "
\n"; echo "
$message
\n"; echo "
\n"; gate_footer(); } function hrefname($name) { if ( preg_match("/^F\d*_T.._V\d*_N(\d*)$/", $name, $matches) ) { return ''.$name.''; } else if ( preg_match("/^\d[AB]_(\d*)$/", $name, $matches) ) { return ''.$name.''; } else if ( preg_match("/^(L\dC\d)_(\d*)$/", $name, $matches) ) { return ''.$name.''; } else if ( preg_match("/^DCS(\d*)$/", $name, $matches) ) { return ''.$name.''; } else if ( preg_match("/^ORI_V\d*_N(\d*)$/", $name, $matches) ) { return ''.$name.''; } else if ( preg_match("/^SM_(.*)$/", $name, $matches) ) { $res = pg_query ("SELECT id FROM inventory WHERE name='$name'"); $row = pg_fetch_assoc($res); return ''.$name.''; } else { return $name; } } function itemurl($name) { if ( preg_match("/^F\d*_T.._V\d*_N(\d*)$/", $name, $matches) ) { return "rob.php?id=".$matches[1]; } else if ( preg_match("/^\d[AB]_(\d*)$/", $name, $matches) ) { return "rob.php?id=".$matches[1]; } else if ( preg_match("/^(L\dC\d)_(\d*)$/", $name, $matches) ) { return "roc.php?name=".$name; } else if ( preg_match("/^DCS(\d*)$/", $name, $matches) ) { return "dcs.php?id=".$matches[1]; } else if ( preg_match("/^ORI_V\d*_N(\d*)$/", $name, $matches) ) { return "ori.php?id=".$matches[1]; } else if ( preg_match("/^SM_(.*)$/", $name, $matches) ) { $res = pg_query ("SELECT id FROM inventory WHERE name='$name'"); $row = pg_fetch_assoc($res); return "sm.php?id=".$row['id']; } else { return $name; } } function gate_check_confirmation($pagename,$message) { if ($_REQUEST["confirm"] != 'GoForIt') { echo $message; echo "
\n"; foreach ($_REQUEST as $request_key => $request_value) { echo " \n"; } echo " \n"; echo " \n"; echo "
\n"; exit; } } function gate_show_result($res) { echo ''; echo ''; for ($i = 0; $i < pg_num_fields($res); $i++) { echo ''; } echo ''; $oe=0; while ($row = pg_fetch_assoc($res)) { echo ''; #echo ''; for ($i = 0; $i < pg_num_fields($res); $i++) { echo ''; } echo ''; } echo '
 '.pg_field_name ($res, $i).' 
 '.$row[pg_field_name ($res, $i)].' 
'; } function gate_show_comments($type, $where_clause) { global $gate_dbname; $res = pg_query ("SELECT title,body,person,". " date_trunc('second', timestamp) AS time,". " attachment0,attachment1,attachment2,". " attachment3,attachment4 ". "FROM ".$type."_comment ". "WHERE ".$where_clause." ". "ORDER BY timestamp DESC;"); while ($row = pg_fetch_assoc($res)) { echo "

".$row['title']."

\n"; echo "By: ".$row['person']."\n"; echo " (".$row['time'].")\n"; echo "

".$row['body']."

\n"; echo "

Attachments:\n"; for ($i=0; $i<5; $i++) { if (isset($row["attachment$i"])) { $res_file = pg_query("SELECT * FROM file WHERE file_id=". $row["attachment$i"]); while ($filerow = pg_fetch_assoc($res_file)) { echo "".$filerow['name']."\n"; } } } echo "

\n"; } } ?> \n"; # echo "
View Inventory
\n"; # echo "
Enter new item
\n"; #} ?>