Subversion Repositories SmartDukaan

Rev

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

<div class="container">
        <div class="row">
                <div class="col-lg-3">
                        <?php echo $this->Element('adminactions');?>
                </div>
                <div class="col-lg-9">
                        <h4>Generate url for sending push notifications for selected brands</h4>
                        <div class="row">
                                <?php if(!empty($categories)):?>
                                        <?php foreach ($categories as $key => $category):?>
                                                <div class="col-xs-6">
                                                        <input class="category" type="radio" name="category_id" value="<?php echo $category['Category']['id'];?>"><?php echo $category['Category']['name'];?></input>
                                                        <div class="clearfix"></div>
                                                        <?php if(!empty($category['Brand'])):?>
                                                        <select name="brands" multiple class="brands col-xs-12" data-categoryId="<?php echo $category['Category']['id'];?>">                                    
                                                                <?php foreach ($category['Brand'] as $key => $brand):?>
                                                                <option value="<?php echo $brand['id'];?>"><?php echo $brand['name'];?></option>        
                                                                <?php endforeach;?>
                                                        </select>
                                                        <?php endif;?>
                                                </div>                                                          
                                        <?php endforeach;?>
                                <?php endif;?>
                        </div>
                        <div class="clearfix mt20"/>
                        <div class="row text-center">           
                                <div class="col-xs-12">
                                        URL : <textarea name="url" id="url" rows="2" ></textarea>
                                </div>
                        </div
                </div>
        </div>
</div>
<script type="text/javascript">
var baseurl = 'http://api.profittill.com/brands/filter/';
$(function(){
        $('.category').on('click',function(){
                $('#url').html('');
                $('.brands').each(function(){
                        $(this).attr('checked',false);
                });
        });
        $('.brands').on('change',function(){
                url = baseurl+$(this).val().join(',')+'/'+$(this).data('categoryid');
                $('#url').html(url);
                console.log($(this).data('categoryid'));
        })
});
</script>
<style type="text/css">
.brands{height: 200px !important;}
</style>