$page_security = 'SA_GLANALYTIC'; // ---------------------------------------------------------------- // $ Revision: 2.0 $ // Creator: Joe Hunt // date_: 2005-05-19 // Title: Audit Trail // ---------------------------------------------------------------- $path_to_root = ".."; include_once $path_to_root . "/includes/session.inc"; include_once $path_to_root . "/includes/date_functions.inc"; include_once $path_to_root . "/includes/data_checks.inc"; include_once $path_to_root . "/gl/includes/gl_db.inc"; include_once $path_to_root . "/includes/ui/ui_view.inc"; //---------------------------------------------------------------------------------------------------- print_audit_trail(); function getTransactions($from, $to, $type, $user) { $fromdate = date2sql($from) . " 00:00:00"; $todate = date2sql($to) . " 23:59.59"; $sql = "SELECT a.*, \n\t\tSUM(IF(ISNULL(g.amount), NULL, IF(g.amount > 0, g.amount, 0))) AS amount,\n\t\tu.user_id,\n\t\tUNIX_TIMESTAMP(a.stamp) as unix_stamp\n\t\tFROM " . TB_PREF . "audit_trail AS a JOIN " . TB_PREF . "users AS u\n\t\tLEFT JOIN " . TB_PREF . "gl_trans AS g ON (g.type_no=a.trans_no\n\t\t\tAND g.type=a.type)\n\t\tWHERE a.user = u.id "; if ($type != -1) { $sql .= "AND a.type={$type} "; } if ($user != -1) { $sql .= "AND a.user='******' "; } $sql .= "AND a.stamp >= '{$fromdate}'\n\t\t\tAND a.stamp <= '{$todate}'\n\t\tGROUP BY a.trans_no,a.gl_seq,a.stamp\t\n\t\tORDER BY a.stamp,a.gl_seq"; return db_query($sql, "No transactions were returned"); } //----------------------------------------------------------------------------------------------------
# Copy by reference, so don't call parse_xml_file again print_deleted_bugs($bug_table); draw_page_bottom(); break; # DISPLAY AUDIT TRAIL. IN: $id # DISPLAY AUDIT TRAIL. IN: $id case "audit": $id = $_GET["id"]; if (!$id) { die("Fatal: No issue id specified for audit record!"); } # Alias xml data array by reference for speed, so do NOT call parse_xml again parse_xml_file(CT_XML_BUGS_FILE, CT_KEEP_HISTORY); $data_array =& $xml_array_g; draw_page_top($page); print_audit_trail($data_array, "{$id}"); # Force string promotion on id draw_page_bottom(); break; # VIEW AN ISSUE. IN: $id # VIEW AN ISSUE. IN: $id case "viewissue": $id = $_GET["id"]; if ($id) { draw_page_top($page); draw_view_bug_page("{$id}"); draw_page_bottom(); break; } else { die("<center><br /><br /><h2>Fatal: No issue ID specified to view!"); }