Commit cf62b582 by Jansa Jose

booking dctor

parent b20909c7
......@@ -928,6 +928,21 @@ class Webservice_model extends CI_Model {
$msg2 = "You have a new booking on ".date('jS F Y',$data['date'])." at ".date('h:i A',$start_time);
if($this->db->insert('tbl_booking',array('doctor_id'=>$data['doctor_id'],'clinic_id'=>$data['clinic_id'],'patient_id'=>$patientid['userid'],'ipok_fee'=>$ipokefees,'date'=>$data['date'],'time'=>$data['time'],'booking_status'=>'1','payment_status'=>$payment_status,'free_visit_status'=>$free_visit_status,'visit_type'=>$visit,'amount'=>$data['amount'],'promo_name'=>$promo_name,'promo_amount'=>$new_amnt,'total_sum'=>$diff,'time_start'=>$start_time,'time_end'=>$end_time,'requested_date'=>time()))){
$insert_id = $this->db->insert_id();
if($visit == '0'){
$doctor_wallet = $this->db->get_where('tbl_wallet_details',array('doctor_id'=>$data['doctor_id']))->row();
$ipkfee = $this->db->get('settings')->row();
$futures = $diff - (($diff * $ipkfee->ipok_fee)/100);
if($doctor_wallet){
$future = $futures + ($doctor_wallet->future_earn);
$total = $future + ($doctor_wallet->reedem_earn);
$this->db->update('tbl_wallet_details',array('future_earn'=>$future,'total_earn'=>$total),array('doctor_id'=>$data['doctor_id']));
}else{
$this->db->insert('tbl_wallet_details',array('future_earn'=>$future,'total_earn'=>$future,'doctor_id'=>$data['doctor_id'],'reedem_earn'=>'0'));
}
}
if(!$is_payment_required){
$this->db->insert('tbl_patient_notification',array('patient_id'=>$patientid['userid'],'type'=>'0','message'=>$msg,'time'=>$conslt_time,'booking_id'=>$insert_id,'read_status'=>'0'));
$patient_insert_id = $this->db->insert_id();
......
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