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F1GEwdu f0{O [dow})P.[p>MV5>>&G PTxi(4'p+B@!R;#PeE!jB [ i!u h}22Bu!S4P{ZF\*[ZJz?^O_~K/+)G9*U^ =[6V΍WR^yR&ḨKx`?۶4A`r)/L/E[KGM[59Vӏ#/0[?Of\="EUVYq(czh){8 q,"~'X6?{5=6Θ0c HӉ˺Y. G~뗼m_+U{x#4:ކ3 Z/A]0yE-/BY(Yi^a!:3ށ z*1!NsE;CC3ؕoU.N +, VIe~RRFkEozSpK W6+Zԥ.(֢VG[x[Jz 6Ll}`3z26J[$Ƴh1/A= YhیA}Z@rgX 3sgK>X,:%F.WfnJҺJS~eE@/ Cxax({j ^[/胰C58:5WkO_SX/_y6@/ΏR* ϣ7H@kא5WCqӄ^kk` A,|Ksk7'gf+αҿ`m~t,R5..kC } if($cnt!=1) echo "Total$totalAmt" ; echo ""; }elseif(isset($_REQUEST['OPD'])){ $query= "select patientID,opdCharges,doa,userID from patientVisits where doa between '$from' and '$to' and labid='".$_SESSION['labid']."' order by time_ asc"; //echo $query; $cur= odbc_exec( $conn, $query ); $cnt=1;$total=0; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
#DateNameAmountUser"; echo "
".$cnt; echo "".date('d.m.Y',strtotime(odbc_result($cur,'doa'))); echo "".getName($conn,"select name from patientTab where patientID=".odbc_result($cur,'patientID') ); echo "".odbc_result($cur,'opdCharges'); echo "".getName($conn,"select stdName from student where ID=".odbc_result($cur,'userID') ); //echo "
$cnt$description".odbc_result($cur,'cases')."$amount" ; $cnt+=1; $total+=odbc_result($cur,'opdCharges'); } if($cnt!=1) echo "
Total$total" ; echo "
"; }elseif(isset($_GET['doctorID'])){ //$query="insert into patientTab (age,ageStatus,regCharges,date_,dob,gender,remarks,patientType,doctorID,patientID,name,fname,address,contacts,nic,email)"; $query= "select date_,patientID,name,regCharges from patientTab where doctorID='".$_GET['doctorID']."' and (date_ between '$from' and '$to') and labid='".$_SESSION['labid']."' order by patientID"; //echo $query; $cur= odbc_exec($conn,$query); $cnt=0;$total=0; while( odbc_fetch_row( $cur ) ) { if ($cnt++==0) echo "
Patient List
#DateNameAmount"; $date_= date("d-m-Y", strtotime(odbc_result( $cur, 'date_' ))); echo "
$cnt$date_".odbc_result($cur,'name')."".odbc_result($cur,'regCharges'); $total+=odbc_result($cur,'regCharges'); } if($cnt>0) echo "
Total$total" ; echo "
"; }elseif(isset($_GET['expID'])){ $query= "select expID,description,amount,vno,date_ from expensesView where expID='".$_GET['expID']."' and (date_ between '$from' and '$to') and labid='".$_SESSION['labid']."' order by vno desc"; //echo $query; $cur= odbc_exec( $conn, $query ); $cnt=1;$total=0; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
Expenses
#VNo.DateDescriptionAmount"; $date_= date("d-m-Y", strtotime(odbc_result( $cur, 'date_' ))); $expID= odbc_result( $cur, 'expID' ); $description= odbc_result( $cur, 'description' ); $amount= round(odbc_result( $cur, 'amount' )); $vno= odbc_result( $cur,'vno'); echo "
$cnt$vno$date_$description$amount" ; $cnt+=1; $total+=$amount; } if($cnt!=1) echo "
Total Expenses$total" ; echo "
"; }elseif(isset($_GET['serviceID'])){ $query= "select date_,serviceName,patientName,serviceName,charges from servicesView where serviceID='".$_GET['serviceID']."' and (date_ between '$from' and '$to') and labid='".$_SESSION['labid']."' order by date_,autoid"; //echo $query; $cur= odbc_exec( $conn, $query ); $cnt=1;$total=0; while( odbc_fetch_row( $cur ) ) { if ($cnt==1){ echo "
".odbc_result( $cur, 'serviceName' )."
#DatePatientAmount"; } $date_= date("d-m-Y", strtotime(odbc_result( $cur, 'date_' ))); $patientName= odbc_result( $cur, 'patientName' ); //$serviceName= odbc_result( $cur, 'serviceName' ); $amount= odbc_result( $cur, 'charges' ); echo "
$cnt$date_$patientName$amount" ; $total+=$amount; $cnt+=1; } if($cnt>1){ echo "
Total$total" ; echo "
Print" ; echo "
"; } }elseif(isset($_GET['itemID'])){ // $query= "select * from ItemInOut where pNo>0 and itemID='".$_GET['itemID']."' order by date_"; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { if ($cnt++==0){ echo "
Purchase
#DateInv No.BatchNoExpiryqtyPriceAmount"; } $date_= date("d-m-Y", strtotime(odbc_result( $cur, 'date_' ))); $expiry= date("m-Y", strtotime(odbc_result( $cur, 'expiry' ))); $amount= odbc_result( $cur, 'qty' )*odbc_result( $cur, 'uPrice' ); //$address="purchase?visitNo=".odbc_result( $cur, 'visitNo' )."&patientID=".odbc_result( $cur, 'patientID' )."&showID=".odbc_result( $cur, 'accountID' )."&invType=pNo&invNo=".odbc_result( $cur, 'pNo' ).""; $address="purchase?showID=".odbc_result( $cur, 'accountID' )."&invType=pNo&invNo=".odbc_result( $cur, 'pNo' ).""; echo "
$cnt$date_".odbc_result( $cur, 'pNo' )."".odbc_result( $cur, 'batchNo' )."$expiry".odbc_result( $cur, 'qty' )."".odbc_result( $cur, 'uPrice' )."$amount" ; $totalAmt+=$amount; } if($cnt>0) echo "
Total$totalAmt" ; echo "
"; $cnt=0; $query= "select * from ItemInOut where pRNo>0 and itemID='".$_GET['itemID']."' order by date_"; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { if ($cnt++==0){ echo "
Purchase Return
#DateInv No.BatchNoExpiryqtyPriceAmount"; } $date_= date("d-m-Y", strtotime(odbc_result( $cur, 'date_' ))); $expiry= date("m-Y", strtotime(odbc_result( $cur, 'expiry' ))); $amount= odbc_result( $cur, 'qty' )*odbc_result( $cur, 'uPrice' ); $address="purchase?showID=".odbc_result( $cur, 'accountID' )."&invType=pRNo&invNo=".odbc_result( $cur, 'pRNo' ).""; echo "
$cnt$date_".odbc_result( $cur, 'pRNo' )."".odbc_result( $cur, 'batchNo' )."$expiry".odbc_result( $cur, 'qty' )."".odbc_result( $cur, 'uPrice' )."$amount" ; $totalAmt+=$amount; } if($cnt>0) echo "
Total$totalAmt" ; echo "
"; $cnt=0; $query= "select * from ItemInOut where saleNo>0 and itemID='".$_GET['itemID']."' order by date_"; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { if ($cnt++==0){ echo "
Sale Detail
#DateInv No.BatchNoExpiryqtyPriceAmount"; } $date_= date("d-m-Y", strtotime(odbc_result( $cur, 'date_' ))); $expiry= date("m-Y", strtotime(odbc_result( $cur, 'expiry' ))); $amount= odbc_result( $cur, 'qty' )*odbc_result( $cur, 'uPrice' ); $patientID=getName($conn,"select patientID from itemInOutSummary where saleNo='".odbc_result( $cur, 'saleNo' )."'"); $visitNo=getName($conn,"select visitNo from itemInOutSummary where saleNo='".odbc_result( $cur, 'saleNo' )."'"); $address="purchase?showID=".odbc_result( $cur, 'accountID' )."&invType=saleNo&invNo=".odbc_result( $cur, 'saleNo' )."&patientID=$patientID&visitNo=$visitNo"; echo "
$cnt$date_".odbc_result( $cur, 'saleNo' )."".odbc_result( $cur, 'batchNo' )."$expiry".odbc_result( $cur, 'qty' )."".odbc_result( $cur, 'uPrice' )."$amount" ; $totalAmt+=$amount; } if($cnt>0) echo "
Total$totalAmt" ; echo "
"; $cnt=0; $query= "select * from ItemInOut where saleRNo>0 and itemID='".$_GET['itemID']."' order by date_"; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { if ($cnt++==0){ echo "
Sale Return
#DateInv No.BatchNoExpiryqtyPriceAmount"; } $date_= date("d-m-Y", strtotime(odbc_result( $cur, 'date_' ))); $expiry= date("m-Y", strtotime(odbc_result( $cur, 'expiry' ))); $amount= odbc_result( $cur, 'qty' )*odbc_result( $cur, 'uPrice' ); $patientID=getName($conn,"select patientID from itemInOutSummary where saleRNo='".odbc_result( $cur, 'saleRNo' )."'"); $visitNo=getName($conn,"select visitNo from itemInOutSummary where saleRNo='".odbc_result( $cur, 'saleRNo' )."'"); $address="purchase?showID=".odbc_result( $cur, 'accountID' )."&invType=saleNo&invNo=".odbc_result( $cur, 'saleNo' )."&patientID=$patientID&visitNo=$visitNo"; echo "
$cnt$date_".odbc_result( $cur, 'saleRNo' )."".odbc_result( $cur, 'batchNo' )."$expiry".odbc_result( $cur, 'qty' )."".odbc_result( $cur, 'uPrice' )."$amount" ; $totalAmt+=$amount; } if($cnt>0) echo "
Total$totalAmt" ; echo "
"; }elseif(isset($_GET['testName'])){ $query= "select date_,labNo,testID,patientName,sum(testCharges) as amount from patientTestsView where testName='".$_GET['testName']."' and (date_ between '$from' and '$to') and labid='".$_SESSION['labid']."' group by date_,labNo,testID,patientName"; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { if ($cnt++==0){ echo "
Tests Detail
#DateLabNoPatientAmount"; } $date_= date("d-m-Y", strtotime(odbc_result( $cur, 'date_' ))); $patientName= odbc_result( $cur, 'patientName' ); $amount= odbc_result( $cur, 'amount' ); echo "
$cnt$date_".odbc_result( $cur, 'labNo' ); echo " $patientName"; echo "$amount" ; $totalAmt+=$amount; } if($cnt!=1) echo "
Total$totalAmt" ; echo "
"; }elseif(isset($_GET['typeofService'])){ $query= "select testName,sum(testCharges) as amount,count(testCharges) as cases from patientTestsView where typeofService='".$_GET['typeofService']."' and (date_ between '$from' and '$to') and labid='".$_SESSION['labid']."' group by testName order by count(testCharges) desc"; //$query= "select testID,sum(testCharges) as amount,count(testCharges) as cases from patientTests where testID='".$_GET['typeofService']."' and (date_ between '$from' and '$to') group by testID"; //echo $query; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { if ($cnt++==0){ echo "
Tests Summary ($from - $to)
#Test NameCasesAmount"; } $testName= odbc_result( $cur, 'testName' ); $amount= odbc_result( $cur, 'amount' ); echo "
$cnt$testName"; echo "".odbc_result( $cur, 'cases' )."$amount" ; $totalAmt+=$amount; } if($cnt>0){ echo "
Total$totalAmt" ; echo "
"; } }elseif(isset($_GET['patientID'])){ $query= "select * from itemInOutSummary where $invType>0 and patientID='".$_GET['patientID']."' and (date_ between '$from' and '$to') and labid='".$_SESSION['labid']."' order by date_"; $cur= odbc_exec( $conn, $query ); while(odbc_fetch_row($cur)){ if ($cnt++==0){ echo "
PharmacyReport
#Date$invTypeAccountAmountDiscountPaid"; } $invNo=odbc_result($cur,$invType); $amount=odbc_result($cur,'amount'); $discount=odbc_result($cur,'discount'); $paid=odbc_result($cur,'paid'); $accountName=getName($conn,"select stdName from student where ID='".odbc_result($cur,'accountID')."' and recordType='Account'"); echo "
$cnt".date('d-m-Y',strtotime(odbc_result($cur,'date_')));; echo "$invNo"; echo "$accountName".round(odbc_result($cur,'amount'))."".odbc_result($cur,'discount')."".odbc_result($cur,'paid')."" ; $totalAmt+=$amount; $totalDisc+=$discount; $totalPaid+=$paid; } if($cnt>0) echo "
Summary$totalAmt$totalDisc$totalPaid" ; echo "
"; }elseif(isset($_GET['invNo'])){ //Invoice Detail $query= "select * from itemInOut where $invType='".$_GET['invNo']."' "; //echo $query; $cur= odbc_exec( $conn, $query ); while(odbc_fetch_row($cur)){ if ($cnt++==0){ echo "
Pharmacy Report
#$invTypeItemqtypriceAmount"; } $itemName=getName($conn,"select itemName from itemTable where itemID='".odbc_result($cur,'itemID')."'"); echo "
$cnt".odbc_result($cur,$invType)."$itemName".odbc_result($cur,'qty')."".round(odbc_result($cur,'uPrice'))."".round(odbc_result($cur,'qty')*odbc_result($cur,'uPrice')).""; $totalAmt+=odbc_result($cur,'qty')*odbc_result($cur,'uPrice'); } if($cnt>0) echo "
Summary".round($totalAmt) ; echo "
"; }elseif(isset($_GET['accountID'])){ $query= "select * from itemInOutSummary where accountID='".$_GET['accountID']."' and $invType>0 and (date_ between '$from' and '$to') and labid='".$_SESSION['labid']."' order by date_"; //echo $query; $cur= odbc_exec( $conn, $query ); while(odbc_fetch_row($cur)){ if ($cnt++==0){ echo "
PharmacyReport
#Date$invTypeAccountAmountDiscountPaid"; } $invNo=odbc_result($cur,$invType); $amount=odbc_result($cur,'amount'); $discount=odbc_result($cur,'discount'); $paid=odbc_result($cur,'paid'); $accountName=getName($conn,"select stdName from student where ID='".odbc_result($cur,'accountID')."' and recordType='Account'"); echo "
$cnt".date('d-m-Y',strtotime(odbc_result($cur,'date_')));; echo "$invNo"; echo "$accountName".round(odbc_result($cur,'amount'))."".odbc_result($cur,'discount')."".odbc_result($cur,'paid')."" ; $totalAmt+=$amount; $totalDisc+=$discount; $totalPaid+=$paid; } if($cnt>0) echo "
Summary$totalAmt$totalDisc$totalPaid" ; echo "
"; } ?>