-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.php
94 lines (76 loc) · 2.76 KB
/
lib.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
// This script and data application were generated by AppGini 5.81
// Download AppGini for free from https://bigprof.com/appgini/download/
error_reporting(E_ERROR | E_WARNING | E_PARSE);
if(!defined('datalist_db_encoding')) define('datalist_db_encoding', 'UTF-8');
if(!defined('maxSortBy')) define('maxSortBy', 4);
if(!defined('empty_lookup_value')) define('empty_lookup_value', '{empty_value}');
if(function_exists('date_default_timezone_set')) @date_default_timezone_set('Europe/Paris');
if(function_exists('set_magic_quotes_runtime')) @set_magic_quotes_runtime(0);
$GLOBALS['filter_operators'] = array(
'equal-to' => '<=>',
'not-equal-to' => '!=',
'greater-than' => '>',
'greater-than-or-equal-to' => '>=',
'less-than' => '<',
'less-than-or-equal-to' => '<=',
'like' => 'like',
'not-like' => 'not like',
'is-empty' => 'isEmpty',
'is-not-empty' => 'isNotEmpty'
);
$currDir = dirname(__FILE__);
include("$currDir/settings-manager.php");
detect_config();
migrate_config();
include("$currDir/config.php");
include("$currDir/db.php");
include("$currDir/ci_input.php");
include("$currDir/datalist.php");
include("$currDir/incCommon.php");
include("$currDir/admin/incFunctions.php");
// detecting classes not included above
@spl_autoload_register(function($class) {
$app_dir = dirname(__FILE__);
@include("{$app_dir}/resources/lib/{$class}.php");
});
ob_start();
/* trim $_POST, $_GET, $_REQUEST */
if(count($_POST)) $_POST = array_trim($_POST);
if(count($_GET)) $_GET = array_trim($_GET);
if(count($_REQUEST)) $_REQUEST = array_trim($_REQUEST);
// include global hook functions
@include_once("$currDir/hooks/__global.php");
initSession();
// check if membership system exists
setupMembership();
// silently apply db changes, if any
@include_once("$currDir/updateDB.php");
// do we have a login request?
logInMember();
// convert expanded sorting variables, if provided, to SortField and SortDirection
$postedOrderBy = array();
for($i = 0; $i < maxSortBy; $i++) {
if(isset($_REQUEST["OrderByField$i"])) {
$sd = ($_REQUEST["OrderDir$i"] == 'desc' ? 'desc' : 'asc');
if($sfi = intval($_REQUEST["OrderByField$i"])) {
$postedOrderBy[] = array($sfi => $sd);
}
}
}
if(count($postedOrderBy)) {
$_REQUEST['SortField'] = '';
$_REQUEST['SortDirection'] = '';
foreach($postedOrderBy as $obi) {
$sfi = ''; $sd = '';
foreach($obi as $sfi => $sd);
$_REQUEST['SortField'] .= "$sfi $sd,";
}
$_REQUEST['SortField'] = substr($_REQUEST['SortField'], 0, -2 - strlen($sd));
$_REQUEST['SortDirection'] = $sd;
}elseif($_REQUEST['apply_sorting']) {
/* no sorting and came from filters page .. so clear sorting */
$_REQUEST['SortField'] = $_REQUEST['SortDirection'] = '';
}
// include nav menu links
@include_once("$currDir/hooks/links-navmenu.php");