diff --git a/application/models/Adif_data.php b/application/models/Adif_data.php index 898575d6..323aa7fb 100644 --- a/application/models/Adif_data.php +++ b/application/models/Adif_data.php @@ -82,12 +82,12 @@ class adif_data extends CI_Model { $this->db->where($this->config->item('table_name').'.station_id', $station_id); // If date is set, we format the date and add it to the where-statement - if ($from != 0) { + if ($from) { $from = DateTime::createFromFormat('d/m/Y', $from); $from = $from->format('Y-m-d'); $this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) >= '".$from."'"); } - if ($to != 0) { + if ($to) { $to = DateTime::createFromFormat('d/m/Y', $to); $to = $to->format('Y-m-d'); $this->db->where("date(".$this->config->item('table_name').".COL_TIME_ON) <= '".$to."'");