mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
@@ -255,9 +255,12 @@ class Awards extends CI_Controller {
|
||||
$this->load->view('interface_assets/footer', $footerData);
|
||||
}
|
||||
|
||||
public function jcc () {
|
||||
public function jcc () {
|
||||
$footerData = [];
|
||||
$footerData['scripts'] = ['assets/js/sections/jcc.js'];
|
||||
$footerData['scripts'] = [
|
||||
'assets/js/sections/jcc.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/jcc.js")),
|
||||
'assets/js/sections/jccmap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/jccmap.js"))
|
||||
];
|
||||
|
||||
$this->load->model('jcc_model');
|
||||
$this->load->model('modes');
|
||||
@@ -354,6 +357,14 @@ class Awards extends CI_Controller {
|
||||
return;
|
||||
}
|
||||
|
||||
public function jcc_cities() {
|
||||
$this->load->model('Jcc_model');
|
||||
$data = $this->Jcc_model->jccCities();
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data, JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
|
||||
public function vucc() {
|
||||
$this->load->model('vucc');
|
||||
$this->load->model('bands');
|
||||
@@ -1463,6 +1474,41 @@ class Awards extends CI_Controller {
|
||||
echo json_encode($newdxcc);
|
||||
}
|
||||
|
||||
/*
|
||||
function jcc_map
|
||||
This displays the DXCC map
|
||||
*/
|
||||
public function jcc_map() {
|
||||
$this->load->model('jcc_model');
|
||||
$this->load->model('bands');
|
||||
|
||||
$bands[] = $this->security->xss_clean($this->input->post('band'));
|
||||
|
||||
$postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1;
|
||||
$postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1;
|
||||
$postdata['eqsl'] = $this->input->post('eqsl') == 0 ? NULL: 1;
|
||||
$postdata['qrz'] = $this->input->post('qrz') == 0 ? NULL: 1;
|
||||
$postdata['worked'] = $this->input->post('worked') == 0 ? NULL: 1;
|
||||
$postdata['confirmed'] = $this->input->post('confirmed') == 0 ? NULL: 1;
|
||||
$postdata['notworked'] = $this->input->post('notworked') == 0 ? NULL: 1;
|
||||
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
|
||||
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
|
||||
|
||||
$jcc_wkd = $this->jcc_model->fetch_jcc_wkd($postdata);
|
||||
$jcc_cnfm = $this->jcc_model->fetch_jcc_cnfm($postdata);
|
||||
|
||||
$jccs = [];
|
||||
foreach ($jcc_wkd as $jcc) {
|
||||
$jccs[$jcc->COL_CNTY] = array(1, 0);
|
||||
}
|
||||
foreach ($jcc_cnfm as $jcc) {
|
||||
$jccs[$jcc->COL_CNTY][1] = 1;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($jccs);
|
||||
}
|
||||
|
||||
/*
|
||||
function iota
|
||||
This displays the IOTA map
|
||||
|
||||
@@ -15,7 +15,9 @@ $lang['awards_total_confirmed'] = "Total confirmed";
|
||||
|
||||
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "共确认";
|
||||
$lang['awards_cq_page_title'] = "CQ 杂志 WAZ 奖状";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Total confirmed";
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Total confirmed";
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -9,6 +9,7 @@ $lang['awards_show_not_worked'] = "Show not worked";
|
||||
$lang['awards_qsl_type'] = "Show QSO with QSL Type";
|
||||
$lang['awards_show_cq_map'] = "Show CQ Zone Map";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
$lang['awards_summary'] = "Summary";
|
||||
$lang['awards_total'] = "Total";
|
||||
$lang['awards_total_worked'] = "Total worked";
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Total confirmed";
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Total \"confirmés\"";
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -16,7 +16,8 @@ $lang['awards_total_confirmed'] = "Gesamt bestätigt";
|
||||
|
||||
$lang['awards_cq_page_title'] = "Diplome - CQ Magazin WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_itu_map'] = "Zeige Karte der ITU-Zonen";
|
||||
$lang['awards_show_jcc_map'] = "Zeige Karte der JCCs";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Total confirmed";
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Total confirmed";
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Total confirmed";
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Всего пожтверждено";
|
||||
$lang['awards_cq_page_title'] = "Дипломы - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Total confirmed";
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Total confirmed";
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
@@ -17,6 +17,7 @@ $lang['awards_total_confirmed'] = "Total confirmed";
|
||||
$lang['awards_cq_page_title'] = "Awards - CQ Magazine WAZ";
|
||||
$lang['awards_itu_page_title'] = "Awards - ITU Zones";
|
||||
$lang['awards_show_itu_map'] = "Show ITU Zone Map";
|
||||
$lang['awards_show_jcc_map'] = "Show JCC Map";
|
||||
|
||||
/*
|
||||
___________________________________________________________________________________________
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,12 @@
|
||||
<script>
|
||||
var tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"
|
||||
</script>
|
||||
<style>
|
||||
#jccmap {
|
||||
height: calc(100vh - 480px) !important;
|
||||
max-height: 900px !important;
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
<!-- Award Info Box -->
|
||||
<br>
|
||||
@@ -98,7 +107,10 @@
|
||||
<div class="col-md-10">
|
||||
<button id="button2id" type="reset" name="button2id" class="btn btn-sm btn-warning">Reset</button>
|
||||
<button id="button1id" type="submit" name="button1id" class="btn btn-sm btn-primary">Show</button>
|
||||
<?php if ($jcc_array) {?>
|
||||
<button type="button" onclick="load_jcc_map();" class="btn btn-info btn-sm"><i class="fas fa-globe-asia"></i> <?php echo lang('awards_show_jcc_map'); ?></button>
|
||||
<button id="button3id" type="button" onclick="export_qsos();" name="button3id" class="btn btn-sm btn-info">Export</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -109,10 +121,17 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="table-tab" data-bs-toggle="tab" href="#table" role="tab" aria-controls="table" aria-selected="true">Results</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" onclick="load_jcc_map();" id="map-tab" data-bs-toggle="tab" href="#jccmaptab" role="tab" aria-controls="home" aria-selected="false"><?php echo lang('filter_map'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
<br />
|
||||
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade" id="jccmaptab" role="tabpanel" aria-labelledby="home-tab">
|
||||
<br />
|
||||
|
||||
<div id="jccmap" class="map-leaflet" ></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
166
assets/js/sections/jccmap.js
Normal file
166
assets/js/sections/jccmap.js
Normal file
@@ -0,0 +1,166 @@
|
||||
var osmUrl = tileUrl;
|
||||
|
||||
function load_jcc_map() {
|
||||
$('.nav-tabs a[href="#jccmaptab"]').tab('show');
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/awards/jcc_map',
|
||||
type: 'post',
|
||||
data: {
|
||||
band: $('#band2').val(),
|
||||
mode: $('#mode').val(),
|
||||
worked: +$('#worked').prop('checked'),
|
||||
confirmed: +$('#confirmed').prop('checked'),
|
||||
notworked: +$('#notworked').prop('checked'),
|
||||
qsl: +$('#qsl').prop('checked'),
|
||||
lotw: +$('#lotw').prop('checked'),
|
||||
qrz: +$('#qrz').prop('checked'),
|
||||
eqsl: +$('#eqsl').prop('checked'),
|
||||
},
|
||||
success: function(data) {
|
||||
load_jcc_map2(data, worked, confirmed, notworked);
|
||||
},
|
||||
error: function() {
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function load_jcc_map2(data, worked, confirmed, notworked) {
|
||||
|
||||
// If map is already initialized
|
||||
var container = L.DomUtil.get('jccmap');
|
||||
|
||||
if(container != null){
|
||||
container._leaflet_id = null;
|
||||
container.remove();
|
||||
$("#jccmaptab").append('<div id="jccmap" class="map-leaflet" ></div>');
|
||||
}
|
||||
|
||||
var map = new L.Map('jccmap', {
|
||||
fullscreenControl: true,
|
||||
fullscreenControlOptions: {
|
||||
position: 'topleft'
|
||||
},
|
||||
});
|
||||
|
||||
L.tileLayer(
|
||||
osmUrl,
|
||||
{
|
||||
attribution: '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
|
||||
maxZoom: 18
|
||||
}
|
||||
).addTo(map);
|
||||
|
||||
var notworkedcount = 0;
|
||||
var confirmedcount = 0;
|
||||
var workednotconfirmedcount = 0;
|
||||
|
||||
var jccstuff = {};
|
||||
$.ajax({
|
||||
dataType: "json",
|
||||
url: base_url + 'index.php/awards/jcc_cities',
|
||||
async: false,
|
||||
success: function(result) {
|
||||
for (var item in result) {
|
||||
var name = item.toString();
|
||||
jccstuff[name] = [result[item]['name'], result[item]['lat'], result[item]['lon']];
|
||||
}
|
||||
}
|
||||
});
|
||||
for (const [key, value] of Object.entries(jccstuff)) {
|
||||
var D = [];
|
||||
if (key in data) {
|
||||
if (confirmed.checked == true) {
|
||||
if (data[key][1] == 1) {
|
||||
mapColor = 'green';
|
||||
D['prefix'] = key;
|
||||
D['name'] = value[0];
|
||||
D['lat'] = value[1];
|
||||
D['long'] = value[2];
|
||||
addMarker(L, D, mapColor, map);
|
||||
confirmedcount++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (worked.checked == true) {
|
||||
mapColor = 'orange';
|
||||
D['prefix'] = key;
|
||||
D['name'] = value[0];
|
||||
D['lat'] = value[1];
|
||||
D['long'] = value[2];
|
||||
addMarker(L, D, mapColor, map);
|
||||
workednotconfirmedcount++;
|
||||
}
|
||||
} else {
|
||||
if (notworked.checked == true) {
|
||||
mapColor = 'red';
|
||||
D['prefix'] = key;
|
||||
D['name'] = value[0];
|
||||
D['lat'] = value[1];
|
||||
D['long'] = value[2];
|
||||
addMarker(L, D, mapColor, map);
|
||||
notworkedcount++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*Legend specific*/
|
||||
var legend = L.control({ position: "topright" });
|
||||
|
||||
legend.onAdd = function(map) {
|
||||
var div = L.DomUtil.create("div", "legend");
|
||||
div.innerHTML += "<h4>Colors</h4>";
|
||||
div.innerHTML += '<i style="background: green"></i><span>Confirmed ('+confirmedcount+')</span><br>';
|
||||
div.innerHTML += '<i style="background: orange"></i><span>Worked not confirmed ('+workednotconfirmedcount+')</span><br>';
|
||||
div.innerHTML += '<i style="background: red"></i><span>Not worked ('+notworkedcount+')</span><br>';
|
||||
return div;
|
||||
};
|
||||
|
||||
legend.addTo(map);
|
||||
|
||||
map.setView([37.460, 139.452], 5);
|
||||
}
|
||||
|
||||
function addMarker(L, D, mapColor, map) {
|
||||
var title = '<span><font style="color: ' +mapColor+ '; text-shadow: 1px 0 #fff, -1px 0 #fff, 0 1px #fff, 0 -1px #fff, 1px 1px #fff, -1px -1px #fff, 1px -1px #fff, -1px 1px #fff;font-size: 14px; font-weight: 900;">' + D['prefix'] + '</font></span>';
|
||||
var myIcon = L.divIcon({className: 'my-div-icon', html: title});
|
||||
|
||||
const markerHtmlStyles = `
|
||||
background-color: ${mapColor};
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
display: block;
|
||||
position: relative;
|
||||
border-radius: 3rem 3rem 0;
|
||||
transform: rotate(45deg);
|
||||
border: 1px solid #FFFFFF`
|
||||
|
||||
const icon = L.divIcon({
|
||||
className: "my-custom-pin",
|
||||
iconAnchor: [0, 24],
|
||||
labelAnchor: [-6, 0],
|
||||
popupAnchor: [0, -36],
|
||||
html: `<span style="${markerHtmlStyles}" />`
|
||||
})
|
||||
|
||||
L.marker(
|
||||
[D['lat'], D['long']], {
|
||||
icon: myIcon,
|
||||
prefix: D['prefix'],
|
||||
title: D['prefix'] + ' - ' + D['name'],
|
||||
}
|
||||
).addTo(map).on('click', onClick);
|
||||
|
||||
L.marker(
|
||||
[D['lat'], D['long']], {
|
||||
icon: icon,
|
||||
prefix: D['prefix'],
|
||||
title: D['prefix'] + ' - ' + D['name'],
|
||||
}
|
||||
).addTo(map).on('click', onClick);
|
||||
}
|
||||
|
||||
function onClick(e) {
|
||||
var marker = e.target;
|
||||
displayContactsOnMap($("#jccmap"),marker.options.prefix, $('#band2').val(), 'All', 'All', $('#mode').val(), 'JCC');
|
||||
}
|
||||
Reference in New Issue
Block a user