Commit 9ae4f45d by Jansa Jose

Merge branch 'jansa'

parents e2717125 c914cdcb
......@@ -3458,6 +3458,63 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$this->db->update('tbl_wallet_details',array('future_earn'=>encrypt_data($future_earn),'total_earn'=>encrypt_data($total)),array('doctor_id'=>$id));
}
}
$todays_consult = $this->db->get_where('tbl_booking',array('doctor_id'=>$query->doctor_id,'clinic_id'=>$query->clinic_id,'date'=>$query->date,'booking_status'=>'0','time'=>$query->book_time,'payment_status'=>'1'))->row_array();
if($todays_consult){
$text = "Your Wait Listed Appointment on ".date('d.m.Y h:i a',$todays_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'=>$todays_consult['patient_id'],'type'=>'4','message'=>$text,'time'=>$conslt_time,'booking_id'=>$todays_consult['id'],'read_status'=>'0'));
$cancel_patient_insert_id = $this->db->insert_id();
$fcm_user_new = $this->db->get_where('tbl_authtoken',array('userid'=>$todays_consult['patient_id']))->row();
$news['id'] = $cancel_patient_insert_id;
$news['type'] = "Consultation Updates";
$news['booking_id'] = $todays_consult['id'];
$news['booking_date'] = $query->date;
$news['doctor_id'] = $query->doctor_id;
$news['doctor_name'] = $doctr_data['name'];
$news['doctor_specialization'] = $special->specialization_name;
$news['message'] = $text;
$news['time'] = $conslt_time;
$news['to'] =$fcm_user_new->fcm_token;
$user_type = '1';
$push_status =$this->push_sent($news,$user_type);
}else{
$nextday = strtotime(date('Y-m-d', strtotime('+1 day', $query->date)));
$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,'payment_status'=>'1'))->row_array();
if($next_day_consult){
$text = "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'=>$next_day_consult['patient_id'],'type'=>'4','message'=>$text,'time'=>$conslt_time,'booking_id'=>$next_day_consult['id'],'read_status'=>'0'));
$cancel_patient_insert_id = $this->db->insert_id();
$fcm_user_new = $this->db->get_where('tbl_authtoken',array('userid'=>$next_day_consult['patient_id']))->row();
$new['id'] = $cancel_patient_insert_id;
$new['type'] = "Consultation Updates";
$new['booking_id'] = $next_day_consult['id'];
$new['booking_date'] = $next_day_consult['date'];
$new['doctor_id'] = $next_day_consult['doctor_id'];
$new['doctor_name'] =$doctr_data['name'];
$new['doctor_specialization'] =$special->specialization_name;
$new['message'] = $text;
$new['time'] = $conslt_time
$new['to'] =$fcm_user_new->fcm_token;
$user_type = '1';
$push_status =push_sent($new,$user_type);
}
}
$result = array('status'=>'success');
}else{
$result = array('status'=>'failed','message'=>'Invalid Doctor ');
......
......@@ -236,7 +236,7 @@ public function cancelBooking()
$this->db->insert('tbl_patient_notification',array('patient_id'=>$todays_consult['patient_id'],'type'=>'4','message'=>$text,'time'=>strtotime($nowin_server),'booking_id'=>$todays_consult['id'],'read_status'=>'0'));
$new_patient_insert_id = $this->db->insert_id();
$fcm_user_new = $this->Home_model->get_patient_fcm($booking_details['pat_id']);
$fcm_user_new = $this->Home_model->get_patient_fcm($todays_consult['patient_id']);
$new['id'] = $new_patient_insert_id;
$new['type'] = "Consultation Updates";
......
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