[Timeline] Added year selection, and only new

This commit is contained in:
Andreas Kristiansen
2024-12-06 08:51:54 +01:00
parent 38292864bb
commit 88b28a1e7f
3 changed files with 220 additions and 93 deletions

View File

@@ -44,6 +44,12 @@ class Timeline extends CI_Controller {
$award = 'dxcc';
}
if ($this->input->post('year') != NULL) {
$year = $this->security->xss_clean($this->input->post('year'));
} else {
$year = 'All';
}
if ($this->input->post('qsl') != NULL) {
$qsl = $this->security->xss_clean($this->input->post('qsl'));
} else {
@@ -68,17 +74,32 @@ class Timeline extends CI_Controller {
$eqsl = '0';
}
if ($this->input->post('qrz') != NULL) {
$qrz = $this->security->xss_clean($this->input->post('qrz'));
} else {
$qrz = '0';
}
if ($this->input->post('onlynew') != NULL) {
$onlynew = $this->security->xss_clean($this->input->post('onlynew'));
} else {
$onlynew = '0';
}
$this->load->model('modes');
$this->load->model('bands');
$data['modes'] = $this->modes->active();
$data['timeline_array'] = $this->Timeline_model->get_timeline($band, $mode, $propmode, $award, $qsl, $lotw, $eqsl, $clublog);
$data['timeline_array'] = $this->Timeline_model->get_timeline($band, $mode, $propmode, $award, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew);
$data['worked_bands'] = $this->bands->get_worked_bands();
$data['bandselect'] = $band;
$data['modeselect'] = $mode;
$data['propmode'] = $propmode;
$data['user_default_band'] = $this->session->userdata('user_default_band');
$data['years'] = $this->Timeline_model->get_years();
$data['onlynew'] = $onlynew;
$data['selectedyear'] = $year;
$footerData['scripts'] = [ 'assets/js/sections/timeline.js?' ];
$this->load->view('interface_assets/header', $data);

View File

@@ -2,7 +2,7 @@
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Timeline_model extends CI_Model {
function get_timeline($band, $mode, $propmode, $award, $qsl, $lotw, $eqsl, $clublog) {
function get_timeline($band, $mode, $propmode, $award, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) {
$this->load->model('logbooks_model');
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
@@ -13,18 +13,18 @@ class Timeline_model extends CI_Model {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
switch ($award) {
case 'dxcc': $result = $this->get_timeline_dxcc($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog); break;
case 'was': $result = $this->get_timeline_was($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog); break;
case 'iota': $result = $this->get_timeline_iota($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog); break;
case 'waz': $result = $this->get_timeline_waz($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog); break;
case 'vucc': $result = $this->get_timeline_vucc($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog); break;
case 'waja': $result = $this->get_timeline_waja($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog); break;
case 'dxcc': $result = $this->get_timeline_dxcc($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew); break;
case 'was': $result = $this->get_timeline_was($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew); break;
case 'iota': $result = $this->get_timeline_iota($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew); break;
case 'waz': $result = $this->get_timeline_waz($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew); break;
case 'vucc': $result = $this->get_timeline_vucc($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew); break;
case 'waja': $result = $this->get_timeline_waja($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew); break;
}
return $result;
}
public function get_timeline_dxcc($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog) {
public function get_timeline_dxcc($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) {
$binding = [];
$sql = "select min(date(COL_TIME_ON)) date, prefix, col_country, end, adif from "
.$this->config->item('table_name'). " thcv
@@ -51,12 +51,17 @@ class Timeline_model extends CI_Model {
}
}
if ($year != "All" && $onlynew == 0) {
$sql .= " and year(col_time_on) = ?";
$binding[] = $year;
}
if ($mode != 'All') {
$sql .= " and col_mode = ?";
$binding[] = $mode;
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog);
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz);
$sql .= " group by col_dxcc, col_country
order by date desc";
@@ -66,7 +71,7 @@ class Timeline_model extends CI_Model {
return $query->result();
}
public function get_timeline_waja($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog) {
public function get_timeline_waja($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) {
$binding = [];
$sql = "select min(date(COL_TIME_ON)) date, col_state from "
.$this->config->item('table_name'). " thcv
@@ -98,9 +103,14 @@ class Timeline_model extends CI_Model {
$binding[] = $mode;
}
if ($year != "All" && $onlynew == 0) {
$sql .= " and year(col_time_on) = ?";
$binding[] = $year;
}
$sql .= " and COL_DXCC = '339' and trim(coalesce(COL_STATE,'')) != '' ";
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog);
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz);
$sql .= " group by col_state
order by date desc";
@@ -110,7 +120,7 @@ class Timeline_model extends CI_Model {
return $query->result();
}
public function get_timeline_was($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog) {
public function get_timeline_was($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) {
$binding = [];
$sql = "select min(date(COL_TIME_ON)) date, col_state from "
.$this->config->item('table_name'). " thcv
@@ -141,10 +151,15 @@ class Timeline_model extends CI_Model {
$binding[] = $mode;
}
if ($year != "All" && $onlynew == 0) {
$sql .= " and year(col_time_on) = ?";
$binding[] = $year;
}
$sql .= " and COL_DXCC in ('291', '6', '110')";
$sql .= " and COL_STATE in ('AK','AL','AR','AZ','CA','CO','CT','DE','FL','GA','HI','IA','ID','IL','IN','KS','KY','LA','MA','MD','ME','MI','MN','MO','MS','MT','NC','ND','NE','NH','NJ','NM','NV','NY','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VA','VT','WA','WI','WV','WY')";
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog);
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz);
$sql .= " group by col_state
order by date desc";
@@ -154,7 +169,7 @@ class Timeline_model extends CI_Model {
return $query->result();
}
public function get_timeline_iota($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog) {
public function get_timeline_iota($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) {
$binding = [];
$sql = "select min(date(COL_TIME_ON)) date, col_iota, name, prefix from "
.$this->config->item('table_name'). " thcv
@@ -187,7 +202,12 @@ class Timeline_model extends CI_Model {
$binding[] = $mode;
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog);
if ($year != "All" && $onlynew == 0) {
$sql .= " and year(col_time_on) = ?";
$binding[] = $year;
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz);
$sql .= " and col_iota <> '' group by col_iota, name, prefix
order by date desc";
@@ -197,7 +217,7 @@ class Timeline_model extends CI_Model {
return $query->result();
}
public function get_timeline_waz($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog) {
public function get_timeline_waz($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) {
$binding = [];
$sql = "select min(date(COL_TIME_ON)) date, col_cqz from "
.$this->config->item('table_name'). " thcv
@@ -229,7 +249,12 @@ class Timeline_model extends CI_Model {
$binding[] = $mode;
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog);
if ($year != "All" && $onlynew == 0) {
$sql .= " and year(col_time_on) = ?";
$binding[] = $year;
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz);
$sql .= " and col_cqz <> '' group by col_cqz
order by date desc";
@@ -241,9 +266,9 @@ class Timeline_model extends CI_Model {
// Adds confirmation to query
function addQslToQuery($qsl, $lotw, $eqsl, $clublog) {
function addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz) {
$sql = '';
if ( (($lotw ?? 0) != 0) || (($qsl ?? 0) != 0) || (($eqsl ?? 0) != 0) || (($clublog ?? 0) != 0) ) {
if ( (($lotw ?? 0) != 0) || (($qsl ?? 0) != 0) || (($eqsl ?? 0) != 0) || (($clublog ?? 0) != 0) || (($qrz ?? 0) != 0)) {
$sql .= 'and (';
if ($lotw ?? 0 == 1) {
@@ -261,6 +286,10 @@ class Timeline_model extends CI_Model {
if ($clublog ?? 0 == 1) {
$sql .= " col_clublog_qso_download_status = 'Y' or";
}
if ($qrz ?? 0 == 1) {
$sql .= " col_qrzcom_qso_download_status = 'Y' or";
}
$sql.=' 1=0)';
}
return $sql;
@@ -295,7 +324,6 @@ class Timeline_model extends CI_Model {
if ( $propmode == 'NoSAT' ) { // All without SAT
$this->db->where('col_prop_mode !=', 'SAT');
} elseif ($propmode == 'None') { // Empty Propmode
$sql .= " and (trim(col_prop_mode)='' or col_prop_mode is null)";
$this->db->group_start();
$this->db->where('trim(col_prop_mode)', '');
$this->db->or_where('col_prop_mode is null');
@@ -314,11 +342,11 @@ class Timeline_model extends CI_Model {
$this->db->where_in('station_profile.station_id', $logbooks_locations_array);
switch($type) {
case 'dxcc': $this->db->where('COL_DXCC', $querystring); break;
case 'was': $this->db->where('COL_STATE', $querystring); $this->db->where("COL_DXCC in ('291', '6', '110')"); break;
case 'iota': $this->db->where('COL_IOTA', $querystring); break;
case 'waz': $this->db->where('COL_CQZ', $querystring); break;
case 'vucc': $this->db->group_start(); $this->db->like('COL_GRIDSQUARE', $querystring); $this->db->or_like('COL_VUCC_GRIDS',$querystring); $this->db->group_end();break;
case 'dxcc': $this->db->where('COL_DXCC', $querystring); break;
case 'was': $this->db->where('COL_STATE', $querystring); $this->db->where("COL_DXCC in ('291', '6', '110')"); break;
case 'iota': $this->db->where('COL_IOTA', $querystring); break;
case 'waz': $this->db->where('COL_CQZ', $querystring); break;
case 'vucc': $this->db->group_start(); $this->db->like('COL_GRIDSQUARE', $querystring); $this->db->or_like('COL_VUCC_GRIDS',$querystring); $this->db->group_end();break;
case 'waja': $this->db->where('COL_STATE', $querystring); $this->db->where('COL_DXCC','339'); break;
}
$this->db->order_by('COL_TIME_ON', 'DESC');
@@ -326,10 +354,10 @@ class Timeline_model extends CI_Model {
return $this->db->get($this->config->item('table_name'));
}
public function get_timeline_vucc($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog) {
public function get_timeline_vucc($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) {
$timeline = array();
$col_gridsquare = $this->get_gridsquare($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog);
$col_gridsquare = $this->get_gridsquare($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew);
foreach ($col_gridsquare as $grid) {
$timeline[] = array(
@@ -337,7 +365,7 @@ class Timeline_model extends CI_Model {
'date' => $grid->date);
}
$col_vucc_grids = $this->get_vucc_grids($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog);
$col_vucc_grids = $this->get_vucc_grids($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew);
foreach ($col_vucc_grids as $gridSplit) {
$grids = explode(",", $gridSplit->gridsquare);
@@ -357,7 +385,7 @@ class Timeline_model extends CI_Model {
return $timeline;
}
public function get_gridsquare($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog) {
public function get_gridsquare($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) {
$binding = [];
$sql = "select min(COL_TIME_ON) date, upper(substring(col_gridsquare, 1, 4)) gridsquare from "
.$this->config->item('table_name'). " thcv
@@ -388,7 +416,12 @@ class Timeline_model extends CI_Model {
$binding[] = $mode;
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog);
if ($year != "All" && $onlynew == 0) {
$sql .= " and year(col_time_on) = ?";
$binding[] = $year;
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz);
$sql .= " and col_gridsquare <> '' group by upper(substring(col_gridsquare, 1, 4))
order by date desc";
@@ -398,7 +431,7 @@ class Timeline_model extends CI_Model {
return $query->result();
}
public function get_vucc_grids($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog) {
public function get_vucc_grids($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) {
$binding = [];
$sql = "select COL_TIME_ON as date, upper(col_vucc_grids) gridsquare from "
.$this->config->item('table_name'). " thcv
@@ -429,7 +462,12 @@ class Timeline_model extends CI_Model {
$binding[] = $mode;
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog);
if ($year != "All" && $onlynew == 0) {
$sql .= " and year(col_time_on) = ?";
$binding[] = $year;
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz);
$sql .= " and col_vucc_grids <> ''";
@@ -438,4 +476,16 @@ class Timeline_model extends CI_Model {
return $query->result();
}
function get_years() {
$this->load->model('logbook_model');
$totals_year = $this->logbook_model->totals_year();
$years=[];
if ($totals_year) {
foreach($totals_year->result() as $years_obj) {
$years[] = $years_obj->year;
}
}
return $years;
}
}

View File

@@ -63,41 +63,64 @@
<input class="form-check-input" type="checkbox" name="eqsl" value="1" id="eqsl" <?php if ($this->input->post('eqsl')) echo ' checked="checked"'; ?> >
<label class="form-check-label" for="eqsl"><?= __("eQSL") ?></label>
</div>
<div class="form-check-inline">
<div class="form-check-inline">
<input class="form-check-input" type="checkbox" name="clublog" value="1" id="clublog" <?php if ($this->input->post('clublog')) echo ' checked="checked"'; ?> >
<label class="form-check-label" for="clublog"><?= __("Clublog") ?></label>
</div>
<div class="form-check-inline">
<input class="form-check-input" type="checkbox" name="qrz" value="1" id="qrz" <?php if ($this->input->post('qrz')) echo ' checked="checked"'; ?> >
<label class="form-check-label" for="qrz"><?= __("QRZ") ?></label>
</div>
</div>
</div>
<div class="mb-4 row">
<label class="col-md-1" for="propmode"><?= __("Propagation"); ?></label>
<div class="col-md-3">
<select class="form-select w-auto" name="propmode" id="propmode">
<option value="0"<?php if (($propmode ?? '') == '0') { echo 'selected="selected"'; } ?>><?= __("All"); ?></option>
<option value="NoSAT"<?php if (($propmode ?? '') == 'NoSAT') { echo 'selected="selected"'; } ?>><?= __("All but SAT"); ?></option>
<option value="None"<?php if (($propmode ?? '') == 'None') { echo ' selected="selected"'; } ?>><?= __("None/Empty"); ?></option>
<option value="AS"<?php if (($propmode ?? '') == 'AS') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Aircraft Scatter"); ?></option>
<option value="AUR"<?php if (($propmode ?? '') == 'AUR') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Aurora"); ?></option>
<option value="AUE"<?php if (($propmode ?? '') == 'AUE') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Aurora-E"); ?></option>
<option value="BS"<?php if (($propmode ?? '') == 'BS') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Back scatter"); ?></option>
<option value="ECH"<?php if (($propmode ?? '') == 'ECH') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","EchoLink"); ?></option>
<option value="EME"<?php if (($propmode ?? '') == 'EME') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Earth-Moon-Earth"); ?></option>
<option value="ES"<?php if (($propmode ?? '') == 'ES') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Sporadic E"); ?></option>
<option value="FAI"<?php if (($propmode ?? '') == 'FAI') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Field Aligned Irregularities"); ?></option>
<option value="F2"<?php if (($propmode ?? '') == 'F2') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","F2 Reflection"); ?></option>
<option value="INTERNET"<?php if (($propmode ?? '') == 'INTERNET') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Internet-assisted"); ?></option>
<option value="ION"<?php if (($propmode ?? '') == 'ION') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Ionoscatter"); ?></option>
<option value="IRL"<?php if (($propmode ?? '') == 'IRL') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","IRLP"); ?></option>
<option value="MS"<?php if (($propmode ?? '') == 'MS') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Meteor scatter"); ?></option>
<option value="RPT"<?php if (($propmode ?? '') == 'RPT') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Terrestrial or atmospheric repeater or transponder"); ?></option>
<option value="RS"<?php if (($propmode ?? '') == 'RS') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Rain scatter"); ?></option>
<option value="SAT" <?php if ($propmode == 'SAT') {echo 'selected="selected"';} ?>><?= _pgettext("Propagation Mode","Satellite"); ?></option>
<option value="TEP"<?php if (($propmode ?? '') == 'TEP') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Trans-equatorial"); ?></option>
<option value="TR"<?php if (($propmode ?? '') == 'TR') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Tropospheric ducting"); ?></option>
</select>
</div>
</div>
<div class="mb-3 row">
<!-- Propagation Mode -->
<label class="col-md-1" for="propmode"><?= __("Propagation"); ?></label>
<div class="col-md-3">
<select class="form-select" name="propmode" id="propmode">
<option value="0"<?php if (($propmode ?? '') == '0') { echo 'selected="selected"'; } ?>><?= __("All"); ?></option>
<option value="NoSAT"<?php if (($propmode ?? '') == 'NoSAT') { echo 'selected="selected"'; } ?>><?= __("All but SAT"); ?></option>
<option value="None"<?php if (($propmode ?? '') == 'None') { echo ' selected="selected"'; } ?>><?= __("None/Empty"); ?></option>
<option value="AS"<?php if (($propmode ?? '') == 'AS') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Aircraft Scatter"); ?></option>
<option value="AUR"<?php if (($propmode ?? '') == 'AUR') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Aurora"); ?></option>
<option value="AUE"<?php if (($propmode ?? '') == 'AUE') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Aurora-E"); ?></option>
<option value="BS"<?php if (($propmode ?? '') == 'BS') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Back scatter"); ?></option>
<option value="ECH"<?php if (($propmode ?? '') == 'ECH') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","EchoLink"); ?></option>
<option value="EME"<?php if (($propmode ?? '') == 'EME') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Earth-Moon-Earth"); ?></option>
<option value="ES"<?php if (($propmode ?? '') == 'ES') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Sporadic E"); ?></option>
<option value="FAI"<?php if (($propmode ?? '') == 'FAI') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Field Aligned Irregularities"); ?></option>
<option value="F2"<?php if (($propmode ?? '') == 'F2') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","F2 Reflection"); ?></option>
<option value="INTERNET"<?php if (($propmode ?? '') == 'INTERNET') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Internet-assisted"); ?></option>
<option value="ION"<?php if (($propmode ?? '') == 'ION') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Ionoscatter"); ?></option>
<option value="IRL"<?php if (($propmode ?? '') == 'IRL') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","IRLP"); ?></option>
<option value="MS"<?php if (($propmode ?? '') == 'MS') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Meteor scatter"); ?></option>
<option value="RPT"<?php if (($propmode ?? '') == 'RPT') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Terrestrial or atmospheric repeater or transponder"); ?></option>
<option value="RS"<?php if (($propmode ?? '') == 'RS') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Rain scatter"); ?></option>
<option value="SAT" <?php if ($propmode == 'SAT') {echo 'selected="selected"';} ?>><?= _pgettext("Propagation Mode","Satellite"); ?></option>
<option value="TEP"<?php if (($propmode ?? '') == 'TEP') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Trans-equatorial"); ?></option>
<option value="TR"<?php if (($propmode ?? '') == 'TR') { echo ' selected="selected"'; } ?>><?= _pgettext("Propagation Mode","Tropospheric ducting"); ?></option>
</select>
</div>
<!-- Year and Checkbox -->
<label class="col-md-1" for="year"><?= __("Year"); ?></label>
<div class="col-md-4">
<div class="d-inline-block">
<select class="form-select d-inline-block w-auto" id="year" name="year">
<option value='All'><?= __("All Years"); ?></option>
<?php foreach($years as $year): ?>
<option value="<?= $year ?>" <?= ($this->input->post('year') == $year) ? 'selected' : '' ?>><?= $year ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-check d-inline-block ms-2">
<input class="form-check-input" type="checkbox" name="onlynew" value="1" id="onlynew" <?= $this->input->post('onlynew') ? 'checked' : '' ?>>
<label class="form-check-label" for="onlynew"><?= __("Only new in selected year") ?></label>
</div>
</div>
</div>
<div class="mb-3 row">
<label class="col-md-1 control-label" for="button1id"></label>
@@ -108,7 +131,7 @@
</form>
<?php
<?php
// Get Date format
if($this->session->userdata('user_date_format')) {
// If Logged in and session exists
@@ -123,12 +146,12 @@
if ($timeline_array) {
switch ($this->input->post('award')) {
case 'dxcc': $result = write_dxcc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award')); break;
case 'was': $result = write_was_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award')); break;
case 'iota': $result = write_iota_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award')); break;
case 'waz': $result = write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award')); break;
case 'vucc': $result = write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award')); break;
case 'waja': $result = write_waja_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award')); break;
case 'dxcc': $result = write_dxcc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award'), $selectedyear, $onlynew); break;
case 'was': $result = write_was_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award'), $selectedyear, $onlynew); break;
case 'iota': $result = write_iota_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award'), $selectedyear, $onlynew); break;
case 'waz': $result = write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award'), $selectedyear, $onlynew); break;
case 'vucc': $result = write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award'), $selectedyear, $onlynew); break;
case 'waja': $result = write_waja_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $this->input->post('award'), $selectedyear, $onlynew); break;
}
}
else {
@@ -140,8 +163,9 @@
<?php
function write_dxcc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award) {
$i = count($timeline_array);
function write_dxcc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award, $selectedyear, $onlynew) {
$i = count($timeline_array); // General counter for all entries
$j = 1; // Separate counter for filtered rows (new stuff)
echo '<table style="width:100%" class="table table-sm timelinetable table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr>
@@ -158,8 +182,12 @@ function write_dxcc_timeline($timeline_array, $custom_date_format, $bandselect,
foreach ($timeline_array as $line) {
$date_as_timestamp = strtotime($line->date ?? '1970-01-01 00:00:00');
$entry_year = date('Y', $date_as_timestamp);
if ($onlynew == "1" && $entry_year != $selectedyear) {
continue;
}
echo '<tr>
<td>' . $i-- . '</td>
<td>' . (($onlynew == "1") ? $j++ : $i--) . '</td>
<td>' . date($custom_date_format, $date_as_timestamp) . '</td>
<td>' . $line->prefix . '</td>
<td>' . $line->col_country . '</td>
@@ -173,10 +201,11 @@ function write_dxcc_timeline($timeline_array, $custom_date_format, $bandselect,
echo '</tfoot></table></div>';
}
function write_waja_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award) {
function write_waja_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award, $selectedyear, $onlynew) {
$CI = &get_instance();
$CI->load->model("Waja");
$i = count($timeline_array);
$i = count($timeline_array); // General counter for all entries
$j = 1; // Separate counter for filtered rows (new stuff)
echo '<table style="width:100%" class="table table-sm timelinetable table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr>
@@ -190,8 +219,12 @@ function write_waja_timeline($timeline_array, $custom_date_format, $bandselect,
foreach ($timeline_array as $line) {
$date_as_timestamp = strtotime($line->date);
$entry_year = date('Y', $date_as_timestamp);
if ($onlynew == "1" && $entry_year != $selectedyear) {
continue;
}
echo '<tr>
<td>' . $i-- . '</td>
<td>' . (($onlynew == "1") ? $j++ : $i--) . '</td>
<td>' . date($custom_date_format, $date_as_timestamp) . '</td>
<td>' . $CI->Waja->jaPrefectures[$line->col_state] . ' ('.$line->col_state.')</td>
<td><a href=javascript:displayTimelineContacts("' . $line->col_state . '","'. $bandselect . '","'. $modeselect. '","' . $propmode . '","' . $award .'")>'.__("Show").'</a></td>
@@ -200,33 +233,42 @@ function write_waja_timeline($timeline_array, $custom_date_format, $bandselect,
echo '</tfoot></table></div>';
}
function write_was_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award) {
$i = count($timeline_array);
function write_was_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award, $selectedyear, $onlynew) {
$i = count($timeline_array); // General counter for all entries
$j = 1; // Separate counter for filtered rows (new stuff)
echo '<table style="width:100%" class="table table-sm timelinetable table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr>
<td>#</td>
<td>'.__("Date").'</td>
<td>'.__("State").'</td>
<td>'.__("Show QSO's").'</td>
<td>' . __("Date") . '</td>
<td>' . __("State") . '</td>
<td>' . __("Show QSO's") . '</td>
</tr>
</thead>
<tbody>';
foreach ($timeline_array as $line) {
$date_as_timestamp = strtotime($line->date);
$entry_year = date('Y', $date_as_timestamp);
if ($onlynew == "1" && $entry_year != $selectedyear) {
continue;
}
echo '<tr>
<td>' . $i-- . '</td>
<td>' . (($onlynew == "1") ? $j++ : $i--) . '</td>
<td>' . date($custom_date_format, $date_as_timestamp) . '</td>
<td>' . $line->col_state . '</td>
<td><a href=javascript:displayTimelineContacts("' . $line->col_state . '","'. $bandselect . '","'. $modeselect. '","' . $propmode . '","' . $award .'")>'.__("Show").'</a></td>
</tr>';
<td><a href=javascript:displayTimelineContacts("' . $line->col_state . '","' . $bandselect . '","' . $modeselect . '","' . $propmode . '","' . $award .'")>' . __("Show") . '</a></td>
</tr>';
}
echo '</tfoot></table></div>';
echo '</tbody></table>';
}
function write_iota_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award) {
$i = count($timeline_array);
function write_iota_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award, $selectedyear, $onlynew) {
$i = count($timeline_array); // General counter for all entries
$j = 1; // Separate counter for filtered rows (new stuff)
echo '<table style="width:100%" class="table table-sm timelinetable table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr>
@@ -242,8 +284,12 @@ function write_iota_timeline($timeline_array, $custom_date_format, $bandselect,
foreach ($timeline_array as $line) {
$date_as_timestamp = strtotime($line->date);
$entry_year = date('Y', $date_as_timestamp);
if ($onlynew == "1" && $entry_year != $selectedyear) {
continue;
}
echo '<tr>
<td>' . $i-- . '</td>
<td>' . (($onlynew == "1") ? $j++ : $i--) . '</td>
<td>' . date($custom_date_format, $date_as_timestamp) . '</td>
<td>' . $line->col_iota . '</td>
<td>' . $line->name . '</td>
@@ -254,8 +300,9 @@ function write_iota_timeline($timeline_array, $custom_date_format, $bandselect,
echo '</tfoot></table></div>';
}
function write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award) {
$i = count($timeline_array);
function write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode, $award, $selectedyear, $onlynew) {
$i = count($timeline_array); // General counter for all entries
$j = 1; // Separate counter for filtered rows (new stuff)
echo '<table style="width:100%" class="table table-sm timelinetable table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr>
@@ -269,8 +316,12 @@ function write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $
foreach ($timeline_array as $line) {
$date_as_timestamp = strtotime($line->date);
$entry_year = date('Y', $date_as_timestamp);
if ($onlynew == "1" && $entry_year != $selectedyear) {
continue;
}
echo '<tr>
<td>' . $i-- . '</td>
<td>' . (($onlynew == "1") ? $j++ : $i--) . '</td>
<td>' . date($custom_date_format, $date_as_timestamp) . '</td>
<td>' . $line->col_cqz . '</td>
<td><a href=javascript:displayTimelineContacts("' . $line->col_cqz . '","'. $bandselect . '","'. $modeselect. '","' . $propmode . '","' . $award .'")>'.__("Show").'</a></td>
@@ -279,8 +330,9 @@ function write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $
echo '</tfoot></table></div>';
}
function write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode,$award) {
$i = count($timeline_array);
function write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $propmode,$award, $selectedyear, $onlynew) {
$i = count($timeline_array); // General counter for all entries
$j = 1; // Separate counter for filtered rows (new stuff)
echo '<table style="width:100%" class="table table-sm timelinetable table-bordered table-hover table-striped table-condensed text-center">
<thead>
<tr>
@@ -295,8 +347,12 @@ function write_vucc_timeline($timeline_array, $custom_date_format, $bandselect,
foreach ($timeline_array as $line) {
$date_as_timestamp = strtotime($line['date']);
$entry_year = date('Y', $date_as_timestamp);
if ($onlynew == "1" && $entry_year != $selectedyear) {
continue;
}
echo '<tr>
<td>' . $i-- . '</td>
<td>' . (($onlynew == "1") ? $j++ : $i--) . '</td>
<td>' . date($custom_date_format, $date_as_timestamp) . '</td>
<td>' . date('H:i', $date_as_timestamp) . '</td>
<td>' . $line['gridsquare'] . '</td>