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Q i!P3|jd虪+)jESnJ٤M"섋1=1k}ےvgpԈ)KV=٩()8,~yIäINf}V(rIANj{w5" *Y~4\2 i20N[q̦ߋ+89;'0e]˖Gbp1kJ9Oed lOwsn݅P=0: j@Eצf'.eQ,J7i7&שJ"݈Wa+ec_k`+9xb5i*$>K$KŔhX(.j}tAYKȂ͝Oh+K.jf49얅kɭPq{/RU8Odāc1eȋ]|ȿiBRr^o׃$| 3BqEغ<4D)>ɄnQ]Vo'}kOH_][^FDmmm{7Ea]ǤNQnf> ͮJK{pc?>|CF#H˩b1跈ĸWZh){8 q,">T~h Tg F#I)A;-ܢRj"1m`aIb~Y}Rg@;ڜAB58\}C.pnt_8c#%1{dX^/'[ڡdY&p1| 9.3lCX{掶'%fj8e2ѨI 8ӕ%znHsqie;`t껚M5DҪ|JBInf>H{0[Rt֎[@9/v]] pmn,fQٗw蟃FHcN*3Q+HexT`FŃr!BIt d7}BQn>u2!!cʡ %=-M[{(^$9f0Êw1ZYjUv 09h_ O8 bs"Ɓ)NMpixڟ<>^4 ulU=,t~L< ʚ'܂5*ߓzml?_!eE/&Pebv˜@qi y(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
S.#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
S.#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' )."
S.#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 "
"; }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
S.#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
S.#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
S.#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
S.#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,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,patientName"; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { if ($cnt++==0){ echo "
Tests Detail
S.#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' )."$patientName$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
S.#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 "
PharmacyReport
S.#$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')."".odbc_result($cur,'uPrice')."".odbc_result($cur,'qty')*odbc_result($cur,'uPrice').""; $totalAmt+=odbc_result($cur,'qty')*odbc_result($cur,'uPrice'); } if($cnt>0) echo "
Summary$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
S.#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 "
"; } ?>