Commit 7fe9708a by Jithin

collaborator section

parent 9860759e
...@@ -138,6 +138,10 @@ public function index() ...@@ -138,6 +138,10 @@ public function index()
$this->load->view('template/template', $template); $this->load->view('template/template', $template);
} }
elseif($this->session->userdata('UserData')&&($this->session->userdata('UserData')['type']=="DOCTOR/COLLABORATOR"))
{
header('Location: '.base_url().'Doctor/collaborator');
}
else else
{ {
$this->session->set_flashdata('message', array('message' => 'Invalid Session, Kindly Login', 'title' => 'Error', 'class' => 'danger')); $this->session->set_flashdata('message', array('message' => 'Invalid Session, Kindly Login', 'title' => 'Error', 'class' => 'danger'));
...@@ -1530,7 +1534,6 @@ public function check_current_user_confirmationcode() ...@@ -1530,7 +1534,6 @@ public function check_current_user_confirmationcode()
{ {
redirect(base_url()); redirect(base_url());
} }
} }
/*FUNCTION FOR EDITING COLABORATOR - DOCTOR DASHBOARD*/ /*FUNCTION FOR EDITING COLABORATOR - DOCTOR DASHBOARD*/
...@@ -1562,6 +1565,8 @@ public function check_current_user_confirmationcode() ...@@ -1562,6 +1565,8 @@ public function check_current_user_confirmationcode()
} }
/*FUNCTION FOR SAVING COLABORATOR - ADD COLLABORATOR*/ /*FUNCTION FOR SAVING COLABORATOR - ADD COLLABORATOR*/
public function saveColaborator() public function saveColaborator()
{ {
...@@ -1599,6 +1604,11 @@ public function check_current_user_confirmationcode() ...@@ -1599,6 +1604,11 @@ public function check_current_user_confirmationcode()
$picdata = array('image'=>$fullfilepath); $picdata = array('image'=>$fullfilepath);
$this->Doctor_model->update_colaborator($colaborator,$picdata); $this->Doctor_model->update_colaborator($colaborator,$picdata);
$res = array('status' =>'success','colaborator' => $colaborator); $res = array('status' =>'success','colaborator' => $colaborator);
//Updating collaborator data in session - header display
$collaborator_data = $this->Doctor_model->get_all_collaborator_for_doctor($userdata['id']);
if(!empty($collaborator_data)){$this->session->set_userdata('CollaboratorData',$collaborator_data);}
} }
} }
...@@ -1612,7 +1622,10 @@ public function check_current_user_confirmationcode() ...@@ -1612,7 +1622,10 @@ public function check_current_user_confirmationcode()
/*FUNCTION FOR UPDATING COLABORATOR DATA- SETTING AUTHORIZATION, EDIT COLLABORATOR*/ /*FUNCTION FOR UPDATING COLABORATOR DATA- SETTING AUTHORIZATION, EDIT COLLABORATOR*/
public function updateColaborator() public function updateColaborator()
{ {
//print_r($_POST);die(); $userdata = $this->session->userdata('UserData');
//print_r($_POST);
//print_r($_FILES);
//die();
$update_array = array(); $update_array = array();
if($_POST['section']=='authorizeaccess') if($_POST['section']=='authorizeaccess')
...@@ -1623,17 +1636,51 @@ public function check_current_user_confirmationcode() ...@@ -1623,17 +1636,51 @@ public function check_current_user_confirmationcode()
$update_array['capabilities'] = implode(",",$_POST['access']); $update_array['capabilities'] = implode(",",$_POST['access']);
} }
} }
elseif($_POST['section']=='profile') elseif($_POST['section']=='profile')
{ {
parse_str($_POST['data'], $req_data);
$update_array = array('name' => $req_data['name'],'telephone' => $req_data['telephone'],'cpf' => $req_data['cpf']);
//print_r($_POST);
//print_r($_FILES);die();
if(!empty($_FILES['image']))
{
$fileName = $_POST['colabor_id'].'_'.$_FILES['image']['name'];
$config = set_upload_options('./assets/uploads/profilepic/doctor_collaborator/');
$config['file_name'] = $fileName;
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('image'))
{
$error = array('error' => $this->upload->display_errors('', ''));
$res = array(
"status"=> "error",
"error"=> "Upload Error",
"message"=> "Sorry! Profile Photo not uploaded. ".$error['error']
);
//$this->Doctor_model->delete_registration_collaborator($colaborator);
}
else
{
$imagedata = $this->upload->data();
$fullfilepath='assets/uploads/profilepic/doctor_collaborator/'.$imagedata['file_name'];
$update_array['image'] = $fullfilepath;
}
}
} }
if(!empty($update_array)) if(!empty($update_array) and empty($res['error']))
{ {
$update = $this->Doctor_model->update_colaborator($_POST['colabor_id'],$update_array); $update = $this->Doctor_model->update_colaborator($_POST['colabor_id'],$update_array);
if($update) if($update)
{$res = array('status' => 'success' );} {
$res = array('status' => 'success' );
//Updating collaborator data in session - header display
$collaborator_data = $this->Doctor_model->get_all_collaborator_for_doctor($userdata['id']);
if(!empty($collaborator_data)){$this->session->set_userdata('CollaboratorData',$collaborator_data);}
}
else else
{$res = array('status'=>'error');} {$res = array('status'=>'error');}
} }
...@@ -1641,6 +1688,113 @@ public function check_current_user_confirmationcode() ...@@ -1641,6 +1688,113 @@ public function check_current_user_confirmationcode()
} }
public function collaborator()
{
$userdata = $this->session->userdata('UserData');
$clinic_list = $this->Doctor_model->get_doctor_clinic_list($userdata['id']);
$day_appointment = $this->Doctor_model->get_doctor_appointments_day($userdata['id'],'null');
foreach ($day_appointment as $key => $value)
{
$times = explode('-', $value['booking_time']);
$day_appointment[$key]['time_start'] = $times[0];
$day_appointment[$key]['time_end'] = $times[1];
}
/*CODE FOR FETCHING APPOINTMENTS COUNT(DAY/WEEK/MONTH/YEAR)*/
$attendence = array();
//DAY ATTENDENCE
$attendence = $this->Doctor_model->get_doctor_num_attendence_fordate($userdata['id'],date('y-m-d'));
//WEEK ATTENDENCE
$attendence_week = 0;
for ($i=0; $i < 7; $i++)
{
$day = date('D',strtotime('+'.$i.'day'));
$week_appointments[$i] = $this->Doctor_model->get_doctor_appointments_week($userdata['id'],date('y-m-d',strtotime('+'.$i.'day')));
foreach ($week_appointments[$i] as $key => $value)
{
if(!empty($value['count']))
{
$attendence_week = $attendence_week + $value['count'];
}
}
}
$attendence['attendence_week'] = $attendence_week;
//MONTH ATTENDENCE
$attendence_month = 0;
$month_appointment = $this->Doctor_model->get_doctor_appointments_month($userdata['id']);
foreach ($month_appointment as $key => $value) {
if(!empty($value['count']))
{
$attendence_month = $attendence_month + $value['count'];
}
}
$attendence['attendence_month'] = $attendence_month;
//YEAR ATTENDENCE
$attendence_year = $this->Doctor_model->get_doctor_appointments_year($userdata['id']);
$attendence['attendence_year'] = $attendence_year['count'];
//CODE FOR SUMMARY IN NUMBERS
$no_of_attendance = $this->Doctor_model->get_doctor_num_attendance($userdata['id']);
$no_of_billed = $this->Doctor_model->get_doctor_num_billed($userdata['id']);
$no_of_patients = $this->Doctor_model->get_doctor_num_patients($userdata['id']);
$no_of_profileview = $this->Doctor_model->get_doctor_num_profileview($userdata['id']);
if(empty($no_of_billed['amount']))
{
$no_of_billed['amount'] = 0;
}
$dash_view = array('no_of_attendance' => $no_of_attendance['count'],'no_of_billed'=>$no_of_billed['amount'],'no_of_patients' => $no_of_patients['count'],'no_of_profileview'=>$no_of_profileview['count']);
//FETCHING NOTIFICATION FOR DASHBOARD VIEW
$notifications = $this->Doctor_model->get_notifications($userdata['id'],1,10);
foreach ($notifications as $key => $value)
{
if($value['type']==0)
{$notifications[$key]['type_name']='Redemption Made';}
elseif($value['type']==1)
{$notifications[$key]['type_name']='New Review';}
elseif($value['type']==2)
{$notifications[$key]['type_name']='New Consultation';}
elseif($value['type']==3)
{$notifications[$key]['type_name']='Added to new clinic';}
}
if(!empty($notifications)){$this->session->set_userdata('notifications',$notifications);}
//print_r($notifications);die();
$recent = $this->Home_model->get_recent_chat($userdata['id'],$userdata['type']);
//$recent = json_decode($recent);
//PASSING VALUES TO VIEW
$template['recent'] = $recent;
$template['doctor_data'] = $doctor_data;
$template['clinic_list'] = $clinic_list;
$template['day_appointment'] = $day_appointment;
$template['dash_view'] = $dash_view;
$template['attendence'] = $attendence;
$template['attendence'] = $attendence;
$template['notifications'] = $notifications;
$template['page'] = "collaborator_dash";
$template['page_title'] = "Error";
$this->load->view('template/template', $template);
//print_r($userdata);
}
/*FUNCTION TO REMOVE COLLABORATOR PROFILE*/
public function removeColaborator()
{
}
......
...@@ -37,7 +37,7 @@ class Home extends CI_Controller { ...@@ -37,7 +37,7 @@ class Home extends CI_Controller {
if($this->session->userdata('UserData')) if($this->session->userdata('UserData'))
{ {
$userdata = $this->session->userdata('UserData'); $userdata = $this->session->userdata('UserData');
if($userdata['type']!="DOCTOR") if($userdata['type']=="PATIENT")
{ {
$this->load->view('template/template', $template); $this->load->view('template/template', $template);
} }
...@@ -99,7 +99,7 @@ class Home extends CI_Controller { ...@@ -99,7 +99,7 @@ class Home extends CI_Controller {
public function reg_patient() public function reg_patient()
{ {
parse_str($_REQUEST['data'], $output); parse_str($_REQUEST['data'], $output);
$reg_data = array('email' => $output['reg_pat_email'],'name' => $output['reg_pat_name'],'username' => $output['reg_pat_username'],'password' => md5($output['reg_pat_password']),'cpf' => $output['reg_pat_cpf'],'rg' => $output['reg_pat_rg'],'dob' =>strtotime($output['reg_pat_dob']),'gender' => $output['reg_pat_gender'],'weight' => $output['reg_pat_weight'],'height' => $output['reg_pat_height'],'blood_group' => $output['reg_pat_bloodgrp'],'zip_code' => $output['reg_pat_cep'],'street_address' => $output['reg_pat_streetadd'],'locality' => $output['reg_pat_locality'],'number' => $output['reg_pat_number'],'landmark' => $output['reg_pat_complement'] ); $reg_data = array('email' => $output['reg_pat_email'],'name' => $output['reg_pat_name'],'username' => $output['reg_pat_username'],'password' => md5($output['reg_pat_password']),'cpf' => $output['reg_pat_cpf'],'rg' => $output['reg_pat_rg'],'dob' =>strtotime($output['reg_pat_dob']),'gender' => $output['reg_pat_gender'],'weight' => $output['reg_pat_weight'],'height' => $output['reg_pat_height'],'blood_group' => $output['reg_pat_bloodgrp'],'zip_code' => $output['reg_pat_cep'],'street_address' => $output['reg_pat_streetadd'],'locality' => $output['reg_pat_locality'],'number' => $output['reg_pat_number'],'landmark' => $output['reg_pat_complement'],'occupation' => $output['reg_pat_occupation'] );
//print_r($reg_data);die(); //print_r($reg_data);die();
$result = $this->Home_model->registration($reg_data); $result = $this->Home_model->registration($reg_data);
if($result['status'] == 'success') if($result['status'] == 'success')
...@@ -312,7 +312,6 @@ class Home extends CI_Controller { ...@@ -312,7 +312,6 @@ class Home extends CI_Controller {
); );
$collaborator_data = $this->Doctor_model->get_all_collaborator_for_doctor($result['userdata']['id']); $collaborator_data = $this->Doctor_model->get_all_collaborator_for_doctor($result['userdata']['id']);
//print_r($collaborator_data);die();
if(!empty($collaborator_data)){$this->session->set_userdata('CollaboratorData',$collaborator_data);} if(!empty($collaborator_data)){$this->session->set_userdata('CollaboratorData',$collaborator_data);}
} }
else else
...@@ -325,6 +324,51 @@ class Home extends CI_Controller { ...@@ -325,6 +324,51 @@ class Home extends CI_Controller {
} }
} }
else if(($result['status']=='success')&&($request['login_type']=="COLLABORATOR"))
{
//print_r($result);die();
$doctor_data = $this->Doctor_model->get_single_doctor($result['userdata']['doctor_id']);
//print_r($doctor_data);die();
$res = array(
"status"=> "success",
"data"=>array(
"type"=>"DOCTOR/COLLABORATOR",
"id"=> $doctor_data['doctorid'],
"name"=> $doctor_data['dr_name'],
"username"=> $doctor_data['dr_username'],
"email"=> $doctor_data['dr_email'],
"specialization_id" => $doctor_data['dr_specialization_id'],
"specialization" => $doctor_data['dr_specialization'],
"telphone" => $doctor_data['dr_telephone'],
"cpf" => $doctor_data['dr_cpf'],
"rg" => $doctor_data['dr_rg'],
"dob" => $doctor_data['dr_dob'],
"gender" => $doctor_data['dr_gender'],
"price" => $doctor_data['dr_price'],
"zip_code" => $doctor_data['dr_cep'],
"street_address" => $doctor_data['dr_rua'],
"locality" => $doctor_data['dr_neighbourhood'],
"number" => $doctor_data['dr_number'],
"landmark" =>$doctor_data['dr_complement'],
"profile_photo" => $doctor_data['dr_pic'],
"bio" => $doctor_data['dr_bio'],
"c_id" => $result['userdata']['id'],
"c_name" => $result['userdata']['name'],
"c_email" => $result['userdata']['email'],
"c_telephone" => $result['userdata']['telephone'],
"c_cpf" => $result['userdata']['cpf'],
"c_capabilities" => $result['userdata']['capabilities']
)
);
$collaborator_data = $this->Doctor_model->get_all_collaborator_for_doctor($result['userdata']['id']);
if(!empty($collaborator_data)){$this->session->set_userdata('CollaboratorData',$collaborator_data);}
}
} }
else if(($result['status']=='success')&&($result['userdata']['account_status']==1)) else if(($result['status']=='success')&&($result['userdata']['account_status']==1))
{ {
...@@ -369,6 +413,10 @@ class Home extends CI_Controller { ...@@ -369,6 +413,10 @@ class Home extends CI_Controller {
{ {
unset($_SESSION['notifications']); unset($_SESSION['notifications']);
} }
if($this->session->userdata('CollaboratorData'))
{
unset($_SESSION['CollaboratorData']);
}
header('Location: '.base_url()); header('Location: '.base_url());
} }
...@@ -653,6 +701,14 @@ class Home extends CI_Controller { ...@@ -653,6 +701,14 @@ class Home extends CI_Controller {
print json_encode($check_result); print json_encode($check_result);
} }
/*FUNCTION TO DISPLAY NOT AUTHORIZED ERROR PAGE*/
public function error()
{
$template['page'] = "error_notauthorized";
$template['page_title'] = "Error";
$this->load->view('template/template', $template);
}
/*FUNCTION FOR SENTING CONFRIMATION CODE FOR ACCOUNT DELETION - PATIENT AND DOCTOR*/ /*FUNCTION FOR SENTING CONFRIMATION CODE FOR ACCOUNT DELETION - PATIENT AND DOCTOR*/
/*public function sentConfirmationcode($user) /*public function sentConfirmationcode($user)
......
...@@ -621,6 +621,11 @@ public function record() ...@@ -621,6 +621,11 @@ public function record()
} }
} }
public function notification()
{
redirect(base_url());
}
......
...@@ -141,6 +141,12 @@ ...@@ -141,6 +141,12 @@
$query_email = $this->db->get_where("tbl_doctors",array("email"=>$data['login-form-username'],"password"=>md5($data['login-form-password']))); $query_email = $this->db->get_where("tbl_doctors",array("email"=>$data['login-form-username'],"password"=>md5($data['login-form-password'])));
} }
else if($data['login_type']=="COLLABORATOR")
{
$query = $this->db->get_where("tbl_doctor_colaborators",array("email"=>$data['login-form-username'],"password"=>md5($data['login-form-password'])));
$query_email = $this->db->get_where("tbl_doctor_colaborators",array("email"=>$data['login-form-username'],"password"=>md5($data['login-form-password'])));
}
if($query->num_rows() > 0 || $query_email->num_rows() >0 ){ if($query->num_rows() > 0 || $query_email->num_rows() >0 ){
if($query->num_rows() > 0) if($query->num_rows() > 0)
...@@ -314,7 +320,7 @@ ...@@ -314,7 +320,7 @@
public function get_recent_chat($id,$type) public function get_recent_chat($id,$type)
{ {
if($type=='DOCTOR') if($type=='DOCTOR' or $type=='DOCTOR/COLLABORATOR')
{ {
$this->db->select('tbl_recent_chats.*, $this->db->select('tbl_recent_chats.*,
tbl_registration.name as pat_name, tbl_registration.name as pat_name,
......
...@@ -151,7 +151,7 @@ public function filter_search($post_data) ...@@ -151,7 +151,7 @@ public function filter_search($post_data)
$this->db->join('tbl_specialization', 'tbl_specialization.id = tbl_doctors.specialization','left'); $this->db->join('tbl_specialization', 'tbl_specialization.id = tbl_doctors.specialization','left');
$this->db->join('tbl_clinic_doctors', 'tbl_doctors.id = tbl_clinic_doctors.doctor_id','inner'); $this->db->join('tbl_clinic_doctors', 'tbl_doctors.id = tbl_clinic_doctors.doctor_id','inner');
$this->db->join('tbl_clinic', 'tbl_clinic_doctors.clinic_id = tbl_clinic.id','left'); $this->db->join('tbl_clinic', 'tbl_clinic_doctors.clinic_id = tbl_clinic.id','left');
$this->db->where('tbl_doctors.price>0');
if(isset($post_data['doctor-search-speciality']) && !empty($post_data['doctor-search-speciality'])) if(isset($post_data['doctor-search-speciality']) && !empty($post_data['doctor-search-speciality']))
{ {
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<div class="ip_add_photo floatRight"> <div class="ip_add_photo floatRight">
<input name="image" data-parsley-required="true" type="file" accept="image/*" class="ip_reg_form_input" <input name="image" data-parsley-required="true" type="file" accept="image/*" class="ip_reg_form_input"
data-parsley-error-message="Choose Profile Photo" onchange="pat_add_depend_loadthumbnail(this,'doc-add-colabor-pic')" id="colabor-pic"> data-parsley-error-message="Choose Profile Photo" onchange="readURL(this,'doc-add-colabor-pic')" id="colabor-pic">
</div> </div>
</div> </div>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="ip_edit_row"> <div class="ip_edit_row">
<div class="ip_bank_detail_frame"> <div class="ip_bank_detail_frame">
<input class="ip_bank_input" disabled placeholder="Email" data-parsley-required="" data-parsley-emailcolabor="" onKeyPress="if(this.value.length > 75) return false;" name="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" value="<?php echo $collaborator_data['email'];?>"> <input class="ip_bank_input" disabled placeholder="Email" onKeyPress="if(this.value.length > 75) return false;" name="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" value="<?php echo $collaborator_data['email'];?>">
</div> </div>
</div> </div>
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
<div class="col-md-6"> <div class="col-md-6">
<p class="ip_row_p">Add photo:</p> <p class="ip_row_p">Add photo:</p>
<div class="ip_reg_modal_addphoto floatLeft"> <div class="ip_reg_modal_addphoto floatLeft">
<img id="doc-add-colabor-pic"> <img id="doc-edit-colabor-pic" src="<?php echo base_url(); echo $collaborator_data['image']; ?>">
</div> </div>
<div class="ip_add_photo floatRight"> <div class="ip_add_photo floatRight">
<input name="image" data-parsley-required="true" type="file" accept="image/*" class="ip_reg_form_input" <input name="image" type="file" accept="image/*" class="ip_reg_form_input"
data-parsley-error-message="Choose Profile Photo" onchange="pat_add_depend_loadthumbnail(this,'doc-add-colabor-pic')" id="colabor-pic"> data-parsley-error-message="Choose Profile Photo" onchange="readURL(this,'doc-edit-colabor-pic')" id="colabor-pic-edit">
</div> </div>
</div> </div>
...@@ -68,14 +68,14 @@ ...@@ -68,14 +68,14 @@
<hr> <hr>
<div class="ip_coloborator_btn_bay"> <div class="ip_coloborator_btn_bay">
<a href="javascript:void(0)"> <a href="javascript:void(0)">
<button class="ip_colaborator_btn" type="button" id="add-colaborator-btn">Update & Save</button> <button class="ip_colaborator_btn" type="button" id="edit-colaborator-btn" collabor="<?php echo $collaborator_data['id'];?>">Update & Save</button>
</a> </a>
<a href="javascript:void(0)"> <a href="javascript:void(0)">
<button class="ip_colaborator_delete_btn">Delete Collaborator</button> <button class="ip_colaborator_delete_btn" type="button" id="delete-colaborator-btn" collabor="<?php echo $collaborator_data['id'];?>" >Delete Collaborator</button>
</a> </a>
</div> </div>
<div class="alert alert-success alert-dismiss textCenter hidden" id="colabor-add-success">Collaborator Added, Authorize Access</div> <div class="alert alert-success alert-dismiss textCenter hidden" id="colabor-edit-success">Collaborator Profile Updated!</div>
<div class="alert alert-danger alert-dismiss textCenter hidden" id="colabor-add-error">Error! Kindly try Again</div> <div class="alert alert-danger alert-dismiss textCenter hidden" id="colabor-edit-error">Error! Kindly try Again</div>
</div> </div>
</div> </div>
...@@ -96,18 +96,20 @@ ...@@ -96,18 +96,20 @@
</div> </div>
<br> <br>
<div class="ip_notify_time"> <div class="ip_notify_time">
<li> <li>
<div class="ip_day_time_schedule_details_data p0"> <div class="ip_day_time_schedule_details_data p0">
<input type="hidden" name="section" value="authorizeaccess"> <input type="hidden" name="section" value="authorizeaccess">
<input id="checkbox-41" class="ip_custom_checkbox1" name="access[]" type="checkbox" value="Doctor/collaborator"> <input id="checkbox-access-appoint" class="ip_custom_checkbox1" name="access[]" type="checkbox" value="Doctor/collaborator">
<label for="checkbox-41" class="ip_custom_checkbox_label1">Appointment</label> <label for="checkbox-access-appoint" class="ip_custom_checkbox_label1">Appointment</label>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</li> </li>
<li> <li>
<div class="ip_day_time_schedule_details_data p0"> <div class="ip_day_time_schedule_details_data p0">
<input id="checkbox-42" class="ip_custom_checkbox1" name="access[]" type="checkbox" value="Doctor/chat" > <input id="checkbox-access-msg" class="ip_custom_checkbox1" name="access[]" type="checkbox" value="Doctor/chat" >
<label for="checkbox-42" class="ip_custom_checkbox_label1">Messages</label> <label for="checkbox-access-msg" class="ip_custom_checkbox_label1">Messages</label>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</li> </li>
...@@ -118,10 +120,10 @@ ...@@ -118,10 +120,10 @@
</form> </form>
<hr> <hr>
<div class="ip_coloborator_btn_bay"> <div class="ip_coloborator_btn_bay">
<button class="ip_colaborator_btn floatRight" type="button" id="colabor-auth-access">Authorize access</button> <button class="ip_colaborator_btn floatRight" type="button" colabor="<?php echo $collaborator_data['id'];?>" id="colabor-auth-access">Authorize access</button>
<div class="clear"></div> <div class="clear"></div>
<br> <br>
<div class="alert alert-danger alert-dismiss textCenter hidden" id="colabor-auth-access-error">Please add Collaborator</div> <div class="alert alert-danger alert-dismiss textCenter hidden" id="colabor-auth-access-error">Collaborator not selected</div>
<div class="alert alert-success alert-dismiss textCenter hidden" id="colabor-auth-access-success">Settings Saved!</div> <div class="alert alert-success alert-dismiss textCenter hidden" id="colabor-auth-access-success">Settings Saved!</div>
</div> </div>
...@@ -132,3 +134,33 @@ ...@@ -132,3 +134,33 @@
</div> </div>
</div> </div>
</div> </div>
<script>
var checkbox_appoint = document.getElementById('checkbox-access-appoint');
var checkbox_msg = document.getElementById('checkbox-access-msg');
<?php if(!empty($collaborator_data['capabilities'])){
$permissions = explode(',', $collaborator_data['capabilities']);
foreach ($permissions as $key => $value)
{
if($value== 'Doctor/collaborator')
{
?>
checkbox_appoint.checked = true;
<?php
}
if($value== 'Doctor/chat')
{
?>
checkbox_msg.checked = true;
<?php
}
}
}
?>
</script>
...@@ -74,15 +74,17 @@ ...@@ -74,15 +74,17 @@
</div> </div>
<div class="col-md-3 p0"> <div class="col-md-3 p0">
<a href="<?php echo base_url();?>Doctor/recordsview/<?php echo $value['pat_id']?>">
<div class="ip_record_pic"> <div class="ip_record_pic">
<img src="<?php echo base_url();echo $value['pat_pic'];?>"> <img src="<?php echo base_url();echo $value['pat_pic'];?>">
</div> </div>
<div class="ip_record_name"> <div class="ip_record_name">
<a href="<?php echo base_url();?>Doctor/recordsview/<?php echo $value['pat_id']?>">
<?php echo $value['pat_name'];?> <?php echo $value['pat_name'];?>
</a>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</a>
</div> </div>
<div class="col-md-3 p0"> <div class="col-md-3 p0">
...@@ -132,9 +134,11 @@ ...@@ -132,9 +134,11 @@
</div> </div>
<div class="col-md-2 p0"> <div class="col-md-2 p0">
<a href="javascript:void(0)">
<div class="ip_record_name sent-broadcast-btn"> <div class="ip_record_name sent-broadcast-btn">
<span>Message</span><span><img src="<?php echo base_url();?>assets/images/ip_menu4.png"></span> <span>Message</span><span><img src="<?php echo base_url();?>assets/images/ip_menu4.png"></span>
</div> </div>
</a>
</div> </div>
</div> </div>
......
...@@ -78,15 +78,15 @@ ...@@ -78,15 +78,15 @@
</div> </div>
<div class="col-md-3 p0"> <div class="col-md-3 p0">
<a href="<?php echo base_url();?>Doctor/recordsview/<?php echo $value['pat_id']?>">
<div class="ip_record_pic"> <div class="ip_record_pic">
<img src="<?php echo base_url();echo $value['pat_pic'];?>"> <img src="<?php echo base_url();echo $value['pat_pic'];?>">
</div> </div>
<div class="ip_record_name"> <div class="ip_record_name">
<a href="<?php echo base_url();?>Doctor/recordsview/<?php echo $value['pat_id']?>">
<?php echo $value['pat_name'];?> <?php echo $value['pat_name'];?>
</a>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</a>
</div> </div>
<div class="col-md-3 p0"> <div class="col-md-3 p0">
...@@ -134,9 +134,11 @@ ...@@ -134,9 +134,11 @@
</div> </div>
<div class="col-md-2 p0"> <div class="col-md-2 p0">
<a href="javascript:void(0)">
<div class="ip_record_name sent-broadcast-btn-sch"> <div class="ip_record_name sent-broadcast-btn-sch">
<span>Message</span><span><img src="<?php echo base_url();?>assets/images/ip_menu4.png"></span> <span>Message</span><span><img src="<?php echo base_url();?>assets/images/ip_menu4.png"></span>
</div> </div>
</a>
</div> </div>
</div> </div>
......
<h5 class="textCenter">
<img class="ip_noaccess_img" src="<?php echo base_url();?>assets/images/no-access.jpg">
</h5>
<h3 class="textCenter">Access Denied!</h3>
<h5 class="textCenter">You are not authorized to access this page!</h5>
\ No newline at end of file
...@@ -94,6 +94,9 @@ ...@@ -94,6 +94,9 @@
<input id="b" class="ip_custom_checkbox1 ip_gender_check_checkbox " type="radio" name="login_type" value="PATIENT"> <input id="b" class="ip_custom_checkbox1 ip_gender_check_checkbox " type="radio" name="login_type" value="PATIENT">
<label for="b" class="ip_custom_checkbox_label1 ip_doc_paitent ip_gender_check_label">PATIENT</label> <label for="b" class="ip_custom_checkbox_label1 ip_doc_paitent ip_gender_check_label">PATIENT</label>
<input id="c" class="ip_custom_checkbox1 ip_gender_check_checkbox " type="radio" name="login_type" value="COLLABORATOR">
<label for="c" class="ip_custom_checkbox_label1 ip_doc_paitent ip_gender_check_label">COLLABORATOR</label>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
...@@ -501,6 +504,15 @@ We send the information to<br>password recovery </p> ...@@ -501,6 +504,15 @@ We send the information to<br>password recovery </p>
</div> </div>
</div> </div>
</div> </div>
<div class="ip_reg_modal_row">
<div class="row">
<div class="col-md-12">
<div class="ip_bank_detail_frame">
<input data-parsley-maxlength="50" name="reg_pat_occupation" type="text" onKeyPress="if(this.value.length > 50) return false;" class="ip_reg_form_input reset-form-custom" placeholder="Occupation">
</div>
</div>
</div>
</div>
<hr> <hr>
<div class="ip_reg_modal_footer"> <div class="ip_reg_modal_footer">
<button class="ip_sign_footer_btn btn btn-primary nextBtn floatRight nextBtn-3" type="button">Next</button> <button class="ip_sign_footer_btn btn btn-primary nextBtn floatRight nextBtn-3" type="button">Next</button>
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
</div> </div>
</form> </form>
<div class="ip_result_listing"> <div class="ip_result_listing">
<div class="ip_result_listing_loader hidden" id="search_filter_loader"></div> <!-- <div class="ip_result_listing_loader hidden" id="search_filter_loader"></div> -->
<ul id="searchresult"> <ul id="searchresult">
<?php $this->load->view('search_doctor_result'); ?> <?php $this->load->view('search_doctor_result'); ?>
......
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
<input class="ip_nav_search_text" type="text" placeholder="Search"> <input class="ip_nav_search_text" type="text" placeholder="Search">
</div> </div>
</li> --> </li> -->
<?php if(!empty($userdata)) <?php if(!empty($userdata) and ($userdata['type']=='DOCTOR') or $userdata['type']=='PATIENT')
{?> {?>
<li class="dropdown"> <li class="dropdown">
<div class="ip_nav_notification dropdown-toggle" data-toggle="dropdown"> <div class="ip_nav_notification dropdown-toggle" data-toggle="dropdown">
...@@ -279,6 +279,11 @@ ...@@ -279,6 +279,11 @@
<!-- CODE FOR SHOWING COLLABORATOR --> <!-- CODE FOR SHOWING COLLABORATOR -->
<?php if(!empty($collaboratordata)){ <?php if(!empty($collaboratordata)){
?>
<li>
<p>Your Collaborator(s)</p>
</li>
<?php
foreach ($collaboratordata as $key => $value) foreach ($collaboratordata as $key => $value)
{ {
?> ?>
...@@ -308,6 +313,19 @@ ...@@ -308,6 +313,19 @@
</ul> </ul>
<?php } ?> <?php } ?>
<?php if(!empty($userdata)&&($userdata['type']=="DOCTOR/COLLABORATOR"))
{?>
<ul class="dropdown-menu ip_nav_profile_listing">
<div class="ip_arrow_up"></div>
<li class="bordernone">
<a href="<?php echo base_url()?>Home/logout">Sign Out</a>
</li>
</ul>
<?php } ?>
<?php if(!empty($userdata)&&($userdata['type']=="PATIENT")) <?php if(!empty($userdata)&&($userdata['type']=="PATIENT"))
{?> {?>
<ul class="dropdown-menu ip_nav_profile_listing"> <ul class="dropdown-menu ip_nav_profile_listing">
...@@ -348,7 +366,7 @@ ...@@ -348,7 +366,7 @@
<?php } ?> <?php } ?>
<div class="ip_nav_account_profile_name"> <div class="ip_nav_account_profile_name">
<?php if(!empty($userdata)&&($userdata['type']=="DOCTOR")) <?php if(!empty($userdata)&&($userdata['type']=="DOCTOR" or $userdata['type']=="DOCTOR/COLLABORATOR"))
{?>Dr.<?php echo $userdata['name'];} {?>Dr.<?php echo $userdata['name'];}
else if(!empty($userdata)&&($userdata['type']=="PATIENT")){echo $userdata['name'];} else if(!empty($userdata)&&($userdata['type']=="PATIENT")){echo $userdata['name'];}
......
...@@ -100,10 +100,11 @@ $scope.load_chat =function(object) ...@@ -100,10 +100,11 @@ $scope.load_chat =function(object)
} }
//console.log($scope.chat_id) //console.log($scope.chat_id)
//console.log($scope.opponent) //console.log($scope.opponent)
$('.full_screen_loader').removeClass('hidden');
var connRef = firebase.database().ref('chats/'+$scope.chat_id+'/').orderByChild("time"); var connRef = firebase.database().ref('chats/'+$scope.chat_id+'/').orderByChild("time");
connRef.on('value', function(snapshot) connRef.on('value', function(snapshot)
{ {
$('.full_screen_loader').addClass('hidden');
$scope.messages = snapshot.val(); $scope.messages = snapshot.val();
angular.forEach($scope.messages,(data,key)=>{ angular.forEach($scope.messages,(data,key)=>{
var d = new Date(data.time); var d = new Date(data.time);
......
...@@ -44,12 +44,27 @@ function post_ajax_serialize(url, data) { ...@@ -44,12 +44,27 @@ function post_ajax_serialize(url, data) {
return result; return result;
} }
/*$(document).ajaxStart(function() { /* $(document).ajaxStart(function(val) {
console.log('ajaxStart',val)
$('.full_screen_loader').removeClass('hidden'); $('.full_screen_loader').removeClass('hidden');
}).ajaxStop(function() { })
*/
$( document ).ajaxSend(function( event, jqxhr, settings ) {
if(!(settings.url==base_url+'Home/get_recent_chat') && !(settings.url==base_url+'Home/update_recent_chat'))
{
$('.full_screen_loader').removeClass('hidden');
}
});
$(document).ajaxStop(function() {
//console.log('ajaxStop')
setTimeout(function(){
$('.full_screen_loader').addClass('hidden'); $('.full_screen_loader').addClass('hidden');
},150)
}); });
*/
function initialize_map(id) { function initialize_map(id) {
...@@ -83,11 +98,11 @@ function initialize_map(id) { ...@@ -83,11 +98,11 @@ function initialize_map(id) {
function load_filterchange() function load_filterchange()
{ {
var filter_data = $('#searchfilter_form').serialize(); var filter_data = $('#searchfilter_form').serialize();
console.log(filter_data); //console.log(filter_data);
var filter_response = post_ajax(base_url+'Searchdoctor/filter_search',filter_data); var filter_response = post_ajax(base_url+'Searchdoctor/filter_search',filter_data);
$('#searchresult').html(filter_response); $('#searchresult').html(filter_response);
load_dynamic_map(); load_dynamic_map();
$('#search_filter_loader').addClass('hidden'); /* $('#search_filter_loader').addClass('hidden');*/
} }
$('#reg-doc-temppic').hide(); $('#reg-doc-temppic').hide();
...@@ -112,7 +127,7 @@ Global_getLocation = function() ...@@ -112,7 +127,7 @@ Global_getLocation = function()
{ {
if (navigator.geolocation) if (navigator.geolocation)
{ {
var item = navigator.geolocation.getCurrentPosition(Global_showPosition,errorCallbackLocation,{timeout:15000}); var item = navigator.geolocation.getCurrentPosition(Global_showPosition,errorCallbackLocation,{timeout:20000});
} }
} }
...@@ -149,6 +164,7 @@ errorCallbackLocation = function(error) ...@@ -149,6 +164,7 @@ errorCallbackLocation = function(error)
//console.log(error) //console.log(error)
if(error.code==3) if(error.code==3)
alert(error.message+'. Cant Find Your Location,Try Again Later'); alert(error.message+'. Cant Find Your Location,Try Again Later');
window.location.reload();
} }
function cancel_consult(thiss) function cancel_consult(thiss)
...@@ -196,6 +212,7 @@ function pat_edit_loadthumbnail(file) ...@@ -196,6 +212,7 @@ function pat_edit_loadthumbnail(file)
$('#pat-edt-pic').attr('src',tmppath); $('#pat-edt-pic').attr('src',tmppath);
$('#pat-edt-pic-inp').attr('data-parsley-required','true'); $('#pat-edt-pic-inp').attr('data-parsley-required','true');
} }
function doc_edit_loadthumbnail(file) function doc_edit_loadthumbnail(file)
{ {
var tmppath = URL.createObjectURL(file.files[0]); var tmppath = URL.createObjectURL(file.files[0]);
...@@ -203,13 +220,29 @@ function doc_edit_loadthumbnail(file) ...@@ -203,13 +220,29 @@ function doc_edit_loadthumbnail(file)
//console.log(file.files[0]) //console.log(file.files[0])
$('#doc-edt-pic-inp').attr('data-parsley-required','true'); $('#doc-edt-pic-inp').attr('data-parsley-required','true');
} }
function pat_add_depend_loadthumbnail(file,id) function pat_add_depend_loadthumbnail(file,id)
{ {
//console.log(file.files[0])
var tmppath = URL.createObjectURL(file.files[0]); var tmppath = URL.createObjectURL(file.files[0]);
//console.log(tmppath);
// $('#pat-add-depend-pic').attr('src',tmppath); // $('#pat-add-depend-pic').attr('src',tmppath);
$('#'+id).attr('src',tmppath); $('#'+id).attr('src',tmppath);
} }
function readURL(input,id)
{
if (input.files && input.files[0])
{
var reader = new FileReader();
reader.onload = function (e)
{
$('#'+id).attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
function get_current_datetime_format() function get_current_datetime_format()
{ {
var today = new Date(); var today = new Date();
...@@ -255,6 +288,49 @@ function certificate_images_loadthumbnail(file) ...@@ -255,6 +288,49 @@ function certificate_images_loadthumbnail(file)
$(function(){ $(function(){
/*DELETE COLLABORATOR PROFILE*/
$('#delete-colaborator-btn').click(function()
{
var elem = this;
var colabor = elem.getAttribute('colabor');
//var result = post_ajax(base_url+'Doctor/removeColaborator',{'collaborator_id':colabor});
//var items = JSON.parse(result);
})
/*EDIT &UPDATE COLLABORATOR PROFILE SAVE BTN*/
$('#edit-colaborator-btn').click(function()
{
var element = this;
//console.log(element.getAttribute('collabor'))
$('#colabor-add-success,#colabor-auth-access-success,#colabor-auth-access-error,#colabor-add-error').addClass('hidden');
if($('#edit-colaborator-form').parsley().validate())
{
//console.log($('#edit-colaborator-form').serialize())
var formData = new FormData();
formData.append('data',$('#edit-colaborator-form').serialize());
formData.append('image', $('#colabor-pic-edit')[0].files[0]); // Attach file
formData.append('section', 'profile'); // Attach file
formData.append('colabor_id', element.getAttribute('collabor'));
var result = post_ajax_serialize(base_url+'Doctor/updateColaborator',formData);
var items = JSON.parse(result);
console.log(items);
if(items.status=="success")
{
$('#colabor-edit-success').removeClass('hidden');
}
else if(items.status=="error" && items.error=="Upload Error")
{
$('#colabor-edit-error').removeClass('hidden').html(items.message);
}
else
{
$('#colabor-edit-error').removeClass('hidden');
}
}
})
$('#colabor-auth-access').click(function(){ $('#colabor-auth-access').click(function(){
$('#colabor-auth-access-success,#colabor-auth-access-error').addClass('hidden'); $('#colabor-auth-access-success,#colabor-auth-access-error').addClass('hidden');
var elem = this; var elem = this;
...@@ -1687,7 +1763,7 @@ $('#book_payment_btn').click(function(){ ...@@ -1687,7 +1763,7 @@ $('#book_payment_btn').click(function(){
{ {
if (navigator.geolocation) if (navigator.geolocation)
{ {
navigator.geolocation.getCurrentPosition(showPosition_home,errorCallbackLocation,{timeout:15000}); navigator.geolocation.getCurrentPosition(showPosition_home,errorCallbackLocation,{timeout:20000});
} }
function showPosition_home(position) function showPosition_home(position)
{ {
...@@ -1710,7 +1786,7 @@ $('#book_payment_btn').click(function(){ ...@@ -1710,7 +1786,7 @@ $('#book_payment_btn').click(function(){
$('.filter-change').on('change',function() $('.filter-change').on('change',function()
{ {
$('#search_filter_loader').removeClass('hidden'); /*$('#search_filter_loader').removeClass('hidden');*/
setTimeout(function(){ setTimeout(function(){
if($('#filter_dr_srch_loc').val()=="" || $('#filter_dr_srch_loc').val()==undefined|| $('#filter_dr_srch_loc').val()==null) if($('#filter_dr_srch_loc').val()=="" || $('#filter_dr_srch_loc').val()==undefined|| $('#filter_dr_srch_loc').val()==null)
...@@ -1718,7 +1794,7 @@ $('#search_filter_loader').removeClass('hidden'); ...@@ -1718,7 +1794,7 @@ $('#search_filter_loader').removeClass('hidden');
if (navigator.geolocation) if (navigator.geolocation)
{ {
navigator.geolocation.getCurrentPosition(showPosition,errorCallbackLocation,{timeout:15000}); navigator.geolocation.getCurrentPosition(showPosition,errorCallbackLocation,{timeout:20000});
} }
else else
{ {
...@@ -1781,7 +1857,7 @@ $("#login_submit").click(function() ...@@ -1781,7 +1857,7 @@ $("#login_submit").click(function()
{ {
if (navigator.geolocation) if (navigator.geolocation)
{ {
var item = navigator.geolocation.getCurrentPosition(showPosition,errorCallbackLocation,{timeout:15000}); var item = navigator.geolocation.getCurrentPosition(showPosition,errorCallbackLocation,{timeout:20000});
} }
} }
...@@ -1839,6 +1915,12 @@ $("#login_submit").click(function() ...@@ -1839,6 +1915,12 @@ $("#login_submit").click(function()
$("#login").modal("hide"); $("#login").modal("hide");
window.location.href='Doctor/'; window.location.href='Doctor/';
} }
else if(items.status=="success"&&items.data.type=="DOCTOR/COLLABORATOR")
{
$("#login").modal("hide");
window.location.href='Doctor/collaborator';
}
if(items.status=="error"&&items.error=="Login Failed") if(items.status=="error"&&items.error=="Login Failed")
{ {
$("#err-login").html(items.message); $("#err-login").html(items.message);
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificats in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only)
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;
/*
TECHLABZ
'hostname' => 'localhost',
'username' => 'techlabz_Ipok',
'password' => 'Golden_123',
'database' => 'techlabz_Ipok',
LOCALHOST
'hostname' => '192.168.138.123',
'username' => 'root',
'password' => '',
'database' => 'reeba_ipok',*/
$db['default'] = array(
'dsn' => '',
'hostname' => '192.168.138.123',
'username' => 'root',
'password' => '',
'database' => 'reeba_ipok',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
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