dialup admin accounting revers order

Ruslan N. Marchenko ruff at olimp.ua
Fri Jun 8 13:42:49 CEST 2007


Have a suggestion to make a checkbox on accounting page 
which will enable reverse listing order. It is more 
convenient (imho) to see it last-like.

--- 
/usr/share/webapps/freeradius-dialupadmin/1.70.3/htdocs/accounting.php 
     2007-03-01 11:58:34.000000000 +0200
+++ /var/www/adm/htdocs/du/accounting.php       2007-04-28 
10:46:54.000000000 +0300
@@ -147,7 +147,7 @@
  </select>
  <br><br>
  <b>Max results returned:</b><br>
-<input name=maxresults value=$config[sql_row_limit] 
size=5>
+<input name=maxresults value=$config[sql_row_limit] 
size=5> <input type=checkbox name=revers checked> 
<b>Reverse</b>
  </td>
  <td valign=top>
  <input type=hidden name=add value=0>
@@ -219,7 +219,8 @@
                                 ' AND ' . 
${"item_of_w$i"} . ' ' . ${"operator_of_w$i"} . " '" . 
${"value_of_w$i"} . "'" ;
         $i++;
  }
-
+#phpinfo();
+$reverse = ($_REQUEST["revers"] != 'on') ? "ASC" : "DESC" 
;
  $order = ($order_by != '') ? "$order_by" : 'username';

  foreach ($accounting_show_attrs as $val)
@@ -228,7 +229,7 @@
  $sql_extra_query = '';
  if ($config[sql_accounting_extra_query] != '')
         $sql_extra_query = 
sql_xlat($config[sql_accounting_extra_query],$login,$config);
-$query="SELECT $query_view FROM 
$config[sql_accounting_table] $where $sql_extra_query 
ORDER BY $order LIMIT $maxresults;";
+$query="SELECT $query_view FROM 
$config[sql_accounting_table] $where $sql_extra_query 
ORDER BY $order $reverse LIMIT $maxresults;";

  echo <<<EOM
  <html>



--
Olimp, System Administrator IT Dept.
----
Looking forward to reading yours.
  RUFF-RIPE DI76-GANDI RUFF-6BONE
      Ruslan N. Marchenko



More information about the Freeradius-Users mailing list