mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Add parameter to static map to show only today's (or yesterday's) QSOs
This commit is contained in:
@@ -35,6 +35,7 @@ class Staticmap extends CI_Controller {
|
|||||||
|
|
||||||
$start_date = $this->input->get('start_date', TRUE) ?? 'noStart'; // Format YYYY-MM-DD
|
$start_date = $this->input->get('start_date', TRUE) ?? 'noStart'; // Format YYYY-MM-DD
|
||||||
$end_date = $this->input->get('end_date', TRUE) ?? 'noEnd'; // Format YYYY-MM-DD
|
$end_date = $this->input->get('end_date', TRUE) ?? 'noEnd'; // Format YYYY-MM-DD
|
||||||
|
$day = $this->input->get('day', TRUE) ?? '';
|
||||||
|
|
||||||
// if the user defines an Satellite Orbit, we need to set the band to SAT
|
// if the user defines an Satellite Orbit, we need to set the band to SAT
|
||||||
if ($orbit != 'nOrb') {
|
if ($orbit != 'nOrb') {
|
||||||
@@ -119,7 +120,8 @@ class Staticmap extends CI_Controller {
|
|||||||
. $contest
|
. $contest
|
||||||
. $start_date
|
. $start_date
|
||||||
. $end_date
|
. $end_date
|
||||||
. $watermark;
|
. $day
|
||||||
|
. $watermark;
|
||||||
|
|
||||||
$filename = crc32('staticmap_' . $slug) . '_' . substr(md5($filenameRaw), 0, 12) . '.png';
|
$filename = crc32('staticmap_' . $slug) . '_' . substr(md5($filenameRaw), 0, 12) . '.png';
|
||||||
$filepath = $cacheDir . '/' . $filename;
|
$filepath = $cacheDir . '/' . $filename;
|
||||||
@@ -182,7 +184,8 @@ class Staticmap extends CI_Controller {
|
|||||||
$orbit == 'nOrb' ? '' : $orbit,
|
$orbit == 'nOrb' ? '' : $orbit,
|
||||||
$contest == 'nContest' ? '' : $contest,
|
$contest == 'nContest' ? '' : $contest,
|
||||||
$start_date == 'noStart' ? '' : $start_date,
|
$start_date == 'noStart' ? '' : $start_date,
|
||||||
$end_date == 'noEnd' ? '' : $end_date
|
$end_date == 'noEnd' ? '' : $end_date,
|
||||||
|
$day
|
||||||
);
|
);
|
||||||
|
|
||||||
$image = $this->staticmap_model->render_static_map($qsos, $uid, $centerMap, $coordinates, $filepath, $continent, $thememode, $hide_home, $night_shadow, $pathlines, $cqzones, $ituzones, $watermark);
|
$image = $this->staticmap_model->render_static_map($qsos, $uid, $centerMap, $coordinates, $filepath, $continent, $thememode, $hide_home, $night_shadow, $pathlines, $cqzones, $ituzones, $watermark);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
class Visitor_model extends CI_Model {
|
class Visitor_model extends CI_Model {
|
||||||
|
|
||||||
function get_qsos($num, $StationLocationsArray, $band = '', $continent = '', $orbit = '', $contest = '', $start_date = '', $end_date = '') {
|
function get_qsos($num, $StationLocationsArray, $band = '', $continent = '', $orbit = '', $contest = '', $start_date = '', $end_date = '', $day = '') {
|
||||||
$this->db->select($this->config->item('table_name').'.*, station_profile.*');
|
$this->db->select($this->config->item('table_name').'.*, station_profile.*');
|
||||||
$this->db->from($this->config->item('table_name'));
|
$this->db->from($this->config->item('table_name'));
|
||||||
|
|
||||||
@@ -11,13 +11,21 @@ class Visitor_model extends CI_Model {
|
|||||||
$this->db->join('satellite', 'satellite.name = '.$this->config->item('table_name').'.COL_SAT_NAME', 'left');
|
$this->db->join('satellite', 'satellite.name = '.$this->config->item('table_name').'.COL_SAT_NAME', 'left');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($start_date != '') {
|
if ($day != '') {
|
||||||
$start_date = date('Y-m-d', strtotime($start_date));
|
if ($day == 'today') {
|
||||||
$this->db->where($this->config->item('table_name').'.COL_TIME_ON >=', $start_date);
|
$this->db->where('DATE('.$this->config->item('table_name').'.COL_TIME_ON) = CURDATE()');
|
||||||
}
|
} elseif ($day == 'yesterday') {
|
||||||
if ($end_date != '') {
|
$this->db->where('DATE('.$this->config->item('table_name').'.COL_TIME_ON) = CURDATE() - INTERVAL 1 DAY');
|
||||||
$end_date = date('Y-m-d', strtotime($end_date));
|
}
|
||||||
$this->db->where($this->config->item('table_name').'.COL_TIME_ON <=', $end_date);
|
} else {
|
||||||
|
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 != '') {
|
||||||
|
|||||||
Reference in New Issue
Block a user