<?php

/* DCMS Special
 * Дата последнего редактирования 20.01.2016
 * Модифицировал densnet
 */

foreach (array('start', 'compress', 'sess', 'settings', 'db_connect', 'ipua', 'fnc', 'user') as $inc) {
    require_once "../../sys/inc/$inc.php";
}

$set['title'] = lang('Операции с рублями');

require_once H . 'sys/inc/thead.php';

aut();

#Навигация
echo "<div class='list-group-item-null list-group-item-grey'><small>";
echo "<a href='/' class='hint--right' data-hint='" . lang('На главную') . "'><i class='fa fa-home fa-lg'></i></a> <i class='fa fa-angle-right fa-fw'></i> ";
echo "<a href='/?umenu'>" . lang('Кабинет') . "</a> <i class='fa fa-angle-right fa-fw'></i> ";
echo "<a href='/modules/shop/'>" . lang('Магазин') . "</a> <i class='fa fa-angle-right fa-fw'></i> ";
echo lang('Финансовые операции');
echo "</small></div><br />";

$z3 = mysql_result(mysql_query("SELECT COUNT(*) FROM `rub_out` WHERE `ank` = '$user[id]'"), 0);

echo "<div class='list-group-item-null list-group-item-grey'>";
echo "<ul class='nav nav-tabs' style='margin-bottom: -11px;'>
        <li class='nav-item'>
            <a class='nav-link' href='in.php'>" . lang('Входящии') . "</a>
        </li>
        <li class='nav-item'>
            <a class='nav-link active'>" . lang('Исходящии') . "</a>
        </li>
      </ul>";
echo "</div>";

echo "<div class='list-group-item-null'><b>Всех операций: $z3</b></div>\n";

$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `rub_out` WHERE `ank` = '" . $user['id'] . "'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];

if ($k_post == 0) {
    $doc->NoResult();
}

$q = mysql_query("SELECT * FROM `rub_out` WHERE `ank` = '" . $user['id'] . "' ORDER BY id DESC LIMIT $start, $set[p_str]");

while ($post = mysql_fetch_array($q)) {
    $ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$post[id]'"));

    echo "<div class='list-group-item-null'>";
    echo toOutput($post['msg']);
    echo "<br />";
    echo "<small style='color: grey'>Операция завершена " . date::times($post['time']) . "</small>";
    echo "</div>";
    echo "<div class='hr'></div>";
}
if ($k_page > 1) {
    str("?name=" . $user['nick'] . "&amp;", $k_page, $page);
}

require_once H . 'sys/inc/tfoot.php';

