Вход Регистрация
Файл: wenr.online/app/user/top.php
Строк: 15
<?php

if(!$user->isAuth()){
    
redirect('/');
    exit;
}

     
$type 'lvl';
 if(
in_array($_GET['type'],['lvl','force','dex','mobs'])){
     
$type Clean :: str($_GET['type']);
 }


    
$all $db->prepare('select * from `users` order by `'.$type.'` desc');
    
$all -> execute();
    
$all $all->fetchAll();

        
$peger = new ArrayPaginator('/top?type='.$type10); 
    
$items $peger->getItems($all);
    
    
$str 1;
    if(
is_numeric(Clean :: int($_GET['page'])) and $_GET['page'] > 1$str $_GET['page']*10-9;
    
    function 
count_quest($us){
        global 
$db;
    
$sql $db->prepare('select id from quest_user where user = ?');
    
$sql -> execute([$us]);
    return 
$sql -> rowCount();
    }
    
    
    echo 
$template->render('user.top',
                                [
'all'  =>  $items,
                                 
'peger'    =>  $peger,
                                 
'top'  => $str
                                                            
]    
                                    );
Онлайн: 1
Реклама