Commit f16f04e8 by Jansa Jose

Merge branch 'jansa'

parents 56b642b3 71f1ebd9
......@@ -6853,7 +6853,8 @@ print_r(date('H:i',$ms));exit();*/
if (isset($data['month']) && strlen($data['month']) && isset($data['year']) && strlen($data['year']) && isset($data['first_name']) && strlen($data['first_name']) && isset($data['last_name']) && strlen($data['last_name']) && isset($data['card_number']) && strlen($data['card_number']) && isset($data['cvv']) && strlen($data['cvv']) && isset($data['booking_id']) && strlen($data['booking_id'])) {
$authtoken = $this->Webservice_model->get_userid_frm_authtoken($headers['Auth']);
$data['user_id'] = $authtoken->userid;
$get_booked_payed_data = $this->Webservice_model->get_booked_payed_data($data['booking_id']);
$payed_data = $this->Webservice_model->get_booked_payed_data($data['booking_id']);
if($payed_data['status'] == 'success' && ($payed_data['is_result'] == '0' || $payed_data['is_result'] == '1')){
$check_markbooking = $this->Webservice_model->checkBooking($data['booking_id']);
$booking_details = $this->Webservice_model->get_booking_details($data['booking_id']);
$patient_data = $this->Webservice_model->get_single_patient($booking_details['patient_id']);
......@@ -7019,6 +7020,12 @@ print_r(date('H:i',$ms));exit();*/
$res = array('status' => 'error', 'payment_status' => '0', 'message' => $charge->errors);
}
}
}else{
$res = array(
"status" => "error",
"error" => "error",
"message" => $payed_data['message']);
}
} else {
$res = array(
"status" => "error",
......
......@@ -3865,22 +3865,28 @@ class Webservice_model extends CI_Model {
$this->db->update('tbl_booking', $update);
}
// public function get_booked_payed_data($id){
// $booked_data = $this->db->get_where('tbl_booking',array('id'=>$id))->row_array();
// if($booked_data){
// $check = $this->db->get_where('tbl_booking',array('doctor_id'=>$booked_data['doctor_id'],'clinic_id'=>$booked_data['clinic_id'],'date'=>$booked_data['date'],'time'=>$booked_data['time'],'payment_status'=>'1'));
// if($check->num_rows() <= '0'){
// $is_result = 0;
// }else if($check->num_rows() == '1'){
// $is_result = 1;
// }else if($check->num_rows() >= '1'){
// $is_result = 2;
// }
// return $is_result;
// }
// }
public function get_booked_payed_data($id){
$booked_data = $this->db->get_where('tbl_booking',array('id'=>$id))->row_array();
if($booked_data){
$check = $this->db->get_where('tbl_booking',array('doctor_id'=>$booked_data['doctor_id'],'clinic_id'=>$booked_data['clinic_id'],'date'=>$booked_data['date'],'time'=>$booked_data['time'],'payment_status'=>'1'));
if($check->num_rows() <= '0'){
$is_result = 0;
$res = array('status'=>'success','is_result'=>$is_result);
}else if($check->num_rows() == '1'){
$is_result = 1;
$this->db->update('tbl_booking',array('booking_status'=>'0'),array('id'=>$id));
$res = array('status'=>'success','is_result'=>$is_result);
}else if($check->num_rows() >= '1'){
$is_result = 2;
$this->db->update('tbl_booking',array('booking_status'=>'4'),array('id'=>$id));
$res = array('status'=>'error','is_result'=>$is_result,'message'=>'
Selected Doctor Not Available');
}
}else{
$res = array('status'=>'error','message'=>'No Booking Found');
}
return $res;
}
/*function push_sent($fcm_data,$type) {
......
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