Subversion Repositories ALCASAR

Rev

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

Rev 3089 Rev 3105
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: stats.php 3089 2022-11-17 23:32:23Z rexy $
2
# $Id: stats.php 3105 2023-01-04 15:01:47Z 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 211... Line 211...
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_tmp = (int)$data['sum'][1] ;
215
			$data['sum'][1] = $data_tmp + $row['res_1'];
215
			$data['sum'][1] = $data_tmp + $row['res_1'];
216
			$stats_num[1] = ($data[$day][1]) ? $stats_num[1] + 1 : $stats_num[1];
216
			$stats_num[1] = ($data[$day][1]) ? (int)$stats_num[1] + 1 : $stats_num[1];
217
			$data[$day][2] = $row['res_2'];
217
			$data[$day][2] = $row['res_2'];
218
			$data_tmp = (int)$data['sum'][2];
218
			$data_tmp = (int)$data['sum'][2];
219
			$data['sum'][2] = $data_tmp + $row['res_2'];
219
			$data['sum'][2] = $data_tmp + $row['res_2'];
220
			$stats_num[2] = ($data[$day][2]) ? $stats_num[2] + 1 : $stats_num[2];
220
			$stats_num[2] = ($data[$day][2]) ? (int)$stats_num[2] + 1 : $stats_num[2];
221
			$data[$day][3] = $row['res_3'];
221
			$data[$day][3] = $row['res_3'];
222
			$data_tmp = (int)$data['sum'][3];
222
			$data_tmp = (int)$data['sum'][3];
223
			$data['sum'][3] = $data_tmp + $row['res_3'];
223
			$data['sum'][3] = $data_tmp + $row['res_3'];
224
			$stats_num[3] = ($data[$day][3]) ? $stats_num[3] + 1 : $stats_num[3];
224
			$stats_num[3] = ($data[$day][3]) ? (int)$stats_num[3] + 1 : $stats_num[3];
225
		}
225
		}
226
		else
226
		else
227
			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";
228
	}
228
	}
229
}
229
}