Subversion Repositories ALCASAR

Rev

Rev 2854 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2854 Rev 2856
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: user_stats.php 2854 2020-07-20 22:08:05Z rexy $
2
# $Id: user_stats.php 2856 2020-07-21 22:11:44Z rexy $
3
 
3
 
4
require('/etc/freeradius-web/config.php');
4
require('/etc/freeradius-web/config.php');
5
require('../lib/functions.php');
5
require('../lib/functions.php');
6
require('../lib/sql/nas_list.php');
6
require('../lib/sql/nas_list.php');
7
require_once('../lib/xlat.php');
7
require_once('../lib/xlat.php');
8
?>
8
?>
9
<!DOCTYPE html>
9
<!DOCTYPE html>
10
<html>
10
<html>
-
 
11
<head>
11
<?php
12
<?php
12
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
-
 
13
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
-
 
14
else{
-
 
15
	echo <<<EOM
-
 
16
<title>Statistiques utilisateurs</title>
-
 
17
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
-
 
18
<link rel="stylesheet" href="/css/acc.css">
-
 
19
</head>
-
 
20
<body>
-
 
21
<center>
-
 
22
<b>Could not include SQL library functions. Aborting</b>
-
 
23
</body>
-
 
24
</html>
-
 
25
EOM;
-
 
26
	exit();
-
 
27
}
-
 
28
# Choice of language
13
# Choice of language
29
$Language = 'en';
14
$Language = 'en';
30
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
15
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
31
	$Langue		= explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
16
	$Langue		= explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
32
	$Language	= strtolower(substr(chop($Langue[0]),0,2)); }
17
	$Language	= strtolower(substr(chop($Langue[0]),0,2)); }
Line 89... Line 74...
89
	$l_to			= "to";
74
	$l_to			= "to";
90
	$l_server		= "Server";
75
	$l_server		= "Server";
91
	$l_login		= "Login";
76
	$l_login		= "Login";
92
	$l_user_edit		= "Edit user";
77
	$l_user_edit		= "Edit user";
93
}
78
}
-
 
79
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
-
 
80
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
-
 
81
else{
-
 
82
	echo <<<EOM
-
 
83
<title>$l_title</title>
-
 
84
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
-
 
85
<link rel="stylesheet" href="/css/acc.css">
-
 
86
</head>
-
 
87
<body>
-
 
88
<center><b>Could not include SQL library functions. Aborting</b></center>
-
 
89
</body>
-
 
90
</html>
-
 
91
EOM;
-
 
92
	exit();
-
 
93
}
94
if (!isset($start) && !isset($stop)){
94
if (!isset($start) && !isset($stop)){
95
	$now = time();
95
	$now = time();
96
	$stop = date($config['sql_date_format'],$now);
96
	$stop = date($config['sql_date_format'],$now);
97
	$now -= 604800;
97
	$now -= 604800;
98
	$start = date($config['sql_date_format'],$now);
98
	$start = date($config['sql_date_format'],$now);
99
}
99
}
100
$start = da_sql_escape_string($link,$start);
100
$start = da_sql_escape_string($link,$start);
101
$stop = da_sql_escape_string($link,$stop);
101
$stop = da_sql_escape_string($link,$stop);
102
?>
102
?>
103
<head>
-
 
104
<title><?php echo "$l_title";?></title>
103
<title><?= $l_title ?></title>
105
<link rel="stylesheet" href="/css/acc.css" type="text/css">
104
<link rel="stylesheet" href="/css/acc.css" type="text/css">
106
</head>
105
</head>
107
<body>
106
<body>
108
<div class="panel">
107
<div class="panel">
109
	<div class="panel-header"><?= $l_title ?></div>
108
	<div class="panel-header"><?= $l_title ?></div>