| Current Path : /var/www/html/mmishra/iws8/html/erp/ |
| Current File : /var/www/html/mmishra/iws8/html/erp/hc_medicalhistory.inc |
<?php
if ($user) {
mysql_select_db('icure', $con);
echo "<h3>Medical History</h3>
<table width='90%' border='1' style='border-collapse: collapse' bgcolor='white'>
<tr><th>Sr.</th><th>Patient Name</th><th>Registration Detail</th><th>Medication Detail</th><th>Dated</th></tr>";
$rs = mysql_query("select * from employees where email='$user@iiita.ac.in'");
if (mysql_num_rows($rs)) {
$o = mysql_fetch_object($rs);
$id= $o->emp_no;
} else {
$rs = mysql_query("select * from students where email='$user@iiita.ac.in'");
if (mysql_num_rows($rs)) {
$o = mysql_fetch_object($rs);
$id = $o->roll_no;
}
}
$sr = mysql_query("select * from registrations where pat_id='$id' order by reg_no desc");
if (mysql_num_rows($sr)) {
$i = 0;
while ($q = mysql_fetch_object($sr)) {
$i++;
echo "<tr valign='top'><th>$i</th>
<td>".($q->dependent != 'Dependent Name' ? 'Dependent: '.$q->dependent : 'Self')."</td>
<td nowrap>RegNo.: $q->reg_no<br>
For: ".doctor_detail($q->dr_id)."<br>By: ".staff_detail($q->login_id)."</td>
<td nowrap>".medications($q->reg_no)."</td>
<td nowrap>$q->reg_date $q->reg_time</td>
</tr>";
}
} else
echo "<tr><td colspan='3'>None</td></tr>";
echo "</table>";
}
?>