Commit 6c37d8f4 by Jemsheer K D

Merge branch 'master' into client

parents fe4778cd 9ee8a085
<?php
$default_date = '01/01/2001';
?>
\ No newline at end of file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Appfeedback extends CI_Controller {
public function __construct() {
parent::__construct();
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
$this->load->model('Appfeedback_model');
}
public function index() {
$all_policy = $this->Appfeedback_model->get_doctor_feedback();
$template['page'] = "Appfeedback/feedback_doctor";
$template['page_title'] = "Manage Feedbacks";
$template['data'] = $all_policy;
$this->load->view('template', $template);
}
public function patient_index(){
$result = $this->Appfeedback_model->get_patient_feedback();
//print_r($result);exit();
$template['page'] = "Appfeedback/feedback_patient";
$template['page_title'] = "Manage Feedbacks";
$template['data'] = $result;
$this->load->view('template',$template);
}
}
\ No newline at end of file
......@@ -86,7 +86,7 @@ class MajorProblems extends CI_Controller {
$all_problems = $this->MajorProblem_model->get_all_Problems();
$all_subproblems = $this->MajorProblem_model->get_all_subProblems();
$template['page'] = "ManageSubProblems/addsubProblems";
$template['page'] = "ManageSubproblems/addsubProblems";
$template['page_title'] = "Add Major SubProblem";
$template['datas'] = $all_subproblems;
$template['data'] = $all_problems;
......
......@@ -254,6 +254,7 @@ class Webservice extends CI_Controller {
header('Content-type: application/json');
// $data =(array) json_decode(file_get_contents("php://input"));
$data = $_POST;
//print_r($this->string->default_date);exit();
//print_r($data);die();
if(isset($data['name']) && strlen($data['name']) && isset($data['username']) && strlen($data['username']) && isset($data['email']) && strlen($data['email']) && isset($data['password']) && strlen($data['password']) && isset($data['dob']) && strlen($data['dob']) && isset($data['gender']) && strlen($data['gender']) && isset($data['zip_code']) && strlen($data['zip_code']) && isset($data['street_address']) && strlen($data['street_address']) && isset($data['locality']) && strlen($data['locality']) && isset($data['number']) && strlen($data['number']) && isset($_FILES['profile_photo']))
{
......@@ -1630,7 +1631,7 @@ class Webservice extends CI_Controller {
if($end <= $end_time && ($initial > strtotime($nowin_server_addoffset))){
$time = date('h:i a',$initial).' - '.date('h:i a',$end);
$result = $this->Webservice_model->is_waiting_list_used($data,$time);
if($result != false || count($result) <= 1){
if($result == false || count($result) <= 1){
array_push($res['data']['time_interval'], array('time'=>date('h:i a',$initial).' - '.date('h:i a',$end)));
}
}
......@@ -1639,14 +1640,15 @@ class Webservice extends CI_Controller {
if($end <= $end_time && ($initial > strtotime($nowin_server_addoffset))){
$time = date('h:i a',$initial).' - '.date('h:i a',$end);
$result = $this->Webservice_model->is_waiting_list_used($data,$time);
if($result != false || count($result) <= 1){
if($result == false || count($result) <= 1){
array_push($res['data']['time_interval'], array('time'=>date('h:i a',$initial).' - '.date('h:i a',$end)));
}
}
}
}
}
}
}
//echo "<pre>";print_r($res['data']['time_interval']);exit();
$res['data']['time_interval'] = array_values(array_unique($res['data']['time_interval'],SORT_REGULAR));
}else{
$res = array(
......@@ -6583,9 +6585,7 @@ class Webservice extends CI_Controller {
}
if($result != ''){
foreach ($result as $key => $value) {
array_push($withdrawArray, $value);
}
}
......
......@@ -194,7 +194,6 @@ function user_menu() {
{"name":"View","cap":"manage_faqs","url":"ManageFaqs/faq_view_doctor","subcap":"manage_faqs/view_doctor_faqs"}
]'
),
array(
"slug" => "Manage Charity",
"name" => "Manage Charity",
......@@ -229,8 +228,24 @@ function user_menu() {
"capabilities" => array("cancelled_consultations"),
),
array(
"slug" => "App Feedback Doctor",//fa-wheelchair-alt,fa-blind
"name" => "App Feedback Doctor",
"url" => "Appfeedback",
"icon" => "fa-bars",
"submenu" => false,
"capabilities" => array("app_feedback_doctor"),
),
array(
"slug" => "App Feedback Patient",//fa-wheelchair-alt,fa-blind
"name" => "App Feedback Patient",
"url" => "Appfeedback/patient_index",
"icon" => "fa-bars",
"submenu" => false,
"capabilities" => array("app_feedback_patient"),
),
array(
"slug" => "Principal Issues",//fa-wheelchair-alt,fa-blind
"name" => "Principal Issues",
......@@ -373,6 +388,8 @@ function user_capabilities() {
"manage_faqs/view_doctor_faqs" => "View Doctor Faqs",
"manage_charity/add" => "Add Charity",
"manage_charity/add_services" => "Add Charity to Clinic",
"app_feedback_doctor" => "Doctor's App Feedback",
"app_feedback_patient" => "Patient's App Feedback",
"manage_wallet/withdrawal" => "Withdrawal History",
"cancelled_consultations" => "Cancelled Consultations",
"manage_doctors/add" => "Add New Doctors",
......@@ -419,6 +436,9 @@ function user_page_capabilities() {
"ManageClinic-view" => "manage_clinic/view",
"ManageClinic-bookingList" => "manage_clinic/bookinglist",
"Appfeedback-index" => "app_feedback_doctor",
"Appfeedback-patient_index" => "app_feedback_patient",
"Promocode-index" => "manage_promocode/add",
"Promocode-promocode_view" => "manage_promocode/view",
"ManageFaqs-index" => "manage_faqs/add",
......
<?php
class Appfeedback_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function get_doctor_feedback(){
$this->db->select('tbl_doctors.name,tbl_app_feedback.*');
$this->db->join('tbl_doctors','tbl_doctors.id = tbl_app_feedback.doctor_id');
$this->db->group_by('tbl_app_feedback.id');
$result = $this->db->get_where('tbl_app_feedback',array('doctor_id !=' =>'0'))->result();
if($result){
return $result;
}else{
return false;
}
}
public function get_patient_feedback(){
$this->db->select('tbl_registration.name,tbl_app_feedback.*');
$this->db->join('tbl_registration','tbl_registration.id = tbl_app_feedback.user_id');
$this->db->group_by('tbl_app_feedback.id');
$result = $this->db->get_where('tbl_app_feedback',array('user_id !=' => '0'))->result();
if($result){
return $result;
}else{
return false;
}
}
}
\ No newline at end of file
......@@ -1265,12 +1265,17 @@ CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='
$diff = $data['amount'];
$promo_name = '';
}
// $this->db->or_where("(booking_status = '1' OR booking_status = '2')");
$check = $this->db->get_where('tbl_booking',array('doctor_id'=>$data['doctor_id'],'clinic_id'=>$data['clinic_id'],'date'=>$data['date'],'time'=>$data['time'],'payment_status'=>'1'));
//echo $this->db->last_query();exit();
$this->db->select('name,profile_pic,specialization');
$doctr_data = $this->db->get_where('tbl_doctors',array('id'=>$data['doctor_id']))->row_array();
$this->db->select('name');
$pat_data = $this->db->get_where('tbl_registration',array('id'=>$patientid['userid']))->row_array();
$special = $this->db->get_where('tbl_specialization',array('id'=>$doctr_data['specialization']))->row();
$fcm_user = $this->db->get_where('tbl_authtoken',array('userid'=>$patientid['userid']))->row();
$conslt_time = date('Y-m-d h:i:s');
$conslt_time = strtotime($conslt_time);
$settngs = $this->db->get('settings')->row();
......@@ -1280,8 +1285,10 @@ CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='
$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 confirmed";
$msg2 = "You have a new booking on ".date('jS F Y',$data['date'])." at ".date('h:i A',$start_time);
$msg = "Your appointment was scheduled in the system, on ".date('d.m.Y',$start_time)." at ".date('H:i a',$start_time).", doctor ".$doctr_data['name'];
$msg2 = "A new appointment was scheduled in the system, on ".date('d.m.Y',$start_time)." at ".date('H:i a',$start_time).", patient ".decrypt_data($pat_data['name']);
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();
......@@ -1335,33 +1342,84 @@ CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='
}
}
elseif($check->num_rows() == 1){
$date_def = date('Y-m-d',$data['date']);
$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,'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($payment_status == '1'){
$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();
$check_data = $check->row_array();
//print_r($check_data);exit();
if($check_data['booking_status'] == 4){
$date_def = date('Y-m-d',$data['date']);
$times = explode('-', $data['time']);
$start_time = strtotime($date_def.$times[0]);
$end_time = strtotime($date_def.$times[1]);
$msg = "Your appointment was scheduled in the system, on ".date('d.m.Y',$start_time)." at ".date('H:i a',$start_time).", doctor ".$doctr_data['name'];
$msg2 = "A new appointment was scheduled in the system, on ".date('d.m.Y',$start_time)." at ".date('H:i a',$start_time).", patient ".decrypt_data($pat_data['name']);
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($payment_status == '1'){
$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();
$new['id'] = $patient_insert_id;
$new['type'] = "Consultation Confirmation";
$new['booking_id'] = $insert_id;
$new['booking_date'] = $data['date'];
$new['doctor_id'] = $data['doctor_id'];
$new['doctor_name'] = $doctr_data['name'];
$new['doctor_specialization'] = $special->specialization_name;
$new['doctor_photo'] = $doctr_data['profile_pic'];
$new['message'] = $msg;
$new['time'] = $conslt_time;
$new['to'] =$fcm_user->fcm_token;
$user_type = '1';
$user_push = $this->push_sent($new,$user_type);
$this->db->insert('tbl_doctor_notifications',array('doctor_id'=>$data['doctor_id'],'type'=>'2','message'=>$msg2,'time'=>$conslt_time,'read_status'=>'0'));
$doctor_insert_id = $this->db->insert_id();
$fcm_doctor = $this->db->get_where('tbl_authtoken_doctors',array('doctor_id'=>$data['doctor_id']))->row();
$news['id'] = $doctor_insert_id;
$news['type'] = "New Consultation";
$news['message'] =$msg2;
$news['read_status'] = false;
$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{
$return_array = array('status'=>'fail','msg' =>'insertion failed');
}
}else{
$date_def = date('Y-m-d',$data['date']);
$times = explode('-', $data['time']);
$start_time = strtotime($date_def.$times[0]);
$end_time = strtotime($date_def.$times[1]);
$new['id'] = $patient_insert_id;
$new['type'] = "Waiting List";
$new['booking_id'] = $insert_id;
$new['booking_date'] = $data['date'];
$new['doctor_id'] = $data['doctor_id'];
$new['doctor_name'] = $doctr_data['name'];
$new['doctor_specialization'] = $special->specialization_name;
$new['doctor_photo'] = $doctr_data['profile_pic'];
$new['message'] = $msg;
$new['time'] = $conslt_time;
$new['to'] =$fcm_user->fcm_token;
$user_type = '1';
$user_push = $this->push_sent($new,$user_type);
$msg = "Your appointment was scheduled in the system as waiting, on ".date('d.m.Y',$start_time)." at ".date('H:i a',$start_time).", doctor ".$doctr_data['name'];
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($payment_status == '1'){
$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();
$new['id'] = $patient_insert_id;
$new['type'] = "Waiting List";
$new['booking_id'] = $insert_id;
$new['booking_date'] = $data['date'];
$new['doctor_id'] = $data['doctor_id'];
$new['doctor_name'] = $doctr_data['name'];
$new['doctor_specialization'] = $special->specialization_name;
$new['doctor_photo'] = $doctr_data['profile_pic'];
$new['message'] = $msg;
$new['time'] = $conslt_time;
$new['to'] =$fcm_user->fcm_token;
$user_type = '1';
$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));
}
$return_array = array('status'=>'failed','data' =>array('booking_id'=>$insert_id,'is_waiting'=>true,'is_payment_required'=>$is_payment_required));
}
}
}
elseif($check->num_rows() > 1){
......@@ -1870,6 +1928,7 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
function is_waiting_list_used($data,$time){
$query = $this->db->get_where('tbl_booking',array('doctor_id'=>$data['doctor_id'],'clinic_id'=>$data['clinic_id'],'date'=>$data['date'],'time'=>$time))->result();
// echo $this->db->last_query();echo"<br>";
if(count($query) > 0){
return $query;
}else{
......@@ -1905,11 +1964,11 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
if($rslt){
$this->db->select('name');
$doctr_data = $this->db->get_where('tbl_registration',array('id'=>$rslt->userid))->row();
$msg = "Your have a new review from ".decrypt_data($doctr_data->name);
$query = $this->db->get_where('tbl_booking',array('medical_record_id'=>$data['medical_record_id']))->row();
$msg = "The patient ".decrypt_data($doctr_data->name)." evaluated his consultation on ".date('d.m.Y',$query->time_start);
$data['reviewer_id'] = $rslt->userid;
$datetime = Date('Y-m-d h:i:s');
$data['date'] = strtotime($datetime);
$query = $this->db->get_where('tbl_booking',array('medical_record_id'=>$data['medical_record_id']))->row();
if($query){
if($query->medical_record_id != '' || $query->medical_record_id != '0'){
$med_data = $this->db->get_where('tbl_medical_records',array('id'=>$data['medical_record_id']))->row();
......@@ -2200,11 +2259,14 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
}
$nowin_server_addoffset = strtotime($nowin_server_addoffset);
$this->db->select('name,specialization');
$doctr_data = $this->db->get_where('tbl_doctors',array('id'=>$query['doctor_id']))->row_array();
$special = $this->db->get_where('tbl_specialization',array('id'=>$doctr_data['specialization']))->row();
$msg = "Your booking for doctor ".$doctr_data['name']." at time ".$query['time']."is Cancelled";
$msg2 = "Your booking for doctor ".$doctr_data['name']." at time ".$query['time']." is confirmed";
$msg = "Your appointment scheduled in the system, on ".date('d.m.Y',$query['time_start'])." at ".date('H:i a',$query['time_start']).", doctor ".$doctr_data['name'] ." is Canceled!";
$msg2 = "Your appointment was scheduled in the system, on ".date('d.m.Y',$query['time_start'])." at ".date('H:i a',$query['time_start']).", doctor ".$doctr_data['name'];
$conslt_time = date('Y-m-d h:i:s');
$conslt_time = strtotime($conslt_time);
if($nowin_server_addoffset < $new_date){
......@@ -2233,7 +2295,7 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$fcm_user = $this->db->get_where('tbl_authtoken',array('userid'=>$ress['patient_id']))->row();
$new['id'] = $patient_insert_id;
$new['type'] = "Waiting List";
$new['booking_id'] = $query['id'];
$new['booking_id'] = $ress['id'];
$new['booking_date'] = $query['date'];
$new['doctor_id'] = $query['doctor_id'];
$new['doctor_name'] = $doctr_data['name'];
......@@ -2244,7 +2306,9 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$user_type = '1';
$push = $this->push_sent($new,$user_type);
$msg3 = "You have a new booking on ".date('jS F Y',$query['date'])." at ".date('h:i A',$query['time_start']);
$this->db->select('name');
$pat_data = $this->db->get_where('tbl_registration',array('id'=>$query['patient_id']))->row_array();
$msg3 = "A new appointment was scheduled in the system, on ".date('d.m.Y',$query['time_start'])." at ".date('H:i a',$query['time_start']).", patient ".decrypt_data($pat_data['name']);
$this->db->insert('tbl_doctor_notifications',array('doctor_id'=>$query['doctor_id'],'type'=>'2','message'=>$msg3,'time'=>$conslt_time,'read_status'=>'0'));
$doctor_insert_id = $this->db->insert_id();
$fcm_doctor = $this->db->get_where('tbl_authtoken_doctors',array('doctor_id'=>$query['doctor_id']))->row();
......@@ -2255,6 +2319,31 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$news['to'] = $fcm_doctor->fcm_token;
$doctor_type = '2';
$doctor_push = $this->push_sent($news,$doctor_type);
}else{
$nextday = strtotime(date('Y-m-d', strtotime('+1 day', $query['date'])));
$next_day_consult = $this->db->get_where('tbl_booking',array('doctor_id'=>$query['doctor_id'],'clinic_id'=>$query['clinic_id'],'date'=>$nextday,'booking_status'=>'0','time'=>$query['time']))->row_array();
if($next_day_consult){
$msg3 = "Your Wait Listed Appointment on ".date('d.m.Y h:i a',$next_day_consult['time_start'])." can be changed to ".date('d.m.Y h:i a',$query['time_start'])." as the Time Slot is Available Now. Would you like to change the Appointment on Available Slot ?";
$this->db->insert('tbl_patient_notification',array('patient_id'=>$next_day_consult['patient_id'],'type'=>'0','message'=>$msg3,'time'=>$conslt_time,'booking_id'=>$query['id'],'read_status'=>'0'));
$new_patient_insert_id = $this->db->insert_id();
$fcm_user_new = $this->db->get_where('tbl_authtoken',array('userid'=>$next_day_consult['patient_id']))->row();
$new['id'] = $new_patient_insert_id;
$new['type'] = "Consultation Confirmation";
$new['booking_id'] = $next_day_consult['id'];
$new['booking_date'] = $query['date'];
$new['doctor_id'] = $query['doctor_id'];
$new['doctor_name'] = $doctr_data['name'];
$new['doctor_specialization'] = $special->specialization_name;
$new['message'] = $msg3;
$new['time'] = $conslt_time;
$new['to'] =$fcm_user_new->fcm_token;
$user_type = '1';
$push = $this->push_sent($new,$user_type);
}
}
if($query['visit_type'] == '0' && $query['payment_type'] == '2'){
$doctor_wallet = $this->db->get_where('tbl_wallet_details',array('doctor_id'=>$query['doctor_id']))->row();
......@@ -2602,7 +2691,7 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$med = array();
$prescrb = json_decode(decrypt_data($result['prescribtions']));
if($prescrb == ''){
$med = [];
$result['prescription'] = [];
}else{
foreach ($prescrb as $key => $value) {
$med[$key]['medicine_name'] = $value->name;
......@@ -2617,7 +2706,7 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$exam = json_decode(decrypt_data($result['exams']));
if($exam == ''){
$examss = [];
$result['medical_test'] = [];
}else{
foreach ($exam as $key => $value) {
$examss[$key]['test_name'] = $value->procedure;
......@@ -2629,7 +2718,8 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$bud = array();
$budget = json_decode(decrypt_data($result['budget']));
if($budget == ''){
$budget = [];
$result['services'] = [];
$result['total'] = 0 ;
}else{
$tot = 0;
foreach ($budget as $key => $value) {
......@@ -2644,7 +2734,7 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$images = json_decode($result['images']);
if($images == ''){
$images = [];
$result['photos'] = [];
}else{
$result['photos'] = $images;
}
......@@ -3337,7 +3427,7 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$doctr_data = $this->db->get_where('tbl_doctors',array('id'=>$id))->row_array();
$special = $this->db->get_where('tbl_specialization',array('id'=>$doctr_data['specialization']))->row();
$conslt_time = strtotime(date('Y-m-d h:i:s'));
$msg = "Sorry, Your booking at time ".$query->time." is cancelled by ".$doctr_data['name'];
$msg = "Your appointment scheduled in the system, on ".date('d.m.Y',$query->time_start)." at ".date('H:i a',$query->time_start).", doctor ".$doctr_data['name'] ." is Canceled!";
if($query){
if($query->doctor_id == $id){
$this->db->update('tbl_booking',array('booking_status'=>'4'),array('id'=>$data['booking_id']));
......@@ -3422,6 +3512,11 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
$query = $this->db->get_where('tbl_booking',array('id'=>$data['booking_id']))->row();
if($query){
$this->db->update('tbl_booking',array('booking_status'=>'2'),array('id'=>$data['booking_id']));
$new['main_complaint'] = null;
$new['booking_id'] = $data['booking_id'];
$this->db->insert('tbl_medical_records',$new);
$last_id = $this->db->insert_id();
$this->db->update('tbl_booking',array('medical_record_id'=>$last_id),array('id'=>$data['booking_id']));
$result = array('status'=>'success');
}else{
$result = array('status'=>'failed','message'=>'Invalid Booking Id');
......@@ -3596,7 +3691,7 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
}else{
$return = array('status'=>'failed','message'=>'Something Went Wrong..Try Again Later!');
}
}else{
}/*else{
$this->db->insert('tbl_medical_records',$new);
$last_id = $this->db->insert_id();
if($this->db->update('tbl_booking',array('medical_record_id'=>$last_id),array('id'=>$data['booking_id']))){
......@@ -3604,7 +3699,7 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
}else{
$return = array('status'=>'failed','message'=>'Something Went Wrong..Try Again Later!');
}
}
}*/
}else{
$return = array('status'=>'failed','message'=>'Invalid Doctor');
}
......@@ -4026,7 +4121,12 @@ CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'F
public function check_wait_listed($data){
$check = $this->db->get_where('tbl_booking',array('doctor_id'=>$data['doctor_id'],'clinic_id'=>$data['clinic_id'],'date'=>$data['date'],'time'=>$data['time'],'payment_status'=>'1'));
if($check->num_rows() > 0){
$is_booking = true;
$check_data = $check->row_array();
if($check_data['booking_status'] == 4){
$is_booking = false;
}else{
$is_booking = true;
}
}else{
$is_booking = false;
}
......@@ -4345,10 +4445,10 @@ CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='
$key = $rs->api_key;
//free booking,confirmed,for user
if($type == '1'){
$data = "{ \"notification\": { \"title\": \"".$fcm_data['type']."\", \"text\": \"".$fcm_data['message']."\" , \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"id\" : \"".$fcm_data['id']."\",\"type\" : \"".$fcm_data['type']."\",\"booking_id\" : \"".$fcm_data['booking_id']."\",\"booking_date\" : \"".$fcm_data['booking_date']."\",\"doctor_id\" : \"".$fcm_data['doctor_id']."\",\"doctor_name\" : \"".$fcm_data['doctor_name']."\",\"doctor_specialization\" : \"".$fcm_data['doctor_specialization']."\",\"message\" : \"".$fcm_data['message']."\",\"time\" : \"".$fcm_data['time']."\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_data['to']."\"}";
$data = "{ \"notification\": { \"title\": \"".$fcm_data['type']."\", \"text\": \"".$fcm_data['message']."\" , \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"id\" : \"".$fcm_data['id']."\",\"type\" : \"".$fcm_data['type']."\",\"booking_id\" : \"".$fcm_data['booking_id']."\",\"booking_date\" : \"".$fcm_data['booking_date']."\",\"doctor_id\" : \"".$fcm_data['doctor_id']."\",\"doctor_name\" : \"".$fcm_data['doctor_name']."\",\"doctor_specialization\" : \"".$fcm_data['doctor_specialization']."\",\"message\" : \"".$fcm_data['message']."\",\"time\" : \"".$fcm_data['time']."\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"content_available\":true, \"to\" : \"".$fcm_data['to']."\"}";
//free booking, confirmed, for doctor
}else if($type == '2'){
$data = "{ \"notification\": { \"title\": \"".$fcm_data['type']."\", \"text\": \"".$fcm_data['message']."\" , \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"id\" : \"".$fcm_data['id']."\",\"type\" : \"".$fcm_data['type']."\",\"message\" : \"".$fcm_data['message']."\",\"read_status\" : \"".$fcm_data['read_status']."\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_data['to']."\"}";
$data = "{ \"notification\": { \"title\": \"".$fcm_data['type']."\", \"text\": \"".$fcm_data['message']."\" , \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"id\" : \"".$fcm_data['id']."\",\"type\" : \"".$fcm_data['type']."\",\"message\" : \"".$fcm_data['message']."\",\"read_status\" : \"".$fcm_data['read_status']."\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"content_available\":true, \"to\" : \"".$fcm_data['to']."\"}";
}/*else if($type == '3'){
$data = "{ \"notification\": { \"title\": \"".$fcm_data['type']."\", \"text\": \"".$fcm_data['message']."\" , \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"id\" : \"".$fcm_data['id']."\",\"type\" : \"".$fcm_data['type']."\",\"booking_id\" : \"".$fcm_data['booking_id']."\",\"booking_date\" : \"".$fcm_data['booking_date']."\",\"doctor_id\" : \"".$fcm_data['doctor_id']."\",\"doctor_name\" : \"".$fcm_data['doctor_name']."\",\"doctor_specialization\" : \"".$fcm_data['doctor_specialization']."\",\"message\" : \"".$fcm_data['message']."\",\"time\" : \"".$fcm_data['time']."\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_data['to']."\"}";
}*/
......
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>Doctor Feedbacks</h1>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<!-- Add -->
<div class="col-md-12">
<?php
if($this->session->flashdata('message')) {
$message = $this->session->flashdata('message');
?>
<div class="alert alert-<?php echo $message['class']; ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?php echo $message['message']; ?>
</div>
<?php
}
?>
</div>
<div class="col-xs-12">
<div class="box box-solid box-info">
<div class="box-header">
<h3 class="box-title">Doctor Feedbacks</h3>
</div>
<div class="box-body">
<?php if($data != ''){?>
<table class="table table-bordered table-striped datatable" data-ordering="true">
<thead>
<tr>
<th class="hidden">ID</th>
<th>Name</th>
<th>Feedback Type</th>
<th>Feedback Content</th>
</tr>
</thead>
<tbody>
<?php
foreach($data as $customer) {?>
<tr>
<td class="hidden"><?php echo $customer->id; ?></td>
<td><?php echo $customer->name; ?></td>
<td><?php if($customer->feedback_type == 0){
echo "Problemas Atendimento";
}else if ($customer->feedback_type == 1) {
echo "Dificuldade para agendamento";
}else if($customer->feedback_type == 2){
echo "Problemas Pagamento";
}else{
echo "Outros";
}
?></td>
<td><?php echo $customer->feedback_content; ?></td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th class="hidden">ID</th>
<th>Name</th>
<th>Feedback Type</th>
<th>Feedback Content</th>
</tr>
</tfoot>
</table>
<?php } else{ ?>
<div>No Result Found</div>
<?php } ?>
</div>
</div>
</div>
<!-- /.row -->
</section><!-- /.content -->
</div>
\ No newline at end of file
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>Patient Feedbacks</h1>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<!-- Add -->
<div class="col-md-12">
<?php
if($this->session->flashdata('message')) {
$message = $this->session->flashdata('message');
?>
<div class="alert alert-<?php echo $message['class']; ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?php echo $message['message']; ?>
</div>
<?php
}
?>
</div>
<div class="col-xs-12">
<div class="box box-solid box-info">
<div class="box-header">
<h3 class="box-title">Patient Feedbacks</h3>
</div>
<div class="box-body">
<?php if($data != ''){?>
<table class="table table-bordered table-striped datatable" data-ordering="true">
<thead>
<tr>
<th class="hidden">ID</th>
<th>Name</th>
<th>Feedback Type</th>
<th>Feedback Content</th>
</tr>
</thead>
<tbody>
<?php
foreach($data as $customer) {?>
<tr>
<td class="hidden"><?php echo $customer->id; ?></td>
<td><?php echo $customer->name; ?></td>
<td><?php if($customer->feedback_type == 0){
echo "Problemas Atendimento";
}else if ($customer->feedback_type == 1) {
echo "Dificuldade para agendamento";
}else if($customer->feedback_type == 2){
echo "Problemas Pagamento";
}else{
echo "Outros";
}
?></td>
<td><?php echo $customer->feedback_content; ?></td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th class="hidden">ID</th>
<th>Name</th>
<th>Feedback Type</th>
<th>Feedback Content</th>
</tr>
</tfoot>
</table>
<?php } else{ ?>
<div>No Result Found</div>
<?php } ?>
</div>
</div>
</div>
<!-- /.row -->
</section><!-- /.content -->
</div>
\ No newline at end of file
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