mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
Add callsign to gridmap filter
This commit is contained in:
@@ -57,6 +57,7 @@ class Gridmap extends CI_Controller {
|
||||
}
|
||||
|
||||
public function getGridsjs() {
|
||||
$call = $this->input->post('call', TRUE);
|
||||
$band = $this->input->post('band', TRUE);
|
||||
$mode = $this->input->post('mode', TRUE);
|
||||
$qsl = $this->input->post('qsl', TRUE);
|
||||
@@ -93,7 +94,7 @@ class Gridmap extends CI_Controller {
|
||||
$grid_4char_confirmed = "";
|
||||
$grid_6char_confirmed = "";
|
||||
|
||||
$query = $this->gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $data['grids'], $datefrom, $dateto);
|
||||
$query = $this->gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $data['grids'], $datefrom, $dateto, null, $call);
|
||||
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
@@ -120,7 +121,7 @@ class Gridmap extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $data['grids'], $datefrom, $dateto);
|
||||
$query = $this->gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $data['grids'], $datefrom, $dateto, null, $call);
|
||||
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
@@ -147,7 +148,7 @@ class Gridmap extends CI_Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
$query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto);
|
||||
$query_vucc = $this->gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, null, $call);
|
||||
|
||||
if ($query_vucc && $query_vucc->num_rows() > 0) {
|
||||
foreach ($query_vucc->result() as $row) {
|
||||
@@ -193,7 +194,7 @@ class Gridmap extends CI_Controller {
|
||||
}
|
||||
|
||||
// // Confirmed Squares
|
||||
$query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto);
|
||||
$query_vucc = $this->gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, null, $call);
|
||||
|
||||
if ($query_vucc && $query_vucc->num_rows() > 0) {
|
||||
foreach ($query_vucc->result() as $row) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class Gridmap_model extends CI_Model {
|
||||
|
||||
function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $grids, $datefrom, $dateto, $logbooks_locations_array = NULL) {
|
||||
function get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $grids, $datefrom, $dateto, $logbooks_locations_array = NULL, $call = '') {
|
||||
if ($logbooks_locations_array == NULL) {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
@@ -21,6 +21,11 @@ class Gridmap_model extends CI_Model {
|
||||
.' WHERE station_id in ('
|
||||
.$location_list.') AND COL_GRIDSQUARE != ""';
|
||||
|
||||
if ($call != '' && $call != '*') {
|
||||
$sql .= " and col_call = ?";
|
||||
$binding[] = $call;
|
||||
}
|
||||
|
||||
if ($band != 'All') {
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and col_prop_mode = ? ";
|
||||
@@ -84,7 +89,7 @@ class Gridmap_model extends CI_Model {
|
||||
return $this->db->query($sql, $binding);
|
||||
}
|
||||
|
||||
function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $grids, $datefrom, $dateto, $logbooks_locations_array = NULL) {
|
||||
function get_band($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $dxcc, $grids, $datefrom, $dateto, $logbooks_locations_array = NULL, $call = '') {
|
||||
if ($logbooks_locations_array == NULL) {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
@@ -103,6 +108,11 @@ class Gridmap_model extends CI_Model {
|
||||
.' WHERE station_id in ('
|
||||
.$location_list.') AND COL_GRIDSQUARE != ""';
|
||||
|
||||
if ($call != '' && $call != '*') {
|
||||
$sql .= " and col_call = ?";
|
||||
$binding[] = $call;
|
||||
}
|
||||
|
||||
if ($band != 'All') {
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and col_prop_mode = ?";
|
||||
@@ -164,7 +174,7 @@ class Gridmap_model extends CI_Model {
|
||||
return $this->db->query($sql, $binding);
|
||||
}
|
||||
|
||||
function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, $logbooks_locations_array = NULL) {
|
||||
function get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, $logbooks_locations_array = NULL, $call = '') {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
@@ -181,6 +191,11 @@ class Gridmap_model extends CI_Model {
|
||||
.' WHERE station_id in ('
|
||||
.$location_list.') AND COL_VUCC_GRIDS != ""';
|
||||
|
||||
if ($call != '' && $call != '*') {
|
||||
$sql .= " and col_call = ?";
|
||||
$binding[] = $call;
|
||||
}
|
||||
|
||||
if ($band != 'All') {
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and col_prop_mode = ?";
|
||||
@@ -236,7 +251,7 @@ class Gridmap_model extends CI_Model {
|
||||
return $this->db->query($sql, $binding);
|
||||
}
|
||||
|
||||
function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, $logbooks_locations_array = NULL) {
|
||||
function get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $qrz, $sat, $orbit, $propagation, $datefrom, $dateto, $logbooks_locations_array = NULL, $call = '') {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
@@ -253,6 +268,11 @@ class Gridmap_model extends CI_Model {
|
||||
.' WHERE station_id in ('
|
||||
.$location_list.') AND COL_VUCC_GRIDS != ""';
|
||||
|
||||
if ($call != '' && $call != '*') {
|
||||
$sql .= " and col_call = ?";
|
||||
$binding[] = $call;
|
||||
}
|
||||
|
||||
if ($band != 'All') {
|
||||
if ($band == 'SAT') {
|
||||
$sql .= " and col_prop_mode = ?";
|
||||
|
||||
@@ -52,6 +52,13 @@
|
||||
</div>
|
||||
|
||||
<!-- Row 1 -->
|
||||
<div class="row mb-2">
|
||||
<label class="form-label col-md-2" for="call"><?= __("Callsign"); ?></label>
|
||||
<div class="col-sm-3">
|
||||
<input onclick="this.select()" type="text" name="call" id="call" class="form-control form-control-sm uppercase" value="*" placeholder="<?= __("Empty"); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<!-- Row 2 -->
|
||||
<div class="row mb-2">
|
||||
<label class="col-md-2" for="band"><?= __("Band"); ?></label>
|
||||
<div class="col-sm-3">
|
||||
@@ -129,7 +136,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Row 2 -->
|
||||
<!-- Row 3 -->
|
||||
<div class="row mb-2">
|
||||
<label class="col-md-2" for="mode"><?= __("Mode"); ?></label>
|
||||
<div class="col-sm-3">
|
||||
|
||||
@@ -117,6 +117,7 @@ function gridPlot(form, visitor=true) {
|
||||
dxcc: $('#dxcc').val(),
|
||||
datefrom: $('#dateFrom').val(),
|
||||
dateto: $('#dateTo').val(),
|
||||
call: $("#call").val(),
|
||||
},
|
||||
success: function (data) {
|
||||
$('.cohidden').show();
|
||||
|
||||
Reference in New Issue
Block a user