"; switch($getActiveWindow){ case 'wait': echo "          WAITING AREA"; break; case 'in': echo "          CHECK-IN"; break; case 'out': echo "          CHECK-OUT"; break; case 'on': echo "          ON-GOING SESSION"; break; } switch($getActiveWindow){ //========================================================================================================================== //========================================================================================================================== case 'wait': //============================================================================================================== echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
"; $q=mysql_query("SELECT * FROM `treatment_session` WHERE `session_status`='Waiting' AND `branch_code`='$compCode' ORDER by `session_lname` ASC"); $row=mysql_fetch_array($q); $total=mysql_num_rows($q); $dis=20; $total_page=ceil($total/$dis); $page_cur=(isset($_GET['page']))?$_GET['page']:1; $k=($page_cur-1)*$dis; $page_cur = mysql_real_escape_string($page_cur); $qq=mysql_query("SELECT * FROM `treatment_session` WHERE `session_status`='Waiting' AND `branch_code`='$compCode' ORDER by `session_id` ASC"); echo ""; echo ""; while($row = mysql_fetch_array($qq)){ $ptID = $row['index_patient_id']; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
REC.NO First Name Middle Name Last Name Birth Date Gender Status -
" . $row['patient_id'] . "" . $row['patient_fname'] . "" . $row['patient_mname'] . "" . $row['patient_lname'] . "" . $row['patient_bday'] . "" . $row['patient_sex']. "" . $row['patient_status'] . " "; echo ""; echo "
"; echo "
"; echo "
"; break; //========================================================================================================================== //========================================================================================================================== case 'in': //============================================================================================================== echo "
"; $q=mysql_query("SELECT * FROM `patient_list` WHERE `status`='In' AND `branch_code`='$compCode'"); $row=mysql_fetch_array($q); $total=mysql_num_rows($q); $dis=20; $total_page=ceil($total/$dis); $page_cur=(isset($_GET['page']))?$_GET['page']:1; $k=($page_cur-1)*$dis; $page_cur = mysql_real_escape_string($page_cur); $qq=mysql_query("SELECT * FROM `patient_list` WHERE `status`='In' AND `branch_code`='$compCode' ORDER by `time_last_in` ASC"); echo ""; echo ""; while($row = mysql_fetch_array($qq)){ echo ""; $MyPatientID =$row['patient_id']; $myStatus = mysql_result(mysql_query("SELECT COUNT('session_id') FROM `treatment_session` WHERE `session_patient_id` ='$MyPatientID' AND `session_status` ='Pending' "),0); $sessionID = mysql_result(mysql_query("SELECT `session_id` FROM `treatment_session` WHERE `session_patient_id` ='$MyPatientID' AND `session_status` ='Pending' "),0); $sessionStatus = mysql_result(mysql_query("SELECT `session_status` FROM `treatment_session` WHERE `session_patient_id` ='$MyPatientID' AND `session_status`!='Closed'"),0); $checkOpenTX = mysql_result(mysql_query("SELECT `hold-tx` FROM `patient_list` WHERE `patient_id`='$MyPatientID'"),0); if($checkOpenTX ==='0'){ $bgColor = 'white'; }else { $bgColor = '#F5A9BC'; } if($myStatus >0) { $pStatus = 'Deferred'; }else { $pStatus = 'New Session'; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if($myStatus >0) { echo ""; echo ""; echo ""; }else { echo ""; echo ""; if(empty($sessionStatus)){ if($checkOpenTX ==='1'){ echo ""; }else { echo ""; } }else{ echo ""; } } echo ""; } echo "
Patient I.D First Name Middle Name Last Name Date In Time In Gender Check-In Status Treatment Status -
" . $row['patient_id'] . "" . $row['patient_fname'] . "" . $row['patient_mname'] . "" . $row['patient_lname'] . "" . $row['date_last_in'] . "" . $row['time_last_in'] . "" . $row['patient_sex'] . "" . $pStatus . "" . $sessionStatus . "Resume" . $pStatus . "" . $sessionStatus . "- START -- START --
"; echo "
"; break; //========================================================================================================================== //========================================================================================================================== case 'on': //============================================================================================================== echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
"; $q=mysql_query("SELECT * FROM `pindex_hdr` WHERE `index_hdr_status`='On-Going' AND `branch_code`='$compCode'"); $row=mysql_fetch_array($q); $total=mysql_num_rows($q); $dis=30; $total_page=ceil($total/$dis); $page_cur=(isset($_GET['page']))?$_GET['page']:1; $k=($page_cur-1)*$dis; $page_cur = mysql_real_escape_string($page_cur); $qq=mysql_query("SELECT * FROM `treatment_session` WHERE `session_status`='On-Going' AND `branch_code`='$compCode' ORDER by `session_lname` ASC"); echo ""; echo ""; while($row = mysql_fetch_array($qq)){ echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo ""; echo ""; echo ""; echo "
Trans I.D Patient I.D First Name Last Name Start Date Start Time - - -
" . $row['session_header_id'] . "" . $row['session_patient_id'] . "" . $row['session_fname'] . "" . $row['session_lname'] . "" . $row['session_date_started'] . "" . $row['session_time_started'] . "
Update

Deferred

Lab Check-Out

"; if($page_cur>1){ echo ' style="cursor:pointer;color:lightgray;" > '; }else { echo ''; } echo ' [ ' . $page_cur . ' of ' . $total_page . ' ] '; for($i=1;$i<=$total_page;$i++) { //if($page_cur==$i) //{ // echo ' '; //} //else //{ //echo ' '; //} } if($page_cur<$total_page) { echo ' '; } else { echo ''; } echo "

"; echo "
"; echo "
"; break; } //========================================================================================== //========================================================================================== if(isset($_GET['deferred'])){ $deferred=$_GET['deferred']; if($deferred==='check'){ $fname =$_GET['fname']; $lname =$_GET['lname']; $pID =$_GET['pID']; $hID =$_GET['hID']; $ID =$_GET['ID']; echo "

Are you sure want to deferred treatment session of ".$fname." ".$lname."?



   

"; } } if(isset($_GET['deferred'])){ $deferred=$_GET['deferred']; if($deferred==='true'){ $ID = $_GET['ID']; $pID = $_GET['pID']; //mysql_query("UPDATE `patient_list` SET `status` = 'Out' WHERE `patient_id`='$pID'"); mysql_query("UPDATE `treatment_session` SET `session_status` = 'Deferred' WHERE `session_id`='$ID'"); } } //lab checkout confirmation if($_GET['action']==='labcheckout'){ $fname =$_GET['fname']; $lname =$_GET['lname']; $pID =$_GET['pID']; $hID =$_GET['hID']; $ID =$_GET['ID']; echo "Action"; echo "

Treatment Session completed. Confirm Laboratory Check-out

Name of Patient: ".$fname." ".$lname."



   

"; } if($_GET['action']==='pout'){ $fname =$_GET['fname']; $lname =$_GET['lname']; $pID =$_GET['pID']; $hID =$_GET['hID']; $ID =$_GET['ID']; mysql_query("UPDATE `treatment_session` SET `session_status`='Billing',`session_date_ended`='$toDate', `session_time_ended` = '$currentTime' WHERE `session_id`='$ID' AND `branch_code`='$compCode'"); echo "

Check-Out Request has been Confirmed...







"; } //============================================================================================ if(isset($_GET['start'])){ if($start==='check'){ $fname =$_GET['fname']; $lname =$_GET['lname']; $pID =$_GET['pID']; $hID =$_GET['hID']; $ID =$_GET['ID']; echo "

Are you sure want to deferred treatment session of ".$fname." ".$lname."?



   

"; } } if(isset($_GET['tx-open'])){ $pID = $_GET['id']; mysql_query("UPDATE `patient_list` SET `hold-tx`='1',`date_last_in`='$toDate', `time_last_in` = '$currentTime' WHERE `patient_id`='$pID' AND `branch_code`='$compCode'"); //update logs for session started without payment $sql="INSERT INTO `unpaid_active_session` (`rec_id`, `patient_id`, `date`, `time`, by`, `branch_code`) VALUES('','$pID','$toDate','$currentTime','$user','$compCode')"; if(!mysql_query($sql)){ die('Error: ' . mysql_error()); } } if(isset($_GET['start'])){ $start=$_GET['start']; if($start==='true'){ $transID = $_GET['hID']; $patientID = $_GET['pID']; $ID = $_GET['ID']; mysql_query("UPDATE `treatment_session` SET `session_status`='On-Going',`session_date_started`='$toDate', `session_time_started` = '$currentTime' WHERE `session_id`='$ID' AND `branch_code`='$compCode'"); echo "

Treatment Session has been started.

Thank you!.


"; } }//========================================================================================== //========================================================================================== ?>