Subversion Repositories ALCASAR

Rev

Rev 2858 | Rev 3089 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2858 Rev 2861
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: stats.php 2858 2020-08-01 09:40:49Z rexy $
2
# $Id: stats.php 2861 2020-10-04 20:41:06Z 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');
Line 16... Line 16...
16
	$Langue		= explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
16
	$Langue		= explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
17
	$Language	= strtolower(substr(chop($Langue[0]),0,2)); }
17
	$Language	= strtolower(substr(chop($Langue[0]),0,2)); }
18
if($Language == 'fr'){
18
if($Language == 'fr'){
19
	$l_Pagename		= "Usage quotidien";
19
	$l_Pagename		= "Usage quotidien";
20
	$l_title		= "Analyse journalière";
20
	$l_title		= "Analyse journalière";
21
	$l_sessions		= "Sessions";
-
 
22
	$l_usage		= "temps d'utilisation total";
-
 
23
	$l_uploads		= "Données sortantes";
21
	$l_uploads		= "Données sortantes";
24
	$l_downloads	= "Données entrantes";
22
	$l_downloads		= "Données entrantes";
25
	$l_from			= "Du";
23
	$l_from			= "Du";
26
	$l_to			= "au";
24
	$l_to			= "au";
27
	$l_user			= "utilisateur";
25
	$l_user			= "utilisateur";
28
	$l_onserver		= "sur le serveur";
26
	$l_onserver		= "sur le serveur";
-
 
27
	$l_fields_to_display	= "Champs à afficher";
-
 
28
	$l_number_of_sessions	= "Nombre de sessions";
-
 
29
	$l_total_usage_time     = "Temps d'usage total";
-
 
30
	$l_date			= "date";
-
 
31
	$l_daily_summary	= "Récapitulatif journalier";
-
 
32
	$l_refresh		= "Rafraîchir";
-
 
33
	$l_stat_for_all		= "Statistique pour <b><font color=\"darkblue\">tous</font></b> les utilisateurs";
-
 
34
	$l_stat_for_user	= "Statistique pour l'utilisateur :";
-
 
35
	$l_maximum		= "Maximum";
-
 
36
	$l_average		= "Moyenne";
-
 
37
	$l_summary		= "Récapitulatif";
29
} else if($Language == 'es') {
38
} else if($Language == 'es') {
30
	$l_Pagename		= "Uso diario";
39
	$l_Pagename		= "Uso diario";
31
	$l_title		= "SAnálisis diario";
40
	$l_title		= "SAnálisis diario";
32
	$l_sessions		= "sesiones";
-
 
33
	$l_usage		= "total usage time";
-
 
34
	$l_uploads		= "Datos de salida";
41
	$l_uploads		= "Datos de salida";
35
	$l_downloads	= "Datos entrantes";
42
	$l_downloads		= "Datos entrantes";
36
	$l_from			= "Del";
43
	$l_from			= "Del";
37
	$l_to			= "al";
44
	$l_to			= "al";
38
	$l_user			= "usuario";
45
	$l_user			= "usuario";
39
	$l_onserver		= "en el servidor";
46
	$l_onserver		= "en el servidor";
-
 
47
	$l_fields_to_display	= "Campos a mostrar";
-
 
48
	$l_number_of_sessions	= "Número de sesiones";
-
 
49
        $l_total_usage_time     = "Tiempo total de uso";
-
 
50
	$l_date			= "Fecha";
-
 
51
	$l_daily_summary	= "Resumen diaro";
-
 
52
	$l_refresh		= "Actualizar";
-
 
53
	$l_stat_for_all		= "Estadísticas para <b><font color=\"darkblue\">todos</font></b> los usuarios";
-
 
54
	$l_stat_for_user	= "Etadísticas para el usuario :";
-
 
55
	$l_maximum		= "Máximo";
-
 
56
	$l_average		= "Promedio";
-
 
57
	$l_summary		= "Résumen";
40
} else {
58
} else {
41
	$l_Pagename		= "Daily use";
59
	$l_Pagename		= "Daily use";
42
	$l_title		= "Daily analysis";
60
	$l_title		= "Daily analysis";
43
	$l_sessions		= "Sessions";
-
 
44
	$l_usage		= "tiempo total de uso";
-
 
45
	$l_uploads		= "Uploads";
61
	$l_uploads		= "Uploads";
46
	$l_downloads	= "Downloads";
62
	$l_downloads		= "Downloads";
47
	$l_from			= "From";
63
	$l_from			= "From";
48
	$l_to			= "to";
64
	$l_to			= "to";
49
	$l_user			= "user";
65
	$l_user			= "user";
50
	$l_onserver		= "on the server";
66
	$l_onserver		= "on the server";
-
 
67
	$l_fields_to_display	= "Fields to display";
-
 
68
	$l_number_of_sessions	= "Number of sesions";
-
 
69
	$l_total_usage_time	= "Total usage time";
-
 
70
	$l_date			= "date";
-
 
71
	$l_daily_summary	= "Daily summary";
-
 
72
	$l_refresh		= "Refresh";
-
 
73
	$l_stat_for_all		= "Statistic for <b><font color=\"darkblue\">all</font></b> users";
-
 
74
	$l_stat_for_user	= "Statistic for user :";
-
 
75
	$l_maximum		= "Maximum";
-
 
76
	$l_average		= "Average";
-
 
77
	$l_summary		= "Summary";
51
}
78
}
52
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
79
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
53
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
80
	include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
54
else{
81
else{
55
	echo <<<EOM
82
	echo <<<EOM
Line 104... Line 131...
104
 
131
 
105
$column3 = (isset($column3)) ? "$column3" : 'download';
132
$column3 = (isset($column3)) ? "$column3" : 'download';
106
$column[3] = "$column3";
133
$column[3] = "$column3";
107
$selected3["$column3"] = 'selected';
134
$selected3["$column3"] = 'selected';
108
 
135
 
109
$message['sessions'] = $l_sessions;
136
$message['sessions'] = $l_number_of_sessions;
110
$message['usage'] = $l_usage;
137
$message['usage'] = $l_total_usage_time;
111
$message['upload'] = $l_uploads;
138
$message['upload'] = $l_uploads;
112
$message['download'] = $l_downloads;
139
$message['download'] = $l_downloads;
-
 
140
 
113
if ($config['general_stats_use_totacct'] == 'yes'){
141
if ($config['general_stats_use_totacct'] == 'yes'){
114
	$sql_val['sessions'] = 'connnum';
142
	$sql_val['sessions'] = 'connnum';
115
	$sql_val['usage'] = 'conntotduration';
143
	$sql_val['usage'] = 'conntotduration';
116
	$sql_val['upload'] = 'outputoctets'; # invert with 'inputoctets' in order to display it more logically
144
	$sql_val['upload'] = 'outputoctets'; # invert with 'inputoctets' in order to display it more logically
117
	$sql_val['download'] = 'inputoctets';
145
	$sql_val['download'] = 'inputoctets';