Commit 9f0b2161 by Jansa Jose

web

parent 49a9fab2
...@@ -269,7 +269,15 @@ class Home extends CI_Controller { ...@@ -269,7 +269,15 @@ class Home extends CI_Controller {
parse_str($_REQUEST['data'], $output); 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'] ); if($output['reg_pat_gender'] == 'MALE' || $output['reg_pat_gender'] == 'male'){
$gender = 0;
}else if($output['reg_pat_gender'] == 'FEMALE' || $output['reg_pat_gender'] == 'female'){
$gender= 1;
}else{
$gender = 1;
}
$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' => $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'] );
//print_r($reg_data);die(); //print_r($reg_data);die();
...@@ -541,8 +549,9 @@ class Home extends CI_Controller { ...@@ -541,8 +549,9 @@ class Home extends CI_Controller {
$request = $_POST; $request = $_POST;
$result=$this->Home_model->login($request); $result=$this->Home_model->login($request);
if($result['userdata']['gender'] == '0'){ $result['userdata']['gender'] == 'MALE'; }
//print_r($result);die(); else if($result['userdata']['gender'] == '1'){$result['userdata']['gender'] == 'FEMALE'; }
else{ $result['userdata']['gender'] == 'OTHERS'; }
if(($result['status']=='success')&&($result['userdata']['account_status']==0)) if(($result['status']=='success')&&($result['userdata']['account_status']==0))
...@@ -965,7 +974,6 @@ class Home extends CI_Controller { ...@@ -965,7 +974,6 @@ class Home extends CI_Controller {
$data['rg'] = $this->encrypt->encode($data['rg']); $data['rg'] = $this->encrypt->encode($data['rg']);
//$data['cpf'] = $this->encrypt->encode($data['cpf']); //$data['cpf'] = $this->encrypt->encode($data['cpf']);
$data['telephone'] = $this->encrypt->encode($data['telephone']); $data['telephone'] = $this->encrypt->encode($data['telephone']);
$data['gender'] = $this->encrypt->encode($data['gender']);
$data['cep'] = $this->encrypt->encode($data['cep']); $data['cep'] = $this->encrypt->encode($data['cep']);
$data['street_address'] = $this->encrypt->encode($data['street_address']); $data['street_address'] = $this->encrypt->encode($data['street_address']);
$data['locality'] = $this->encrypt->encode($data['locality']); $data['locality'] = $this->encrypt->encode($data['locality']);
...@@ -977,7 +985,13 @@ class Home extends CI_Controller { ...@@ -977,7 +985,13 @@ class Home extends CI_Controller {
$newdob = $data['year'].'-'.$data['month'].'-'.$data['day']; $newdob = $data['year'].'-'.$data['month'].'-'.$data['day'];
$data['dob'] = strtotime($newdob); $data['dob'] = strtotime($newdob);
/*encryption*/ /*encryption*/
if($data['gender'] == 'MALE' || $data['gender'] == 'male'){
$data['gender'] = 0;
}else if($data['gender'] == 'FEMALE' || $data['gender'] == 'female'){
$data['gender'] = 1;
}else{
$data['gender'] = 1;
}
//print_r($data); //print_r($data);
......
...@@ -20,7 +20,7 @@ public function get_single_doctor($id) ...@@ -20,7 +20,7 @@ public function get_single_doctor($id)
tbl_doctors.consultation_duration as dr_consult_duration, tbl_doctors.consultation_duration as dr_consult_duration,
tbl_doctors.accept_return as dr_accept_return, tbl_doctors.accept_return as dr_accept_return,
tbl_doctors.return_timeperiod as dr_return_timeperiod, tbl_doctors.return_timeperiod as dr_return_timeperiod,
tbl_doctors.gender as dr_gender, 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.locality as dr_neighbourhood,
tbl_doctors.street_address as dr_rua, tbl_doctors.street_address as dr_rua,
tbl_doctors.number as dr_number, tbl_doctors.number as dr_number,
...@@ -467,8 +467,13 @@ function get_single_doctor_row($id) ...@@ -467,8 +467,13 @@ function get_single_doctor_row($id)
$this->db->select("*,CAST(AES_DECRYPT(dob,'".$key."') as CHAR) as dr_dob"); $this->db->select("*,CAST(AES_DECRYPT(dob,'".$key."') as CHAR) as dr_dob");
$this->db->from("tbl_doctors"); $this->db->from("tbl_doctors");
$this->db->where("tbl_doctors.id",$id); $this->db->where("tbl_doctors.id",$id);
$query = $this->db->get(); $query = $this->db->get()->row_array();
return $query->row_array();
if($query['gender'] == '0'){ $query['gender'] == 'MALE'; }
else if($query['gender'] == '1'){ $query['gender'] == 'FEMALE'; }
else{ $query['gender'] == 'OTHERS'; }
return $query;
} }
function check_consult_duration($id) function check_consult_duration($id)
{ {
......
...@@ -292,7 +292,10 @@ ...@@ -292,7 +292,10 @@
$this->db->query("update tbl_registration set dob = AES_ENCRYPT(".$date_of_birth.",'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA')where id = ".$insertid); $this->db->query("update tbl_registration set dob = AES_ENCRYPT(".$date_of_birth.",'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA')where id = ".$insertid);
$query = $this->db->get_where("tbl_registration",array("id"=>$insertid))->row_array(); $query = $this->db->get_where("tbl_registration",array("id"=>$insertid))->row_array();
if($query['gender'] == '0'){ $query['gender'] == 'MALE';}
else if($query['gender'] == '1'){ $query['gender'] == 'FEMALE';}
else{ $query['gender'] == 'OTHERS';}
$this->db->select("CAST(AES_DECRYPT(`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob"); $this->db->select("CAST(AES_DECRYPT(`dob`,'Ptf/PWNWrULQT72syxfaaBRTS9JbiKrj9dfuVEvT3rA') as CHAR) as dob");
$this->db->where('id',$insertid); $this->db->where('id',$insertid);
...@@ -594,7 +597,10 @@ ...@@ -594,7 +597,10 @@
$this->db->insert('tbl_clinic_doctors',array('doctor_id'=>$insertid,'clinic_id'=> 0)); $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->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)); $query = $this->db->get_where("tbl_doctors",array("id"=>$insertid));
if($query['gender'] == '0'){ $query['gender'] == 'MALE';}
else if($query['gender'] == '1'){ $query['gender'] == 'FEMALE';}
else{ $query['gender'] == 'OTHERS';}
$return_array = array('status'=>'success','data'=>$query->row_array()); $return_array = array('status'=>'success','data'=>$query->row_array());
......
...@@ -229,7 +229,14 @@ public function filter_search($post_data) ...@@ -229,7 +229,14 @@ public function filter_search($post_data)
if(isset($post_data['filter_dr_gender']) && !empty($post_data['filter_dr_gender'])) if(isset($post_data['filter_dr_gender']) && !empty($post_data['filter_dr_gender']))
{ {
if($post_data['filter_dr_gender'] == 'male' || $post_data['filter_dr_gender'] == 'MALE'){
$post_data['filter_dr_gender'] = '0';
}elseif($post_data['filter_dr_gender'] == 'female' || $post_data['filter_dr_gender'] == 'FEMALE'){
$post_data['filter_dr_gender'] = '1';
}elseif($post_data['filter_dr_gender'] == 'others' || $post_data['filter_dr_gender'] == 'OTHERS'){
$post_data['filter_dr_gender'] = '2';
}
$this->db->where('tbl_doctors.gender',$post_data['filter_dr_gender']); $this->db->where('tbl_doctors.gender',$post_data['filter_dr_gender']);
} }
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
setTimeout(function() setTimeout(function()
{ {
$("#edit-doctor input").datepicker("update", '<?php echo date('m/d/Y',$doctor_data['dr_dob']);?>'); $("#edit-doctor input").datepicker("update", '<?php echo date('m/d/Y',$doctor_data['dr_dob']);?>');
$('#doc-edt-gender').val('<?php echo $this->encrypt->decode($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 $doctor_data['dr_gender'];?>').trigger('change');
$('#doc-edt-specialization').val('<?php echo $doctor_data['dr_specialization_id'];?>').trigger('change'); $('#doc-edt-specialization').val('<?php echo $doctor_data['dr_specialization_id'];?>').trigger('change');
},500) },500)
......
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