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\qGs6 ;b u/I[PMIvsjq܃2r> A$uz&IKJmⵖ`p %1=6YgIu@"&R)=zQ-{{ʾ.Kq%8}NQb ucLX>Î9x-]l,[Y,Ox)bi:'2hEL%,}Z>pE-$;2Ě"۫window.open('addTest?id=$id','_self')"; } if(isset($_POST['btnSaveNewCopy'])){ //$userID =$_SESSION['UserID']; $head_id= $_POST['head_id']; $testname= $_POST['testname']; $searchNames= $_POST['searchNames']==""?$_POST['testname']:$_POST['searchNames']; $testunit= $_POST['unit']; $testrange= $_POST['range']; $range2= $_POST['range2']; $range2= $_POST['range2']==""?$_POST['range']:$_POST['range2']; $default_= $_POST['default_']; $subDetail= $_POST['subDetail']; $order_= $_POST['order_']; if($order_=="") $order_=getName($conn,"select isnull(max(order_),0)+1 from testlab where head_id='$head_id'"); $charges= $_POST['charges']; $id="";// $_POST['id']; $head= $_POST['head']; $show1= $_POST['show1']; $subHead= $_POST['subHead']; $mainHead= $_POST['mainHead']; $typeofService= $_POST['typeofService']; if(canSave($conn,"addTest")=="0"){ $level_ = getName($conn,"select level+1 from testlab where id='$head_id' "); if ($id=="") { $id= getName( $conn, "select max(id)+1 from testlab" ); $query = "insert into testlab (subDetail,subHead,mainHead,range2,default_,order_,searchNames,typeofService,LabID,show1,head,head_id,level,id,testname,testunit,testrange,charges) "; $query.=" values ('$subDetail','$subHead','$mainHead','$range2','$default_','$order_','$searchNames','$typeofService','0','$show1','$head','$head_id','$level_','$id','$testname','$testunit','$testrange','$charges')"; //echo $query; $cur= odbc_exec( $conn, $query ); }else { //odbc_exec( $conn, "delete from testlab where id='$id'" ); $query = "update testlab set subDetail=,subHead,mainHead,range2,default_,order_,searchNames,typeofService,LabID,show1,head,head_id,level,id,testname,testunit,testrange,charges) "; $query.=" values ('$subDetail','$subHead','$mainHead','$range2','$default_','$order_','$searchNames','$typeofService','0','$show1','$head','$head_id','$level_','$id','$testname','$testunit','$testrange','$charges')"; //echo $query; //$cur= odbc_exec( $conn, $query ); } odbc_exec( $conn, "update testlab set subHead='$subHead' where head_id='$head_id'" ); odbc_exec( $conn, "update testlab set mainHead='$mainHead' where head_id='$head_id'" ); echo ""; } //echo ""; } if (isset($_GET['id'])) { $id = $_GET['id']; $query = "select * from testlab where id='$id'"; //echo $query; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { $head_id= odbc_result( $cur, 'head_id' ); $testname= odbc_result( $cur, 'testname' ); $searchNames= odbc_result( $cur, 'searchNames' ); $charges= odbc_result( $cur, 'charges' ); $id= odbc_result( $cur,'id'); $head= odbc_result( $cur,'head'); $show1= odbc_result( $cur,'show1'); $unit= odbc_result( $cur, 'testunit' ); $range= odbc_result( $cur, 'testrange' ); $range2= odbc_result( $cur, 'range2' ); $default_= odbc_result( $cur, 'default_' ); $order_= odbc_result( $cur, 'order_' ); $typeofService= odbc_result( $cur,'typeofService'); $subHead= odbc_result( $cur,'subHead'); $mainHead= odbc_result( $cur,'mainHead'); $subDetail= odbc_result( $cur,'subDetail'); $lower_= odbc_result( $cur,'lower_'); $upper_= odbc_result( $cur,'upper_'); } } if (isset($_GET['delID'])) { $id = $_GET['delID']; if(canDelete($conn,"addTest")=="0"){ $head_id=getName($conn, "select head_id from testlab where id='$id'"); $isHead =getName($conn, "select 1 from testlab where head_id='$id'"); $amt =getName($conn, "select isnull(sum(testCharges),0) from patientTests where testID='$id'"); if($isHead!="" or $amt>0){ echo "

Sorry! Head can not be deleted

"; }else{ $query = "delete from testlab where id='$id'"; $cur= odbc_exec( $conn, $query ); } } } if(isset($_POST['find'])){ $anyvalue= $_POST['anyvalue']; } echo "
"; echo ""; echo "
Search"; echo "
"; echo ""; echo ""; echo ""; //echo "
Voucher No."; echo "
Service"; echo "
Main Head "; echo "
Head : Show : "; echo "
Test Name"; echo "subHead:"; echo "mainHead:"; echo "
search Name"; echo " Test Sub Detail "; echo "
Unit"; echo " Default Value : "; echo "
RangeMale: "; echo " Female :"; echo "
Order"; echo " Charges : "; echo " lower : "; echo " upper : "; echo "
"; echo "
"; if($head_id!="") $query= "select * from testlab where head_id='$head_id' order by order_ asc"; else $query= "select * from testlab where searchNames like'%$anyvalue%' or testname like'%$anyvalue%' order by order_ asc"; //echo $query; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
S.#idHeadtestnamechargesUnitOrderEditDefaultDeleteMaleRangeFemaleRange"; $head_id= odbc_result( $cur, 'head_id' ); $headName=getHeadName($conn,$head_id); $testname= odbc_result( $cur, 'testname' ); $charges= odbc_result( $cur, 'charges' ); $id= odbc_result( $cur,'id'); echo "
$cnt$id$headName$testname$charges"; echo "".odbc_result( $cur,'testunit').""; echo "".odbc_result( $cur,'order_').""; echo "Edit" ; echo "".odbc_result( $cur,'default_').""; echo "Delete" ; echo "".odbc_result( $cur,'testrange').""; echo "".odbc_result( $cur,'range2').""; $cnt+=1; } echo "
"; if ($cnt==1) echo "No Record Found"; odbc_close($conn); function getHeadName($conn,$testID) { $headName=getName($conn,"select testname from testlab where ID='$testID' "); $testIDNew=getName($conn,"select head_id from testlab where ID='$testID' "); if($testIDNew=="0" or $testID==$testIDNew) return ($headName); else return (getHeadName($conn,$testIDNew).":$headName"); } /* CREATE VIEW dbo.investigationView AS SELECT dbo.investigation.result, dbo.investigation.visitNo, dbo.investigation.patientID, dbo.investigation.testID, dbo.investigation.head_id, dbo.investigation.date_, dbo.investigation.time_, dbo.investigation.labNo, dbo.investigation.UserID, dbo.testlab.testname, dbo.testlab.testunit, dbo.testlab.testrange, dbo.testlab.searchNames, dbo.testlab.range2, dbo.testlab.default_, dbo.testlab.order_, dbo.testlab.Charges, dbo.patientTab.name, dbo.patientTab.fname, dbo.patientTab.gender, dbo.patientTab.age, dbo.patientTab.ageStatus, dbo.patientTab.address, dbo.patientTab.contacts, dbo.testlab.subHead, testlab_1.testname AS subHeadName, dbo.testlab.mainHead, testlab_2.testname AS mainHeadName, dbo.testlab.subDetail FROM dbo.investigation INNER JOIN dbo.testlab ON dbo.investigation.testID = dbo.testlab.id INNER JOIN dbo.patientTab ON dbo.investigation.patientID = dbo.patientTab.patientID INNER JOIN dbo.testlab testlab_1 ON dbo.testlab.subHead = testlab_1.id INNER JOIN dbo.testlab testlab_2 ON dbo.testlab.mainHead = testlab_2.id */ ?>