File: /home/durgeshpandey215/www/zeeroprice.skilladders.com/mystore.php
<? require "application_top.php";
$searchkey = isset($_REQUEST['key'])? $_REQUEST['key'] : "";
$sid = isset($_REQUEST['sid'])? $_REQUEST['sid'] : "";
if(!$sid){
$_SESSION['msg'] = "Invalid access";
header('location:index.php'); exit;
}
$db->where('userid',$sid);
$rowuser = $db->getOne('register');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?=SITE_NAME;?></title>
<!-- Meta tag Keywords -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<meta name="keywords" content="" />
<meta property="og:site_name" content="<?=HTTP_SERVER;?>" />
<meta property="og:url" content="<?=CURRENTURL;?>" />
<meta property="og:title" content="<?=$rowuser['fullname'];?> 's Store" />
<meta property="og:type" content="article" />
<meta property="og:description" content="View & shop products available at <?=$rowuser['fullname'];?>'s store." />
<meta property="og:image" content="<?=HTTP_SERVER;?>images/photos/photosThumbs/<?=($rowuser['pic1'])? $rowuser['pic1']:"default.jpg";?>"/>
<? require "scripts.php";?>
</head>
<body>
<? $pagename = "mystore"; require "header.php";?>
<h3><?=$rowuser['fullname'];?> 's Store</h3>
<div class="py-md-3">
<div class="w3-row">
<?
if($searchkey){
$db->where('ititle','%'.$searchkey.'%','like');
$db->orWhere('description','%'.$searchkey.'%','like');
}
if($sid){
$db->where('sellerid',$sid);
}
$db->where('istatus',1);
$db->where('reducedPrice',0,'>');
$db->where('qty',0,'>');
$db->where('tilldate',CURDATE,'>=');
$db->orderBy('pid','desc');
//---------------Paginate BOF---------------------------------------
$paginatetable = 'products'; //table name
$extra ="key=$searchkey&sid=$sid"; //use '&' in between if more than 1 parameter
$adjacents = 2;
$limit = 20; //how many items to show per page
$db->pageLimit = $limit;
$targetpage = $_SERVER['PHP_SELF']; //your file name (the name of this file)
require "paginate.php";
//------------------------------------------------------------------
if($rows){
?>
<? foreach($rows as $rowprd){
$prdurl = HTTP_SERVER."buy-at-lowest-price/".friendlyURL($rowprd["ititle"])."_".encode($rowprd["pid"]).".html";
?>
<div onclick="window.location='<?=$prdurl;?>'" class="w3-col s6 m3" style="cursor:pointer;">
<div class="w3-card w3-padding-16" style="height:315px;width:96%;margin-bottom:20px;padding:10px;background-color:#fff;">
<center>
<? if($rowprd['pic1'] != ""){ ?>
<img src="<?=HTTP_SERVER;?>images/products/<?=$rowprd['pic1'];?>" class="prodthumb"/>
<? }else{ ?>
<img src="<?=HTTP_SERVER;?>images/products/default.jpg" class="prodthumb"/>
<? } ?>
</center>
<div style="margin-top:10px;width:100%;font-size:14px;word-wrap: break-word;">
<b><?=mb_str_word_count($rowprd['ititle'],1);?></b><br/>
<?=mb_str_word_count($rowprd['description'],5);?>...<br/>
<font style="font-size:18px;"><?=currSign($rowprd['currency']);?>.<?=$rowprd['mrp'];?></font>
</div>
</div>
</div>
<? } ?>
<? }else{
echo "No products found!";
} ?>
</div>
<center><?=$pagination;?></center>
<br/>
<?
$wtmsgtosend = 'Visit and shop online at our store here %0a'.CURRENTURL;
?>
<center><a href="https://wa.me/?text=<?=$wtmsgtosend;?>" class="btn w3-green w3-display-container"><img src="<?=HTTP_SERVER;?>images/whatsapp.svg" style="width:20px;"> Share On Whatsapp</a></center>
<br/>
<br/>
</center>
</div>
<? require "footer.php";?>
<script>
// work in progress - needs some refactoring and will drop JQuery i promise :)
var instance = $(".hs__wrapper");
$.each( instance, function(key, value) {
var arrows = $(instance[key]).find(".arrow"),
prevArrow = arrows.filter('.arrow-prev'),
nextArrow = arrows.filter('.arrow-next'),
box = $(instance[key]).find(".hs"),
x = 0,
mx = 0,
maxScrollWidth = box[0].scrollWidth - (box[0].clientWidth / 2) - (box.width() / 2);
$(arrows).on('click', function() {
if ($(this).hasClass("arrow-next")) {
x = ((box.width() / 2)) + box.scrollLeft() - 10;
box.animate({
scrollLeft: x,
})
} else {
x = ((box.width() / 2)) - box.scrollLeft() -10;
box.animate({
scrollLeft: -x,
})
}
});
$(box).on({
mousemove: function(e) {
var mx2 = e.pageX - this.offsetLeft;
if(mx) this.scrollLeft = this.sx + mx - mx2;
},
mousedown: function(e) {
this.sx = this.scrollLeft;
mx = e.pageX - this.offsetLeft;
},
scroll: function() {
toggleArrows();
}
});
$(document).on("mouseup", function(){
mx = 0;
});
function toggleArrows() {
if(box.scrollLeft() > maxScrollWidth - 10) {
// disable next button when right end has reached
nextArrow.addClass('disabled');
} else if(box.scrollLeft() < 10) {
// disable prev button when left end has reached
prevArrow.addClass('disabled')
} else{
// both are enabled
nextArrow.removeClass('disabled');
prevArrow.removeClass('disabled');
}
}
});
</script>