Subversion Repositories ALCASAR

Rev

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

Rev 2861 Rev 3089
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: stats.php 2861 2020-10-04 20:41:06Z rexy $
2
# $Id: stats.php 3089 2022-11-17 23:32:23Z 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 209... Line 209...
209
			$sql_val[user] AND acctstoptime >= '$day 00:00:00' 
209
			$sql_val[user] AND acctstoptime >= '$day 00:00:00' 
210
			AND acctstoptime <= '$day 23:59:59' $s $sql_extra_query;");
210
			AND acctstoptime <= '$day 23:59:59' $s $sql_extra_query;");
211
		if ($search){
211
		if ($search){
212
			$row = @da_sql_fetch_array($search,$config);
212
			$row = @da_sql_fetch_array($search,$config);
213
			$data[$day][1] = $row['res_1'];
213
			$data[$day][1] = $row['res_1'];
-
 
214
			$data_tmp = (int)$data['sum'][1] ;
214
			$data['sum'][1] += $row['res_1'];
215
			$data['sum'][1] = $data_tmp + $row['res_1'];
215
			$stats_num[1] = ($data[$day][1]) ? $stats_num[1] + 1 : $stats_num[1];
216
			$stats_num[1] = ($data[$day][1]) ? $stats_num[1] + 1 : $stats_num[1];
216
			$data[$day][2] = $row['res_2'];
217
			$data[$day][2] = $row['res_2'];
-
 
218
			$data_tmp = (int)$data['sum'][2];
217
			$data['sum'][2] += $row['res_2'];
219
			$data['sum'][2] = $data_tmp + $row['res_2'];
218
			$stats_num[2] = ($data[$day][2]) ? $stats_num[2] + 1 : $stats_num[2];
220
			$stats_num[2] = ($data[$day][2]) ? $stats_num[2] + 1 : $stats_num[2];
219
			$data[$day][3] = $row['res_3'];
221
			$data[$day][3] = $row['res_3'];
-
 
222
			$data_tmp = (int)$data['sum'][3];
220
			$data['sum'][3] += $row['res_3'];
223
			$data['sum'][3] = $data_tmp + $row['res_3'];
221
			$stats_num[3] = ($data[$day][3]) ? $stats_num[3] + 1 : $stats_num[3];
224
			$stats_num[3] = ($data[$day][3]) ? $stats_num[3] + 1 : $stats_num[3];
222
		}
225
		}
223
		else
226
		else
224
			echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
227
			echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
225
	}
228
	}