Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/icure/staff/
Upload File :
Current File : /var/www/html/mmishra/icure/staff/daily_receipts.inc

<h3 align='left'>Dated Receipts</h3>
<center>
<?php

$tbl = 'receipts';
$dated = $_REQUEST["dated"];

if (!$dated) $dated = date("Y-m-d");

$dated1 = date('Y-m-d', strtotime($dated .' -1 day'));
$dated2 = date('Y-m-d', strtotime($dated .' +1 day'));

echo "<a href='?pg=$pg&dated=$dated1'>&lt;&lt;</a> 
<font size='+1' color='red'>[ $dated ]</font>";

if ($dated != date("Y-m-d")) echo " <a href='?pg=$pg&dated=$dated2'>&gt;&gt;</a>";
echo "<br>";
$sql = "select med_name as medicine,b.batchNo,b.dateExpiry as expiry,b.qty_receipt as qty,rec_date as dated,a.login_id as staff from medicines as a,$tbl as b
where a.med_id=b.med_id and rec_date='$dated' order by med_name";

$rs = mysql_query($sql);
if (mysql_num_rows($rs)) {
        $colHeads = mysql_num_fields($rs);
        
        $str = "<table border='1' width='90%'><tr><th>Sr</th>";
        for ($i=0; $i < $colHeads; $i++) { // Header
                $str .= "<th>".ucwords(str_replace("_"," ",mysql_field_name($rs, $i)))."</th>";
        }
        $str .= "</tr>";
	$j = $pgno;                        
        while ($row = mysql_fetch_row($rs)) { //data
                $j++;
                $str .= "<tr><td>$j</td><td>".implode($row,'</td><td>')."</td></tr>";
        }
        $str .= "</table>";
} else {
        $str = "<b>Nothing.</b>";
}
echo $str;

?>
</center>