$pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 7, 'Server: ' . $hostname, 1, 1, 'C', 1); $pdf->SetTextColor(0, 0, 0); $pdf->AddCol('time', 55, 'Time ', 'C'); $pdf->AddCol('date', 55, 'Date ', 'C'); $pdf->AddCol('user', 55, '% User', 'C'); $pdf->AddCol('system', 57, '% System ', 'C'); $pdf->AddCol('idle', 55, '% Idle ', 'C'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT distinct dbuid,date(cpurep.date)as date,time(cpurep.date) as time,cpurep.user,cpurep.system,cpurep.idle from cpurep,configureddb WHERE cpurep.dbid=configureddb.dbuid and server='{$hostname}' and date(date) = '{$dt}' ORDER BY date(date) desc", $prop); $pdf->Ln(5); } else { $pdf->SetFont('Times', '', 20); $pdf->Ln(20); $pdf->Cell(0, 10, 'No Matching Records Found For Server ' . $hostname, 0, 1, 'C'); $pdf->Ln(20); } } } } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(30); $pdf->Cell(0, 10, 'No Matching Records Found For Any Database ', 0, 1, 'C'); $pdf->SetFont('Times', '', 20); } $pdf->stopPageNums(); $pdf->insertTOC(2); $pdf->AutoPrint(true); $pdf->Output(); }