@@ -51,16 +58,19 @@ class Webservice_model extends CI_Model {
$insertid=$this->db->insert_id();
$this->db->query("update tbl_registration set dob = AES_ENCRYPT(".$data['dob'].",'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA')where id = ".$insertid);
$this->db->select("tbl_registration.*,CASE when gender='0' then 'MALE' when gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender");
$this->db->select('tbl_specialization.id as specialization_id,tbl_specialization.specialization_name,tbl_doctors.*');
$this->db->select("tbl_specialization.id as specialization_id,tbl_specialization.specialization_name,tbl_doctors.*,CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender");
@@ -296,7 +313,7 @@ class Webservice_model extends CI_Model {
$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->select("tbl_doctors.*,tbl_specialization.id as specialization_id,tbl_specialization.specialization_name,tbl_authtoken_doctors.doctor_id ,tbl_authtoken_doctors.authtoken,CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender");
$this->db->select("tbl_registration.*,CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender,tbl_authtoken.userid ,tbl_authtoken.authtoken");
CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender,tbl_authtoken.userid ,tbl_authtoken.authtoken");
@@ -481,12 +514,13 @@ class Webservice_model extends CI_Model {
//....................doctor login
functiondoctor_login($data){
$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->select("tbl_doctors.*,
CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender,tbl_specialization.id as specialization_id,tbl_specialization.specialization_name,tbl_authtoken_doctors.doctor_id ,tbl_authtoken_doctors.authtoken");
$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->select("tbl_doctors.*,CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender,tbl_specialization.id as specialization_id,tbl_specialization.specialization_name,tbl_authtoken_doctors.doctor_id ,tbl_authtoken_doctors.authtoken");
CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender,tbl_authtoken.userid ,tbl_authtoken.authtoken");
@@ -652,7 +690,8 @@ class Webservice_model extends CI_Model {
//.............. Get doctor data based on email
functionget_userdata_doctor($data){
$this->db->select('tbl_doctors.*,tbl_authtoken_doctors.doctor_id ,tbl_authtoken_doctors.authtoken,tbl_specialization.id as specialization_id,tbl_specialization.specialization_name');
$this->db->select("tbl_doctors.*,
CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender,tbl_authtoken_doctors.doctor_id ,tbl_authtoken_doctors.authtoken,tbl_specialization.id as specialization_id,tbl_specialization.specialization_name");
@@ -691,7 +731,8 @@ class Webservice_model extends CI_Model {
//.............. Get doctor data based on uid
functionget_userdata_doctor_by_uid($data){
$this->db->select('tbl_doctors.*,tbl_authtoken_doctors.doctor_id ,tbl_authtoken_doctors.authtoken,tbl_specialization.id as specialization_id,tbl_specialization.specialization_name');
$this->db->select("tbl_doctors.*,
CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender,tbl_authtoken_doctors.doctor_id ,tbl_authtoken_doctors.authtoken,tbl_specialization.id as specialization_id,tbl_specialization.specialization_name");
@@ -731,7 +773,8 @@ class Webservice_model extends CI_Model {
functionget_userdata_patient_by_uid($data){
//$this->db->select("tbl_registration.*,CAST(AES_DECRYPT(`tbl_registration.dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob_new,tbl_authtoken.userid ,tbl_authtoken.authtoken");
CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender,tbl_authtoken.userid ,tbl_authtoken.authtoken");
$this->db->query("update tbl_doctors set dob = AES_ENCRYPT(".$data['dob'].",'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA')where id = ".$insertid);
...
...
@@ -1741,11 +1795,16 @@ class Webservice_model extends CI_Model {
$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();
$this->db->select("tbl_doctors.*,
CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender");
$query=$this->db->get('tbl_doctors');
$query=$query->row_array();
unset($query['dob']);
$query['dob']=$query_date->dob;
$query['about']=decrypt_data($query['about']);
$query['gender']=decrypt_data($query['gender']);
$query['gender']=$query['pt_gender'];
unset($query['pt_gender']);
$query['rg']=decrypt_data($query['rg']);
$query['crm']=decrypt_data($query['crm']);
$query['cep']=decrypt_data($query['cep']);
...
...
@@ -4050,14 +4109,14 @@ class Webservice_model extends CI_Model {
publicfunctionget_single_patient($id)
{
$this->db->select("tbl_registration.id as patientid,tbl_registration.name as pt_name,tbl_registration.username as pt_username,tbl_registration.profile_photo as pt_pic,tbl_registration.gender as pt_gender,tbl_registration.email as pt_email,CAST(AES_DECRYPT(`tbl_registration`.`dob`, 'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as pt_dob,tbl_registration.number as pt_number,tbl_registration.blood_group as pt_blood_group,tbl_registration.weight as pt_weight,tbl_registration.height as pt_height,tbl_registration.street_address as pt_street_add,tbl_registration.locality as pt_locality,tbl_registration.zip_code as pt_zip_code,tbl_registration.landmark as pt_complement,tbl_registration.rg as pt_rg,tbl_registration.cpf as pt_cpf,tbl_registration.customer_id as pt_customer_id
$this->db->select("tbl_registration.id as patientid,tbl_registration.name as pt_name,tbl_registration.username as pt_username,tbl_registration.profile_photo as pt_pic,
CASE when tbl_registration.gender='0' then 'MALE' when tbl_registration.gender='1' then 'FEMALE' else 'OTHERS' end as pt_gender,tbl_registration.email as pt_email,CAST(AES_DECRYPT(`tbl_registration`.`dob`, 'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as pt_dob,tbl_registration.number as pt_number,tbl_registration.blood_group as pt_blood_group,tbl_registration.weight as pt_weight,tbl_registration.height as pt_height,tbl_registration.street_address as pt_street_add,tbl_registration.locality as pt_locality,tbl_registration.zip_code as pt_zip_code,tbl_registration.landmark as pt_complement,tbl_registration.rg as pt_rg,tbl_registration.cpf as pt_cpf,tbl_registration.customer_id as pt_customer_id
@@ -4075,7 +4134,7 @@ class Webservice_model extends CI_Model {
publicfunctionget_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,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->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,CASE when tbl_doctors.gender='0' then 'MALE' when tbl_doctors.gender='1' then 'FEMALE' else 'OTHERS' end 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");