-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
51 lines (40 loc) · 1.29 KB
/
index.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
<?php
require_once __DIR__ . '/bootstrap/bootstrap.php';
require_once __DIR__ . '/configs/default.conf.php';
require_once __DIR__ . '/../../libs/paloSantoGrid.class.php';
use App\Models\DeviceModel;
$lang_file = __DIR__ . '/lang/' . get_language() . '.lang';
file_exists($lang_file) ? include_once $lang_file : include_once __DIR__ . '/lang/en.lang';
function _moduleContent(&$smarty, $module_name)
{
global $arrConf;
global $arrConfModule;
global $arrLang;
global $arrLangModule;
$arrConf = array_merge($arrConf, $arrConfModule);
$arrLang = array_merge($arrLang, $arrLangModule);
$template = 'modules/' . $module_name . '/' . $arrConf['templates_dir'] . '/default';
$dsn = generarDSNSistema('root', '');
$model = new DeviceModel(new \paloDB($dsn));
$grid = new \paloSantoGrid($smarty);
$grid->setTitle($arrConf['module_title']);
$grid->pagingShow(false);
$grid->setColumns([
_tr('User Extension'),
_tr('Display Extension'),
]);
$total = $model->count();
$grid->setTotal($total['total']);
$list = $model->index();
$data = [];
if (is_array($list) && $total['total'] > 0) {
foreach ($list as $item) {
array_push($data, [
$item['user'],
$item['description']
]);
}
}
$grid->setData($data);
return $grid->fetchGrid();
}