Commit f89932ac by Jansa Jose

web load

parent ee3dd9ad
......@@ -175,7 +175,7 @@ public function cancelBooking()
/*CODE FOR WALLET INSERTION*/
/*---------------------------------------------------*/
$booking_details = $this->Doctor_model->get_booking_details($_POST['booking_id']);
if($booking_details['visit_type']==0)
if($booking_details['visit_type']==0 && ($booking_details['payment_type'] == '2'))
{
//print_r($booking_details);die();
//$ipok_settings = $this->Home_model->get_ipok_settings();
......
......@@ -97,9 +97,10 @@ public function cancelBooking()
/*CODE FOR WALLET INSERTION*/
/*---------------------------------------------------*/
$booking_details = $this->Doctor_model->get_booking_details($_POST['booking_id']);
if($booking_details['visit_type']==0)
if($booking_details['visit_type']==0 && ($booking_details['payment_type'] == '2'))
{
$wallet = $this->Doctor_model->get_wallet_for_doctor($booking_details['doc_id']);
//print_r($wallet);exit();
$earn = $booking_details['book_price'] - (($booking_details['book_price'] * $booking_details['ipok_fee'])/100);
$wallet['future_earn'] = $wallet['future_earn'] - $earn;
$wallet['total_earn'] = $wallet['total_earn'] - $earn;
......
......@@ -386,6 +386,7 @@ public function get_booking_details($book_id)
tbl_booking.total_sum as book_price,
tbl_booking.visit_type as visit_type,
tbl_booking.ipok_fee as ipok_fee,
tbl_booking.payment_type,
tbl_booking.time_start as time_start,
tbl_registration.id as pat_id,
tbl_registration.name as pat_name,
......@@ -843,19 +844,21 @@ public function get_wallet_for_doctor($doc_id)
$this->db->from('tbl_wallet_details');
$this->db->where('doctor_id',$doc_id);
$query = $this->db->get()->row_array();
if($query){
$query['reedem_earn'] = decrypt_data($query['reedem_earn']);
$query['future_earn'] = decrypt_data($query['future_earn']);
$query['total_earn'] = decrypt_data($query['total_earn']);
}
//print_r($query);echo"<br>";
return $query;
}
public function update_wallet($id,$data)
{
//print_r($data);
$sql = $this->db->insert_string('tbl_wallet_details', array("doctor_id"=>$id,"reedem_earn"=>encrypt_data($data['reedem_earn']),"future_earn"=>encrypt_data($data['future_earn']),"total_earn"=>encrypt_data($data['total_earn']))) . ' ON DUPLICATE KEY UPDATE doctor_id = ' .$id.',reedem_earn ='.'"' .encrypt_data($data['reedem_earn']).'"'.',future_earn='.'"' .encrypt_data($data['future_earn']).'"' .',total_earn='. '"' .$data['total_earn'].'"';
//print_r($this->db->last_sqlquery());die();
//echo $this->db->last_query();
if($this->db->query($sql)){
$return_array = array('status'=>'success');
}
......
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