mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
[Location list] A very early draft
This commit is contained in:
@@ -519,4 +519,13 @@ class Stationsetup extends CI_Controller {
|
||||
$this->user_options_model->set_option('ExportMapOptions', 'qsocount', array($slug => xss_clean($this->input->post('qsocount'))));
|
||||
$this->user_options_model->set_option('ExportMapOptions', 'band', array($slug => xss_clean($this->input->post('band'))));
|
||||
}
|
||||
|
||||
public function list_locations() {
|
||||
$this->load->model('stationsetup_model');
|
||||
$data['locations'] = $this->stationsetup_model->list_all_locations()->result();
|
||||
$data['page_title'] = __("Station location list");
|
||||
$this->load->view('interface_assets/header');
|
||||
$this->load->view('stationsetup/locationlist', $data);
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,6 +232,15 @@ class Stationsetup_model extends CI_Model {
|
||||
|
||||
return $this->db->get();
|
||||
}
|
||||
|
||||
function list_all_locations() {
|
||||
$sql = "select station_profile_name, station_gridsquare, station_city, station_iota, station_sota, station_callsign, station_power, station_dxcc, station_cnty, station_cq, station_itu, station_active, eqslqthnickname, state, county, station_sig, station_sig_info, qrzrealtime, station_wwff, station_pota, oqrs, oqrs_text, oqrs_email, webadifrealtime, clublogrealtime, clublogignore, hrdlogrealtime, creation_date, last_modified
|
||||
from station_profile
|
||||
where user_id = ?";
|
||||
|
||||
$query = $this->db->query($sql, array($this->session->userdata('user_id')));
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
27
application/views/stationsetup/locationlist.php
Normal file
27
application/views/stationsetup/locationlist.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<h1><?= $page_title ?></h1>
|
||||
|
||||
<?php if (!empty($locations)): ?>
|
||||
<table style="width:100%" class="table-sm table table-bordered table-hover table-striped table-condensed text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
// Dynamically create table headers based on object keys
|
||||
$first_row = (array)$locations[0];
|
||||
foreach (array_keys($first_row) as $key): ?>
|
||||
<th><?= ucfirst(str_replace('_', ' ', $key)) ?></th>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($locations as $loc): ?>
|
||||
<tr>
|
||||
<?php foreach ((array)$loc as $val): ?>
|
||||
<td><?php echo $val; ?></td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="no-data">No locations found.</div>
|
||||
<?php endif; ?>
|
||||
@@ -101,7 +101,9 @@
|
||||
<?= __("The 'Linked' column shows if the station location is linked with the Active Logbook selected above."); ?>
|
||||
</p>
|
||||
|
||||
<p><a href="<?php echo site_url('station/create'); ?>" class="btn btn-sm btn-primary"><i class="fas fa-plus"></i> <?= __("Create a Station Location"); ?></a> <button onclick="filterlocations();" class="btn btn-sm btn-success"><?= __("Show only locations from the active logbook"); ?></button> <button onclick="removefilterlocations();" class="btn btn-sm btn-success"><?= __("Show all locations"); ?></button></p>
|
||||
<p><a href="<?php echo site_url('station/create'); ?>" class="btn btn-sm btn-primary"><i class="fas fa-plus"></i> <?= __("Create a Station Location"); ?></a> <button onclick="filterlocations();" class="btn btn-sm btn-success"><?= __("Show only locations from the active logbook"); ?></button>
|
||||
<button onclick="removefilterlocations();" class="btn btn-sm btn-success"><?= __("Show all locations"); ?></button>
|
||||
<a href="<?php echo site_url('stationsetup/list_locations'); ?>" class="btn btn-sm btn-success"><?= __("Show a location list"); ?></a></p>
|
||||
|
||||
<?php if($current_active == 0) { ?>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
|
||||
Reference in New Issue
Block a user