$pdf->Cell(0, 10, 'Database I/O Report', 1, 1, 'C', 1); $pdf->TOC_Entry('Database I/O Report', 0); $pdf->SetTextColor(0, 0, 0); while ($query_row = mysql_fetch_assoc($query)) { $dbuid = $query_row['dbuid']; $databaseName = $query_row['dbname']; $pdf->ln(1); $dioquery = mysql_query("SELECT time(date) as time,rupdates,rreads,rcreates,rdeletes,dbwrites,dbreads FROM databaseio WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'"); if (mysql_num_rows($dioquery)) { $pdf->TOC_Entry($databaseName, 1); $pdf->SetFont('Arial', 'B', 14); $pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 7, 'Database: ' . $databaseName, 1, 1, 'C', 1); $pdf->SetTextColor(0, 0, 0); $pdf->AddCol('time', 17, 'time', 'C'); $pdf->AddCol('dbwrites', 45, 'DB Writes'); $pdf->AddCol('dbreads', 45, 'DB Reads'); $pdf->AddCol('rreads', 45, 'Record Reads'); $pdf->AddCol('rcreates', 45, 'Record Creates'); $pdf->AddCol('rupdates', 40, 'Record Updates', 'C'); $pdf->AddCol('rdeletes', 40, 'Record Deletes'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT time(date) as time,rupdates,rreads,rcreates,rdeletes,dbwrites,dbreads FROM databaseio WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'", $prop); $pdf->Ln(5); } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(10); $pdf->Cell(0, 10, 'No Matching Records Found For Database ' . $databaseName, 0, 1, 'C'); } }
$pdf->Cell(0, 10, 'CPU Utilization', 1, 1, 'C', 1); $pdf->TOC_Entry('CPU Utilization', 0); $pdf->SetTextColor(0, 0, 0); $pdf->ln(1); if ($querycpu = mysql_query("SELECT distinct server FROM configureddb INNER JOIN dbalogin where dbalogin.username ='******' group by server")) { while ($query_rowcpu = mysql_fetch_assoc($querycpu)) { $hostname = $query_rowcpu['server']; $cpunumquery = mysql_query("SELECT distinct dbuid,date(cpurep.date)as date,time(cpurep.date) as time,cpurep.user,cpurep.system,cpurep.iowait,cpurep.idle from cpurep,configureddb WHERE cpurep.dbid=configureddb.dbuid and server='{$hostname}' and date(date) = '{$dt}' ORDER BY date desc"); if (mysql_num_rows($cpunumquery)) { $pdf->TOC_Entry($hostname, 1); $pdf->SetFont('Arial', 'B', 14); $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); } } }
$pdf->Cell(0, 10, 'Database Index Report', 1, 1, 'C', 1); $pdf->TOC_Entry('Database Index Report', 0); $pdf->SetTextColor(0, 0, 0); while ($query_row = mysql_fetch_assoc($query)) { $dbuid = $query_row['dbuid']; $databaseName = $query_row['dbname']; $pdf->ln(1); $connquery = mysql_query("SELECT date(date)as date,time(date)as time,idxstatid,createidx,blockdelete,deleteidx,readidx,idxstatname FROM idxstat WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'"); if (mysql_num_rows($connquery)) { $pdf->TOC_Entry($databaseName, 1); $pdf->SetFont('Arial', 'B', 14); $pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 7, 'Database: ' . $databaseName, 1, 1, 'C', 1); $pdf->SetTextColor(0, 0, 0); $pdf->AddCol('date', 27, 'Date', 'C'); $pdf->AddCol('time', 27, 'Time', 'C'); $pdf->AddCol('idxstatid', 20, 'Id', 'C'); $pdf->AddCol('idxstatname', 53, 'Index Name', 'C'); $pdf->AddCol('createidx', 40, 'Create'); $pdf->AddCol('blockdelete', 35, 'Block Delete'); $pdf->AddCol('deleteidx', 30, 'Delete'); $pdf->AddCol('readidx', 45, 'Read'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT date(date)as date,time(date)as time,idxstatid,createidx,blockdelete,deleteidx,readidx,idxstatname FROM idxstat WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'", $prop); $pdf->Ln(5); } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(10); $pdf->Cell(0, 10, 'No Matching Records Found For Database ' . $databaseName, 0, 1, 'C'); }
$pdf->TOC_Entry('Database User I/O', 0); $pdf->SetTextColor(0, 0, 0); $pdf->ln(1); while ($query_row = mysql_fetch_assoc($query)) { $dbuid = $query_row['dbuid']; $databaseName = $query_row['dbname']; $pdf->ln(1); $connquery = mysql_query("SELECT date(date)as date, time(date)as time,name,dbaccess,dbreads,dbwrites FROM userio WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'"); if (mysql_num_rows($connquery)) { $pdf->TOC_Entry($databaseName, 1); $pdf->SetFont('Arial', 'B', 14); $pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 7, 'Database: ' . $databaseName, 1, 1, 'C', 1); $pdf->SetTextColor(0, 0, 0); $pdf->AddCol('time', 25, 'Time', 'C'); $pdf->AddCol('date', 27, 'Date', 'C'); $pdf->AddCol('name', 60, 'Name', 'C'); $pdf->AddCol('dbaccess', 55, 'DB Access'); $pdf->AddCol('dbreads', 55, 'DB Reads'); $pdf->AddCol('dbwrites', 55, 'DB writes'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT date(date)as date, time(date)as time,name,dbaccess,dbreads,dbwrites FROM userio WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'", $prop); $pdf->Ln(5); } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(10); $pdf->Cell(0, 10, 'No Matching Records Found For Database ' . $databaseName, 0, 1, 'C'); } } }
$pdf->Cell(0, 10, 'Database Table I/O', 1, 1, 'C', 1); $pdf->TOC_Entry('Database Table I/O', 0); $pdf->SetTextColor(0, 0, 0); while ($query_row = mysql_fetch_assoc($query)) { $dbuid = $query_row['dbuid']; $databaseName = $query_row['dbname']; $pdf->ln(1); $connquery = mysql_query("SELECT time(date)as time,date(date) as date,tableioid,createtio,deletetio,readtio,tablename,updatetio FROM tableio WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'"); if (mysql_num_rows($connquery)) { $pdf->TOC_Entry($databaseName, 1); $pdf->SetFont('Arial', 'B', 14); $pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 7, 'Database: ' . $databaseName, 1, 1, 'C', 1); $pdf->SetTextColor(0, 0, 0); $pdf->AddCol('time', 30, 'TIME', 'C'); $pdf->AddCol('date', 30, 'DATE', 'C'); $pdf->AddCol('tableioid', 25, 'ID', 'C'); $pdf->AddCol('tablename', 45, 'TABLE NAME', 'C'); $pdf->AddCol('createtio', 45, 'CREATE'); $pdf->AddCol('deletetio', 35, 'DELETE'); $pdf->AddCol('readtio', 37, 'READ'); $pdf->AddCol('updatetio', 30, 'UPDATE'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT time(date)as time,date(date) as date,tableioid,createtio,deletetio,readtio,tablename,updatetio FROM tableio WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'", $prop); $pdf->Ln(5); } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(10); $pdf->Cell(0, 10, 'No Matching Records Found For Database ' . $databaseName, 0, 1, 'C'); }
$pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 10, 'Monitored database', 1, 1, 'C', 1); $pdf->TOC_Entry('Monitored Database', 0); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Times', '', 14); $pdf->Cell(0, 10, 'Database Name:- ' . $databaseName, 0, 1, 'L'); $pdf->Ln(10); $pdf->SetFont('Times', 'B', 20); $pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 10, 'Alerts Summary', 1, 1, 'C', 1); $pdf->TOC_Entry('Alerts Summary', 0); $pdf->SetTextColor(0, 0, 0); $pdf->ln(1); $pdf->AddCol('date', 35, 'Date', 'C'); $pdf->AddCol('time', 35, 'Time', 'C'); $pdf->AddCol('alerttype', 37, 'Type', 'C'); $pdf->AddCol('alertdisc', 170, 'Description'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("select date(alerts.date) as date,time(alerts.date) as time, alertdesc.alertdisc , alertdesc.alerttype from alerts inner join alertdesc where alerts.desc_id = alertdesc.desc_id and alerts.dbid='{$currentdb}' and date(alerts.date)>DATE_SUB(NOW(), INTERVAL 1 MONTH)", $prop); $pdf->stopPageNums(); $pdf->insertTOC(2); } else { $pdf->SetFont('Times', '', 26); $pdf->AddPage(); $pdf->Ln(60); $pdf->Cell(0, 10, 'No Matching Records Found For Selected Database ' . $databaseName, 0, 1, 'C'); $pdf->SetFont('Times', '', 20); $pdf->Cell(0, 10, 'Please Select Another Database ', 0, 1, 'C'); }
$pdf->Cell(0, 10, 'Disk Utilization', 1, 1, 'C', 1); $pdf->TOC_Entry('Disk Utilization', 0); $pdf->SetTextColor(0, 0, 0); $pdf->ln(1); if ($querydisk = mysql_query("SELECT distinct server FROM configureddb INNER JOIN dbalogin where dbalogin.username ='******' group by server")) { while ($query_rowdisk = mysql_fetch_assoc($querydisk)) { $hostname = $query_rowdisk['server']; $disknumquery = mysql_query("SELECT distinct date(diskrep.date)as date,time(diskrep.date) as time,diskrep.totalsize,diskrep.usedsize,diskrep.freesize from diskrep , configureddb WHERE diskrep.dbid=configureddb.dbuid and server='{$hostname}' and date(date) = '{$dt}' ORDER BY date desc"); if (mysql_num_rows($disknumquery)) { $pdf->TOC_Entry($hostname, 1); $pdf->SetFont('Arial', '', 14); $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', 25, 'Time ', 'C'); $pdf->AddCol('date', 25, 'Date ', 'C'); $pdf->AddCol('totalsize', 60, 'Total Size (in KB)', 'C'); $pdf->AddCol('usedsize', 57, 'Used Size (in KB)', 'C'); $pdf->AddCol('freesize', 60, 'Free Size (in KB)', 'C'); $pdf->AddCol('mounted', 50, 'Mount Name', 'C'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT distinct date(diskrep.date)as date,time(diskrep.date) as time,mounted,diskrep.totalsize,diskrep.usedsize,diskrep.freesize from diskrep ,configureddb WHERE diskrep.dbid=configureddb.dbuid and server='{$hostname}' and date(date) = '{$dt}' ORDER BY date desc", $prop); $pdf->Ln(5); } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(20); $pdf->Cell(0, 10, 'No Matching Records Found For Server ' . $hostname, 0, 1, 'C'); $pdf->Ln(20); } }
$pdf->Cell(0, 10, 'Database Name:- ' . $databaseName, 0, 1, 'L'); } if ($query = mysql_query("SELECT dbuid,dbuser,dbpass,server,port,dbname FROM configureddb INNER JOIN dbalogin where dbalogin.username ='******'")) { while ($query_row = mysql_fetch_assoc($query)) { $username = $query_row['dbuser']; $password = $query_row['dbpass']; $hostname = $query_row['server']; $portnumber = $query_row['port']; $databaseName = $query_row['dbname']; $dbuid = $query_row['dbuid']; $num = mysql_query("select date(alerts.date) as date,time(alerts.date) as time, alertdesc.alertdisc , alertdesc.alerttype from alerts inner join alertdesc where alerts.desc_id = alertdesc.desc_id and alerts.dbid='{$dbuid}'"); if (mysql_num_rows($num)) { $pdf->SetFont('Arial', 'B', 15); $pdf->Ln(10); $pdf->Cell(0, 10, 'Alerts Generated', 1, 1, 'C'); $pdf->TOC_Entry('Alerts Generated', 0); $pdf->ln(1); $pdf->SetFont('Arial', '', 15); $pdf->Cell(0, 10, 'Database Name:- ' . $databaseName, 0, 1, 'L'); $pdf->AddCol('date', 35, 'DATE', 'C'); $pdf->AddCol('time', 35, 'TIME', 'C'); $pdf->AddCol('alerttype', 37, 'TYPE', 'C'); $pdf->AddCol('alertdisc', 170, 'DISCRIPTION'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("select date(alerts.date) as date,time(alerts.date) as time, alertdesc.alertdisc , alertdesc.alerttype from alerts inner join alertdesc where alerts.desc_id = alertdesc.desc_id and alerts.dbid='{$dbuid}'", $prop); } } $pdf->stopPageNums(); $pdf->insertTOC(2); $pdf->Output(); }
$pdf->TOC_Entry('Database Long Running Transaction', 0); $pdf->SetTextColor(0, 0, 0); while ($query_row = mysql_fetch_assoc($query)) { $dbuid = $query_row['dbuid']; $databaseName = $query_row['dbname']; $pdf->SetFont('Arial', 'B', 15); $pdf->ln(5); $ltsquery = mysql_query("SELECT time(date) as time,date(date)as date,usrno,user,pid,transno,timerunning FROM longtrans WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'"); if (mysql_num_rows($ltsquery)) { $pdf->TOC_Entry($databaseName, 1); $pdf->SetFont('Arial', 'B', 14); $pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 7, 'Database: ' . $databaseName, 1, 1, 'C', 1); $pdf->SetTextColor(0, 0, 0); $pdf->AddCol('time', 33, 'Time', 'C'); $pdf->AddCol('date', 34, 'Date', 'C'); $pdf->AddCol('usrno', 40, 'User No', 'C'); $pdf->AddCol('user', 45, 'User', 'C'); $pdf->AddCol('pid', 35, 'Pid'); $pdf->AddCol('transno', 50, 'Transaction No'); $pdf->AddCol('timerunning', 40, 'Time Running(sec)'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT time(date) as time,date(date)as date,usrno,user,pid,transno,timerunning FROM longtrans WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'", $prop); } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(10); $pdf->Cell(0, 10, 'No Matching Records Found For Database ' . $databaseName, 0, 1, 'C'); } } }
if (mysql_num_rows($areastatquery)) { $pdf->TOC_Entry('Database Area Growth Report', 0); $pdf->Ln(10); if ($query = mysql_query("SELECT dbuid,dbname FROM configureddb INNER JOIN dbalogin where dbalogin.username ='******'")) { while ($query_row = mysql_fetch_assoc($query)) { $dbuid = $query_row['dbuid']; $databaseName = $query_row['dbname']; $areanumquery = mysql_query("SELECT date(date) as date,time(date) as time, areaname, totalalloc ,(hiwater/totalalloc*100) as percen FROM areagrowth WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'"); if (mysql_num_rows($areanumquery)) { $pdf->TOC_Entry($databaseName, 1); $pdf->SetFont('Arial', 'B', 14); $pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 7, 'Database: ' . $databaseName, 1, 1, 'C', 1); $pdf->SetTextColor(0, 0, 0); $pdf->AddCol('time', 35, 'Time'); $pdf->AddCol('date', 35, 'Date'); $pdf->AddCol('areaname', 90, 'Area name'); $pdf->AddCol('totalalloc', 67, 'Total Size (in Bytes)'); $pdf->AddCol('percen', 50, 'Used(%)'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT date(date) as date,time(date) as time, areaname, totalalloc ,(hiwater/totalalloc*100) as percen FROM areagrowth WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'", $prop); $pdf->Ln(5); } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(10); $pdf->Cell(0, 10, 'No Matching Records Found For Database ' . $databaseName, 0, 1, 'C'); } } } } else {
$pdf->TOC_Entry('Database Connection Summary', 0); $pdf->SetTextColor(0, 0, 0); $pdf->ln(1); while ($query_row = mysql_fetch_assoc($query)) { $dbuid = $query_row['dbuid']; $databaseName = $query_row['dbname']; $pdf->ln(1); $connquery = mysql_query("SELECT time(date) as time, date(date)as date,user,utype,mip,connsince,pid,userno from connect WHERE dbid ='{$dbuid}' and date(date) = '{$dt}'"); if (mysql_num_rows($connquery)) { $pdf->TOC_Entry($databaseName, 1); $pdf->SetFont('Arial', 'B', 14); $pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 7, 'Database: ' . $databaseName, 1, 1, 'C', 1); $pdf->SetTextColor(0, 0, 0); $pdf->AddCol('time', 25, 'Time', 'C'); $pdf->AddCol('date', 27, 'Date', 'C'); $pdf->AddCol('user', 45, 'User', 'C'); $pdf->AddCol('utype', 20, 'Type'); $pdf->AddCol('mip', 40, 'Device'); $pdf->AddCol('connsince', 55, 'Connected Since'); $pdf->AddCol('pid', 30, 'PID'); $pdf->AddCol('userno', 35, 'User No'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT time(date) as time, date(date)as date,user,utype,mip,connsince,pid,userno from connect WHERE dbid ='{$dbuid}' and date(date) = '{$dt}' ORDER BY date desc", $prop); $pdf->Ln(5); } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(10); $pdf->Cell(0, 10, 'No Matching Records Found For Database ' . $databaseName, 0, 1, 'C'); }
$pdf->Cell(0, 10, 'Memory Utilization', 1, 1, 'C', 1); $pdf->TOC_Entry('Memory Utilization', 0); $pdf->SetTextColor(0, 0, 0); $pdf->ln(1); if ($querycpu = mysql_query("SELECT distinct server FROM configureddb INNER JOIN dbalogin where dbalogin.username ='******' group by server")) { while ($query_rowcpu = mysql_fetch_assoc($querycpu)) { $hostname = $query_rowcpu['server']; $memnumquery = mysql_query("SELECT distinct dbuid,time(memrep.date) as time,date(memrep.date)as date,memrep.totalmem,memrep.usedmem,memrep.freemem,memrep.totalswap,memrep.usedswap,memrep.freeswap from memrep,configureddb WHERE memrep.dbid=configureddb.dbuid and server='{$hostname}' and date(date) = '{$dt}' ORDER BY date desc"); if (mysql_num_rows($memnumquery)) { $pdf->TOC_Entry($hostname, 1); $pdf->SetFont('Arial', 'B', 14); $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', 35, 'Time ', 'C'); $pdf->AddCol('date', 35, 'Date ', 'C'); $pdf->AddCol('totalmem', 60, 'Total Memory (in KB)', 'C'); $pdf->AddCol('freemem', 45, 'Free Memory (in KB)', 'C'); $pdf->AddCol('totalswap', 60, 'Total Swap (in KB)', 'C'); $pdf->AddCol('freeswap', 42, 'Free Swap (in KB)', 'C'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT distinct dbuid,time(memrep.date) as time,date(memrep.date)as date,memrep.totalmem,memrep.freemem,memrep.totalswap,memrep.freeswap from memrep,configureddb WHERE memrep.dbid=configureddb.dbuid and server='{$hostname}' and date(date) = '{$dt}' ORDER BY date desc", $prop); $pdf->Ln(5); } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(20); $pdf->Cell(0, 10, 'No Matching Records Found For Server ' . $hostname, 0, 1, 'C'); $pdf->Ln(20); } }
$pdf->SetTextColor(0, 0, 0); while ($query_row = mysql_fetch_assoc($query)) { $dbuid = $query_row['dbuid']; $databaseName = $query_row['dbname']; $pdf->SetFont('Arial', 'B', 15); $pdf->Ln(10); $pdf->ln(1); $biquery = mysql_query("SELECT time(B.date) as time,date(B.date) as date,B.bisize as bisize, (B.bisize - A.bisize) AS growth,B.clustersize as clustersize , B.commits as commits FROM bireport A CROSS JOIN bireport B WHERE B.date IN (SELECT MIN(C.date) FROM bireport C WHERE C.date > A.date) and date(B.date) = '{$dt}' ORDER BY B.date ASC "); if (mysql_num_rows($biquery)) { $pdf->TOC_Entry($databaseName, 1); $pdf->SetFont('Arial', 'B', 14); $pdf->setFillColor(63, 139, 202); $pdf->SetTextColor(253, 253, 253); $pdf->Cell(0, 7, 'Database: ' . $databaseName, 1, 1, 'C', 1); $pdf->SetTextColor(0, 0, 0); $pdf->AddCol('time', 26, 'Time', 'C'); $pdf->AddCol('date', 27, 'Date', 'C'); $pdf->AddCol('bisize', 64, 'BI Size (in KB)'); $pdf->AddCol('growth', 50, 'Growth (in KB)'); $pdf->AddCol('clustersize', 55, 'Cluster Size (in KB)'); $pdf->AddCol('commits', 55, 'Commits'); $prop = array('HeaderColor' => array(66, 139, 202), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255)); $pdf->Table("SELECT time(B.date) as time,date(B.date) as date,B.bisize as bisize, (B.bisize - A.bisize) AS growth,B.clustersize as clustersize , B.commits as commits FROM bireport A CROSS JOIN bireport B WHERE B.date IN (SELECT MIN(C.date) FROM bireport C WHERE C.date > A.date AND C.dbid ='{$dbuid}') AND A.dbid ='{$dbuid}' AND B.dbid ='{$dbuid}' and date(B.date) = '{$dt}' ORDER BY B.date ASC ", $prop); } else { $pdf->SetFont('Times', '', 26); $pdf->Ln(10); $pdf->Cell(0, 10, 'No Matching Records Found For Database ' . $databaseName, 0, 1, 'C'); } } } } else {