コード例 #1
0
ファイル: reportsmonth.php プロジェクト: JKT-OSSCLUB/ProActio
             $ch1 = "";
             while ($querycpu_row = mysql_fetch_assoc($querycpu)) {
                 $date = $querycpu_row['date'];
                 $used = $querycpu_row['used'];
                 if ($chd != "") {
                     $chd = $chd . "," . $used;
                 } else {
                     $chd = $chd . $used;
                 }
                 if ($ch1 != "") {
                     $ch1 = $ch1 . "|" . $date;
                 } else {
                     $ch1 = $ch1 . $date;
                 }
             }
             $pdf->Cell(40, 40, $pdf->Image("http://chart.googleapis.com/chart?cht=lc&chd=t:{$chd}&chs=1000x300&chl={$ch1}&chco=FF0000&chxt=x,y", $pdf->GetX(), $pdf->GetY(), 280, 100, 'PNG'), 0, 0, 'L', false);
             $pdf->Ln(100);
             $pdf->SetFont('Times', '', 11);
             $pdf->Cell(0, 10, 'Server: ' . $hostname, 0, 1, 'C');
             $pdf->AddPage();
         }
     }
 }
 if ($query = mysql_query("SELECT  distinct server FROM configureddb INNER JOIN dbalogin where  dbalogin.username ='******' group by server")) {
     $pdf->Cell(0, 10, 'CPU wait time', 0, 1, 'L');
     $pdf->TOC_Entry('CPU wait time', 2);
     while ($query_row = mysql_fetch_assoc($query)) {
         $hostname = $query_row['server'];
         $cpuquery = mysql_query("select distinct  date(cpurep.date)as date, max(cpurep.iowait) as used from cpurep,configureddb WHERE cpurep.dbid=configureddb.dbuid and server='{$hostname}' and date(date)>date(date_sub(now(), interval 1 month)) group by date(cpurep.date)order by date(cpurep.date) desc limit 31");
         if (mysql_num_rows($cpuquery)) {
             $pdf->TOC_Entry($hostname, 3);