CCIT Service Catalog

common = $commonDir; $COMMON->dateFormat = "m/d/Y"; $COMMON->timeFormat = "g:ia"; $COMMON->dateTimeFormat = "m/d/Y g:ia "; $COMMON->dateFormatMysql = "Y-m-d"; $COMMON->timeFormatMysql = "H:i:s"; $COMMON->dateTimeFormatMysql = "Y-m-d H:i:s"; $COMMON->now = date($COMMON->dateTimeFormatMysql); $COMMON->globalUser = strtolower(getenv("REMOTE_USER")); $serverName = getenv("SERVER_NAME"); ?>common."db/$which.php"; //echo "

database file path = ".$COMMON->common."db/$which.php"; $COMMON->DB = $db; //echo "

database name = ".$COMMON->DB = $db; $COMMON->DBcon = mysql_connect(base64_decode($host), base64_decode($user), base64_decode($pwd)); q_select_db($db); } function q_select_db($db) { global $COMMON; mysql_select_db($db, $COMMON->DBcon); } function q_kill() { mysql_close(); } function q_query($query, $switch='', $debug=FALSE, $lastInsert=FALSE) { global $COMMON; if ($debug || $COMMON->debug) echo "
" . htmlspecialchars($query) . "
"; if ($COMMON->debugQuiet) echo "\n"; $COMMON->query = mysql_query($query,$COMMON->DBcon); $COMMON->lastInsert = mysql_insert_id($COMMON->DBcon); if($lastInsert) return $COMMON->lastInsert; return $COMMON->query; } function q_db_query($db, $query, $switch='', $debug=FALSE, $lastInsert=FALSE) { global $COMMON; if ($debug || $COMMON->debug) echo "
" . htmlspecialchars($query) . "
"; if ($COMMON->debugQuiet) echo "\n"; $COMMON->query = mysql_db_query($db,$query,$COMMON->DBcon); $COMMON->lastInsert = mysql_insert_id($COMMON->DBcon); if($lastInsert) return $COMMON->lastInsert; return $COMMON->query; } function q_result($query, $row) { return mysql_result($query, $row); } function q_fetch_array($query) { return mysql_fetch_array($query); } function q_fetch_assoc($query) { return mysql_fetch_assoc($query); } function q_fetch_row($query) { return mysql_fetch_row($query); } function q_fetch_object($query) { return mysql_fetch_object($query); } function q_num_rows($query) { return mysql_num_rows($query); } function q_affected_rows() { global $COMMON; return mysql_affected_rows($COMMON->DBcon); } function q_insert_id() { global $COMMON; return mysql_insert_id($COMMON->DBcon); } function q_free_result($query) { mysql_free_result($query); } function q_num_fields($query) { return mysql_num_fields($query); } function q_field_name($query, $fieldno) { return mysql_field_name($query, $fieldno); } function q_data_seek($query, $row) { if (q_num_rows($query)) { return mysql_data_seek($query, $row); } } function q_error() { return mysql_error(); } function q_errno() { return mysql_errno(); } ?>