. */ include("./include/include.php"); admin_header(); if( !in_array($_SESSION['sess_access'], array("localorg", "chair", "admin")) ) { echoln("You are not authorized to see this page."); }else { echoln("
"); } } if( !in_array($_SESSION['log_section'], $sections) ) $_SESSION['log_section']="all"; $query = "SELECT COUNT(`id`) AS `tot_rows` FROM `log`"; if( $_SESSION['log_section']!="all" ) $query .= " WHERE `section`='".addslashes($_SESSION['log_section'])."'"; if( @mysql_num_rows( $res=doquery($query) )!=1 ) { echoln("Failed selecting row count."); }else { $row = mysql_fetch_array($res); $tot_rows=$row["tot_rows"]; if( $tot_rows>MAXLIST ) { // There are more entries to show than fit on one page, split in pages $page_text = "Page"; for($i=0; $i<($tot_rows/MAXLIST); $i++) { if( $_REQUEST['start']==($i*MAXLIST) ) $page_text .= " ".($i+1).""; else $page_text .= " ".($i+1).""; } if( $_REQUEST['start']==-1 ) $page_text .= " all rows"; else $page_text.=" all rows"; echoln($page_text); echoln("
"); } if( $_REQUEST['start']==-1 ) { $sqllimit = ""; if( $tot_rows>0 ) echoln("Showing rows 1 - $tot_rows ($tot_rows total).
"); }else { $start = get_int('start'); if( $start<0 ) $start = 0; if( $start>$tot_rows ) $start = $tot_rows-MAXLIST; $sqllimit = "LIMIT $start, ".MAXLIST; if( $tot_rows>0 ) echoln("Showing rows ".($start+1)." - ".min( ($start+MAXLIST), $tot_rows )." ($tot_rows total).
"); } $query = "SELECT `id`, `date`, `section`, `message`, `type`, `sess_name` FROM `log`"; if( $_SESSION['log_section']!="all" ) $query .= " WHERE `section`='".addslashes($_SESSION['log_section'])."'"; $query .= " ORDER BY `date` DESC $sqllimit"; if( @mysql_num_rows( $res=doquery($query) )<1 ) { echoln("Empty selection."); }else { echoln("
| Date | "); echoln("Section | "); echoln("Message | "); echoln("Type | "); echoln("User | "); echoln("
|---|---|---|---|---|
| ".get_date($row['date'])." | "); echoln("".$row['section']." | "); echoln("".$row['message']." | "); echoln("".$row['type']." | "); echoln("".$row['sess_name']." | "); echoln("
Total: ".$tot_rows." log entries in current selection"); if( isset($page_text) ) echoln("
".$page_text); } } } admin_footer(); ?>