Your IP : 216.73.217.78


Current Path : /home/seto/tdsbs.com/v9/files/
Upload File :
Current File : /home/seto/tdsbs.com/v9/files/sslog.php

<?php
define('INDEX', 'yes');
require_once '../config.php';
if(!isset($_COOKIE[md5($rnd)]) || !isset($_POST['length'])){
	header('HTTP/1.1 403 Forbidden');
	die('403 Forbidden');
}
@ini_set('memory_limit', '-1');
$dt_arr = array(
'0' => 'id',
'1' => 'time',
'2' => 'ngroup',
'3' => 'nstream',
'4' => 'out',
'5' => 'keyword',
'6' => 'redirect',
'7' => 'operator',
'8' => 'device',
'9' => 'brand',
'10' => 'os',
'11' => 'browser',
'12' => 'lang',
'13' => 'country',
'14' => 'city',
'15' => 'region',
'16' => 'asn',
'17' => 'org',
'18' => 'utc',
'19' => 'uniq',
'20' => 'bot',
'21' => 'ipuser',
'22' => 'domain',
'23' => 'page',
'24' => 'referer',
'25' => 'useragent',
'26' => 'se',
'27' => 'postback',
);
$length = $_POST['length'];
$start = $_POST['start'];
$offset = $start;
$order_column = $_POST['order'][0]['column'];
$order_dir = $_POST['order'][0]['dir'];
$order_name = $dt_arr[$order_column];
$data = unserialize(base64_decode($_POST['q']));
$table = $data['table'];
$q_group = $data['q_group'];
$q_stream = $data['q_stream'];
$q_find = $data['q_find'];
$db = new SQLite3('../'.$folder_log.'/'.$q_group.'.db');
$db->busyTimeout(60);
$db->exec('PRAGMA journal_mode = WAL;');
$count = $db->querySingle("SELECT COUNT(*) FROM '$table' WHERE id != 0 $q_stream $q_find;");
$data = array();
if(!empty($count)){
	$query = "SELECT * FROM '$table' WHERE id != 0 $q_stream $q_find ORDER BY $order_name $order_dir LIMIT $length OFFSET $offset;";
	$res = $db->query($query);
	$data['recordsTotal'] = $count;
	$data['recordsFiltered'] = $count;
	while($array = $res->fetchArray(SQLITE3_ASSOC)){
		$data['data'][] = array(
		$array['id'],
		$array['time'],
		htmlentities($array['ngroup'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['nstream'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['out'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['keyword'], ENT_QUOTES, 'UTF-8'),
		$array['redirect'],
		$array['operator'],
		$array['device'],
		$array['brand'],
		htmlentities($array['os'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['browser'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['lang'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['country'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['city'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['region'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['asn'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['org'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['utc'], ENT_QUOTES, 'UTF-8'),
		$array['uniq'],
		$array['bot'],
		htmlentities($array['ipuser'], ENT_QUOTES, 'UTF-8'),
		htmlentities($array['domain'], ENT_QUOTES, 'UTF-8'),
		htmlentities(urldecode($array['page']), ENT_QUOTES, 'UTF-8'),
		htmlentities(urldecode($array['referer']), ENT_QUOTES, 'UTF-8'),
		htmlentities($array['useragent'], ENT_QUOTES, 'UTF-8'),
		$array['se'],
		htmlentities($array['postback'], ENT_QUOTES, 'UTF-8'),
		);
	}
}
else{
	$data = array('data'=>'');
	$data['recordsTotal'][] = 0;
	$data['recordsFiltered'] = 0;
}
echo json_encode($data);
$db->close();
?>