<?php
$idCategory = mysqli_real_escape_string($_MS_ID, $routes[1]);
$categoryInfo = "SELECT * FROM `category` WHERE `id` = '{$idCategory}';";
$categoryInfo = mysqli_get_query($categoryInfo);
if(is_null($categoryInfo)) showMessage("warning", "Извините, данная страница сейчас недоступна, повторите попытку позже");
else {
?>
<div class="row" style="margin-right: -15px;margin-left: -36px;margin-top: -45px;margin-bottom: -85px;">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="results hidden animated fadeIn">
<div class='alert alert-warning' id="errorMsg"></div>
<div class="hr-line-dashed"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<div class="input-group m-b form-horizontal">
</div>
</div>
</div>
<form class="form-horizontal" method="POST" id="formx" action="javascript:void(null);" onsubmit="sendOrderCategory()">
<div class="form-group">
<div class="col-sm-6">
<img style="width: 100%;">
</div>
</div>
<!-- Win -->
<div class="modal fade" id="win-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><?=$categoryInfo['name']?></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<img src="https://naku-store.ru/item/60" alt="">
<span class="win-game-title"></span>
<a href="https://naku-store.ru/profile" class="pickup-btn">Забрать</a>
<p class="reg-message">Все ваши выйгрыши находятся в личном кабинете и всегда доступны от туда.</p>
</div>
</div>
</div>
</div>
<!-- Video -->
<!-- Roll -->
<div class="modal fade" id="trailer" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<div class="modal-content">
<iframe id="gamevideo" src="./Магазин игр Naku Store — Grand Theft Auto V_files/saved_resource.html" data-src="https://steamcdn-a.akamaihd.net/steam/apps/256703157/movie480.webm?t=1512687177" allowfullscreen="" width="798" height="449" frameborder="0"></iframe>
</div>
</div>
</div>
<div class="item-block">
<div class="container">
<div class="item-gallery">
<div class="item-poster">
<img src="<?=$categoryInfo['img']?>">
<a href="<?=$categoryInfo['OC']?>" width="400" height="225" target="_blank" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen data-toggle="modal" id="item-video">Трейлер</a>
</div>
<div class="screenshots">
<h3>Скриншоты</h3>
<div class="screenshot-items slick-initialized slick-slider">
<div class="slick-list draggable"><div class="slick-track" style="opacity: 1; width: 318px; transform: translate3d(0px, 0px, 0px);"><div class="screenshots-pic slick-slide slick-current slick-active" data-slick-index="0" aria-hidden="false" style="width: 90px;" tabindex="0">
<a target="_blank" href="<?=$categoryInfo['img1']?>" tabindex="0">
<img src="<?=$categoryInfo['img1']?>" value="">
</a>
</div><div class="screenshots-pic slick-slide slick-active" data-slick-index="1" aria-hidden="false" style="width: 90px;" tabindex="0">
<a target="_blank" href="<?=$categoryInfo['img2']?>" tabindex="0">
<img src="<?=$categoryInfo['img2']?>" value="">
</a>
</div><div class="screenshots-pic slick-slide slick-active" data-slick-index="2" aria-hidden="false" style="width: 90px;" tabindex="0">
<a target="_blank" href="<?=$categoryInfo['img3']?>" tabindex="0">
<img src="<?=$categoryInfo['img3']?>" value="">
</a>
</div></div></div>
</div>
</div>
</div>
<div class="item-information">
<span class="steam"><?=$categoryInfo['name']?></span>
<div class="item-tags">
<span><?=$categoryInfo['buy1']?></span><span><?=$categoryInfo['buy2']?></span></div>
<div class="item-type">
<p>
Тип: <span><?=$categoryInfo['description']?></span>
</p>
</div>
<div class="item-promo">
<p style="font-family: sans-serif;font-size: 13px;">
<?=$categoryInfo['vdsvps']?></p>
</div>
<div class="item-price">
<span><?=$categoryInfo['priceRub']?> Rub</span>
<div class="item-price-options">
<span class="item-available">Доступна</span>
<span class="item-delivery">Моментальная доставка</span>
<span class="item-guarantees">100% Гарантия</span>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-8"></div>
<div class="col-sm-4">
<input value="<?=$categoryInfo['minCount']?>" name="count" id="count" style="margin-left: -3000px;" data-style="zoom-in" onchange="updatePrice(<?=$categoryInfo['priceRub']?>);" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10" style="margin-left: -300px;margin-top: -62px;">
<input type="hidden"" name="id" value="<?=$idCategory?>">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<div class="form-horizontal pull-right">
<input type="checkbox" id="ruleCheck" style="margin-left: -3000px;" value="rule" checked="checked">
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-8"></div>
<div class="col-sm-4">
<input id="sub_button" name="buy" class="ladda-button btn btn-primary pull-right" style="margin-top: -263px;margin-right: 268px;" type="submit" data-style="zoom-in" value="Купить">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function sendOrderCategory() {
var postData = $('#formx').serialize();
$.ajax({
dataType:'json',
url:'/main/ajax/createOrderCategory.php',
data:postData,
type:'POST',
success:function(data) {
if(data.errorMsg!=null) {
$(".results").removeClass("hidden");
$("#errorMsg").html(data.errorMsg);
d = new Date();
grecaptcha.reset();
} else {
window.location.href = location.protocol+'//'+location.hostname+"/order/"+data.idOrder;
}
}
})
}
</script>
<script>updatePrice(<?=$categoryInfo['priceRub']?>);</script>
<?php } ?>