Add basic function to show activated grids
这个提交包含在:
父节点
f0054da867
当前提交
1fadec7e7b
共有 6 个文件被更改,包括 667 次插入 和 0 次删除
|
|
@ -0,0 +1,285 @@
|
|||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
|
||||
Activated_grids Controller
|
||||
|
||||
*/
|
||||
|
||||
class Activated_grids extends CI_Controller {
|
||||
|
||||
/*
|
||||
* TODO List
|
||||
* - Create index page
|
||||
* - Band page provide a band dropdown list
|
||||
* - Find somewhere in the main menu to add a button to it
|
||||
*/
|
||||
|
||||
|
||||
public function index() {
|
||||
// if there are no satellite QSOs redirect to band selection directly
|
||||
$this->load->model('logbook_model');
|
||||
$total_sat = $this->logbook_model->total_sat();
|
||||
if ($total_sat->num_rows() == 0) {
|
||||
redirect('activated_grids/band/2m');
|
||||
return;
|
||||
}
|
||||
|
||||
$data['page_title'] = "Activated Gridsquare Map";
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('activated_grids/main.php');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
public function satellites()
|
||||
{
|
||||
$this->load->model('activated_grids_model');
|
||||
|
||||
$data['page_title'] = "Satellite Activated Gridsquare Map";
|
||||
|
||||
|
||||
$array_grid_2char = array();
|
||||
$array_grid_4char = array();
|
||||
$array_grid_6char = array();
|
||||
|
||||
|
||||
$array_confirmed_grid_2char = array();
|
||||
$array_confirmed_grid_4char = array();
|
||||
$array_confirmed_grid_6char = array();
|
||||
|
||||
$grid_2char = "";
|
||||
$grid_4char = "";
|
||||
$grid_6char = "";
|
||||
|
||||
$grid_2char_confirmed = "";
|
||||
$grid_4char_confirmed = "";
|
||||
$grid_6char_confirmed = "";
|
||||
|
||||
|
||||
// Get Confirmed LOTW & Paper Activated Squares (non VUCC)
|
||||
$query = $this->activated_grids_model->get_activated_confirmed_sat_squares();
|
||||
|
||||
|
||||
if ($query && $query->num_rows() > 0)
|
||||
{
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
|
||||
$grid_2char_confirmed = strtoupper(substr($row->SAT_SQUARE,0,2));
|
||||
$grid_4char_confirmed = strtoupper(substr($row->SAT_SQUARE,0,4));
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
$grid_6char_confirmed = strtoupper(substr($row->SAT_SQUARE,0,6));
|
||||
}
|
||||
|
||||
// Check if 2 Char is in array
|
||||
if(!in_array($grid_2char_confirmed, $array_confirmed_grid_2char)){
|
||||
array_push($array_confirmed_grid_2char, $grid_2char_confirmed);
|
||||
}
|
||||
|
||||
|
||||
if(!in_array($grid_4char_confirmed, $array_confirmed_grid_4char)){
|
||||
array_push($array_confirmed_grid_4char, $grid_4char_confirmed);
|
||||
}
|
||||
|
||||
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
if(!in_array($grid_6char_confirmed, $array_confirmed_grid_6char)){
|
||||
array_push($array_confirmed_grid_6char, $grid_6char_confirmed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Get activated squares
|
||||
$query = $this->activated_grids_model->get_activated_sat_squares();
|
||||
|
||||
if ($query && $query->num_rows() > 0)
|
||||
{
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
|
||||
$grid_two = strtoupper(substr($row->SAT_SQUARE,0,2));
|
||||
$grid_four = strtoupper(substr($row->SAT_SQUARE,0,4));
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
$grid_six = strtoupper(substr($row->SAT_SQUARE,0,6));
|
||||
}
|
||||
|
||||
// Check if 2 Char is in array
|
||||
if(!in_array($grid_two, $array_grid_2char)){
|
||||
array_push($array_grid_2char, $grid_two);
|
||||
}
|
||||
|
||||
|
||||
if(!in_array($grid_four, $array_grid_4char)){
|
||||
array_push($array_grid_4char, $grid_four);
|
||||
}
|
||||
|
||||
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
if(!in_array($grid_six, $array_grid_6char)){
|
||||
array_push($array_grid_6char, $grid_six);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function js_str($s)
|
||||
{
|
||||
return '"' . addcslashes($s, "\0..\37\"\\") . '"';
|
||||
}
|
||||
|
||||
function js_array($array)
|
||||
{
|
||||
$temp = array_map('js_str', $array);
|
||||
return '[' . implode(',', $temp) . ']';
|
||||
}
|
||||
|
||||
|
||||
$data['grid_2char_confirmed'] = js_array($array_confirmed_grid_2char);
|
||||
$data['grid_4char_confirmed'] = js_array($array_confirmed_grid_4char);
|
||||
$data['grid_6char_confirmed'] = js_array($array_confirmed_grid_6char);
|
||||
|
||||
$data['grid_2char'] = js_array($array_grid_2char);
|
||||
$data['grid_4char'] = js_array($array_grid_4char);
|
||||
$data['grid_6char'] = js_array($array_grid_6char);
|
||||
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('activated_grids/index.php');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
|
||||
public function band($band)
|
||||
{
|
||||
$this->load->model('activated_grids_model');
|
||||
|
||||
$data['page_title'] = strtoupper($band)." Activated Gridsquare Map";
|
||||
|
||||
$array_grid_2char = array();
|
||||
$array_grid_4char = array();
|
||||
$array_grid_6char = array();
|
||||
|
||||
$array_grid_2char_confirmed = array();
|
||||
$array_grid_4char_confirmed = array();
|
||||
$array_grid_6char_confirmed = array();
|
||||
|
||||
$grid_2char = "";
|
||||
$grid_4char = "";
|
||||
$grid_6char = "";
|
||||
|
||||
$grid_2char_confirmed = "";
|
||||
$grid_4char_confirmed = "";
|
||||
$grid_6char_confirmed = "";
|
||||
|
||||
$query = $this->activated_grids_model->get_band_confirmed($band);
|
||||
|
||||
if ($query && $query->num_rows() > 0)
|
||||
{
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
$grid_2char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,2));
|
||||
$grid_4char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
$grid_6char_confirmed = strtoupper(substr($row->GRID_SQUARES,0,6));
|
||||
}
|
||||
|
||||
// Check if 2 Char is in array
|
||||
if(!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)){
|
||||
array_push($array_grid_2char_confirmed, $grid_2char_confirmed);
|
||||
}
|
||||
|
||||
if(!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)){
|
||||
array_push($array_grid_4char_confirmed, $grid_4char_confirmed);
|
||||
}
|
||||
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
if(!in_array($grid_6char_confirmed, $array_grid_6char_confirmed)){
|
||||
array_push($array_grid_6char_confirmed, $grid_6char_confirmed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->activated_grids_model->get_band($band);
|
||||
|
||||
if ($query && $query->num_rows() > 0)
|
||||
{
|
||||
foreach ($query->result() as $row)
|
||||
{
|
||||
|
||||
$grid_two = strtoupper(substr($row->GRID_SQUARES,0,2));
|
||||
$grid_four = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
$grid_six = strtoupper(substr($row->GRID_SQUARES,0,6));
|
||||
}
|
||||
|
||||
// Check if 2 Char is in array
|
||||
if(!in_array($grid_two, $array_grid_2char)){
|
||||
array_push($array_grid_2char, $grid_two);
|
||||
}
|
||||
|
||||
|
||||
if(!in_array($grid_four, $array_grid_4char)){
|
||||
array_push($array_grid_4char, $grid_four);
|
||||
}
|
||||
|
||||
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
if(!in_array($grid_six, $array_grid_6char)){
|
||||
array_push($array_grid_6char, $grid_six);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function js_str($s)
|
||||
{
|
||||
return '"' . addcslashes($s, "\0..\37\"\\") . '"';
|
||||
}
|
||||
|
||||
function js_array($array)
|
||||
{
|
||||
$temp = array_map('js_str', $array);
|
||||
return '[' . implode(',', $temp) . ']';
|
||||
}
|
||||
|
||||
$data['grid_2char_confirmed'] = js_array($array_grid_2char_confirmed);
|
||||
$data['grid_4char_confirmed'] = js_array($array_grid_4char_confirmed);
|
||||
$data['grid_6char_confirmed'] = js_array($array_grid_6char_confirmed);
|
||||
|
||||
$data['grid_2char'] = js_array($array_grid_2char);
|
||||
$data['grid_4char'] = js_array($array_grid_4char);
|
||||
$data['grid_6char'] = js_array($array_grid_6char);
|
||||
|
||||
$data['bands_available'] = js_array($this->config->item('bands_available'));
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('activated_grids/index.php');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
function search_band($band, $gridsquare){
|
||||
$this->load->model('activated_grids_model');
|
||||
header('Content-Type: application/json');
|
||||
$result = $this->activated_grids_model->search_band($band, $gridsquare);
|
||||
|
||||
echo $result;
|
||||
}
|
||||
|
||||
function search_sat($gridsquare){
|
||||
$this->load->model('activated_grids_model');
|
||||
header('Content-Type: application/json');
|
||||
$result = $this->activated_grids_model->search_sat($gridsquare);
|
||||
|
||||
echo $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
<?php
|
||||
|
||||
class Activated_grids_model extends CI_Model {
|
||||
|
||||
function get_activated_sat_squares() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->db->select('distinct substring(COL_MY_GRIDSQUARE,1,6) as SAT_SQUARE, COL_SAT_NAME', FALSE);
|
||||
// $this->db->where_in('station_id', $logbooks_locations_array);
|
||||
$this->db->where('COL_MY_GRIDSQUARE !=', '');
|
||||
$this->db->where('COL_SAT_NAME !=', '');
|
||||
|
||||
return $this->db->get($this->config->item('table_name'));
|
||||
}
|
||||
|
||||
function get_activated_confirmed_sat_squares() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT distinct substring(COL_MY_GRIDSQUARE,1,6) as SAT_SQUARE, COL_SAT_NAME FROM '
|
||||
. $this->config->item('table_name')
|
||||
. ' WHERE COL_MY_GRIDSQUARE != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_SENT = "Y" OR COL_QSL_SENT = "Y")';
|
||||
// . ' WHERE station_id in (' . $location_list . ') AND COL_MY_GRIDSQUARE != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_SENT = "Y" OR COL_QSL_SENT = "Y")';
|
||||
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
function get_confirmed_sat_vucc_squares() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT COL_VUCC_GRIDS, COL_SAT_NAME FROM '
|
||||
. $this->config->item('table_name')
|
||||
. ' WHERE station_id in (' . $location_list . ') AND COL_VUCC_GRIDS != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y") AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y")';
|
||||
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
function get_worked_sat_vucc_squares() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->db->select('COL_PRIMARY_KEY, COL_VUCC_GRIDS, COL_SAT_NAME', FALSE);
|
||||
$this->db->where_in('station_id', $logbooks_locations_array);
|
||||
$this->db->where('COL_VUCC_GRIDS !=', "");
|
||||
$this->db->where('COL_SAT_NAME !=', "");
|
||||
return $this->db->get($this->config->item('table_name'));
|
||||
}
|
||||
|
||||
function get_band($band) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->db->select('distinct substring(COL_GRIDSQUARE,1,6) as GRID_SQUARES, COL_BAND', FALSE);
|
||||
$this->db->where_in('station_id', $logbooks_locations_array);
|
||||
$this->db->where('COL_GRIDSQUARE !=', '');
|
||||
|
||||
if ($band != 'All') {
|
||||
$this->db->where('COL_BAND', $band);
|
||||
$this->db->where('COL_PROP_MODE !=', "SAT");
|
||||
$this->db->where('COL_PROP_MODE !=', "INTERNET");
|
||||
$this->db->where('COL_PROP_MODE !=', "ECH");
|
||||
$this->db->where('COL_PROP_MODE !=', "RPT");
|
||||
$this->db->where('COL_SAT_NAME =', "");
|
||||
}
|
||||
|
||||
return $this->db->get($this->config->item('table_name'));
|
||||
}
|
||||
|
||||
function get_band_confirmed($band) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,6) as GRID_SQUARES, COL_BAND FROM '
|
||||
.$this->config->item('table_name')
|
||||
.' WHERE station_id in ('
|
||||
.$location_list.') AND COL_GRIDSQUARE != ""';
|
||||
if ($band != 'All') {
|
||||
$sql .= ' AND COL_BAND = "' . $band
|
||||
.'"
|
||||
AND COL_PROP_MODE != "SAT"
|
||||
AND COL_PROP_MODE != "INTERNET"
|
||||
AND COL_PROP_MODE != "ECH"
|
||||
AND COL_PROP_MODE != "RPT"
|
||||
AND COL_SAT_NAME = ""';
|
||||
}
|
||||
|
||||
$sql .= ' AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y")';
|
||||
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
function search_band($band, $gridsquare) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT COL_CALL, COL_TIME_ON, COL_BAND, COL_MODE, COL_GRIDSQUARE, COL_VUCC_GRIDS FROM '
|
||||
.$this->config->item('table_name')
|
||||
.' WHERE station_id IN (' . $location_list . ') '
|
||||
. ' AND (COL_GRIDSQUARE LIKE "%'.$gridsquare.'%" or COL_VUCC_GRIDS LIKE "%'.$gridsquare.'%")';
|
||||
|
||||
if ($band != 'All') {
|
||||
$sql .= ' AND COL_BAND = "' . $band
|
||||
.'"
|
||||
AND COL_PROP_MODE != "SAT"
|
||||
AND COL_PROP_MODE != "INTERNET"
|
||||
AND COL_PROP_MODE != "ECH"
|
||||
AND COL_PROP_MODE != "RPT"
|
||||
AND COL_SAT_NAME = ""';
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
//print_r($result);
|
||||
return json_encode($result->result());
|
||||
}
|
||||
|
||||
function search_sat($gridsquare) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT COL_CALL, COL_TIME_ON, COL_BAND, COL_MODE, COL_SAT_NAME, COL_GRIDSQUARE, COL_VUCC_GRIDS FROM ' .
|
||||
$this->config->item('table_name').
|
||||
' WHERE station_id IN ('.$location_list. ')' .
|
||||
' AND (COL_GRIDSQUARE LIKE "%'.$gridsquare.'%" or COL_VUCC_GRIDS LIKE "%'.$gridsquare.'%")'.
|
||||
' AND COL_PROP_MODE = "SAT"';
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
//print_r($result);
|
||||
return json_encode($result->result());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<div class="container">
|
||||
|
||||
<br>
|
||||
|
||||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<?php if ($this->uri->segment(1) == "activated_grids" && $this->uri->segment(2) == "band") { ?>
|
||||
<form class="form-inline">
|
||||
<label class="my-1 mr-2" for="gridsquare_bands">Band Selection</label>
|
||||
<select class="custom-select my-1 mr-sm-2" id="gridsquare_bands"></select>
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if($this->session->flashdata('message')) { ?>
|
||||
<!-- Display Message -->
|
||||
<div class="alert-message error">
|
||||
<p><?php echo $this->session->flashdata('message'); ?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="gridsquare_map" style="width: 100%; height: 800px"></div>
|
||||
|
||||
<div class="container">
|
||||
<?php if ($this->uri->segment(2) == "satellites") { ?>
|
||||
<div class="alert alert-success" role="alert">
|
||||
Confirmed is Green | Activated but not confirmed is Red
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->uri->segment(2) == "band") { ?>
|
||||
<div class="alert alert-success" role="alert">
|
||||
Confirmed is Green | Activated but not confirmed is Red <br>
|
||||
[This map does not include satellite, internet or repeater QSOs]
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel"><span id="qso_count"></span> QSO<span id="gt1_qso"></span> in Square: <span id="square_number"></span></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<table id="grid_results" class="table table-sm">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col">Date/Time</th>
|
||||
<th scope="col">Callsign</th>
|
||||
<th scope="col">Mode</th>
|
||||
<th scope="col">Band</th>
|
||||
<th scope="col">Gridsquare</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<div class="container">
|
||||
|
||||
<br>
|
||||
|
||||
<?php if($this->session->flashdata('message')) { ?>
|
||||
<!-- Display Message -->
|
||||
<div class="alert-message error">
|
||||
<p><?php echo $this->session->flashdata('message'); ?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<nav class="nav">
|
||||
<a class="nav-link" href="<?php echo site_url('activated_grids/satellites'); ?>">Satellites</a>
|
||||
<a class="nav-link" href="<?php echo site_url('activated_grids/band/2m'); ?>">Band</a>
|
||||
</nav>
|
||||
</div>
|
||||
|
|
@ -1175,6 +1175,122 @@ $(document).ready(function(){
|
|||
</script>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->uri->segment(1) == "activated_grids") { ?>
|
||||
|
||||
<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.MaidenheadColoured.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
var layer = L.tileLayer('<?php echo $this->optionslib->get_option('map_tile_server');?>', {
|
||||
maxZoom: 18,
|
||||
attribution: '<?php echo $this->optionslib->get_option('map_tile_server_copyright');?>',
|
||||
id: 'mapbox.streets'
|
||||
});
|
||||
|
||||
|
||||
var map = L.map('gridsquare_map', {
|
||||
layers: [layer],
|
||||
center: [19, 0],
|
||||
zoom: 2
|
||||
});
|
||||
|
||||
var grid_two = <?php echo $grid_2char; ?>;
|
||||
var grid_four = <?php echo $grid_4char; ?>;
|
||||
var grid_six = <?php echo $grid_6char; ?>;
|
||||
|
||||
var grid_two_confirmed = <?php echo $grid_2char_confirmed; ?>;
|
||||
var grid_four_confirmed = <?php echo $grid_4char_confirmed; ?>;
|
||||
var grid_six_confirmed = <?php echo $grid_6char_confirmed; ?>;
|
||||
|
||||
var maidenhead = L.maidenhead().addTo(map);
|
||||
|
||||
map.on('click', onMapClick);
|
||||
|
||||
function onMapClick(event) {
|
||||
var LatLng = event.latlng;
|
||||
var lat = LatLng.lat;
|
||||
var lng = LatLng.lng;
|
||||
var locator = LatLng2Loc(lat,lng, 10);
|
||||
var loc_4char = locator.substring(0, 4);
|
||||
console.log(loc_4char);
|
||||
console.log(map.getZoom());
|
||||
|
||||
if(map.getZoom() > 2) {
|
||||
<?php if ($this->session->userdata('user_callsign')) { ?>
|
||||
var band = '';
|
||||
var search_type = "<?php echo $this->uri->segment(2); ?>";
|
||||
if(search_type == "satellites") {
|
||||
band = 'SAT';
|
||||
} else {
|
||||
band = "<?php echo $this->uri->segment(3); ?>";
|
||||
}
|
||||
$(".modal-body").empty();
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/awards/qso_details_ajax',
|
||||
type: 'post',
|
||||
data: {
|
||||
'Searchphrase': loc_4char,
|
||||
'Band': band,
|
||||
'Mode': 'All',
|
||||
'Type': 'VUCC'
|
||||
},
|
||||
success: function (html) {
|
||||
$(".modal-body").html(html);
|
||||
$(".modal-body table").addClass('table-sm');
|
||||
$(".modal-body h5").empty();
|
||||
var count = $('.table tr').length;
|
||||
count = count - 1;
|
||||
$('#qso_count').text(count);
|
||||
if (count > 1) {
|
||||
$('#gt1_qso').text("s");
|
||||
} else {
|
||||
$('#gt1_qso').text("");
|
||||
}
|
||||
|
||||
if (count > 0) {
|
||||
$('#square_number').text(loc_4char);
|
||||
$('#exampleModal').modal('show');
|
||||
$('[data-toggle="tooltip"]').tooltip({ boundary: 'window' });
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php } ?>
|
||||
}
|
||||
};
|
||||
|
||||
<?php if ($this->uri->segment(1) == "activated_grids" && $this->uri->segment(2) == "band") { ?>
|
||||
|
||||
var bands_available = <?php echo $bands_available; ?>;
|
||||
$('#gridsquare_bands').append('<option value="All">All</option>')
|
||||
$.each(bands_available, function(key, value) {
|
||||
$('#gridsquare_bands')
|
||||
.append($("<option></option>")
|
||||
.attr("value",value)
|
||||
.text(value));
|
||||
});
|
||||
|
||||
var num = "<?php echo $this->uri->segment(3);?>";
|
||||
$("#gridsquare_bands option").each(function(){
|
||||
if($(this).val()==num){ // EDITED THIS LINE
|
||||
$(this).attr("selected","selected");
|
||||
}
|
||||
});
|
||||
|
||||
$(function(){
|
||||
// bind change event to select
|
||||
$('#gridsquare_bands').on('change', function () {
|
||||
var url = $(this).val(); // get selected value
|
||||
if (url) { // require a URL
|
||||
window.location = "<?php echo site_url('activated_grids/band/');?>" + url
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->uri->segment(1) == "dayswithqso") { ?>
|
||||
<script src="<?php echo base_url(); ?>assets/js/chart.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/js/sections/dayswithqso.js"></script>
|
||||
|
|
|
|||
|
|
@ -86,6 +86,8 @@
|
|||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="<?php echo site_url('gridsquares');?>" title="Gridsquares">Gridsquares</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="<?php echo site_url('activated_grids');?>" title="Activated Gridsquares">Activated Gridsquares</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="<?php echo site_url('distances');?>" title="Distances">Distances Worked</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="<?php echo site_url('dayswithqso');?>" title="Days with QSOs">Days with QSOs</a>
|
||||
|
|
|
|||
正在加载…
在新工单中引用