session_start();
include("config.php");
include("functions.php");
mysql_query('SET NAMES UTF8');
if(!isset($_SESSION['uid'])) { header('Location: /index.php'); }
if($user['klan'] == '' || $user['klan'] != mysql_real_escape_string((int)$_GET['clan'])) { header('Location: /index.php'); }
if($user['clan_prava'] != 'glava') {
$utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = "'.$user['clan_prava'].'" LIMIT 1'));
if(!isset($utitl['id'])) {
$utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = 2 LIMIT 1'));
}
} else {
$utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = 1 LIMIT 1'));
}
if(isset($utitl['id'])) {
$i = 1;
while($i < count($clan_acces)) {
if($utitl['prava'][$i] > 0) {
$clan_acces[$i][0] = 1;
}
$i++;
}
}
if(is_numeric($_GET['page'])) {
$numb = round($_GET['page']*15, 0);
} else {
$numb = 0;
}
if($clan_acces[6][0] == 1) {
$t = '
';
$data = mysql_query("SELECT * FROM `clan_log` WHERE `clan_id` = '".$user['klan']."' ORDER BY `id` DESC LIMIT $numb, 15");
while($it = mysql_fetch_array($data)) {
$i++;
if($i == 1) {
$t .= " | Когда | Кто | Сколько |
";
}
if($it['type'] == 1) {
$pp = ""; $dop = 'РљСЂ.';
} elseif($it['type'] == 2) {
$pp = ""; $dop = 'Екр.';
}
$it['date'] = date('d.m.y h:i', $it['time']);
$it['login'] = nick::id($it['user_id'])->full(1);
$it['coms'] = ' Комментарий : '.$it['comment'].'';
$t .= "".$pp." | ".$it['date']." | ".$it['login']."".$it['coms']." | ".$it['suma']." $dop |
";
}
$t .= '
';
$t .= "Страницы: ";
$data2 = mysql_query("SELECT * FROM `clan_log` WHERE `clan_id`= '{$user['klan']}'"); $all = mysql_num_rows($data2)-1; $pgs = $all/15;
for($is = 0; $is <= $pgs; ++$is) {
if($_GET['page'] == $is) {
$t .= '
'.($is+1).' ';
} else {
$t .= '
'.($is+1).' ';
}
$t .= '
';
}
} else {
$t = 'Недостаточно прав';
}
?>