Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/irp/icure/doctor/
Upload File :
Current File : /var/www/html/mmishra/irp/icure/doctor/admissions.inc

<?php

$tbl = 'admissions';
$regno = $_REQUEST["regno"];
$admdatetime = $_POST["admdatetime"];

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

?>

<h3>IPD Admissions</h3>
<center>
Registration No. <input type='text' name='regno' value='<?php echo $regno; ?>' size='10'>
or Dated <input type='text' name='admdatetime' value='<?php echo $admdatetime; ?>' size='10'>
<input type='submit' name='submit' value='FIND'>
<br><br>

<?php  

$sql = "select reg_no,diagnosis,adm_datetime as Admission_Date_Time,dis_datetime as Discharge_Date_time,login_id as staff from $tbl";
if ($regno) {
	$sql .= " where reg_no=$regno";
} else if ($regdatetime) {
	$sql .= " where adm_datetime like '$admdatetime%' order by reg_no desc";
}
$rs = mysql_query($sql);

if (mysql_num_rows($rs)) {
        $colHeads = mysql_num_fields($rs);

        echo "<table border='1' width='90%' align='center'>
	<tr><th>No.</th>";
        for ($i=0; $i < $colHeads; $i++) { // Header
                $fld = ucwords(str_replace("_"," ",mysql_field_name($rs, $i)));
                echo "<th>$fld</th>";
        }
        echo "</tr>";
        while ($row = mysql_fetch_row($rs)) { //data
                $j++;
                echo "<tr><td>$j</td><td>".implode($row,'</td><td>')."</td></tr>";
        }
        echo "</table>";
} else {
        echo "Sorry! record does not exist.";
}

?>

</center>