Subversion Repositories SmartDukaan

Rev

Rev 16066 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php echo $this->Html->css('bootstrap-slider');?>
<?php echo $this->Html->script('bootstrap-slider');?>
<div class="container"> 
        <ul class="nav nav-tabs noborder">
        <?php foreach($categories AS $key => $category):?>
        <?php if($category['Category']['id'] != 6):?>
                <li class="prefcatselect col-xs-6 <?php if($key==0)echo 'active';?>" data-id="<?php echo $category['Category']['id'];?>">
                <a href="javascript:void(0);" ><?php echo $category['Category']['name'];?></a>
            </li>
        <?php endif;?>
        <?php endforeach;?>
        </ul>
        <?php if(!empty($categories)):?>
                <?php foreach ($categories as $key => $category):?>
                <div class="categorypreferences <?php if($key>0)echo 'hidden';?>" id="cat-<?php echo $category['Category']['id'];?>">
                        <form name="preferenceform" id="categorypreference-<?php echo $category['Category']['id'];?>" action="/preferences/add" method="POST">
                                <input type="hidden" name="user_id" value="<?php echo $logged_user['id'];?>"/> 
                                <input type="hidden" name="category_id" value="<?php echo $category['Category']['id'];?>"/> 
                        <div class="row controls">
                                <div class="categorytab">
                                        <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>
                                        <div class="col-xs-4" data-id="<?php echo $category['Category']['id'];?>">
                                                <span class="categorytabcontrol" id="togglepreferences-<?php echo $category['Category']['id'];?>" data-id="<?php echo $category['Category']['id'];?>"></span>
                                        </div>
                                </div>
                        </div>
                        <div class="row" id="preferences-<?php echo $category['Category']['id'];?>">
                                <div class="pricepreferences">
                                        <h5>My Price Range</h5>
                                        <?php 
                                                $defaultmin = intval($priceranges[$category['Category']['id']]['min']);
                                                $defaultmax =  intval($priceranges[$category['Category']['id']]['max']);
                                        ?>
                                        <?php if(!empty($preferredPrices) && isset($preferredPrices[$category['Category']['id']])){
                                                        $range = "[".intval($preferredPrices[$category['Category']['id']]['min_price']).",".intval($preferredPrices[$category['Category']['id']]['max_price'])."]";
                                                }else{                                                  
                                                        $range = '['.$defaultmin.','.$defaultmax.']';
                                                }?>
                                        <div class="maxrange col-xs-12">
                                                <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"/>
                                        </div>
                                        <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>
                                        <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>
                                </div>
                                <div class="clearfix"></div>
                                <div class="brandpreferences">                  
                                <?php if(!empty($category['Brand'])):?>
                                        <h5>My Favourite Brands</h5>
                                        <?php foreach ($category['Brand'] as $key => $brand):?>
                                                <div class="col-xs-6 brands <?php if(empty($brand['displayed_in_preference_page'])):?>hidden notfeatured<?php endif;?>">
                                                        <?php if(!empty($preferredBrands) && isset($preferredBrands[$category['Category']['id']]) && in_array($brand['name'],$preferredBrands[$category['Category']['id']])):?>
                                                                        <input type="checkbox" name="brand[]" value="<?php echo $brand['name'];?>" class="brandselector active" data-catid="<?php echo $category['Category']['id'];?>" checked="checked"/> 
                                                        <?php else:?>
                                                                <input type="checkbox" name="brand[]" value="<?php echo $brand['name'];?>" class="brandselector active" data-catid="<?php echo $category['Category']['id'];?>"/> 
                                                        <?php endif;?>
                                                        <?php echo $brand['name'];?>                                                    
                                                </div>
                                        <?php endforeach;?>
                                        <div class="revealbrands">Others</div>
                                <?php endif;?>
                                </div>                                                          
                        </div>
                        </form>
                </div>
                <script type="text/javascript">
                        $('#pricerange-<?php echo $category['Category']['id'];?>').slider().on('slide',function(){
                                var range = $(this).slider('getValue');
                                $(this).parent().siblings('.minrange').html('<span class="cashbackrupee"></span>'+range[0]);
                                $(this).parent().siblings('.maxrange').html('<span class="cashbackrupee"></span>'+range[1]);
                                $(this).parents('.row').siblings('.controls').find('.editcategorypreferences',0).click();
                        });
                </script>
                <?php endforeach;?>
        <?php endif;?>
        <div class="hidden text-center firsttimemsg">
        <?php if(isset($firsttime)):?>  
                <a class="showdeals btn btn-block btn-primary" href="<?php echo $base_url;?>deals/?user_id=<?php echo $userId;?>">Show my Deals</a>
                <img src="<?php echo $base_url;?>img/preference-success.png"/>  
        <?php else:?>
                <a class="showdeals btn btn-block btn-primary" href="<?php echo $base_url;?>deals/?user_id=<?php echo $userId;?>">Show my Deals</a>
        <?php endif;?>
        </div>
</div>
<script type="text/javascript" src="/js/profittill.js?v=<?php echo $staticversion;?>"></script>