Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/icure/admin/
Upload File :
Current File : /var/www/html/mmishra/icure/admin/bhtest.inc

<h3 align='left'>Bed Head Test</h3>
<center>
<?php

$tbl = 'bhtests';
$bhtid = $_REQUEST["bhtid"];
$regno = $_REQUEST["regno"];
$bp = $_POST["bp"];
$puls = $_POST["puls"];
$temp = $_POST["temp"];

if ($_POST["submit"] == 'SAVE' && $regno) {
        
        if (mysql_num_rows(mysql_query("select * from $tbl where bht_id=$bhtid"))) {
                mysql_query("update $tbl set reg_no=$regno,bp='$bp',puls=$puls,temp=$temp,bht_datetime=now(),
                login_id='$user' where bht_id=$bhtid");
        } else {
                mysql_query("insert into $tbl(reg_no,bp,puls,temp,bht_datetime,login_id) 
                values($regno,'$bp',$puls,$temp,now(),'$user')");
        }
}                       
                        
if ($_GET["del"] == 1) {
//      mysql_query("delete from $tbl where reg_no=$regno");
}
                        

?>

Registration No. <input type='text' name='regno' value='<?php echo $regno; ?>' size='10'>
<input type='submit' name='submit' value='FIND'>
<br>

<?php

if ($regno && is_registration($regno)) {
        echo registration_detail($regno);

        if (is_admission($regno)) {
        	echo admission_detail($regno);
		
		echo "<table border='1' width='60%'>
        	<tr><th>Sr</th><th>BP</th><th>Puls</th><th>Temp</th><th>Date Time</th><td align='center'>Action</td></tr>";


        	if (!$bhtid) {
                	echo "<tr><td>+</td>
                	<td align='center'><input type='text' name='bp' value='0/0' size='10'></td>
                	<td align='center'><input type='text' name='puls' value='0' size='5'></td>
                	<td align='center'><input type='text' name='temp' value='0' size='5'></td>
                	<td align='center'>".date("Y-m-d H:i:s")."</td>
                	<td align='center'><input type='submit' name='submit' value='SAVE'></td></tr>";
        	} else {
                	echo "<tr><td colspan='6'><a href='?pg=$pg&regno=$regno&bhtid='>+</a></td></tr>";
        	}

        	$rs = mysql_query("select * from $tbl where reg_no=$regno order by bht_id");
        	while ($o = mysql_fetch_object($rs)) {
                	$i++;
                	if ($bhtid == $o->bht_id) {
                        	echo "<tr><td>$i <input type='hidden' name='bhtid' value='$o->bht_id'></td>
                        	<td align='center'><input type='text' name='bp' value='$o->bp' size='10'></td>
                        	<td align='center'><input type='text' name='puls' value='$o->puls' size='5'></td>
                        	<td align='center'><input type='text' name='temp' value='$o->temp' size='5'></td>
                        	<td align='center'>$o->bht_datetime</td>
                        	<td nowrap align='center'><input type='submit' name='submit' value='SAVE'> 
				<a href='?pg=$pg&regno=$regno&bhtid=$o->bht_id'>x</a></td></tr>";
                	} else {
                        	echo "<tr><td>$i</td>
                        	<td><a href='?pg=$pg&regno=$regno&bhtid=$o->bht_id'>$o->bp</a></td>
                        	<td align='center'>$o->puls</td>
                        	<td align='center'>$o->temp</td>
                        	<td align='center'>$o->bht_datetime</td>
                        	</tr>";
                	}
        	}
       	 	echo "</table>";
	} else
		echo "<font color='red'>Above patient has not been admitted so far.</font>";
}

?>
</center>