<?php

    global $db , $tpl;

    $atime = $stime = date("Y-m-d");
    
    
    // Ostatnie 7 dni
    for( $i=0; $i<7 ; $i++ ){
        
        $btime = time::getModify("-{$i} DAYS",$stime,"Y-m-d");
        
        // DEBUGER
        //die("select count(1) from event_selecting where crt LIKE('".$btime."%')");

        list( $back[$btime]['procesy'] ) = db::$i->row("select count(1) from `procesy` where crt LIKE('".$btime."%')");
        // DEBUGER
        //die( "TYPES:" . $back[$btime]['newtypes'] );
    }
    

    

    
    list( $all['users'] ) = db::$i->row("select count(1) from user");
    list( $all['payments'] ) = db::$i->row("select sum(cash) from payment where status=2 and abonament is null");

    
    $tpl->assign(array(
        'back' => $back,
        'next' => $next,
        'last' => $last,
        'all' => $all
    ));

    admin::$i->on();
?>