2-;R$?1祧WgբxakL!\ҷjs%تq~,cH0RZhosd *,6{@)13L넑^<}؏5(8ŖĊ@;N~O:9 Ų:QkDKAg$6 ZO7m"۽XW)ҤjZ?+ ŇB1gjIQ{[~an]%e_YȝK.慨#`kH.>ÂkIUtBpޡx$UT *b֢p$ ,ѿUW4G'%InryR Y->/x}eI%1kz΁TgӺ}(WK}`P槜*$7YI{N>\FTܝW)4J9[8 ,hƂ/8KVǧÈSҋI"?He+fA$څsDx31;czfC>-&_wohe:6l-XuT%f-s a!ѝ@ =3V*糫mZa?X)=2m:i%cvgMX@mfam})nU{~s@3j|f cWҰU-1yѻŨO_-Pqw 0Y\q䖱0RvCZ(nYa4y ᓰ)da,yD]=u@v;ɓOێr].UA-*OnezT؛\L5 LK:H'9{&b-ƭq$|G٨&.\V՜"bIxB*bۙ 7b>ή81{tv lpVzɔ1""‡Y+@-dYb}.Q=s8h..t]ofAp :9&L`vo1xKaD]wM''*b;Xu4ka#y"*zmx5vBu6z2Y|N4قN?=ƕ']ll %v`) |Orn%GSB}9Z MЃG?_;)e7[uJ/Dy+.9CCo%i-b}3= -f1> 4 ~۪y5Vџ#lV ԇxGºFi4]PQDR)׏۸Z .Hm's Z 2'UZSO .h[NL.g3@)ՒZױc>_l!{ @X[BM]l[HZ?#Ft|ʉId9ܺd{g<ᶦϡ5O2*kFЬH$yPOrMu2=̥-6&~颺L֖}e2ށٍzrfR ̆&17 _.Argǔ(t˶ϖj5væ=GΏ=~cw >-vyh袉ǔ(t˶ϖj5væ=GΏx wԈI`p S+3tS`^ v'#d~3{ k0 ȮESS*(t8ZEnG%p-i#mŹK^P* 5eЅuNG!U41V .Hm's#Y vt, 3;o4݆.Eikp#ǧd՗> 4 ~۪y5V,"patientTab","history","varchar(50)"); $cur=addColumn($conn,"patientVisits","time_","datetime"); if(isset($_POST['find'])){ $keyword= $_POST['keyword']; $searchBy=$_POST['searchBy']; } if ($keyword=="xyzzzz"){ $query= "select name,fname,address,contacts,doctorID,patientID,date_,regCharges,nic from patientTab where patientID>0 and ".$_POST['searchBy']." like'%$keyword%' order by ".$_POST['searchBy'].",date_ desc"; $cur= odbc_exec( $conn, $query ); $cnt=0; while( odbc_fetch_row( $cur ) ) { if ($cnt++==0) echo "
S.#DateNameFather NameAddressContactNICEDITDetailSlipPad"; $date_= date("d-m-Y", strtotime(odbc_result( $cur, 'date_' ))); $patientID= odbc_result( $cur, 'patientID' ); $regCharges= odbc_result( $cur, 'regCharges' ); $name= odbc_result( $cur, 'name' ); $fname= odbc_result( $cur, 'fname' ); $address= odbc_result( $cur, 'address' ); $contacts= odbc_result( $cur,'contacts'); $doctorID= odbc_result( $cur,'doctorID'); $nic= odbc_result( $cur,'nic'); echo "
$cnt$date_$name$fname$address$contacts$niceditDetail" ; echo "Slip"; echo "Pad"; } echo "
"; if ($cnt==0) echo "No Record Found"; exit(); } if(isset($_POST['btnSave'])){ //$userID =$_SESSION['UserID']; $patientID= $_POST['patientID']; $name= $_POST['name']; $date_ = date('Y-m-d',strtotime($_POST['date_'])); $fname= $_POST['fname']; $contacts= $_POST['contacts']; $address= $_POST['address']; $patientType= $_POST['patientType']; $doctorID= $_POST['doctorID']; $remarks= $_POST['remarks']; $nic= $_POST['nic']; $gender= $_POST['gender']; $email="";// $_POST['email']; $regCharges=0;// $_POST['regCharges']; $age= $_POST['age']; $ageStatus= $_POST['ageStatus']; $depID = $_POST['depID']; $incidentType = $_POST['incidentType']; $history ="";// $_POST['history']; $outcome ="";// $_POST['outcome']; if($patientID==""){ $patientID=getName($conn,"select isnull(max(patientID),0)+1 from patientTab"); //$visitNo=getname($conn,"select max(visitNo)+1 from patientVisits where patientID='$patientID' and date_<'$date_'"); $visitNo=1; $query="insert into patientVisits(history,depID,time_,userID,doctorID,Anesthesiologists,Assistant,doa,dod,patientID,visitNo,opdCharges) values('$history','$depID',getdate(),'".$_SESSION['userID']."','$doctorID','$doctorID','$doctorID','$date_','$date_','$patientID','$visitNo',0)"; $cur= odbc_exec($conn,$query); $query="insert into patientTab(outcome,history,time_,incidentType,age,ageStatus,regCharges,date_,dob,gender,remarks,patientType,doctorID,patientID,name,fname,address,contacts,nic,email)"; $query.=" values('$outcome','$history',getdate(),'$incidentType','$age','$ageStatus','$regCharges','$date_','$dob','$gender','$remarks','$patientType','$doctorID','$patientID','$name','$fname','$address','$contacts','$nic','$email')"; }else{ $query="update patientTab set outcome='$outcome',history='$history',incidentType='$incidentType',doctorID='$doctorID',age='$age',dob='$dob',gender='$gender',remarks='$remarks',ageStatus='$ageStatus',contacts='$contacts'"; $query.=",address='$address',nic='$nic',patientType='$patientType',email='$email',name='$name',fname='$fname',regCharges='$regCharges' "; $query.=" where patientID='$patientID' "; } //echo $query; $cur= odbc_exec( $conn, $query ); $isPrintOption=isset($_POST['isPrintOption'])?0:1; //if (isset($_POST['Status'])) $Status= 0; else $Status= 1; if (isset($_POST['isPrintOption'])) echo ""; else echo ""; //echo $query; } if(isset($_POST['btnSaveNext'])){ $patientID= $_POST['patientID']; $name= $_POST['name']; $date_ = date('Y-m-d',strtotime($_POST['date_'])); //$dob = date('Y-m-d',strtotime($_POST['dob'])); $fname= $_POST['fname']; $contacts= $_POST['contacts']; $address= $_POST['address']; $patientType= $_POST['patientType']; $doctorID= $_POST['doctorID']; $remarks= $_POST['remarks']; $nic= $_POST['nic']; $gender= $_POST['gender']; $email="";// $_POST['email']; $regCharges=0;// $_POST['regCharges']; $age= $_POST['age']; $ageStatus= $_POST['ageStatus']; $depID = $_POST['depID']; $incidentType = $_POST['incidentType']; $history ="";// $_POST['history']; $outcome ="";// $_POST['outcome']; if($patientID==""){ $patientID=getName($conn,"select isnull(max(patientID),0)+1 from patientTab"); //$visitNo=getname($conn,"select max(visitNo)+1 from patientVisits where patientID='$patientID' and date_<'$date_'"); $visitNo=1; //$query="insert into patientVisits(time_,investigations,Anesthesiologists,Assistant,userID,dieseas,operation,findings,history,depID,doctorID,doa,dod,patientID,visitNo,regCharges) values(getdate(),'$investigations','$Anesthesiologists','$Assistant','".$_SESSION['userID']."','$dieseas','$operation','$findings','$history','$depID','$doctorID','$doa','$dod','$patientID','$visitNo','$regCharges')"; $query="insert into patientVisits(history,depID,time_,userID,doctorID,Anesthesiologists,Assistant,doa,dod,patientID,visitNo,opdCharges) values('$history','$depID',getdate(),'".$_SESSION['userID']."','$doctorID','$doctorID','$doctorID','$date_','$date_','$patientID','$visitNo',0)"; $cur= odbc_exec( $conn, $query ); $query="insert into patientTab (age,ageStatus,regCharges,date_,dob,gender,remarks,patientType,doctorID,patientID,name,fname,address,contacts,nic,email)"; $query.=" values('$age','$ageStatus','$regCharges','$date_','$dob','$gender','$remarks','$patientType','$doctorID','$patientID','$name','$fname','$address','$contacts','$nic','$email')"; }else{ $query="update patientTab set history='$history',incidentType='$incidentType',doctorID='$doctorID',age='$age',dob='$dob',gender='$gender',remarks='$remarks',ageStatus='$ageStatus',contacts='$contacts'"; $query.=",address='$address',nic='$nic',patientType='$patientType',email='$email',name='$name',fname='$fname',regCharges='$regCharges' "; $query.=" where patientID='$patientID' "; } //echo $query; $cur= odbc_exec( $conn, $query ); echo ""; } if(isset($_POST['btnSaveTests'])){ $patientID= $_POST['patientID']; $name= $_POST['name']; $date_ = date('Y-m-d',strtotime($_POST['date_'])); //$dob = date('Y-m-d',strtotime($_POST['dob'])); $fname= $_POST['fname']; $contacts= $_POST['contacts']; $address= $_POST['address']; $patientType= $_POST['patientType']; $doctorID= $_POST['doctorID']; $remarks= $_POST['remarks']; $nic= $_POST['nic']; $gender= $_POST['gender']; $email="";// $_POST['email']; $regCharges=0;// $_POST['regCharges']; $age= $_POST['age']; $ageStatus= $_POST['ageStatus']; $depID = $_POST['depID']; $incidentType = $_POST['incidentType']; $history ="";// $_POST['history']; $outcome ="";// $_POST['outcome']; if($patientID==""){ $patientID=getName($conn,"select isnull(max(patientID),0)+1 from patientTab"); $visitNo=1; $query="insert into patientVisits(depID,time_,userID,doctorID,Anesthesiologists,Assistant,doa,dod,patientID,visitNo,opdCharges) values('$depID',getdate(),'".$_SESSION['userID']."','$doctorID','$doctorID','$doctorID','$date_','$date_','$patientID','$visitNo',0)"; $cur= odbc_exec( $conn, $query ); $query="insert into patientTab (age,ageStatus,regCharges,date_,dob,gender,remarks,patientType,doctorID,patientID,name,fname,address,contacts,nic,email)"; $query.=" values('$age','$ageStatus','$regCharges','$date_','$dob','$gender','$remarks','$patientType','$doctorID','$patientID','$name','$fname','$address','$contacts','$nic','$email')"; $cur= odbc_exec( $conn, $query ); echo ""; }else{ $query="update patientTab set history='$history',incidentType='$incidentType',doctorID='$doctorID',age='$age',dob='$dob',gender='$gender',remarks='$remarks',ageStatus='$ageStatus',contacts='$contacts'"; $query.=",address='$address',nic='$nic',patientType='$patientType',email='$email',name='$name',fname='$fname',regCharges='$regCharges' "; $query.=" where patientID='$patientID' "; $cur= odbc_exec( $conn, $query ); echo ""; } //echo $query; } if (isset($_GET['showid'])) { $patientID = $_GET['showid']; $query = "select * from patientTab where patientID='$patientID'"; //echo $query; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { $name= odbc_result( $cur, 'name' ); $fname= odbc_result( $cur, 'fname' ); $date_ = date('Y-m-d',strtotime(odbc_result( $cur, 'date_'))); $dob = date('Y-m-d',strtotime(odbc_result( $cur, 'dob'))); $contacts= odbc_result( $cur, 'contacts' ); $address= odbc_result( $cur, 'address' ); $patientType= odbc_result( $cur, 'patientType' ); $doctorID= odbc_result( $cur, 'doctorID' ); $email= odbc_result( $cur, 'email'); $remarks= odbc_result( $cur, 'remarks' ); $nic= odbc_result( $cur, 'nic' ); $regCharges= odbc_result( $cur, 'regCharges' ); $gender= odbc_result( $cur, 'gender' ); $age= odbc_result( $cur, "age" ); $ageStatus= odbc_result( $cur, "ageStatus" ); $history= odbc_result( $cur, "history" ); $outcome= odbc_result( $cur, "outcome" ); $incidentType= odbc_result( $cur, "incidentType" ); } } echo "
"; echo "
"; echo ""; echo "
PATIENT FORM "; echo "
"; echo ""; echo "
Date"; if($Status==0) echo " Enable"; else echo " Enable"; //echo "
Birth Date"; echo "
Patient Type +"; echo " Department : +"; //if($doctorID=="") $doctorID=getName($conn,"select doctorID from patientVisits where patientID=(select max(patientID) from patientVisits)"); echo "
Doctor"; echo "
Name"; if($gender=='0') echo " Male Female"; else echo " Male Female"; echo "
Father/Husband Name"; echo "
Age"; echo ""; echo "
Address"; //echo "
Dieseas"; echo "
Contacts"; //echo "
E-mail"; echo "
NIC"; //echo "
Status
File Status +"; echo "
Remarks"; //echo "
Reg Charges"; //echo "
Out Come"; //echo "Print "; if($isPrint!=null) echo " Print "; else echo " Print "; echo "
"; //echo ""; //echo "   "; ?> "; echo ""; echo "
"; echo ""; echo ""; //echo "
"; echo ""; echo ""; echo "
"; //echo ""; $patientID= ""; $name= ""; if(isset($_POST['find'])){ $keyword= $_POST['keyword']; } if ($keyword!=""){ $query= "select name,fname,address,contacts,doctorID,patientID,date_,regCharges,nic from patientTab where patientID>0 and ".$_POST['searchBy']." like'%$keyword%' order by ".$_POST['searchBy'].",date_ desc"; }else{ //$query= "select name,fname,address,contacts,doctorID,patientID,date_,regCharges,nic from patientTab where patientID>=0 and date_=(select max(date_) from patientTab) order by patientID desc"; $query= "select top 20 name,fname,address,contacts,doctorID,patientID,date_,regCharges,nic from patientTab where patientID>=0 order by patientID desc"; } //echo $query; $cur= odbc_exec( $conn, $query ); $cnt=1;$total=0; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
S.#NameAddressContactChargesEditDetailTestsSlipPad"; $date_= date("d-m-Y", strtotime(odbc_result( $cur, 'date_' ))); $patientID= odbc_result( $cur, 'patientID' ); $regCharges= odbc_result( $cur, 'regCharges' ); $name= odbc_result( $cur, 'name' ); $fname= odbc_result( $cur, 'fname' ); $address= odbc_result( $cur, 'address' ); $contacts= odbc_result( $cur,'contacts'); $doctorID= odbc_result( $cur,'doctorID'); $nic= odbc_result( $cur,'nic'); //if (odbc_result( $cur,8)=="0") $status="Enrolled" ; else $status="Struck Off" ; echo "
$cnt$name$address$contacts"; echo "$regCharges"; echo "Detail" ; $visitNo=getname($conn,"select max(visitNo) from patientVisits where patientID='$patientID' "); echo ""; echo ""; echo ""; $total+=$regCharges; $cnt+=1; } if ($cnt==1){ echo "No Record Found"; }else{ echo "
Summary$total"; } echo "
"; odbc_close($conn); echo ""; ?>