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(-) (limited to 'pages') 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