Commit 5e872e93 by Jansa Jose

search dates6

parent 682da54b
......@@ -1121,16 +1121,12 @@ class Webservice_model extends CI_Model {
//echo $this->db->last_query();exit();
//print_r($this->db->last_query());die();
if ($query->num_rows() > 0) {
if(isset($data['date']) && strlen($data['date'])){
$date = $data['date'];
//SELECT * FROM `tbl_doctor_leave` WHERE NOT(1532304000 > `tbl_doctor_leave`.`start_date` OR 1532304000 < `tbl_doctor_leave`.`end_date`)
//$where = '$date<tbl_doctor_leave.start_date OR $date>tbl_doctor_leave.end_date';
// $this->db->where_not_in("($date<tbl_doctor_leave.start_date OR $date>tbl_doctor_leave.end_date)");
// $leave_query = $this->db->get('tbl_doctor_leave')->result();
$this->db->query("SELECT * FROM `tbl_doctor_leave` WHERE NOT($date > `tbl_doctor_leave`.`start_date` OR $date < `tbl_doctor_leave`.`end_date`)")->result();
//echo $this->db->last_query();
echo "<pre>";print_r($leave_query);exit();
}
// if(isset($data['date']) && strlen($data['date'])){
// $date = $data['date'];
// $leave_query = $this->db->query("SELECT * FROM `tbl_doctor_leave` WHERE NOT($date > `tbl_doctor_leave`.`start_date` OR $date < `tbl_doctor_leave`.`end_date`)")->result();
// //echo $this->db->last_query();
// echo "<pre>";print_r($leave_query);exit();
// }
$return_array = array('status'=>'success','data'=>$query->result_array());
}
else{
......
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