<?php
$page_name = 'Поиск товаров';
$page_keys = 'Поиск товаров';
$page_desc = 'Поиск товаров';
$online_title = 'На странице поиска';
$online_url = '/eshop_search';
include('wu-engine/wu_header.php');
?>
<!-- Контент -->

<script src="/wu-static/js/multiselect.js" type="text/javascript"></script>
<script type='text/javascript'>
$(function() {
$('.multi-select-search').multiselect({
buttonClass: 'btn btn-link btn-lg btn-icon',
dropRight: true,
buttonText: function(options) {
if (options.length == 0) {
return '<b class="caret"></b>';
}
else {
return ' <b class="caret"></b>';
}
},
onChange:function(element, checked){
$.uniform.update();
}
});
});
</script>
<form action="#" class="search-line block" role="form">
<span class="subtitle"><i class="icon-search3"></i> Поиск:</span>
<div class="input-group">
<div class="search-control">
<input type="text" class="form-control autocomplete" placeholder="Введите текст для поиска" id="text" />
<select id="cat" multiple="multiple" class="multi-select-search" tabindex="2" style="display: none;">
<option value="1">Скрипты</option>
<option value="2">Программы</option>
<option value="3">Для телефона</option>
<option value="4">Видео</option>
<option value="5">Аудио</option>
<option value="6">Книги</option>
<option value="7">Ключи</option>
<option value="8">Дизайн</option>
<option value="9">Остальное</option>
</select>
</div>
<span class="input-group-btn">
<button class="btn btn-primary" type="button" id="search">Искать</button>
</span>
</div>
</form>
<div id="sresult"></div>
<script src="/wu-static/js/jscroll.js" type="text/javascript"></script>
<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'>
$(function() {
$('.ajaxnext').remove();
var content = $("#sresult");
loading = "<center><i class='icon-spinner7 margload spin'></i></center>";
var btns = $('#search');
btns.click(function() {
content.removeData('jscroll');
content.html('');
var text = $("#text").val();
var cat = $("#cat").val();
if(text) {
$.ajax({
type: "POST",
url: "/wu-engine/wu-actions/eshop_search.php",
data: {'text': text, 'cat': cat, 'token': token},
cache: false,
success: function(data){
if(data){
$(".jscroll-loading").hide();
content.append(data);
content.jscroll({
loadingHtml: loading
});
};
},
beforeSend: function(){
content.append("<div class='jscroll-loading'>" + loading + "</div>");
},
error: function(){
serr();
}
});
} else { $.jGrowl('Вы не ввели текст для поиска', { theme: 'growl-error' }); }
return false;
});
});
function fav(id){
<?php if(USER_LOGGED){ ?>
$('#fav_'+id).button('loading');
$.ajax({
type: 'POST',
url: '/wu-engine/wu-actions/eshop_fav_add.php',
data: {'id': id, 'token': token},
cache: false,
success: function(result){
$('#fav_'+id).button('reset');
if (result == '0') {
$.jGrowl('Товар уже в избранном', { theme: 'growl-error' });
}
if (result == '1') {
$.jGrowl('Добавлено в избранное', { theme: 'growl-success' });
$('#fav_'+id).hide();
$('#favb_'+id).show();
}
if (result == '3') {
jerr();
}
},
error: function(){
$('#fav_'+id).button('reset');
serr();
}
});
<?php } else { ?>
$.jGrowl('Авторизуйтесь для добавления в избранное', { theme: 'growl-error' });
<?php } ?>
};
function favb(id){
<?php if(USER_LOGGED){ ?>
$('#favb_'+id).button('loading');
$.ajax({
type: 'POST',
url: '/wu-engine/wu-actions/eshop_fav_back.php',
data: {'id': id, 'token': token},
cache: false,
success: function(result){
$('#favb_'+id).button('reset');
if (result == '0') {
$.jGrowl('Товар не в избранном', { theme: 'growl-error' });
}
if (result == '1') {
$.jGrowl('Удалено из избранного', { theme: 'growl-success' });
$('#fav_'+id).show();
$('#favb_'+id).hide();
}
if (result == '3') {
jerr();
}
},
error: function(){
$('#fav_'+id).button('reset');
serr();
}
});
<?php } else { ?>
$.jGrowl('Необходимо авторизоваться', { theme: 'growl-error' });
<?php } ?>
};
$(function() {
$('.lightgallerys').lightGallery();
});
</script>

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