Skip to content

Commit

Permalink
Improved attribute dictionaries management feature (#316)
Browse files Browse the repository at this point in the history
Improved layout and other minor features
  • Loading branch information
filippolauria committed Dec 16, 2022
1 parent 7b5697b commit 6878619
Show file tree
Hide file tree
Showing 63 changed files with 1,679 additions and 2,044 deletions.
7 changes: 2 additions & 5 deletions acct-active.php
Expand Up @@ -27,8 +27,9 @@
include('library/check_operator_perm.php');
include_once('library/config_read.php');

// include validation utils
include_once("lang/main.php");
include("library/validation.php");
include("library/layout.php");

// validate this parameter before including menu
$username = (array_key_exists('username', $_GET) && isset($_GET['username']))
Expand All @@ -55,10 +56,6 @@
$logQuery = "performed query for user [$username] and start date [$startdate] and end date [$enddate] on page: ";
$logDebugSQL = "";

include_once("lang/main.php");

include("library/layout.php");

// print HTML prologue
$title = t('Intro','acctactive.php');
$help = t('helpPage','acctactive');
Expand Down
9 changes: 3 additions & 6 deletions acct-all.php
Expand Up @@ -27,18 +27,15 @@
include('library/check_operator_perm.php');
include_once('library/config_read.php');

include_once("lang/main.php");
include("library/validation.php");
include("library/layout.php");

// init logging variables
$log = "visited page: ";
$logQuery = "performed query for all accounting records on page: ";
$logDebugSQL = "";

include("library/validation.php");

include_once("lang/main.php");

include("library/layout.php");

// print HTML prologue
$title = t('Intro','acctall.php');
$help = t('helpPage','acctall');
Expand Down
18 changes: 9 additions & 9 deletions acct-custom-query.php
Expand Up @@ -25,6 +25,11 @@
$operator = $_SESSION['operator_user'];

include('library/check_operator_perm.php');
include_once('library/config_read.php');

include_once("lang/main.php");
include("library/validation.php");
include("library/layout.php");

// init logging variables
$log = "visited page: ";
Expand All @@ -34,10 +39,6 @@
// set session's page variable
$_SESSION['PREV_LIST_PAGE'] = $_SERVER['REQUEST_URI'];

include_once('library/config_read.php');

include("library/validation.php");

$sqlfields = (array_key_exists('sqlfields', $_GET) && !empty($_GET['sqlfields']) && is_array($_GET['sqlfields']) &&
array_intersect($_GET['sqlfields'], $acct_custom_query_options_all) == $_GET['sqlfields'])
? $_GET['sqlfields'] : $acct_custom_query_options_default;
Expand Down Expand Up @@ -86,9 +87,6 @@
$accounting_custom_enddate = $enddate;
$accounting_custom_value = $where_value_enc;

include_once("lang/main.php");

include("library/layout.php");

// print HTML prologue
$extra_js = array(
Expand Down Expand Up @@ -203,12 +201,14 @@
. '<tbody>';

// inserting the values of each field from the database to the table
$count = 0;
while($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
echo "<tr>";
printf('<tr id="row-%d">', $count);
foreach ($sqlfields as $field) {
printf("<td>%s</td>", htmlspecialchars($row[$field], ENT_QUOTES, 'UTF-8'));
}
echo "</tr>";
echo '</tr>';
$count++;
}

echo '</tbody>';
Expand Down
4 changes: 1 addition & 3 deletions acct-custom.php
Expand Up @@ -27,10 +27,8 @@
include_once('library/config_read.php');
$log = "visited page: ";

include("library/validation.php");

include_once("lang/main.php");

include("library/validation.php");
include("library/layout.php");

// print HTML prologue
Expand Down
6 changes: 2 additions & 4 deletions acct-date.php
Expand Up @@ -27,8 +27,9 @@
include('library/check_operator_perm.php');
include_once('library/config_read.php');

// include validation utils
include_once("lang/main.php");
include("library/validation.php");
include("library/layout.php");

// validate this parameter before including menu
$username = (array_key_exists('username', $_GET) && isset($_GET['username']))
Expand All @@ -55,9 +56,6 @@
$logQuery = "performed query for user [$username] and start date [$startdate] and end date [$enddate] on page: ";
$logDebugSQL = "";

include_once("lang/main.php");

include("library/layout.php");

// print HTML prologue
$title = t('Intro','acctdate.php');
Expand Down
6 changes: 3 additions & 3 deletions acct-ipaddress.php
Expand Up @@ -27,7 +27,9 @@
include('library/check_operator_perm.php');
include_once('library/config_read.php');

include_once("lang/main.php");
include("library/validation.php");
include("library/layout.php");

// validate this parameter before including menu
$ipaddress = (array_key_exists('ipaddress', $_GET) && isset($_GET['ipaddress']) &&
Expand All @@ -43,10 +45,8 @@
((!empty($ipaddress)) ? "IP address [$ipaddress]" : "all IP addresses"));
$logDebugSQL = "";

include_once("lang/main.php");

include("library/layout.php");

// print HTML prologue
$title = t('Intro','acctipaddress.php');
$help = t('helpPage','acctipaddress');

Expand Down
1 change: 1 addition & 0 deletions acct-main.php
Expand Up @@ -44,4 +44,5 @@

include('include/config/logging.php');
print_footer_and_html_epilogue();

?>
7 changes: 3 additions & 4 deletions acct-nasipaddress.php
Expand Up @@ -27,7 +27,9 @@
include('library/check_operator_perm.php');
include_once('library/config_read.php');

include_once("lang/main.php");
include("library/validation.php");
include("library/layout.php");

// validate this parameter before including menu
$onlyactive = (array_key_exists('only-active', $_GET) && isset($_GET['only-active']));
Expand All @@ -46,10 +48,7 @@
((!empty($nasipaddress)) ? "NAS IP address [$nasipaddress]" : "all NAS IP addresses"));
$logDebugSQL = "";

include_once("lang/main.php");

include("library/layout.php");

// print HTML prologue
$title = t('Intro','acctnasipaddress.php');
$help = t('helpPage','acctnasipaddress');

Expand Down
13 changes: 6 additions & 7 deletions acct-username.php
Expand Up @@ -27,9 +27,13 @@
include('library/check_operator_perm.php');
include_once('library/config_read.php');

include_once("lang/main.php");
include("library/validation.php");
include("library/layout.php");

// validate this parameter before including menu
$username = (array_key_exists('username', $_GET) && isset($_GET['username']))
? str_replace("%", "", $_GET['username']) : "";
$username = (array_key_exists('username', $_GET) && !empty(str_replace("%", "", trim($_GET['username']))))
? str_replace("%", "", trim($_GET['username'])) : "";
$username_enc = (!empty($username)) ? htmlspecialchars($username, ENT_QUOTES, 'UTF-8') : "";

// init logging variables
Expand All @@ -44,11 +48,6 @@
//feed the sidebar variables
$accounting_username = $username_enc;

include("library/validation.php");

include_once("lang/main.php");

include("library/layout.php");

// print HTML prologue
$title = t('Intro','acctusername.php');
Expand Down

0 comments on commit 6878619

Please sign in to comment.