Subversion Repositories SmartDukaan

Rev

Blame | 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">
                        <?php echo $this->Form->create('FeaturedDeal'); ?>
                                <fieldset>
                                        <legend><?php echo __('Add Featured Deal'); ?></legend>
                                <?php
                                        echo $this->Form->input('sku',array('type'=>'number'));
                                        echo $this->Form->input('FeaturedDeal.rankDetails.0',array('type'=>'number','label'=>'Default Rank'));
                                        $options = array(
                                            '3' => 'Mobiles',
                                            '5' => 'Tablets'
                                        );

                                        $attributes = array(
                                            'legend' => false,
                                            'value' => 3,
                                            'class' => 'catselect'
                                        );
                                        echo $this->Form->radio('type',$options,$attributes);
                                        // echo $this->Form->input('FeaturedDeal.rankDetails',array('type'=>'number','label'=>'Rank','class'=>'categoryRank'));
                                        echo $this->Form->input('FeaturedDeal.rankDetails.3',array('type'=>'number','label'=>'Mobiles Rank','class' => 'categoryRank'));
                                        echo $this->Form->input('FeaturedDeal.rankDetails.5',array('type'=>'number','label'=>'Tablets Rank','class'=>'categoryRank','disabled'=>true));
                                        echo $this->Form->input('startDate',array('type'=>'datetime','timeFormat'=>24));
                                        echo $this->Form->input('endDate',array('type'=>'datetime','timeFormat'=>24));
                                        echo $this->Form->input('thresholdPrice',array('type'=>'number'));
                                        echo $this->Form->input('multi',array('type'=>'checkbox'));
                                ?>
                                </fieldset>
                        <?php echo $this->Form->end(__('Submit')); ?>
                        </div>
                </div>
        </div>
</div>
<script type="text/javascript">
$(function(){
        $(document).on('click','.catselect',function(){
                var that = $(this);
                $('.categoryRank').prop('disabled',true).val('');
                $('#FeaturedDealRankDetails'+$(this).val()).prop('disabled',false);             
        })
})
</script>