Commit 71f1ebd9 by Jansa Jose

payment change

parent 797bfa45
......@@ -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