| Current Path : /var/www/html/mmishra/icure/admin/ |
| Current File : /var/www/html/mmishra/icure/admin/registrations.inc |
<h3 align='left'>Registration Status</h3>
<center>
<?php
$tbl = 'registrations';
$pgno = $_REQUEST["pgno"];
if (!$pgno) $pgno = 0;
$pgsz = 30;
$dated = $_REQUEST["dated"];
$regno = $_REQUEST["regno"];
$patid = $_REQUEST["patid"];
$sql = "select reg_date,count(reg_no) as no from $tbl group by reg_date order by reg_no desc limit $pgno,$pgsz";
$rs = mysql_query($sql);
echo "<table border='1' width='90%'>
<tr valign='top'><td width='30%'>";
while ($o = mysql_fetch_object($rs)) { //data
if ($dated == $o->reg_date) {
echo "<font color='red' size=+1>- $dated ($o->no)</font>";
$sr = mysql_query("select reg_no,pat_id,dependent from $tbl where reg_date='$dated' order by reg_no desc");
echo "<dir>";
while ($q = mysql_fetch_object($sr)) { //data
if ($regno == $q->reg_no)
echo "<font color='red' size=+1>- $q->reg_no ($q->pat_id)</font>";
else
echo "+ <a href='?pg=$pg&dated=$dated®no=$q->reg_no&pgno=$pgno'>$q->reg_no</a> ($q->pat_id)";
echo "<br>";
}
echo "</dir>";
} else {
echo "+ <a href='?pg=$pg&dated=$o->reg_date&pgno=$pgno'>$o->reg_date</a> ($o->no)";
}
echo "<br>";
}
echo "</td><td>";
if ($regno) {
$heads = array('Registrations','Medications');
echo "<h3 align='center'>Treatment Record of Registration No.- $regno</h3>";
$sqls = array("select reg_no,concat(reg_date,' ',reg_time) as dated,concat(dr_name,' (',specialization,')') as doctor,a.login_id as staff from registrations a, doctors b where a.dr_id=b.dr_id and reg_no=$regno",
"select med_name,qty,a.login_id as staff from medications as a, medicines as b where a.med_id=b.med_id and reg_no=$regno");
echo patient_name($regno);
//echo registration_detail($regno);
$no = 0;
foreach ($sqls as $sql) {
echo "<p align='left'><b>".$heads[$no]."</b></p>";
$no++;
echo list_tabledata($sql);
}
}
echo "</td></tr></table>";
if ($pgno) {
$pgno = $pgno - $pgsz;
echo "[ <a href='?pg=$pg&pgno=$pgno'>Previous</a> ] ";
$pgno = $pgno + $pgsz;
}
if ($j % $pgsz == 0) {
$pgno = $pgno + $pgsz;
echo " [ <a href='?pg=$pg&pgno=$pgno'>Next</a> ]";
}
?>
</center>