From 40f56dbfe7ca2fdcafdafc8be0bdf8423c5907a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Fr=C3=B6hlich?= Date: Mon, 1 Aug 2011 22:20:08 +0200 Subject: Changes by Uli60 https://bugs.cacert.org/view.php?id=955#c2132 "added ord parameter with fixed querys" --- pages/account/25.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) mode change 100644 => 100755 pages/account/25.php diff --git a/pages/account/25.php b/pages/account/25.php old mode 100644 new mode 100755 index ab0e6b2..a460ea0 --- a/pages/account/25.php +++ b/pages/account/25.php @@ -19,6 +19,11 @@ + + + Order by: Id - Country - Name + + @@ -27,7 +32,28 @@ 0 && $order<3) { + if($order==1) { + $query = "select * from `orginfo` ORDER BY `C`,`O`"; + } else { + $query = "select * from `orginfo` ORDER BY `O`"; + } + } else { + $order=0; + $query = "select * from `orginfo` ORDER BY `id`"; + } + } else { + $order=0; + $query = "select * from `orginfo` ORDER BY `id`"; + } + +// echo "(".$order.") ".$query."\r\n"; + $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { -- cgit v1.2.1 From 93714fa661ce6473eacf48d343cd27a8a6c237e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20T=C3=A4nzer?= Date: Wed, 14 Sep 2011 20:50:33 +0200 Subject: bug 955: Allow for the strings to be translated and make the sort order handling more readable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Tänzer --- pages/account/25.php | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/pages/account/25.php b/pages/account/25.php index a460ea0..a70f608 100755 --- a/pages/account/25.php +++ b/pages/account/25.php @@ -21,7 +21,11 @@ - Order by: Id - Country - Name + + - + - + + @@ -32,28 +36,24 @@ 0 && $order<3) { - if($order==1) { - $query = "select * from `orginfo` ORDER BY `C`,`O`"; - } else { - $query = "select * from `orginfo` ORDER BY `O`"; - } - } else { - $order=0; - $query = "select * from `orginfo` ORDER BY `id`"; - } - } else { - $order=0; - $query = "select * from `orginfo` ORDER BY `id`"; - } - -// echo "(".$order.") ".$query."\r\n"; - + $order = 0; + if (array_key_exists('ord',$_REQUEST)) { + $order = intval($_REQUEST['ord']); + } + + $order_by = "`id`"; + switch ($order) { + case 1: + $order_by = "`C`,`O`"; + break; + case 2: + $order_by = "`O`"; + break; + // the 0 and default case are handled by the preset + } + + // Safe because $order_by only contains fixed strings + $query = sprintf("select * from `orginfo` ORDER BY %s", $order_by); $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { -- cgit v1.2.1