summaryrefslogtreecommitdiff
path: root/pages/account
diff options
context:
space:
mode:
authorBernhard Fröhlich <bernhard@cacert.org>2011-09-25 16:51:25 +0200
committerBernhard Fröhlich <bernhard@cacert.org>2011-09-25 16:51:25 +0200
commitedf7a9208da1f325bb172b05e022234c8204d639 (patch)
treed6c31d69713658a9d4b1be65f3e282f1c68e633a /pages/account
parent863618723ff55b4ebb19da4f5144ca7790e8748c (diff)
parent93714fa661ce6473eacf48d343cd27a8a6c237e4 (diff)
downloadcacert-devel-edf7a9208da1f325bb172b05e022234c8204d639.tar.gz
cacert-devel-edf7a9208da1f325bb172b05e022234c8204d639.tar.xz
cacert-devel-edf7a9208da1f325bb172b05e022234c8204d639.zip
Merge branch 'bug-955' into release
Diffstat (limited to 'pages/account')
-rwxr-xr-x[-rw-r--r--]pages/account/25.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/pages/account/25.php b/pages/account/25.php
index ab0e6b2..a70f608 100644..100755
--- a/pages/account/25.php
+++ b/pages/account/25.php
@@ -19,6 +19,15 @@
<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>
@@ -27,7 +36,24 @@
<td class="DataTD"><?=_("Delete")?></td>
</tr>
<?
- $query = "select * from `orginfo` ORDER BY `id`";
+ $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))
{