<?php
$t = 'Список заказов';
require_once '../../wcore/core.php';
require_once '../../wcore/head.php';
iank();
$id = (isset($_GET['type']) && !empty($_GET['type'])?intval($_GET['type']):0);
    $_tmp = mysqli_query($mysqli,"SELECT * FROM `servers`,`orders` WHERE `servers`.`id`=`orders`.`l_s` AND `servers`.`type` = '$id' AND `orders`.`uid`='$ank->id'") or die("Ошибка запроса: ".mysqli_error($mysqli));
    while ($serv = mysqli_fetch_assoc($_tmp)){
        
        $status = array(
            0=>$lang['ord_status_0'],
            1=>$lang['ord_status_1'],
            2=>$lang['ord_status_2'],
            3=>$lang['ord_status_3'],
            4=>$lang['ord_status_4'],
        );
        
        $array[] = array(
            'id'    =>  $serv['oid'],
            'name'  =>  $serv['nametar'],
            'desc'  =>  json_decode(base64_decode($serv['data'])),
            'status'=>  $serv['status'],
            'stat_t'=>  $status[$serv['status']],
            'bits'  =>  $serv['bits'],
            'nserv' =>  $serv['name'],
            'infinity' =>   $serv['infinity'],
            'mgr'   =>  $serv['order_init'],
            'time'  =>  ptime($serv['time']).' (Осталось: '.cunter_day_unix($serv['time'],false).')',
            );
    }
    if (!isset($array)){$array = FALSE;}
echo $twig->render('page_modules_order_list.tpl', array(
    'lang'  =>  $lang,
    'id'    =>  $id,
    'data'  =>  $array,
    )
    );
require_once '../../wcore/foot.php';
?>