mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Added Waja to Timeline
This commit is contained in:
@@ -104,6 +104,9 @@ class Timeline extends CI_Controller {
|
||||
case 'vucc' : $data['page_title'] = __("Log View")." - VUCC";
|
||||
$data['filter'] = "Gridsquare ". $querystring;
|
||||
break;
|
||||
case 'waja' : $data['page_title'] = __("Log View")." - WAJA";
|
||||
$data['filter'] = "WAJA ". $querystring;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($band != "All") {
|
||||
@@ -113,4 +116,4 @@ class Timeline extends CI_Controller {
|
||||
$this->load->view('timeline/details', $data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ class Timeline_model extends CI_Model
|
||||
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;
|
||||
case 'waja': $result = $this->get_timeline_waja($band, $mode, $location_list, $qsl, $lotw, $eqsl); break;
|
||||
}
|
||||
|
||||
return $result;
|
||||
@@ -55,6 +56,37 @@ class Timeline_model extends CI_Model
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
public function get_timeline_waja($band, $mode, $location_list, $qsl, $lotw, $eqsl) {
|
||||
$sql = "select min(date(COL_TIME_ON)) date, col_state 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 .= " and COL_DXCC = '339' and trim(coalesce(COL_STATE,'')) != '' ";
|
||||
|
||||
$sql .= $this->addQslToQuery($qsl, $lotw, $eqsl);
|
||||
|
||||
$sql .= " group by col_state
|
||||
order by date desc";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
public function get_timeline_was($band, $mode, $location_list, $qsl, $lotw, $eqsl) {
|
||||
$sql = "select min(date(COL_TIME_ON)) date, col_state from "
|
||||
.$this->config->item('table_name'). " thcv
|
||||
@@ -241,6 +273,7 @@ class Timeline_model extends CI_Model
|
||||
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); break;
|
||||
}
|
||||
$this->db->order_by('COL_TIME_ON', 'DESC');
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<option value="iota" <?php if ($this->input->post('award') == "iota") echo ' selected'; ?> ><?= __("Islands On The Air (IOTA)"); ?></option>
|
||||
<option value="waz" <?php if ($this->input->post('award') == "waz") echo ' selected'; ?> ><?= __("Worked All Zones (WAZ)"); ?></option>
|
||||
<option value="vucc" <?php if ($this->input->post('award') == "vucc") echo ' selected'; ?> ><?= __("VHF / UHF Century Club (VUCC)"); ?></option>
|
||||
<option value="waja" <?php if ($this->input->post('award') == "waja") echo ' selected'; ?> ><?= __("Worked All Japan (WAJA)"); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1 control-label"><?= __("Confirmation") ?></div>
|
||||
@@ -94,6 +95,7 @@
|
||||
case 'iota': $result = write_iota_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('award')); break;
|
||||
case 'waz': $result = write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('award')); break;
|
||||
case 'vucc': $result = write_vucc_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('award')); break;
|
||||
case 'waja': $result = write_waja_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $this->input->post('award')); break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -138,6 +140,33 @@ 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, $award) {
|
||||
$CI = &get_instance();
|
||||
$CI->load->model("Waja");
|
||||
$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>'.__("Prefecture").'</td>
|
||||
<td>'.__("Show QSO's").'</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>' . $CI->Waja->jaPrefectures[$line->col_state] . '</td>
|
||||
<td><a href=javascript:displayTimelineContacts("' . $line->col_state . '","'. $bandselect . '","'. $modeselect . '","' . $award .'")>'.__("Show").'</a></td>
|
||||
</tr>';
|
||||
}
|
||||
echo '</tfoot></table></div>';
|
||||
}
|
||||
|
||||
function write_was_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">
|
||||
|
||||
Reference in New Issue
Block a user