Subversion Repositories SmartDukaan

Rev

Rev 19635 | Rev 19638 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
19605 naman 1
<?php if((isset($id) && $id == 6) && ((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories)))):?>
2
	<script type="text/javascript" src="<?php echo $base_url;?>js/iscroll.js"></script>
3
	<script type="text/javascript">
4
	function loaded () {
5
		myScroll = new IScroll('#wrapper', { scrollX: true, scrollY: false, mouseWheel: true, click: true, tap: true });
6
		myScroll1 = new IScroll('#wrapper1', { scrollX: true, scrollY: false, mouseWheel: true, click: true, tap: true });
7
	}</script>
8
<?php endif;?>
18388 naman 9
 
19605 naman 10
<script>
11
$(document).ready(function(){
12
 
13
	var scrollerwidth = 0;
14
	var scroller1width = 0;
15
	$('#scroller li').each(function() {
16
	    var $this = $(this);
17
	    scrollerwidth =scrollerwidth + $this.outerWidth() + 4;
18
	});
19
	var scrollerwidth = ""+(scrollerwidth + 2)+"px";
20
	$('#scroller1 li').each(function() {
21
	    var $this = $(this);
22
	    scroller1width =scroller1width + $this.outerWidth() + 10;
23
	});
24
	var scroller1width = ""+(scroller1width + 2)+"px";
25
 
26
    $('#scroller').css("width",scrollerwidth);
27
    $('#scroller1').css("width",scroller1width);
28
 
29
	$('.getcancel').click(function(){
30
		var urldet = getJsonFromUrl();
31
		var whatfirst = "";
32
	    if(urldet['whatfirst'] !=undefined){
33
	    	whatfirst = urldet['whatfirst'];
34
	    }
35
		var that = $(this);
36
		var brandid = that.attr('data-brandid');
37
		var subcatid = that.attr('data-subCategoryid');
38
		var subcatarr =[];
39
		var brandarr = [];
40
		var url = "/category/6?";
41
 
42
		if(urldet['brands'] != undefined){
43
			brandarr = urldet['brands'].split("^");
44
		}
45
 
46
		if(urldet['subcategories'] != undefined){
47
			subcatarr = urldet['subcategories'].split("^");
48
		}
49
 
50
		if(that.attr('data-type') == "brand"){			
51
			if(jQuery.inArray(brandid, brandarr) !== -1){
52
					var y = jQuery.grep(brandarr, function(value) {
53
						  return value != brandid;
54
						});
55
					brandarr = y;	
56
 
57
				}
58
		}
59
 
60
		if(that.attr('data-type') == "subCategory"){			
61
			if(jQuery.inArray(subcatid, subcatarr) !== -1){
62
					var y = jQuery.grep(subcatarr, function(value) {
63
						  return value != subcatid;
64
						});
65
					subcatarr = y;
66
				}
67
		}
68
 
69
 
70
		if(brandarr.length != 0 && subcatarr.length == 0)
71
		{
72
			if(whatfirst == "subCategory"){
73
				whatfirst = "brand";
74
			}
75
			url = url + "brands="+brandarr.join('^');
76
		}
77
 
78
		else if(brandarr.length == 0 && subcatarr.length != 0)
79
		{
80
			if(whatfirst == "brand"){
81
				whatfirst = "subCategory";
82
			}
83
			url = url + "subcategories="+subcatarr.join('^');
84
		}
85
		else if(brandarr.length != 0 && subcatarr.length != 0)
86
		{
87
			url = url + "brands="+brandarr.join('^')+"&subcategories="+subcatarr.join('^');
88
		}
89
 
90
		if(brandarr.length == 0 && subcatarr.length == 0){
91
			window.location = apihost + "category/6";
92
		}else {
93
			window.location = url+"&whatfirst="+whatfirst;	
94
		}
95
 
96
 
97
 
98
	});	
99
 
100
 
101
 
102
 
103
	$('.downselect').click(function(){
104
 
105
		var urldet = getJsonFromUrl();
106
		var whatfirst = "";
107
	    if(urldet['whatfirst'] !=undefined){
108
	    	whatfirst = urldet['whatfirst'];
109
	    }
110
		var that = $(this);
111
		var brandid = that.attr('data-brandid');
112
		var subcatid = that.attr('data-subCategoryid');
113
		var subcatarr =[];
114
		var brandarr = [];
115
		var url = "/category/6?";
116
 
117
		if(urldet['brands'] != undefined){
118
			brandarr = urldet['brands'].split("^");
119
		}
120
 
121
		if(urldet['subcategories'] != undefined){
122
			subcatarr = urldet['subcategories'].split("^");
123
		}
124
 
125
		if(that.attr('data-type') == "brand"){			
126
			if(jQuery.inArray(brandid, brandarr) !== -1){
127
					var y = jQuery.grep(brandarr, function(value) {
128
						  return value != brandid;
129
						});
130
					brandarr = y;								
131
				}
132
			else{
133
				brandarr.push(brandid);				
134
			}
135
		}
136
 
137
		if(that.attr('data-type') == "subCategory"){			
138
			if(jQuery.inArray(subcatid, subcatarr) !== -1){
139
					var y = jQuery.grep(subcatarr, function(value) {
140
						  return value != subcatid;
141
						});
142
					subcatarr = y;
143
				}
144
			else{				
145
				subcatarr.push(subcatid);
146
			}
147
		}
148
 
149
 
150
		if(brandarr.length != 0 && subcatarr.length == 0)
151
		{
152
			url = url + "brands="+brandarr.join('^');
153
		}
154
 
155
		else if(brandarr.length == 0 && subcatarr.length != 0)
156
		{
157
			url = url + "subcategories="+subcatarr.join('^');
158
		}
159
		else if(brandarr.length != 0 && subcatarr.length != 0)
160
		{
161
			url = url + "brands="+brandarr.join('^')+"&subcategories="+subcatarr.join('^');
162
		}
163
 
164
		window.location = url+"&whatfirst="+whatfirst;
165
 
166
	});	
167
 
168
});
169
</script>
170
<style>
171
.activate{
172
	color:green;
173
}
174
#wrapper,#wrapper1 {
175
	z-index: 1;
176
	bottom: 48px;
177
	left: 0;
178
	overflow: hidden;
179
}
180
#wrapper{
19620 naman 181
	max-height:40px;
19605 naman 182
	width: 97%;
19620 naman 183
	padding: 0px 5px;
184
	min-height: 0px;
19605 naman 185
}
186
#wrapper1{
187
	height:30px;
188
	width: 100%;
189
}
190
 
191
#scroller, #scroller1 {
192
	z-index: 1;
193
	-webkit-tap-highlight-color: rgba(0,0,0,0);
194
	-webkit-transform: translateZ(0);
195
	-moz-transform: translateZ(0);
196
	-ms-transform: translateZ(0);
197
	-o-transform: translateZ(0);
198
	transform: translateZ(0);
199
	-webkit-touch-callout: none;
200
	-webkit-user-select: none;
201
	-moz-user-select: none;
202
	-ms-user-select: none;
203
	user-select: none;
204
	-webkit-text-size-adjust: none;
205
	-moz-text-size-adjust: none;
206
	-ms-text-size-adjust: none;
207
	-o-text-size-adjust: none;
208
	text-size-adjust: none;
209
}
210
 
211
#scroller ul,#scroller1 ul {
212
	list-style: none;
213
	padding: 0;
214
	margin: 0;
215
	width: 100%;	
216
	text-align: center;
217
}
218
 
219
#scroller li, #scroller1 li {
220
	display: block;
221
	float: left;
222
  	margin:2px;
223
	color:white;
224
	border-right: 1px solid #ccc;
225
	background-color: #F2DEDE;
226
	font-size: 12px;
227
}
228
#scroller li{
229
	font-weight:bold;
230
	padding: 7px;
231
	height: 37px;
232
	border-radius:5px;
233
	vertical-align:middle;
234
	font-size: 11px;
235
	min-width: 67px;
236
	max-width: 92px;
237
	text-transform: uppercase;
238
/* 	overflow: hidden ; */
239
	}
240
#scroller1 li {
241
	color: #555;
242
    padding: 5px;
243
    background : none;
244
    height: 23px;
245
    border : #E5E5E5 1px solid;
246
    margin:3px;
247
    text-transform: uppercase;
248
    font-size: 10px;
249
}
250
 
251
.cancelstyle{
252
	font-weight:bold;
253
	background: black;
254
    padding: 1px 3px;
255
    color: white;
256
	border-radius: 4px;
257
 
258
}
259
</style>
260
<?php $catstr = explode("^",$subcategories);?>
261
 
16912 naman 262
 <ul class="nav nav-tabs catselect">
16929 anikendra 263
<?php foreach($categories AS $catId => $name):?>
17686 naman 264
 
17552 manish.sha 265
  	<li class=" tab_layout <?php if((isset($id)) && $catId == $id):?>active<?php endif;?> col-xs-<?php echo (12/(count($categories)+1));?>">
19383 amit.gupta 266
	    <a href="/category/<?php echo $catId;?>"<?php if($id!=6 && $catId==6):?> id="popovertrigger4" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Accessories at wholesale rates"<?php endif;?>>
19636 naman 267
	    	<?php echo $name;?>
19383 amit.gupta 268
	    </a>
18008 amit.gupta 269
    </li>
19383 amit.gupta 270
<?php endforeach;?>		
16929 anikendra 271
</ul>
19605 naman 272
<div class="filters row" >	
16929 anikendra 273
<!-- For apps tab -->		
274
<?php if($id==2):?>
275
	<div class="text-center">
276
		<div class="text_arrange cb">				
17123 naman 277
 
17129 anikendra 278
                  <div class="card row" >
17310 naman 279
                  	<a href = "<?php echo $base_url;?>appb"><span style="color:red;font-size:1.1em">Earn upto Rs. 10,000 per month</span> 
280
                  		<!-- <u style="font-size:.9em">SEE HOW</u> -->
281
                  		<button type="button" class="btn btn-primary btn-sm">SEE HOW</button>
282
                  	</a><br>
283
                  	<!--<span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>--><a href = "<?php echo $base_url;?>appb" style="font-size:1em; color:black"> Download these free apps for your customer.</a>
17313 amit.gupta 284
            <hr style="margin:1px;">
17123 naman 285
            <ul class="list-unstyled " style='margin:1px';>
16929 anikendra 286
                <li class="row row_style" >
17310 naman 287
                  	<div class="row showtips" style="font-size:.9em">
17123 naman 288
                  		<br>
289
                  		<div class='col-xs-11'>
290
                  	 		<font color= 'grey'>Normally cashbacks are not approved for 30-40% cases.</font><br> <font color='red'>Click here </font>to see tips on increasing your profit. 
291
                  	 	</div>
292
                  	 	<div class='col-xs-1'><span class="glyphicon glyphicon-chevron-down"></span></div>
293
                  	</div>
16929 anikendra 294
                  </div>
17129 anikendra 295
                  <div class="apptips hidden" style="background:#fff;">
16929 anikendra 296
                    <div class="row">
297
 
17123 naman 298
                    	<div class="col-xs-12" style='padding:1px'>
299
                    		<ol style="text-align:left;background:#f9fafb">
16929 anikendra 300
                    			<li>Only install new apps</li>
301
                    			<li>Keep network connected after installing apps</li>   			
302
                    			<li>Open the app 4-5 minutes after installing</li>
303
                    			<li>Preferably register and login on app</li>
304
                    		</ol>
305
                    	</div>
306
 
307
                    </div>
308
                  </div>              
309
                </li>
310
            </ul>
17313 amit.gupta 311
            <hr style="margin:1px;">
16929 anikendra 312
		</div>
313
	</div>		
314
<?php endif;?>	
315
<!-- End of apps tab code -->
316
<?php if(isset($notification) && !empty($notification)):?>
317
	<?php if($notification['NotificationRule']['type']=='link'):?>
318
	<div class="alert alert-info text-center col-xs-12">
319
		<a target="_blank" href="<?php echo $notification['NotificationRule']['url'].'?user_id='.$logged_user['id'];?>" class="webnotification"><?php echo $notification['NotificationRule']['message'];?></a>
14150 anikendra 320
	</div>
16929 anikendra 321
	<?php elseif($notification['NotificationRule']['type']=='popup'):?>
322
	<?php 
323
		$url = $notification['NotificationRule']['url'];
324
		if(strpos($url, '?')!==false){
325
			$url .= '&user_id='.$logged_user['id'];
326
		}else{
327
			$url .= '?user_id='.$logged_user['id'];
328
		}
329
	?>
17190 naman 330
	<div class="herotext col-xs-9" style='padding-top:0px'>
17130 anikendra 331
		<!-- Daily profitable deals for you -->
18846 naman 332
		<?php //echo $this->element('headerlinks',array(),array());?>
16929 anikendra 333
		<script type="text/javascript">
334
			$(function(){
335
				$('.notificationMessage').html('<?php echo $notification['NotificationRule']['message'];?>');
336
				$('.notificationUrl').prop('href','<?php echo $url;?>').data('id','<?php echo $notification['NotificationRule']['id'];?>');
337
				if(showpopup(<?php echo $notification['NotificationRule']['id'];?>,<?php echo $notification['NotificationRule']['popup_display_count'];?>,<?php echo $notification['NotificationRule']['popup_display_interval'];?>)) {
338
					$('#notificationModal'+'<?php echo ucfirst($notification['NotificationRule']['popup_type']);?>').modal({show: true,keyboard: false,backdrop: 'static'});	
339
					var postdata = {'user_id':me,'notification_rule_id':'<?php echo $notification['NotificationRule']['id'];?>'};
340
					$.post( "/notification_views/add", postdata, function( data ) {});		
341
					ga('send', 'event', 'popupnotification-<?php echo $notification['NotificationRule']['id'];?>', 'shown', me);	
342
					var properties = {};
343
					properties.id = String('<?php echo $notification['NotificationRule']['id'];?>');
344
					pma.send('popupnotification','shown','<?php echo $notification['NotificationRule']['type'];?>',me,properties);			
345
				}
346
			});
347
		</script>
348
	</div>
349
	<?php endif;?>
18846 naman 350
<?php endif;?>
19605 naman 351
 
352
 
353
	<?php if((isset($id) && $id == 6) && ((!isset($brands) || ( isset($brands) && empty($brands))) && (!isset($subcategories) || (isset($subcategories) && empty($subcategories))))):?>
354
 
355
	<div class="col-xs-12 herotext" style='padding-top:0px'> 
356
 
357
			<?php echo $this->element('headerlinks',array(),array());?>
358
 
359
	</div>
360
 
361
 
19616 naman 362
	<?php elseif($id!=2):?>
17190 naman 363
	<div class="col-xs-9 herotext" style='padding-top:0px'>                	
19605 naman 364
 
365
	    	<?php if((isset($id) && $id == 6) && ((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories)))):?>
366
		    	<div id="wrapperboss" style="position:relative;">
367
				<!-- crossfilter start -->
368
 
369
		    		<div id="wrapper1" style="background:white;">
370
						<div id="scroller1">
371
							<ul>
372
 
373
								<?php foreach($allbrandsubcat['idListInfo'] as $akey => $avalue ):?>
19618 naman 374
									<li class="upselect mtop getcancel quickclick" data-type="<?php if(isset($whatfirst)&&!empty($whatfirst)):?><?php echo $whatfirst;?><?php endif;?>" data-<?php echo $whatfirst."id";?>="<?php echo $akey;?>" ><?php echo $avalue;?> <span class="cancelstyle"> X </span></li>
19605 naman 375
								<?php endforeach;?>
376
 
377
								<?php foreach($allbrandsubcat['result'] as $ckey => $cvalue ):?>
378
									<?php if(in_array($cvalue[$whatsecondid],$secondloop)):?>
19618 naman 379
										<li class="upselect getcancel quickclick" data-type="<?php if(isset($whatsecond)&&!empty($whatsecond)):?><?php echo $whatsecond;?><?php endif;?>" data-<?php echo $whatsecond."id";?>="<?php echo $cvalue[$whatsecondid];?>">
19605 naman 380
										<?php echo $cvalue[$whatsecond];?> <span class="cancelstyle"> X </span>
381
										</li>
382
									<?php endif;?>
383
								<?php endforeach;?>
384
 
385
						    </ul>
386
						</div>
387
					</div>
388
 
389
				<!-- crossfilter end -->
390
 
391
 
392
		    	</div>
393
		    <?php else:?>
394
		    	<?php echo $this->element('headerlinks',array(),array());?>
17123 naman 395
	    	<!-- Daily profitable deals for you	               	        -->
19605 naman 396
		    <?php endif;?>
397
 
398
	</div>   
399
 
400
 
17190 naman 401
	<div class="col-xs-3 pt7">
18388 naman 402
		<?php if((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories))):?>
19605 naman 403
				<a class="btn btn-xs btn-danger filteraction clearfilters pull-right mr5" id="clearfilters" style="margin-top: 4px;padding: 2px 16px; background: #efefef !important;border: 1px; color: #333!important;font-size: 12px;"> RESET </a>
16929 anikendra 404
			<?php endif;?>	
405
	</div>
406
	<?php endif;?> 
18846 naman 407
 
19605 naman 408
<?php if((isset($id) && $id == 6)):?>
17552 manish.sha 409
 
19605 naman 410
<?php else:?>
411
			<?php if($id!=2):?>
412
							<div class = 'col-xs-3 bg-white' style='float:left'>
17552 manish.sha 413
 
414
								<ul class="nav">
415
									<li class="tab_layout <?php if($id!=2):?>bg-white<?php endif;?>">
416
										<?php if($id!=2):?>
417
										<div class="dropdown pull-right">
418
											<a tabindex="0" id="popovertrigger" role="button" class="btn" data-container="body" data-toggle="popover" data-placement="left" data-trigger="click" data-content="<span class='greentext'>Filter by brands</span> to see deals you want"></a>
18388 naman 419
											<button class="<?php if((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories))):?>red-text<?php endif;?> btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
420
												<i class="glyphicon glyphicon-filter"></i> <?php if ((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories))):?>On<?php endif;?>	  
17552 manish.sha 421
												<span class="caret"></span>
422
											</button>
423
											<ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="dropdownMenu1">
424
												<li role="presentation" class="dropdown-header menu-item">
425
													FILTER
18388 naman 426
 
427
 
428
													<?php if((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories))):?>
17552 manish.sha 429
													<button class="btn btn-xs clearfilters btn-danger filteraction" style="position: absolute;right: -5px;top: 5px;" id="clearfilters">Reset</button>
430
												<?php endif;?>	
431
												</li>
17686 naman 432
												<!-- <By subcategory started> -->
433
												<?php if ($id==6):?>
18388 naman 434
												<li role="presentation" class="menu-item"><a role="menuitem" tabindex="-1" href="<?php echo $base_url;?>subcategoryfilter/subcategory<?php if(isset($id)):?>/<?php echo $id;?><?php endif;?>/?<?php echo $_SERVER["QUERY_STRING"];?>">By Product <span class="greyarrow"></span></a></li>
17686 naman 435
												<?php endif;?>
436
 
437
												<!-- <By subcategory ended> -->
18388 naman 438
 
439
												<li role="presentation" class="menu-item"><a role="menuitem" tabindex="-1" href="<?php echo $base_url;?>filter/brand<?php if(isset($id)):?>/<?php echo $id;?><?php endif;?>/?<?php echo $_SERVER["QUERY_STRING"];?>">By Brands <span class="greyarrow"></span></a></li>
17686 naman 440
 
17700 naman 441
 
442
 
443
 
17552 manish.sha 444
												<!-- <li role="presentation" class="menu-item"><a role="menuitem" tabindex="-1" href="#">Price-range</a></li> -->
445
												<!-- <li role="presentation" class="menu-item"><a role="menuitem" tabindex="-1" href="#">Sub-category</a></li> -->
446
												<li role="presentation" class="dropdown-header menu-item">SORT</li>
19605 naman 447
												<li role="presentation" class="menu-item <?php if(isset($sortlabel) && $sortlabel == 'bestseller'):?>selected<?php endif;?>"><a role="menuitem" tabindex="-1" href="?sort=bestSellerPoints&direction=-1<?php if(isset($filterstr)):?><?php echo $filterstr;?><?php endif;?>">Bestsellers</a></li>
18388 naman 448
												<li role="presentation" class="menu-item <?php //if(isset($sort) && $sort == 'available_price'):?><?php //endif;?>">
449
													<span class="sortlabel">Price</span> 
19605 naman 450
							<a role="menuitem" tabindex="-1" href="?sort=available_price&direction=1<?php echo $filterstr;?>" class="btn-asc btn btn-xs" <?php if(isset($sortlabel) && $sortlabel == 'pricelow'):?> style="background:#36d98a;" <?php endif;?>>Low</a>
451
							<a role="menuitem" tabindex="-1" href="?sort=available_price&direction=-1<?php echo $filterstr;?>" class="btn-desc btn-xs" <?php if(isset($sortlabel) && $sortlabel == 'pricehigh'):?> style="background:#36d98a;" <?php endif;?>>High</a>
18388 naman 452
												</li>
17552 manish.sha 453
												<!-- <li role="presentation" class="menu-item <?php if(isset($sort) && $sort == 'available_price' && $direction=='-1'):?>selected<?php endif;?>"><a role="menuitem" tabindex="-1" href="?sort=available_price&direction=-1">Price High to Low</a></li> -->
19605 naman 454
												<li role="presentation" class="menu-item<?php if(isset($sortlabel) && $sortlabel == 'recommended'):?> selected<?php endif;?>"><a role="menuitem" tabindex="-1" href="?sort=-1<?php echo $filterstr;?>">Recommended</a></li>
17552 manish.sha 455
											</ul>
456
										</div>
457
										<?php endif;?>
458
									</li>	
459
								</ul>	
460
							</div>	
19605 naman 461
			<?php endif; ?>
462
<?php endif;?>
16929 anikendra 463
</div>
19605 naman 464
 
465
<?php if((isset($id) && $id == 6) && ((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories))) && (isset($allbrandsubcat) && !empty($allbrandsubcat))):?>
466
<!-- for quickfilter start-->
467
				<div style="background:white;">
468
		    		<div id="wrapper" style="background:white;">
469
						<div id="scroller">
470
							<ul>
471
							<?php $colorcount = 0;?>
472
							<?php foreach($allbrandsubcat['result'] as $bkey => $bvalue ):?>
473
								<?php if(!in_array($bvalue[$whatsecondid],$secondloop)):?>
474
								<?php $strarr = explode(" ", $bvalue[$whatsecond]);?>
19620 naman 475
									<li class="downselect quickclick" data-type="<?php if(isset($whatsecond)&&!empty($whatsecond)):?><?php echo $whatsecond;?><?php endif;?>" data-<?php echo $whatsecond."id";?>="<?php echo $bvalue[$whatsecondid];?>" style="background:<?php echo $color[$colorcount];?>; <?php if(strlen($bvalue[$whatsecond]) >9 && sizeof($strarr)>1):?> font-size: 10px;line-height: 12px;<?php elseif(strlen($bvalue[$whatsecond]) <=9 && sizeof($strarr)>1):?>line-height: 12px;<?php else:?>line-height: 24px;<?php endif;?>">
19605 naman 476
 
477
										<?php 
478
											echo $strarr[0]; 
479
											if(sizeof($strarr) >1){
480
												echo "<br>";
19620 naman 481
												for($abs = 1; $abs< sizeof($strarr);$abs++)
19605 naman 482
												{
483
													echo $strarr[$abs]." ";
484
												}	
485
											}									
486
 
487
 
488
 
489
										?>
490
 
491
									</li>
492
									<?php $colorcount = $colorcount+1;
493
										if($colorcount == 6)
494
										{
495
											$colorcount = 0;
496
										}
497
									?>
498
								<?php endif;?>
499
							<?php endforeach;?>
500
						    </ul>
501
						</div>
502
					</div>
503
				</div>
504
<!-- for quickfilter end-->
505
<?php endif;?>