Update vars.php
This commit is contained in:
+21
-18
@@ -17,22 +17,25 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
Portions created by the Initial Developer are Copyright (C) 2008-2018
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
*/
|
*/
|
||||||
include "root.php";
|
//includes
|
||||||
require_once "resources/require.php";
|
include "root.php";
|
||||||
require_once "resources/check_auth.php";
|
require_once "resources/require.php";
|
||||||
if (permission_exists('var_view')) {
|
require_once "resources/check_auth.php";
|
||||||
//access granted
|
|
||||||
}
|
//check permissions
|
||||||
else {
|
if (permission_exists('var_view')) {
|
||||||
echo "access denied";
|
//access granted
|
||||||
exit;
|
}
|
||||||
}
|
else {
|
||||||
|
echo "access denied";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
$language = new text;
|
$language = new text;
|
||||||
@@ -79,7 +82,7 @@ else {
|
|||||||
$sql .= "order by $order_by $order ";
|
$sql .= "order by $order_by $order ";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$sql .= "order by var_cat, var_order asc ";
|
$sql .= "order by var_category, var_order asc ";
|
||||||
}
|
}
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
@@ -108,13 +111,13 @@ else {
|
|||||||
$tmp_var_header .= "<tr>\n";
|
$tmp_var_header .= "<tr>\n";
|
||||||
|
|
||||||
if ($result_count > 0) {
|
if ($result_count > 0) {
|
||||||
$prev_var_cat = '';
|
$prev_var_category = '';
|
||||||
foreach($result as $row) {
|
foreach($result as $row) {
|
||||||
$var_value = $row['var_value'];
|
$var_value = $row['var_value'];
|
||||||
$var_value = substr($var_value, 0, 50);
|
$var_value = substr($var_value, 0, 50);
|
||||||
if ($prev_var_cat != $row['var_cat']) {
|
if ($prev_var_category != $row['var_category']) {
|
||||||
$c=0;
|
$c=0;
|
||||||
if (strlen($prev_var_cat) > 0) {
|
if (strlen($prev_var_category) > 0) {
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
echo "<td colspan='6'>\n";
|
echo "<td colspan='6'>\n";
|
||||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||||
@@ -134,7 +137,7 @@ else {
|
|||||||
echo "<tr><td colspan='4' align='left'>\n";
|
echo "<tr><td colspan='4' align='left'>\n";
|
||||||
echo " <br />\n";
|
echo " <br />\n";
|
||||||
echo " <br />\n";
|
echo " <br />\n";
|
||||||
echo " <b>".$row['var_cat']."</b> </td></tr>\n";
|
echo " <b>".$row['var_category']."</b> </td></tr>\n";
|
||||||
echo $tmp_var_header;
|
echo $tmp_var_header;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +169,7 @@ else {
|
|||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
||||||
$prev_var_cat = $row['var_cat'];
|
$prev_var_category = $row['var_category'];
|
||||||
if ($c==0) { $c=1; } else { $c=0; }
|
if ($c==0) { $c=1; } else { $c=0; }
|
||||||
} //end foreach
|
} //end foreach
|
||||||
unset($sql, $result, $row_count);
|
unset($sql, $result, $row_count);
|
||||||
@@ -194,4 +197,4 @@ else {
|
|||||||
//include the footer
|
//include the footer
|
||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user