[Awards] Addad WAJA
这个提交包含在:
父节点
e5bfa97009
当前提交
50fef635d5
共有 9 个文件被更改,包括 766 次插入 和 6 次删除
|
|
@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$config['migration_version'] = 155;
|
$config['migration_version'] = 156;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,80 @@ class Awards extends CI_Controller {
|
||||||
$this->load->view('interface_assets/footer');
|
$this->load->view('interface_assets/footer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function waja () {
|
||||||
|
$footerData = [];
|
||||||
|
$footerData['scripts'] = [
|
||||||
|
'assets/js/sections/wajamap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/wajamap.js"))
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->load->model('waja');
|
||||||
|
$this->load->model('modes');
|
||||||
|
$this->load->model('bands');
|
||||||
|
|
||||||
|
$data['worked_bands'] = $this->bands->get_worked_bands('waja');
|
||||||
|
$data['modes'] = $this->modes->active();
|
||||||
|
|
||||||
|
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
|
||||||
|
if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands
|
||||||
|
$bands = $data['worked_bands'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$bands[] = $this->security->xss_clean($this->input->post('band'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$bands = $data['worked_bands'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view
|
||||||
|
|
||||||
|
if($this->input->method() === 'post') {
|
||||||
|
$postdata['qsl'] = $this->security->xss_clean($this->input->post('qsl'));
|
||||||
|
$postdata['lotw'] = $this->security->xss_clean($this->input->post('lotw'));
|
||||||
|
$postdata['eqsl'] = $this->security->xss_clean($this->input->post('eqsl'));
|
||||||
|
$postdata['worked'] = $this->security->xss_clean($this->input->post('worked'));
|
||||||
|
$postdata['confirmed'] = $this->security->xss_clean($this->input->post('confirmed'));
|
||||||
|
$postdata['notworked'] = $this->security->xss_clean($this->input->post('notworked'));
|
||||||
|
$postdata['includedeleted'] = $this->security->xss_clean($this->input->post('includedeleted'));
|
||||||
|
$postdata['Africa'] = $this->security->xss_clean($this->input->post('Africa'));
|
||||||
|
$postdata['Asia'] = $this->security->xss_clean($this->input->post('Asia'));
|
||||||
|
$postdata['Europe'] = $this->security->xss_clean($this->input->post('Europe'));
|
||||||
|
$postdata['NorthAmerica'] = $this->security->xss_clean($this->input->post('NorthAmerica'));
|
||||||
|
$postdata['SouthAmerica'] = $this->security->xss_clean($this->input->post('SouthAmerica'));
|
||||||
|
$postdata['Oceania'] = $this->security->xss_clean($this->input->post('Oceania'));
|
||||||
|
$postdata['Antarctica'] = $this->security->xss_clean($this->input->post('Antarctica'));
|
||||||
|
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
|
||||||
|
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
|
||||||
|
}
|
||||||
|
else { // Setting default values at first load of page
|
||||||
|
$postdata['qsl'] = 1;
|
||||||
|
$postdata['lotw'] = 1;
|
||||||
|
$postdata['eqsl'] = 0;
|
||||||
|
$postdata['worked'] = 1;
|
||||||
|
$postdata['confirmed'] = 1;
|
||||||
|
$postdata['notworked'] = 1;
|
||||||
|
$postdata['includedeleted'] = 0;
|
||||||
|
$postdata['Africa'] = 1;
|
||||||
|
$postdata['Asia'] = 1;
|
||||||
|
$postdata['Europe'] = 1;
|
||||||
|
$postdata['NorthAmerica'] = 1;
|
||||||
|
$postdata['SouthAmerica'] = 1;
|
||||||
|
$postdata['Oceania'] = 1;
|
||||||
|
$postdata['Antarctica'] = 1;
|
||||||
|
$postdata['band'] = 'All';
|
||||||
|
$postdata['mode'] = 'All';
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['waja_array'] = $this->waja->get_waja_array($bands, $postdata);
|
||||||
|
$data['waja_summary'] = $this->waja->get_waja_summary($bands, $postdata);
|
||||||
|
|
||||||
|
// Render Page
|
||||||
|
$data['page_title'] = "Awards - WAJA";
|
||||||
|
$this->load->view('interface_assets/header', $data);
|
||||||
|
$this->load->view('awards/waja/index');
|
||||||
|
$this->load->view('interface_assets/footer');
|
||||||
|
}
|
||||||
|
|
||||||
public function vucc() {
|
public function vucc() {
|
||||||
$this->load->model('vucc');
|
$this->load->model('vucc');
|
||||||
$this->load->model('bands');
|
$this->load->model('bands');
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ $lang['menu_sota'] = 'SOTA';
|
||||||
$lang['menu_us_counties'] = 'US Counties';
|
$lang['menu_us_counties'] = 'US Counties';
|
||||||
$lang['menu_us_gridmaster'] = 'US Gridmaster';
|
$lang['menu_us_gridmaster'] = 'US Gridmaster';
|
||||||
$lang['menu_vucc'] = 'VUCC';
|
$lang['menu_vucc'] = 'VUCC';
|
||||||
|
$lang['menu_waja'] = 'WAJA';
|
||||||
$lang['menu_was'] = 'WAS';
|
$lang['menu_was'] = 'WAS';
|
||||||
$lang['menu_wwff'] = 'WWFF';
|
$lang['menu_wwff'] = 'WWFF';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Migration_add_waja_bandxuser extends CI_Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$fields = array(
|
||||||
|
'waja TINYINT NOT NULL DEFAULT 1',
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!$this->db->field_exists('clublogrealtime', 'bandxuser')) {
|
||||||
|
$this->dbforge->add_column('bandxuser', $fields);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
if ($this->db->field_exists('waja', 'bandxuser')) {
|
||||||
|
$this->dbforge->drop_column('bandxuser', 'waja');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -379,6 +379,10 @@ class Logbook_model extends CI_Model {
|
||||||
case 'DOK':
|
case 'DOK':
|
||||||
$this->db->where('COL_DARC_DOK', $searchphrase);
|
$this->db->where('COL_DARC_DOK', $searchphrase);
|
||||||
break;
|
break;
|
||||||
|
case 'WAJA':
|
||||||
|
$this->db->where('COL_STATE', $searchphrase);
|
||||||
|
$this->db->where_in('COL_DXCC', ['339']);
|
||||||
|
break;
|
||||||
case 'QSLRDATE':
|
case 'QSLRDATE':
|
||||||
$this->db->where('date(COL_QSLRDATE)=date(SYSDATE())');
|
$this->db->where('date(COL_QSLRDATE)=date(SYSDATE())');
|
||||||
break;
|
break;
|
||||||
|
|
@ -577,7 +581,7 @@ class Logbook_model extends CI_Model {
|
||||||
$this->mark_clublog_qsos_sent($last_id);
|
$this->mark_clublog_qsos_sent($last_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
$result = $this->exists_hrdlog_code($data['station_id']);
|
$result = $this->exists_hrdlog_code($data['station_id']);
|
||||||
// Push qso to hrdlog if code is set, and realtime upload is enabled, and we're not importing an adif-file
|
// Push qso to hrdlog if code is set, and realtime upload is enabled, and we're not importing an adif-file
|
||||||
|
|
@ -731,7 +735,7 @@ class Logbook_model extends CI_Model {
|
||||||
} else {
|
} else {
|
||||||
$returner['status']=$response;
|
$returner['status']=$response;
|
||||||
}
|
}
|
||||||
curl_close ($request);
|
curl_close ($request);
|
||||||
return ($returner);
|
return ($returner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
402
application/models/Waja.php
普通文件
402
application/models/Waja.php
普通文件
|
|
@ -0,0 +1,402 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class WAJA extends CI_Model {
|
||||||
|
|
||||||
|
public $jaPrefectures = array(
|
||||||
|
'01' => 'Hokkaido',
|
||||||
|
'02' => 'Aomori',
|
||||||
|
'03' => 'Iwate',
|
||||||
|
'04' => 'Akita',
|
||||||
|
'05' => 'Yamagata',
|
||||||
|
'06' => 'Miyagi',
|
||||||
|
'07' => 'Fukushima',
|
||||||
|
'08' => 'Niigata',
|
||||||
|
'09' => 'Nagano',
|
||||||
|
'10' => 'Tokyo',
|
||||||
|
'11' => 'Kanagawa',
|
||||||
|
'12' => 'Chiba',
|
||||||
|
'13' => 'Saitama',
|
||||||
|
'14' => 'Ibaraki',
|
||||||
|
'15' => 'Tochigi',
|
||||||
|
'16' => 'Gunma',
|
||||||
|
'17' => 'Yamanashi',
|
||||||
|
'18' => 'Shizuoka',
|
||||||
|
'19' => 'Gifu',
|
||||||
|
'20' => 'Aichi',
|
||||||
|
'21' => 'Mie',
|
||||||
|
'22' => 'Kyoto',
|
||||||
|
'23' => 'Shiga',
|
||||||
|
'24' => 'Nara',
|
||||||
|
'25' => 'Osaka',
|
||||||
|
'26' => 'Wakayama',
|
||||||
|
'27' => 'Hyogo',
|
||||||
|
'28' => 'Toyama',
|
||||||
|
'29' => 'Fukui',
|
||||||
|
'30' => 'Ishikawa',
|
||||||
|
'31' => 'Okayama',
|
||||||
|
'32' => 'Shimane',
|
||||||
|
'33' => 'Yamaguchi',
|
||||||
|
'34' => 'Tottori',
|
||||||
|
'35' => 'Hiroshima',
|
||||||
|
'36' => 'Kagawa',
|
||||||
|
'37' => 'Tokushima',
|
||||||
|
'38' => 'Ehime',
|
||||||
|
'39' => 'Kochi',
|
||||||
|
'40' => 'Fukuoka',
|
||||||
|
'41' => 'Saga',
|
||||||
|
'42' => 'Nagasaki',
|
||||||
|
'43' => 'Kumamoto',
|
||||||
|
'44' => 'Oita',
|
||||||
|
'45' => 'Miyazaki',
|
||||||
|
'46' => 'Kagoshima',
|
||||||
|
'47' => 'Okinawa');
|
||||||
|
|
||||||
|
public $prefectureString = '01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47';
|
||||||
|
|
||||||
|
function get_waja_array($bands, $postdata) {
|
||||||
|
$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)."'";
|
||||||
|
|
||||||
|
$wajaArray = explode(',', $this->prefectureString);
|
||||||
|
|
||||||
|
$prefectures = array(); // Used for keeping track of which states that are not worked
|
||||||
|
|
||||||
|
$qsl = "";
|
||||||
|
if ($postdata['confirmed'] != NULL) {
|
||||||
|
if ($postdata['qsl'] != NULL ) {
|
||||||
|
$qsl .= "Q";
|
||||||
|
}
|
||||||
|
if ($postdata['lotw'] != NULL ) {
|
||||||
|
$qsl .= "L";
|
||||||
|
}
|
||||||
|
if ($postdata['eqsl'] != NULL ) {
|
||||||
|
$qsl .= "E";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($wajaArray as $state) { // Generating array for use in the table
|
||||||
|
$prefectures[$state]['count'] = 0; // Inits each state's count
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($bands as $band) {
|
||||||
|
foreach ($wajaArray as $state) { // Generating array for use in the table
|
||||||
|
$bandWaja[$state]['Number'] = $state;
|
||||||
|
$bandWaja[$state]['Prefecture'] = $this->jaPrefectures[$state];
|
||||||
|
$bandWaja[$state][$band] = '-'; // Sets all to dash to indicate no result
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($postdata['worked'] != NULL) {
|
||||||
|
$wajaBand = $this->getWajaWorked($location_list, $band, $postdata);
|
||||||
|
foreach ($wajaBand as $line) {
|
||||||
|
$bandWaja[$line->col_state][$band] = '<div class="bg-danger awardsBgDanger"><a href=\'javascript:displayContacts("' . $line->col_state . '","' . $band . '","'. $postdata['mode'] . '","WAJA", "")\'>W</a></div>';
|
||||||
|
$prefectures[$line->col_state]['count']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($postdata['confirmed'] != NULL) {
|
||||||
|
$wajaBand = $this->getWajaConfirmed($location_list, $band, $postdata);
|
||||||
|
foreach ($wajaBand as $line) {
|
||||||
|
$bandWaja[$line->col_state][$band] = '<div class="bg-success awardsBgSuccess"><a href=\'javascript:displayContacts("' . $line->col_state . '","' . $band . '","'. $postdata['mode'] . '","WAJA", "'.$qsl.'")\'>C</a></div>';
|
||||||
|
$prefectures[$line->col_state]['count']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// We want to remove the worked states in the list, since we do not want to display them
|
||||||
|
if ($postdata['worked'] == NULL) {
|
||||||
|
$wajaBand = $this->getWajaWorked($location_list, $postdata['band'], $postdata);
|
||||||
|
foreach ($wajaBand as $line) {
|
||||||
|
unset($bandWaja[$line->col_state]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// We want to remove the confirmed states in the list, since we do not want to display them
|
||||||
|
if ($postdata['confirmed'] == NULL) {
|
||||||
|
$wasBand = $this->getWajaConfirmed($location_list, $postdata['band'], $postdata);
|
||||||
|
foreach ($wasBand as $line) {
|
||||||
|
unset($bandWaja[$line->col_state]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($postdata['notworked'] == NULL) {
|
||||||
|
foreach ($wajaArray as $state) {
|
||||||
|
if ($prefectures[$state]['count'] == 0) {
|
||||||
|
unset($bandWaja[$state]);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($bandWaja)) {
|
||||||
|
return $bandWaja;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getWajaBandConfirmed($location_list, $band, $postdata) {
|
||||||
|
$sql = "select adif as waja, name from dxcc_entities
|
||||||
|
join (
|
||||||
|
select col_dxcc from ".$this->config->item('table_name')." thcv
|
||||||
|
where station_id in (" . $location_list .
|
||||||
|
") and col_dxcc > 0";
|
||||||
|
|
||||||
|
$sql .= $this->addBandToQuery($band);
|
||||||
|
|
||||||
|
if ($postdata['mode'] != 'All') {
|
||||||
|
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= $this->addQslToQuery($postdata);
|
||||||
|
|
||||||
|
$sql .= " group by col_dxcc
|
||||||
|
) x on dxcc_entities.adif = x.col_dxcc";
|
||||||
|
|
||||||
|
if ($postdata['includedeleted'] == NULL) {
|
||||||
|
$sql .= " and dxcc_entities.end is null";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= $this->addContinentsToQuery($postdata);
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
function getWajaBandWorked($location_list, $band, $postdata) {
|
||||||
|
$sql = "select adif as waja, name from dxcc_entities
|
||||||
|
join (
|
||||||
|
select col_dxcc from ".$this->config->item('table_name')." thcv
|
||||||
|
where station_id in (" . $location_list .
|
||||||
|
") and col_dxcc > 0";
|
||||||
|
|
||||||
|
$sql .= $this->addBandToQuery($band);
|
||||||
|
|
||||||
|
if ($postdata['mode'] != 'All') {
|
||||||
|
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= " group by col_dxcc
|
||||||
|
) x on dxcc_entities.adif = x.col_dxcc";;
|
||||||
|
|
||||||
|
if ($postdata['includedeleted'] == NULL) {
|
||||||
|
$sql .= " and dxcc_entities.end is null";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= $this->addContinentsToQuery($postdata);
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
function addBandToQuery($band) {
|
||||||
|
$sql = '';
|
||||||
|
if ($band != 'All') {
|
||||||
|
if ($band == 'SAT') {
|
||||||
|
$sql .= " and col_prop_mode ='" . $band . "'";
|
||||||
|
} else {
|
||||||
|
$sql .= " and col_prop_mode !='SAT'";
|
||||||
|
$sql .= " and col_band ='" . $band . "'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $sql;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function returns all worked, but not confirmed states
|
||||||
|
* $postdata contains data from the form, in this case Lotw or QSL are used
|
||||||
|
*/
|
||||||
|
function getWajaWorked($location_list, $band, $postdata) {
|
||||||
|
$sql = "SELECT distinct col_state FROM " . $this->config->item('table_name') . " thcv
|
||||||
|
where station_id in (" . $location_list . ")";
|
||||||
|
|
||||||
|
if ($postdata['mode'] != 'All') {
|
||||||
|
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= $this->addStateToQuery();
|
||||||
|
|
||||||
|
$sql .= $this->addBandToQuery($band);
|
||||||
|
|
||||||
|
$sql .= " and not exists (select 1 from ". $this->config->item('table_name') .
|
||||||
|
" where station_id in (". $location_list . ")" .
|
||||||
|
" and col_state = thcv.col_state";
|
||||||
|
|
||||||
|
if ($postdata['mode'] != 'All') {
|
||||||
|
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= $this->addBandToQuery($band);
|
||||||
|
|
||||||
|
$sql .= $this->addQslToQuery($postdata);
|
||||||
|
|
||||||
|
$sql .= $this->addStateToQuery();
|
||||||
|
|
||||||
|
$sql .= ")";
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function returns all confirmed states on given band and on LoTW or QSL
|
||||||
|
* $postdata contains data from the form, in this case Lotw or QSL are used
|
||||||
|
*/
|
||||||
|
function getWajaConfirmed($location_list, $band, $postdata) {
|
||||||
|
$sql = "SELECT distinct col_state FROM " . $this->config->item('table_name') . " thcv
|
||||||
|
where station_id in (" . $location_list . ")";
|
||||||
|
|
||||||
|
if ($postdata['mode'] != 'All') {
|
||||||
|
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= $this->addStateToQuery();
|
||||||
|
|
||||||
|
$sql .= $this->addBandToQuery($band);
|
||||||
|
|
||||||
|
$sql .= $this->addQslToQuery($postdata);
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Made function instead of repeating this several times
|
||||||
|
function addQslToQuery($postdata) {
|
||||||
|
$sql = '';
|
||||||
|
$qsl = array();
|
||||||
|
if ($postdata['lotw'] != NULL || $postdata['qsl'] != NULL || $postdata['eqsl'] != NULL) {
|
||||||
|
$sql .= ' and (';
|
||||||
|
if ($postdata['qsl'] != NULL) {
|
||||||
|
array_push($qsl, "col_qsl_rcvd = 'Y'");
|
||||||
|
}
|
||||||
|
if ($postdata['lotw'] != NULL) {
|
||||||
|
array_push($qsl, "col_lotw_qsl_rcvd = 'Y'");
|
||||||
|
}
|
||||||
|
if ($postdata['eqsl'] != NULL) {
|
||||||
|
array_push($qsl, "col_eqsl_qsl_rcvd = 'Y'");
|
||||||
|
}
|
||||||
|
$sql .= implode(' or ', $qsl);
|
||||||
|
$sql .= ')';
|
||||||
|
}
|
||||||
|
return $sql;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function gets worked and confirmed summary on each band on the active stationprofile
|
||||||
|
*/
|
||||||
|
function get_waja_summary($bands, $postdata)
|
||||||
|
{
|
||||||
|
$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)."'";
|
||||||
|
|
||||||
|
foreach ($bands as $band) {
|
||||||
|
$worked = $this->getSummaryByBand($band, $postdata, $location_list);
|
||||||
|
$confirmed = $this->getSummaryByBandConfirmed($band, $postdata, $location_list);
|
||||||
|
$wajaSummary['worked'][$band] = $worked[0]->count;
|
||||||
|
$wajaSummary['confirmed'][$band] = $confirmed[0]->count;
|
||||||
|
}
|
||||||
|
|
||||||
|
$workedTotal = $this->getSummaryByBand($postdata['band'], $postdata, $location_list);
|
||||||
|
$confirmedTotal = $this->getSummaryByBandConfirmed($postdata['band'], $postdata, $location_list);
|
||||||
|
|
||||||
|
$wajaSummary['worked']['Total'] = $workedTotal[0]->count;
|
||||||
|
$wajaSummary['confirmed']['Total'] = $confirmedTotal[0]->count;
|
||||||
|
|
||||||
|
return $wajaSummary;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSummaryByBand($band, $postdata, $location_list)
|
||||||
|
{
|
||||||
|
$sql = "SELECT count(distinct thcv.col_state) as count FROM " . $this->config->item('table_name') . " thcv";
|
||||||
|
|
||||||
|
$sql .= " where station_id in (" . $location_list . ")";
|
||||||
|
|
||||||
|
if ($band == 'SAT') {
|
||||||
|
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
|
||||||
|
} else if ($band == 'All') {
|
||||||
|
$this->load->model('bands');
|
||||||
|
|
||||||
|
$bandslots = $this->bands->get_worked_bands('was');
|
||||||
|
|
||||||
|
$bandslots_list = "'".implode("','",$bandslots)."'";
|
||||||
|
|
||||||
|
$sql .= " and thcv.col_band in (" . $bandslots_list . ")" .
|
||||||
|
" and thcv.col_prop_mode !='SAT'";
|
||||||
|
} else {
|
||||||
|
$sql .= " and thcv.col_prop_mode !='SAT'";
|
||||||
|
$sql .= " and thcv.col_band ='" . $band . "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($postdata['mode'] != 'All') {
|
||||||
|
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= $this->addStateToQuery();
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSummaryByBandConfirmed($band, $postdata, $location_list)
|
||||||
|
{
|
||||||
|
$sql = "SELECT count(distinct thcv.col_state) as count FROM " . $this->config->item('table_name') . " thcv";
|
||||||
|
|
||||||
|
$sql .= " where station_id in (" . $location_list . ")";
|
||||||
|
|
||||||
|
if ($band == 'SAT') {
|
||||||
|
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
|
||||||
|
} else if ($band == 'All') {
|
||||||
|
$this->load->model('bands');
|
||||||
|
|
||||||
|
$bandslots = $this->bands->get_worked_bands('was');
|
||||||
|
|
||||||
|
$bandslots_list = "'".implode("','",$bandslots)."'";
|
||||||
|
|
||||||
|
$sql .= " and thcv.col_band in (" . $bandslots_list . ")" .
|
||||||
|
" and thcv.col_prop_mode !='SAT'";
|
||||||
|
} else {
|
||||||
|
$sql .= " and thcv.col_prop_mode !='SAT'";
|
||||||
|
$sql .= " and thcv.col_band ='" . $band . "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($postdata['mode'] != 'All') {
|
||||||
|
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= $this->addQslToQuery($postdata);
|
||||||
|
|
||||||
|
$sql .= $this->addStateToQuery();
|
||||||
|
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function addStateToQuery() {
|
||||||
|
$sql = '';
|
||||||
|
$sql .= " and COL_DXCC in ('339')";
|
||||||
|
$sql .= " and COL_STATE in ($this->prefectureString)";
|
||||||
|
return $sql;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
@ -0,0 +1,220 @@
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#dxccmap {
|
||||||
|
height: calc(100vh - 500px) !important;
|
||||||
|
max-height: 900px !important;
|
||||||
|
}
|
||||||
|
/*Legend specific*/
|
||||||
|
.legend {
|
||||||
|
padding: 6px 8px;
|
||||||
|
font: 14px Arial, Helvetica, sans-serif;
|
||||||
|
background: white;
|
||||||
|
background: rgba(255, 255, 255, 0.8);
|
||||||
|
line-height: 24px;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
.legend h4 {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 16px;
|
||||||
|
margin: 2px 12px 8px;
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
.legend span {
|
||||||
|
position: relative;
|
||||||
|
bottom: 3px;
|
||||||
|
}
|
||||||
|
.legend i {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
float: left;
|
||||||
|
margin: 0 8px 0 0;
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="container">
|
||||||
|
<!-- Award Info Box -->
|
||||||
|
<br>
|
||||||
|
<div id="awardInfoButton">
|
||||||
|
<script>
|
||||||
|
var lang_awards_info_button = "<?php echo lang('awards_info_button'); ?>";
|
||||||
|
var lang_award_info_ln1 = "<?php echo lang('awards_dxcc_description_ln1'); ?>";
|
||||||
|
var lang_award_info_ln2 = "<?php echo lang('awards_dxcc_description_ln2'); ?>";
|
||||||
|
var lang_award_info_ln3 = "<?php echo lang('awards_dxcc_description_ln3'); ?>";
|
||||||
|
var lang_award_info_ln4 = "<?php echo lang('awards_dxcc_description_ln4'); ?>";
|
||||||
|
</script>
|
||||||
|
<h2><?php echo $page_title; ?></h2>
|
||||||
|
<button type="button" class="btn btn-sm btn-primary me-1" id="displayAwardInfo"><?php echo lang('awards_info_button'); ?></button>
|
||||||
|
</div>
|
||||||
|
<!-- End of Award Info Box -->
|
||||||
|
|
||||||
|
<form class="form" action="<?php echo site_url('awards/waja'); ?>" method="post" enctype="multipart/form-data">
|
||||||
|
<fieldset>
|
||||||
|
|
||||||
|
<div class="mb-3 row">
|
||||||
|
<div class="col-md-2" for="checkboxes">Worked / Confirmed</div>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<div class="form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" name="worked" id="worked" value="1" <?php if ($this->input->post('worked') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
|
||||||
|
<label class="form-check-label" for="worked">Show worked</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" name="confirmed" id="confirmed" value="1" <?php if ($this->input->post('confirmed') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
|
||||||
|
<label class="form-check-label" for="confirmed">Show confirmed</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" name="notworked" id="notworked" value="1" <?php if ($this->input->post('notworked') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
|
||||||
|
<label class="form-check-label" for="notworked">Show not worked</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3 row">
|
||||||
|
<div class="col-md-2">QSL Type</div>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<div class="form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" name="qsl" value="1" id="qsl" <?php if ($this->input->post('qsl') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
|
||||||
|
<label class="form-check-label" for="qsl">QSL</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" name="lotw" value="1" id="lotw" <?php if ($this->input->post('lotw') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
|
||||||
|
<label class="form-check-label" for="lotw">LoTW</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" name="eqsl" value="1" id="eqsl" <?php if ($this->input->post('eqsl')) echo ' checked="checked"'; ?> >
|
||||||
|
<label class="form-check-label" for="eqsl">eQSL</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3 row">
|
||||||
|
<label class="col-md-2 control-label" for="band">Band</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<select id="band2" name="band" class="form-select form-select-sm">
|
||||||
|
<option value="All" <?php if ($this->input->post('band') == "All" || $this->input->method() !== 'post') echo ' selected'; ?> >Every band</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">
|
||||||
|
<label class="col-md-2 control-label" for="mode">Mode</label>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<select id="mode" name="mode" class="form-select form-select-sm">
|
||||||
|
<option value="All" <?php if ($this->input->post('mode') == "All" || $this->input->method() !== 'mode') echo ' selected'; ?>>All</option>
|
||||||
|
<?php
|
||||||
|
foreach($modes->result() as $mode){
|
||||||
|
if ($mode->submode == null) {
|
||||||
|
echo '<option value="' . $mode->mode . '"';
|
||||||
|
if ($this->input->post('mode') == $mode->mode) echo ' selected';
|
||||||
|
echo '>'. $mode->mode . '</option>'."\n";
|
||||||
|
} else {
|
||||||
|
echo '<option value="' . $mode->submode . '"';
|
||||||
|
if ($this->input->post('mode') == $mode->submode) echo ' selected';
|
||||||
|
echo '>' . $mode->submode . '</option>'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3 row">
|
||||||
|
<label class="col-md-2 control-label" for="button1id"></label>
|
||||||
|
<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 ($waja_array) {
|
||||||
|
?><button type="button" onclick="load_dxcc_map();" class="btn btn-info btn-sm"><i class="fas fa-globe-americas"></i> Show WAJA Map</button>
|
||||||
|
<?php }?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||||
|
<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">Table</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" id="map-tab" onclick="load_dxcc_map();" data-bs-toggle="tab" href="#dxccmaptab" role="tab" aria-controls="home" aria-selected="false">Map</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div class="tab-content" id="myTabContent">
|
||||||
|
<div class="tab-pane fade" id="dxccmaptab" role="tabpanel" aria-labelledby="home-tab">
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div id="dxccmap"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade show active" id="table" role="tabpanel" aria-labelledby="table-tab">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$i = 1;
|
||||||
|
if ($waja_array) {
|
||||||
|
echo '
|
||||||
|
<table style="width:100%" class="table-sm table tablewaja table-bordered table-hover table-striped table-condensed text-center">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td>Number</td>
|
||||||
|
<td>Prefecture</td>';
|
||||||
|
|
||||||
|
foreach($bands as $band) {
|
||||||
|
echo '<td>' . $band . '</td>';
|
||||||
|
}
|
||||||
|
echo '</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>';
|
||||||
|
foreach ($waja_array as $dxcc => $value) { // Fills the table with the data
|
||||||
|
echo '<tr>';
|
||||||
|
foreach ($value as $name => $key) {
|
||||||
|
echo '<td style="text-align: center">' . $key . '</td>';
|
||||||
|
}
|
||||||
|
echo '</tr>';
|
||||||
|
}
|
||||||
|
echo '</table>
|
||||||
|
<h2>Summary</h2>
|
||||||
|
|
||||||
|
<table class="table-sm tablesummary table table-bordered table-hover table-striped table-condensed text-center">
|
||||||
|
<thead>
|
||||||
|
<tr><td></td>';
|
||||||
|
|
||||||
|
foreach($bands as $band) {
|
||||||
|
echo '<td>' . $band . '</td>';
|
||||||
|
}
|
||||||
|
echo '<td>Total</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<tr><td>Total worked</td>';
|
||||||
|
|
||||||
|
foreach ($waja_summary['worked'] as $dxcc) { // Fills the table with the data
|
||||||
|
echo '<td style="text-align: center">' . $dxcc . '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</tr><tr>
|
||||||
|
<td>Total confirmed</td>';
|
||||||
|
foreach ($waja_summary['confirmed'] as $dxcc) { // Fills the table with the data
|
||||||
|
echo '<td style="text-align: center">' . $dxcc . '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</tr>
|
||||||
|
</table>
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo '<div class="alert alert-danger" role="alert"><a href="#" class="btn-close" data-bs-dismiss="alert" aria-label="close">×</a>Nothing found!</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/*
|
/*
|
||||||
General Language
|
General Language
|
||||||
*/
|
*/
|
||||||
var lang_general_word_qso_data = "<?php echo lang('general_word_qso_data'); ?>";
|
var lang_general_word_qso_data = "<?php echo lang('general_word_qso_data'); ?>";
|
||||||
|
|
@ -78,7 +78,7 @@ function load_was_map() {
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
@ -762,7 +762,7 @@ function showActivatorsMap(call, count, grids) {
|
||||||
<?php if ($this->uri->segment(1) == "" || $this->uri->segment(1) == "dashboard" ) { ?>
|
<?php if ($this->uri->segment(1) == "" || $this->uri->segment(1) == "dashboard" ) { ?>
|
||||||
<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.Maidenhead.js"></script>
|
<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.Maidenhead.js"></script>
|
||||||
<script id="leafembed" type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/leafembed.js" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script>
|
<script id="leafembed" type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/leafembed.js" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
$('[data-bs-toggle="tooltip"]').tooltip()
|
$('[data-bs-toggle="tooltip"]').tooltip()
|
||||||
|
|
@ -1919,6 +1919,40 @@ $(document).ready(function(){
|
||||||
</script>
|
</script>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php if ($this->uri->segment(2) == "waja") { ?>
|
||||||
|
<script>
|
||||||
|
$('.tablewaja').DataTable({
|
||||||
|
"pageLength": 25,
|
||||||
|
responsive: false,
|
||||||
|
ordering: false,
|
||||||
|
"scrollY": "400px",
|
||||||
|
"scrollCollapse": true,
|
||||||
|
"paging": false,
|
||||||
|
"scrollX": true,
|
||||||
|
dom: 'Bfrtip',
|
||||||
|
buttons: [
|
||||||
|
'csv'
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.tablesummary').DataTable({
|
||||||
|
info: false,
|
||||||
|
searching: false,
|
||||||
|
ordering: false,
|
||||||
|
"paging": false,
|
||||||
|
dom: 'Bfrtip',
|
||||||
|
buttons: [
|
||||||
|
'csv'
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// change color of csv-button if dark mode is chosen
|
||||||
|
if (isDarkModeTheme()) {
|
||||||
|
$(".buttons-csv").css("color", "white");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<?php if ($this->uri->segment(2) == "vucc_band") { ?>
|
<?php if ($this->uri->segment(2) == "vucc_band") { ?>
|
||||||
<script>
|
<script>
|
||||||
$('.tablevucc').DataTable({
|
$('.tablevucc').DataTable({
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,8 @@
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" href="<?php echo site_url('awards/vucc'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_vucc'); ?></a>
|
<a class="dropdown-item" href="<?php echo site_url('awards/vucc'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_vucc'); ?></a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
|
<a class="dropdown-item" href="<?php echo site_url('awards/waja'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_waja'); ?></a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" href="<?php echo site_url('awards/was'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_was'); ?></a>
|
<a class="dropdown-item" href="<?php echo site_url('awards/was'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_was'); ?></a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" href="<?php echo site_url('awards/wwff'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_wwff'); ?></a>
|
<a class="dropdown-item" href="<?php echo site_url('awards/wwff'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_wwff'); ?></a>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用