Commit 85b284ed by Jansa Jose

change flow in ipok

parent 63e584d3
...@@ -2187,8 +2187,6 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F ...@@ -2187,8 +2187,6 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
public function cancel_booking($data){ public function cancel_booking($data){
$query = $this->db->get_where('tbl_booking',array('id'=>$data['booking_id']))->row_array(); $query = $this->db->get_where('tbl_booking',array('id'=>$data['booking_id']))->row_array();
if($query){ if($query){
$nextday = strtotime(date('Y-m-d', strtotime('+1 day', $query['date'])));
print_r($nextday);exit();
$this->db->select('duration'); $this->db->select('duration');
$dur = $this->db->get('tbl_policy')->row(); $dur = $this->db->get('tbl_policy')->row();
...@@ -2247,7 +2245,7 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F ...@@ -2247,7 +2245,7 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$fcm_user = $this->db->get_where('tbl_authtoken',array('userid'=>$ress['patient_id']))->row(); $fcm_user = $this->db->get_where('tbl_authtoken',array('userid'=>$ress['patient_id']))->row();
$new['id'] = $patient_insert_id; $new['id'] = $patient_insert_id;
$new['type'] = "Waiting List"; $new['type'] = "Waiting List";
$new['booking_id'] = $query['id']; $new['booking_id'] = $ress['id'];
$new['booking_date'] = $query['date']; $new['booking_date'] = $query['date'];
$new['doctor_id'] = $query['doctor_id']; $new['doctor_id'] = $query['doctor_id'];
$new['doctor_name'] = $doctr_data['name']; $new['doctor_name'] = $doctr_data['name'];
...@@ -2273,8 +2271,29 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F ...@@ -2273,8 +2271,29 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$doctor_push = $this->push_sent($news,$doctor_type); $doctor_push = $this->push_sent($news,$doctor_type);
}else{ }else{
$nextday = strtotime(date('Y-m-d', strtotime('+1 day', $query['date']))); $nextday = strtotime(date('Y-m-d', strtotime('+1 day', $query['date'])));
print_r($nextday);exit();
$ress = $this->db->get_where('tbl_booking',array('doctor_id'=>$query['doctor_id'],'clinic_id'=>$query['clinic_id'],'date'=>$query['date'],'time'=>$query['time'],'booking_status'=>'0'))->row_array(); $next_day_consult = $this->db->get_where('tbl_booking',array('doctor_id'=>$query['doctor_id'],'clinic_id'=>$query['clinic_id'],'date'=>$nextday,'booking_status'=>'0','time'=>$query['time']))->row_array();
if($next_day_consult){
$msg3 = "Your Wait Listed Appointment on ".date('d.m.Y h:i a',$next_day_consult['time_start'])." can be changed to ".date('d.m.Y h:i a',$query['time_start'])." as the Time Slot is Available Now. Would you like to change the Appointment on Available Slot ?";
$this->db->insert('tbl_patient_notification',array('patient_id'=>$ress['patient_id'],'type'=>'0','message'=>$msg3,'time'=>$conslt_time,'booking_id'=>$query['id'],'read_status'=>'0'));
$new_patient_insert_id = $this->db->insert_id();
$fcm_user = $this->db->get_where('tbl_authtoken',array('userid'=>$ress['patient_id']))->row();
$new['id'] = $new_patient_insert_id;
$new['type'] = "Consultation Confirmation";
$new['booking_id'] = $next_day_consult['id'];
$new['booking_date'] = $query['date'];
$new['doctor_id'] = $query['doctor_id'];
$new['doctor_name'] = $doctr_data['name'];
$new['doctor_specialization'] = $special->specialization_name;
$new['message'] = $msg3;
$new['time'] = $conslt_time;
$new['to'] =$fcm_user->fcm_token;
$user_type = '1';
$push = $this->push_sent($new,$user_type);
}
} }
if($query['visit_type'] == '0' && $query['payment_type'] == '2'){ if($query['visit_type'] == '0' && $query['payment_type'] == '2'){
$doctor_wallet = $this->db->get_where('tbl_wallet_details',array('doctor_id'=>$query['doctor_id']))->row(); $doctor_wallet = $this->db->get_where('tbl_wallet_details',array('doctor_id'=>$query['doctor_id']))->row();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment