<?php
$discountnetChecked = "";
$discountcommChecked = "";
$discountperChecked = "";
$discountfixChecked = "";
if(!empty($vehicleData['discount_netrate_commissionrate'])){
    if($vehicleData['discount_netrate_commissionrate']!="Commissionable Rate"){
        $displayDiscountClass = "display-none";
        $discountnetChecked = "checked='checked'";
        $discountcommChecked="";
    }else{
        $displayDiscountClass = "";
        $discountnetChecked = "";
        $discountcommChecked="checked='checked'";
    }
    if($vehicleData['discount_commission_rate_type']=="Percentage"){
        $discountperChecked = "checked='checked'";
        $discountfixChecked="";
    }else{
        $discountfixChecked = "checked='checked'";
        $discountperChecked = "";
    }
}
?>

<div class="col-sm-12">
                        
                        <div class="col-sm-2 no-padding">
                               <label><?php echo $this->translate('Discount'); ?></label>
                        </div>

                        <div class="col-sm-2 no-padding">
                            <div class="carbooking">
                                <input type="radio" name="discounttypeofcommission" id="discount-net-rate" <?php echo $discountnetChecked;?> value="Net Rate"/>
                                <label for="discount-net-rate"><span class="radio"><?php echo $this->translate('Net'); ?></span></label>
                            </div>
                        </div>

                        <div class="col-sm-2">
                            <div class="carbooking">
                                <input type="radio" name="discounttypeofcommission" id="discount-commission-rate" value="Commissionable Rate" <?php echo $discountcommChecked;?>/>
                                <label for="discount-commission-rate"><span class="radio"><?php echo $this->translate('Commissionable'); ?></span></label>
                            </div>
                        </div>
                        <div class="col-sm-6 no-padding <?php echo $displayDiscountClass;?>" id="discount_type_of_commission">

                            <div class="col-sm-3">
                                <div class="carbooking">
                                    <input type="radio" name="discountcommissiontype" id="discountcommissionper" value="Percentage" <?php echo $discountperChecked;?>/>
                                    <label for="discountcommissionper"><span class="radio"><?php echo $this->translate('Percent'); ?></span></label>
                                </div>
                            </div>

                            <div class="col-sm-3">
                                <div class="carbooking">
                                    <input type="radio" name="discountcommissiontype" id="discountcommissionrs" value="Fixed" <?php echo $discountfixChecked;?>/>
                                    <label for="discountcommissionrs"><span class="radio"><?php echo $this->translate('Fixed'); ?></span></span></label>
                                </div>

                            </div>

                            <div class="col-sm-6">
                                <?php echo $this->FormElement($form->get('discount_commission_value')); ?>
                            </div>
                            
                            <label class="col-sm-3" for="discount_valid_from">
                        <?php echo $this->translate($this->formLabel($form->get('discount_valid_from'))); ?>
                    </label>
                    <div class="col-sm-3">
                        <?php echo $this->FormElement($form->get('discount_valid_from')); ?>
                        <?php echo $this->formElementErrors($form->get('discount_valid_from'), ['class' => 'error']); ?>
                    </div>

                    <label class="col-sm-3" for="discount_valid_to"> 
                        <?php echo $this->translate($this->formLabel($form->get('discount_valid_to'))); ?>
                    </label>
                    <div class="col-sm-3">                                    
                        <?php echo $this->FormElement($form->get('discount_valid_to')); ?>
                        <?php echo $this->formElementErrors($form->get('discount_valid_to'), ['class' => 'error']); ?>
                    </div>

                        </div>


                    </div>