<?php $form = $this->hourform;
$form->prepare();
$form->setAttribute('action', $this->url('cabfare', ['action' => 'add-price-hour']));
$form->setAttribute('method', 'post');
echo $this->form()->openTag($form);

$bookingMode    = $this->bookingMode;
$masterlocalpkg = $this->masterLocalPkg;

$local_package_fare = isset($fareDetails['local_package_fare'])?$fareDetails['local_package_fare']:'';
if(!empty($local_package_fare)){
    $package_fare_data = array_column($local_package_fare, 'local_pkg_fare','local_pkg_id');
}else{
    $package_fare_data="";
}

$hour_fare = isset($fareDetails['booking_mode_fare_data'])?$fareDetails['booking_mode_fare_data']:0;
echo $this->formElement($form->get('hour_fare_id')->setValue($hour_fare['id']));

?>
<div id="displayMsg"></div>
<div class="row">
    <div class="col-sm-12 col-md-12 margin20auto0 padding10px">
        <div class="portlet-body">
            <div class="col-sm-12">
                <h4 class="hourlyRates_hour">Hourly Rates</h4>


                <div class="form-group clearfix">

                    <div class="col-sm-2">
                        <label class="ratePerHour_hour"><?php echo $this->translate($form->get('rate_per_hour')->getLabel()); ?></label>
                        <div class="input-group"> <span class="input-group-addon ratePerHourRupees_hour">Rs</span>
                            <?php echo $this->formElement($form->get('rate_per_hour')->setValue($hour_fare['per_hr_charge'])); ?>
                        </div>
                    </div>

                    <div class="col-sm-3">
                        <label><?php echo $this->translate($form->get('ignore_first_hours')->getLabel()); ?></label>
                        <div class="input-group"> <span class="input-group-addon">Hrs</span>
                            <?php echo $this->formElement($form->get('ignore_first_hours')->setValue($hour_fare['minimum_hrs'])); ?>
                        </div>
                    </div>


                    <div class="col-sm-2" >
                        <label><?php echo $this->translate($form->get('minimum_fare')->getLabel()); ?></label>
                        <div class="input-group"> <span class="input-group-addon">Rs</span>
                            <?php echo $this->formElement($form->get('minimum_fare')->setValue($hour_fare['minimum_charge'])); ?>
                        </div>
                    </div>

                </div>


            </div>
        </div>

        <?php
        if (!empty($masterlocalpkg) && $bookingMode == 2) { ?>

        <div class="col-sm-12">
            <div class="col-sm-2">
                <label><?php echo $this->translate($form->get('hour_package_name[]')->getLabel()); ?></label>
            </div>
            <div class="col-sm-2">
                <label><?php echo $this->translate($form->get('hour_ignore_hours[]')->getLabel()); ?></label>
            </div>
            <div class="col-sm-2">
                <label><?php echo $this->translate($form->get('hour_amount[]')->getLabel()); ?></label>
            </div>
            <div class="col-sm-2 margin-left15"></div>
            <div class="col-sm-3">&nbsp;</div>
        </div>
        <?php }?>
        <!-- add more functionality
        <div id="Hourly_Div_package">
            <div class="col-sm-12 margin-bttom10px">
                <div class="col-sm-2"><?php //echo $this->formElement($form->get('hour_package_name[]')); ?></div>
                <div class="col-sm-2"><?php //echo $this->formElement($form->get('hour_ignore_hours[]')); ?></div>
                <div class="col-sm-2"><?php //echo $this->formElement($form->get('hour_amount[]')); ?></div>

                <div class="col-sm-2"><div class="col-sm-4 addPKG_loc_hourly no-padding" id="addPKgHourly_3"><a href="#" class="btn btn-info form-control">Add</a></div></div>
                <div class="col-sm-2"></div></div>

        </div>
        <div id="appended_Hourly_package"></div>-->

         <?php
        if (!empty($masterlocalpkg) && $bookingMode == 2) {
            foreach ($masterlocalpkg as $val) {
                $localId = $val['id'];
                $fare_value = isset($package_fare_data[$localId])?$package_fare_data[$localId]:'';
                ?>
                <div class="col-sm-12 no-padding margin-bttom10px">
                    <div class="col-sm-2"><?php echo $val['name']; ?></div>
                    <div class="col-sm-2"><?php echo $val['km']; ?></div>
                    <div class="col-sm-2"><?php echo $this->formElement($form->get('hour_amount[]')->setValue($fare_value)); ?></div>
                    <input type="hidden" name="localpkgid[]" value="<?php echo $localId; ?>"/>
                </div>
            <?php }
        } ?>

        <div class="col-sm-12">
            <div class="col-sm-8"></div>
            <div class="col-sm-2 pull-right margin-right20">
                <a href="#Distance_Hour" id="HourVehiclen" data-toggle="tab">
                   <?php echo $this->formElement($form->get('next')); ?>
                </a>
            </div>
            <div class="col-sm-2  pull-right" id="fair_manage_cab_save">
                <a href="#" data-toggle="tab">
                    <?php if(!isset($VndViewFare)){echo $this->formElement($form->get('save'));}?>

                </a>
            </div>

        </div>

    </div>
</div>
  <?php echo $this->form()->closeTag(); ?>