Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ include "root.php"; require_once "includes/require.php"; require_once "includes/checkauth.php"; if (permission_exists('variables_view')) { //access granted } else { echo "access denied"; exit; } //include the header require_once "includes/header.php"; //set http values as php variables $order_by = $_GET["order_by"]; $order = $_GET["order"]; //show the content echo "
"; echo "\n"; echo "\n"; echo " "; echo ""; echo "
\n"; echo "
"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
Variables
\n"; echo " Define preprocessor variables here. \n"; echo "
\n"; $sql = "select * from v_vars "; if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } else { $sql .= "order by var_cat, var_order asc "; } $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $result_count = count($result); unset ($prep_statement, $sql); $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "
\n"; echo "\n"; $tmp_var_header = ''; $tmp_var_header .= "\n"; $tmp_var_header .= th_order_by('var_name', 'Name', $order_by, $order); $tmp_var_header .= th_order_by('var_value', 'Value', $order_by, $order); //$tmp_var_header .= th_order_by('var_cat', 'Category', $order_by, $order); //$tmp_var_header .= th_order_by('var_order', 'Order', $order_by, $order); $tmp_var_header .= th_order_by('var_enabled', 'Enabled', $order_by, $order); $tmp_var_header .= "\n"; $tmp_var_header .= "\n"; $tmp_var_header .= "\n"; if ($result_count > 0) { $prev_var_cat = ''; foreach($result as $row) { $var_value = $row[var_value]; $var_value = substr($var_value, 0, 50); if ($prev_var_cat != $row[var_cat]) { $c=0; if (strlen($prev_var_cat) > 0) { echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo $tmp_var_header; } echo "\n"; echo " \n"; echo " \n"; //echo " \n"; //echo " \n"; echo " \n"; $var_description = str_replace("\n", "
", trim(substr(base64_decode($row['var_description']),0,40))); $var_description = str_replace(" ", "       ", $var_description); echo " \n"; echo " \n"; echo "\n"; $prev_var_cat = $row[var_cat]; if ($c==0) { $c=1; } else { $c=0; } } //end foreach unset($sql, $result, $row_count); } //end if results echo "\n"; echo "\n"; echo "\n"; echo "
Description\n"; if (permission_exists('variables_add')) { $tmp_var_header .= " $v_link_label_add\n"; } $tmp_var_header .= "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
  \n"; if (permission_exists('variables_add')) { echo " $v_link_label_add\n"; } echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo " ".$row['var_cat']." 
".substr($row['var_name'],0,32)." ".substr($var_value,0,30)." ".$row['var_cat']."".$row['var_order']."".$row['var_enabled']."".$var_description." \n"; if (permission_exists('variables_edit')) { echo " $v_link_label_edit\n"; } if (permission_exists('variables_delete')) { echo " $v_link_label_delete\n"; } echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 $paging_controls\n"; if (permission_exists('variables_add')) { echo " $v_link_label_add\n"; } echo "
\n"; echo "
"; echo "
"; echo "

"; echo "

"; echo "
"; echo "
"; echo "

"; //include the footer require_once "includes/footer.php"; ?>