| Current Path : /var/www/html/mmishra/icure/staff/ |
| Current File : /var/www/html/mmishra/icure/staff/phresult.inc.old |
<h3 align='left'>Pathology Result</h3>
<center>
<?php
$tbl = 'phreports';
$repid = $_REQUEST["repid"];
$regno = $_REQUEST["regno"];
$testgroup = $_REQUEST["testgroup"];
if (!$testgroup) $testgroup = 'Haemetology';
if ($_POST["submit"] == 'SAVE') {
$testid = $_POST["testid"];
$testresult = $_POST["testresult"];
$testdatetime = $_POST["testdatetime"];
if (mysql_num_rows(mysql_query("select * from $tbl where rep_id=$repid"))) {
mysql_query("update $tbl set reg_no=$regno,test_id=$testid,test_result='$testresult',
test_datetime='$testdatetime',date_updation=now(),login_id='$user' where rep_id=$repid");
} else {
mysql_query("insert into $tbl(reg_no,test_id,test_result,test_datetime,date_creation,date_updation,login_id)
values($regno,$testid,'$testresult',now(),now(),now(),'$user')");
}
}
if ($_GET["del"] == 1) {
mysql_query("delete from $tbl where rep_id=$repid");
}
?>
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) {
if (is_registration($regno)) {
echo registration_detail($regno);
//if (is_prescription($regno)) {
// echo prescription_detail($regno);
echo "Select group <b>";
foreach ($testgps as $tgp) {
echo "<input type='radio' name='testgroup' value='$tgp'";
if ($testgroup == $tgp) echo " checked";
echo " onclick=\"document.location.href='staff/?pg=$pg®no=$regno&testgroup='+this.value\"> $tgp";
}
echo "</b>
<table border='1' width='80%'>
<tr><th>Sr.</th><th>Test Name</th><th>Test Result</th><th>Date Time</th><td align='center'>Action</td></tr>";
if (!$repid) {
echo "<tr><td>+</td>
<td>".phtest_list($testgroup,0)."</td>
<td><input type='text' name='testresult' value='' size='25'></td>
<td><input type='text' name='testdatetime' value='".date("Y-m-d H:i:s")."' size='17'></td>
<td><input type='submit' name='submit' value='SAVE'></td></tr>";
} else {
echo "<tr><td colspan='4'><a href='staff/?pg=$pg®no=$regno&testgroup=$testgroup&repid='>+</a></td></tr>";
}
$rs = mysql_query("select * from $tbl where reg_no=$regno order by rep_id");
while ($o = mysql_fetch_object($rs)) {
$i++;
echo "<tr><td>$i</td>";
if ($repid == $o->rep_id) {
echo "<td><input type='hidden' name='repid' value='$o->rep_id'>
".phtest_list($testgroup,$o->test_id)."</td>
<td><input type='text' name='testresult' value='$o->test_result' size='25'></td>
<td><input type='text' name='testdatetime' value='$o->test_datetime' size='15'></td>
<td><input type='submit' name='submit' value='SAVE'>
<a href='staff/?pg=$pg®no=$regno&testgroup=$testgroup&repid=$o->rep_id'>-</a></td>";
} else {
$tgp = phtest_group($o->test_id);
echo "<td><a href='staff/?pg=$pg®no=$regno&testgroup=$tgp&repid=$o->rep_id'>$tgp</a></td>
<td>$o->test_result</td>
<td>$o->test_datetime</td>";
}
echo "</tr>";
}
echo "</table>
<a href='staff/?pg=phreport®no=$regno'>PRINT REPORT</a>";
//} else
// echo "No prescription";
} else
echo "No registration";
}
?>
</center>