Merge pull request #2740 from phl0/removeOldMaps
这个提交包含在:
当前提交
1bf82c1496
共有 17 个文件被更改,包括 134 次插入 和 1521 次删除
|
|
@ -1,365 +0,0 @@
|
|||
<?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
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Load language files
|
||||
$this->lang->load(array(
|
||||
'gridsquares',
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
public function index() {
|
||||
// if there are no satellite QSOs redirect to band selection directly
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('bands');
|
||||
$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";
|
||||
$data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true);
|
||||
|
||||
$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)
|
||||
{
|
||||
|
||||
/* Handle VUCC squares */
|
||||
if (strpos($row->SAT_SQUARE, ",") > 0) {
|
||||
$subsquares = explode(",", $row->SAT_SQUARE);
|
||||
foreach ($subsquares as &$subsquare) {
|
||||
$grid_two = strtoupper(substr($subsquare,0,2));
|
||||
$grid_four = strtoupper(substr($subsquare,0,4));
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
$grid_six = strtoupper(substr($subsquare,0,6));
|
||||
}
|
||||
|
||||
// Check if 2 Char is in array
|
||||
if(!in_array($grid_two, $array_confirmed_grid_2char)){
|
||||
array_push($array_confirmed_grid_2char, $grid_two);
|
||||
}
|
||||
|
||||
if(!in_array($grid_four, $array_confirmed_grid_4char)){
|
||||
array_push($array_confirmed_grid_4char, $grid_four);
|
||||
}
|
||||
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
if(!in_array($grid_six, $array_confirmed_grid_6char)){
|
||||
array_push($array_confirmed_grid_6char, $grid_six);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$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)
|
||||
{
|
||||
|
||||
/* Handle VUCC squares */
|
||||
if (strpos($row->SAT_SQUARE, ",") > 0) {
|
||||
$subsquares = explode(",", $row->SAT_SQUARE);
|
||||
foreach ($subsquares as &$subsquare) {
|
||||
$grid_two = strtoupper(substr($subsquare,0,2));
|
||||
$grid_four = strtoupper(substr($subsquare,0,4));
|
||||
if ($this->config->item('map_6digit_grids')) {
|
||||
$grid_six = strtoupper(substr($subsquare,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
public function qso_details_ajax(){
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$searchphrase = str_replace('"', "", $this->input->post("Searchphrase"));
|
||||
$band = str_replace('"', "", $this->input->post("Band"));
|
||||
$mode = str_replace('"', "", $this->input->post("Mode"));
|
||||
|
||||
$data['results'] = $this->logbook_model->activated_grids_qso_details($searchphrase, $band, $mode);
|
||||
|
||||
// Render Page
|
||||
$data['page_title'] = "Log View";
|
||||
$data['filter'] = $searchphrase . " and band ".$band . " and mode ".$mode;
|
||||
$this->load->view('awards/details', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ class Gridmap extends CI_Controller {
|
|||
$this->load->model('gridmap_model');
|
||||
$this->load->model('stations');
|
||||
|
||||
$data['visitor'] = false;
|
||||
$data['homegrid'] = explode(',', $this->stations->find_gridsquare());
|
||||
|
||||
$data['modes'] = $this->gridmap_model->get_worked_modes();
|
||||
|
|
|
|||
|
|
@ -1,403 +0,0 @@
|
|||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
|
||||
Gridsquares Controller
|
||||
|
||||
*/
|
||||
|
||||
class Gridsquares 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
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Load language files
|
||||
$this->lang->load(array(
|
||||
'gridsquares',
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
public function index() {
|
||||
// if there are no satellite QSOs redirect to band selection directly
|
||||
$this->load->model('logbook_model');
|
||||
$this->load->model('bands');
|
||||
$total_sat = $this->logbook_model->total_sat();
|
||||
if ($total_sat->num_rows() == 0) {
|
||||
redirect('gridsquares/band/2m');
|
||||
return;
|
||||
}
|
||||
|
||||
$data['page_title'] = "Gridsquare Map";
|
||||
$data['sat_active'] = array_search("SAT", $this->bands->get_user_bands(), true);
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('gridsquares/main.php');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
public function satellites()
|
||||
{
|
||||
$this->load->model('gridsquares_model');
|
||||
|
||||
$data['page_title'] = "Satellite 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 Squares (non VUCC)
|
||||
$query = $this->gridsquares_model->get_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 worked squares
|
||||
$query = $this->gridsquares_model->get_worked_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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$query_vucc = $this->gridsquares_model->get_worked_sat_vucc_squares();
|
||||
|
||||
if ($query && $query_vucc->num_rows() > 0)
|
||||
{
|
||||
foreach ($query_vucc->result() as $row)
|
||||
{
|
||||
|
||||
$grids = explode(",", $row->COL_VUCC_GRIDS);
|
||||
|
||||
foreach($grids as $key) {
|
||||
$grid_two = strtoupper(substr($key,0,2));
|
||||
$grid_four = strtoupper(substr($key,0,4));
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Confirmed Squares
|
||||
$query_vucc = $this->gridsquares_model->get_confirmed_sat_vucc_squares();
|
||||
|
||||
if ($query && $query_vucc->num_rows() > 0)
|
||||
{
|
||||
foreach ($query_vucc->result() as $row)
|
||||
{
|
||||
|
||||
$grids = explode(",", $row->COL_VUCC_GRIDS);
|
||||
|
||||
foreach($grids as $key) {
|
||||
$grid_2char_confirmed = strtoupper(substr($key,0,2));
|
||||
$grid_4char_confirmed = strtoupper(substr($key,0,4));
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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('gridsquares/index.php');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
|
||||
public function band($band)
|
||||
{
|
||||
$this->load->model('gridsquares_model');
|
||||
|
||||
$data['page_title'] = strtoupper($band)." 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->gridsquares_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->gridsquares_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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
$query_vucc = $this->gridsquares_model->get_band_worked_vucc_squares($band);
|
||||
|
||||
if ($query && $query_vucc->num_rows() > 0)
|
||||
{
|
||||
foreach ($query_vucc->result() as $row)
|
||||
{
|
||||
|
||||
$grids = explode(",", $row->COL_VUCC_GRIDS);
|
||||
|
||||
foreach($grids as $key) {
|
||||
$grid_two = strtoupper(substr($key,0,2));
|
||||
$grid_four = strtoupper(substr($key,0,4));
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Confirmed Squares
|
||||
$query_vucc = $this->gridsquares_model->get_band_confirmed_vucc_squares($band);
|
||||
|
||||
if ($query && $query_vucc->num_rows() > 0)
|
||||
{
|
||||
foreach ($query_vucc->result() as $row)
|
||||
{
|
||||
|
||||
$grids = explode(",", $row->COL_VUCC_GRIDS);
|
||||
|
||||
foreach($grids as $key) {
|
||||
$grid_2char_confirmed = strtoupper(substr($key,0,2));
|
||||
$grid_4char_confirmed = strtoupper(substr($key,0,4));
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
$this->load->model('bands');
|
||||
$data['bands_available'] = js_array($this->bands->get_worked_bands());
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('gridsquares/index.php');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
function search_band($band, $gridsquare){
|
||||
$this->load->model('gridsquares_model');
|
||||
header('Content-Type: application/json');
|
||||
$result = $this->gridsquares_model->search_band($band, $gridsquare);
|
||||
|
||||
echo $result;
|
||||
}
|
||||
|
||||
function search_sat($gridsquare){
|
||||
$this->load->model('gridsquares_model');
|
||||
header('Content-Type: application/json');
|
||||
$result = $this->gridsquares_model->search_sat($gridsquare);
|
||||
|
||||
echo $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -115,11 +115,11 @@ class Visitor extends CI_Controller {
|
|||
|
||||
$this->load->model('dxcc');
|
||||
$dxcc = $this->dxcc->list_current();
|
||||
|
||||
|
||||
$current = $this->logbook_model->total_countries_current($logbooks_locations_array);
|
||||
|
||||
|
||||
$data['total_countries_needed'] = count($dxcc->result()) - $current;
|
||||
|
||||
|
||||
$this->load->view('visitor/layout/header', $data);
|
||||
$this->load->view('visitor/index');
|
||||
$this->load->view('visitor/layout/footer');
|
||||
|
|
@ -128,10 +128,10 @@ class Visitor extends CI_Controller {
|
|||
log_message('error', '[Visitor] XSS Attack detected on public_slug '. $public_slug);
|
||||
show_404('Unknown Public Page.');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function radio_display_component() {
|
||||
$this->load->model('cat');
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ class Visitor extends CI_Controller {
|
|||
|
||||
public function map() {
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
|
||||
$this->load->library('qra');
|
||||
|
||||
$slug = $this->security->xss_clean($this->uri->segment(3));
|
||||
|
|
@ -173,7 +173,7 @@ class Visitor extends CI_Controller {
|
|||
echo ",";
|
||||
}
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\"}";
|
||||
|
|
@ -190,10 +190,10 @@ class Visitor extends CI_Controller {
|
|||
if (count($grids) == 2) {
|
||||
$grid1 = $this->qra->qra2latlong(trim($grids[0]));
|
||||
$grid2 = $this->qra->qra2latlong(trim($grids[1]));
|
||||
|
||||
|
||||
$coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]);
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
|
||||
$stn_loc = $this->qra->get_midpoint($coords);
|
||||
}
|
||||
if (count($grids) == 4) {
|
||||
|
|
@ -201,20 +201,20 @@ class Visitor extends CI_Controller {
|
|||
$grid2 = $this->qra->qra2latlong(trim($grids[1]));
|
||||
$grid3 = $this->qra->qra2latlong(trim($grids[2]));
|
||||
$grid4 = $this->qra->qra2latlong(trim($grids[3]));
|
||||
|
||||
|
||||
$coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]);
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
$coords[]=array('lat' => $grid3[0],'lng'=> $grid3[1]);
|
||||
$coords[]=array('lat' => $grid4[0],'lng'=> $grid4[1]);
|
||||
|
||||
$coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]);
|
||||
$coords[]=array('lat' => $grid3[0],'lng'=> $grid3[1]);
|
||||
$coords[]=array('lat' => $grid4[0],'lng'=> $grid4[1]);
|
||||
|
||||
$stn_loc = $this->qra->get_midpoint($coords);
|
||||
}
|
||||
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
}
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
|
||||
if($row->COL_SAT_NAME != null) {
|
||||
echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."<br />Date/Time: ".$row->COL_TIME_ON."<br />SAT: ".$row->COL_SAT_NAME."<br />Mode: ";
|
||||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\"}";
|
||||
|
|
@ -223,9 +223,9 @@ class Visitor extends CI_Controller {
|
|||
echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE;
|
||||
echo "\",\"label\":\"".$row->COL_CALL."\"}";
|
||||
}
|
||||
|
||||
|
||||
$count++;
|
||||
|
||||
|
||||
} else {
|
||||
if($count != 1) {
|
||||
echo ",";
|
||||
|
|
@ -261,7 +261,7 @@ class Visitor extends CI_Controller {
|
|||
{
|
||||
// Get associated station locations for mysql queries
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($logbook_id);
|
||||
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
show_404('Empty Logbook');
|
||||
}
|
||||
|
|
@ -271,7 +271,7 @@ class Visitor extends CI_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
$this->load->model('gridsquares_model');
|
||||
$this->load->model('gridmap_model');
|
||||
|
||||
$data['page_title'] = "Satellite Gridsquare Map";
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ class Visitor extends CI_Controller {
|
|||
|
||||
|
||||
// Get Confirmed LoTW & Paper Squares (non VUCC)
|
||||
$query = $this->gridsquares_model->get_confirmed_sat_squares($logbooks_locations_array);
|
||||
$query = $this->gridmap_model->get_band_confirmed('SAT', 'All', 'false', 'true', 'false', 'All', $logbooks_locations_array);
|
||||
|
||||
|
||||
if ($query && $query->num_rows() > 0)
|
||||
|
|
@ -303,26 +303,26 @@ class Visitor extends CI_Controller {
|
|||
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));
|
||||
$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->SAT_SQUARE,0,6));
|
||||
$grid_6char_confirmed = strtoupper(substr($row->GRID_SQUARES,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);
|
||||
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);
|
||||
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);
|
||||
array_push($array_confirmed_grid_6char, $grid_6char_confirmed);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -331,33 +331,33 @@ class Visitor extends CI_Controller {
|
|||
}
|
||||
|
||||
// Get worked squares
|
||||
$query = $this->gridsquares_model->get_worked_sat_squares($logbooks_locations_array);
|
||||
$query = $this->gridmap_model->get_band('SAT', 'All', 'false', 'true', 'false', 'All', $logbooks_locations_array);
|
||||
|
||||
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));
|
||||
$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->SAT_SQUARE,0,6));
|
||||
$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);
|
||||
array_push($array_grid_2char, $grid_two);
|
||||
}
|
||||
|
||||
|
||||
if(!in_array($grid_four, $array_grid_4char)){
|
||||
array_push($array_grid_4char, $grid_four);
|
||||
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);
|
||||
array_push($array_grid_6char, $grid_six);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -365,7 +365,7 @@ class Visitor extends CI_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
$query_vucc = $this->gridsquares_model->get_worked_sat_vucc_squares($logbooks_locations_array);
|
||||
$query_vucc = $this->gridmap_model->get_band_worked_vucc_squares('SAT', 'All', 'false', 'true', 'false', 'All', $logbooks_locations_array);
|
||||
|
||||
if ($query && $query_vucc->num_rows() > 0)
|
||||
{
|
||||
|
|
@ -374,25 +374,25 @@ class Visitor extends CI_Controller {
|
|||
|
||||
$grids = explode(",", $row->COL_VUCC_GRIDS);
|
||||
|
||||
foreach($grids as $key) {
|
||||
foreach($grids as $key) {
|
||||
$grid_two = strtoupper(substr($key,0,2));
|
||||
$grid_four = strtoupper(substr($key,0,4));
|
||||
|
||||
// Check if 2 Char is in array
|
||||
if(!in_array($grid_two, $array_grid_2char)){
|
||||
array_push($array_grid_2char, $grid_two);
|
||||
array_push($array_grid_2char, $grid_two);
|
||||
}
|
||||
|
||||
|
||||
if(!in_array($grid_four, $array_grid_4char)){
|
||||
array_push($array_grid_4char, $grid_four);
|
||||
array_push($array_grid_4char, $grid_four);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Confirmed Squares
|
||||
$query_vucc = $this->gridsquares_model->get_confirmed_sat_vucc_squares($logbooks_locations_array);
|
||||
$query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares('SAT', 'All', 'false', 'true', 'false', 'All', $logbooks_locations_array);
|
||||
|
||||
if ($query && $query_vucc->num_rows() > 0)
|
||||
{
|
||||
|
|
@ -401,18 +401,18 @@ class Visitor extends CI_Controller {
|
|||
|
||||
$grids = explode(",", $row->COL_VUCC_GRIDS);
|
||||
|
||||
foreach($grids as $key) {
|
||||
foreach($grids as $key) {
|
||||
$grid_2char_confirmed = strtoupper(substr($key,0,2));
|
||||
$grid_4char_confirmed = strtoupper(substr($key,0,4));
|
||||
|
||||
// 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);
|
||||
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);
|
||||
array_push($array_confirmed_grid_4char, $grid_4char_confirmed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -439,9 +439,19 @@ class Visitor extends CI_Controller {
|
|||
$data['grid_4char'] = js_array($array_grid_4char);
|
||||
$data['grid_6char'] = js_array($array_grid_6char);
|
||||
|
||||
$data['homegrid'] = 'JO31OL';
|
||||
$data['layer'] = $this->optionslib->get_option('option_map_tile_server');
|
||||
$data['attribution'] = $this->optionslib->get_option('option_map_tile_server_copyright');
|
||||
|
||||
$data['gridsquares_gridsquares'] = lang('gridsquares_gridsquares');
|
||||
$data['gridsquares_gridsquares_confirmed'] = lang('gridsquares_gridsquares_confirmed');
|
||||
$data['gridsquares_gridsquares_not_confirmed'] = lang('gridsquares_gridsquares_not_confirmed');
|
||||
$data['gridsquares_gridsquares_total_worked'] = lang('gridsquares_gridsquares_total_worked');
|
||||
|
||||
$data['visitor'] = true;
|
||||
|
||||
$this->load->view('visitor/layout/header', $data);
|
||||
$this->load->view('gridsquares/index');
|
||||
$this->load->view('gridmap/index', $data);
|
||||
$this->load->view('visitor/layout/footer');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,146 +0,0 @@
|
|||
<?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;
|
||||
}
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
$sql = 'SELECT DISTINCT station_gridsquare AS SAT_SQUARE FROM '
|
||||
. 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id '
|
||||
. 'WHERE station_profile.station_gridsquare != "" AND '.$this->config->item('table_name').'.COL_SAT_NAME != ""'
|
||||
. ' AND station_profile.station_id in ('.$location_list.')';
|
||||
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
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 station_gridsquare AS SAT_SQUARE FROM '
|
||||
. 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id '
|
||||
. 'WHERE station_profile.station_gridsquare != "" AND '.$this->config->item('table_name').'.COL_SAT_NAME != "" '
|
||||
. 'AND (COL_LOTW_QSL_SENT = "Y" OR COL_QSL_SENT = "Y")'
|
||||
. ' AND station_profile.station_id in ('.$location_list.')';
|
||||
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT DISTINCT station_gridsquare AS GRID_SQUARES, COL_BAND FROM '
|
||||
. 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id '
|
||||
. 'WHERE station_profile.station_gridsquare != "" '
|
||||
. ' AND station_profile.station_id in ('.$location_list.')';
|
||||
|
||||
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 = "" ';
|
||||
}
|
||||
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
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 station_gridsquare AS GRID_SQUARES, COL_BAND FROM '
|
||||
. 'station_profile JOIN '.$this->config->item('table_name').' on '.$this->config->item('table_name').'.station_id = station_profile.station_id '
|
||||
. 'WHERE station_profile.station_gridsquare != "" '
|
||||
. ' AND station_profile.station_id in ('.$location_list.')';
|
||||
|
||||
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_SENT = "Y" OR COL_QSL_SENT = "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_MY_GRIDSQUARE 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_MY_GRIDSQUARE LIKE "%'.$gridsquare.'%")'.
|
||||
' AND COL_PROP_MODE = "SAT"';
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
//print_r($result);
|
||||
return json_encode($result->result());
|
||||
}
|
||||
}
|
||||
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
class Gridmap_model extends CI_Model {
|
||||
|
||||
function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $sat) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $sat, $logbooks_locations_array = NULL) {
|
||||
if ($logbooks_locations_array == NULL) {
|
||||
$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;
|
||||
|
|
@ -40,10 +42,12 @@ class Gridmap_model extends CI_Model {
|
|||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
function get_band($band, $mode, $qsl, $lotw, $eqsl, $sat) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
function get_band($band, $mode, $qsl, $lotw, $eqsl, $sat, $logbooks_locations_array = NULL) {
|
||||
if ($logbooks_locations_array == NULL) {
|
||||
$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;
|
||||
|
|
@ -76,10 +80,12 @@ class Gridmap_model extends CI_Model {
|
|||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat, $logbooks_locations_array = NULL) {
|
||||
if ($logbooks_locations_array == NULL) {
|
||||
$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;
|
||||
|
|
@ -112,10 +118,12 @@ class Gridmap_model extends CI_Model {
|
|||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat, $logbooks_locations_array = NULL) {
|
||||
if ($logbooks_locations_array == NULL) {
|
||||
$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;
|
||||
|
|
@ -223,4 +231,4 @@ class Gridmap_model extends CI_Model {
|
|||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,265 +0,0 @@
|
|||
<?php
|
||||
|
||||
class Gridsquares_model extends CI_Model {
|
||||
|
||||
function get_worked_sat_squares($StationLocationsArray = null) {
|
||||
if($StationLocationsArray == null) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
$this->db->select('distinct substring(COL_GRIDSQUARE,1,6) as SAT_SQUARE, COL_SAT_NAME', FALSE);
|
||||
$this->db->where_in('station_id', $logbooks_locations_array);
|
||||
$this->db->where('COL_GRIDSQUARE !=', '');
|
||||
$this->db->where('COL_SAT_NAME !=', '');
|
||||
|
||||
return $this->db->get($this->config->item('table_name'));
|
||||
}
|
||||
|
||||
function get_confirmed_sat_squares($StationLocationsArray = null) {
|
||||
if($StationLocationsArray == null) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,6) as SAT_SQUARE, COL_SAT_NAME FROM '
|
||||
. $this->config->item('table_name')
|
||||
. ' WHERE station_id in (' . $location_list . ') AND COL_GRIDSQUARE != "" AND COL_SAT_NAME != "" AND (COL_LOTW_QSL_RCVD = "Y" OR COL_QSL_RCVD = "Y")';
|
||||
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
function get_confirmed_sat_vucc_squares($StationLocationsArray = null) {
|
||||
if($StationLocationsArray == null) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
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($StationLocationsArray = null) {
|
||||
if($StationLocationsArray == null) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
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, $StationLocationsArray = null) {
|
||||
if($StationLocationsArray == null) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
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, $StationLocationsArray = null) {
|
||||
if($StationLocationsArray == null) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
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 get_band_worked_vucc_squares($band, $StationLocationsArray = null) {
|
||||
if($StationLocationsArray == null) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->db->select('distinct COL_VUCC_GRIDS, COL_BAND', FALSE);
|
||||
$this->db->where_in('station_id', $logbooks_locations_array);
|
||||
$this->db->where('COL_VUCC_GRIDS !=', '');
|
||||
|
||||
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_vucc_squares($band, $StationLocationsArray = null) {
|
||||
if($StationLocationsArray == null) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT distinct COL_VUCC_GRIDS, COL_BAND FROM '
|
||||
.$this->config->item('table_name')
|
||||
.' WHERE station_id in ('
|
||||
.$location_list.') AND COL_VUCC_GRIDS != ""';
|
||||
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, $StationLocationsArray = null) {
|
||||
if($StationLocationsArray == null) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
$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, $StationLocationsArray = null) {
|
||||
if($StationLocationsArray == null) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
} else {
|
||||
$logbooks_locations_array = $StationLocationsArray;
|
||||
}
|
||||
$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());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
<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="d-flex align-items-center">
|
||||
<label class="my-1 me-2" for="gridsquare_bands"><?php echo lang('gen_band_selection'); ?></label>
|
||||
<select class="form-select my-1 me-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">
|
||||
<?php echo lang('gridsquares_confirmed_is_green'); ?> <span id="confirmed_grids"></span>| <?php echo lang('gridsquares_activated_but_not_confirmed_is_red'); ?> <span id="activated_grids"></span>|<span id="sum_grids"></span><br>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->uri->segment(2) == "band") { ?>
|
||||
<div class="alert alert-success" role="alert">
|
||||
<?php echo lang('gridsquares_confirmed_is_green'); ?> <span id="confirmed_grids"></span>| <?php echo lang('gridsquares_activated_but_not_confirmed_is_red'); ?> <span id="activated_grids"></span>|<span id="sum_grids"></span><br>
|
||||
[<?php echo lang('gridsquares_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> from Square: <span id="square_number"></span></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
|
||||
</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-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<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">
|
||||
<?php if ($sat_active) { ?>
|
||||
<a class="nav-link" href="<?php echo site_url('activated_grids/satellites'); ?>">Satellites</a>
|
||||
<?php } ?>
|
||||
<a class="nav-link" href="<?php echo site_url('activated_grids/band/2m'); ?>">Band</a>
|
||||
</nav>
|
||||
</div>
|
||||
|
|
@ -46,6 +46,7 @@
|
|||
|
||||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<?php if ($visitor == false) { ?>
|
||||
<form class="d-flex align-items-center">
|
||||
<label class="my-1 me-2" for="band"><?php echo lang('gridsquares_band'); ?></label>
|
||||
<select class="form-select my-1 me-sm-2 w-auto" id="band">
|
||||
|
|
@ -111,6 +112,7 @@
|
|||
<button id="plot" type="button" name="plot" class="btn btn-primary me-1 ld-ext-right ld-ext-right-plot" onclick="gridPlot(this.form)"><?php echo lang('gridsquares_button_plot'); ?><div class="ld ld-ring ld-spin"></div></button>
|
||||
<button id="clear" type="button" name="clear" class="btn btn-primary me-1 ld-ext-right ld-ext-right-clear" onclick="clearMarkers()"><?php echo lang('gridsquares_button_clear_markers'); ?><div class="ld ld-ring ld-spin"></div></button>
|
||||
</form>
|
||||
<?php } ?>
|
||||
|
||||
<?php if($this->session->flashdata('message')) { ?>
|
||||
<!-- Display Message -->
|
||||
|
|
@ -135,16 +137,22 @@
|
|||
<div class="cohidden"><?php echo lang('gen_hamradio_bearing')?>: </div>
|
||||
<div class="cohidden col-auto text-success fw-bold" id="bearing"></div>
|
||||
</div>
|
||||
<script>var gridsquaremap = true;
|
||||
<script>
|
||||
var gridsquaremap = true;
|
||||
var type = "worked";
|
||||
<?php if ($visitor == true) { ?>
|
||||
var visitor = true;
|
||||
<?php } else { ?>
|
||||
var visitor = false;
|
||||
<?php } ?>
|
||||
<?php
|
||||
echo 'var jslayer ="' . $layer .'";';
|
||||
echo "var jslayer = \"" . $layer ."\";\n";
|
||||
echo "var jsattribution ='" . $attribution . "';";
|
||||
echo "var homegrid ='" . strtoupper($homegrid[0]) . "';";
|
||||
echo "var homegrid = \"" . strtoupper($homegrid[0]) . "\";\n";
|
||||
|
||||
echo 'var gridsquares_gridsquares = "' . $gridsquares_gridsquares . '";';
|
||||
echo 'var gridsquares_gridsquares_confirmed = "' . $gridsquares_gridsquares_confirmed . '";';
|
||||
echo 'var gridsquares_gridsquares_not_confirmed = "' . $gridsquares_gridsquares_not_confirmed . '";';
|
||||
echo 'var gridsquares_gridsquares_total_worked = "' . $gridsquares_gridsquares_total_worked . '";';
|
||||
echo "var gridsquares_gridsquares = \"" . $gridsquares_gridsquares . "\";\n";
|
||||
echo "var gridsquares_gridsquares_confirmed = \"" . $gridsquares_gridsquares_confirmed . "\";\n";
|
||||
echo "var gridsquares_gridsquares_not_confirmed = \"" . $gridsquares_gridsquares_not_confirmed . "\";\n";
|
||||
echo "var gridsquares_gridsquares_total_worked = \"" . $gridsquares_gridsquares_total_worked . "\";\n";
|
||||
?>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,69 +0,0 @@
|
|||
<div class="container">
|
||||
|
||||
<br>
|
||||
|
||||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<?php if ($this->uri->segment(1) == "gridsquares" && $this->uri->segment(2) == "band") { ?>
|
||||
<form class="d-flex align-items-center">
|
||||
<label class="my-1 me-2" for="gridsquare_bands"><?php echo lang('gen_band_selection'); ?></label>
|
||||
<select class="form-select my-1 me-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">
|
||||
<?php echo lang('gridsquares_confirmed_is_green'); ?> <span id="confirmed_grids"></span>| <?php echo lang('gridsquares_worked_but_not_confirmed_is_red'); ?> <span id="worked_grids"></span>|<span id="sum_grids"></span>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($this->uri->segment(2) == "band") { ?>
|
||||
<div class="alert alert-success" role="alert">
|
||||
<?php echo lang('gridsquares_confirmed_is_green'); ?> <span id="confirmed_grids"></span>| <?php echo lang('gridsquares_worked_but_not_confirmed_is_red'); ?> <span id="worked_grids"></span>|<span id="sum_grids"></span><br>
|
||||
[<?php echo lang('gridsquares_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="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
|
||||
</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-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<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">
|
||||
<?php if ($sat_active) { ?>
|
||||
<a class="nav-link" href="<?php echo site_url('gridsquares/satellites'); ?>">Satellites</a>
|
||||
<?php } ?>
|
||||
<a class="nav-link" href="<?php echo site_url('gridsquares/band/All'); ?>">Band</a>
|
||||
</nav>
|
||||
</div>
|
||||
|
|
@ -149,7 +149,6 @@ function load_was_map() {
|
|||
<script>
|
||||
var position;
|
||||
function getLocation() {
|
||||
console.log("'clicked");
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(showPosition);
|
||||
} else {
|
||||
|
|
@ -1588,8 +1587,6 @@ $(document).ready(function(){
|
|||
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')) { ?>
|
||||
|
|
@ -1731,8 +1728,6 @@ $(document).ready(function(){
|
|||
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')) { ?>
|
||||
|
|
|
|||
|
|
@ -103,73 +103,8 @@
|
|||
var grid_four_confirmed_count = grid_four_confirmed.length;
|
||||
var grid_six_confirmed_count = grid_six_confirmed.length;
|
||||
|
||||
if (grid_four_confirmed_count > 0) {
|
||||
var span = document.getElementById('confirmed_grids');
|
||||
span.innerText = span.textContent = '('+grid_four_confirmed_count+' grid squares) ';
|
||||
}
|
||||
if ((grid_four_count-grid_four_confirmed_count) > 0) {
|
||||
var span = document.getElementById('worked_grids');
|
||||
span.innerText = span.textContent = '('+(grid_four_count-grid_four_confirmed_count)+' grid squares) ';
|
||||
}
|
||||
var span = document.getElementById('sum_grids');
|
||||
span.innerText = span.textContent = ' Total Count: '+grid_four_count+' grid squares';
|
||||
|
||||
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-bs-toggle="tooltip"]').tooltip({ boundary: 'window' });
|
||||
}
|
||||
}
|
||||
});
|
||||
<?php } ?>
|
||||
}
|
||||
};
|
||||
|
||||
<?php if ($this->uri->segment(1) == "gridsquares" && $this->uri->segment(2) == "band") { ?>
|
||||
|
||||
var bands_available = <?php echo $bands_available; ?>;
|
||||
|
|
@ -201,6 +136,7 @@
|
|||
<?php } ?>
|
||||
<?php } ?>
|
||||
</script>
|
||||
<script type="text/javascript" src="<?php echo base_url();?>assets/js/sections/gridmap.js?"></script>
|
||||
<?php if ($this->CI->public_search_enabled($slug) || $this->session->userdata('user_type') >= 2) { ?>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/datatables.min.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/dataTables.buttons.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ L.Maidenhead = L.LayerGroup.extend({
|
|||
var lat_cor = new Array(0, 8, 8, 8, 2.5, 2.2, 6, 8, 8, 8, 1.4, 2.5, 3, 3.5, 4, 4, 3.5, 3.5, 3, 1.8, 1.6); // Used for gridsquare text offset
|
||||
var bounds = map.getBounds();
|
||||
var zoom = map.getZoom();
|
||||
console.log(zoom);
|
||||
var unit = d3[zoom];
|
||||
var lcor = lat_cor[zoom];
|
||||
var w = bounds.getWest();
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ L.Maidenhead = L.LayerGroup.extend({
|
|||
var lat_cor = new Array(0, 8, 8, 8, 2.5, 2.2, 6, 8, 8, 8, 1.4, 2.5, 3, 3.5, 4, 4, 3.5, 3.5, 3, 1.8, 1.6); // Used for gridsquare text offset
|
||||
var bounds = map.getBounds();
|
||||
var zoom = map.getZoom();
|
||||
console.log(zoom);
|
||||
var unit = d3[zoom];
|
||||
var lcor = lat_cor[zoom];
|
||||
var w = bounds.getWest();
|
||||
|
|
|
|||
|
|
@ -8,16 +8,18 @@ $('#band').change(function(){
|
|||
});
|
||||
|
||||
var map;
|
||||
var grid_two = '';
|
||||
var grid_four = '';
|
||||
var grid_six = '';
|
||||
var grid_two_confirmed = '';
|
||||
var grid_four_confirmed = '';
|
||||
var grid_six_confirmed = '';
|
||||
if (typeof(visitor) !== 'undefined' && visitor != true) {
|
||||
var grid_two = '';
|
||||
var grid_four = '';
|
||||
var grid_six = '';
|
||||
var grid_two_confirmed = '';
|
||||
var grid_four_confirmed = '';
|
||||
var grid_six_confirmed = '';
|
||||
}
|
||||
|
||||
function gridPlot(form) {
|
||||
function gridPlot(form, visitor) {
|
||||
$(".ld-ext-right-plot").addClass('running');
|
||||
$(".ld-ext-right-plot").prop('disabled', true);
|
||||
$(".ld-ext-right-plot").prop('disabled', true);
|
||||
$('#plot').prop("disabled", true);
|
||||
// If map is already initialized
|
||||
var container = L.DomUtil.get('gridsquare_map');
|
||||
|
|
@ -36,6 +38,7 @@ function gridPlot(form) {
|
|||
ajax_url = site_url + '/gridmap/getGridsjs';
|
||||
}
|
||||
|
||||
if (visitor != true) {
|
||||
$.ajax({
|
||||
url: ajax_url,
|
||||
type: 'post',
|
||||
|
|
@ -52,12 +55,24 @@ function gridPlot(form) {
|
|||
$(".ld-ext-right-plot").removeClass('running');
|
||||
$(".ld-ext-right-plot").prop('disabled', false);
|
||||
$('#plot').prop("disabled", false);
|
||||
grid_two = data.grid_2char;
|
||||
grid_two = data.grid_2char;
|
||||
grid_four = data.grid_4char;
|
||||
grid_six = data.grid_6char;
|
||||
grid_two_confirmed = data.grid_2char_confirmed;
|
||||
grid_four_confirmed = data.grid_4char_confirmed;
|
||||
grid_six_confirmed = data.grid_6char_confirmed;
|
||||
plot(visitor, grid_two, grid_four, grid_six, grid_two_confirmed, grid_four_confirmed, grid_six_confirmed);
|
||||
|
||||
},
|
||||
error: function (data) {
|
||||
},
|
||||
});
|
||||
} else {
|
||||
plot(visitor, grid_two, grid_four, grid_six, grid_two_confirmed, grid_four_confirmed, grid_six_confirmed);
|
||||
};
|
||||
}
|
||||
|
||||
function plot(visitor, grid_two, grid_four, grid_six, grid_two_confirmed, grid_four_confirmed, grid_six_confirmed) {
|
||||
var layer = L.tileLayer(jslayer, {
|
||||
maxZoom: 12,
|
||||
attribution: jsattribution,
|
||||
|
|
@ -75,13 +90,15 @@ function gridPlot(form) {
|
|||
},
|
||||
});
|
||||
|
||||
var printer = L.easyPrint({
|
||||
tileLayer: layer,
|
||||
sizeModes: ['Current'],
|
||||
filename: 'myMap',
|
||||
exportOnly: true,
|
||||
hideControlContainer: true
|
||||
}).addTo(map);
|
||||
if (visitor != true) {
|
||||
var printer = L.easyPrint({
|
||||
tileLayer: layer,
|
||||
sizeModes: ['Current'],
|
||||
filename: 'myMap',
|
||||
exportOnly: true,
|
||||
hideControlContainer: true
|
||||
}).addTo(map);
|
||||
}
|
||||
|
||||
/*Legend specific*/
|
||||
var legend = L.control({ position: "topright" });
|
||||
|
|
@ -98,13 +115,10 @@ function gridPlot(form) {
|
|||
legend.addTo(map);
|
||||
|
||||
var maidenhead = L.maidenhead().addTo(map);
|
||||
map.on('mousemove', onMapMove);
|
||||
map.on('click', onMapClick);
|
||||
|
||||
},
|
||||
error: function (data) {
|
||||
},
|
||||
});
|
||||
if (visitor != true) {
|
||||
map.on('mousemove', onMapMove);
|
||||
map.on('click', onMapClick);
|
||||
}
|
||||
}
|
||||
|
||||
function spawnGridsquareModal(loc_4char) {
|
||||
|
|
@ -174,5 +188,5 @@ function clearMarkers() {
|
|||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
gridPlot(this.form);
|
||||
gridPlot(this.form, visitor);
|
||||
})
|
||||
|
|
|
|||
正在加载…
在新工单中引用