
PK 
<?php
include".././includes/dbconnect.php";
?>
<head>
<style type="text/css">
.printo {
font-style: normal;
color: #000000;
letter-spacing: 0;
display: block;
padding-top: 1px;
font-size: 80%;
border:thin;
}
.hr{
border: solid; border-width: thin;
border-color:#000000;
}
</style>
</style>
</head><body onLoad="window.print(); window.close();">
<br><br>
<h2 align="center">Invoice Report</h2>
<table align="center" width="95%" border=2px cellpadding="0px" cellspacing="0px" bordercolor="black">
<tr>
<th>Date</th>
<th>Invoice No.</th>
<th>Party Name</th>
<th>Amount</th>
<th>Certificate No.</th>
<th>Status</th>
</tr>
<?php
$sql="SELECT * FROM invoices";// WHERE dtd>='$_GET[st_date]' && dtd<='$_GET[en_date]'";
$result=mysql_query($sql) or die('error in fetch');
while($row=mysql_fetch_array($result)){
//print($row['invid']);
$sdt_ar=explode("/", $_GET[st_date]);
$edt_ar=explode("/", $_GET[en_date]);
$sdt=strtotime($sdt_ar[2]."-".$sdt_ar[1]."-".$sdt_ar[0]);
$edt=strtotime($edt_ar[2]."-".$edt_ar[1]."-".$edt_ar[0]);
$sdt_ar1=explode("/", $row[dtd]);
$edt_ar1=explode("/", $row[dtd]);
$sdt1=strtotime($sdt_ar1[2]."-".$sdt_ar1[1]."-".$sdt_ar1[0]);
$edt1=strtotime($edt_ar1[2]."-".$edt_ar1[1]."-".$edt_ar1[0]);
//echo "$sdt = ".time(). "<br>";
if($sdt <= $sdt1 && $edt >= $edt1){
?>
<tr>
<td><?php print($row['dtd']); ?></td>
<td><?php print($row['invid']); ?></td>
<td>
<?php
if($row['ajtid']=="")
{
$exp1 = explode(',',$row['clnid']);
$ln1 = count($exp1);
for($i=1; $i<$ln1; $i++)
{
if($i==1)
{
echo "<strong>".$exp1[$i]."</strong><br />";
}
else
{
echo $exp1[$i]."<br />";
}
}
}
else
{
$exp1 = explode(',',$row['ajtid']);
$ln1 = count($exp1);
for($i=1; $i<$ln1; $i++)
{
if($i==1)
{
echo "<strong>".$exp1[$i]."</strong><br />";
}
else
{
echo $exp1[$i]."<br />";
}
}
}
?>
</td>
<td>
<?php print($row['grandtotal']); ?>
</td>
<td><?php print($row['certid']); ?></td>
<td align="center"><?php echo ($row['cancel']?"Cancelled":" "); ?></td>
</tr>
<?php
}
}
?>
</table>
</body>


PK 99