Commit a1e52b2a by Dixon Joseph

Merge branch 'jansa' into dixon

parents 78604019 70bf47d1
......@@ -43,7 +43,16 @@ class Webservice extends CI_Controller {
$ress = $this->cpf_valid($data['cpf']);
if((isset($ress)) && ($ress == 1)){
/*$is_cpf = $this->Webservice_model->is_cpf_exist($data['cpf']);
if($is_cpf['status'] == 'success'){*/
$res = $this->registration_processing_user($data,$type);
/*}else{
$res = array(
"status"=> "error",
"error"=> "CPF Exist",
"message"=> "CPF Already Exist"
);
}*/
}else{
$res = array(
"status"=> "error",
......@@ -1098,7 +1107,7 @@ class Webservice extends CI_Controller {
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -1143,7 +1152,7 @@ class Webservice extends CI_Controller {
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}
......@@ -1155,7 +1164,7 @@ class Webservice extends CI_Controller {
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}
......@@ -2652,7 +2661,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -2688,7 +2697,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
......@@ -2698,7 +2707,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('faq_list'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -3024,7 +3033,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -3048,9 +3057,9 @@ print_r(date('H:i',$ms));exit();*/
$totalPages = (int)($total / $per_page);
}
else{
$totalPages = 1;
$totalPages = 0;
}
if($result != ''){
if($result != false){
foreach (array_slice($result,$start,$per_page) as $key => $value) {
array_push($notiArray, $value);
......@@ -3067,7 +3076,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
......@@ -3077,7 +3086,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('unread_count'=>$total_count,'notification_list'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -3115,7 +3124,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -3147,7 +3156,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
......@@ -3157,7 +3166,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('recent_chats'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -4253,7 +4262,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -4290,7 +4299,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
......@@ -4300,7 +4309,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('reviews'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -4337,7 +4346,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -4372,7 +4381,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' =>$per_page)
);
......@@ -4382,7 +4391,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('faq_list'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' =>$currentpage+1,
'per_page' =>$per_page)
);
}
......@@ -4420,7 +4429,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -4454,7 +4463,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
......@@ -4464,7 +4473,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('patients'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -4502,7 +4511,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -4535,7 +4544,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
......@@ -4545,7 +4554,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('anniversaries'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}
......@@ -4772,7 +4781,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -4807,7 +4816,7 @@ print_r(date('H:i',$ms));exit();*/
'data'=>$result['data'],
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}else{
......@@ -4816,7 +4825,7 @@ print_r(date('H:i',$ms));exit();*/
'data'=>$result['data'],
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}
......@@ -4861,7 +4870,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -4894,7 +4903,7 @@ print_r(date('H:i',$ms));exit();*/
'data'=>$result['data'],
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}else{
......@@ -4903,7 +4912,7 @@ print_r(date('H:i',$ms));exit();*/
'data'=>array('consultations'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}
......@@ -4940,7 +4949,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -4975,7 +4984,7 @@ print_r(date('H:i',$ms));exit();*/
'data'=>$result['data'],
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}else{
......@@ -4984,7 +4993,7 @@ print_r(date('H:i',$ms));exit();*/
'data'=>array('consultations'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}
......@@ -5021,7 +5030,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -5054,7 +5063,7 @@ print_r(date('H:i',$ms));exit();*/
'data'=>$result['data'],
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}else{
......@@ -5063,7 +5072,7 @@ print_r(date('H:i',$ms));exit();*/
'data'=>array('consultations'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -5146,7 +5155,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -5185,7 +5194,7 @@ print_r(date('H:i',$ms));exit();*/
'data'=>array('unread_count'=>$total_count,'notifications'=>$notifArray),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}else{
......@@ -5194,7 +5203,7 @@ print_r(date('H:i',$ms));exit();*/
'data'=>array('unread_count'=>$total_count,'notifications'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' =>$page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
}
......@@ -5408,7 +5417,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -5444,7 +5453,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
......@@ -5454,7 +5463,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('recent_chats'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -6115,7 +6124,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -6150,7 +6159,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
......@@ -6160,7 +6169,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('consultation'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -6198,7 +6207,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -6233,7 +6242,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
......@@ -6243,7 +6252,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('consultation'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -6425,7 +6434,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -6459,7 +6468,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
......@@ -6469,7 +6478,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('banks'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -6507,7 +6516,7 @@ print_r(date('H:i',$ms));exit();*/
$page_no = $_GET['page'];
}
else{
$currentpage = 1;
$currentpage = 0;
$start = 0;
$page_no = 0;
}
......@@ -6541,7 +6550,7 @@ print_r(date('H:i',$ms));exit();*/
),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' =>$currentpage+1,
'per_page' => $per_page)
);
......@@ -6551,7 +6560,7 @@ print_r(date('H:i',$ms));exit();*/
"data"=>array('withdrawal_history'=>[]),
'meta' => array('total_pages' => $totalPages,
'total' => $total,
'current_page' => $page_no,
'current_page' => $currentpage+1,
'per_page' => $per_page)
);
}
......@@ -6853,7 +6862,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 +7029,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",
......
......@@ -78,6 +78,10 @@ class Webservice_model extends CI_Model {
}else{
if($this->db->insert('tbl_doctors', $data)){
$insertid = $this->db->insert_id();
$this->db->insert('tbl_clinic_doctors',array('doctor_id'=>$insertid,'clinic_id'=> 0));
$this->db->insert('tbl_consultation',array('doctor_id'=>$insertid,'clinic_id'=> 0,'date'=>'""','date_secondary'=>'""','active_schedule'=> 0));
$this->db->select('tbl_specialization.id as specialization_id,tbl_specialization.specialization_name,tbl_doctors.*');
$this->db->join('tbl_specialization','tbl_specialization.id = tbl_doctors. specialization');
$query = $this->db->get_where("tbl_doctors",array("tbl_doctors.id"=>$insertid));
......@@ -1048,7 +1052,7 @@ class Webservice_model extends CI_Model {
$end_time = strtotime($date_def.$times[1]);
$msg = "Your booking for doctor ".$doctr_data['name']." at time ".$data['time']." is confirmed";
$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()))){
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,'payment_type'=>$data['payment_mode'],'total_sum'=>$diff,'time_start'=>$start_time,'time_end'=>$end_time,'requested_date'=>time()))){
$insert_id = $this->db->insert_id();
if($visit == '0'){
......@@ -1065,7 +1069,7 @@ class Webservice_model extends CI_Model {
}
}
if(!$is_payment_required){
//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();
......@@ -1093,7 +1097,7 @@ class Webservice_model extends CI_Model {
$news['to'] = $fcm_doctor->fcm_token;
$doctor_type = '2';
$doctor_push = $this->push_sent($news,$doctor_type);
}
//}
$return_array = array('status'=>'success','data'=>array('booking_id'=>$insert_id,'is_waiting'=>false,'is_payment_required'=>$is_payment_required));
}
else{
......@@ -1105,10 +1109,10 @@ class Webservice_model extends CI_Model {
$times = explode('-', $data['time']);
$start_time = strtotime($date_def.$times[0]);
$end_time = strtotime($date_def.$times[1]);
$msg = "Your booking for doctor ".$doctr_data->name." at time ".$data['time']." is in Waiting list";
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'=>'0','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()))){
$msg = "Your booking for doctor ".$doctr_data['name']." at time ".$data['time']." is in Waiting list";
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'=>'0','payment_status'=>$payment_status,'free_visit_status'=>$free_visit_status,'visit_type'=>$visit,'amount'=>$data['amount'],'promo_name'=>$promo_name,'promo_amount'=>$new_amnt,'payment_type'=>$data['payment_mode'],'total_sum'=>$diff,'time_start'=>$start_time,'time_end'=>$end_time,'requested_date'=>time()))){
$insert_id = $this->db->insert_id();
if(!$is_payment_required){
//if(!$is_payment_required){
$this->db->insert('tbl_patient_notification',array('patient_id'=>$patientid['userid'],'type'=>'1','message'=>$msg,'time'=>$conslt_time,'booking_id'=>$insert_id,'read_status'=>'0'));
$patient_insert_id = $this->db->insert_id();
......@@ -1125,7 +1129,7 @@ class Webservice_model extends CI_Model {
$new['to'] =$fcm_user->fcm_token;
$user_type = '3';
$user_push = $this->push_sent($new,$user_type);
}
//}
$return_array = array('status'=>'failed','data' =>array('booking_id'=>$insert_id,'is_waiting'=>true,'is_payment_required'=>$is_payment_required));
}
......@@ -1162,6 +1166,16 @@ class Webservice_model extends CI_Model {
//............................ get clinic specialisation
function is_cpf_exist($cpf){
$res = $this->db->get_where('tbl_cpf_number',array('cpf'=>$cpf))->row();
if($res){
$query = array('status'=>'error');
}else{
$query = array('status'=>'success');
}
return $query;
}
function get_clinic_specialisation(){
$this->db->select("DISTINCT(tbl_specialization.specialization_name),tbl_clinic_specialization.clinic_id,tbl_specialization.id");
$this->db->join('tbl_specialization','tbl_specialization.id = tbl_clinic_specialization.specialization_id');
......@@ -2649,10 +2663,23 @@ class Webservice_model extends CI_Model {
$this->db->select('tbl_clinic.id,tbl_clinic.name,tbl_clinic.email,tbl_clinic.profile_photo,tbl_clinic.location_lattitude,tbl_clinic.location_longitude,tbl_clinic.street_address,tbl_clinic.locality,tbl_clinic.number,tbl_clinic.complement');
$this->db->join('tbl_clinic','tbl_clinic_doctors.clinic_id = tbl_clinic.id');
$this->db->where('tbl_clinic_doctors.doctor_id',$id);
$this->db->order_by('tbl_clinic.id','ASC');
$query = $this->db->get('tbl_clinic_doctors')->result();
array_splice($query, 0, 1);
if(count($query) > 0){
foreach ($query as $key => $value) {
$this->db->select('tbl_clinic.id,tbl_clinic.name,tbl_clinic.email,tbl_clinic.profile_photo,tbl_doctors.default_latitude as location_lattitude,tbl_doctors.default_longitude as location_longitude,tbl_doctors.street_address,tbl_doctors.locality,tbl_doctors.number,tbl_doctors.complement');
$this->db->from('tbl_clinic_doctors');
$this->db->join('tbl_clinic','tbl_clinic_doctors.clinic_id = tbl_clinic.id');
$this->db->join('tbl_doctors','tbl_clinic_doctors.doctor_id = tbl_doctors.id');
$this->db->where('tbl_clinic_doctors.clinic_id','0');
$this->db->where('tbl_clinic_doctors.doctor_id',$id);
$query_default = $this->db->get()->result();
$new_query = array_merge($query_default,$query);
//echo"<pre>";print_r($new_query);exit();
if(count($new_query) > 0){
foreach ($new_query as $key => $value) {
$location = $value->street_address.','.$value->locality.','.$value->number.','.$value->complement;
$new[$key]['id'] = $value->id;
$new[$key]['name'] = $value->name;
......@@ -3865,22 +3892,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) {
......
......@@ -983,6 +983,7 @@ class Home extends CI_Controller {
//print_r($data);
<<<<<<< HEAD
$data['password'] = md5($data['password']);
......@@ -990,6 +991,8 @@ class Home extends CI_Controller {
unset($data['month']);
unset($data['year']);
=======
>>>>>>> jansa
//$this->Doctor_model->assignDoctors_default($this->session->userdata('UserData')['id'],'');
$result = $this->Home_model->register_doctor($data);
......
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