Subversion Repositories SmartDukaan

Rev

Rev 19383 | Rev 19616 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19383 Rev 19605
Line -... Line 1...
-
 
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;?>
-
 
9
 
-
 
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
/* 	position: absolute; */
-
 
176
	z-index: 1;
-
 
177
/* 	top: 5px; */
-
 
178
	bottom: 48px;
-
 
179
	left: 0;
-
 
180
/* 	width: 100%; */
-
 
181
/* 	height: 24px; */
-
 
182
	overflow: hidden;
-
 
183
}
-
 
184
#wrapper{
-
 
185
/* 	top: 25px; */
-
 
186
	height:40px;
-
 
187
	width: 97%;
-
 
188
	padding: 0px 5px
-
 
189
}
-
 
190
#wrapper1{
-
 
191
	height:30px;
-
 
192
	width: 100%;
-
 
193
/* 	top: 2px; */
-
 
194
}
-
 
195
 
-
 
196
#scroller, #scroller1 {
-
 
197
/* 	position: absolute; */
-
 
198
	z-index: 1;
-
 
199
	-webkit-tap-highlight-color: rgba(0,0,0,0);
-
 
200
/* 	width: 500px; */
-
 
201
	
-
 
202
	
-
 
203
	-webkit-transform: translateZ(0);
-
 
204
	-moz-transform: translateZ(0);
-
 
205
	-ms-transform: translateZ(0);
-
 
206
	-o-transform: translateZ(0);
-
 
207
	transform: translateZ(0);
-
 
208
	-webkit-touch-callout: none;
-
 
209
	-webkit-user-select: none;
-
 
210
	-moz-user-select: none;
-
 
211
	-ms-user-select: none;
-
 
212
	user-select: none;
-
 
213
	-webkit-text-size-adjust: none;
-
 
214
	-moz-text-size-adjust: none;
-
 
215
	-ms-text-size-adjust: none;
-
 
216
	-o-text-size-adjust: none;
-
 
217
	text-size-adjust: none;
-
 
218
}
-
 
219
 
-
 
220
#scroller ul,#scroller1 ul {
-
 
221
	list-style: none;
-
 
222
	padding: 0;
-
 
223
	margin: 0;
-
 
224
	width: 100%;	
-
 
225
	text-align: center;
-
 
226
}
-
 
227
 
-
 
228
#scroller li, #scroller1 li {
-
 
229
	display: block;
-
 
230
	float: left;
-
 
231
/*   	height: 24px; 	 */
-
 
232
  	margin:2px;
-
 
233
	color:white;
-
 
234
	border-right: 1px solid #ccc;
-
 
235
	background-color: #F2DEDE;
-
 
236
	font-size: 12px;
-
 
237
}
-
 
238
#scroller li{
-
 
239
	font-weight:bold;
-
 
240
	padding: 7px;
-
 
241
	height: 37px;
-
 
242
	border-radius:5px;
-
 
243
	vertical-align:middle;
-
 
244
	font-size: 11px;
-
 
245
	min-width: 67px;
-
 
246
	max-width: 92px;
-
 
247
	text-transform: uppercase;
-
 
248
/* 	overflow: hidden ; */
-
 
249
	}
-
 
250
#scroller1 li {
-
 
251
	color: #555;
-
 
252
    padding: 5px;
-
 
253
    background : none;
-
 
254
    height: 23px;
-
 
255
    border : #E5E5E5 1px solid;
-
 
256
    margin:3px;
-
 
257
    text-transform: uppercase;
-
 
258
    font-size: 10px;
-
 
259
}
-
 
260
 
-
 
261
.cancelstyle{
-
 
262
	font-weight:bold;
-
 
263
	background: black;
-
 
264
    padding: 1px 3px;
-
 
265
    color: white;
-
 
266
	border-radius: 4px;
-
 
267
	
-
 
268
}
-
 
269
</style>
-
 
270
<?php $catstr = explode("^",$subcategories);?>
1
 
271
 
2
 <ul class="nav nav-tabs catselect">
272
 <ul class="nav nav-tabs catselect">
3
<?php foreach($categories AS $catId => $name):?>
273
<?php foreach($categories AS $catId => $name):?>
4
	
274
	
5
  	<li class=" tab_layout <?php if((isset($id)) && $catId == $id):?>active<?php endif;?> col-xs-<?php echo (12/(count($categories)+1));?>">
275
  	<li class=" tab_layout <?php if((isset($id)) && $catId == $id):?>active<?php endif;?> col-xs-<?php echo (12/(count($categories)+1));?>">
Line 7... Line 277...
7
	    	<?php echo $name;?>
277
	    	<?php echo $name;?>
8
	    </a>
278
	    </a>
9
    </li>
279
    </li>
10
<?php endforeach;?>		
280
<?php endforeach;?>		
11
</ul>
281
</ul>
12
<div class="filters row" <?php if($id==6 && isset($subcategories) && array_key_exists($subcategories, $searchableSubCategories)):?> style="display:none"<?php endif;?>>	
282
<div class="filters row" >	
13
<!-- For apps tab -->		
283
<!-- For apps tab -->		
14
<?php if($id==2):?>
284
<?php if($id==2):?>
15
	<div class="text-center">
285
	<div class="text-center">
16
		<div class="text_arrange cb">				
286
		<div class="text_arrange cb">				
17
			
287
			
Line 86... Line 356...
86
			});
356
			});
87
		</script>
357
		</script>
88
	</div>
358
	</div>
89
	<?php endif;?>
359
	<?php endif;?>
90
<?php endif;?>
360
<?php endif;?>
-
 
361
 
-
 
362
 
-
 
363
	<?php if((isset($id) && $id == 6) && ((!isset($brands) || ( isset($brands) && empty($brands))) && (!isset($subcategories) || (isset($subcategories) && empty($subcategories))))):?>
-
 
364
	
-
 
365
	<div class="col-xs-12 herotext" style='padding-top:0px'> 
-
 
366
	
-
 
367
			<?php echo $this->element('headerlinks',array(),array());?>
-
 
368
	
-
 
369
	</div>
-
 
370
	
-
 
371
 
91
	<?php if($id!=2):?>
372
	<?php elseif($id!=2 && $id != 6):?>
92
	<div class="col-xs-9 herotext" style='padding-top:0px'>                	
373
	<div class="col-xs-9 herotext" style='padding-top:0px'>                	
-
 
374
	    		    	
-
 
375
	    	<?php if((isset($id) && $id == 6) && ((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories)))):?>
-
 
376
		    	<div id="wrapperboss" style="position:relative;">
-
 
377
				<!-- crossfilter start -->
-
 
378
				
-
 
379
		    		<div id="wrapper1" style="background:white;">
-
 
380
						<div id="scroller1">
-
 
381
							<ul>
-
 
382
								
-
 
383
								<?php foreach($allbrandsubcat['idListInfo'] as $akey => $avalue ):?>
-
 
384
									<li class="upselect mtop getcancel" 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>
-
 
385
								<?php endforeach;?>
-
 
386
								
-
 
387
								<?php foreach($allbrandsubcat['result'] as $ckey => $cvalue ):?>
-
 
388
									<?php if(in_array($cvalue[$whatsecondid],$secondloop)):?>
-
 
389
										<li class="upselect getcancel" data-type="<?php if(isset($whatsecond)&&!empty($whatsecond)):?><?php echo $whatsecond;?><?php endif;?>" data-<?php echo $whatsecond."id";?>="<?php echo $cvalue[$whatsecondid];?>">
-
 
390
										<?php echo $cvalue[$whatsecond];?> <span class="cancelstyle"> X </span>
-
 
391
										</li>
-
 
392
									<?php endif;?>
-
 
393
								<?php endforeach;?>
-
 
394
								
-
 
395
						    </ul>
-
 
396
						</div>
-
 
397
					</div>
-
 
398
				
-
 
399
				<!-- crossfilter end -->
-
 
400
				
-
 
401
		    	
-
 
402
		    	</div>
-
 
403
		    <?php else:?>
93
	    	<?php echo $this->element('headerlinks',array(),array());?>
404
		    	<?php echo $this->element('headerlinks',array(),array());?>
94
	    	<!-- Daily profitable deals for you	               	        -->
405
	    	<!-- Daily profitable deals for you	               	        -->
-
 
406
		    <?php endif;?>
-
 
407
	    	
95
	</div>        
408
	</div>   
-
 
409
	 
-
 
410
	     
96
	<div class="col-xs-3 pt7">
411
	<div class="col-xs-3 pt7">
97
		<?php if((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories))):?>
412
		<?php if((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories))):?>
98
				<a class="btn btn-xs btn-danger filteraction clearfilters pull-right mr5" id="clearfilters">Reset <i class="glyphicon glyphicon-chevron-right"></i></a>
413
				<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>
99
			<?php endif;?>	
414
			<?php endif;?>	
100
	</div>
415
	</div>
101
	<?php endif;?> 
416
	<?php endif;?> 
102
			
417
			
-
 
418
<?php if((isset($id) && $id == 6)):?>
103
 
419
 
-
 
420
<?php else:?>
104
<?php if($id!=2) {?>
421
			<?php if($id!=2):?>
105
<div class = 'col-xs-3 bg-white' style='float:left'>
422
							<div class = 'col-xs-3 bg-white' style='float:left'>
106
 
423
 
107
								<ul class="nav">
424
								<ul class="nav">
108
									<li class="tab_layout <?php if($id!=2):?>bg-white<?php endif;?>">
425
									<li class="tab_layout <?php if($id!=2):?>bg-white<?php endif;?>">
109
										<?php if($id!=2):?>
426
										<?php if($id!=2):?>
110
										<div class="dropdown pull-right">
427
										<div class="dropdown pull-right">
Line 135... Line 452...
135
												
452
												
136
 
453
 
137
												<!-- <li role="presentation" class="menu-item"><a role="menuitem" tabindex="-1" href="#">Price-range</a></li> -->
454
												<!-- <li role="presentation" class="menu-item"><a role="menuitem" tabindex="-1" href="#">Price-range</a></li> -->
138
												<!-- <li role="presentation" class="menu-item"><a role="menuitem" tabindex="-1" href="#">Sub-category</a></li> -->
455
												<!-- <li role="presentation" class="menu-item"><a role="menuitem" tabindex="-1" href="#">Sub-category</a></li> -->
139
												<li role="presentation" class="dropdown-header menu-item">SORT</li>
456
												<li role="presentation" class="dropdown-header menu-item">SORT</li>
140
												<li role="presentation" class="menu-item <?php if($sortlabel == 'bestseller'):?>selected<?php endif;?>"><a role="menuitem" tabindex="-1" href="?sort=bestSellerPoints&direction=-1<?php echo $filterstr;?>">Bestsellers</a></li>
457
												<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>
141
												<li role="presentation" class="menu-item <?php //if(isset($sort) && $sort == 'available_price'):?><?php //endif;?>">
458
												<li role="presentation" class="menu-item <?php //if(isset($sort) && $sort == 'available_price'):?><?php //endif;?>">
142
													<span class="sortlabel">Price</span> 
459
													<span class="sortlabel">Price</span> 
143
							<a role="menuitem" tabindex="-1" href="?sort=available_price&direction=1<?php echo $filterstr;?>" class="btn-asc btn btn-xs" <?php if($sortlabel == 'pricelow'):?> style="background:#36d98a;" <?php endif;?>>Low</a>
460
							<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>
144
							<a role="menuitem" tabindex="-1" href="?sort=available_price&direction=-1<?php echo $filterstr;?>" class="btn-desc btn-xs" <?php if($sortlabel == 'pricehigh'):?> style="background:#36d98a;" <?php endif;?>>High</a>
461
							<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>
145
												</li>
462
												</li>
146
												<!-- <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> -->
463
												<!-- <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> -->
147
												<li role="presentation" class="menu-item<?php if($sortlabel == 'recommended'):?> selected<?php endif;?>"><a role="menuitem" tabindex="-1" href="?sort=-1<?php echo $filterstr;?>">Recommended</a></li>
464
												<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>
148
											</ul>
465
											</ul>
149
										</div>
466
										</div>
150
										<?php endif;?>
467
										<?php endif;?>
151
									</li>	
468
									</li>	
152
								</ul>	
469
								</ul>	
153
							</div>	
470
							</div>	
-
 
471
			<?php endif; ?>
154
<?php } ?>
472
<?php endif;?>
155
</div>
473
</div>
-
 
474
 
-
 
475
<?php if((isset($id) && $id == 6) && ((isset($brands) && !empty($brands)) || (isset($subcategories) && !empty($subcategories))) && (isset($allbrandsubcat) && !empty($allbrandsubcat))):?>
-
 
476
<!-- for quickfilter start-->
-
 
477
				<div style="background:white;">
-
 
478
		    		<div id="wrapper" style="background:white;">
-
 
479
						<div id="scroller">
-
 
480
							<ul>
-
 
481
							<?php $colorcount = 0;?>
-
 
482
							<?php foreach($allbrandsubcat['result'] as $bkey => $bvalue ):?>
-
 
483
								<?php if(!in_array($bvalue[$whatsecondid],$secondloop)):?>
-
 
484
								<?php $strarr = explode(" ", $bvalue[$whatsecond]);?>
-
 
485
									<li class="downselect" 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;?>;">
-
 
486
										
-
 
487
										<?php 
-
 
488
											echo $strarr[0]; 
-
 
489
											if(sizeof($strarr) >1){
-
 
490
												echo "<br>";
-
 
491
												for($abs = 1; $abs<= sizeof($strarr);$abs++)
-
 
492
												{
-
 
493
													echo $strarr[$abs]." ";
-
 
494
												}	
-
 
495
											}									
-
 
496
											
-
 
497
											
-
 
498
											
-
 
499
										?>
-
 
500
										
-
 
501
									</li>
-
 
502
									<?php $colorcount = $colorcount+1;
-
 
503
										if($colorcount == 6)
-
 
504
										{
-
 
505
											$colorcount = 0;
-
 
506
										}
-
 
507
									?>
-
 
508
								<?php endif;?>
-
 
509
							<?php endforeach;?>
-
 
510
						    </ul>
-
 
511
						</div>
-
 
512
					</div>
-
 
513
				</div>
-
 
514
<!-- for quickfilter end-->
-
 
515
<?php endif;?>
156
516