mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge branch 'dev' into import_speed
This commit is contained in:
@@ -1,75 +1,62 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Activators extends CI_Controller {
|
||||
class Activators extends CI_Controller
|
||||
{
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||
if (!$this->user_model->authorize(2)) {
|
||||
$this->session->set_flashdata('notice', 'You\'re not allowed to do that!');
|
||||
redirect('dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
// Render Page
|
||||
$data['page_title'] = "Gridsquare Activators";
|
||||
|
||||
$this->load->model('Activators_model');
|
||||
|
||||
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
|
||||
$band = $this->input->post('band');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$band = 'All';
|
||||
}
|
||||
|
||||
if ($this->input->post('mincount') != NULL) { // mincount is not set when page first loads.
|
||||
$mincount = $this->input->post('mincount');
|
||||
} else {
|
||||
$mincount = 2;
|
||||
}
|
||||
|
||||
if ($this->input->post('leogeo') != NULL) { // orbit is not set when page first loads.
|
||||
$orbit = $this->input->post('leogeo');
|
||||
} else {
|
||||
$orbit = 'both';
|
||||
}
|
||||
|
||||
$this->load->model('bands');
|
||||
|
||||
$data['worked_bands'] = $this->bands->get_worked_bands();
|
||||
$data['mincount'] = $mincount;
|
||||
$data['maxactivatedgrids'] = $this->Activators_model->get_max_activated_grids();
|
||||
$data['activators_array'] = $this->Activators_model->get_activators($band, $this->input->post('mincount'), $this->input->post('leogeo'));
|
||||
$data['activators_vucc_array'] = $this->Activators_model->get_activators_vucc($band, $this->input->post('leogeo'));
|
||||
$data['orbit'] = $orbit;
|
||||
$data['activators_array'] = $this->Activators_model->get_activators($band, $mincount, $orbit);
|
||||
$data['activators_vucc_array'] = $this->Activators_model->get_activators_vucc($band, $orbit);
|
||||
$data['bandselect'] = $band;
|
||||
|
||||
$footerData = [];
|
||||
$footerData['scripts'] = [
|
||||
'assets/js/sections/activators.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/activators.js")),
|
||||
];
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('activators/index');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
public function details() {
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$call = str_replace('"', "", $this->input->post("Callsign"));
|
||||
$band = str_replace('"', "", $this->input->post("Band"));
|
||||
$leogeo = str_replace('"', "", $this->input->post("LeoGeo"));
|
||||
$data['results'] = $this->logbook_model->activator_details($call, $band, $leogeo);
|
||||
$data['filter'] = "Call ".$call;
|
||||
switch($band) {
|
||||
case 'All': $data['page_title'] = "Log View All Bands";
|
||||
$data['filter'] .= " and Band All";
|
||||
break;
|
||||
case 'SAT': $data['page_title'] = "Log View SAT";
|
||||
$data['filter'] .= " and Band SAT";
|
||||
break;
|
||||
default: $data['page_title'] = "Log View Band";
|
||||
$data['filter'] .= " and Band ".$band;
|
||||
break;
|
||||
}
|
||||
if ($band == "SAT") {
|
||||
switch($leogeo) {
|
||||
case 'both': $data['filter'] .= " and GEO/LEO";
|
||||
break;
|
||||
case 'leo': $data['filter'] .= " and LEO";
|
||||
break;
|
||||
case 'geo': $data['filter'] .= " and GEO";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->load->view('activators/details', $data);
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,115 +3,121 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Activators_model extends CI_Model
|
||||
{
|
||||
function get_activators($band, $mincount, $leogeo) {
|
||||
$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_activators($band, $mincount, $leogeo)
|
||||
{
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if ($mincount == '' || $mincount == 0 || ! is_numeric($mincount)) {
|
||||
if ($mincount == '' || $mincount == 0 || !is_numeric($mincount)) {
|
||||
$mincount = 2;
|
||||
}
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
|
||||
|
||||
$sql = "select COL_CALL as `call`, COUNT(DISTINCT(SUBSTR(COL_GRIDSQUARE,1,4))) AS `count`, GROUP_CONCAT(DISTINCT SUBSTR(`COL_GRIDSQUARE`,1,4) ORDER BY `COL_GRIDSQUARE` SEPARATOR ', ') AS `grids` from ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ")";
|
||||
if ($band != 'All') {
|
||||
if ($band == 'SAT') {
|
||||
switch ($leogeo) {
|
||||
case 'both' :
|
||||
$sql = "SELECT COL_CALL as `call`,
|
||||
COUNT(DISTINCT(SUBSTR(COL_GRIDSQUARE,1,4))) AS `count`,
|
||||
GROUP_CONCAT(DISTINCT SUBSTR(`COL_GRIDSQUARE`,1,4) ORDER BY `COL_GRIDSQUARE` SEPARATOR ', ') AS `grids`
|
||||
FROM " . $this->config->item('table_name') . " WHERE station_id in (" . $location_list . ")";
|
||||
|
||||
if ($band != 'All') {
|
||||
if ($band == 'SAT') {
|
||||
switch ($leogeo) {
|
||||
case 'both':
|
||||
$sql .= " and col_prop_mode ='" . $band . "'";
|
||||
break;
|
||||
case 'leo' :
|
||||
case 'leo':
|
||||
$sql .= " and col_prop_mode = '" . $band . "'";
|
||||
$sql .= " and col_sat_name != 'QO-100'";
|
||||
break;
|
||||
case 'geo' :
|
||||
case 'geo':
|
||||
$sql .= " and col_prop_mode = '" . $band . "'";
|
||||
$sql .= " and col_sat_name = 'QO-100'";
|
||||
break;
|
||||
default :
|
||||
default:
|
||||
$sql .= " and col_prop_mode ='" . $band . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql .= " and col_prop_mode !='SAT'";
|
||||
$sql .= " and COL_BAND ='" . $band . "'";
|
||||
}
|
||||
}
|
||||
$sql .= " AND `COL_GRIDSQUARE` != '' GROUP BY `COL_CALL` HAVING `count` >= ".$mincount." ORDER BY `count` DESC;";
|
||||
} else {
|
||||
$sql .= " and col_prop_mode !='SAT'";
|
||||
$sql .= " and COL_BAND ='" . $band . "'";
|
||||
}
|
||||
}
|
||||
$sql .= " AND `COL_GRIDSQUARE` != '' GROUP BY `COL_CALL` HAVING `count` >= " . $mincount . " ORDER BY `count` DESC;";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function get_activators_vucc($band, $leogeo) {
|
||||
$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_activators_vucc($band, $leogeo)
|
||||
{
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
|
||||
|
||||
$sql = "SELECT DISTINCT COL_CALL AS `call`, GROUP_CONCAT(COL_VUCC_GRIDS) AS `vucc_grids` FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ")";
|
||||
if ($band != 'All') {
|
||||
if ($band == 'SAT') {
|
||||
switch ($leogeo) {
|
||||
case 'both' :
|
||||
$sql = "SELECT DISTINCT COL_CALL AS `call`,
|
||||
GROUP_CONCAT(COL_VUCC_GRIDS) AS `vucc_grids` FROM " . $this->config->item('table_name') .
|
||||
" WHERE station_id in (" . $location_list . ")";
|
||||
|
||||
if ($band != 'All') {
|
||||
if ($band == 'SAT') {
|
||||
switch ($leogeo) {
|
||||
case 'both':
|
||||
$sql .= " and col_prop_mode ='" . $band . "'";
|
||||
break;
|
||||
case 'leo' :
|
||||
case 'leo':
|
||||
$sql .= " and col_prop_mode = '" . $band . "'";
|
||||
$sql .= " and col_sat_name != 'QO-100'";
|
||||
break;
|
||||
case 'geo' :
|
||||
case 'geo':
|
||||
$sql .= " and col_prop_mode = '" . $band . "'";
|
||||
$sql .= " and col_sat_name = 'QO-100'";
|
||||
break;
|
||||
default :
|
||||
default:
|
||||
$sql .= " and col_prop_mode ='" . $band . "'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql .= " and col_prop_mode !='SAT'";
|
||||
$sql .= " and COL_BAND ='" . $band . "'";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sql .= " and col_prop_mode !='SAT'";
|
||||
$sql .= " and COL_BAND ='" . $band . "'";
|
||||
}
|
||||
}
|
||||
$sql .= " AND COL_VUCC_GRIDS != '' GROUP BY COL_CALL;";
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
function get_max_activated_grids() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
return $query->result();
|
||||
}
|
||||
function get_max_activated_grids()
|
||||
{
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return array();
|
||||
}
|
||||
if (!$logbooks_locations_array) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
$location_list = "'" . implode("','", $logbooks_locations_array) . "'";
|
||||
|
||||
// Get max no of activated grids of single operator
|
||||
$data = $this->db->query(
|
||||
"select COUNT(DISTINCT(SUBSTR(COL_GRIDSQUARE,1,4))) AS `count` from " . $this->config->item('table_name') . " WHERE station_id in (" . $location_list . ") AND `COL_GRIDSQUARE` != '' GROUP BY `COL_CALL` ORDER BY `count` DESC LIMIT 1"
|
||||
);
|
||||
foreach($data->result() as $row){
|
||||
$max = $row->count;
|
||||
}
|
||||
|
||||
return ($max ?? 0);
|
||||
}
|
||||
// Get max no of activated grids of single operator
|
||||
$data = $this->db->query(
|
||||
"SELECT COUNT(DISTINCT(SUBSTR(COL_GRIDSQUARE,1,4))) AS `count` from " . $this->config->item('table_name') .
|
||||
" WHERE station_id in (" . $location_list . ") AND
|
||||
`COL_GRIDSQUARE` != '' GROUP BY `COL_CALL` ORDER BY `count` DESC LIMIT 1"
|
||||
);
|
||||
foreach ($data->result() as $row) {
|
||||
$max = $row->count;
|
||||
}
|
||||
|
||||
return ($max ?? 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,6 +413,9 @@ class Logbook_model extends CI_Model {
|
||||
$this->db->join('satellite', 'satellite.name = '.$this->config->item('table_name').'.col_sat_name', 'left outer');
|
||||
}
|
||||
switch ($type) {
|
||||
case 'CALL':
|
||||
$this->db->where('COL_CALL', $searchphrase);
|
||||
break;
|
||||
case 'DXCC':
|
||||
$this->db->where('COL_COUNTRY', $searchphrase);
|
||||
if ($band == 'SAT' && $type == 'DXCC') {
|
||||
@@ -4892,7 +4895,32 @@ function lotw_last_qsl_date($user_id) {
|
||||
if ($row->COL_NAME != null) {
|
||||
$plot['html'] .= "Name: ".$row->COL_NAME."<br />";
|
||||
}
|
||||
$plot['html'] .= "Date/Time: ".$row->COL_TIME_ON."<br />";
|
||||
$date_cat = "Date";
|
||||
|
||||
// Get Date format
|
||||
if($this->session->userdata('user_date_format')) {
|
||||
// If Logged in and session exists
|
||||
$user_date_format = $this->session->userdata('user_date_format');
|
||||
} else {
|
||||
// Get Default date format from /config/wavelog.php
|
||||
$user_date_format = $this->config->item('qso_date_format');
|
||||
}
|
||||
|
||||
$qso_time_on = new DateTime($row->COL_TIME_ON);
|
||||
|
||||
if ($this->uri->segment(1) == 'visitor') {
|
||||
$visitor_date_format = $this->config->item('qso_date_format');
|
||||
if ($this->config->item('show_time')) {
|
||||
$visitor_date_format .= ' H:i';
|
||||
$date_cat .= "/Time";
|
||||
}
|
||||
$qso_time_on = $qso_time_on->format($visitor_date_format);
|
||||
} else {
|
||||
$qso_time_on = $qso_time_on->format($user_date_format.' H:i');
|
||||
$date_cat .= "/Time";
|
||||
}
|
||||
|
||||
$plot['html'] .= $date_cat.": ".$qso_time_on."<br />";
|
||||
$plot['html'] .= ($row->COL_SAT_NAME != null) ? ("SAT: ".$row->COL_SAT_NAME."<br />") : ("Band: ".$row->COL_BAND."<br />");
|
||||
$plot['html'] .= "Mode: ".($row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE)."<br />";
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<div class="container">
|
||||
<h5><?php echo lang('general_word_filtering_on'); ?> <?php echo $filter ?></h5>
|
||||
|
||||
<?php $this->load->view('view_log/partial/log_ajax') ?>
|
||||
@@ -3,59 +3,59 @@
|
||||
|
||||
<form class="form" action="<?php echo site_url('activators'); ?>" method="post" enctype="multipart/form-data">
|
||||
<!-- Select Basic -->
|
||||
<div class="mb-3 row">
|
||||
<label class="col-md-1 control-label" for="band"><?php echo lang('gen_hamradio_band'); ?></label>
|
||||
<div class="col-md-3">
|
||||
<select id="band" name="band" class="form-select">
|
||||
<option value="All" <?php if ($this->input->post('band') == "All" || $this->input->method() !== 'post') echo ' selected'; ?> ><?php echo lang('general_word_all'); ?></option>
|
||||
<?php foreach($worked_bands as $band) {
|
||||
echo '<option value="' . $band . '"';
|
||||
if ($this->input->post('band') == $band) echo ' selected';
|
||||
echo '>' . $band . '</option>'."\n";
|
||||
} ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row" id="leogeo">
|
||||
<label class="col-md-1 control-label" for="leogeo">LEO/GEO</label>
|
||||
<div class="col-md-3">
|
||||
<select id="leogeo" name="leogeo" class="form-select">
|
||||
<option value="both" <?php if ($this->input->post('leogeo') == "both" || $this->input->method() !== 'post') echo ' selected'; ?> >Both</option>
|
||||
<option value="leo" <?php if ($this->input->post('leogeo') == "leo") echo ' selected'; ?>>LEO</option>
|
||||
<option value="geo" <?php if ($this->input->post('leogeo') == "geo") echo ' selected'; ?>>GEO</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<label class="col-md-1 control-label" for="mincount"><?php echo lang('gridsquares_minimum_count'); ?></label>
|
||||
<div class="col-md-3">
|
||||
<select id="mincount" name="mincount" class="form-select">
|
||||
<?php
|
||||
$i = 1;
|
||||
do {
|
||||
echo '<option value="'.$i.'"';
|
||||
if ($this->input->post('mincount') == $i || ($this->input->method() !== 'post' && $i == 2)) echo ' selected';
|
||||
echo '>'.$i.'</option>'."\n";
|
||||
$i++;
|
||||
} while ($i <= $maxactivatedgrids);
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mb-3 row">
|
||||
<label class="col-md-1 control-label" for="button1id"></label>
|
||||
<div class="col-md-10">
|
||||
<button id="button1id" type="submit" name="button1id" class="btn btn-primary"><?php echo lang('filter_options_show'); ?></button>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<label class="col-md-1 control-label" for="band"><?php echo lang('gen_hamradio_band'); ?></label>
|
||||
<div class="col-md-3">
|
||||
<select id="band" name="band" class="form-select">
|
||||
<option value="All" <?php if ($bandselect == "All") echo ' selected'; ?>><?php echo lang('general_word_all'); ?></option>
|
||||
<?php foreach ($worked_bands as $band) {
|
||||
echo '<option value="' . $band . '"';
|
||||
if ($bandselect == $band) echo ' selected';
|
||||
echo '>' . $band . '</option>' . "\n";
|
||||
} ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row" id="leogeo" style="display: none;">
|
||||
<label class="col-md-1 control-label" for="leogeo">LEO/GEO</label>
|
||||
<div class="col-md-3">
|
||||
<select id="leogeo" name="leogeo" class="form-select">
|
||||
<option value="both" <?php if ($orbit == 'both') echo ' selected'; ?>>Both</option>
|
||||
<option value="leo" <?php if ($orbit == 'leo') echo ' selected'; ?>>LEO</option>
|
||||
<option value="geo" <?php if ($orbit == 'geo') echo ' selected'; ?>>GEO</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 row">
|
||||
<label class="col-md-1 control-label" for="mincount"><?php echo lang('gridsquares_minimum_count'); ?></label>
|
||||
<div class="col-md-3">
|
||||
<select id="mincount" name="mincount" class="form-select">
|
||||
<?php
|
||||
$i = 1;
|
||||
do {
|
||||
echo '<option value="' . $i . '"';
|
||||
if ($mincount == $i) echo ' selected';
|
||||
echo '>' . $i . '</option>' . "\n";
|
||||
$i++;
|
||||
} while ($i <= $maxactivatedgrids);
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mb-3 row">
|
||||
<label class="col-md-1 control-label" for="button1id"></label>
|
||||
<div class="col-md-10">
|
||||
<button id="button1id" type="submit" name="button1id" class="btn btn-primary"><?php echo lang('filter_options_show'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
// Get Date format
|
||||
if($this->session->userdata('user_date_format')) {
|
||||
if ($this->session->userdata('user_date_format')) {
|
||||
// If Logged in and session exists
|
||||
$custom_date_format = $this->session->userdata('user_date_format');
|
||||
} else {
|
||||
@@ -63,21 +63,18 @@
|
||||
$custom_date_format = $this->config->item('qso_date_format');
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
<?php
|
||||
$vucc_grids = array();
|
||||
if ($activators_vucc_array) {
|
||||
foreach ($activators_vucc_array as $line) {
|
||||
$vucc_grids[$line->call] = $line->vucc_grids;
|
||||
}
|
||||
foreach ($activators_vucc_array as $line) {
|
||||
$vucc_grids[$line->call] = $line->vucc_grids;
|
||||
}
|
||||
}
|
||||
if( $this->input->post('band') != NULL) {
|
||||
if ($activators_array) {
|
||||
if ($activators_array) {
|
||||
|
||||
$result = write_activators($activators_array, $vucc_grids, $custom_date_format, $this->input->post('band'), $this->input->post('leogeo'));
|
||||
}
|
||||
else {
|
||||
echo '<div class="alert alert-danger" role="alert">Nothing found!</div>';
|
||||
}
|
||||
$result = write_activators($activators_array, $vucc_grids, $custom_date_format, $bandselect, $orbit);
|
||||
} else {
|
||||
echo '<div class="alert alert-danger" role="alert">Nothing found!</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -86,12 +83,13 @@
|
||||
|
||||
<?php
|
||||
|
||||
function write_activators($activators_array, $vucc_grids, $custom_date_format, $band, $leogeo) {
|
||||
function write_activators($activators_array, $vucc_grids, $custom_date_format, $band, $leogeo)
|
||||
{
|
||||
if ($band == '') {
|
||||
$band = 'All';
|
||||
$band = 'All';
|
||||
}
|
||||
if ($leogeo == '') {
|
||||
$leogeo = 'both';
|
||||
$leogeo = 'both';
|
||||
}
|
||||
$i = 1;
|
||||
echo '<table style="width:100%" class="table table-sm activatorstable table-bordered table-hover table-striped table-condensed text-center">
|
||||
@@ -113,16 +111,16 @@ function write_activators($activators_array, $vucc_grids, $custom_date_format, $
|
||||
$grids = $line->grids;
|
||||
$count = $line->count;
|
||||
if (array_key_exists($line->call, $vucc_grids)) {
|
||||
foreach(explode(',', $vucc_grids[$line->call]) as $vgrid) {
|
||||
if(!strpos($grids, $vgrid)) {
|
||||
$grids .= ','.$vgrid;
|
||||
}
|
||||
}
|
||||
$grids = str_replace(' ', '', $grids);
|
||||
$grid_array = explode(',', $grids);
|
||||
sort($grid_array);
|
||||
$count = count($grid_array);
|
||||
$grids = implode(', ', $grid_array);
|
||||
foreach (explode(',', $vucc_grids[$line->call]) as $vgrid) {
|
||||
if (!strpos($grids, $vgrid)) {
|
||||
$grids .= ',' . $vgrid;
|
||||
}
|
||||
}
|
||||
$grids = str_replace(' ', '', $grids);
|
||||
$grid_array = explode(',', $grids);
|
||||
sort($grid_array);
|
||||
$count = count($grid_array);
|
||||
$grids = implode(', ', $grid_array);
|
||||
}
|
||||
array_push($activators, array($count, $call, $grids));
|
||||
}
|
||||
@@ -130,11 +128,11 @@ function write_activators($activators_array, $vucc_grids, $custom_date_format, $
|
||||
foreach ($activators as $line) {
|
||||
echo '<tr>
|
||||
<td>' . $i++ . '</td>
|
||||
<td>'.$line[1].'</td>
|
||||
<td>'.$line[0].'</td>
|
||||
<td style="text-align: left; font-family: monospace;">'.$line[2].'</td>
|
||||
<td><a href=javascript:displayActivatorsContacts("'.$line[1].'","'.$band.'","'.$leogeo.'")><i class="fas fa-list"></i></a></td>
|
||||
<td><a href=javascript:spawnActivatorsMap("'.$line[1].'","'.$line[0].'","'.str_replace(' ', '', $line[2]).'")><i class="fas fa-globe"></i></a></td>
|
||||
<td>' . $line[1] . '</td>
|
||||
<td>' . $line[0] . '</td>
|
||||
<td style="text-align: left; font-family: monospace;">' . $line[2] . '</td>
|
||||
<td><a href=javascript:displayActivatorsContacts("' . $line[1] . '","' . $band . '","' . $leogeo . '")><i class="fas fa-list"></i></a></td>
|
||||
<td><a href=javascript:spawnActivatorsMap("' . $line[1] . '","' . $line[0] . '","' . str_replace(' ', '', $line[2]) . '")><i class="fas fa-globe"></i></a></td>
|
||||
</tr>';
|
||||
}
|
||||
echo '</tfoot></table></div>';
|
||||
|
||||
@@ -1981,75 +1981,7 @@ $(document).ready(function(){
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
<?php if ($this->uri->segment(1) == "activators") { ?>
|
||||
<script>
|
||||
$('.activatorstable').DataTable({
|
||||
"pageLength": 25,
|
||||
responsive: false,
|
||||
ordering: false,
|
||||
"scrollY": "500px",
|
||||
"scrollCollapse": true,
|
||||
"paging": false,
|
||||
"scrollX": true,
|
||||
"language": {
|
||||
url: getDataTablesLanguageUrl(),
|
||||
},
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'csv'
|
||||
]
|
||||
});
|
||||
|
||||
// change color of csv-button if dark mode is chosen
|
||||
if (isDarkModeTheme()) {
|
||||
$(".buttons-csv").css("color", "white");
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#band').change(function()
|
||||
{
|
||||
if($(this).val() == "SAT")
|
||||
{
|
||||
$('#leogeo').show();
|
||||
} else {
|
||||
$('#leogeo').hide();
|
||||
}
|
||||
});
|
||||
<?php if ($this->input->post('band') != "SAT") { ?>
|
||||
$('#leogeo').hide();
|
||||
<?php } ?>
|
||||
});
|
||||
function displayActivatorsContacts(call, band, leogeo) {
|
||||
var baseURL= "<?php echo base_url();?>";
|
||||
$.ajax({
|
||||
url: baseURL + 'index.php/activators/details',
|
||||
type: 'post',
|
||||
data: {'Callsign': call,
|
||||
'Band': band,
|
||||
'LeoGeo': leogeo
|
||||
},
|
||||
success: function(html) {
|
||||
BootstrapDialog.show({
|
||||
title: lang_general_word_qso_data,
|
||||
size: BootstrapDialog.SIZE_WIDE,
|
||||
cssClass: 'qso-was-dialog',
|
||||
nl2br: false,
|
||||
message: html,
|
||||
onshown: function(dialog) {
|
||||
$('[data-bs-toggle="tooltip"]').tooltip();
|
||||
},
|
||||
buttons: [{
|
||||
label: lang_admin_close,
|
||||
action: function (dialogItself) {
|
||||
dialogItself.close();
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if ($this->uri->segment(1) == "mode") { ?>
|
||||
<script src="<?php echo base_url(); ?>assets/js/sections/mode.js"></script>
|
||||
|
||||
@@ -68,18 +68,20 @@ function echo_table_col($row, $name) {
|
||||
echo_table_header_col($this, $this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4'));
|
||||
echo_table_header_col($this, $this->session->userdata('user_column5'));
|
||||
|
||||
if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?>
|
||||
if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) {
|
||||
if ( strpos($this->session->userdata('user_default_confirmation'),'Q') !== false ) { ?>
|
||||
<th>QSL</th>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'E')>0 && ($this->session->userdata('user_eqsl_name') != "") ) { ?>
|
||||
<?php } ?>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'E') !== false && ($this->session->userdata('user_eqsl_name') != "") ) { ?>
|
||||
<th>eQSL</th>
|
||||
<?php } ?>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'L')>0 && ($this->session->userdata('user_lotw_name') != "") ) { ?>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'L') !== false && ($this->session->userdata('user_lotw_name') != "") ) { ?>
|
||||
<th>LoTW</th>
|
||||
<?php } ?>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'Z')>0 && ($this->session->userdata('hasQrzKey') != "") ) { ?>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'Z') !== false && ($this->session->userdata('hasQrzKey') != "") ) { ?>
|
||||
<th>QRZ</th>
|
||||
<?php } ?>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'C')>0 ) { ?>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'C') !== false ) { ?>
|
||||
<th>Clublog</th>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
@@ -131,7 +133,8 @@ function echo_table_col($row, $name) {
|
||||
echo_table_col($row, $this->session->userdata('user_column4')==""?'Band':$this->session->userdata('user_column4'));
|
||||
echo_table_col($row, $this->session->userdata('user_column5'));
|
||||
|
||||
if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?>
|
||||
if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) {
|
||||
if ( strpos($this->session->userdata('user_default_confirmation'),'Q') !== false ) { ?>
|
||||
<td id="qsl_<?php echo $row->COL_PRIMARY_KEY; ?>" class="qsl">
|
||||
<span <?php if ($row->COL_QSL_SENT != "N") {
|
||||
switch ($row->COL_QSL_SENT) {
|
||||
@@ -211,7 +214,7 @@ function echo_table_col($row, $name) {
|
||||
} ?>">▼</span>
|
||||
</td>
|
||||
|
||||
<?php if (strpos($this->session->userdata('user_default_confirmation'),'E')>0 && ($this->session->userdata('user_eqsl_name') != "")){ ?>
|
||||
<?php } if (strpos($this->session->userdata('user_default_confirmation'),'E') !== false && ($this->session->userdata('user_eqsl_name') != "")){ ?>
|
||||
<td class="eqsl">
|
||||
<span <?php if ($row->COL_EQSL_QSL_SENT == "Y") { echo "title=\"".lang('eqsl_short')." ".lang('general_word_sent'); if ($row->COL_EQSL_QSLSDATE != null) { $timestamp = strtotime($row->COL_EQSL_QSLSDATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-bs-toggle=\"tooltip\""; } ?> class="eqsl-<?php echo ($row->COL_EQSL_QSL_SENT=='Y')?'green':'red'?>">▲</span>
|
||||
<span <?php if ($row->COL_EQSL_QSL_RCVD == "Y") { echo "title=\"".lang('eqsl_short')." ".lang('general_word_received'); if ($row->COL_EQSL_QSLRDATE != null) { $timestamp = strtotime($row->COL_EQSL_QSLRDATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-bs-toggle=\"tooltip\""; } ?> class="eqsl-<?php echo ($row->COL_EQSL_QSL_RCVD=='Y')?'green':'red'?>">
|
||||
@@ -224,14 +227,14 @@ function echo_table_col($row, $name) {
|
||||
</td>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'L')>0 && ($this->session->userdata('user_lotw_name') != "") ) { ?>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'L') !== false && ($this->session->userdata('user_lotw_name') != "") ) { ?>
|
||||
<td class="lotw">
|
||||
<span <?php if ($row->COL_LOTW_QSL_SENT == "Y") { echo "title=\"".lang('lotw_short')." ".lang('general_word_sent'); if ($row->COL_LOTW_QSLSDATE != null) { $timestamp = strtotime($row->COL_LOTW_QSLSDATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-bs-toggle=\"tooltip\""; } ?> class="lotw-<?php echo ($row->COL_LOTW_QSL_SENT=='Y')?'green':'red'?>">▲</span>
|
||||
<span <?php if ($row->COL_LOTW_QSL_RCVD == "Y") { echo "title=\"".lang('lotw_short')." ".lang('general_word_received'); if ($row->COL_LOTW_QSLRDATE != null) { $timestamp = strtotime($row->COL_LOTW_QSLRDATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-bs-toggle=\"tooltip\""; } ?> class="lotw-<?php echo ($row->COL_LOTW_QSL_RCVD=='Y')?'green':'red'?>">▼</span>
|
||||
</td>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'Z')>0 && ($this->session->userdata('hasQrzKey') != "") ) { ?>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'Z') !== false && ($this->session->userdata('hasQrzKey') != "") ) { ?>
|
||||
<td class="qrz">
|
||||
<span <?php if ($row->COL_QRZCOM_QSO_UPLOAD_STATUS == "Y") { echo "title=\"QRZ ".lang('general_word_sent'); if ($row->COL_QRZCOM_QSO_UPLOAD_DATE != null) { $timestamp = strtotime($row->COL_QRZCOM_QSO_UPLOAD_DATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-bs-toggle=\"tooltip\""; } ?> class="qrz-<?php echo ($row->COL_QRZCOM_QSO_UPLOAD_STATUS=='Y')?'green':'red'?>">▲</span>
|
||||
<span <?php if ($row->COL_QRZCOM_QSO_DOWNLOAD_STATUS == "Y") { echo "title=\"QRZ ".lang('general_word_received'); if ($row->COL_QRZCOM_QSO_DOWNLOAD_DATE != null) { $timestamp = strtotime($row->COL_QRZCOM_QSO_DOWNLOAD_DATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-bs-toggle=\"tooltip\""; } ?> class="qrz-<?php echo ($row->COL_QRZCOM_QSO_DOWNLOAD_STATUS=='Y')?'green':'red'?>">▼</span>
|
||||
@@ -239,7 +242,7 @@ function echo_table_col($row, $name) {
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'C')>0 ) { ?>
|
||||
<?php if ( strpos($this->session->userdata('user_default_confirmation'),'C') !== false ) { ?>
|
||||
<td class="clublog">
|
||||
<span <?php if ($row->COL_CLUBLOG_QSO_UPLOAD_STATUS == "Y") { echo "title=\"Clublog ".lang('general_word_sent'); if ($row->COL_CLUBLOG_QSO_UPLOAD_DATE != null) { $timestamp = strtotime($row->COL_CLUBLOG_QSO_UPLOAD_DATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-bs-toggle=\"tooltip\""; } ?> class="clublog-<?php echo ($row->COL_CLUBLOG_QSO_UPLOAD_STATUS=='Y')?'green':'red'?>">▲</span>
|
||||
<span <?php if ($row->COL_CLUBLOG_QSO_DOWNLOAD_STATUS == "Y") { echo "title=\"Clublog ".lang('general_word_received'); if ($row->COL_CLUBLOG_QSO_DOWNLOAD_DATE != null) { $timestamp = strtotime($row->COL_CLUBLOG_QSO_DOWNLOAD_DATE); echo " ".($timestamp!=''?date($custom_date_format, $timestamp):''); } echo "\" data-bs-toggle=\"tooltip\""; } ?> class="clublog-<?php echo ($row->COL_CLUBLOG_QSO_DOWNLOAD_STATUS=='Y')?'green':'red'?>">▼</span>
|
||||
|
||||
@@ -45,8 +45,9 @@ function echo_table_col($row, $name) {
|
||||
</div>
|
||||
|
||||
<!-- Map -->
|
||||
<?php if ($this->optionslib->get_option('public_maps') == 'true') { ?>
|
||||
<div id="map" class="map-leaflet" style="width: 100%; height: 365px"></div>
|
||||
<?php $public_maps_option = $this->optionslib->get_option('public_maps') ?? 'true';
|
||||
if ($public_maps_option == 'true') { ?>
|
||||
<div id="map" class="map-leaflet" style="width: 100%; height: 365px"></div>
|
||||
<?php } ?>
|
||||
|
||||
<div id="container" style="padding-top: 0px; margin-top: 5px;" class="container dashboard">
|
||||
|
||||
@@ -62,7 +62,8 @@
|
||||
<ul class="navbar-nav">
|
||||
<?php
|
||||
if (!empty($slug)) {
|
||||
if ($this->optionslib->get_option('public_maps') == 'true') { ?>
|
||||
$public_maps_option = $this->optionslib->get_option('public_maps') ?? 'true';
|
||||
if ($public_maps_option == 'true') { ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo site_url('visitor/satellites/'.$slug);?>">Gridsquares</a>
|
||||
</li>
|
||||
|
||||
75
assets/js/sections/activators.js
Normal file
75
assets/js/sections/activators.js
Normal file
@@ -0,0 +1,75 @@
|
||||
$(".activatorstable").DataTable({
|
||||
pageLength: 25,
|
||||
responsive: false,
|
||||
ordering: false,
|
||||
scrollY: "500px",
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
scrollX: true,
|
||||
language: {
|
||||
url: getDataTablesLanguageUrl(),
|
||||
},
|
||||
dom: "Bfrtip",
|
||||
buttons: ["csv"],
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
let bandselect = $('#band');
|
||||
|
||||
showHideLeoGeo(bandselect);
|
||||
bandselect.change(function () {
|
||||
showHideLeoGeo(bandselect);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function showHideLeoGeo(bandselect) {
|
||||
|
||||
if (bandselect.val() == "SAT") {
|
||||
$("#leogeo").show();
|
||||
} else {
|
||||
$("#leogeo").hide();
|
||||
}
|
||||
}
|
||||
|
||||
function displayActivatorsContacts(call, band, leogeo) {
|
||||
var data = {
|
||||
Searchphrase: call,
|
||||
Band: band,
|
||||
Type: 'CALL'
|
||||
};
|
||||
|
||||
if (leogeo != 'both') {
|
||||
data.Orbit = leogeo;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: base_url + "index.php/awards/qso_details_ajax",
|
||||
type: "post",
|
||||
data: data,
|
||||
success: function (html) {
|
||||
BootstrapDialog.show({
|
||||
title: lang_general_word_qso_data,
|
||||
size: BootstrapDialog.SIZE_WIDE,
|
||||
cssClass: "qso-was-dialog",
|
||||
nl2br: false,
|
||||
message: html,
|
||||
onshown: function (dialog) {
|
||||
$('[data-bs-toggle="tooltip"]').tooltip();
|
||||
$('.table-responsive .dropdown-toggle').off('mouseenter').on('mouseenter', function () {
|
||||
showQsoActionsMenu($(this).closest('.dropdown'));
|
||||
});
|
||||
},
|
||||
buttons: [
|
||||
{
|
||||
label: lang_admin_close,
|
||||
action: function (dialogItself) {
|
||||
dialogItself.close();
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user