added option for date range

This commit is contained in:
HB9HIL
2024-11-04 01:58:02 +01:00
parent bbf9fbbf4f
commit e91ab001f0
2 changed files with 24 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
class Visitor_model extends CI_Model {
function get_qsos($num, $StationLocationsArray, $band = '', $continent = '', $orbit = '', $contest = '') {
function get_qsos($num, $StationLocationsArray, $band = '', $continent = '', $orbit = '', $contest = '', $start_date = '', $end_date = '') {
$this->db->select($this->config->item('table_name').'.*, station_profile.*');
$this->db->from($this->config->item('table_name'));
@@ -11,6 +11,15 @@ class Visitor_model extends CI_Model {
$this->db->join('satellite', 'satellite.name = '.$this->config->item('table_name').'.COL_SAT_NAME', 'left');
}
if ($start_date != '') {
$start_date = date('Y-m-d', strtotime($start_date));
$this->db->where($this->config->item('table_name').'.COL_TIME_ON >=', $start_date);
}
if ($end_date != '') {
$end_date = date('Y-m-d', strtotime($end_date));
$this->db->where($this->config->item('table_name').'.COL_TIME_ON <=', $end_date);
}
if ($band != '') {
if ($band == 'SAT') {
$this->db->where($this->config->item('table_name').'.col_prop_mode', 'SAT');