"; echo" "; } function close_table(){ echo" "; echo""; } function postfix_read_db($query,$file) { $postfixdb = array(); $DB = postfix_opendb($file); if ($DB) { $response = $DB->query("{$query}"); if ($response != FALSE) { while ($row = $response->fetchArray()) $postfixdb[] = $row; } else print "Trying to read DB returned error: {$DB->lastErrorMsg()}"; $DB->close(); } return $postfixdb; } function postfix_opendb($file) { global $g,$postfix_dir,$postfix_arg; $stm = "select id from mail_status;"; if (file_exists($postfix_dir.$file)){ $DB = new SQLite3($postfix_dir.$file); if ($DB->exec("{$stm};")) return $DB; } } $pfb_table=array(); $img['Sick']=""; $img['Healthy']=""; #var_dump($pfb_table); #exit; ?>
$days; $z--){ if ($z==0) $postfix_db=date("Y-m-d"); else $postfix_db=date("Y-m-d",strtotime("$z day",$curr_time)); if (file_exists($postfix_dir.'/'.$postfix_db.".db")){ #noqueue if (@filesize($postfix_dir.'/'.$postfix_db.".db")< $size){ $stm="select count(*) as total from mail_noqueue"; $row_noqueue = postfix_read_db($stm,$postfix_db.".db"); //queue $stm="select mail_status.info as status,count(*) as total from mail_to,mail_status where mail_to.status=mail_status.id group by status order by mail_status.info"; $result = postfix_read_db($stm,$postfix_db.".db"); $reader=""; $count=""; $reject=0; foreach($result as $i => $row){ if (is_array($row)){ if (preg_match("/\w+/",$row['status'])){ $reader.="".ucfirst($row['status'])."\n"; if ($row['status']=="reject"){ $row['total']=+$row_noqueue[0]['total']; $reject++; } $count.="".number_format($row['total'],0,"",".")."\n"; } } } if(count($result) > 0){ open_table(); print "
$postfix_db
"; close_table(); open_table(); if ($reject==0){ $reader.="Reject\n"; $count.="".number_format($row_noqueue[0]['total'],0,"",".")."\n"; } print "".$reader.""; print "".$count.""; close_table(); echo "
"; } } else{ print "
File size is too large.
"; close_table(); echo "
"; } } } echo" "; echo"
"; ?>