Commit 64fd4a6d by Jansa Jose

search

parent 9b29e288
......@@ -1483,7 +1483,7 @@ class Webservice_model extends CI_Model {
// echo $this->db->last_query();exit();
if ($query->num_rows() > 0) {
$querys = $query->result_array();
echo "<pre>";print_r($querys);exit();
// echo "<pre>";print_r($querys);exit();
if(isset($data['date']) && strlen($data['date'])){
$day = date('D',$data['date']);
$day = strtolower($day);
......@@ -1497,10 +1497,15 @@ class Webservice_model extends CI_Model {
}else{
$consult = $this->db->get_where('tbl_consultation',array('clinic_id'=>$values['clinic_id'],'doctor_id'=>$values['doctor_id']))->row();
if($consult){
if($consult->active_schedule == '0'){
$consult_date = json_decode($consult->date);
}else{
$consult_date = json_decode($consult->date_secondary);
}
if($consult->date != '""'){
$consult_date = json_decode($consult->date);
foreach ($consult_date as $consult_key => $consult_value) {
$new_array_day = array();
foreach ($consult_date as $consult_key => $consult_value) {
$new_array_day[] = $consult_value->day;
}
if(!in_array($day, $new_array_day)){
......@@ -1516,13 +1521,19 @@ class Webservice_model extends CI_Model {
}else{
foreach ($querys as $keys => $values) {
$consult = $this->db->get_where('tbl_consultation',array('clinic_id'=>$values['clinic_id'],'doctor_id'=>$values['doctor_id']))->row();
//echo $this->db->last_query();print_r($consult);
if($consult){
if($consult->date != '""'){
if($consult->active_schedule == '0'){
$consult_date = json_decode($consult->date);
foreach ($consult_date as $consult_key => $consult_value) {
}else{
$consult_date = json_decode($consult->date_secondary);
}
if($consult->date != '""'){
$new_array_day = array();
foreach ($consult_date as $consult_key => $consult_value) {
$new_array_day[] = $consult_value->day;
}
//print_r($new_array_day);exit();
if(!in_array($day, $new_array_day)){
unset($querys[$keys]);
}
......
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