[Timeline] Added VUCC as selection for award

这个提交包含在:
Andreas 2023-01-30 19:54:27 +01:00
父节点 89f55c7595
当前提交 dcdfd66a01
共有 4 个文件被更改,包括 193 次插入37 次删除

查看文件

@ -76,14 +76,14 @@ class Timeline extends CI_Controller {
}
public function details() {
$this->load->model('logbook_model');
$this->load->model('timeline_model');
$querystring = str_replace('"', "", $this->input->post("Querystring"));
$band = str_replace('"', "", $this->input->post("Band"));
$mode = str_replace('"', "", $this->input->post("Mode"));
$type = str_replace('"', "", $this->input->post("Type"));
$data['results'] = $this->logbook_model->timeline_qso_details($querystring, $band, $mode, $type);
$data['results'] = $this->timeline_model->timeline_qso_details($querystring, $band, $mode, $type);
switch($type) {
@ -100,6 +100,9 @@ class Timeline extends CI_Controller {
case 'waz' : $data['page_title'] = "Log View - WAZ";
$data['filter'] = "CQ zone ". $querystring;
break;
case 'vucc' : $data['page_title'] = "Log View - VUCC";
$data['filter'] = "Gridsquare ". $querystring;
break;
}
if ($band != "All") {

查看文件

@ -385,38 +385,6 @@ class Logbook_model extends CI_Model {
return $this->db->query($sql);
}
public function timeline_qso_details($querystring, $band, $mode, $type){
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
if ($band != 'All') {
if ($band == 'SAT') {
$this->db->where('col_prop_mode', $band);
} else {
$this->db->where('COL_PROP_MODE !=', 'SAT');
$this->db->where('col_band', $band);
}
}
if ($mode != 'All') {
$this->db->where('col_mode', $mode);
}
$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); break;
case 'iota': $this->db->where('COL_IOTA', $querystring); break;
case 'waz': $this->db->where('COL_CQZ', $querystring); break;
}
return $this->db->get($this->config->item('table_name'));
}
public function activator_details($call, $band, $leogeo){
$CI =& get_instance();
$CI->load->model('logbooks_model');

查看文件

@ -19,6 +19,7 @@ class Timeline_model extends CI_Model
case 'was': $result = $this->get_timeline_was($band, $mode, $location_list, $qsl, $lotw, $eqsl); break;
case 'iota': $result = $this->get_timeline_iota($band, $mode, $location_list, $qsl, $lotw, $eqsl); break;
case 'waz': $result = $this->get_timeline_waz($band, $mode, $location_list, $qsl, $lotw, $eqsl); break;
case 'vucc': $result = $this->get_timeline_vucc($band, $mode, $location_list, $qsl, $lotw, $eqsl); break;
}
return $result;
@ -179,4 +180,158 @@ class Timeline_model extends CI_Model
return $sql;
}
public function get_timeline_vucc3($band, $mode, $location_list, $qsl, $lotw, $eqsl) {
// $sql = "select min(date(COL_TIME_ON)) date, col_gridsquare from "
$sql = "select min(date(COL_TIME_ON)) date, upper(substring(col_gridsquare, 1, 4)) gridsquare from "
.$this->config->item('table_name'). " thcv
where station_id in (" . $location_list . ")";
if ($band != 'All') {
if ($band == 'SAT') {
$sql .= " and col_prop_mode ='" . $band . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'";
}
}
if ($mode != 'All') {
$sql .= " and col_mode ='" . $mode . "'";
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl);
$sql .= " and col_gridsquare <> '' group by upper(substring(col_gridsquare, 1, 4))
order by date desc";
$query = $this->db->query($sql);
$this->vucc_shit($band, $mode, $location_list, $qsl, $lotw, $eqsl);
return $query->result();
}
public function timeline_qso_details($querystring, $band, $mode, $type){
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
if ($band != 'All') {
if ($band == 'SAT') {
$this->db->where('col_prop_mode', $band);
} else {
$this->db->where('COL_PROP_MODE !=', 'SAT');
$this->db->where('col_band', $band);
}
}
if ($mode != 'All') {
$this->db->where('col_mode', $mode);
}
$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); 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;
}
return $this->db->get($this->config->item('table_name'));
}
public function get_timeline_vucc($band, $mode, $location_list, $qsl, $lotw, $eqsl) {
$timeline = array();
$col_gridsquare = $this->get_gridsquare($band, $mode, $location_list, $qsl, $lotw, $eqsl);
foreach ($col_gridsquare as $grid) {
$timeline[] = array(
'gridsquare' => $grid->gridsquare,
'date' => $grid->date);
}
$col_vucc_grids = $this->get_vucc_grids($band, $mode, $location_list, $qsl, $lotw, $eqsl);
foreach ($col_vucc_grids as $gridSplit) {
$grids = explode(",", $gridSplit->gridsquare);
foreach($grids as $key) {
$grid_four = strtoupper(substr(trim($key),0,4));
if (!array_search($grid_four, array_column($timeline, 'gridsquare'))) {
$timeline[] = array(
'gridsquare' => $grid_four,
'date' => $gridSplit->date);
}
}
}
usort($timeline, function($a, $b) {
return $b['date'] <=> $a['date'];
});
return $timeline;
}
public function get_gridsquare($band, $mode, $location_list, $qsl, $lotw, $eqsl) {
// $sql = "select min(date(COL_TIME_ON)) date, col_gridsquare from "
$sql = "select min(date(COL_TIME_ON)) date, upper(substring(col_gridsquare, 1, 4)) gridsquare from "
.$this->config->item('table_name'). " thcv
where station_id in (" . $location_list . ")";
if ($band != 'All') {
if ($band == 'SAT') {
$sql .= " and col_prop_mode ='" . $band . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'";
}
}
if ($mode != 'All') {
$sql .= " and col_mode ='" . $mode . "'";
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl);
$sql .= " and col_gridsquare <> '' group by upper(substring(col_gridsquare, 1, 4))
order by date desc";
$query = $this->db->query($sql);
return $query->result();
}
public function get_vucc_grids($band, $mode, $location_list, $qsl, $lotw, $eqsl) {
// $sql = "select min(date(COL_TIME_ON)) date, col_gridsquare from "
$sql = "select date(COL_TIME_ON) date, upper(col_vucc_grids) gridsquare from "
.$this->config->item('table_name'). " thcv
where station_id in (" . $location_list . ")";
if ($band != 'All') {
if ($band == 'SAT') {
$sql .= " and col_prop_mode ='" . $band . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'";
}
}
if ($mode != 'All') {
$sql .= " and col_mode ='" . $mode . "'";
}
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl);
$sql .= " and col_vucc_grids <> ''";
$query = $this->db->query($sql);
return $query->result();
}
}

查看文件

@ -65,12 +65,16 @@
Worked All Zones (WAZ)
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="awardradio" id="vucc" value="vucc" <?php if ($this->input->post('awardradio') == 'vucc') echo ' checked'?>>
<label class="form-check-label" for="vucc">
VHF / UHF Century Club (VUCC)
</label>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-md-1 control-label">Confirmation</div>
<div class="col-md-10">
<div class="col-md-3">
<div class="form-check-inline">
<input class="form-check-input" type="checkbox" name="qsl" value="1" id="qsl" <?php if ($this->input->post('qsl')) echo ' checked="checked"'; ?> >
<label class="form-check-label" for="qsl">QSL</label>
@ -114,6 +118,7 @@
case 'was': $result = write_was_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('awardradio')); break;
case 'iota': $result = write_iota_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('awardradio')); break;
case 'waz': $result = write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('awardradio')); break;
case 'vucc': $result = write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('awardradio')); break;
}
}
else {
@ -236,3 +241,28 @@ 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, $award) {
$i = count($timeline_array);
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>Gridsquare</td>
<td>Show QSOs</td>
</tr>
</thead>
<tbody>';
foreach ($timeline_array as $line) {
$date_as_timestamp = strtotime($line['date']);
echo '<tr>
<td>' . $i-- . '</td>
<td>' . date($custom_date_format, $date_as_timestamp) . '</td>
<td>' . $line['gridsquare'] . '</td>
<td><a href=javascript:displayTimelineContacts("' . $line['gridsquare'] . '","'. $bandselect . '","'. $modeselect . '","' . $award .'")>Show</a></td>
</tr>';
}
echo '</tfoot></table></div>';
}