Fix the order the IVR Menus are listed in.
This commit is contained in:
parent
5daa2ac037
commit
8c03d88b8b
|
|
@ -209,8 +209,7 @@ include "root.php";
|
||||||
$this->connect();
|
$this->connect();
|
||||||
}
|
}
|
||||||
//get data from the database
|
//get data from the database
|
||||||
$sql = "";
|
$sql = " select * from ".$this->table." ";
|
||||||
$sql .= " select * from ".$this->table." ";
|
|
||||||
if ($this->where) {
|
if ($this->where) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach($this->where as $row) {
|
foreach($this->where as $row) {
|
||||||
|
|
@ -223,21 +222,18 @@ include "root.php";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->order_by) {
|
if (count($this->order_by) > 0) {
|
||||||
$sql .= "order by ";
|
$sql .= "order by ";
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($this->order_by as $row) {
|
foreach($this->order_by as $row) {
|
||||||
if (count($this->order_by) == $i) {
|
if (count($this->order_by) == $i) {
|
||||||
$sql .= $row['name']." ";
|
$sql .= $row['name']." ".$row['order']." ";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$sql .= $row['name'].", ";
|
$sql .= $row['name']." ".$row['order'].", ";
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if ($this->order_type) {
|
|
||||||
$sql .= $this->order_type." ";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ($this->limit) {
|
if ($this->limit) {
|
||||||
$sql .= " limit ".$this->limit." offset ".$this->offset." ";
|
$sql .= " limit ".$this->limit." offset ".$this->offset." ";
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ include "root.php";
|
||||||
public $ivr_menu_option_param;
|
public $ivr_menu_option_param;
|
||||||
public $ivr_menu_option_order;
|
public $ivr_menu_option_order;
|
||||||
public $ivr_menu_option_description;
|
public $ivr_menu_option_description;
|
||||||
|
public $order_by; //array
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
require_once "includes/classes/database.php";
|
require_once "includes/classes/database.php";
|
||||||
|
|
@ -151,9 +152,6 @@ include "root.php";
|
||||||
if (isset($this->order_by)) {
|
if (isset($this->order_by)) {
|
||||||
$database->order_by = $this->order_by;
|
$database->order_by = $this->order_by;
|
||||||
}
|
}
|
||||||
if (isset($this->order_type)) {
|
|
||||||
$database->order_type = $this->order_type;
|
|
||||||
}
|
|
||||||
return $database->find();
|
return $database->find();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue