Commit 1d9e2fb5 by Anju M S

Merge branch 'jansa' into anju

parents 824a7372 fb7997c5
......@@ -3932,20 +3932,28 @@ print_r(date('H:i',$ms));exit();*/
//$data = $_POST;
$headers = apache_request_headers();
//$data =(array) json_decode(file_get_contents("php://input"));
$data = $_POST;
if(isset($data['fcm_token']) && strlen($data['fcm_token']) && isset($headers['Auth']) && strlen($headers['Auth'])){
$check_authToken = $this->Webservice_model->check_auth_token($headers['Auth']);
$data = (array) json_decode(file_get_contents("php://input"));;
if( isset($headers['Auth']) && strlen($headers['Auth'])){
$check_authToken = $this->Webservice_model->check_auth_token_doctor($headers['Auth']);
if($check_authToken){
if(isset($data['fcm_token']) && strlen($data['fcm_token'])){
$result = $this->Webservice_model->update_fcm_token_doctor($data,$headers['Auth']);
if($result['status'] == 'success'){
$res = array("status"=>'success');
}
else if($result['status'] == 'fail'){
$res = array(
"status"=> "error",
"error"=> "updation failed",
"message"=> "updation failed"
);
if($result['status'] == 'success'){
$res = array("status"=>'success');
}
else if($result['status'] == 'fail'){
$res = array(
"status"=> "error",
"error"=> "updation failed",
"message"=> "updation failed"
);
}
}else{
$res = array(
"status"=> "error",
"error"=> "Not Valid",
"message"=> "Fcm token is required"
);
}
}
else{
......@@ -6890,14 +6898,14 @@ print_r(date('H:i',$ms));exit();*/
$token = json_decode($request);
if ($check_markbooking['count'] != 1) {
$res = array('status' => 'fail', 'payment_status' => '0', 'message' => 'No Booking Found');
$res = array('status' => 'error', 'payment_status' => '0', 'message' => 'No Booking Found');
}
elseif(!empty($token->errors->number)) {
$res = array('status' => 'fail', 'payment_status' => '0', 'message' => 'Invalid Card Provided');
$res = array('status' => 'error', 'payment_status' => '0', 'message' => 'Invalid Card Provided');
}
else {
if (empty($patient_data['pt_customer_id'])) {
$create_customer = array('email' => $patient_data['pt_email'], 'name' => $patient_data['pt_name'], 'cpf_cnpj' => $patient_data['pt_cpf'], 'zip_code' => $patient_data['pt_zip_code'], 'street' => $patient_data['pt_street_add'], 'number' => $patient_data['pt_number'], 'complement' => $patient_data['pt_complement']);
$create_customer = array('email' => $patient_data['pt_email'], 'name' => $patient_data['pt_name'], /*'cpf_cnpj' => $patient_data['pt_cpf'],*/ 'zip_code' => $patient_data['pt_zip_code'], 'street' => $patient_data['pt_street_add'], 'number' => $patient_data['pt_number'], 'complement' => $patient_data['pt_complement']);
$request = load_curl('https://api.iugu.com/v1/customers', $create_customer);
$customer = json_decode($request);
$this->Webservice_model->update_profile($patient_data['patientid'], array('customer_id' => $customer->id));
......
......@@ -11,15 +11,24 @@ class Exam_model extends CI_Model {
if($check_exam_name->num_rows() > 0){
return false;
}else{*/
if($this->db->insert('tbl_exams',array('exam_procedure'=>encrypt_data(ucfirst($examData['exam_procedure'])),'observation'=>encrypt_data(ucfirst($examData['observation']))))) {
return true;
$exam_procedure = ucfirst($examData['exam_procedure']);
$observation = ucfirst($examData['observation']);
if($this->db->query("INSERT INTO `tbl_exams`(`exam_procedure`, `observation`) VALUES (AES_ENCRYPT('".$exam_procedure."','Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA'),AES_ENCRYPT('".$observation."','Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA'))")){
return true;
}
// if($this->db->insert('tbl_exams',array('exam_procedure'=>encrypt_data(ucfirst($examData['exam_procedure'])),'observation'=>encrypt_data(ucfirst($examData['observation']))))) {
// return true;
// }
//}
}
function get_all_exams(){
$this->db->select("CAST(AES_DECRYPT(`exam_procedure`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as exam_procedure,id,CAST(AES_DECRYPT(`observation`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as observation");
$all_exams = $this->db->get('tbl_exams');
if($all_exams->num_rows() > 0){
$result = $all_exams->result_array();
/*echo $this->db->last_query();exit();
print_r($result);exit();*/
return $result;
}
}
......@@ -29,6 +38,7 @@ class Exam_model extends CI_Model {
}
}
function get_single_exam($id){
$this->db->select("CAST(AES_DECRYPT(`exam_procedure`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as exam_procedure,id,CAST(AES_DECRYPT(`observation`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as observation ");
$single_exams = $this->db->get_where('tbl_exams',array('id' => $id));
if($single_exams->num_rows() > 0){
return $single_exams->row_array();
......@@ -41,9 +51,14 @@ class Exam_model extends CI_Model {
if($res){
return false;
}else{*/
if($this->db->update('tbl_exams',array('exam_procedure'=>encrypt_data(ucfirst($data['exam_procedure'])),'observation'=>encrypt_data(ucfirst($data['observation']))),array('id'=>$id))){
$exam_procedure = ucfirst($data['exam_procedure']);
$observation = ucfirst($data['observation']);
if($this->db->query("update `tbl_exams` set `exam_procedure` = AES_ENCRYPT('".$exam_procedure."','Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA'),`observation` = AES_ENCRYPT('".$observation."','Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') where id = $id ")) {
return true;
}
/*if($this->db->update('tbl_exams',array('exam_procedure'=>encrypt_data(ucfirst($data['exam_procedure'])),'observation'=>encrypt_data(ucfirst($data['observation']))),array('id'=>$id))){
return true;
}
}*/
//}
}
}
\ No newline at end of file
......@@ -76,16 +76,49 @@ class Webservice_model extends CI_Model {
$return_array = array('status'=>'fail');
}
}else{
//$data['name'] = encrypt_data($data['name']);
$data['about'] = encrypt_data($data['about']);
//$data['price'] = encrypt_data($data['price']);
$data['gender'] = encrypt_data($data['gender']);
//$data['domiciliary_status'] = encrypt_data($data['domiciliary_status']);
$data['rg'] = encrypt_data($data['rg']);
$data['crm'] = encrypt_data($data['crm']);
$data['cep'] = encrypt_data($data['cep']);
$data['street_address'] = encrypt_data($data['street_address']);
$data['locality'] = encrypt_data($data['locality']);
$data['number'] = encrypt_data($data['number']);
$data['complement'] = encrypt_data($data['complement']);
if($this->db->insert('tbl_doctors', $data)){
$insertid = $this->db->insert_id();
$this->db->insert('tbl_clinic_doctors',array('doctor_id'=>$insertid,'clinic_id'=> 0));
$this->db->insert('tbl_consultation',array('doctor_id'=>$insertid,'clinic_id'=> 0,'date'=>'""','date_secondary'=>'""','active_schedule'=> 0));
$this->db->query("update tbl_doctors set dob = AES_ENCRYPT(".$data['dob'].",'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA')where id = ".$insertid);
$this->db->select('tbl_specialization.id as specialization_id,tbl_specialization.specialization_name,tbl_doctors.*');
$this->db->join('tbl_specialization','tbl_specialization.id = tbl_doctors. specialization');
$query = $this->db->get_where("tbl_doctors",array("tbl_doctors.id"=>$insertid));
$return_array = array('status'=>'success','userdata'=>$query->row_array());
$query = $this->db->get_where("tbl_doctors",array("tbl_doctors.id"=>$insertid));
$this->db->select("CAST(AES_DECRYPT(`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob");
$this->db->where('id',$insertid);
$query_date = $this->db->get('tbl_doctors')->row();
$query = $query->row_array();
unset($query['dob']);
$query['dob'] = $query_date->dob;
//$query['name'] = decrypt_data($query['name']);
$query['about'] = decrypt_data($query['about']);
//$query['price'] = decrypt_data($query['price']);
$query['gender'] = decrypt_data($query['gender']);
//$query['domiciliary_status'] = decrypt_data($query['domiciliary_status']);
$query['rg'] = decrypt_data($query['rg']);
$query['crm'] = decrypt_data($query['crm']);
$query['cep'] = decrypt_data($query['cep']);
$query['street_address'] = decrypt_data($query['street_address']);
$query['locality'] = decrypt_data($query['locality']);
$query['number'] = decrypt_data($query['number']);
$query['complement'] = decrypt_data($query['complement']);
$return_array = array('status'=>'success','userdata'=>$query);
}
else{
$return_array = array('status'=>'fail');
......@@ -246,15 +279,23 @@ class Webservice_model extends CI_Model {
function update_doctor_registration_data($data,$query){
//$data['password'] = md5($data['password']);
$data['dob'] = $data['dob'];
//$data['dob'] = $data['dob'];
$data['cep'] = $data['zip_code'];
$data['complement'] = $data['landmark'];
$data['about'] = $data['biodata'];
$data['cep'] = encrypt_data($data['zip_code']);
$data['complement'] = encrypt_data($data['landmark']);
$data['about'] = encrypt_data($data['biodata']);
$data['specialization'] = $data['specialization_id'];
$data['gender'] = strtoupper($data['gender']);
$data['gender'] = encrypt_data(strtoupper($data['gender']));
$data['username'] = $data['uid'];
$data['is_registration_completed'] = 1;
//$data['name'] = encrypt_data($data['name']);
$data['price'] = encrypt_data($data['price']);
$data['domiciliary_status'] = encrypt_data($data['domiciliary_status']);
$data['rg'] = encrypt_data($data['rg']);
$data['crm'] = encrypt_data($data['crm']);
$data['street_address'] = encrypt_data($data['street_address']);
$data['locality'] = encrypt_data($data['locality']);
$data['number'] = encrypt_data($data['number']);
unset($data['zip_code']);
unset($data['landmark']);
......@@ -262,12 +303,34 @@ class Webservice_model extends CI_Model {
unset($data['specialization_id']);
if($this->db->update('tbl_doctors',$data,array('uid'=>$data['uid']))){
$this->db->query("update tbl_doctors set dob = AES_ENCRYPT(".$data['dob'].",'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA')where uid = ".$data['uid']);
$this->db->select('tbl_doctors.*,tbl_specialization.id as specialization_id,tbl_specialization.specialization_name,tbl_authtoken_doctors.doctor_id ,tbl_authtoken_doctors.authtoken');
$this->db->join('tbl_authtoken_doctors', 'tbl_authtoken_doctors.doctor_id = tbl_doctors.id');
$this->db->join('tbl_specialization','tbl_specialization.id = tbl_doctors. specialization');
$query = $this->db->get_where("tbl_doctors",array('tbl_doctors.id'=>$query->id))->row_array();
unset($query['dob']);
$this->db->select("CAST(AES_DECRYPT(`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob");
$this->db->where('uid',$data['uid']);
$query_date = $this->db->get('tbl_doctors')->row();
$query['dob'] = $query_date->dob;
$query['cep'] = decrypt_data($query['zip_code']);
$query['complement'] = decrypt_data($query['landmark']);
$query['about'] = decrypt_data($query['biodata']);
$query['gender'] = decrypt_data($query['gender']);
//$query['name'] = decrypt_data($query['name']);
$query['price'] = decrypt_data($query['price']);
$query['domiciliary_status'] = decrypt_data($query['domiciliary_status']);
$query['rg'] = decrypt_data($query['rg']);
$query['crm'] = decrypt_data($query['crm']);
$query['street_address'] = decrypt_data($query['street_address']);
$query['locality'] = decrypt_data($query['locality']);
$query['number'] = decrypt_data($query['number']);
$return_array = array('status'=>'success','userdata'=>$query);
}else{
$return_array = array('status'=>'failed');
......@@ -438,10 +501,45 @@ class Webservice_model extends CI_Model {
if(count($query_email) < 0 || $query_email == ''){
$return_array = array('status'=>'fail');
}else{
$this->db->select("CAST(AES_DECRYPT(`tbl_doctors`.`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob_new");
$this->db->where('id',$query_email['id']);
$querydate = $this->db->get('tbl_doctors')->row();
$query_email['dob'] = $query_date->dob_new;
$query_email['cep'] = decrypt_data($query_email['zip_code']);
$query_email['complement'] = decrypt_data($query_email['landmark']);
$query_email['about'] = decrypt_data($query_email['biodata']);
$query_email['gender'] = decrypt_data($query_email['gender']);
//$query_email['name'] = decrypt_data($query_email['name']);
//$query_email['price'] = decrypt_data($query_email['price']);
//$query_email['domiciliary_status'] = decrypt_data($query_email['domiciliary_status']);
$query_email['rg'] = decrypt_data($query_email['rg']);
$query_email['crm'] = decrypt_data($query_email['crm']);
$query_email['street_address'] = decrypt_data($query_email['street_address']);
$query_email['locality'] = decrypt_data($query_email['locality']);
$query_email['number'] = decrypt_data($query_email['number']);
$return_array = array('status'=>'success','userdata'=>$query_email);
}
}else{
$return_array = array('status'=>'success','userdata'=>$query);
$this->db->select("CAST(AES_DECRYPT(`tbl_doctors`.`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob_new");
$this->db->where('id',$query['id']);
$querydate = $this->db->get('tbl_doctors')->row();
$query_email = $query;
$query_email['dob'] = $query_date->dob;
$query_email['cep'] = decrypt_data($query_email['zip_code']);
$query_email['complement'] = decrypt_data($query_email['landmark']);
$query_email['about'] = decrypt_data($query_email['biodata']);
$query_email['gender'] = decrypt_data($query_email['gender']);
//$query_email['name'] = decrypt_data($query_email['name']);
//$query_email['price'] = decrypt_data($query_email['price']);
//$query_email['domiciliary_status'] = decrypt_data($query_email['domiciliary_status']);
$query_email['rg'] = decrypt_data($query_email['rg']);
$query_email['crm'] = decrypt_data($query_email['crm']);
$query_email['street_address'] = decrypt_data($query_email['street_address']);
$query_email['locality'] = decrypt_data($query_email['locality']);
$query_email['number'] = decrypt_data($query_email['number']);
$return_array = array('status'=>'success','userdata'=>$query_email);
}
return $return_array;
......@@ -580,7 +678,7 @@ class Webservice_model extends CI_Model {
$query['complement'] = decrypt_data($query['landmark']);
$query['about'] = decrypt_data($query['biodata']);
$query['gender'] = decrypt_data($query['gender']);
$query['name'] = decrypt_data($query['name']);
//$query['name'] = decrypt_data($query['name']);
$query['price'] = decrypt_data($query['price']);
$query['domiciliary_status'] = decrypt_data($query['domiciliary_status']);
$query['rg'] = decrypt_data($query['rg']);
......@@ -605,8 +703,26 @@ class Webservice_model extends CI_Model {
$this->db->join('tbl_specialization','tbl_specialization.id = tbl_doctors. specialization','left');
$query_userdata = $this->db->get_where("tbl_doctors",array("uid"=>$data));
if($query_userdata->num_rows() > 0){
$query = $query_userdata->row_array();
$this->db->select("CAST(AES_DECRYPT(`tbl_doctors`.`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob_new");
$this->db->where('id',$query['id']);
$querydate = $this->db->get('tbl_doctors')->row();
$query['dob'] = $query_date->dob_new;
$query['cep'] = decrypt_data($query['zip_code']);
$query['complement'] = decrypt_data($query['landmark']);
$query['about'] = decrypt_data($query['biodata']);
$query['gender'] = decrypt_data($query['gender']);
//$query['name'] = decrypt_data($query['name']);
$query['price'] = decrypt_data($query['price']);
$query['domiciliary_status'] = decrypt_data($query['domiciliary_status']);
$query['rg'] = decrypt_data($query['rg']);
$query['crm'] = decrypt_data($query['crm']);
$query['street_address'] = decrypt_data($query['street_address']);
$query['locality'] = decrypt_data($query['locality']);
$query['number'] = decrypt_data($query['number']);
$return_array = array('status'=>'success','userdata'=>$query_userdata->row_array());
$return_array = array('status'=>'success','userdata'=>$query);
}
else{
$return_array = array('status'=>'fail');
......@@ -647,13 +763,52 @@ class Webservice_model extends CI_Model {
//.............. Insert uid for doctor
public function insert_uid_doctor($data){
$data['is_registration_completed'] = 0;
$data['name'] = encrypt_data($data['name']);
$data['about'] = encrypt_data($data['about']);
$data['price'] = encrypt_data($data['price']);
$data['gender'] = encrypt_data($data['gender']);
$data['domiciliary_status'] = encrypt_data($data['domiciliary_status']);
$data['rg'] = encrypt_data($data['rg']);
$data['crm'] = encrypt_data($data['crm']);
$data['cep'] = encrypt_data($data['cep']);
$data['street_address'] = encrypt_data($data['street_address']);
$data['locality'] = encrypt_data($data['locality']);
$data['number'] = encrypt_data($data['number']);
$data['complement'] = encrypt_data($data['complement']);
$this->db->insert('tbl_doctors',$data);
$insertid = $this->db->insert_id();
$this->db->query("update tbl_doctors set dob = AES_ENCRYPT(".$data['dob'].",'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA')where id = ".$insertid);
$this->db->select('tbl_doctors.*');
$query_userdata = $this->db->get_where("tbl_doctors",array("id"=>$insertid));
if($query_userdata->num_rows() > 0){
$return_array = array('status'=>'success','userdata'=>$query_userdata->row_array());
$query = $query_userdata->row_array();
$this->db->select("CAST(AES_DECRYPT(`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob");
$this->db->where('id',$insertid);
$query_date = $this->db->get('tbl_doctors')->row();
unset($query['dob']);
$query['dob'] = $query_date->dob;
//$query['name'] = decrypt_data($query['name']);
$query['about'] = decrypt_data($query['about']);
$query['price'] = decrypt_data($query['price']);
$query['gender'] = decrypt_data($query['gender']);
$query['domiciliary_status'] = decrypt_data($query['domiciliary_status']);
$query['rg'] = decrypt_data($query['rg']);
$query['crm'] = decrypt_data($query['crm']);
$query['cep'] = decrypt_data($query['cep']);
$query['street_address'] = decrypt_data($query['street_address']);
$query['locality'] = decrypt_data($query['locality']);
$query['number'] = decrypt_data($query['number']);
$query['complement'] = decrypt_data($query['complement']);
$return_array = array('status'=>'success','userdata'=>$query);
}
else{
$return_array = array('status'=>'fail');
......@@ -909,7 +1064,26 @@ class Webservice_model extends CI_Model {
$query = $this->db->get_where("tbl_doctors",array("tbl_doctors.id"=>$doctorid));
if($query->num_rows() > 0 && !is_null($query->row_array()['id'])){
$return_array = array('status'=>'success','data'=>$query->row_array());
$query = $query->row_array();
$this->db->select("CAST(AES_DECRYPT(`tbl_doctors`.`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob_new");
$this->db->where('id',$query['id']);
$querydate = $this->db->get('tbl_doctors')->row();
$query['dob'] = $query_date->dob_new;
$query['cep'] = decrypt_data($query['zip_code']);
$query['complement'] = decrypt_data($query['landmark']);
$query['about'] = decrypt_data($query['biodata']);
$query['gender'] = decrypt_data($query['gender']);
//$query['name'] = decrypt_data($query['name']);
$query['price'] = decrypt_data($query['price']);
$query['domiciliary_status'] = decrypt_data($query['domiciliary_status']);
$query['rg'] = decrypt_data($query['rg']);
$query['crm'] = decrypt_data($query['crm']);
$query['street_address'] = decrypt_data($query['street_address']);
$query['locality'] = decrypt_data($query['locality']);
$query['number'] = decrypt_data($query['number']);
$return_array = array('status'=>'success','data'=>$query);
}
else{
$return_array = array('status'=>'fail');
......@@ -1091,7 +1265,7 @@ class Webservice_model extends CI_Model {
}
}
//if(!$is_payment_required){
if($payment_status == '1'){
$this->db->insert('tbl_patient_notification',array('patient_id'=>$patientid['userid'],'type'=>'0','message'=>$msg,'time'=>$conslt_time,'booking_id'=>$insert_id,'read_status'=>'0'));
$patient_insert_id = $this->db->insert_id();
......@@ -1119,7 +1293,7 @@ class Webservice_model extends CI_Model {
$news['to'] = $fcm_doctor->fcm_token;
$doctor_type = '2';
$doctor_push = $this->push_sent($news,$doctor_type);
//}
}
$return_array = array('status'=>'success','data'=>array('booking_id'=>$insert_id,'is_waiting'=>false,'is_payment_required'=>$is_payment_required));
}
else{
......@@ -1134,7 +1308,7 @@ class Webservice_model extends CI_Model {
$msg = "Your booking for doctor ".$doctr_data['name']." at time ".$data['time']." is in Waiting list";
if($this->db->insert('tbl_booking',array('doctor_id'=>$data['doctor_id'],'clinic_id'=>$data['clinic_id'],'patient_id'=>$patientid['userid'],'ipok_fee'=>$ipokefees,'date'=>$data['date'],'time'=>$data['time'],'booking_status'=>'0','payment_status'=>$payment_status,'free_visit_status'=>$free_visit_status,'visit_type'=>$visit,'amount'=>$data['amount'],'promo_name'=>$promo_name,'promo_amount'=>$new_amnt,'payment_type'=>$data['payment_mode'],'total_sum'=>$diff,'time_start'=>$start_time,'time_end'=>$end_time,'requested_date'=>time()))){
$insert_id = $this->db->insert_id();
//if(!$is_payment_required){
if($payment_status == '1'){
$this->db->insert('tbl_patient_notification',array('patient_id'=>$patientid['userid'],'type'=>'1','message'=>$msg,'time'=>$conslt_time,'booking_id'=>$insert_id,'read_status'=>'0'));
$patient_insert_id = $this->db->insert_id();
......@@ -1151,7 +1325,7 @@ class Webservice_model extends CI_Model {
$new['to'] =$fcm_user->fcm_token;
$user_type = '3';
$user_push = $this->push_sent($new,$user_type);
//}
}
$return_array = array('status'=>'failed','data' =>array('booking_id'=>$insert_id,'is_waiting'=>true,'is_payment_required'=>$is_payment_required));
}
......@@ -1281,7 +1455,7 @@ class Webservice_model extends CI_Model {
}
if($data['others'] == 'DOMICILIARY ATTENDANCE'){
$where = 'tbl_doctors.domiciliary_status ='. 1;
$where = "CAST(AES_DECRYPT(tbl_doctors.domiciliary_status,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) =". 1;
$this->db->where($where);
}
}
......@@ -1303,6 +1477,10 @@ class Webservice_model extends CI_Model {
//print_r($this->db->last_query());die();
if ($query->num_rows() > 0) {
$querys = $query->result_array();
foreach ($querys as $key => $value) {
$querys[$key]['domiciliary_status'] = decrypt_data($value['domiciliary_status']);
$querys[$key]['price'] = decrypt_data($value['price']);
}
//echo "<pre>";print_r($querys);exit();
if(isset($data['date']) && strlen($data['date'])){
$day = date('D',$data['date']);
......@@ -1526,6 +1704,7 @@ class Webservice_model extends CI_Model {
$this->db->join('tbl_authtoken','tbl_authtoken.userid = tbl_booking.patient_id','INNER');
$this->db->join('tbl_doctors','tbl_doctors.id = tbl_booking.doctor_id','INNER');
$this->db->where('tbl_authtoken.authtoken',$authtoken);
$this->db->where('tbl_booking.payment_status','1');
$query = $this->db->get();
if($query->num_rows() > 0){
$result = array('status'=>'success','data'=>$query->result_array());
......@@ -1543,10 +1722,43 @@ class Webservice_model extends CI_Model {
//........................ Register Doctor
function register_doctor($data){
//$data['name'] = encrypt_data($data['name']);
$data['about'] = encrypt_data($data['about']);
$data['price'] = encrypt_data($data['price']);
$data['gender'] = encrypt_data($data['gender']);
$data['domiciliary_status'] = encrypt_data($data['domiciliary_status']);
$data['rg'] = encrypt_data($data['rg']);
$data['crm'] = encrypt_data($data['crm']);
$data['cep'] = encrypt_data($data['cep']);
$data['street_address'] = encrypt_data($data['street_address']);
$data['locality'] = encrypt_data($data['locality']);
$data['number'] = encrypt_data($data['number']);
$data['complement'] = encrypt_data($data['complement']);
if($this->db->insert('tbl_doctors', $data)){
$insertid = $this->db->insert_id();
$this->db->query("update tbl_doctors set dob = AES_ENCRYPT(".$data['dob'].",'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA')where id = ".$insertid);
$this->db->select("CAST(AES_DECRYPT(`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob");
$this->db->where('id',$insertid);
$query_date = $this->db->get('tbl_doctors')->row();
$query = $query->row_array();
unset($query['dob']);
$query['dob'] = $query_date->dob;
//$query['name'] = decrypt_data($query['name']);
$query['about'] = decrypt_data($query['about']);
$query['price'] = decrypt_data($query['price']);
$query['gender'] = decrypt_data($query['gender']);
$query['domiciliary_status'] = decrypt_data($query['domiciliary_status']);
$query['rg'] = decrypt_data($query['rg']);
$query['crm'] = decrypt_data($query['crm']);
$query['cep'] = decrypt_data($query['cep']);
$query['street_address'] = decrypt_data($query['street_address']);
$query['locality'] = decrypt_data($query['locality']);
$query['number'] = decrypt_data($query['number']);
$query['complement'] = decrypt_data($query['complement']);
$query = $this->db->get_where("tbl_doctors",array("id"=>$insertid));
$return_array = array('status'=>'success','userdata'=>$query->row_array());
$return_array = array('status'=>'success','userdata'=>$query);
}
else{
$return_array = array('status'=>'fail');
......@@ -1690,11 +1902,12 @@ class Webservice_model extends CI_Model {
}
function notification($id,$start,$per_page){
$this->db->select('tbl_patient_notification.id,tbl_patient_notification.booking_id,tbl_patient_notification.type,tbl_patient_notification.message,tbl_patient_notification.time,tbl_doctors.id as doctor_id,tbl_patient_notification.booking_id,tbl_booking.date,tbl_doctors.profile_pic as doctor_photo,tbl_doctors.name as doctor_name,tbl_specialization.specialization_name as doctor_specialization');
$this->db->select('tbl_patient_notification.id,tbl_patient_notification.booking_id,tbl_patient_notification.type,tbl_patient_notification.message,tbl_patient_notification.time,tbl_doctors.id as doctor_id,tbl_patient_notification.booking_id,tbl_booking.date,tbl_doctors.profile_pic as doctor_photo,tbl_doctors.name as doctor_name,tbl_specialization.specialization_name as doctor_specialization,tbl_patient_notification.read_status');
$this->db->join('tbl_booking','tbl_booking.id = tbl_patient_notification.booking_id');
$this->db->join('tbl_doctors','tbl_doctors.id = tbl_booking.doctor_id');
$this->db->join('tbl_specialization','tbl_specialization.id = tbl_doctors.specialization');
$this->db->limit($per_page,$start);
$this->db->order_by('tbl_patient_notification.id','DESC');
$query = $this->db->get_where('tbl_patient_notification',array('tbl_patient_notification.patient_id'=>$id))->result();
if(count($query) > 0){
return $query;
......@@ -1805,7 +2018,15 @@ class Webservice_model extends CI_Model {
$this->db->where("tbl_booking.id",$id);
//$this->db->where("tbl_booking.date >= '".$date."'");
$result = $this->db->get()->row();
//print_r($result);exit();
foreach ($result as $key => $value) {
$result[$key]->street_address = decrypt_data($value->street_address);
$result[$key]->locality = decrypt_data($value->locality);
$result[$key]->number = decrypt_data($value->number);
$result[$key]->complement = decrypt_data($value->complement);
$result[$key]->consultation_fee = decrypt_data($value->consultation_fee);
}
$this->db->where('doctor_id',$result->doctor_id);
$this->db->where('clinic_id',$result->clinic_id);
$clinic_details = $this->db->get('tbl_consultation')->row();
......@@ -2041,6 +2262,7 @@ class Webservice_model extends CI_Model {
$this->db->where('tbl_doctors.id',$value);
$res = $this->db->get()->result();
foreach ($res as $key => $values) {
$res[$key]->fee = decrypt_data($values->fee);
$new_array[] = $values;
}
$result = array("status"=>"success","data"=>$new_array);
......@@ -2275,6 +2497,7 @@ class Webservice_model extends CI_Model {
$result = $this->db->get('tbl_booking')->row_array();
//echo"<pre>";print_r($result);echo"</pre>";
if($result){
$result['consultation_fee'] = decrypt_data($result['consultation_fee']);
$fee = $this->db->get('settings')->row();
$result['review'] = decrypt_data($result['patient_review']);
unset($result['patient_review']);
......@@ -2283,13 +2506,13 @@ class Webservice_model extends CI_Model {
//$result['tax'] = $actual; //Get in integer type since actual is in integer format
$result['tax'] = (string)$actual;// Get in string type
$result['anamnese'] = $result['main_complaint'];
$result['anamnese'] = decrypt_data($result['main_complaint']);
unset($result['main_complaint']);
$result['anamnese_content'] = $result['description'];
$result['anamnese_content'] = decrypt_data($result['description']);
unset($result['description']);
$let = json_decode($result['letters']);
$let = json_decode(decrypt_data($result['letters']));
if($let == ''){
$result['Letter_and_certificates'] = '';
}else{
......@@ -2297,13 +2520,13 @@ class Webservice_model extends CI_Model {
unset($result['letters']);
}
if($result['other_observations']){
$result['other_observation'] = $result['other_observations'];
$result['other_observation'] = decrypt_data($result['other_observations']);
unset($result['other_observations']);
}else{
$result['other_observation'] = '';
}
$ill = json_decode($result['diseases']);
$ill = json_decode(decrypt_data($result['diseases']));
if($ill == ''){
$new = [];
}else{
......@@ -2332,7 +2555,7 @@ class Webservice_model extends CI_Model {
}
unset($result['diseases']);
$med = array();
$prescrb = json_decode($result['prescribtions']);
$prescrb = json_decode(decrypt_data($result['prescribtions']));
if($prescrb == ''){
$med = [];
}else{
......@@ -2346,7 +2569,7 @@ class Webservice_model extends CI_Model {
unset($result['prescribtions']);
$examss = array();
$exam = json_decode($result['exams']);
$exam = json_decode(decrypt_data($result['exams']));
if($exam == ''){
$examss = [];
......@@ -2359,7 +2582,7 @@ class Webservice_model extends CI_Model {
}
unset($result['exams']);
$bud = array();
$budget = json_decode($result['budget']);
$budget = json_decode(decrypt_data($result['budget']));
if($budget == ''){
$budget = [];
}else{
......@@ -2474,7 +2697,7 @@ class Webservice_model extends CI_Model {
}
//echo "<pre>";print_r($data);exit();
if($doc_query->num_rows() > 0){
$this->db->update('tbl_doctors',array('consultation_duration'=>$data['consultation_duration'],'price'=>$data['consultation_fee'],' domiciliary_status'=>$data['home_consultation_available'],'accept_return'=>$data['return_consultation_available'],'return_timeperiod'=>$data['timeperiod']),array('id'=>$doctor_id));
$this->db->update('tbl_doctors',array('consultation_duration'=>$data['consultation_duration'],'price'=>encrypt_data($data['consultation_fee']),' domiciliary_status'=>encrypt_data($data['home_consultation_available']),'accept_return'=>$data['return_consultation_available'],'return_timeperiod'=>$data['timeperiod']),array('id'=>$doctor_id));
$res = $this->db->get_where("tbl_doctors",array("id"=>$doctor_id))->row_array();
if($res['accept_return'] == '1'){
$res['accept_return'] = true;
......@@ -2482,12 +2705,12 @@ class Webservice_model extends CI_Model {
$res['accept_return'] = false;
}
if($res['domiciliary_status'] == '1'){
if(decrypt_data($res['domiciliary_status']) == '1'){
$res['domiciliary_status'] = true;
}else{
$res['domiciliary_status'] = false;
}
$return_array = array('status'=>'success','data'=>array('doctor_id'=>$doctor_id,'is_return_consultation_available'=>$res['accept_return'],'is_home_consultation_available'=>$res['domiciliary_status'],'consultation_price'=>$res['price'],'consultation_duration'=>$res['consultation_duration'],'return_consultation_time_period'=>$res['return_timeperiod']));
$return_array = array('status'=>'success','data'=>array('doctor_id'=>$doctor_id,'is_return_consultation_available'=>$res['accept_return'],'is_home_consultation_available'=>$res['domiciliary_status'],'consultation_price'=>decrypt_data($res['price']),'consultation_duration'=>$res['consultation_duration'],'return_consultation_time_period'=>$res['return_timeperiod']));
}else{
$return_array = array('status'=>'failed','message'=>'Doctor Id Doesnot Exist');
......@@ -2552,7 +2775,7 @@ class Webservice_model extends CI_Model {
$vacation[$key]['end_time'] = $value->end_date;
}
//echo"<pre>";print_r($vacation);echo"</pre>";exit();
if($doc_res->domiciliary_status == '1'){
if(decrypt_data($doc_res->domiciliary_status) == '1'){
$home_status = true;
}else{
$home_status = false;
......@@ -2564,7 +2787,7 @@ class Webservice_model extends CI_Model {
$accept_status = false;
}
$data = array('clinic_id'=>$clinic_id,'consultation_duration'=>$doc_res->consultation_duration,'consultation_price'=>$doc_res->price,'is_home_consultation_available'=>$home_status,'is_return_consultation_available'=>$accept_status,'return_consultation_time_period'=>$doc_res->return_timeperiod,'activated_schedule'=>$query->active_schedule,'primary_schedule'=>$primary,'secondary_schedule'=>$secondary,'vacations'=>$vacation);
$data = array('clinic_id'=>$clinic_id,'consultation_duration'=>$doc_res->consultation_duration,'consultation_price'=>decrypt_data($doc_res->price),'is_home_consultation_available'=>$home_status,'is_return_consultation_available'=>$accept_status,'return_consultation_time_period'=>$doc_res->return_timeperiod,'activated_schedule'=>$query->active_schedule,'primary_schedule'=>$primary,'secondary_schedule'=>$secondary,'vacations'=>$vacation);
$return_array = array('status'=>'success','data'=>$data);
}else{
$return_array = array('status'=>'failed','message'=>'No consultation for this doctor in this clinic');
......@@ -2703,7 +2926,7 @@ class Webservice_model extends CI_Model {
//echo"<pre>";print_r($new_query);exit();
if(count($new_query) > 0){
foreach ($new_query as $key => $value) {
$location = $value->street_address.','.$value->locality.','.$value->number.','.$value->complement;
$location = decrypt_data($value->street_address).','.decrypt_data($value->locality).','.decrypt_data($value->number).','.decrypt_data($value->complement);
$new[$key]['id'] = $value->id;
$new[$key]['name'] = $value->name;
$new[$key]['email'] = $value->email;
......@@ -2854,7 +3077,7 @@ class Webservice_model extends CI_Model {
//echo $this->db->last_query();exit();
if(count($reslt) > 0){
foreach ($reslt as $key => $value) {
$reslt[$key]->name = decrypt_data($value->name);
$reslt[$key]->patient_name = decrypt_data($value->patient_name);
}
return $reslt;
}else{
......@@ -2870,6 +3093,7 @@ class Webservice_model extends CI_Model {
$this->db->join('tbl_doctors','tbl_booking.doctor_id = tbl_doctors.id');
$this->db->where('tbl_registration.id',$data['patient_id']);
$result = $this->db->get()->row();
$result->price = decrypt_data($result->price);
$settings = $this->db->get('settings')->row();
......@@ -3051,19 +3275,19 @@ class Webservice_model extends CI_Model {
$doctr_data = $this->db->get_where('tbl_doctors',array('id'=>$id))->row_array();
$special = $this->db->get_where('tbl_specialization',array('id'=>$doctr_data['specialization']))->row();
$conslt_time = strtotime(date('Y-m-d h:i:s'));
$msg = "Sorry, Your booking at time ".$data['time']." is cancelled by ".$doctr_data['name'];
$msg = "Sorry, Your booking at time ".$query->time." is cancelled by ".$doctr_data['name'];
if($query){
if($query->doctor_id == $id){
$this->db->update('tbl_booking',array('booking_status'=>'4'),array('id'=>$data['booking_id']));
$this->db->insert('tbl_patient_notification',array('patient_id'=>$query->patient_id,'type'=>'3','message'=>$msg,'time'=>$conslt_time,'booking_id'=>$data['booking_id'],'read_status'=>'0'));
$patient_insert_id = $this->db->insert_id();
$fcm_user = $this->db->get_where('tbl_authtoken',array('userid'=>$query['patient_id']))->row();
$fcm_user = $this->db->get_where('tbl_authtoken',array('userid'=>$query->patient_id))->row();
$new['id'] = $patient_insert_id;
$new['type'] = "Cancel Consultation";
$new['booking_id'] = $query['id'];
$new['booking_date'] = $query['date'];
$new['doctor_id'] = $query['doctor_id'];
$new['booking_id'] = $query->id;
$new['booking_date'] = $query->date;
$new['doctor_id'] = $query->doctor_id;
$new['doctor_name'] = $doctr_data['name'];
$new['doctor_specialization'] = $special->specialization_name;
$new['message'] = $msg;
......@@ -3072,7 +3296,7 @@ class Webservice_model extends CI_Model {
$user_type = '1';
$push = $this->push_sent($new,$user_type);
if($res->visit_type == '0'){
if($query->visit_type == '0'){
$doctor_wallet = $this->db->get_where('tbl_wallet_details',array('doctor_id'=>$id))->row();
$earn = $query->total_sum - (($query->total_sum * $query->ipok_fee)/100);
......@@ -3097,6 +3321,8 @@ class Webservice_model extends CI_Model {
$this->db->select('consultation_duration,price as consultation_price,domiciliary_status,accept_return,return_timeperiod as return_consultation_time_period');
$query = $this->db->get_where('tbl_doctors',array('id'=>$doctor_id))->row();
if($query){
$query->consultation_price = decrypt_data($query->consultation_price);
$query->domiciliary_status = decrypt_data($query->domiciliary_status);
if($query->accept_return == '0'){
$query->is_return_consultation_available = false;
}else{
......@@ -3571,8 +3797,7 @@ class Webservice_model extends CI_Model {
public function get_consultation_transaction_list($doctorid,$start,$per_page,$type){
$this->db->select("tbl_booking.id,tbl_booking.patient_id,tbl_registration.name as patient_name,tbl_doctors.consultation_duration as duration,(tbl_booking.total_sum - ((tbl_booking.total_sum * tbl_booking.ipok_fee) / 100)) as earnings,CASE
WHEN tbl_doctors.domiciliary_status = '0' THEN 0
ELSE 0 END as type,tbl_booking.date");
WHEN tbl_doctors.domiciliary_status as type,tbl_booking.date");
$this->db->from('tbl_booking');
$this->db->join('tbl_registration','tbl_registration.id = tbl_booking.patient_id');
$this->db->join('tbl_doctors','tbl_doctors.id = tbl_booking.doctor_id');
......@@ -3586,7 +3811,12 @@ class Webservice_model extends CI_Model {
$query = $this->db->get()->result();
if(count($query) > 0 ){
foreach ($query as $key => $value) {
$query[$key]->name = decrypt_data($value->name);
$query[$key]->patient_name = decrypt_data($value->patient_name);
if(decrypt_data($value->type) == '0'){
$query[$key]->type = '0';
}else{
$query[$key]->type = '0';
}
}
$result = array('status'=>'success','data'=>$query);
}else{
......@@ -3700,10 +3930,17 @@ class Webservice_model extends CI_Model {
}
public function doctor_profile($id){
$this->db->select('tbl_doctors.id,tbl_doctors.name,tbl_specialization.specialization_name as specialization,tbl_doctors.profile_pic as profile_photo,CONCAT_WS(" ", tbl_doctors.street_address, tbl_doctors.locality,tbl_doctors.number,tbl_doctors.complement) as address,tbl_doctors.telephone');
//$this->db->select('tbl_doctors.id,tbl_doctors.name,tbl_specialization.specialization_name as specialization,tbl_doctors.profile_pic as profile_photo,CONCAT_WS(" ", tbl_doctors.street_address, tbl_doctors.locality,tbl_doctors.number,tbl_doctors.complement) as address,tbl_doctors.telephone');
$this->db->select('tbl_doctors.id,tbl_doctors.name,tbl_specialization.specialization_name as specialization,tbl_doctors.profile_pic as profile_photo, tbl_doctors.street_address, tbl_doctors.locality,tbl_doctors.number,tbl_doctors.complement,tbl_doctors.telephone');
$this->db->join('tbl_specialization','tbl_specialization.id = tbl_doctors.specialization');
$res = $this->db->get_where('tbl_doctors',array('tbl_doctors.id'=>$id))->row();
if($res){
$res->address = decrypt_data($res->street_address).' '.decrypt_data($res->locality).' '.decrypt_data($res->number).' '.decrypt_data($res->complement);
unset($res->street_address);
unset($res->locality);
unset($res->number);
unset($res->complement);
$new[0] = $res->telephone;
$res->phone =$new;
unset($res->telephone);
......@@ -3817,7 +4054,7 @@ class Webservice_model extends CI_Model {
$data['pt_name'] = decrypt_data($data['pt_name']);
$data['pt_gender'] = decrypt_data($data['pt_gender']);
$data['pt_number'] = decrypt_data($data['pt_number']);
$data['blood_group'] = decrypt_data($data['blood_group']);
$data['pt_blood_group'] = decrypt_data($data['pt_blood_group']);
$data['pt_weight'] = decrypt_data($data['pt_weight']);
$data['pt_height'] = decrypt_data($data['pt_height']);
$data['pt_street_add'] = decrypt_data($data['pt_street_add']);
......@@ -3833,13 +4070,23 @@ class Webservice_model extends CI_Model {
public function get_single_doctor($id)
{
$this->db->select("tbl_doctors.id as doctorid,tbl_doctors.name as dr_name,tbl_doctors.profile_pic as dr_pic,tbl_doctors.email as dr_email,tbl_doctors.username as dr_username,tbl_doctors.dob as dr_dob,tbl_doctors.about as dr_bio,tbl_doctors.specialization as dr_specialization_id,tbl_doctors.price as dr_price,tbl_doctors.consultation_duration as dr_consult_duration,tbl_doctors.accept_return as dr_accept_return,tbl_doctors.return_timeperiod as dr_return_timeperiod,tbl_doctors.gender as dr_gender,tbl_doctors.locality as dr_neighbourhood,tbl_doctors.street_address as dr_rua,tbl_doctors.number as dr_number,tbl_doctors.telephone as dr_telephone,tbl_doctors.complement as dr_complement,tbl_doctors.rg as dr_rg,tbl_doctors.cpf as dr_cpf,tbl_doctors.crm as dr_crm,tbl_doctors.cep as dr_cep,tbl_specialization.specialization_name AS dr_specialization");
$this->db->select("tbl_doctors.id as doctorid,tbl_doctors.name as dr_name,tbl_doctors.profile_pic as dr_pic,tbl_doctors.email as dr_email,tbl_doctors.username as dr_username,CAST(AES_DECRYPT(tbl_doctors.dob,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dr_dob,tbl_doctors.about as dr_bio,tbl_doctors.specialization as dr_specialization_id,tbl_doctors.price as dr_price,tbl_doctors.consultation_duration as dr_consult_duration,tbl_doctors.accept_return as dr_accept_return,tbl_doctors.return_timeperiod as dr_return_timeperiod,tbl_doctors.gender as dr_gender,tbl_doctors.locality as dr_neighbourhood,tbl_doctors.street_address as dr_rua,tbl_doctors.number as dr_number,tbl_doctors.telephone as dr_telephone,tbl_doctors.complement as dr_complement,tbl_doctors.rg as dr_rg,tbl_doctors.cpf as dr_cpf,tbl_doctors.crm as dr_crm,tbl_doctors.cep as dr_cep,tbl_specialization.specialization_name AS dr_specialization");
$this->db->from('tbl_doctors');
$this->db->join('tbl_specialization', 'tbl_specialization.id = tbl_doctors.specialization','left');
$this->db->where('tbl_doctors.id',$id);
$data =$this->db->get()->row_array();
$data =$this->db->get()->row_array();
$data['dr_bio'] = decrypt_data($data['dr_bio']);
$data['dr_price'] = decrypt_data($data['dr_price']);
$data['dr_gender'] = decrypt_data($data['dr_gender']);
$data['dr_neighbourhood'] = decrypt_data($data['dr_neighbourhood']);
$data['dr_rua'] = decrypt_data($data['dr_rua']);
$data['dr_number'] = decrypt_data($data['dr_number']);
$data['dr_complement'] = decrypt_data($data['dr_complement']);
$data['dr_rg'] = decrypt_data($data['dr_rg']);
$data['dr_crm'] = decrypt_data($data['dr_crm']);
$data['dr_cep'] = decrypt_data($data['dr_cep']);
return $data;
}
......@@ -3848,8 +4095,21 @@ class Webservice_model extends CI_Model {
$this->db->select("*");
$this->db->from("tbl_doctors");
$this->db->where("tbl_doctors.id",$id);
$query = $this->db->get();
return $query->row_array();
$query = $this->db->get()->row_array();
$query['about'] = decrypt_data($query['about']);
$query['price'] = decrypt_data($query['price']);
$query['gender'] = decrypt_data($query['gender']);
$query['street_address'] = decrypt_data($query['street_address']);
$query['locality'] = decrypt_data($query['locality']);
$query['number'] = decrypt_data($query['number']);
$query['complement'] = decrypt_data($query['complement']);
$query['rg'] = decrypt_data($query['rg']);
$query['crm'] = decrypt_data($query['crm']);
$query['cep'] = decrypt_data($query['cep']);
$query['domiciliary_status'] = decrypt_data($query['domiciliary_status']);
return $query;
}
public function get_wallet_for_doctor($doc_id)
......@@ -3859,13 +4119,17 @@ class Webservice_model extends CI_Model {
total_earn as total_earn');
$this->db->from('tbl_wallet_details');
$this->db->where('doctor_id',$doc_id);
$query = $this->db->get();
return $query->row_array();
$query = $this->db->get()->row_array();
$query['reedem_earn'] = decrypt_data($query['reedem_earn']);
$query['future_earn'] = decrypt_data($query['future_earn']);
$query['total_earn'] = decrypt_data($query['total_earn']);
return $query;
}
public function update_wallet($id,$data)
{
$sql = $this->db->insert_string('tbl_wallet_details', array("doctor_id"=>$id,"reedem_earn"=>encrypt_data($data['reedem_earn']),"future_earn"=>encrypt_data($data['future_earn']),"total_earn"=>encrypt_data($data['total_earn']))) . ' ON DUPLICATE KEY UPDATE doctor_id = ' .$id.',reedem_earn ='.'"' .encrypt_data($data['reedem_earn']).'"'.',future_earn='.encrypt_data($data['future_earn']).',total_earn='.encrypt_data($data['total_earn']);
$sql = $this->db->insert_string("tbl_wallet_details", array("doctor_id"=>$id,"reedem_earn"=>encrypt_data($data['reedem_earn']),"future_earn"=>encrypt_data($data['future_earn']),"total_earn"=>encrypt_data($data['total_earn']))) . " ON DUPLICATE KEY UPDATE doctor_id = " .$id.',reedem_earn ='.'"' .encrypt_data($data['reedem_earn']).'"'.',future_earn='.'"' .encrypt_data($data['future_earn']).'"' .',total_earn='. '"' .encrypt_data($data['total_earn']).'"';
if($this->db->query($sql)){
$return_array = array('status'=>'success');
}
......
......@@ -92,8 +92,8 @@
?>
<tr>
<td class="hidden"><?php echo $exams['id'];?></td>
<td><?php echo decrypt_data($exams['exam_procedure']);?></td>
<td><i><?php echo decrypt_data($exams['observation']);?></i></td>
<td><?php echo $exams['exam_procedure'];?></td>
<td><i><?php echo $exams['observation'];?></i></td>
<td>
<a class='btn btn-sm btn-primary' href='<?php echo base_url(); ?>ManageExams/exams_edit/<?php echo $exams['id']; ?>'> <i class='fa fa-fw fa-edit'></i> Edit </a>
<a class='btn btn-sm btn-danger' href='<?php echo base_url(); ?>ManageExams/exams_delete/<?php echo $exams['id']; ?>'> <i class='fa fa-fw fa-trash'></i> Delete </a>
......
......@@ -44,11 +44,11 @@ if(isset($data)) {
<div class="form-group">
<label>Exam or Procedure</label>
<input type="text" name="exam_procedure" value="<?php echo decrypt_data($data['exam_procedure']);?>" class="form-control required" placeholder="Enter Exams or Procedure" data-parsely-minlength="10" data-parsley-required="true">
<input type="text" name="exam_procedure" value="<?php echo $data['exam_procedure'];?>" class="form-control required" placeholder="Enter Exams or Procedure" data-parsely-minlength="10" data-parsley-required="true">
</div>
<div class="form-group">
<label>Observation</label>
<input type="text" name="observation" value="<?php echo decrypt_data($data['observation']);?>" class="form-control required" placeholder="Enter Observation" data-parsley-required="true">
<input type="text" name="observation" value="<?php echo $data['observation'];?>" class="form-control required" placeholder="Enter Observation" data-parsley-required="true">
</div>
</div><!-- /.box-body -->
......
......@@ -776,7 +776,7 @@ public function service()
//print_r($major_problems);die();
$medicines = $this->Doctor_model->get_distinct_medicines(); //for use of medicines
$exams = $this->Doctor_model->get_distinct_exams(); //for use of medicines
$exams = $this->Doctor_model->get_distinct_exams(); //for use of medicines
$procedure = $this->Doctor_model->get_distinct_procedure(); //for use of medicines
$cidnumbers = $this->Doctor_model->get_distinct_cid(); //for use of medicines
$certificate_letter = $this->Doctor_model->get_certificate_letters(); //for use of medicines
......@@ -846,12 +846,11 @@ public function recordsummary()
$doctor_data = $this->Doctor_model->get_single_doctor($booking_details['doc_id']);
$patient_data = $this->Patient_model->get_single_patient($booking_details['pat_id']);
$record_data['diseases'] = json_decode($record_data['diseases']);
$record_data['prescribtions'] = json_decode($record_data['prescribtions']);
$record_data['exams'] = json_decode($record_data['exams']);
$record_data['budget'] = json_decode($record_data['budget']);
$record_data['letters'] = json_decode($record_data['letters']);
$record_data['diseases'] = json_decode($this->encrypt->decode($record_data['diseases']));
$record_data['prescribtions'] = json_decode($this->encrypt->decode($record_data['prescribtions']));
$record_data['exams'] = json_decode($this->encrypt->decode($record_data['exams']));
$record_data['budget'] = json_decode($this->encrypt->decode($record_data['budget']));
$record_data['letters'] = json_decode($this->encrypt->decode($record_data['letters']));
//print_r($record_data);die();
......@@ -921,15 +920,15 @@ public function save_medicalrecord_data()
{
$disease['anamnese'] = $anamnese;
$myJSON = json_encode($disease);
$insert_array['diseases'] = $myJSON;
$insert_array['diseases'] = $this->encrypt->encode($myJSON);
}
if(!empty($_POST['description']) and (isset($_POST['description'])))
{
$insert_array['description'] = $_POST['description'];
$insert_array['description'] = $this->encrypt->encode($_POST['description']);
}
$insert_array['main_complaint'] = $_POST['main_complaint'];
$insert_array['main_complaint'] = $this->encrypt->encode($_POST['main_complaint']);
$update = $this->Doctor_model->update_records($_POST['booking_id'],$insert_array);
if($update)
......@@ -953,7 +952,7 @@ public function save_medicalrecord_data()
}
$myJSON = json_encode($medicine); //json encoding for db entry
$insert_array['prescribtions'] = $myJSON;
$insert_array['prescribtions'] = $this->encrypt->encode($myJSON);
$update = $this->Doctor_model->update_records($_POST['booking_id'],$insert_array);
if($update)
......@@ -977,7 +976,7 @@ public function save_medicalrecord_data()
$new[] = $exam;
//print_r(json_encode($new));exit();
$myJSON = json_encode($new); //json encoding for db entry
$insert_array['exams'] = $myJSON;
$insert_array['exams'] = $this->encrypt->encode($myJSON);
$update = $this->Doctor_model->update_records($_POST['booking_id'],$insert_array);
if($update)
......@@ -1001,7 +1000,7 @@ public function save_medicalrecord_data()
$myJSON = json_encode($budget); //json encoding for db entry
$insert_array['budget'] = $myJSON;
$insert_array['budget'] = $this->encrypt->encode($myJSON);
$update = $this->Doctor_model->update_records($_POST['booking_id'],$insert_array);
if($update)
......@@ -1031,7 +1030,7 @@ public function save_medicalrecord_data()
$letter_json = json_encode($postdata);
//print_r($letter_json);die();
$insert_array['letters'] = $letter_json;
$insert_array['letters'] = $this->encrypt->encode($letter_json);
$update = $this->Doctor_model->update_records($_POST['booking_id'],$insert_array);
if($update)
......@@ -1070,7 +1069,7 @@ public function save_medicalrecord_data()
$booking_details = $this->Search_doctor_model->get_booking_details($_POST['booking_id']);
$patient_data = $this->Patient_model->get_single_patient($booking_details['patient_id']);
$text = 'The patient '.$patient_data['pt_name'].' evaluated his consultation on '.date('d.m.Y',$booking_details['time_start']);
$text = 'The patient '.$this->encrypt->encode($patient_data['pt_name']).' evaluated his consultation on '.date('d.m.Y',$booking_details['time_start']);
$notification = array('doctor_id' => $booking_details['doctor_id'],'type'=>1,'message'=>$text,'read_status'=>0,'time'=>strtotime($nowin_server) );
$doctor_insert_id = $this->Home_model->insert_notification_doctor($notification);
......@@ -1204,6 +1203,7 @@ public function get_exam_details()
{
$name = $_POST['exam_name'];
$exam = $this->Doctor_model->get_exam_for_name($name);
//echo $this->db->last_query();
print json_encode($exam);
}
......@@ -1224,7 +1224,7 @@ public function editProfile()
$template['page'] = "doctor_editprofile";
$template['page_title'] = "Edit Profile";
$template['data'] = "Doctor page";
$doctor_data = $this->Doctor_model->get_single_doctor($userdata['id']);
$doctor_data = $this->Doctor_model->get_single_doctor($userdata['id']);
$speciality_list = $this->Home_model->get_speciality();
$template['speciality_list'] = $speciality_list;
$template['doctor_data'] = $doctor_data;
......@@ -1258,7 +1258,9 @@ public function check_username_edit()
public function saveProfile()
{
$userdata = $this->session->userdata('UserData');
$_POST['dob'] = strtotime($_POST['dob']);
if(isset($_POST) and !empty($_POST))
{
$update_data = $_POST;
......@@ -1290,11 +1292,30 @@ public function saveProfile()
unset($update_data['profile_pic']);
}
//print_r($update_data);die();
/*encryption*/
$update_data['name'] = $this->encrypt->encode($update_data['name']);
$update_data['rg'] = $this->encrypt->encode($update_data['rg']);
$update_data['cpf'] = $this->encrypt->encode($update_data['cpf']);
$update_data['telephone'] = $this->encrypt->encode($update_data['telephone']);
$update_data['gender'] = $this->encrypt->encode($update_data['gender']);
$update_data['cep'] = $this->encrypt->encode($update_data['cep']);
$update_data['street_address'] = $this->encrypt->encode($update_data['street_address']);
$update_data['locality'] = $this->encrypt->encode($update_data['locality']);
$update_data['number'] = $this->encrypt->encode($update_data['number']);
$update_data['complement'] = $this->encrypt->encode($update_data['complement']);
$update_data['about'] = $this->encrypt->encode($update_data['about']);
$update_data['crm'] = $this->encrypt->encode($update_data['crm']);
/*encryption*/
$update = $this->Doctor_model->update_profile($userdata['id'],$update_data);
if($update['status']=='success')
{
$doctor_data = $this->Doctor_model->get_single_doctor_row($userdata['id']);
//print_r($patient_data);
//print_r($doctor_data);
$new_userdata = array(
"type"=>"DOCTOR",
......
......@@ -269,7 +269,7 @@ class Home extends CI_Controller {
parse_str($_REQUEST['data'], $output);
$reg_data = array('email' => $output['reg_pat_email'],'name' => encrypt_data($output['reg_pat_name']),'username' => $output['reg_pat_username'],'password' => md5($output['reg_pat_password']),'cpf' => $output['reg_pat_cpf'],'rg' => encrypt_data($output['reg_pat_rg']),'dob' =>strtotime($output['reg_pat_dob']),'gender' =>encrypt_data($output['reg_pat_gender']),'weight' => encrypt_data($output['reg_pat_weight']),'height' => encrypt_data($output['reg_pat_height']),'blood_group' => encrypt_data($output['reg_pat_bloodgrp']),'zip_code' => encrypt_data($output['reg_pat_cep']),'street_address' => encrypt_data($output['reg_pat_streetadd']),'locality' => encrypt_data($output['reg_pat_locality']),'number' => encrypt_data($output['reg_pat_number']),'landmark' => encrypt_data($output['reg_pat_complement']),'occupation' => $output['reg_pat_occupation'] );
$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();
......@@ -534,7 +534,6 @@ class Home extends CI_Controller {
public function login()
{
//parse_str($_REQUEST['LoginData'], $request);
//print_r($_POST);die();
......@@ -572,7 +571,7 @@ class Home extends CI_Controller {
"id"=> $result['userdata']['id'],
"name"=> decrypt_data($result['userdata']['name']),
"name"=> $result['userdata']['name'],
"username"=> $result['userdata']['username'],
......@@ -582,27 +581,27 @@ class Home extends CI_Controller {
"cpf" => $result['userdata']['cpf'],
"rg" => decrypt_data($result['userdata']['rg']),
"rg" => $result['userdata']['rg'],
"dob" => $result['userdata']['dob'],
"gender" => decrypt_data($result['userdata']['gender']),
"gender" => $result['userdata']['gender'],
"weight" => decrypt_data($result['userdata']['weight']) ,
"weight" => $result['userdata']['weight'] ,
"height" => decrypt_data($result['userdata']['height']),
"height" => $result['userdata']['height'],
"blood_group" => decrypt_data($result['userdata']['blood_group']),
"blood_group" => $result['userdata']['blood_group'],
"zip_code" => decrypt_data($result['userdata']['zip_code']),
"zip_code" => $result['userdata']['zip_code'],
"street_address" => decrypt_data($result['userdata']['street_address']),
"street_address" => $result['userdata']['street_address'],
"locality" => decrypt_data($result['userdata']['locality']),
"locality" => $result['userdata']['locality'],
"number" => decrypt_data($result['userdata']['number']),
"number" => $result['userdata']['number'],
"landmark" =>decrypt_data($result['userdata']['landmark']),
"landmark" =>$result['userdata']['landmark'],
"profile_photo" => $result['userdata']['profile_photo']
......@@ -960,16 +959,40 @@ class Home extends CI_Controller {
$data = $_POST;
//print_r($data);exit();
/*encryption*/
//$data['name'] = $this->encrypt->encode($data['name']);
$data['rg'] = $this->encrypt->encode($data['rg']);
//$data['cpf'] = $this->encrypt->encode($data['cpf']);
$data['telephone'] = $this->encrypt->encode($data['telephone']);
$data['gender'] = $this->encrypt->encode($data['gender']);
$data['cep'] = $this->encrypt->encode($data['cep']);
$data['street_address'] = $this->encrypt->encode($data['street_address']);
$data['locality'] = $this->encrypt->encode($data['locality']);
$data['number'] = $this->encrypt->encode($data['number']);
$data['complement'] = $this->encrypt->encode($data['complement']);
$data['about'] = $this->encrypt->encode($data['about']);
$data['crm'] = $this->encrypt->encode($data['crm']);
$newdob = $data['year'].'-'.$data['month'].'-'.$data['day'];
$data['dob'] = strtotime($newdob);
/*encryption*/
$data['password'] = md5($data['password']);
$data['dob'] = strtotime($newdob);
//print_r($data);
$data['password'] = md5($data['password']);
unset($data['day']);
unset($data['month']);
unset($data['year']);
//$this->Doctor_model->assignDoctors_default($this->session->userdata('UserData')['id'],'');
$result = $this->Home_model->register_doctor($data);
//print_r($result);
......@@ -1157,7 +1180,7 @@ class Home extends CI_Controller {
}
$msg = "Hi ".decrypt_data($check_authentic['name']).",<br><br>Your request for resetting password has been accepted. Use the following link to reset password. ".$link.". Please Do not share with anyone<br><br>Ipok Team";
$msg = "Hi ".$check_authentic['name'].",<br><br>Your request for resetting password has been accepted. Use the following link to reset password. ".$link.". Please Do not share with anyone<br><br>Ipok Team";
//print_r($msg);
......@@ -1376,6 +1399,23 @@ class Home extends CI_Controller {
$userdata = $this->session->userdata('UserData');
$recent = $this->Home_model->get_recent_chat($userdata['id'],$userdata['type']);
if($userdata['type'] == 'DOCTOR' || $userdata['type'] =="COLLABORATOR")
{
for($i=0;$i<count($recent);$i++){
$recent[$i]['pat_name'] = $this->encrypt->decode($recent[$i]['pat_name']);
$recent[$i]['msg'] = $this->encrypt->decode($recent[$i]['msg']);
}
}
elseif($userdata['type'] == 'PATIENT')
{
for($i=0;$i<count($recent);$i++){
$recent[$i]['doc_name'] = $this->encrypt->decode($recent[$i]['doc_name']);
$recent[$i]['msg'] = $this->encrypt->decode($recent[$i]['msg']);
}
}
//print_r($recent);die();
......@@ -1411,18 +1451,25 @@ class Home extends CI_Controller {
$userdata = $this->session->userdata('UserData');
$allusers = $this->Home_model->get_all_chat_users($userdata['id'],$userdata['type']);
$allusers = $this->Home_model->get_all_chat_users($userdata['id'],$userdata['type']);
//print_r($userdata);die();
//header('Content-type: application/json');
if(($userdata['type']) == 'PATIENT'){
foreach($allusers as $key => $value) {
if($userdata['type'] == 'DOCTOR' || $userdata['type'] =="COLLABORATOR")
{
for($i=0;$i<count($allusers);$i++){
$allusers[$i]['pat_name'] = $this->encrypt->decode($allusers[$i]['pat_name']);
}
}
elseif($userdata['type'] == 'PATIENT')
{
for($i=0;$i<count($allusers);$i++){
$allusers[$i]['doc_name'] = $this->encrypt->decode($allusers[$i]['doc_name']);
}
}
$allusers[$key]['doc_name'] = decrypt_data($value['doc_name']);
//print_r($allusers);die();
}
}
//header('Content-type: application/json');
print json_encode($allusers);
......@@ -1456,22 +1503,31 @@ class Home extends CI_Controller {
$userdata = $this->session->userdata('UserData');
$_POST['msg'] = $this->encrypt->encode($_POST['msg']);
$this->Home_model->update_recent_chat($_POST);
$recent = $this->Home_model->get_recent_chat($userdata['id'],$userdata['type']);
if($userdata['type'] == 'DOCTOR' || $userdata['type'] =="COLLABORATOR")
{
for($i=0;$i<count($recent);$i++){
$recent[$i]['pat_name'] = $this->encrypt->decode($recent[$i]['pat_name']);
$recent[$i]['msg'] = $this->encrypt->decode($recent[$i]['msg']);
}
}
elseif($userdata['type'] == 'PATIENT')
{
for($i=0;$i<count($recent);$i++){
$recent[$i]['doc_name'] = $this->encrypt->decode($recent[$i]['doc_name']);
$recent[$i]['msg'] = $this->encrypt->decode($recent[$i]['msg']);
}
}
//print_r($recent);die();
//header('Content-type: application/json');
if(($userdata['type']) == 'PATIENT'){
foreach($recent as $key => $value) {
$recent[$key]['doc_name'] = decrypt_data($value['doc_name']);
}
}
print json_encode($recent);
}
......
......@@ -7,12 +7,13 @@ function __construct() {
public function get_single_doctor($id)
{
$key = $this->config->item('encryption_key');
$this->db->select("tbl_doctors.id as doctorid,
tbl_doctors.name as dr_name,
tbl_doctors.name as dr_name,
tbl_doctors.profile_pic as dr_pic,
tbl_doctors.email as dr_email,
tbl_doctors.username as dr_username,
tbl_doctors.dob as dr_dob,
CAST(AES_DECRYPT(tbl_doctors.dob,'".$key."') as CHAR) as dr_dob,
tbl_doctors.about as dr_bio,
tbl_doctors.specialization as dr_specialization_id,
tbl_doctors.price as dr_price,
......@@ -449,6 +450,8 @@ function update_profile($id,$data)
$this->db->where('tbl_doctors.id',$id);
if($this->db->update('tbl_doctors',$data))
{
$key = $this->config->item('encryption_key');
$this->db->query("Update tbl_doctors SET dob = AES_ENCRYPT(".$data['dob'].",'".$key."') where id=".$id);
$result = array('status' => 'success');
}
else
......@@ -460,7 +463,8 @@ function update_profile($id,$data)
function get_single_doctor_row($id)
{
$this->db->select("*");
$key = $this->config->item('encryption_key');
$this->db->select("*,CAST(AES_DECRYPT(dob,'".$key."') as CHAR) as dr_dob");
$this->db->from("tbl_doctors");
$this->db->where("tbl_doctors.id",$id);
$query = $this->db->get();
......@@ -527,11 +531,14 @@ function get_distinct_medicines()
function get_distinct_exams()
{
$this->db->select('exam_procedure as exam_name,
id as exam_id');
$key = $this->config->item('encryption_key');
$this->db->select("CAST(AES_DECRYPT(exam_procedure,'".$key."') as CHAR) as exam_name,
id as exam_id");
$this->db->from('tbl_exams');
$this->db->group_by('exam_procedure');
$query = $this->db->get();
//print_r($query->result_array());exit();
return $query->result_array();
}
......@@ -601,9 +608,10 @@ function get_medicine_for_name($name)
function get_exam_for_name($name)
{
$this->db->select('observation');
$key = $this->config->item('encryption_key');
$this->db->select("CAST(AES_DECRYPT(observation,'".$key."') as CHAR) as observation");
$this->db->from('tbl_exams');
$this->db->where('exam_procedure',$name);
$this->db->where("exam_procedure = AES_ENCRYPT('".$name."','".$key."') ");
$query = $this->db->get();
return $query->result_array();
}
......
......@@ -381,6 +381,7 @@
else if($data['login_type']=="DOCTOR")
{
$this->db->select("tbl_doctors.*,CAST(AES_DECRYPT(name, 'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as name");
$query = $this->db->get_where("tbl_doctors",array("username"=>$data['login-form-username'],"password"=>md5($data['login-form-password'])));
......@@ -416,6 +417,7 @@
$this->db->select("CAST(AES_DECRYPT(`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob");
$this->db->where('id',$patient_data['id']);
$query_date = $this->db->get('tbl_registration')->row();
//print_r($query_date);exit();
unset($patient_data['dob']);
$patient_data['dob'] = $query_date->dob;
......@@ -432,7 +434,7 @@
$this->db->where('id',$patient_email['id']);
$query_date = $this->db->get('tbl_registration')->row();
unset($patient_email['dob']);
$patient_email['dob'] = $query_date->email;
$patient_email['dob'] = $query_date->dob;
$return_array = array('status'=>'success','type'=>$type,'userdata'=>$patient_email);
......@@ -565,13 +567,16 @@
if($this->db->insert('tbl_doctors', $data))
{
$insertid = $this->db->insert_id();
$this->db->insert('tbl_clinic_doctors',array('doctor_id'=>$insertid,'clinic_id'=> 0));
$key = $this->config->item('encryption_key');
$this->db->query("update tbl_registration set dob = AES_ENCRYPT(".$data['dob'].",'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA')where id = ".$insertid);
//$this->db->query("Update tbl_doctors SET dob = AES_ENCRYPT(".$data['dob'].",".$key."), name = AES_ENCRYPT('".$data['name']."',".$key.") where id=".$insertid);
$this->db->insert('tbl_clinic_doctors',array('doctor_id'=>$insertid,'clinic_id'=> 0));
$this->db->insert('tbl_consultation',array('doctor_id'=>$insertid,'clinic_id'=> 0,'date'=>'""','date_secondary'=>'""','active_schedule'=> 0));
$query = $this->db->get_where("tbl_doctors",array("id"=>$insertid));
......@@ -842,6 +847,7 @@
{
$sql = $this->db->insert_string('tbl_recent_chats', $post) . ' ON DUPLICATE KEY UPDATE sender_type = ' .$post['sender_type'].',msg ='.'"' .$post['msg'].'"'.',photo_url='.'"' .$post['photo_url'].'"'.',video_url='.'"' .$post['video_url'].'"'.',type='.'"' .$post['type'].'"'.',time='.$post['time'];
//print_r($this->db->last_sqlquery());die();
......
<div class="ip_set_two_wrapper">
<div class="container ip_custom_container">
<div class="ip_top_dash_bay">
......@@ -75,7 +74,7 @@
<img src="<?php echo base_url();echo $doctor_data['dr_pic'];?>">
</div>
<div class="ip_profile_tab_name">
<h3>Dr. <?php echo $doctor_data['dr_name'] ?></h3>
<h3>Dr. <?php echo $doctor_data['dr_name']; ?></h3>
</div>
<div class="ip_profile_tab_button">
......@@ -99,7 +98,7 @@
</li>
<li>
<div class="child1"><?php load_language('phone');?> :</div>
<div class="child2"><?php echo $doctor_data['dr_telephone'] ?></div>
<div class="child2"><?php echo $this->encrypt->decode($doctor_data['dr_telephone']); ?></div>
<div class="clear"></div>
</li>
<!-- <li>
......@@ -133,7 +132,7 @@
?>
<li>
<div class="child1"><?php load_language('current_city');?> :</div>
<div class="child2"><?php echo $doctor_data["dr_neighbourhood"];?></div>
<div class="child2"><?php echo $this->encrypt->decode($doctor_data["dr_neighbourhood"]);?></div>
<div class="clear"></div>
</li>
<!-- <li>
......@@ -152,7 +151,7 @@
<img src="<?php echo base_url();echo $doctor_data['dr_pic'];?>">
</div>
<div class="ip_profile_tab_name">
<h3>Dr. <?php echo $doctor_data['dr_name'] ?></h3>
<h3>Dr. <?php echo $doctor_data['dr_name']; ?></h3>
</div>
<div class="ip_profile_tab_button">
......@@ -165,7 +164,7 @@
<div class="clear"></div>
</div>
<div class="ip_profile_tab_detail">
<p class="ip_row_p"><?php echo $doctor_data["dr_bio"];?></p>
<p class="ip_row_p"><?php echo $this->encrypt->decode($doctor_data["dr_bio"]);?></p>
</div>
</div>
<div id="special" class="tab-pane fade">
......@@ -174,7 +173,7 @@
<img src="<?php echo base_url();echo $doctor_data['dr_pic'];?>">
</div>
<div class="ip_profile_tab_name">
<h3>Dr. <?php echo $doctor_data['dr_name'] ?></h3>
<h3>Dr. <?php echo $doctor_data['dr_name']; ?></h3>
</div>
<div class="ip_profile_tab_button">
......@@ -319,9 +318,9 @@
<img src="<?php echo base_url(); echo $elm['pat_pic']?>">
</div>
<div class="ip_bio_messages">
<h5><?php echo $elm['pat_name'];?></h5><div class="ip_message_time"><?php echo change_time_to_local($elm['time'])?></div>
<h5><?php echo $this->encrypt->decode($elm['pat_name']);?></h5><div class="ip_message_time"><?php echo change_time_to_local($elm['time'])?></div>
<div class="clear"></div>
<p><?php echo $elm['msg'];?></p>
<p><?php echo $this->encrypt->decode($elm['msg']);?></p>
</div>
<div class="clear"></div>
</a>
......
......@@ -24,7 +24,9 @@
<div class="col-md-5 p0 height100">
<div class="ip_day_time_schedule_details_data height100">
<span><img src="<?php echo base_url();echo $value['pat_pic'];?>"></span>
<span><?php echo decrypt_data($value['pat_name']);?></span>
<span><?php echo $this->encrypt->decode($value['pat_name']);?></span>
</div>
</div>
......@@ -75,7 +77,9 @@
<div class="col-md-5 p0 height100">
<div class="ip_day_time_schedule_details_data height100">
<span><img src="<?php echo base_url();echo $value['pat_pic'];?>"></span>
<span><?php echo decrypt_data($value['pat_name']);?></span>
<span><?php echo $this->encrypt->decode($value['pat_name']);?></span>
</div>
</div>
<div class="col-md-4 p0 height100">
......
......@@ -16,7 +16,7 @@
<div class="row">
<div class="col-md-8 content" id="content" >
<div class="ip_edit_record_name" style="padding-top: 40px;">
<h5 id="patdetail" patid="<?php echo $booking_details['pat_id'];?>"><?php echo $booking_details['pat_name'];?></h5>
<h5 id="patdetail" patid="<?php echo $booking_details['pat_id'];?>"><?php echo $this->encrypt->decode($booking_details['pat_name']);?></h5>
<p><?php echo date('d M',$booking_details['book_date']);?>, <?php echo $booking_details['book_time'];?><img src="<?php echo base_url();?>assets/images/ip_menu5.png"></p>
</div>
<br><br>
......@@ -387,7 +387,7 @@
foreach ($exams as $key => $elem)
{
?>
<option value="<?php echo $elem['exam_name']?>"><?php echo $elem['exam_name']?></option>
<option value="<?php echo $elem['exam_name'];?>"><?php echo $elem['exam_name'];?></option>
<?php
}
}
......
......@@ -29,7 +29,7 @@
</div>
</div>
<div class="ip_record_search_box backgroundnone">
<h4><?php echo $patient_data['pt_name']?></h4>
<h4><?php echo $this->encrypt->decode($patient_data['pt_name']);?></h4>
</div>
<div class="ip_record_settings">
<span class="settings"><img src="<?php echo base_url();?>assets/images/ip_settings.png"></span>
......@@ -57,7 +57,7 @@
<div class="tab-content">
<div class="ip_profile_tab_top p0">
<div class="ip_profile_tab_name">
<h3><?php if(!empty($record_data['main_complaint'])) echo $record_data['main_complaint'];?></h3>
<h3><?php if(!empty($record_data['main_complaint'])) echo $this->encrypt->decode($record_data['main_complaint']);?></h3>
</div>
<div class="clear"></div>
......@@ -66,7 +66,7 @@
<div id="record" class="tab-pane fade in active">
<div class="ip_profile_tab_detail">
<?php if(!empty($record_data['description']))echo $record_data['description'];?>
<?php if(!empty($record_data['description']))echo $this->encrypt->decode($record_data['description']);?>
<br>
<div class="ip_prescription_div">
<ul>
......@@ -257,7 +257,7 @@
<img src="<?php echo base_url();echo $doctor_data['dr_pic']?>">
</div>
<div class="ip_profile_tab_name">
<h3>Dr. <?php echo $doctor_data['dr_name']?></h3>
<h3>Dr. <?php echo $this->encrypt->decode($doctor_data['dr_name']);?></h3>
<!-- <form id="ip_user_rating_form">
<div id="ip_selected_rating" class="ip_selected_rating floatLeft">5.0</div>
<span class="ip_user_rating floatLeft">
......
......@@ -31,7 +31,7 @@
<div class="col-md-7">
<div class="ip_edit_row">
<div class="ip_bank_detail_frame">
<input class="ip_bank_input" name="name" data-parsley-required="true" onKeyPress="if(this.value.length > 40) return false;" data-parsley-minlength="5" data-parsley-pattern="^[a-zA-Z ]+$" placeholder="<?php load_language('name');?>" value="<?php echo $doctor_data['dr_name']?>">
<input class="ip_bank_input" name="name" data-parsley-required="true" onKeyPress="if(this.value.length > 40) return false;" data-parsley-minlength="5" data-parsley-pattern="^[a-zA-Z ]+$" placeholder="<?php load_language('name');?>" value="<?php echo $this->encrypt->decode($doctor_data['dr_name']);?>">
</div>
</div>
<div class="ip_edit_row">
......@@ -44,13 +44,13 @@
<div class="col-md-6">
<p class="ip_row_p">RG</p>
<div class="ip_bank_detail_frame">
<input class="ip_bank_input" name="rg" maxlength="25" onKeyPress="if(this.value.length > 25) return false;" placeholder="" value="<?php echo $doctor_data['dr_rg']?>">
<input class="ip_bank_input" name="rg" maxlength="25" onKeyPress="if(this.value.length > 25) return false;" placeholder="" value="<?php echo $this->encrypt->decode($doctor_data['dr_rg']);?>">
</div>
</div>
<div class="col-md-6">
<p class="ip_row_p">CPF</p>
<div class="ip_bank_detail_frame">
<input class="ip_bank_input" name="cpf" placeholder="" data-parsley-required="true" data-parsley-minlength="11" data-parsley-cpf="" onKeyPress="if(this.value.length > 10) return false;" type="number" value="<?php echo $doctor_data['dr_cpf']?>">
<input class="ip_bank_input" name="cpf" placeholder="" data-parsley-required="true" data-parsley-minlength="11" data-parsley-cpf="" onKeyPress="if(this.value.length > 10) return false;" type="number" value="<?php echo $doctor_data['dr_cpf'];?>">
</div>
</div>
</div>
......@@ -60,13 +60,13 @@
<div class="col-md-6">
<p class="ip_row_p">CRM</p>
<div class="ip_bank_detail_frame">
<input class="ip_bank_input" name="crm" placeholder="" onKeyPress="if(this.value.length > 25) return false;" value="<?php echo $doctor_data['dr_crm']?>">
<input class="ip_bank_input" name="crm" placeholder="" onKeyPress="if(this.value.length > 25) return false;" value="<?php echo $this->encrypt->decode($doctor_data['dr_crm']);?>">
</div>
</div>
<div class="col-md-6">
<p class="ip_row_p"><?php load_language('telephone');?></p>
<div class="ip_bank_detail_frame">
<input class="ip_bank_input" name="telephone" placeholder="" data-parsley-pattern="^[0-9]+$" type="number" data-parsley-minlength="5" onKeyPress="if(this.value.length > 30) return false;" value="<?php echo $doctor_data['dr_telephone']?>">
<input class="ip_bank_input" name="telephone" placeholder="" data-parsley-pattern="^[0-9]+$" type="number" data-parsley-minlength="5" onKeyPress="if(this.value.length > 30) return false;" value="<?php echo $this->encrypt->decode($doctor_data['dr_telephone']);?>">
</div>
</div>
</div>
......@@ -129,37 +129,37 @@
<div class="col-md-5">
<div class="ip_edit_row">
<div class="ip_bank_detail_frame">
<input class="ip_bank_input" name="cep" data-parsley-required placeholder="CEP" onKeyPress="if(this.value.length > 7) return false;" type="number" data-parsley-minlength="8" data-parsley-cep="" data-parsley-pattern="^[0-9]+$" value="<?php echo $doctor_data['dr_cep']?>">
<input class="ip_bank_input" name="cep" data-parsley-required placeholder="CEP" onKeyPress="if(this.value.length > 7) return false;" type="number" data-parsley-minlength="8" data-parsley-cep="" data-parsley-pattern="^[0-9]+$" value="<?php echo $this->encrypt->decode($doctor_data['dr_cep']);?>">
</div>
</div>
<div class="ip_edit_row">
<div class="ip_bank_detail_frame">
<input class="ip_bank_input" name="street_address" data-parsley-required placeholder="<?php load_language('rua');?>" data-parsley-maxlength="50" onKeyPress="if(this.value.length > 50) return false;" data-parsley-pattern="^[a-zA-Z ]+$" data-parsley-minlength="5" value="<?php echo $doctor_data['dr_rua']?>">
<input class="ip_bank_input" name="street_address" data-parsley-required placeholder="<?php load_language('rua');?>" data-parsley-maxlength="50" onKeyPress="if(this.value.length > 50) return false;" data-parsley-pattern="^[a-zA-Z ]+$" data-parsley-minlength="5" value="<?php echo $this->encrypt->decode($doctor_data['dr_rua']);?>">
</div>
</div>
<div class="ip_edit_row">
<div class="row">
<div class="col-md-7">
<div class="ip_bank_detail_frame">
<input class="ip_bank_input" name="locality" data-parsley-required placeholder="<?php load_language('neighbourhood');?>" onKeyPress="if(this.value.length > 50) return false;" data-parsley-pattern="^[a-zA-Z ]+$" data-parsley-minlength="5" data-parsley-maxlength="50" value="<?php echo $doctor_data['dr_neighbourhood']?>">
<input class="ip_bank_input" name="locality" data-parsley-required placeholder="<?php load_language('neighbourhood');?>" onKeyPress="if(this.value.length > 50) return false;" data-parsley-pattern="^[a-zA-Z ]+$" data-parsley-minlength="5" data-parsley-maxlength="50" value="<?php echo $this->encrypt->decode($doctor_data['dr_neighbourhood']);?>">
</div>
</div>
<div class="col-md-5">
<div class="ip_bank_detail_frame">
<input class="ip_bank_input" name="number" data-parsley-required placeholder="<?php load_language('number');?>" data-parsley-pattern="^[0-9]+$" type="number" data-parsley-minlength="5" data-parsley-maxlength="30" onKeyPress="if(this.value.length > 30) return false;" value="<?php echo $doctor_data['dr_number']?>">
<input class="ip_bank_input" name="number" data-parsley-required placeholder="<?php load_language('number');?>" data-parsley-pattern="^[0-9]+$" type="number" data-parsley-minlength="5" data-parsley-maxlength="30" onKeyPress="if(this.value.length > 30) return false;" value="<?php echo $this->encrypt->decode($doctor_data['dr_number']);?>">
</div>
</div>
</div>
</div>
<div class="ip_edit_row">
<div class="ip_bank_detail_frame">
<input class="ip_bank_input" name="complement" placeholder="<?php load_language('complement');?>" onKeyPress="if(this.value.length > 50) return false;" data-parsley-maxlength="50" value="<?php echo $doctor_data['dr_complement']?>">
<input class="ip_bank_input" name="complement" placeholder="<?php load_language('complement');?>" onKeyPress="if(this.value.length > 50) return false;" data-parsley-maxlength="50" value="<?php echo $this->encrypt->decode($doctor_data['dr_complement']);?>">
</div>
</div>
<div class="ip_edit_row">
<p class="ip_row_p"><?php load_language('biography');?></p>
<div class="ip_bank_detail_frame" style="height:auto;">
<textarea class="ip_bank_input" name="about" placeholder="BIOGRAPHY" data-parsley-required rows="8" data-parsley-maxlength="1000" data-parsley-minlength="15" onKeyPress="if(this.value.length > 1000) return false;"><?php echo $doctor_data['dr_bio']?></textarea>
<textarea class="ip_bank_input" name="about" placeholder="BIOGRAPHY" data-parsley-required rows="8" data-parsley-maxlength="1000" data-parsley-minlength="15" onKeyPress="if(this.value.length > 1000) return false;"><?php echo $this->encrypt->decode($doctor_data['dr_bio']);?></textarea>
</div>
</div>
<div class="ip_edit_row">
......
......@@ -3,8 +3,8 @@
setTimeout(function()
{
$("#edit-doctor input").datepicker("update", '<?php echo date('m/d/Y',$doctor_data['dr_dob']);?>');
$('#doc-edt-gender').val('<?php echo $doctor_data['dr_gender'];?>').trigger('change');
$('#doc-edt-gender').val('<?php echo $doctor_data['dr_gender'];?>').trigger('change');
$('#doc-edt-gender').val('<?php echo $this->encrypt->decode($doctor_data['dr_gender']);?>').trigger('change');
$('#doc-edt-gender').val('<?php echo $this->encrypt->decode($doctor_data['dr_gender']);?>').trigger('change');
$('#doc-edt-specialization').val('<?php echo $doctor_data['dr_specialization_id'];?>').trigger('change');
},500)
......
......@@ -80,8 +80,8 @@
</div>
<div class="ip_record_name">
<?php echo decrypt_data($value['pat_name']);?>
<?php echo $this->encrypt->decode($value['pat_name']);?>
</div>
<div class="clear"></div>
</a>
......
......@@ -83,7 +83,9 @@
<img src="<?php echo base_url();echo $value['pat_pic'];?>">
</div>
<div class="ip_record_name">
<?php echo decrypt_data($value['pat_name']);?>
<?php echo $this->encrypt->decode($value['pat_name']);?>
</div>
<div class="clear"></div>
</a>
......
......@@ -33,6 +33,8 @@ if($this->session->userdata('language') == 'en'){
<div id="loading" style="display: none;">
<img id="loading-image" src="<?php echo base_url();?>assets/images/ipok-loading.gif" alt="Loading..." />
</div>
<input type="hidden" name="language" value="<?php echo $this->session->userdata('language');?>" id="language">
<form role="form" data-parsley-validate="" id="reg-form-doctor" method="POST" action="<?php echo base_url();?>Home/doRegister" enctype="multipart/form-data">
<div class="ip_edit_record_head backgroundnone">
<?php load_language('create_a_medical_account');?>
......@@ -73,7 +75,6 @@ if($this->session->userdata('language') == 'en'){
</div>
</div>
<input type="hidden" name="language" value="<>php echo $this->session->userdata('language');?>" id="language">
<div class="col-md-5">
<div class="ip_edit_row">
<div class="ip_bank_detail_frame">
......@@ -136,7 +137,7 @@ if($this->session->userdata('language') == 'en'){
<?php
$now = date('Y');
$max_year = $now - 18;
$min_year = $max_year - 100;
$min_year = $max_year - 120;
for($i = $min_year; $i <= $max_year ; $i++){?>
<option value="<?php echo $i;?>"><?php echo $i;?></option>
<?php }
......
......@@ -24,7 +24,7 @@
<div class="ip_bio_detail textCenter">
<div class="ip_bal_circle">
<div class="c100 p25">
<span><strong class="ip_counter" data-count="<?php echo $wallet['reedem_earn'];?>"><?php echo $wallet['reedem_earn'];?></strong></span>
<span><strong class="ip_counter" data-count="<?php echo $this->encrypt->decode($wallet['reedem_earn']);?>"><?php echo $this->encrypt->decode($wallet['reedem_earn']);?></strong></span>
<div class="slice">
<div class="bar"></div>
<div class="fill"></div>
......@@ -58,7 +58,7 @@
<div class="ip_bio_detail textCenter">
<div class="ip_future_circle">
<div class="c100 p25">
<span><strong class="ip_counter" data-count="<?php echo $wallet['future_earn'];?>"><?php echo $wallet['future_earn'];?></strong></span>
<span><strong class="ip_counter" data-count="<?php echo $this->encrypt->decode($wallet['future_earn']);?>"><?php echo $this->encrypt->decode($wallet['future_earn']);?></strong></span>
<div class="slice">
<div class="bar"></div>
<div class="fill"></div>
......@@ -92,7 +92,7 @@
<div class="ip_bio_detail textCenter">
<div class="ip_total_circle">
<div class="c100 p25">
<span><strong class="ip_counter" data-count="<?php echo $wallet['total_earn'];?>"><?php echo $wallet['total_earn'];?></strong></span>
<span><strong class="ip_counter" data-count="<?php echo $this->encrypt->decode($wallet['total_earn']);?>"><?php echo $this->encrypt->decode($wallet['total_earn']);?></strong></span>
<div class="slice">
<div class="bar"></div>
<div class="fill"></div>
......
......@@ -2725,12 +2725,22 @@ $('#reg_choose_pat').click(function(){
/* REGISTRATION DATEPICKER JS */
/*----------------------------*/
var date = (new Date()).getFullYear();
console.log(date);
var cur_date = date - 18;
console.log(cur_date);
var max_date = cur_date - 120;
console.log(max_date);
$('#registration-container input').datepicker({
autoclose: true,
onSelect: function(dateText) {
//console.log("Selected date: " + dateText + "; input's current value: " + this.value);
},
endDate:"0d",
/*endDate:"0d",
startDate:"-120y"*/
/*minDate: '-120Y',
maxDate: '-18Y',*/
endDate:"-18y",
startDate:"-120y"
})
......@@ -2739,7 +2749,11 @@ $('#doc-registration-container input').datepicker({
onSelect: function(dateText) {
//console.log("Selected date: " + dateText + "; input's current value: " + this.value);
},
endDate:"0d",
/*endDate:"0d",
startDate:"-120y"*/
/*minDate: '-120Y',
maxDate: '-18Y',*/
endDate:"-18y",
startDate:"-120y"
})
/* PATIENT EDIT DATEPICKER JS */
......@@ -2749,7 +2763,9 @@ $('#edit-patient input').datepicker({
onSelect: function(dateText) {
//console.log("Selected date: " + dateText + "; input's current value: " + this.value);
},
endDate:"0d",
/* endDate:"0d",
startDate:"-120y"*/
endDate:"-18y",
startDate:"-120y"
})
/*----------------------------*/
......
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