| 13822 |
anikendra |
1 |
<?php echo $this->Html->css('bootstrap-slider');?>
|
| 14056 |
anikendra |
2 |
<?php echo $this->Html->script('bootstrap-slider');?>
|
| 13695 |
anikendra |
3 |
<div class="container">
|
| 14135 |
anikendra |
4 |
<ul class="nav nav-tabs noborder">
|
|
|
5 |
<?php foreach($categories AS $key => $category):?>
|
|
|
6 |
<li class="prefcatselect col-xs-6 <?php if($key==0)echo 'active';?>" data-id="<?php echo $category['Category']['id'];?>">
|
|
|
7 |
<a href="javascript:void(0);" ><?php echo $category['Category']['name'];?></a>
|
|
|
8 |
</li>
|
|
|
9 |
<?php endforeach;?>
|
|
|
10 |
</ul>
|
| 13695 |
anikendra |
11 |
<?php if(!empty($categories)):?>
|
|
|
12 |
<?php foreach ($categories as $key => $category):?>
|
| 14135 |
anikendra |
13 |
<div class="categorypreferences <?php if($key>0)echo 'hidden';?>" id="cat-<?php echo $category['Category']['id'];?>">
|
| 13695 |
anikendra |
14 |
<form name="preferenceform" id="categorypreference-<?php echo $category['Category']['id'];?>" action="/preferences/add" method="POST">
|
|
|
15 |
<input type="hidden" name="user_id" value="<?php echo $logged_user['id'];?>"/>
|
|
|
16 |
<input type="hidden" name="category_id" value="<?php echo $category['Category']['id'];?>"/>
|
|
|
17 |
<div class="row">
|
|
|
18 |
<div class="categorytab">
|
|
|
19 |
<div class="col-xs-8"><span class="categoryname"><?php echo $category['Category']['name'];?></span> <button data-id="<?php echo $category['Category']['id'];?>" type="button" class="editcategorypreferences btn btn-xs">Edit</button></div>
|
|
|
20 |
<div class="col-xs-4" data-id="<?php echo $category['Category']['id'];?>">
|
|
|
21 |
<span class="categorytabcontrol" id="togglepreferences-<?php echo $category['Category']['id'];?>" data-id="<?php echo $category['Category']['id'];?>"></span>
|
|
|
22 |
</div>
|
|
|
23 |
</div>
|
|
|
24 |
</div>
|
| 14286 |
anikendra |
25 |
<div class="row" id="preferences-<?php echo $category['Category']['id'];?>">
|
| 13695 |
anikendra |
26 |
<div class="pricepreferences">
|
|
|
27 |
<h5>My Price Range</h5>
|
| 14049 |
anikendra |
28 |
<?php
|
| 14286 |
anikendra |
29 |
$defaultmin = intval($priceranges[$category['Category']['id']]['min']);
|
|
|
30 |
$defaultmax = intval($priceranges[$category['Category']['id']]['max']);
|
| 14049 |
anikendra |
31 |
?>
|
| 13695 |
anikendra |
32 |
<?php if(!empty($preferredPrices) && isset($preferredPrices[$category['Category']['id']])){
|
|
|
33 |
$range = "[".intval($preferredPrices[$category['Category']['id']]['min_price']).",".intval($preferredPrices[$category['Category']['id']]['max_price'])."]";
|
| 14049 |
anikendra |
34 |
}else{
|
|
|
35 |
$range = '['.$defaultmin.','.$defaultmax.']';
|
| 13695 |
anikendra |
36 |
}?>
|
|
|
37 |
<div class="maxrange col-xs-12">
|
| 14056 |
anikendra |
38 |
<input name="pricerange" id="pricerange-<?php echo $category['Category']['id'];?>" value="" class="slider" data-slider-min="<?php echo $defaultmin;?>" data-slider-max="<?php echo $defaultmax;?>" data-slider-step="500" data-slider-value="<?php echo $range;?>" data-tooltip="show" data-tooltip_split="true"/>
|
| 13695 |
anikendra |
39 |
</div>
|
| 14286 |
anikendra |
40 |
<b class="minrange col-xs-6"><span class="cashbackrupee"></span><?php if(!empty($preferredPrices[$category['Category']['id']]['min_price']))echo intval($preferredPrices[$category['Category']['id']]['min_price']);else echo $defaultmin;?></b>
|
|
|
41 |
<b class="maxrange col-xs-6 text-right"><span class="cashbackrupee"></span><?php if(!empty($preferredPrices[$category['Category']['id']]['max_price']))echo intval($preferredPrices[$category['Category']['id']]['max_price']);else echo $defaultmax;?></b>
|
| 13695 |
anikendra |
42 |
</div>
|
| 13759 |
anikendra |
43 |
<div class="clearfix"></div>
|
|
|
44 |
<div class="brandpreferences">
|
|
|
45 |
<?php if(!empty($category['Brand'])):?>
|
|
|
46 |
<h5>My Favourite Brands</h5>
|
|
|
47 |
<?php foreach ($category['Brand'] as $key => $brand):?>
|
|
|
48 |
<div class="col-xs-6 brands <?php if(empty($brand['displayed_in_preference_page'])):?>hidden notfeatured<?php endif;?>">
|
|
|
49 |
<?php if(!empty($preferredBrands) && isset($preferredBrands[$category['Category']['id']]) && in_array($brand['name'],$preferredBrands[$category['Category']['id']])):?>
|
|
|
50 |
<input type="checkbox" name="brand[]" value="<?php echo $brand['name'];?>" class="brandselector" data-catid="<?php echo $category['Category']['id'];?>" checked="checked"/>
|
|
|
51 |
<?php else:?>
|
|
|
52 |
<input type="checkbox" name="brand[]" value="<?php echo $brand['name'];?>" class="brandselector" data-catid="<?php echo $category['Category']['id'];?>"/>
|
|
|
53 |
<?php endif;?>
|
|
|
54 |
<?php echo $brand['name'];?>
|
|
|
55 |
</div>
|
|
|
56 |
<?php endforeach;?>
|
|
|
57 |
<div class="revealbrands">Others</div>
|
|
|
58 |
<?php endif;?>
|
|
|
59 |
</div>
|
| 13695 |
anikendra |
60 |
</div>
|
|
|
61 |
</form>
|
|
|
62 |
</div>
|
| 14056 |
anikendra |
63 |
<script type="text/javascript">
|
|
|
64 |
$('#pricerange-<?php echo $category['Category']['id'];?>').slider().on('slide',function(){
|
|
|
65 |
var range = $(this).slider('getValue');
|
| 14286 |
anikendra |
66 |
console.log(range[0]);
|
|
|
67 |
$(this).parent().siblings('.minrange').html('<span class="cashbackrupee"></span>'+range[0]);
|
|
|
68 |
$(this).parent().siblings('.maxrange').html('<span class="cashbackrupee"></span>'+range[1]);
|
| 14056 |
anikendra |
69 |
});
|
|
|
70 |
</script>
|
| 13695 |
anikendra |
71 |
<?php endforeach;?>
|
|
|
72 |
<?php endif;?>
|
|
|
73 |
</div>
|
|
|
74 |
</div>
|
| 14056 |
anikendra |
75 |
<script type="text/javascript" src="/js/profittill.js?v=<?php echo $staticversion;?>"></script>
|