Fix form visibility and mode handling for visitor gridmap
Co-authored-by: magicbug <84308+magicbug@users.noreply.github.com>
这个提交包含在:
父节点
251fe3cc35
当前提交
499e752dbd
共有 2 个文件被更改,包括 24 次插入 和 5 次删除
|
|
@ -262,12 +262,25 @@ class Visitor extends CI_Controller {
|
||||||
|
|
||||||
// Get available modes
|
// Get available modes
|
||||||
$modes_query = $this->db->query(
|
$modes_query = $this->db->query(
|
||||||
"SELECT distinct col_mode FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") and coalesce(col_mode, '') <> '' and col_mode <> 'SSB' ORDER BY col_mode"
|
"SELECT distinct col_mode FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") and coalesce(col_mode, '') <> '' ORDER BY col_mode"
|
||||||
);
|
);
|
||||||
$modes = array();
|
$modes = array();
|
||||||
foreach($modes_query->result() as $row){
|
foreach($modes_query->result() as $row){
|
||||||
$modes[] = (object) ['mode' => $row->col_mode, 'submode' => ''];
|
if (!in_array($row->col_mode, $modes)) {
|
||||||
|
array_push($modes, $row->col_mode);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get submodes as well
|
||||||
|
$submodes_query = $this->db->query(
|
||||||
|
"SELECT distinct col_submode FROM ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") and coalesce(col_submode, '') <> '' ORDER BY col_submode"
|
||||||
|
);
|
||||||
|
foreach($submodes_query->result() as $row){
|
||||||
|
if (!in_array($row->col_submode, $modes)) {
|
||||||
|
array_push($modes, $row->col_submode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
asort($modes);
|
||||||
|
|
||||||
$data['bands'] = $bands;
|
$data['bands'] = $bands;
|
||||||
$data['sats_available'] = $sats_available;
|
$data['sats_available'] = $sats_available;
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@
|
||||||
|
|
||||||
<h2><?php echo $page_title; ?></h2>
|
<h2><?php echo $page_title; ?></h2>
|
||||||
|
|
||||||
<?php if ($visitor == false) { ?>
|
|
||||||
<form class="d-flex align-items-center">
|
<form class="d-flex align-items-center">
|
||||||
<label class="my-1 me-2" for="band"><?php echo lang('gridsquares_band'); ?></label>
|
<label class="my-1 me-2" for="band"><?php echo lang('gridsquares_band'); ?></label>
|
||||||
<select class="form-select my-1 me-sm-2 w-auto" id="band">
|
<select class="form-select my-1 me-sm-2 w-auto" id="band">
|
||||||
|
|
@ -75,12 +74,19 @@
|
||||||
<option value="All"><?php echo lang('general_word_all')?></option>
|
<option value="All"><?php echo lang('general_word_all')?></option>
|
||||||
<?php
|
<?php
|
||||||
foreach($modes as $mode){
|
foreach($modes as $mode){
|
||||||
|
if (is_object($mode)) {
|
||||||
|
// Handle object format (from gridmap_model->get_worked_modes())
|
||||||
if ($mode->submode ?? '' == '') {
|
if ($mode->submode ?? '' == '') {
|
||||||
|
echo '<option value="' . $mode->mode . '">' . strtoupper($mode->mode) . '</option>'."\n";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Handle simple string format (from visitor implementation)
|
||||||
echo '<option value="' . $mode . '">' . strtoupper($mode) . '</option>'."\n";
|
echo '<option value="' . $mode . '">' . strtoupper($mode) . '</option>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
<?php if ($visitor == false) { ?>
|
||||||
<label class="my-1 me-2"><?php echo lang('gridsquares_confirmation'); ?></label>
|
<label class="my-1 me-2"><?php echo lang('gridsquares_confirmation'); ?></label>
|
||||||
<div>
|
<div>
|
||||||
<div class="form-check-inline">
|
<div class="form-check-inline">
|
||||||
|
|
@ -116,11 +122,11 @@
|
||||||
<label class="form-check-label" for="qrz">QRZ.com</label>
|
<label class="form-check-label" for="qrz">QRZ.com</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<button id="plot" type="button" name="plot" class="btn btn-primary me-1 ld-ext-right ld-ext-right-plot" onclick="gridPlot(this.form,<?php echo $visitor == true ? "true" : "false"; ?>)"><?php echo lang('gridsquares_button_plot'); ?><div class="ld ld-ring ld-spin"></div></button>
|
<button id="plot" type="button" name="plot" class="btn btn-primary me-1 ld-ext-right ld-ext-right-plot" onclick="gridPlot(this.form,<?php echo $visitor == true ? "true" : "false"; ?>)"><?php echo lang('gridsquares_button_plot'); ?><div class="ld ld-ring ld-spin"></div></button>
|
||||||
<button id="clear" type="button" name="clear" class="btn btn-primary me-1 ld-ext-right ld-ext-right-clear" onclick="clearMarkers()"><?php echo lang('gridsquares_button_clear_markers'); ?><div class="ld ld-ring ld-spin"></div></button>
|
<button id="clear" type="button" name="clear" class="btn btn-primary me-1 ld-ext-right ld-ext-right-clear" onclick="clearMarkers()"><?php echo lang('gridsquares_button_clear_markers'); ?><div class="ld ld-ring ld-spin"></div></button>
|
||||||
</form>
|
</form>
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?php if($this->session->flashdata('message')) { ?>
|
<?php if($this->session->flashdata('message')) { ?>
|
||||||
<!-- Display Message -->
|
<!-- Display Message -->
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用