From 116d0ea2e13e133ce65047129491c405429f0e51 Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 25 Oct 2023 04:53:03 +0000 Subject: [PATCH] Added sorting like printing and callbook-lookup to Label-List --- application/models/Qslprint_model.php | 16 ++++++++++++++-- application/views/qslprint/qslprint.php | 3 ++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/application/models/Qslprint_model.php b/application/models/Qslprint_model.php index 548696067..cd8878bf8 100644 --- a/application/models/Qslprint_model.php +++ b/application/models/Qslprint_model.php @@ -79,7 +79,13 @@ class Qslprint_model extends CI_Model { // always filter user. this ensures that even if the station_id is from another user no inaccesible QSOs will be returned $this->db->where('station_profile.user_id', $this->session->userdata('user_id')); $this->db->where_in('COL_QSL_SENT', array('R', 'Q')); - $this->db->order_by("COL_TIME_ON", "DESC"); + $this->db->order_by("COL_DXCC", "ASC"); + $this->db->order_by("COL_CALL", "ASC"); + $this->db->order_by("COL_SAT_NAME", "ASC"); + $this->db->order_by("COL_SAT_MODE", "ASC"); + $this->db->order_by("COL_BAND_RX", "ASC"); + $this->db->order_by("COL_TIME_ON", "ASC"); + $this->db->order_by("COL_MODE", "ASC"); $query = $this->db->get($this->config->item('table_name')); return $query; @@ -133,7 +139,13 @@ class Qslprint_model extends CI_Model { $this->db->where('station_profile.user_id', $this->session->userdata('user_id')); $this->db->where('COL_CALL like "%'.$callsign.'%"'); $this->db->where('coalesce(COL_QSL_SENT, "") not in ("R", "Q")'); - $this->db->order_by("COL_TIME_ON", "DESC"); + $this->db->order_by("COL_DXCC", "ASC"); + $this->db->order_by("COL_CALL", "ASC"); + $this->db->order_by("COL_SAT_NAME", "ASC"); + $this->db->order_by("COL_SAT_MODE", "ASC"); + $this->db->order_by("COL_BAND_RX", "ASC"); + $this->db->order_by("COL_TIME_ON", "ASC"); + $this->db->order_by("COL_MODE", "ASC"); $query = $this->db->get($this->config->item('table_name')); return $query; diff --git a/application/views/qslprint/qslprint.php b/application/views/qslprint/qslprint.php index a9dbd0f9b..1af5b3a1c 100644 --- a/application/views/qslprint/qslprint.php +++ b/application/views/qslprint/qslprint.php @@ -43,7 +43,8 @@ if ($qsos->result() != NULL) { foreach ($qsos->result() as $qsl) { echo ''; echo '
'; - echo '' . $qsl->COL_CALL . ''; + ?>COL_CALL)); ?> Lookup <?php echo strtoupper($qsl->COL_CALL); ?> on QRZ.com Lookup <?php echo strtoupper($qsl->COL_CALL); ?> on HamQTH Lookup <?php echo strtoupper($qsl->COL_CALL); ?> on eQSL.cc' . $qsl->COL_CALL . ''; echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date($custom_date_format, $timestamp); echo ''; echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); echo ''; echo ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo '';