Hi, I’m trying to print this doc with heading at top of each printed page,
page# at bottom of each page, thousands “,” at “totdue” and without the
filename on each page. any help? Thanks
Following is my current code
[CODE]<html><head>
<style>
@page { size 8.5in 11in; margin: 2cm }
div.page { page-break-after: always }
</style>
</head><body><center>
<div class=”page”>
<?php
error_reporting(0);
mysql_connect(‘localhost’,’root’,’xxxxx’);
mysql_select_db(‘homedb’) or die(“Unable to select database”);
$query=” SELECT * FROM oocust WHERE payrec = ‘R’ AND pd = ‘N’ ORDER BY datepaid ASC”;
$result=mysql_query($query);
$num=mysql_numrows($result);
echo date(‘m/d/y’);
echo “<font size=+1><b><center> Accounts Receivable Report</font></center></b></b><br />”;
?>
<table cellspacing=0 cellpadding=2 border=1>
<thead>
<tr>
<th colspan=4></th>
<th bgcolor=”#ccffff”>date</th>
<th bgcolor=”#ccffff”>days</th>
<th bgcolor=”#ccffff”>amt</th>
<tr>
<th bgcolor=”#ccffff”>recur?</th>
<th bgcolor=”#ccffff”>acct#</th>
<th bgcolor=”#ccffff”>creditor</th>
<th bgcolor=”#ccffff”>purpose</th>
<th bgcolor=”#ccffff”>due</th>
<th bgcolor=”#ccffff”>late</th>
<th bgcolor=”#ccffff”>due</th>
</tr>
<?php
while($row = mysql_fetch_array($result))
{
$totdue += $row[‘amtdue’];
echo ‘
<tr>
<td>’, $row[‘status’], ‘</td>
<td>’, $row[‘acctno’], ‘</td>
<td>’, $row[‘bname’], ‘</td>
<td>’, $row[‘purpose’], ‘</td>
<td>’, $row[‘duedate’], ‘</td>
<td align=right class=”currency”>’, ($late > 120 ? ‘pastdue’ : $row[‘dayslate’]), ‘</td>
<td align=right class=”currency”>$’.number_format($row[‘amtdue’],2).'</td> // ****perfect****
</tr>’;
}
echo ‘
<tr>
<th bgcolor=”#ccffff” scope=”row” colspan=”6″>Grand Total:</th>
// <td bgcolor=”#FFD4D4″ class=”currency”>$’, number_format($totdue, 2, ‘.’, ”), ‘</td>
<td align=right class=”currency”>$’. number_format(‘$totdue’,2).'</td> // no thousands “,” ***
</tr>
</table>’;
echo “Page 1″;
?>
</div>
<div class=”page”>
<?php
echo “Page 2”;
mysql_close();
?>
</body></html>