[Awards] Fixed implode error when logbook is empty
这个提交包含在:
父节点
914333693c
当前提交
8c7fa355fb
共有 16 个文件被更改,包括 121 次插入 和 10 次删除
|
|
@ -235,13 +235,11 @@ class Awards extends CI_Controller {
|
|||
$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)."'";
|
||||
|
||||
$this->load->model('cq');
|
||||
$this->load->model('modes');
|
||||
$this->load->model('bands');
|
||||
|
||||
$data['worked_bands'] = $this->bands->get_worked_bands($location_list);
|
||||
$data['worked_bands'] = $this->bands->get_worked_bands();
|
||||
$data['modes'] = $this->modes->active(); // Used in the view for mode select
|
||||
|
||||
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
|
||||
|
|
@ -277,8 +275,15 @@ class Awards extends CI_Controller {
|
|||
$postdata['mode'] = 'All';
|
||||
}
|
||||
|
||||
$data['cq_array'] = $this->cq->get_cq_array($bands, $postdata, $location_list);
|
||||
$data['cq_summary'] = $this->cq->get_cq_summary($data['worked_bands'], $location_list);
|
||||
if ($logbooks_locations_array) {
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
$data['cq_array'] = $this->cq->get_cq_array($bands, $postdata, $location_list);
|
||||
$data['cq_summary'] = $this->cq->get_cq_summary($data['worked_bands'], $location_list);
|
||||
} else {
|
||||
$location_list = null;
|
||||
$data['cq_array'] = null;
|
||||
$data['cq_summary'] = null;
|
||||
}
|
||||
|
||||
// Render page
|
||||
$data['page_title'] = "Awards - CQ Magazine";
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ class Bands extends CI_Model {
|
|||
$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 array();
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
// get all worked slots from database
|
||||
|
|
@ -67,6 +71,9 @@ class Bands extends CI_Model {
|
|||
$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 array();
|
||||
}
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
// get all worked slots from database
|
||||
|
|
@ -93,6 +100,10 @@ class Bands extends CI_Model {
|
|||
$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 array();
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
// get all worked sats from database
|
||||
|
|
@ -113,6 +124,10 @@ class Bands extends CI_Model {
|
|||
$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 array();
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
// get all worked slots from database
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ class Counties extends CI_Model
|
|||
$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 count(distinct COL_CNTY) countycountworked, coalesce(x.countycountconfirmed, 0) countycountconfirmed, thcv.COL_STATE
|
||||
|
|
@ -75,6 +79,10 @@ class Counties extends CI_Model
|
|||
$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 distinct COL_CNTY, COL_STATE
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ class DOK extends CI_Model {
|
|||
$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;
|
||||
}
|
||||
|
||||
$this->load->model('bands');
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
|
|
|||
|
|
@ -63,6 +63,10 @@ class DXCC extends CI_Model {
|
|||
$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) { // Looping through bands and entities to generate the array needed for display
|
||||
|
|
@ -193,6 +197,10 @@ class DXCC extends CI_Model {
|
|||
$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 adif, prefix, name, date(end) Enddate, date(start) Startdate
|
||||
|
|
@ -387,6 +395,10 @@ class DXCC extends CI_Model {
|
|||
$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) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ class IOTA extends CI_Model {
|
|||
$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) { // Looping through bands and iota to generate the array needed for display
|
||||
|
|
@ -279,6 +283,10 @@ class IOTA extends CI_Model {
|
|||
$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) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ class Sig extends CI_Model {
|
|||
$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;
|
||||
}
|
||||
|
||||
$this->db->where_in("station_id", $logbooks_locations_array);
|
||||
$this->db->order_by("COL_SIG_INFO", "ASC");
|
||||
$this->db->where('COL_SIG =', $type);
|
||||
|
|
@ -19,6 +23,10 @@ class Sig extends CI_Model {
|
|||
$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 col_sig, count(*) qsos, count(distinct col_sig_info) refs from " . $this->config->item('table_name') .
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ class Sota extends CI_Model {
|
|||
$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;
|
||||
}
|
||||
|
||||
$this->db->where_in("station_id", $logbooks_locations_array);
|
||||
$this->db->order_by("COL_SOTA_REF", "ASC");
|
||||
$this->db->where('COL_SOTA_REF !=', '');
|
||||
|
|
|
|||
|
|
@ -87,6 +87,10 @@ class VUCC extends CI_Model
|
|||
$vuccArray['All']['worked'] = count($totalGridWorked);
|
||||
$vuccArray['All']['confirmed'] = count($totalGridConfirmed);
|
||||
|
||||
if ($vuccArray['All']['worked'] == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $vuccArray;
|
||||
}
|
||||
|
||||
|
|
@ -100,6 +104,10 @@ class VUCC extends CI_Model
|
|||
$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 col_vucc_grids
|
||||
|
|
@ -140,6 +148,10 @@ class VUCC extends CI_Model
|
|||
$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 distinct upper(substring(col_gridsquare, 1, 4)) gridsquare
|
||||
|
|
|
|||
|
|
@ -9,7 +9,11 @@ class was extends CI_Model {
|
|||
$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)."'";
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$stateArray = explode(',', $this->stateString);
|
||||
|
||||
|
|
@ -82,6 +86,10 @@ class was extends CI_Model {
|
|||
$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) {
|
||||
|
|
|
|||
|
|
@ -29,5 +29,8 @@
|
|||
</tr></tfoot>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } ?>
|
||||
<?php } else {
|
||||
echo '<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Nothing found!</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
|
@ -3,6 +3,10 @@
|
|||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<table class="table table-sm table-striped table-hover">
|
||||
<?php
|
||||
if ($worked_bands) {
|
||||
?>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width:225px">DOKs (<?php echo count($doks)?>)</td>
|
||||
|
|
@ -33,5 +37,7 @@
|
|||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<?php } else {
|
||||
echo '<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Nothing found!</div>';
|
||||
} ?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
<div class="container">
|
||||
|
||||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<?php
|
||||
if ($sota_all) {
|
||||
?>
|
||||
|
||||
<table class="table table-sm table-striped table-hover">
|
||||
|
||||
|
|
@ -34,4 +38,7 @@
|
|||
?>
|
||||
|
||||
</table>
|
||||
<?php } else {
|
||||
echo '<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Nothing found!</div>';
|
||||
}?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<div class="container">
|
||||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<?php if (!empty($vucc_array)) { ?>
|
||||
|
||||
<table class="table table-sm table-bordered table-hover table-striped table-condensed text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -20,4 +22,8 @@
|
|||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php } else {
|
||||
echo '<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>Nothing found!</div>';
|
||||
} ?>
|
||||
</div>
|
||||
|
|
@ -78,7 +78,9 @@
|
|||
<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>
|
||||
<button type="button" onclick="load_was_map();" class="btn btn-info btn-sm"><i class="fas fa-globe-americas"></i> Show WAS Map</button>
|
||||
<?php if ($was_array) {
|
||||
?><button type="button" onclick="load_was_map();" class="btn btn-info btn-sm"><i class="fas fa-globe-americas"></i> Show WAS Map</button>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@
|
|||
fill: 'blue'
|
||||
},
|
||||
'stateSpecificStyles': {
|
||||
<?php foreach ($was_array as $was => $value) { ?>
|
||||
<?php
|
||||
if ($was_array) {
|
||||
foreach ($was_array as $was => $value) { ?>
|
||||
'<?php echo $was; ?>' :
|
||||
<?php
|
||||
foreach ($value as $key) {
|
||||
|
|
@ -52,6 +54,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
},
|
||||
// Show tooltip when hovering over state
|
||||
|
|
|
|||
正在加载…
在新工单中引用