Merge pull request #1739 from AndreasK79/wrong_cq_zone
这个提交包含在:
当前提交
64bbed8991
共有 10 个文件被更改,包括 1227 次插入 和 1 次删除
|
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
|||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
$config['migration_version'] = 104;
|
||||
$config['migration_version'] = 105;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -747,6 +747,39 @@ class Logbook extends CI_Controller {
|
|||
|
||||
}
|
||||
|
||||
function search_incorrect_cq_zones($station_id) {
|
||||
$station_id = $this->security->xss_clean($station_id);
|
||||
|
||||
$this->load->model('user_model');
|
||||
|
||||
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
|
||||
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'select *, (select group_concat(distinct cqzone order by cqzone) from dxcc_master where countrycode = thcv.col_dxcc and cqzone <> \'\' order by cqzone asc) as correctcqzone from ' . $this->config->item('table_name') .
|
||||
' thcv join station_profile on thcv.station_id = station_profile.station_id where thcv.station_id in ('. $location_list . ')
|
||||
and not exists (select 1 from dxcc_master where countrycode = thcv.col_dxcc and cqzone = col_cqz) and col_dxcc > 0
|
||||
';
|
||||
|
||||
if ($station_id != 'All') {
|
||||
$sql .= ' and station_profile.station_id = ' . $station_id;
|
||||
}
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
$data['qsos'] = $query;
|
||||
|
||||
$this->load->view('search/cqzones_result.php', $data);
|
||||
}
|
||||
|
||||
/*
|
||||
* Provide a dxcc search, returning results json encoded
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -68,6 +68,18 @@ class Search extends CI_Controller {
|
|||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
// Searches for incorrect CQ Zones
|
||||
public function incorrect_cq_zones() {
|
||||
$this->load->model('stations');
|
||||
|
||||
$data['station_profile'] = $this->stations->all_of_user();
|
||||
$data['page_title'] = "Incorrectly logged CQ zones";
|
||||
|
||||
$this->load->view('interface_assets/header', $data);
|
||||
$this->load->view('search/cqzones');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
function json_result() {
|
||||
if(isset($_POST['search'])) {
|
||||
$result = $this->fetchQueryResult($_POST['search'], false);
|
||||
|
|
|
|||
文件差异内容过多而无法显示
加载差异
|
|
@ -920,6 +920,29 @@ function findduplicates(){
|
|||
});
|
||||
}
|
||||
|
||||
function findincorrectcqzones() {
|
||||
event.preventDefault();
|
||||
$('#partial_view').load(base_url+"index.php/logbook/search_incorrect_cq_zones/"+$("#station_id").val(), function() {
|
||||
$('.qsolist').DataTable({
|
||||
"pageLength": 25,
|
||||
responsive: false,
|
||||
ordering: false,
|
||||
"scrollY": "500px",
|
||||
"scrollCollapse": true,
|
||||
"paging": false,
|
||||
"scrollX": true,
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'csv'
|
||||
]
|
||||
});
|
||||
// change color of csv-button if dark mode is chosen
|
||||
if (isDarkModeTheme()) {
|
||||
$(".buttons-csv").css("color", "white");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function searchButtonPress(){
|
||||
event.preventDefault()
|
||||
if ($('#callsign').val()) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
<div class="container search">
|
||||
|
||||
<h1>
|
||||
Search
|
||||
<small class="text-muted">Ready to find a QSO?</small>
|
||||
</h1>
|
||||
|
||||
<div class="card text-center">
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo site_url('search'); ?>">Search</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo site_url('search/filter'); ?>">Advanced Search</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo site_url('search/duplicates'); ?>">Duplicate QSOs</a>
|
||||
</li>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="<?php echo site_url('search/incorrect_cq_zones'); ?>">Incorrect CQ Zones</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post" action="" id="search_box" name="test">
|
||||
<div class="form-group row">
|
||||
<label for="callsign" class="col-sm-2 col-form-label">Station location:</label>
|
||||
<select id="station_id" name="station_profile" class="custom-select col-sm-3 mb-3 mr-sm-3">
|
||||
<option value="All">All</option>
|
||||
<?php foreach ($station_profile->result() as $station) { ?>
|
||||
<option value="<?php echo $station->station_id; ?>">Callsign: <?php echo $station->station_callsign; ?> (<?php echo $station->station_profile_name; ?>)</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<div class="col-sm-2">
|
||||
<button onclick="findincorrectcqzones();" class="btn btn-outline-success my-2 my-sm-0" type="submit"><i class="fas fa-search"></i> Search</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="partial_view"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
if ($qsos->result() != NULL) {
|
||||
Echo 'The following QSOs were found to have an incorrect CQ zone that this DXCC normally has:';
|
||||
echo '<table style="width:100%" class="qsolist table-sm table-bordered table-hover table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style=\'text-align: center\'>Date</th>
|
||||
<th style=\'text-align: center\'>Time</th>
|
||||
<th style=\'text-align: center\'>'.$this->lang->line('gen_hamradio_callsign').'</th>
|
||||
<th style=\'text-align: center\'>' . $this->lang->line('gen_hamradio_mode') . '</th>
|
||||
<th style=\'text-align: center\'>' . $this->lang->line('gen_hamradio_band') . '</th>
|
||||
<th style=\'text-align: center\'>CQ Zone</th>
|
||||
<th style=\'text-align: center\'>DXCC CQ Zone</th>
|
||||
<th style=\'text-align: center\'>DXCC</th>
|
||||
<th style=\'text-align: center\'>' . $this->lang->line('gen_hamradio_station') . '</th>
|
||||
</tr>
|
||||
</thead><tbody>';
|
||||
|
||||
// Get 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 {
|
||||
// Get Default date format from /config/cloudlog.php
|
||||
$custom_date_format = $this->config->item('qso_date_format');
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
|
||||
foreach ($qsos->result() as $qso) {
|
||||
echo '<tr>';
|
||||
echo '<td style=\'text-align: center\'>'; $timestamp = strtotime($qso->COL_TIME_ON); echo date($custom_date_format, $timestamp); echo '</td>';
|
||||
echo '<td style=\'text-align: center\'>'; $timestamp = strtotime($qso->COL_TIME_ON); echo date('H:i', $timestamp); echo '</td>';
|
||||
echo '<td style=\'text-align: center\'><a id="edit_qso" href="javascript:displayQso(' . $qso->COL_PRIMARY_KEY . ')">' . str_replace("0","Ø",strtoupper($qso->COL_CALL)) . '</a></td>';
|
||||
echo '<td style=\'text-align: center\'>'; echo $qso->COL_SUBMODE==null?$qso->COL_MODE:$qso->COL_SUBMODE; echo '</td>';
|
||||
echo '<td style=\'text-align: center\'>'; if($qso->COL_SAT_NAME != null) { echo $qso->COL_SAT_NAME; } else { echo strtolower($qso->COL_BAND); }; echo '</td>';
|
||||
echo '<td style=\'text-align: center\'>' . $qso->COL_CQZ . '</td>';
|
||||
echo '<td style=\'text-align: center\'>' . $qso->correctcqzone . '</td>';
|
||||
echo '<td style=\'text-align: center\'>' . ucwords(strtolower($qso->COL_COUNTRY), "- (/") . '</td>';
|
||||
echo '<td style=\'text-align: center\'><span class="badge badge-light">' . $qso->station_callsign . '</span></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo '</tbody></table>';
|
||||
?>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
echo '<div class="alert alert-danger"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>No duplicate QSO\'s were found.</div>';
|
||||
}
|
||||
?>
|
||||
|
|
@ -16,6 +16,10 @@
|
|||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="<?php echo site_url('search/duplicates'); ?>">Duplicate QSOs</a>
|
||||
</li>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo site_url('search/incorrect_cq_zones'); ?>">Incorrect CQ Zones</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@
|
|||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo site_url('search/duplicates'); ?>">Duplicate QSOs</a>
|
||||
</li>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo site_url('search/incorrect_cq_zones'); ?>">Incorrect CQ Zones</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo site_url('search/duplicates'); ?>">Duplicate QSOs</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?php echo site_url('search/incorrect_cq_zones'); ?>">Incorrect CQ Zones</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
正在加载…
在新工单中引用