Changes by Uli60 https://bugs.cacert.org/view.php?id=955#c2132
authorBernhard Fröhlich <bernhard@cacert.org>
Mon, 1 Aug 2011 20:20:08 +0000 (22:20 +0200)
committerBernhard Fröhlich <bernhard@cacert.org>
Mon, 1 Aug 2011 20:20:08 +0000 (22:20 +0200)
"added ord parameter with fixed querys"

pages/account/25.php [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index ab0e6b2..a460ea0
   <tr>
     <td colspan="5" class="title"><?=_("Organisations")?></td>
   </tr>
+
+<tr>
+  <td colspan="5" class="title">Order by: <a href="account.php?id=25">Id</a> - <a href="account.php?id=25&amp;ord=1">Country</a> - <a href="account.php?id=25&amp;ord=2">Name</a></td>
+</tr>
+
   <tr>
     <td class="DataTD" width="350"><?=_("Organisation")?></td>
     <td class="DataTD"><?=_("Domains")?></td>
     <td class="DataTD"><?=_("Delete")?></td>
   </tr>
 <?
-       $query = "select * from `orginfo` ORDER BY `id`";
+        $order = 0;
+        if (array_key_exists('ord',$_REQUEST)) {
+          if ( $_REQUEST['ord'] != '') {
+            $order = intval($_REQUEST['ord']);
+          }
+          if($order>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 "<tr><td colspan='5'>(".$order.") ".$query."</td></tr>\r\n";
+
        $res = mysql_query($query);
        while($row = mysql_fetch_assoc($res))
        {