
PK 
<?php
session_start();
require_once 'common/common.php';
require_once 'common/secure.php';
include("connexion.php");
include("ps_pagination.php");
include "head.php";
?>
<table width="100%">
<tr><td colspan="2"><center><img src="banking.jpg" width="80%"></center></td></tr>
<tr><td colspan="2"><center><h2>Manage Invoices & Payments</h2></center></td></tr>
<tr><td><a href="payment.php">+ Recipt a Due Payments</a></td>
<td><a href="recpay.php">Recived/Pending Payments</a></td></tr>
<tr><td colspan="2"><font color="#006699"> Below are the due Invoices with their
details: </font></td></tr>
</table>
<table cellspacing="3" align="center" width="100%" border="4" cellpadding="3">
<tr>
<td><strong>Invoice</strong></td>
<td><strong>Cert. No.</strong></td>
<td><strong>Client Id</strong></td>
<td><strong>Date</strong></td>
<td><strong>Amount</strong></td>
<td><strong>Status</strong></td>
<td><strong>Pay</strong></td>
</tr>
<?php
include("connexion2.php");
$sql="SELECT * FROM invoices Where invstatus='pending' AND cmntz='2' and branch='$_SESSION[city]'";
//$sql="SELECT * From certificate";
$pager = new PS_Pagination($conn, $sql, 10, 15,"status=certificateno&");
$pager->setDebug(true);
echo $pager->renderFullNav();
$rs = $pager->paginate();
//---------- pagination---------------
//************for pagination code******************
$sql_count="SELECT count(certificateno) FROM certificate";
$result_count=mysql_query($sql_count);
$row_count=mysql_fetch_array($result_count);
$final_result=$row_count['count(certificateno)']/10;
$row_count_explode=explode(".",$final_result);
$page_limit=$row_count_explode[0];
for($i=1;$i<=$page_limit;$i++)
{
if($_GET['page']>$i)
{
$sno_count=$sno+10*($_GET['page']-1);
}
}
$sno=$sno_count;
//************for pagination code******************
//$sql="SELECT * FROM invoices Where invstatus='pending' AND cmntz='2' and branch='$_SESSION[city]'";
//$result=mysql_query($sql) or die('error');
if (mysql_num_rows($rs) == 0)
{
echo "<tr><td colspan=8 align=center><font color=red><strong><br>No Due Invoice records Found</strong>.</font><br><br></td></tr>";
}
while($row=mysql_fetch_array($rs))
{
echo"<tr>
<td>{$row['invid']}</td>
<td>{$row['certid']}</td>
<td>{$row['clnid']}</td>
<td>{$row['dtd']}</td>
<td>{$row['grandtotal']}</td>
<td>{$row['invstatus']}</td>
<td><a href='pay.php?act=paybybill&id=".$row['invid']."'>Pay</a></td>
</tr>";
}
?>
<tr>
<td colspan="7">
<br/>
<center>
<?php
echo "";
echo $pager->renderFirst();
echo $pager->renderPrev();
echo $pager->renderNav('<span>', '</span>');
echo $pager->renderNext();
echo $pager->renderLast();
?>
</center>
<br/>
</td>
</tr>
</table>
<br><br>
<p align="center"><font color="#006699"> Get the Statements for due Bills :- </font></p>
<table cellspacing="3" align="center" width="100%" border="4" cellpadding="3">
<tr>
<form action="statement.php" method="get">
<td align="center" colspan="4">
<center>Select a Client<i> > > </i>
<select name="clnt">
<option value="all">- - Show All Clients - -</option>
<?php
include("connexion.php");
$sql="SELECT * FROM head WHERE headid>2 order by headname";
$result=mysql_query($sql) or die ('errr');
while($row=mysql_fetch_array($result))
{
echo"<option value={$row['headid']}>{$row['headname']}-{$row['headid']}</option>";
} ?>
</select>
<input type="submit" value="» Get Statement »" class="amo-submit"></center></form>
</td>
<form action="statementagent.php" method="get">
<td align="center" colspan="4">
<select name="clnt">
<option value="all">- - Show All Agents - -</option>
<?php
include("connexion.php");
$sql="SELECT * FROM clients order by subname";
$result=mysql_query($sql) or die ('errr');
while($row=mysql_fetch_array($result))
{
$clntid="{$row['clntid']}";
echo"<option value={$row['subid']}>{$row['subname']} - {$row['subid']}</option>";
} ?>
</select>
<input type="submit" value="» Get Statement »" class="amo-submit"></center></form>
</td></tr>
<tr>
<td><strong>Invoice</strong></td>
<td><strong>Cert. No.</strong></td>
<td><strong>Client Id</strong></td>
<td><strong>Date</strong></td>
<td><strong>Amount</strong></td>
<td><strong>Status</strong></td>
<td><strong>Pay</strong></td>
</tr>
<?php
include("connexion2.php");
//$sql="SELECT * From certificate";
$sql2="SELECT * FROM invoices Where invstatus='pending' AND cmntz='1' and branch='$_SESSION[city]'";
$pager2 = new PS_Pagination($conn, $sql2, 10, 15,"status=certificateno&");
$pager2->setDebug(true);
echo $pager2->renderFullNav();
$rs2 = $pager2->paginate();
//$sql="SELECT * FROM invoices Where invstatus='pending' AND cmntz='1' and branch='$_SESSION[city]'";
//$result=mysql_query($sql) or die('error');
if (mysql_num_rows($rs2) == 0)
{
echo "<tr>
<td colspan=8 align=center><font color=red><strong><br>No Due Invoice records Found</strong>.</font><br><br></td></tr>";
}
while($row=mysql_fetch_array($rs2))
{
echo"<tr>
<td>{$row['invid']}</td>
<td>{$row['certid']}</td>
<td>{$row['clnid']}</td>
<td>{$row['dtd']}</td>
<td>{$row['grandtotal']}</td>
<td>{$row['invstatus']}</td>
<td><a href='pay.php?act=paybybill&id=".$row['invid']."'>Pay</a></td>
</tr>";
}
?>
<tr>
<td colspan="7">
<center><?php
echo "";
echo $pager2->renderFirst();
echo $pager2->renderPrev();
echo $pager2->renderNav('<span>', '</span>');
echo $pager2->renderNext();
echo $pager2->renderLast();
?></center>
</td>
</tr>
</table>
<p align="center"><a href="payments.php">View Payments</a></p>
<?php
include "foot.php";
?>


PK 99