Merge branch 'magicbug:master' into master

这个提交包含在:
Emiliano 2024-05-16 11:33:46 +02:00 提交者 GitHub
当前提交 50d4696190
找不到此签名对应的密钥
GPG 密钥 ID: B5690EEEBB952194
共有 7 个文件被更改,包括 277 次插入17 次删除

查看文件

@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
*/
$config['migration_version'] = 181;
$config['migration_version'] = 182;
/*
|--------------------------------------------------------------------------

查看文件

@ -515,12 +515,73 @@ class Awards extends CI_Controller
$this->load->view('interface_assets/footer');
}
public function gmdxsummer()
{
// Load the GMDX Summer Challenge model
$this->load->model('gmdxsummer_model');
// Get Week 1
$data['week1_6m_cw'] = $this->gmdxsummer_model->get_week('2024-05-26 18:00:00', '6m', 'CW');
$data['week1_6m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-05-26 18:00:00', '6m');
$data['week1_6m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-05-26 18:00:00', '6m');
$data['week1_6m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-05-26 18:00:00', '6m');
$data['week1_4m_cw'] = $this->gmdxsummer_model->get_week('2024-05-26 18:00:00', '4m', 'CW');
$data['week1_4m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-05-26 18:00:00', '4m');
$data['week1_4m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-05-26 18:00:00', '4m');
$data['week1_4m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-05-26 18:00:00', '4m');
// Get Week 2
$data['week2_6m_cw'] = $this->gmdxsummer_model->get_week('2024-06-09 18:00:00', '6m', 'CW');
$data['week2_6m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-06-09 18:00:00', '6m');
$data['week2_6m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-06-09 18:00:00', '6m');
$data['week2_6m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-06-09 18:00:00', '6m');
$data['week2_4m_cw'] = $this->gmdxsummer_model->get_week('2024-06-09 18:00:00', '4m', 'CW');
$data['week2_4m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-06-09 18:00:00', '4m');
$data['week2_4m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-06-09 18:00:00', '4m');
$data['week2_4m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-06-09 18:00:00', '4m');
// Get Week 3
$data['week3_6m_cw'] = $this->gmdxsummer_model->get_week('2024-06-23 18:00:00', '6m', 'CW');
$data['week3_6m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-06-23 18:00:00', '6m');
$data['week3_6m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-06-23 18:00:00', '6m');
$data['week3_6m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-06-23 18:00:00', '6m');
$data['week3_4m_cw'] = $this->gmdxsummer_model->get_week('2024-06-23 18:00:00', '4m', 'CW');
$data['week3_4m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-06-23 18:00:00', '4m');
$data['week3_4m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-06-23 18:00:00', '4m');
$data['week3_4m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-06-23 18:00:00', '4m');
// Get Week 4
$data['week4_6m_cw'] = $this->gmdxsummer_model->get_week('2024-07-01 18:00:00', '6m', 'CW');
$data['week4_6m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-07-01 18:00:00', '6m');
$data['week4_6m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-07-01 18:00:00', '6m');
$data['week4_6m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-07-01 18:00:00', '6m');
$data['week4_4m_cw'] = $this->gmdxsummer_model->get_week('2024-07-01 18:00:00', '4m', 'CW');
$data['week4_4m_ssb'] = $this->gmdxsummer_model->get_week_voice('2024-07-01 18:00:00', '4m');
$data['week4_4m_digital'] = $this->gmdxsummer_model->get_week_digital('2024-07-01 18:00:00', '4m');
$data['week4_4m_combined'] = $this->gmdxsummer_model->get_week_combined('2024-07-01 18:00:00', '4m');
// Render page
$data['page_title'] = "Awards - GMDX Summer Challenge";
$this->load->view('interface_assets/header', $data);
$this->load->view('awards/gmdxsummer/index');
$this->load->view('interface_assets/footer');
}
public function wab_details_ajax()
{
$this->load->model('logbook_model');
$wab = str_replace('"', "", $this->security->xss_clean($this->input->post("Wab")));
$wab = str_replace(["Small Square ", " Boundry Box"], "", $wab);
$data['results'] = $this->logbook_model->wab_qso_details($wab);

查看文件

@ -297,23 +297,13 @@ class Lotw extends CI_Controller {
//Tell cURL to return the output as a string.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//If the function curl_file_create exists
if(function_exists('curl_file_create')){
//Use the recommended way, creating a CURLFile object.
$filePath = curl_file_create($filePath);
} else{
//Otherwise, do it the old way.
//Get the canonicalized pathname of our file and prepend
//the @ character.
$filePath = '@' . realpath($filePath);
//Turn off SAFE UPLOAD so that it accepts files
//starting with an @
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);
}
//Use the recommended way, creating a CURLFile object.
$uploadfile = curl_file_create($filePath);
$uploadfile->setPostFilename(basename($filePath));
//Setup our POST fields
$postFields = array(
$uploadFieldName => $filePath
$uploadFieldName => $uploadfile
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
@ -967,7 +957,7 @@ class Lotw extends CI_Controller {
openssl_free_key($pkeyid);
}
$signature_b64 = base64_encode($signature);
return $signature_b64;
return $signature_b64."\n";
}

查看文件

@ -0,0 +1,30 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* Tag Cloudlog as 2.6.12
*/
class Migration_tag_2_6_12 extends CI_Migration {
public function up()
{
// Tag Cloudlog 2.6.12
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.6.12'));
// Trigger Version Info Dialog
$this->db->where('option_type', 'version_dialog');
$this->db->where('option_name', 'confirmed');
$this->db->update('user_options', array('option_value' => 'false'));
}
public function down()
{
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.6.11'));
}
}

查看文件

@ -0,0 +1,86 @@
<?php
class Gmdxsummer_model extends CI_Model
{
public function get_week($end_date, $band, $mode)
{
$table_name = $this->config->item('table_name');
$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) . "'";
$query = $this->db->query("
SELECT COUNT(DISTINCT SUBSTRING(COL_GRIDSQUARE, 1, 4)) AS count
FROM " . $table_name . "
WHERE station_id in (" . $location_list . ") AND COL_MODE = '" . $mode . "' AND COL_BAND = '" . $band . "'
AND (COL_TIME_ON >= '2024-05-13 00:00:00' AND COL_TIME_ON <= '" . $end_date . "')
");
return $query->row()->count;
}
public function get_week_voice($end_date, $band)
{
$table_name = $this->config->item('table_name');
$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) . "'";
$query = $this->db->query("
SELECT COUNT(DISTINCT SUBSTRING(COL_GRIDSQUARE, 1, 4)) AS count
FROM " . $table_name . "
WHERE station_id in (".$location_list.") AND COL_MODE IN ('SSB', 'AM', 'FM') AND COL_BAND = '" . $band . "'
AND (COL_TIME_ON >= '2024-05-13 00:00:00' AND COL_TIME_ON <= '" . $end_date . "')
");
return $query->row()->count;
}
public function get_week_digital($end_date, $band)
{
$table_name = $this->config->item('table_name');
$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) . "'";
$query = $this->db->query("
SELECT COUNT(DISTINCT SUBSTRING(COL_GRIDSQUARE, 1, 4)) AS count
FROM " . $table_name . "
WHERE station_id in (".$location_list.") AND COL_MODE NOT IN ('CW', 'FM', 'SSB', 'AM') AND COL_BAND = '" . $band . "'
AND (COL_TIME_ON >= '2024-05-13 00:00:00' AND COL_TIME_ON <= '" . $end_date . "')
");
return $query->row()->count;
}
public function get_week_combined($end_date, $band)
{
$table_name = $this->config->item('table_name');
$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) . "'";
$query = $this->db->query("
SELECT COUNT(DISTINCT SUBSTRING(COL_GRIDSQUARE, 1, 4)) AS count
FROM " . $table_name . "
WHERE station_id in (".$location_list.") AND COL_BAND = '" . $band . "'
AND (COL_TIME_ON >= '2024-05-13 00:00:00' AND COL_TIME_ON <= '" . $end_date . "')
");
return $query->row()->count;
}
}

查看文件

@ -0,0 +1,91 @@
<div class="container">
<!-- Award Info Box -->
<br>
<div id="awardInfoButton">
<h2><?php echo $page_title; ?></h2>
</div>
<!-- End of Award Info Box -->
<div class="card">
<div class="card-header">
What is the GMDX Summer Challenge?
</div>
<div class="card-body">
<p class="card-text">The GMDX Summer Challenge will takes place over 6 weeks beginning 00:00 on Monday 13th May until 2359 on Sunday 30th June.</p>
<p class="card-text">The Summer Challenge is a single event using CW, SSB or Digital Modes on both 4m and 6m. GMDX members are expected not to set up FT8 in automated robot mode. You are trusted to operate your station manually.</p>
<p class="card-text">The overall winner will have worked the most 4 digit maidenhead locator squares (eg IO75) on 4m and 6m to give the highest combined score. DXCC Countries are not counted, only locator squares. In order to have the leading score, it is expected operators would have to make contacts on both 4m and 6m using all modes.</p>
<p class="card-text">All GMDX members worldwide are welcome to enter.</p>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSek4GlQzx7OXJBxYh-KCLdK86_yRbqXGL1rTl1dFXmTlkpdlA/viewform" class="btn btn-primary" target="_blank">Submit your entry</a>
</div>
</div>
<div class="card">
<div class="card-header">
Fortnightly Breakdown
</div>
<div class="card-body">
<table class="table table-striped table-hover">
<tr>
<td>Week</td>
<td>6m SSB</td>
<td>6m CW</td>
<td>6m Digital</td>
<td>6m Combined</td>
<td>4m SSB</td>
<td>4m CW</td>
<td>4m Digital</td>
<td>4m Combined</td>
</tr>
<tr>
<td>18:00 on Sunday 26th May</td>
<td><?php echo $week1_6m_ssb; ?></td>
<td><?php echo $week1_6m_cw; ?></td>
<td><?php echo $week1_6m_digital; ?></td>
<td><?php echo $week1_6m_combined; ?></td>
<td><?php echo $week1_4m_ssb; ?></td>
<td><?php echo $week1_4m_cw; ?></td>
<td><?php echo $week1_4m_digital; ?></td>
<td><?php echo $week1_4m_combined; ?></td>
</tr>
<tr>
<td>18:00 on Sunday 9th June</td>
<td><?php echo $week2_6m_ssb; ?></td>
<td><?php echo $week2_6m_cw; ?></td>
<td><?php echo $week2_6m_digital; ?></td>
<td><?php echo $week2_6m_combined; ?></td>
<td><?php echo $week2_4m_ssb; ?></td>
<td><?php echo $week2_4m_cw; ?></td>
<td><?php echo $week2_4m_digital; ?></td>
<td><?php echo $week2_4m_combined; ?></td>
</tr>
<tr>
<td>18:00 on Sunday 23th June</td>
<td><?php echo $week3_6m_ssb; ?></td>
<td><?php echo $week3_6m_cw; ?></td>
<td><?php echo $week3_6m_digital; ?></td>
<td><?php echo $week3_6m_combined; ?></td>
<td><?php echo $week3_4m_ssb; ?></td>
<td><?php echo $week3_4m_cw; ?></td>
<td><?php echo $week3_4m_digital; ?></td>
<td><?php echo $week3_4m_combined; ?></td>
</tr>
<tr>
<td>18:00 on Monday 1st July</td>
<td><?php echo $week4_6m_ssb; ?></td>
<td><?php echo $week4_6m_cw; ?></td>
<td><?php echo $week4_6m_digital; ?></td>
<td><?php echo $week4_6m_combined; ?></td>
<td><?php echo $week4_4m_ssb; ?></td>
<td><?php echo $week4_4m_cw; ?></td>
<td><?php echo $week4_4m_digital; ?></td>
<td><?php echo $week4_4m_combined; ?></td>
</tr>
</table>
</div>
</div>
</div>

查看文件

@ -161,6 +161,8 @@
</ul>
</div>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo site_url('awards/gmdxsummer'); ?>"><i class="fas fa-trophy"></i> GMDX Summer Challenge</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo site_url('awards/pota'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_pota'); ?></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?php echo site_url('awards/sig'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_sig'); ?></a>