diff --git a/application/controllers/Timeline.php b/application/controllers/Timeline.php index 3b8311420..24e2b78f7 100644 --- a/application/controllers/Timeline.php +++ b/application/controllers/Timeline.php @@ -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); } -} \ No newline at end of file +} diff --git a/application/models/Timeline_model.php b/application/models/Timeline_model.php index 3f96f7117..fb92cd1a5 100644 --- a/application/models/Timeline_model.php +++ b/application/models/Timeline_model.php @@ -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'); diff --git a/application/views/timeline/index.php b/application/views/timeline/index.php index cea5392a8..0fd2ac83a 100644 --- a/application/views/timeline/index.php +++ b/application/views/timeline/index.php @@ -46,6 +46,7 @@ +
@@ -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 ''; } +function write_waja_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $award) { + $CI = &get_instance(); + $CI->load->model("Waja"); + $i = count($timeline_array); + echo ' + + + + + + + + + '; + + foreach ($timeline_array as $line) { + $date_as_timestamp = strtotime($line->date); + echo ' + + + + + '; + } + echo '
#'.__("Date").''.__("Prefecture").''.__("Show QSO's").'
' . $i-- . '' . date($custom_date_format, $date_as_timestamp) . '' . $CI->Waja->jaPrefectures[$line->col_state] . 'col_state . '","'. $bandselect . '","'. $modeselect . '","' . $award .'")>'.__("Show").'
'; +} + function write_was_timeline($timeline_array, $custom_date_format, $bandselect, $modeselect, $award) { $i = count($timeline_array); echo '