<?php
require_once('../wu_init.php');
if (!wu_token()) { exit('wu-error'); }
if (!USER_LOGGED) { exit('wu-error'); }
include('wu_checkadmin.php');
include('../wu-functions/wu_functions.php');

if(isset($_POST['usr'])){
if(!empty($_POST['usr'])){
$usr = intval($_POST['usr']);

$qr = mysqli_query($connect_db, "SELECT id,ty,s,msg,dt FROM `".DB_PREFIX."_operations` WHERE usr = '$usr' ORDER BY id DESC");
if (mysqli_num_rows($qr) > 0) {
while($row = mysqli_fetch_assoc($qr)) {
?>
<div class="fulln" id="op_<?php echo $row['id']; ?>">
<span class="alert-notice"><?php echo wudatenorm($row['dt']); ?> <i class="icon-remove alert-notice-i" onclick="i_del('<?php echo $row['id']; ?>');"></i></span>
<div class="alert alert-<?php if($row['ty'] == 0 || $row['ty'] == 3) { echo 'danger'; } if($row['ty'] == 1 || $row['ty'] == 2) { echo 'success'; } ?> fade in block-inner">
<i class="icon-<?php if($row['ty'] == 0 || $row['ty'] == 3) { echo 'minus'; } if($row['ty'] == 1 || $row['ty'] == 2) { echo 'plus'; } ?>"></i> <?php if($row['ty'] == 0 || $row['ty'] == 3) { echo 'Со счёта списано '; } if($row['ty'] == 1 || $row['ty'] == 2) { echo 'На Ваш счёт зачислено '; } echo $row['s'].' руб. ('.htmlspecialchars($row['msg']).').'; ?>
</div>
</div>
<?php }
} else { echo '<div class="alert alert-info fade in"><i class="icon-info"></i> Операций нет</div>'; }

} else { exit('wu-error'); }
} else { exit('wu-error'); }
?>