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/prescriptions.inc

<?php

$tbl = 'prescriptions';
$regno = $_REQUEST["regno"];

?>

<h3 align='left'>Prescriptions</h3>
<center>
Registration No. <input type='text' name='regno' value='<?php echo $regno; ?>' size='10'>
<input type='submit' name='submit' value='FIND'>
<br><br>

<?php
if ($regno) {
	$sql = "select concat(med_type,' ',med_name,' ',specification) as medicine,dose,course_days from $tbl where reg_no=$regno order by pres_id";
	$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>