From 7fc5db585e4efe7b145572a6fcd23f10374837e1 Mon Sep 17 00:00:00 2001 From: int2001 Date: Thu, 22 Aug 2024 12:05:02 +0000 Subject: [PATCH] Simplify it a bit --- application/models/Timeline_model.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/application/models/Timeline_model.php b/application/models/Timeline_model.php index 25630aea3..d9f562402 100644 --- a/application/models/Timeline_model.php +++ b/application/models/Timeline_model.php @@ -35,22 +35,16 @@ class Timeline_model extends CI_Model { $sql .= " and col_prop_mode = ?"; $binding[] = $band; } else { // Not SAT + if ($band != 'All') { + $sql .= " and col_band = ?"; + $binding[] = $band; + } if ( $propmode == 'All' ) { // Not SAT and Prop=All -> Show everything but not prop_mode SAT $sql .= " and col_prop_mode !='SAT'"; - if ($band != 'All') { - $sql .= " and col_band = ?"; - $binding[] = $band; - } } elseif ($propmode == 'None') { // Not SAT and prop=None --> Take only care of Band (if set) - if ($band != 'All') { - $sql .= " and col_band = ?"; - $binding[] = $band; - } + ; + // No filter } else { // Not SAT and not All and no prop in ('All','None') take care of band and propmode - if ($band != 'All') { - $sql .= " and col_band = ?"; - $binding[] = $band; - } $sql .= " and col_prop_mode = ?"; $binding[] = $propmode; }