Commit 678c40b5 by Jithin

initial scope project delivery

parent 677d5742
...@@ -88,7 +88,7 @@ $query_builder = TRUE; ...@@ -88,7 +88,7 @@ $query_builder = TRUE;
$db['default'] = array( $db['default'] = array(
'dsn' => '', 'dsn' => '',
'hostname' => '192.168.138.123', 'hostname' => '192.168.140.123',
'username' => 'root', 'username' => 'root',
'password' => '', 'password' => '',
'database' => 'reeba_ipok', 'database' => 'reeba_ipok',
......
...@@ -9,6 +9,7 @@ class Home extends CI_Controller { ...@@ -9,6 +9,7 @@ class Home extends CI_Controller {
$this->load->model('Home_model'); $this->load->model('Home_model');
$this->load->model('Patient_model'); $this->load->model('Patient_model');
$this->load->model('Doctor_model'); $this->load->model('Doctor_model');
$this->load->model('Search_doctor_model');
$this->load->library('facebook'); // Load facebook library $this->load->library('facebook'); // Load facebook library
} }
...@@ -705,9 +706,15 @@ class Home extends CI_Controller { ...@@ -705,9 +706,15 @@ class Home extends CI_Controller {
public function error() public function error()
{ {
$template['page'] = "error_notauthorized"; $template['page'] = "error_notauthorized";
//$this->load->view('error_notauthorized', $template);
if($this->uri->segment(3) and $this->uri->segment(3)=='url')
{
$template['page'] = "error_invalidurl";
}
$template['page_title'] = "Error"; $template['page_title'] = "Error";
$this->load->view('template/template', $template); $this->load->view('template/template', $template);
//$this->load->view('error_notauthorized', $template);
} }
...@@ -833,16 +840,18 @@ public function redemptionrequest() ...@@ -833,16 +840,18 @@ public function redemptionrequest()
$get_account_balance = $this->Home_model->get_redemption_balance($userdata['id']); $get_account_balance = $this->Home_model->get_redemption_balance($userdata['id']);
$check_valid_bank = $this->Home_model->get_bank_valid($userdata['id'],$_POST['redemption_bank']); $check_valid_bank = $this->Home_model->get_bank_valid($userdata['id'],$_POST['redemption_bank']);
//print_r($check_valid_bank);die(); //print_r($check_valid_bank);die();
$nowin_server = date("Y-m-d TH:i:s");
if($get_account_balance['reedem_earn']>=$_POST['redemption_amount'] and $check_valid_bank['count']==1) if($get_account_balance['reedem_earn']>=$_POST['redemption_amount'] and $check_valid_bank['count']==1)
{ {
$withdrawal_insert = array('bank_id' => $_POST['redemption_bank'], 'amount'=>$_POST['redemption_amount'], 'date'=>time(),'status'=>0,'doctor_id' =>$userdata['id']); $withdrawal_insert = array('bank_id' => $_POST['redemption_bank'], 'amount'=>$_POST['redemption_amount'], 'date'=>time(),'status'=>0,'doctor_id' =>$userdata['id'],'previous_reedem_earn'=>$get_account_balance['reedem_earn']);
$this->Home_model->add_redemption_request($withdrawal_insert); $this->Home_model->add_redemption_request($withdrawal_insert);
$res = array('status' => 'success','message' => 'Redemption Requested' ); $res = array('status' => 'success','message' => 'Redemption Requested' );
} }
elseif($get_account_balance['reedem_earn']<=$_POST['redemption_amount'] and $check_valid_bank['count']==1) elseif($get_account_balance['reedem_earn']<=$_POST['redemption_amount'] and $check_valid_bank['count']==1)
{ {
$withdrawal_insert = array('bank_id' => $_POST['redemption_bank'], 'amount'=>$_POST['redemption_amount'], 'date'=>time(),'status'=>3,'doctor_id' =>$userdata['id']); $withdrawal_insert = array('bank_id' => $_POST['redemption_bank'], 'amount'=>$_POST['redemption_amount'], 'date'=>time(),'status'=>3,'doctor_id' =>$userdata['id'],'previous_reedem_earn'=>$get_account_balance['reedem_earn']);
$this->Home_model->add_redemption_request($withdrawal_insert); $this->Home_model->add_redemption_request($withdrawal_insert);
$res = array('status' => 'error','message' => 'Error, Insufficient Balance' ); $res = array('status' => 'error','message' => 'Error, Insufficient Balance' );
} }
...@@ -862,6 +871,44 @@ public function redemptionrequest() ...@@ -862,6 +871,44 @@ public function redemptionrequest()
print json_encode($res); print json_encode($res);
} }
public function test()
{
$test = push_sent();
print_r($test);
}
/*CRON JOBS FOR IPOK*/
public function cron_jobs()
{
/*FUNCTION FOR SENTING CONSULTATION REMINDER*/
$nowin_server = date("Y-m-d TH:i:s");
//print_r($nowin_server);die();
$todays_booking = $this->Home_model->get_todays_booking();
//echo "<pre>";
//print_r($todays_booking);
if(!empty($todays_booking))
{
foreach ($todays_booking as $key => $booking)
{
//print_r($booking['id']);die();
/*CODE FOR SENTING NOTIFICATION - PATIENT NOTIFICATION*/
/*------------------------------------------------*/
$booking_details = $this->Search_doctor_model->get_booking_details($booking['id']);
$doctor_data = $this->Doctor_model->get_single_doctor($booking_details['doctor_id']);
$text_pat = 'You have a scheduled appointment in the system today, at '.date('H:i a',$booking_details['time_start']).', doctor '.$doctor_data['dr_name'];
$notification_pat = array('patient_id' => $booking_details['patient_id'],'type'=>2,'message'=>$text_pat,'read_status'=>0,'time'=>strtotime($nowin_server),'booking_id' =>$booking['id']);
$this->Home_model->insert_notification_patient($notification_pat);
/*------------------------------------------------*/
}
}
}
} }
......
...@@ -41,12 +41,18 @@ public function index() ...@@ -41,12 +41,18 @@ public function index()
$recent = $this->Home_model->get_recent_chat($userdata['id'],$userdata['type']); $recent = $this->Home_model->get_recent_chat($userdata['id'],$userdata['type']);
//FETCHING NOTIFICATION FOR DASHBOARD VIEW
$notifications = $this->Patient_model->get_notifications($userdata['id'],1,10);
$this->session->set_userdata('notifications',$notifications);
$template['recent'] = $recent; $template['recent'] = $recent;
$template['patient_data'] = $patient_data; $template['patient_data'] = $patient_data;
$template['policy'] = $policy; $template['policy'] = $policy;
$template['completed_consultation'] = $completed_consultation; $template['completed_consultation'] = $completed_consultation;
$template['confirmed_consultation'] = $confirmed_consultation; $template['confirmed_consultation'] = $confirmed_consultation;
$template['promocodes'] = $promocodes; $template['promocodes'] = $promocodes;
$template['notifications'] = $notifications;
/*$template['canceled_consultation'] = $canceled_consultation;*/ /*$template['canceled_consultation'] = $canceled_consultation;*/
$this->load->view('template/template', $template); $this->load->view('template/template', $template);
...@@ -84,26 +90,106 @@ public function cancelBooking() ...@@ -84,26 +90,106 @@ public function cancelBooking()
//print_r($_POST);die(); //print_r($_POST);die();
$userdata = $this->session->userdata('UserData'); $userdata = $this->session->userdata('UserData');
$result = $this->Patient_model->cancel_Booking($_POST['booking_id']); $result = $this->Patient_model->cancel_Booking($_POST['booking_id']);
$nowin_server = date("Y-m-d TH:i:s");
/*CODE FOR WALLET INSERTION*/ /*CODE FOR WALLET INSERTION*/
/*---------------------------------------------------*/ /*---------------------------------------------------*/
$booking_details = $this->Doctor_model->get_booking_details($_POST['booking_id']); $booking_details = $this->Doctor_model->get_booking_details($_POST['booking_id']);
if($booking_details['visit_type']==0) if($booking_details['visit_type']==0)
{ {
$wallet = $this->Doctor_model->get_wallet_for_doctor($booking_details['doc_id']); $wallet = $this->Doctor_model->get_wallet_for_doctor($booking_details['doc_id']);
$earn = $booking_details['book_price'] - (($booking_details['book_price'] * $ipok_settings['ipok_fee'])/100); $earn = $booking_details['book_price'] - (($booking_details['book_price'] * $booking_details['ipok_fee'])/100);
$wallet['future_amount'] = $wallet['future_amount'] - $earn; $wallet['future_earn'] = $wallet['future_earn'] - $earn;
$wallet['total_amount'] = $wallet['total_amount'] - $earn; $wallet['total_earn'] = $wallet['total_earn'] - $earn;
$this->Doctor_model->update_wallet($booking_details['doc_id'],$wallet); $this->Doctor_model->update_wallet($booking_details['doc_id'],$wallet);
} }
/*---------------------------------------------------*/ /*---------------------------------------------------*/
/*CODE FOR SENTING NOTIFICATION - PATIENT NOTIFICATION*/
/*------------------------------------------------*/
$doctor_data = $this->Doctor_model->get_single_doctor($booking_details['doc_id']);
$text_pat = 'Your appointment scheduled in the system, on '.date('d.m.Y',$booking_details['time_start']).' at '.date('H:i a',$booking_details['time_start']).', doctor '.$doctor_data['dr_name'] .' is Canceled!';
$notification_pat = array('patient_id' => $booking_details['pat_id'],'type'=>3,'message'=>$text_pat,'read_status'=>0,'time'=>strtotime($nowin_server),'booking_id' => $_POST['booking_id']);
$patient_insert_id = $this->Home_model->insert_notification_patient($notification_pat);
$fcm_user = $this->Home_model->get_patient_fcm($booking_details['pat_id']);
//print_r($fcm_user);
if(!empty($fcm_user['fcm_token']))
{
//print_r($fcm_user['fcm_token']);die();
$pat_push_obj['id'] = $patient_insert_id;
$pat_push_obj['type'] = "Consultation Canceled";
$pat_push_obj['booking_id'] = $booking_details['book_id'];
$pat_push_obj['booking_date'] = $booking_details['book_date'];
$pat_push_obj['doctor_id'] = $booking_details['doc_id'];
$pat_push_obj['doctor_name'] = $doctor_data['dr_name'];
$pat_push_obj['doctor_specialization'] = $doctor_data['dr_specialization'];
$pat_push_obj['message'] = $text_pat;
$pat_push_obj['time'] = strtotime($nowin_server);
$pat_push_obj['to'] = $fcm_user['fcm_token'];
$user_type = '1'; //patient push
$push_status = push_sent($pat_push_obj,$user_type);
}
/*------------------------------------------------*/
$check_waiting_list = $this->Patient_model->check_waiting_list($result); $check_waiting_list = $this->Patient_model->check_waiting_list($result);
//print_r($check_waiting_list);die(); //print_r($check_waiting_list);die();
if($check_waiting_list['count']>0) if($check_waiting_list['count']>0)
{ {
$this->Patient_model->change_waitinglist_to_confirmed($check_waiting_list['booking_id']); $this->Patient_model->change_waitinglist_to_confirmed($check_waiting_list['booking_id']);
$booking_details_waiting = $this->Doctor_model->get_booking_details($check_waiting_list['booking_id']);
/*CODE FOR SENTING WAITING LIST NOTIFICATION - PATIENT NOTIFICATION*/
/*------------------------------------------------*/
$doctor_data_waiting = $this->Doctor_model->get_single_doctor($booking_details_waiting['doc_id']);
$patient_data_waiting = $this->Patient_model->get_single_patient($booking_details_waiting['pat_id']);
$text_pat_waiting = 'Your appointment scheduled in the system, on '.date('d.m.Y',$booking_details_waiting['time_start']).' at '.date('H:i a',$booking_details_waiting['time_start']).', doctor '.$doctor_data_waiting['dr_name'] .' is Confirmed!';
$notification_pat_waiting = array('patient_id' => $booking_details_waiting['pat_id'],'type'=>0,'message'=>$text_pat_waiting,'read_status'=>0,'time'=>strtotime($nowin_server),'booking_id' => $check_waiting_list['booking_id']);
$patient_insert_id = $this->Home_model->insert_notification_patient($notification_pat_waiting);
$fcm_user = $this->Home_model->get_patient_fcm($booking_details_waiting['pat_id']);
//print_r($fcm_user);
if(!empty($fcm_user['fcm_token']))
{
//print_r($fcm_user['fcm_token']);die();
$pat_push_obj['id'] = $patient_insert_id;
$pat_push_obj['type'] = "Consultation Confirmation";
$pat_push_obj['booking_id'] = $check_waiting_list['booking_id'];
$pat_push_obj['booking_date'] = $booking_details_waiting['book_date'];
$pat_push_obj['doctor_id'] = $booking_details_waiting['doc_id'];
$pat_push_obj['doctor_name'] = $doctor_data_waiting['dr_name'];
$pat_push_obj['doctor_specialization'] = $doctor_data_waiting['dr_specialization'];
$pat_push_obj['message'] = $text_pat_waiting;
$pat_push_obj['time'] = strtotime($nowin_server);
$pat_push_obj['to'] = $fcm_user['fcm_token'];
$user_type = '1'; //patient push
$push_status = push_sent($pat_push_obj,$user_type);
}
/*------------------------------------------------*/
/*CODE FOR SENTING WAITING LIST NOTIFICATION - DOCTOR NOTIFICATION*/
/*------------------------------------------------*/
$text = 'A new appointment was scheduled in the system, on '.date('d.m.Y',$booking_details_waiting['time_start']).' at '.date('H:i a',$booking_details_waiting['time_start']).', patient '.$patient_data_waiting['pt_name'];
$notification = array('doctor_id' => $booking_details_waiting['doc_id'],'type'=>2,'message'=>$text,'read_status'=>0,'time'=>strtotime($nowin_server) );
$doctor_insert_id = $this->Home_model->insert_notification_doctor($notification);
$fcm_doctor = $this->Home_model->get_doctor_fcm($booking_details_waiting['doc_id']);
if(!empty($fcm_doctor['fcm_token']))
{
$doc_push_obj['id'] = $doctor_insert_id;
$doc_push_obj['type'] = "New Consultation";
$doc_push_obj['message'] =$text;
$doc_push_obj['read_status'] = false;
$doc_push_obj['to'] = $fcm_doctor['fcm_token'];
$user_type = '2';
$push_status = push_sent($doc_push_obj,$user_type);
}
/*------------------------------------------------*/
} }
$confirmed_consultation = $this->Patient_model->get_patient_confirmed_consultation($userdata['id']); $confirmed_consultation = $this->Patient_model->get_patient_confirmed_consultation($userdata['id']);
$template['confirmed_consultation'] = $confirmed_consultation; $template['confirmed_consultation'] = $confirmed_consultation;
...@@ -594,6 +680,8 @@ public function record() ...@@ -594,6 +680,8 @@ public function record()
$booking_id = $this->uri->segment(3); $booking_id = $this->uri->segment(3);
$booking_details = $this->Doctor_model->get_booking_details($booking_id); $booking_details = $this->Doctor_model->get_booking_details($booking_id);
$record_data = $this->Doctor_model->get_medical_record_for_booking($booking_id); $record_data = $this->Doctor_model->get_medical_record_for_booking($booking_id);
if(!empty($record_data))
{
$doctor_data = $this->Doctor_model->get_single_doctor($booking_details['doc_id']); $doctor_data = $this->Doctor_model->get_single_doctor($booking_details['doc_id']);
$patient_data = $this->Patient_model->get_single_patient($booking_details['pat_id']); $patient_data = $this->Patient_model->get_single_patient($booking_details['pat_id']);
...@@ -602,6 +690,7 @@ public function record() ...@@ -602,6 +690,7 @@ public function record()
$record_data['prescribtions'] = json_decode($record_data['prescribtions']); $record_data['prescribtions'] = json_decode($record_data['prescribtions']);
$record_data['exams'] = json_decode($record_data['exams']); $record_data['exams'] = json_decode($record_data['exams']);
$record_data['budget'] = json_decode($record_data['budget']); $record_data['budget'] = json_decode($record_data['budget']);
$record_data['letters'] = json_decode($record_data['letters']);
//print_r($record_data);die(); //print_r($record_data);die();
...@@ -615,6 +704,12 @@ public function record() ...@@ -615,6 +704,12 @@ public function record()
} }
else else
{ {
header('Location: '.base_url().'Home/error/url');
}
}
else
{
$this->session->set_flashdata('message', array('message' => 'Invalid Session, Kindly Try Again', 'title' => 'Error', 'class' => 'danger')); $this->session->set_flashdata('message', array('message' => 'Invalid Session, Kindly Try Again', 'title' => 'Error', 'class' => 'danger'));
header('Location: '.base_url()); header('Location: '.base_url());
} }
...@@ -638,9 +733,43 @@ public function record() ...@@ -638,9 +733,43 @@ public function record()
public function notification() public function notification()
{ {
redirect(base_url()); if($this->session->userdata('UserData')&&$this->session->userdata('UserData')['type']=="PATIENT")
{
$userdata = $this->session->userdata('UserData');
$page = 1;
$notifications = $this->Patient_model->get_notifications($userdata['id'],$page);
//echo "<pre>";
//print_r($notifications);die();
$notifications_total_count = $this->Patient_model->get_notifications_total_count($userdata['id']);
//print_r($notifications_total_count);die();
$template['page'] = 'patient_notifications_page';
$template['page_title'] = "Notification";
$template['notifications'] = $notifications;
$template['notifications_total_count'] = $notifications_total_count[0];
$template['notifications_page_no'] = $page;
$this->load->view('template/template', $template);
}
} }
public function notification_ajax()
{
$userdata = $this->session->userdata('UserData');
$page = 1;
if(!empty($_POST))
{$page = $_POST['page']+1;}
$notifications = $this->Patient_model->get_notifications($userdata['id'],$page);
$notifications_total_count = $this->Patient_model->get_notifications_total_count($userdata['id']);
//print_r($notifications);die();
$template['notifications'] = $notifications;
$template['notifications_total_count'] = $notifications_total_count[0];
$template['notifications_page_no'] = $page;
$this->load->view('patient_notifications_list', $template);
}
......
...@@ -152,6 +152,100 @@ function send_mail($msg,$email,$sub) ...@@ -152,6 +152,100 @@ function send_mail($msg,$email,$sub)
$query = $CI->db->get(); $query = $CI->db->get();
return $query->result_array(); return $query->result_array();
} }
function get_notification($id,$type)
{
$CI = & get_instance();
if($type=="PATIENT")
{
$CI->db->select("id,
type,
CASE
WHEN type = '0' THEN 'New Booking'
WHEN type = '1' THEN 'Waiting List'
WHEN type = '2' THEN 'Consultation Reminder'
WHEN type = '3' THEN 'Consulation Canceled'
END as type_desc,
message,
read_status,
time");
$CI->db->from('tbl_patient_notification');
$CI->db->where('patient_id',$id);
}
elseif($type=="DOCTOR")
{
$CI->db->select("id,
type,
CASE
WHEN type = '0' THEN 'Redemption Made'
WHEN type = '1' THEN 'New Review'
WHEN type = '2' THEN 'New Consultation'
WHEN type = '3' THEN 'Added to new clinic'
END as type_desc,
message,
read_status,
time");
$CI->db->from('tbl_doctor_notifications');
$CI->db->where('doctor_id',$id);
}
$CI->db->limit(10);
$CI->db->order_by('time','DESC');
$query = $CI->db->get();
return $query->result_array();
}
function push_sent($fcm_data,$type)
{
$CI = & get_instance();
//print_r($fcm_data);die();
$data1 = "SELECT * FROM settings WHERE id = '0'";
$query1 = $CI->db->query($data1);
$rs = $query1->row();
$key = $rs->api_key;
//$key = 'AIzaSyCGDtxjM3gDFKNEvooXMQ9uGs8P5r7hYAE';
/* $data = "{ \"notification\": { \"title\": \"".$fcm_data['title']."\", \"text\": \"".$fcm_data['message']."\" , \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"id\" : \"".$fcm_data['id']."\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_token."\"}";*/
/* $data = "{ \"notification\": { \"title\": \"hi\", \"text\": \"hellonewmessage\" , \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"id\" : \"12\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"c7yemODrWAY:APA91bFqfFVJsydZrtSjwhD_c_2uBcm_N3XZvbOyiaX4O1mlDtAVbEo2XyRsKpoQ3ypvOZkCnJ9qsA9tcGKeHutItKrU2LhBZbpfgCNM0ZFxw5An6biIhuh0HOW_yfsd90YbUzEhnj7Y\"}";*/
//type 1 - Free Booking Confirmed
if($type == '1') //push for patient
{
$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']."\"}";
}
else if($type == '2') //push for doctor
{
$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']."\"}";
}
$ch = curl_init("https://fcm.googleapis.com/fcm/send");
$header = array('Content-Type: application/json', 'Authorization: key='.$key);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt($ch, CURLOPT_POSTFIELDS, "{ \"notification\": { \"title\": \"olakka title\", \"text\": \"Olakka message\" }, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"id\" : \"$request[id]\"}}} \"to\" : \"cAAoKqSKvgk:APA91bH-mvqwAp1JYW1oBZl_aheVDb7HOWx0YjXU6Wmmm-G_CB-60T2M6WKwsjPDMUfu47nCf1qi4a9SREiwRifAFBWszVTL8XA1y4_nb7ZiI9EmX7rpKsWogsrzqXSwKt56cd8sH5ox\"}");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_close($ch);
$out = curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
//print(cpf_validator('111.444.777-35'));// return 1 if valid else no return //print(cpf_validator('111.444.777-35'));// return 1 if valid else no return
?> ?>
\ No newline at end of file
...@@ -134,7 +134,7 @@ public function get_doctor_appointments_day($dctr_id,$list_day) ...@@ -134,7 +134,7 @@ public function get_doctor_appointments_day($dctr_id,$list_day)
$this->db->where("tbl_booking.doctor_id",$dctr_id); $this->db->where("tbl_booking.doctor_id",$dctr_id);
$this->db->where("tbl_booking.date",$today); $this->db->where("tbl_booking.date",$today);
$this->db->where("tbl_booking.payment_status",1); $this->db->where("tbl_booking.payment_status",1);
//$this->db->where("tbl_booking.booking_status",1); $this->db->where("(tbl_booking.booking_status = '1' or tbl_booking.booking_status = '4')");
$this->db->order_by("tbl_booking.time_start", "asc"); $this->db->order_by("tbl_booking.time_start", "asc");
$this->db->join('tbl_registration', 'tbl_registration.id = tbl_booking.patient_id','inner'); $this->db->join('tbl_registration', 'tbl_registration.id = tbl_booking.patient_id','inner');
//$this->db->where("tbl_consultation.clinic_id",$clinicId); //$this->db->where("tbl_consultation.clinic_id",$clinicId);
...@@ -364,6 +364,9 @@ public function get_booking_details($book_id) ...@@ -364,6 +364,9 @@ public function get_booking_details($book_id)
tbl_booking.date as book_date, tbl_booking.date as book_date,
tbl_booking.time as book_time, tbl_booking.time as book_time,
tbl_booking.total_sum as book_price, tbl_booking.total_sum as book_price,
tbl_booking.visit_type as visit_type,
tbl_booking.ipok_fee as ipok_fee,
tbl_booking.time_start as time_start,
tbl_registration.id as pat_id, tbl_registration.id as pat_id,
tbl_registration.name as pat_name, tbl_registration.name as pat_name,
tbl_booking.doctor_id as doc_id"); tbl_booking.doctor_id as doc_id");
...@@ -632,11 +635,17 @@ function get_notifications($doctor_id,$page,$limit = null) ...@@ -632,11 +635,17 @@ function get_notifications($doctor_id,$page,$limit = null)
$limit = $page * 5; $limit = $page * 5;
} }
$this->db->select('id, $this->db->select("id,
type, type,
CASE
WHEN type = '0' THEN 'Redemption Made'
WHEN type = '1' THEN 'New Review'
WHEN type = '2' THEN 'New Consultation'
WHEN type = '3' THEN 'Added to new clinic'
END as type_desc,
message, message,
read_status, read_status,
time'); time");
$this->db->from('tbl_doctor_notifications'); $this->db->from('tbl_doctor_notifications');
$this->db->where('doctor_id',$doctor_id); $this->db->where('doctor_id',$doctor_id);
$this->db->order_by('time','DESC'); $this->db->order_by('time','DESC');
...@@ -647,45 +656,40 @@ function get_notifications($doctor_id,$page,$limit = null) ...@@ -647,45 +656,40 @@ function get_notifications($doctor_id,$page,$limit = null)
function get_notifications_total_count($doctor_id) function get_notifications_total_count($doctor_id)
{ {
$this->db->select('id as count'); $this->db->select('count(id) as count');
$this->db->from('tbl_doctor_notifications'); $this->db->from('tbl_doctor_notifications');
$this->db->where('doctor_id',$doctor_id); $this->db->where('doctor_id',$doctor_id);
$query = $this->db->get(); $query = $this->db->get();
return $query->row_array(); //echo $this->db->last_query();exit();
return $query->result_array();
} }
function get_aniversaries_list($doc_id) function get_aniversaries_list($doc_id)
{ {
/*$this->db->select("tbl_registration.id, //print_r($doc_id);die();
tbl_registration.name, // Upcomming Birthday list
tbl_registration.dob, $O_month = date('m');
tbl_registration.profile_photo, $T_month = date('m', strtotime("last day of next month"));
DATE_FORMAT(tbl_registration.dob, '%m') as mo"); if($T_month == "12") {
$this->db->from('tbl_booking'); $TH_month = "01";
$this->db->join('tbl_registration', 'tbl_booking.patient_id = tbl_registration.id ','left'); }else if($T_month <= "11") {
$this->db->where('tbl_booking.doctor_id',$doc_id); $TH_month = $T_month + "01";
$this->db->where('tbl_booking.booking_status',3); }
$this->db->where("month(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))".'>='. date('m',time()));*/ if(strlen($TH_month) == 1) {
//$this->db->where("day(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))".'>='. date('d',time())); $TH_month="0".$TH_month;
}
//$this->db->where('IF("month(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,"+00:00"))"'.'='. date('m',time()).')'., null, "day(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))".'>='. date('d',time())); // another methods for getting months
/* echo $date = date('m',strtotime('first day of +1 month'));
//$this->db->where('IF(month(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,"+00:00"))='.date('m',time()).',day(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,"+00:00"))>=26,null)'); echo $date = date('m',strtotime('first day of +2 month'));
*/
//$this->db->where("IF(tbl_registration.id='156',NULL,true)");
//$this->db->where("IF(month(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))='".date('m',time())."',day(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))".'>='.$day.",true)",true);
//$this->db->where("IF( cond,true,fasle)", null, false); $upcomming = $this->db->query("SELECT `tbl_registration`.`id`, `tbl_registration`.`name`, `tbl_registration`.`dob`, `tbl_registration`.`profile_photo`, DATE_FORMAT(FROM_UNIXTIME(`tbl_registration`.`dob`), '%Y-%m-%e') AS 'date_formatted' ,`tbl_booking`.`booking_status`,`tbl_booking`.`id` as 'book_id' FROM `tbl_booking` LEFT JOIN `tbl_registration` ON `tbl_booking`.`patient_id` = `tbl_registration`.`id` WHERE `tbl_booking`.`doctor_id` = $doc_id AND `tbl_booking`.`booking_status` = '3' AND `tbl_booking`.`payment_status` = '1' AND (DATE_FORMAT(FROM_UNIXTIME(`tbl_registration`.`dob`), '%Y-%m-%e') like '%-$O_month-%' or DATE_FORMAT(FROM_UNIXTIME(`tbl_registration`.`dob`), '%Y-%m-%e') like '%-$T_month-%' or DATE_FORMAT(FROM_UNIXTIME(`tbl_registration`.`dob`), '%Y-%m-%e') like '%-$TH_month-%') ORDER BY DAYOFYEAR(DATE_FORMAT(FROM_UNIXTIME(`tbl_registration`.`dob`), '%Y-%m-%e')) < DAYOFYEAR(CURDATE()) , DAYOFYEAR(DATE_FORMAT(FROM_UNIXTIME(`tbl_registration`.`dob`), '%Y-%m-%e'))");
//$this->db->where('tbl_registration.dob',3);
//$query = $this->db->query("SELECT `tbl_registration`.`id`, `tbl_registration`.`name`, `tbl_registration`.`dob`, `tbl_registration`.`profile_photo`, DATE_FORMAT(tbl_registration.dob, '%m') as mo FROM `tbl_booking` LEFT JOIN `tbl_registration` ON `tbl_booking`.`patient_id` = `tbl_registration`.`id` WHERE `tbl_booking`.`doctor_id` = '30' AND `tbl_booking`.`booking_status` = 3 AND month(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00')) >= 03 AND IF(month(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))='03',day(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))>= '26',true)"); /*
$query = $this->db->query("SELECT `tbl_registration`.`id`, `tbl_registration`.`name`, `tbl_registration`.`dob`, `tbl_registration`.`profile_photo`, DATE_FORMAT(tbl_registration.dob, '%m') as mo FROM `tbl_booking` LEFT JOIN `tbl_registration` ON `tbl_booking`.`patient_id` = `tbl_registration`.`id` WHERE `tbl_booking`.`doctor_id` = '30' AND `tbl_booking`.`booking_status` = 3 AND month(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00')) >= ".date('m',time())." AND IF(month(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))='".date('m',time())."',day(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))>= '".date('d',time())."',true)"); $query = $this->db->query("SELECT `tbl_registration`.`id`, `tbl_registration`.`name`, `tbl_registration`.`dob`, `tbl_registration`.`profile_photo`, DATE_FORMAT(FROM_UNIXTIME(`tbl_registration`.`dob`), '%Y-%m-%e') AS 'date_formatted' FROM `tbl_booking` LEFT JOIN `tbl_registration` ON `tbl_booking`.`patient_id` = `tbl_registration`.`id` WHERE `tbl_booking`.`doctor_id` = '30' AND `tbl_booking`.`booking_status` = 3 AND month(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00')) >= ".date('m',time())." AND IF(month(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))='".date('m',time())."',day(CONVERT_TZ(FROM_UNIXTIME(tbl_registration.dob),@@session.time_zone,'+00:00'))>= '".date('d',time())."',true)")*/;
//$this->db->get(); //$this->db->get();
//echo $this->db->last_query();die(); //echo $this->db->last_query();die();
return $query->result_array(); return $upcomming->result_array();
} }
public function get_doctor_password($id) public function get_doctor_password($id)
......
...@@ -259,10 +259,22 @@ ...@@ -259,10 +259,22 @@
if($this->db->insert('tbl_doctor_notifications',$data)) if($this->db->insert('tbl_doctor_notifications',$data))
{ {
$insert_id = $this->db->insert_id(); $insert_id = $this->db->insert_id();
return $insert_id;
} }
} }
public function insert_notification_patient($data)
{
if($this->db->insert('tbl_patient_notification',$data))
{
$insert_id = $this->db->insert_id();
return $insert_id;
}
}
public function check_valid_email_forgot($email,$type) public function check_valid_email_forgot($email,$type)
{ {
$this->db->select('count(id) as count, $this->db->select('count(id) as count,
...@@ -505,6 +517,90 @@ ...@@ -505,6 +517,90 @@
return $query->row_array(); return $query->row_array();
} }
public function redemptionhistory($id)
{
$this->db->select("tbl_withdrawal_history.id as id,
tbl_withdrawal_history.amount as amount,
tbl_withdrawal_history.date as date,
CASE
WHEN tbl_withdrawal_history.status = '0' THEN 'PENDING'
WHEN tbl_withdrawal_history.status = '1' THEN 'INPROGRESS'
WHEN tbl_withdrawal_history.status = '2' THEN 'COMPLETED'
ELSE 'REJECTED'
END as status,
tbl_bank_accounts.bank_name as bank_name,
tbl_bank_accounts.account_holder as account_holder,
tbl_bank_accounts.account_no as account_no ");
$this->db->from('tbl_withdrawal_history');
$this->db->where('tbl_bank_accounts.type',1);
$this->db->where('tbl_withdrawal_history.doctor_id',$id);
//$this->db->where('tbl_withdrawal_history.status',2);
$this->db->where('tbl_bank_accounts.type_id',$id);
$this->db->join('tbl_bank_accounts', 'tbl_bank_accounts.id = tbl_withdrawal_history.bank_id', 'inner');
$this->db->order_by('tbl_withdrawal_history.date','DESC');
$query = $this->db->get();
return $query->result_array();
}
public function futurereleases($id)
{
$current_time_in_UTC = strtotime(local_time_in_server(time()));
//print_r($current_time_in_UTC);die();
$this->db->select("tbl_booking.doctor_id,
tbl_booking.date as date,
tbl_booking.time_start as time_start,
CASE
WHEN tbl_booking.promo_name = '' THEN 'NORMAL'
WHEN tbl_booking.promo_name != '' THEN 'SPECIAL'
END as consultation_type,
tbl_booking.promo_name as promocode,
tbl_booking.total_sum as total_sum,
tbl_booking.ipok_fee as ipok_fee,
tbl_doctors.name as doctor_name,
(tbl_booking.total_sum - ((tbl_booking.total_sum * tbl_booking.ipok_fee)/100)) as release_amount
");
$this->db->from('tbl_booking');
$this->db->join('tbl_doctors', 'tbl_doctors.id = tbl_booking.doctor_id', 'inner');
$this->db->where('tbl_booking.time_start'.'>'.$current_time_in_UTC);
$this->db->where('tbl_booking.booking_status',1);
$this->db->where('tbl_booking.doctor_id',$id);
$this->db->order_by('tbl_booking.time_start','ASC');
//$this->db->limit(1);
$query = $this->db->get();
return $query->result_array();
}
public function get_todays_booking()
{
$todayat12 = strtotime(date('Y-m-d'));
//print_r($todayat12);
//die();
$this->db->select("*");
$this->db->from('tbl_booking');
$this->db->where('date',$todayat12);
$this->db->where('booking_status',1);
$this->db->where('payment_status',1);
$query = $this->db->get();
return $query->result_array();
}
public function get_patient_fcm($pat_id)
{
$this->db->select('fcm_token');
$this->db->from('tbl_authtoken');
$this->db->where('userid',$pat_id);
$query = $this->db->get();
return $query->row_array();
}
public function get_doctor_fcm($doc_id)
{
$this->db->select('fcm_token');
$this->db->from('tbl_authtoken_doctors');
$this->db->where('doctor_id',$doc_id);
$query = $this->db->get();
return $query->row_array();
}
......
...@@ -396,6 +396,41 @@ public function set_confirmation_code($user,$code) ...@@ -396,6 +396,41 @@ public function set_confirmation_code($user,$code)
$this->db->update('tbl_registration',$data); $this->db->update('tbl_registration',$data);
} }
public function get_notifications($id,$page,$limit = null)
{
$start = 0;
if(!isset($limit) or empty($limit))
{
$limit = $page * 5;
}
$this->db->select("id,
type,
CASE
WHEN type = '0' THEN 'New Booking'
WHEN type = '1' THEN 'Waiting List'
WHEN type = '2' THEN 'Consultation Reminder'
WHEN type = '3' THEN 'Consulation Canceled'
END as type_desc,
message,
read_status,
time");
$this->db->from('tbl_patient_notification');
$this->db->where('patient_id',$id);
$this->db->order_by('time','DESC');
$this->db->limit($limit, $start);
$query = $this->db->get();
return $query->result_array();
}
function get_notifications_total_count($patient_id)
{
$this->db->select('count(id) as count');
$this->db->from('tbl_patient_notification');
$this->db->where('patient_id',$patient_id);
$query = $this->db->get();
return $query->result_array();
}
} }
......
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
{ {
?> ?>
<li> <li>
<h5><?php echo $value['type_name'];?> <h5><?php echo $value['type_desc'];?>
<div class="ip_notification_time"><?php echo change_time_to_local($value['time'])?></div> <div class="ip_notification_time"><?php echo change_time_to_local($value['time'])?></div>
</h5> </h5>
<p><?php echo $value['message'];?></p> <p><?php echo $value['message'];?></p>
...@@ -280,15 +280,15 @@ ...@@ -280,15 +280,15 @@
<?php <?php
} }
} }
else
{
?>
<li>
<p>No Notifications!</p>
</li>
<?php
}
?> ?>
<!-- <li>
<h5>Nyla Augusta
<div class="ip_notification_time">12:56</div>
</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p>
</li> -->
</ul> </ul>
</div> </div>
......
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
<?php if(!empty($record_data['letters'])) <?php if(!empty($record_data['letters']))
{ {
?> ?>
<p><?php echo $record_data['letters'];?></p> <p><?php echo $record_data['letters']->certificate;?></p>
<?php <?php
} }
?> ?>
......
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
<?php if(!empty($record_data['letters'])) <?php if(!empty($record_data['letters']))
{ {
?> ?>
<p><?php echo $record_data['letters'];?></p> <p><?php echo $record_data['letters']->certificate;?></p>
<?php <?php
} }
?> ?>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<li> <li>
<h5><?php echo $value['type_name'];?> <h5><?php echo $value['type_desc'];?>
<div class="ip_notification_time" ><?php echo change_time_to_local($value['time'])?></div> <div class="ip_notification_time" ><?php echo change_time_to_local($value['time'])?></div>
<!-- <div class="ip_notification_time"><?php echo date('H:i s',$value['time']);?></div> --> <!-- <div class="ip_notification_time"><?php echo date('H:i s',$value['time']);?></div> -->
......
<div class="ip_set_two_wrapper">
<div class="">
<div class="modal-dialog" style=" box-shadow: 0px 0px 5px 0px #888888;border-top-right-radius: 8px;border-top-left-radius: 8px;">
<div class="ip_patient_delete_pop_wrapper">
<div class="ip_paitent_delete_header">
ERROR
</div>
<div class="ip_patient_delete_content">
<div class="textCenter">
<img src="<?php echo base_url();?>assets/images/ip_error.png">
</div>
<h5>URL ERROR !</h5>
<hr>
<p>Invalid Url Provided!</p>
<div class="ip_patient_delete_form">
<div class="ip_patient_delete_row textCenter">
<!-- <button class="ip_paitent_dark_btn">OKAY</button> -->
<div class="clear"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
...@@ -256,54 +256,30 @@ ...@@ -256,54 +256,30 @@
<div class="ip_bio_detail"> <div class="ip_bio_detail">
<div class="ip_bio_notification_list"> <div class="ip_bio_notification_list">
<ul> <ul>
<?php
if(!empty($notifications))
{
foreach ($notifications as $key => $value)
{
?>
<li> <li>
<h5>Nyla Augusta <h5><?php echo $value['type_desc'];?>
<div class="ip_notification_time">12:56</div> <div class="ip_notification_time"><?php echo change_time_to_local($value['time'])?></div>
</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p>
</li>
<li>
<h5>Nyla Augusta
<div class="ip_notification_time">12:56</div>
</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p>
</li>
<li>
<h5>Nyla Augusta
<div class="ip_notification_time">12:56</div>
</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p>
</li>
<li>
<h5>Nyla Augusta
<div class="ip_notification_time">12:56</div>
</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p>
</li>
<li>
<h5>Nyla Augusta
<div class="ip_notification_time">12:56</div>
</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p>
</li>
<li>
<h5>Nyla Augusta
<div class="ip_notification_time">12:56</div>
</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p>
</li>
<li>
<h5>Nyla Augusta
<div class="ip_notification_time">12:56</div>
</h5> </h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p> <p><?php echo $value['message'];?></p>
</li> </li>
<?php
}
}
else
{
?>
<li> <li>
<h5>Nyla Augusta <p>No Notifications!</p>
<div class="ip_notification_time">12:56</div>
</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p>
</li> </li>
<?php
}
?>
</ul> </ul>
</div> </div>
</div> </div>
......
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
<?php if(!empty($record_data['letters'])) <?php if(!empty($record_data['letters']))
{ {
?> ?>
<p><?php echo $record_data['letters'];?></p> <p><?php echo $record_data['letters']->certificate;?></p>
<?php <?php
} }
?> ?>
......
<div class="ip_bio_notification_list">
<ul>
<?php
if(!empty($notifications))
{
foreach ($notifications as $key => $value)
{
?>
<li>
<h5><?php echo $value['type_desc'];?>
<div class="ip_notification_time"><?php echo change_time_to_local($value['time'])?></div>
<!-- <div class="ip_notification_time"><?php echo date('H:i s',$value['time']);?></div> -->
</h5>
<p><?php echo $value['message'];?></p>
</li>
<?php
}
?>
<input type="hidden" id="pat-noti-pageno" value="<?php echo $notifications_page_no?>">
<?php
}
?>
</ul>
</div>
<div class="ip_notification_btm_btn_bay textCenter" style="padding:30px;">
<?php
if($notifications_total_count['count']>sizeof($notifications))
{
?>
<a href="javascript:void(0)">
<button class="ip_notification_btn" type="button" id="pat-noti-loadmore" style="width: 40%;">View more</button>
</a>
<?php
}
?>
</div>
\ No newline at end of file
<div class="ip_set_two_wrapper">
<div class="container ip_custom_container">
<!-- <div class="ip_top_dash_bay">
<div class="row">
<div class="col-md-3">
<div class="ip_top_dash_list">
<div class="ip_top_dash_circle">
<img src="<?php echo base_url();?>assets/images/ip_appointments.png">
</div>
<div class="ip_top_dash_detail">
<strong class="ip_counter" data-count="<?php echo $dash_view['no_of_attendance']?>">0</strong>
<p>Attendance</p>
</div>
<div class="clear"></div>
</div>
</div>
<div class="col-md-3">
<div class="ip_top_dash_list">
<div class="ip_top_dash_circle">
<img src="<?php echo base_url();?>assets/images/ip_feature.png">
</div>
<div class="ip_top_dash_detail" >
<strong class="ip_counter" data-count="<?php echo $dash_view['no_of_billed']?>">0</strong>
<p>Billed</p>
</div>
<div class="clear"></div>
</div>
</div>
<div class="col-md-3">
<div class="ip_top_dash_list">
<div class="ip_top_dash_circle">
<img src="<?php echo base_url();?>assets/images/ip_paintences.png">
</div>
<div class="ip_top_dash_detail">
<strong class="ip_counter" data-count="<?php echo $dash_view['no_of_patients']?>">0</strong>
<p>Patients</p>
</div>
<div class="clear"></div>
</div>
</div>
<div class="col-md-3">
<div class="ip_top_dash_list bordernone">
<div class="ip_top_dash_circle">
<img src="<?php echo base_url();?>assets/images/ip_vistors.png">
</div>
<div class="ip_top_dash_detail">
<strong class="ip_counter" data-count="<?php echo $dash_view['no_of_profileview']?>">0</strong>
<p>Profile Views</p>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div> -->
<div class="ip_grid_cols">
<div class="row">
<div class="col-md-8">
<div class="ip_bio_tab_div">
<div class="ip_bio_head">
Notification center
</div>
<div class="ip_bio_detail" id="pat-noti-view">
<?php
$this->load->view('patient_notifications_list')
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...@@ -190,9 +190,10 @@ ...@@ -190,9 +190,10 @@
<div class="ip_bio_detail"> <div class="ip_bio_detail">
<?php <?php
if($userdata['type']=='DOCTOR' and (!empty($this->session->userdata('notifications')))) $notifications = get_notification($userdata['id'],$userdata['type']);
if(!empty($notifications))
{ {
$notifications = $this->session->userdata('notifications'); //$notifications = $this->session->userdata('notifications');
?> ?>
<div class="ip_bio_notification_list"> <div class="ip_bio_notification_list">
<ul> <ul>
...@@ -201,55 +202,49 @@ ...@@ -201,55 +202,49 @@
{ {
?> ?>
<li> <li>
<h5><?php echo $value['type_name'];?> <h5><?php echo $value['type_desc'];?>
<div class="ip_notification_time"><?php echo change_time_to_local($value['time'])?></div> <div class="ip_notification_time"><?php echo change_time_to_local($value['time'])?></div>
</h5> </h5>
<p><?php echo $value['message'];?></p> <p><?php echo $value['message'];?></p>
</li> </li>
<?php <?php
} }
?> ?>
<!-- <li>
<h5>Nyla Augusta
<div class="ip_notification_time">12:56</div>
</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p>
</li> -->
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
<div class="ip_notification_btm_btn_bay"> <div class="ip_notification_btm_btn_bay">
<?php
if($userdata['type']=='PATIENT')
{
?>
<a class="p0" href="<?php echo base_url();?>Patient/notification">
<button class="ip_notification_btn">See All</button>
</a>
<?php
}
elseif($userdata['type']=='DOCTOR')
{
?>
<a class="p0" href="<?php echo base_url();?>Doctor/notification"> <a class="p0" href="<?php echo base_url();?>Doctor/notification">
<button class="ip_notification_btn">See All</button> <button class="ip_notification_btn">See All</button>
</a> </a>
</div>
</div>
<?php <?php
} }
?> ?>
</div>
</div>
<?php <?php
if($userdata['type']=='PATIENT') }
else
{ {
?> ?>
<div class="ip_bio_notification_list"> <div class="ip_bio_notification_list">
<ul> <ul>
<li> <li>
<h5>Nyla Augusta </p>No Notifications!</li>
<div class="ip_notification_time">12:56</div>
</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been</p>
</li> </li>
</ul> </ul>
<div class="clear"></div>
<div class="ip_notification_btm_btn_bay">
<a class="p0" href="<?php echo base_url();?>Patient/notification">
<button class="ip_notification_btn">See All</button>
</a>
</div>
</div> </div>
<?php <?php
} }
...@@ -288,7 +283,10 @@ ...@@ -288,7 +283,10 @@
<li> <li>
<p>Clinics</p> <p>Clinics</p>
</li> </li>
<div class="ip_listing_scroll">
<?php <?php
foreach ($clinic_list as $key => $elm) foreach ($clinic_list as $key => $elm)
{ {
?> ?>
...@@ -302,6 +300,10 @@ ...@@ -302,6 +300,10 @@
<?php <?php
} }
?>
</div>
<?php
} }
?> ?>
...@@ -312,6 +314,7 @@ ...@@ -312,6 +314,7 @@
<li> <li>
<p>Your Collaborator(s)</p> <p>Your Collaborator(s)</p>
</li> </li>
<div class="ip_listing_scroll">
<?php <?php
foreach ($collaboratordata as $key => $value) foreach ($collaboratordata as $key => $value)
{ {
...@@ -327,6 +330,9 @@ ...@@ -327,6 +330,9 @@
</a> </a>
<?php <?php
} }
?>
</div>
<?php
} }
?> ?>
......
...@@ -39,7 +39,9 @@ ...@@ -39,7 +39,9 @@
<p>Last Redemption</p> <p>Last Redemption</p>
</div> </div>
<div class="ip_circle_right"> <div class="ip_circle_right">
<button class="ip_circle_btn bal_btn">HISTORY</button> <a href="<?php echo base_url();?>Doctor/wallet/redemptionhistory">
<button class="ip_circle_btn bal_btn" type="button">HISTORY</button>
</a>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
...@@ -71,7 +73,9 @@ ...@@ -71,7 +73,9 @@
<p>Next Release</p> <p>Next Release</p>
</div> </div>
<div class="ip_circle_right"> <div class="ip_circle_right">
<button class="ip_circle_btn future_btn">VIEW MORE</button> <a href="<?php echo base_url();?>Doctor/wallet/futurereleases">
<button class="ip_circle_btn future_btn" type="button">VIEW MORE</button>
</a>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
...@@ -127,7 +131,7 @@ ...@@ -127,7 +131,7 @@
<div class="ip_bank_form"> <div class="ip_bank_form">
<div class="ip_bank_row"> <div class="ip_bank_row">
<div class="ip_bank_detail_frame"> <div class="ip_bank_detail_frame">
<input class="ip_bank_input reset-bank-form" data-parsley-required="" placeholder="Bank" name="bank"> <input class="ip_bank_input reset-bank-form" data-parsley-required="" placeholder="Bank" onKeyPress="if(this.value.length > 40) return false;" data-parsley-maxlength="40" name="bank">
</div> </div>
</div> </div>
<div class="ip_bank_row"> <div class="ip_bank_row">
...@@ -137,7 +141,7 @@ ...@@ -137,7 +141,7 @@
<!-- <input class="ip_bank_input" placeholder="Agency" style="border-right:2px solid #f5f5f5;"> --> <!-- <input class="ip_bank_input" placeholder="Agency" style="border-right:2px solid #f5f5f5;"> -->
<p class="p12" style="border-right:2px solid #f5f5f5;">Agency</p> <p class="p12" style="border-right:2px solid #f5f5f5;">Agency</p>
</div> </div>
<div class="col-md-8 p0 height100"><input class="ip_bank_input bordernone reset-bank-form" placeholder="xxxx-xx" data-parsley-required="" name="agency"></div> <div class="col-md-8 p0 height100"><input class="ip_bank_input bordernone reset-bank-form" placeholder="xxxx-xx" data-parsley-required="" name="agency" onKeyPress="if(this.value.length > 40) return false;" data-parsley-maxlength="40"></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -149,15 +153,14 @@ ...@@ -149,15 +153,14 @@
<option>Account</option> <option>Account</option>
</select> --> </select> -->
<p class="p12" style="border-right:2px solid #f5f5f5;">Account</p> <p class="p12" style="border-right:2px solid #f5f5f5;">Account</p>
</div> </div>
<div class="col-md-8 p0 height100"><input class="ip_bank_input bordernone reset-bank-form" placeholder="xxxx-xx" data-parsley-required="" type="number" name="account"></div> <div class="col-md-8 p0 height100"><input class="ip_bank_input bordernone reset-bank-form" placeholder="xxxx-xx" data-parsley-required="" type="number" name="account" onKeyPress="if(this.value.length > 30) return false;" data-parsley-maxlength="30"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="ip_bank_row"> <div class="ip_bank_row">
<div class="ip_bank_detail_frame"> <div class="ip_bank_detail_frame">
<input class="ip_bank_input reset-bank-form" placeholder="Name" data-parsley-required="" name="name"> <input class="ip_bank_input reset-bank-form" placeholder="Name" data-parsley-required="" onKeyPress="if(this.value.length > 40) return false;" data-parsley-maxlength="40" name="name">
</div> </div>
</div> </div>
<div class="row m0 height100"> <div class="row m0 height100">
...@@ -225,7 +228,7 @@ ...@@ -225,7 +228,7 @@
<!-- <input class="ip_bank_input"style="border-right:2px solid #f5f5f5;" placeholder="Redemption Value"> --> <!-- <input class="ip_bank_input"style="border-right:2px solid #f5f5f5;" placeholder="Redemption Value"> -->
<p class="p12" style="border-right:2px solid #f5f5f5;">Redemption Value</p> <p class="p12" style="border-right:2px solid #f5f5f5;">Redemption Value</p>
</div> </div>
<div class="col-md-6 p0 height100"><input class="ip_bank_input bordernone reset-redemption-form" placeholder="R$ " type="number" data-parsley-required="" name="redemption_amount"> </div> <div class="col-md-6 p0 height100"><input class="ip_bank_input bordernone reset-redemption-form" placeholder="R$ " type="number" data-parsley-required="" name="redemption_amount" onKeyPress="if(this.value.length > 6) return false;" data-parsley-maxlength="6" > </div>
</div> </div>
</div> </div>
</div> </div>
......
<div class="container">
<div class="row">
<div class="col-md-8">
<div class="ip_edit_record_cover">
<div class="ip_edit_record_head">
Future Releases
</div>
<div>
<hr>
<div class="ip_edit_record_detail">
<div class="ip_edit_row">
<div class="ip_budject_list">
<?php if(!empty($futurereleases))
{
foreach ($futurereleases as $key => $value)
{
?>
<li>
<h6 class="m0"><?php echo date('d-m-Y',$value['date']);?></h6>
<div class="child1"><h5><strong><?php echo $value['consultation_type'];?> CONSULTATION</strong></h5>
<p class="select"><?php echo $value['doctor_name'];?> | <?php echo date('h:i a',$value['time_start']);?></p>
</div>
<div class="child2"><strong><b>R$ <?php echo $value['release_amount'];?></b></strong></div>
<div class="clear"></div>
</li>
<hr>
<?php
}
}
else
{
?>
<li>
<div class="child1"><h5>No Future Realeases</h5>
</div>
<div class="clear"></div>
</li>
<hr>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-8">
<div class="ip_edit_record_cover">
<div class="ip_edit_record_head">
Redemption History
</div>
<div>
<hr>
<div class="ip_edit_record_detail">
<div class="ip_edit_row">
<div class="ip_budject_list">
<?php if(!empty($redemptiondata))
{
foreach ($redemptiondata as $key => $value)
{
?>
<li>
<h6 class="m0"><?php echo date('d-m-Y',$value['date']);?></h6>
<div class="child1"><h5><strong><?php echo $value['account_holder'];?> - <?php echo $value['bank_name'];?> <?php echo $value['account_no'];?></strong></h5>
<p class="select"><?php echo $value['status'];?></p>
</div>
<div class="child2"><strong><b>R$ <?php echo $value['amount'];?></b></strong></div>
<div class="clear"></div>
</li>
<hr>
<?php
}
}
else
{
?>
<li>
<div class="child1"><h5>No Redemption Request</h5>
</div>
<div class="clear"></div>
</li>
<hr>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
</div>
</div>
</div>
...@@ -885,7 +885,7 @@ unicode-bidi: bidi-override;display: inline-block;position: relative;bottom: 5px ...@@ -885,7 +885,7 @@ unicode-bidi: bidi-override;display: inline-block;position: relative;bottom: 5px
.ip_nav_notification_listing{width: 300px;margin: 0px;padding: 0px;box-shadow: none;border:none;position: absolute;top: 51px;} .ip_nav_notification_listing{width: 300px;margin: 0px;padding: 0px;box-shadow: none;border:none;position: absolute;top: 51px;}
.ip_nav_notification_listing li{width:100%;} .ip_nav_notification_listing li{width:100%;}
.ip_nav_notification_listing li a{padding: 0px;} .ip_nav_notification_listing li a{padding: 0px;}
.ip_nav_notification_listing .ip_bio_tab_div{margin:0px;box-shadow: none;min-height: 380px; border: 1px solid #f4f4f4;} .ip_nav_notification_listing .ip_bio_tab_div{margin:0px;box-shadow: none;min-height: 380px;border: 1px solid #f4f4f4;}
.ip_nav_notification_listing .ip_bio_tab_div .ip_bio_head{padding: 10px;height:45px;position: relative;} .ip_nav_notification_listing .ip_bio_tab_div .ip_bio_head{padding: 10px;height:45px;position: relative;}
.ip_nav_notification_listing .ip_bio_notification_list ul li{padding: 15px;padding-left: 70px;} .ip_nav_notification_listing .ip_bio_notification_list ul li{padding: 15px;padding-left: 70px;}
.ip_nav_notification_listing .ip_bio_notification_list{height: 340px;} .ip_nav_notification_listing .ip_bio_notification_list{height: 340px;}
...@@ -941,7 +941,7 @@ unicode-bidi: bidi-override;display: inline-block;position: relative;bottom: 5px ...@@ -941,7 +941,7 @@ unicode-bidi: bidi-override;display: inline-block;position: relative;bottom: 5px
/* SET-FOUR-SCREEN-FOUR */ /* SET-FOUR-SCREEN-FOUR */
.ip_listing_scroll{width:100%;max-height:200px;overflow:scroll;background-color: #fff;} .ip_listing_scroll{width:100%;max-height:170px;overflow:scroll;background-color: #fff;}
.ip_listing_scroll::-webkit-scrollbar { display: none; } .ip_listing_scroll::-webkit-scrollbar { display: none; }
.ip_listing_scroll::-moz-scrollbar { display: none; } .ip_listing_scroll::-moz-scrollbar { display: none; }
.ip_nav_profile_listing{width:210px;margin: 0px;border: 1px solid #f5f5f5;padding: 0px;padding-top:10px;box-shadow: none;top: 51px;} .ip_nav_profile_listing{width:210px;margin: 0px;border: 1px solid #f5f5f5;padding: 0px;padding-top:10px;box-shadow: none;top: 51px;}
......
...@@ -288,6 +288,14 @@ function certificate_images_loadthumbnail(file) ...@@ -288,6 +288,14 @@ function certificate_images_loadthumbnail(file)
$(function(){ $(function(){
/*PATIENT NOTIFICATION PAGE BEGINS*/
$(document).on("click","#pat-noti-loadmore",function()
{
var pageno = $('#pat-noti-pageno').val();
var result = post_ajax(base_url+'Patient/notification_ajax',{'page':pageno});
$('#pat-noti-view').html(result);
})
$('#request-redemption-btn').click(function() $('#request-redemption-btn').click(function()
{ {
......
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