From 0c4e87b6e4283212ef5fe8958d84a9159df17452 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 12 Jan 2015 15:27:05 -0500 Subject: [PATCH] #92 Update print_tickets.inc.php --- inc/print_tickets.inc.php | 49 +++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/inc/print_tickets.inc.php b/inc/print_tickets.inc.php index b6204a27..1605a249 100644 --- a/inc/print_tickets.inc.php +++ b/inc/print_tickets.inc.php @@ -1,7 +1,7 @@ $v) +{ + if ($v['use']) + { + $sql_final .= ", `".$k."`"; + } +} + +$sql_final.= " FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE "; // This code will be used to count number of results $sql_count = "SELECT COUNT(*) FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE "; @@ -87,11 +122,15 @@ while ($row = $results->fetch_assoc()) } $status = $possible_status; -foreach ($status as $k => $v) +// Process statuses unless overridden with "s_all" variable +if ( ! hesk_GET('s_all') ) { - if (empty($_GET['s'.$k])) + foreach ($status as $k => $v) { - unset($status[$k]); + if (empty($_GET['s' . $k])) + { + unset($status[$k]); + } } }