Destinations/Extensions/Voicemails: Better sorting ability.
This commit is contained in:
@@ -40,10 +40,8 @@ else {
|
||||
|
||||
//get the http values and set them as variables
|
||||
$search = check_str($_GET["search"]);
|
||||
if (isset($_GET["order_by"])) {
|
||||
$order_by = check_str($_GET["order_by"]);
|
||||
$order = check_str($_GET["order"]);
|
||||
}
|
||||
$order_by = check_str($_GET["order_by"]);
|
||||
$order = check_str($_GET["order"]);
|
||||
|
||||
//includes and title
|
||||
require_once "resources/header.php";
|
||||
@@ -113,7 +111,17 @@ else {
|
||||
$sql .= " or destination_description like '%".$search."%' ";
|
||||
$sql .= ") ";
|
||||
}
|
||||
if (strlen($order_by) > 0) { $sql .= "order by $order_by $order "; }
|
||||
if (strlen($order_by) > 0) {
|
||||
if ($order_by == 'destination_type') {
|
||||
$sql .= "order by destination_type ".$order.", destination_number asc ";
|
||||
}
|
||||
else {
|
||||
$sql .= "order by ".$order_by." ".$order." ";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql .= "order by destination_type asc, destination_number asc ";
|
||||
}
|
||||
$sql .= "limit $rows_per_page offset $offset ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
|
||||
Reference in New Issue
Block a user