<?
include "connect.php";
if ($rstart == ''){$rstart=0;}
if ($pgptr == ''){$pgptr=1;}
$sizeLimit = 15;
$sqlQry = mysql_query("select * from deposit,customer,product where (deposit.custId=customer.custId) and (deposit.pCode=product.prodId) and (deposit.status='') order by (deposit.date) desc");
print mysql_error();
$numRows = mysql_num_rows($sqlQry);
$totalRows = mysql_num_rows($sqlQry);
$totalPages = intval($totalRows / $sizeLimit);
$excess = $totalRows % $sizeLimit;
if ($excess > 0){ $totalPages = $totalPages + 1; }
$i = 0;
if ($totalPages > 10){
$i = $i + ($pgptr - 1);
} else { $i = 0; }
$trstart = $rstart;
$pages = "";
if ($totalPages > 10){
if (($i != 0)) { $rstart = $rstart - $sizeLimit; $pages = $pages."<a href='deposit.php?pgptr=$i&rstart=$rstart'>[<< Previous]</a> "; }
}
if ($totalPages > 10) { $value = (10+($pgptr-1)); } else {$value = $totalPages;}
while ($i < $value){
$rstart = $sizeLimit * $i;
$i++;
if ($i == $pgptr){
$pages = $pages."<b>$i</b> ";
} else {
$pages = $pages."<a href='deposit.php?pgptr=$i&rstart=$rstart'>$i</a> ";
}
}
if ($totalPages > 10){
$i = $i + 1;
$rstart = $rstart + $sizeLimit;
$pages = $pages." <a href='deposit.php?pgptr=$i&rstart=$rstart'>[Next >>]</a>";
}
$rstart = $trstart;
$fRow = (($pgptr-1) * $sizeLimit) + 1;
$i = $fRow - 1;
$sqlQry = mysql_query("select * from deposit,customer,product where (deposit.custId=customer.custId) and (deposit.pCode=product.prodId) and (deposit.status='') order by (deposit.date) desc limit $rstart,$sizeLimit");
print mysql_error();
$numRows = mysql_num_rows($sqlQry);
if ($numRows >0){
while ($hRow = mysql_fetch_array($sqlQry)) {
$depId = $hRow["depId"];
$issueId = $hRow["issueId"];
$date = $hRow["date"];
$custName = $hRow["custName"];
$prodName = $hRow["productName"];
$qty = $hRow["dQty"];
$amount = $hRow["amt"];
$amtDep = $hRow["amtDep"];
$i++;
?>
<tr bgcolor=#E9E9E9 height=25>
<td align=center><a href="editDeposit.php?nav=2&issueId=<? print $issueId; ?>"><? print $issueId; ?></a></td>
<td align=center><? print $date; ?></td>
<td><? print $custName; ?></td>
<td><? print $prodName; ?></td>
<td align=right><? print $qty; ?> </td>
<td align=right><? print number_format($amount,2); ?> </td>
<td align=right><? print number_format($amtDep,2); ?> </td>
</tr>
<?
}
}
?>