<?php
require_once('../../wu-engine/wu_init.php');
$page_name = 'Скриншоты';
$page_keys = 'Скриншоты';
$page_desc = 'Скриншоты';
$prevurl_1 = '/'.ADMINPATH.'/';
$prevname_1 = 'Панель управления';
$online_title = 'В панели управления';
$online_url = '/';
include('../../wu-engine/wu_header.php');
if(!USER_LOGGED) { header ("Location: /"); exit; }

$getid = intval($_GET['id']);
$maths = mysqli_query($connect_db, "SELECT id,ti FROM `".DB_PREFIX."_es` WHERE id='$getid'");
$how = mysqli_num_rows($maths);
if ($how > 0) {
$math = mysqli_fetch_assoc($maths);
?>
<!-- Контент -->

<?php
$qr = mysqli_query($connect_db, "SELECT id,img FROM ".DB_PREFIX."_es_i WHERE m='$getid' ORDER BY id DESC");
if (mysqli_num_rows($qr) > 0) {
while($row = mysqli_fetch_array($qr)) {
?>
<div class="panel panel-default">
<div class="panel-heading">
<h6 class="panel-title">Скриншот #<?php echo $row['id']; ?></h6>
<div class="panel-icons-group">
<a href="javascript://" id="bdel_<?php echo $row['id']; ?>" onclick="rdel('<?php echo $row['id']; ?>');" class="btn btn-link btn-icon tip" data-placement="bottom" data-original-title="Удалить"><i class="icon-remove2"></i></a>
</div>
</div>
<div class="panel-body">
<div class="media">
<div class="media-body cpn marnone">
<div class="lightgallerys pull-left marnone">
<a href="/eshop/images/<?php echo $row['img']; ?>" data-sub-html="<?php echo $math['ti']; ?>"><img class="imgeshop" src="/eshop/images/<?php echo $row['img']; ?>" border="0" alt="<?php echo $math['ti']; ?>" title="<?php echo $math['ti']; ?>" /></a>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<?php } else { echo '<div class="alert alert-info fade in"><i class="icon-info"></i> Скриншотов нет</div>'; } ?>
<div id="rdelete" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title"><i class="icon-remove"></i> Удаление скриншота #<font id="todel"></font></h4>
</div>
<div class="modal-body with-padding">
<div class="alert alert-danger fade in"><center>Восстановить скриншот будет нельзя</center></div>
</div>
<div class="modal-footer">
<a class="btn btn-danger" href="javascript://" id="rdel" data-loading-text="<i class='icon-spinner7 spin'></i> Удаляем">Удалить</a>
<button class="btn btn-warning" data-dismiss="modal">Отмена</button>
</div>
</div>
</div>
</div>
<link href="/wu-static/js/lightgallery/css/lightgallery.min.css" rel="stylesheet">
<script src="/wu-static/js/lightgallery/js/picturefill.min.js"></script>
<script src="/wu-static/js/lightgallery/js/lightgallery.min.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-fullscreen.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-thumbnail.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-video.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-autoplay.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-zoom.js"></script>
<script src="/wu-static/js/lightgallery/js/lg-pager.js"></script>
<script src="/wu-static/js/lightgallery/js/jquery.mousewheel.min.js"></script>
<script type='text/javascript'>
var vrdel;
function rdel(id){
vrdel = id;
$('#todel').text(id);
$('#rdelete').modal('show');
};
$(function() {
var btnr = $('#rdel');
btnr.click(function(){
btnr.button('loading');
$.ajax({
type: 'POST',
url: '/wu-engine/wu-actions/adm_eshop_screen_del.php',
data: {'id': vrdel, 'token': token},
cache: false,
success: function(result){
btnr.button('reset');
if (result == '1') {
$(location).attr('href','/<?php echo ADMINPATH; ?>/eshop/images/<?php echo $getid; ?>');
}
if (result == '3') {
jerr();
}
},
error: function(){
btnr.button('reset');
serr();
}
});
});
$('.lightgallerys').lightGallery();
});
</script>
<?php
} else { echo '<div class="alert alert-danger fade in"><i class="icon-warning"></i> Нет такого товара</div>'; }
?>

<?php include('../../wu-engine/wu_footer.php'); ?>