Quote:
<?php
error_reporting(E_ALL);
include('class.ezpdf.php');
// $pdf =& new Cezpdf();
$pdf =& new Cezpdf('A4','Landscape');
$pdf->selectFont('./fonts/Helvetica');
$pdf->setEncryption('','rc',array('print'));
$page=$pdf->ezStartPageNumbers(560,85,8,'','',1);
$pdf->addText(60,550,10,'Issues : ');
$pdf->addText(100,550,10,$issue);
//--------------------------------------------------
$host = ' localhost';
$user = 'root';
$password = ' ';
$database = 'e-account2';
$query = "select usr_cc, call_name, rec_time, rec_date, call_no, company, issue, comments from comments WHERE issue='$issue' ORDER BY rec_date";
//--------------------------------------------------
// open the connection to the db server
$link = mysql_connect($host,$user,$password);
// change to the right database
mysql_select_db($database);
// initialize the array
$data = array();
// do the SQL query
$result = mysql_query($query);
$noRows = mysql_num_rows($result);
// step through the result set, populating the array, note that this could also have been written:
// while($data[] = mysql_fetch_assoc($result)) {}
while($data[] = mysql_fetch_array($result, MYSQL_ASSOC)) {}
// make the table
$pdf->ezColumnsStart(array('num'=>2,'gap'=>10));
// $pdf->ezTable($data);
$pdf->ezTable($data,array('usr_cc'=>'Agent','rec_date'=>'Date','rec_time'=>'Time','call_name'=>'Caller Name','call_no'=>'Phone','company'=>'Company','comments'=>'Comments'),'Report based on Issues',
array('xPos'=>430,'xOrientation'=>'center','width'=>750));
// do the output, this standard testing output code, adding ?d=1
// to the url puts the pdf code to the screen in raw form, good for checking
// for parse errors before try to generate the pdf file.
if (isset($d) && $d){
$pdfcode = $pdf->output(1);
$pdfcode = str_replace("\n","\n<br>",htmlspecialchars($pdfcode));
echo '<html><body>';
echo trim($pdfcode);
echo '</body></html>';
} else {
$pdf->stream();
}
?>
:( :confused: :confused: