<?php
$cabfare_details = isset($fareDetails['cabfare_detail'])?$fareDetails['cabfare_detail']:'';
$fareId  = $this->fareId;
?>
<div class="panel panel-default" id="fare_add">

    <div class="panel-headingnew"><?php if(isset($VndViewFare)){ echo "View Vendor Fare";} else{echo "Add Fare";}?></div>

    <div id="faq-1-1" class="panel-collapse collapse in" aria-expanded="true">
        <div class="panel-body">

            <div class="tab-content" id="myTabContent">
                <div id="home" class="tab-pane fade active in">
                    <div class="col-sm-col-sm-offset-1 margin-10auto0 paddingRL10px">
                        <div class="row">
                           <div class="col-sm-12 no-padding">
                                <?php
                                $form = $this->form;
                                $form->prepare();
                                $form->setAttribute('action', $this->url('cabfare', ['action' => 'add-fare']));
                                $form->setAttribute('method', 'post');
                                //$form->setAttribute('id', 'cab-add-fare');
                                echo $this->form()->openTag($form);
                                ?>
                                <div class="col-sm-12 no-padding padding-bottom15">
                                    <div class="col-sm-2 ">
                                        <div class="carbooking">
                                            <input type="radio" name="fare_type" id="public-fare" class="public-fare" checked="checked" value="1">
                                            <label for="public-fare"><span class="radio"><?php echo $this->translate('Public Fare'); ?></span></label>
                                            <?php echo $this->formElement($form->get('public_fare_selected')); ?>
                                        </div>

                                    </div>


                                    <div class="col-sm-2 ">
                                        <label class="booking-check"><strong><?php echo $this->translate($this->formLabel($form->get('market_place'))); ?></strong>
                                            <?php echo $this->FormElement($form->get('market_place')); ?>
                                            <span class="checkmark"></span>
                                        </label>


                                    </div>

                                    <div class="col-sm-2 ">
                                        <div class="carbooking">
                                            <input type="radio" name="fare_type" id="client-fare" class="client-fare" value="2">
                                            <label for="client-fare"><span class="radio"><?php echo $this->translate('Client Fare'); ?></span></label>
                                            <?php echo $this->formElement($form->get('client_fare_selected')); ?>
                                        </div>
                                    </div>

                                </div>


                                <div class="form-group clearfix client_fare margintopbottom20 display-none" id="client_fare">
                                    <label class="col-sm-2"><?php echo $this->translate($this->formLabel($form->get('client'))); ?></label>
                                    <div class="col-sm-4">
                                        <?php echo $this->FormElement($form->get('client')); ?>
                                        <?php echo $this->formElementErrors($form->get('client'), ['class' => 'error']); ?>
                                    </div>
                                    <!--<div class="col-sm-4">
                                        <label class="col-sm-12"><a href="#" class="btn btn-adn" data-toggle="modal" data-target="#add-client">Add Client</a></label>
                                    </div>-->

                                </div>

                                <!--<div class="form-group clearfix margintopbottom20">
                                    <label class="col-sm-2"><?php echo $this->translate($this->formLabel($form->get('fare_country'))); ?></label>
                                    <div class="col-sm-4">
                                        <div class="row-fluid form-group">
                                            <?php echo $this->FormElement($form->get('fare_country')->setValue(isset($cabfare_details['id'])?$cabfare_details['id']:'')); ?>
                                            <?php echo $this->formElementErrors($form->get('fare_country'), ['class' => 'error']); ?>
                                        </div>
                                    </div>

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

                             <div class="form-group clearfix margintopbottom20">
                                    <label class="col-sm-2 "><?php echo $this->translate($this->formLabel($form->get('fare_city'))); ?></label>
                                    <div class="col-sm-4 form-group">
                                        <?php echo $this->FormElement($form->get('fare_city')); ?>
                                        <?php echo $this->FormElement($form->get('fare_country')); ?>
                                        <?php echo $this->FormElement($form->get('fare_state')); ?>
                                        <?php echo $this->FormElement($form->get('fare_city_id')); ?>
                                        <?php echo $this->formElementErrors($form->get('fare_city'), ['class' => 'error']); ?>
                                    </div>
                                    <label class="col-sm-2"><?php echo $this->translate($this->formLabel($form->get('booking_type'))); ?></label>
                                    <div class="col-sm-4">
                                        <div class="row-fluid form-group">
                                            <?php echo $this->FormElement($form->get('booking_type')->setValue(isset($cabfare_details['master_package_id'])?$cabfare_details['master_package_id']:'')); ?>
                                            <?php echo $this->formElementErrors($form->get('booking_type'), ['class' => 'error']); ?>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group clearfix margintopbottom20">



                                    <label class="col-sm-2"><?php echo $this->translate($this->formLabel($form->get('booking_mode_type'))); ?></label>
                                    <div class="col-sm-4">
                                        <div class="row-fluid form-group">
                                            <?php echo $this->FormElement($form->get('booking_mode_type')->setValue(isset($cabfare_details['master_package_mode_id'])?$cabfare_details['master_package_mode_id']:'')); ?>
                                            <?php echo $this->formElementErrors($form->get('booking_mode_type'), ['class' => 'error']); ?>
                                        </div>




                                    </div>

                                    <label class="col-sm-2 "><?php echo $this->translate($this->formLabel($form->get('vehicle_type'))); ?></label>
                                    <div class="col-sm-4">

                                        <div class="row-fluid form-group">
                                                <?php echo $this->FormElement($form->get('vehicle_type')->setValue(isset($cabfare_details['vehicle_type_id'])?$cabfare_details['vehicle_type_id']:'')); ?>
                                            <?php echo $this->formElementErrors($form->get('vehicle_type'), ['class' => 'error']); ?>
                                        </div>

                                    </div>

                                    <!--<div class="col-sm-2 display-none" id="car-list" >

                                        <div class="">
                                            <select class=" form-control" >
                                                <option selected>--Select Cab Type--</option>

                                                <option>All</option>
                                                <option>Dzire &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 2018 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;  Del5244h</option>
                                                <option>Audi &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 2018 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;  Del5244h</option>

                                                <option>Verna &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 2018 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;  Del5244h</option>

                                                <option>Toyota &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 2018 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;  Del5244h</option>

                                            </select>

                                        </div>

                                    </div>


                                    <div class="col-sm-1 ">

                                        <label class="col-sm-12"><a href="vechicle-detail.html" class="btn btn-adn" ><?php echo $this->translate('Add Car'); ?></a></label>

                                    </div>-->
                                </div>

                                <div class="form-group clearfix margintopbottom20">
                                    <label class="col-sm-2"><?php echo $this->translate('Type of Dispatch'); ?></label>
                                    <div class="clearfix"></div>
                                    <div class="col-sm-9 no-padding">

                                        <div class="col-sm-3">

                                            <div class="carbooking">
                                                <input type="radio" name="dispatch_type" id="point-to-point-dispatch"  checked="checked" value="1">
                                                <label for="point-to-point-dispatch"><span class="radio"><?php echo $this->translate('Point to Point'); ?></span></label>
                                                <?php echo $this->formElement($form->get('point_dispatch_selected')); ?>
                                            </div>
                                        </div>

                                        <div class="col-sm-3">
                                            <div class="carbooking">
                                                <input type="radio" name="dispatch_type" id="garage-to-garage-dispatch" value="2">
                                                <label for="garage-to-garage-dispatch"><span class="radio"><?php echo $this->translate('Garage to Garage'); ?></span></label>
                                                <?php echo $this->formElement($form->get('garage_dispatch_selected')); ?>
                                            </div>


                                        </div>

                                        <div class="col-sm-6 no-padding display-none" id="garage">

                                            <div class="col-sm-6">

                                                <div class="carbooking">
                                                    <input type="radio" name="dispatch_garage" id="dishpatch-garage-own" value="1">
                                                    <label for="dishpatch-garage-own"><span class="radio"><?php echo $this->translate('Own'); ?></span></label>
                                                    <?php echo $this->formElement($form->get('own_garage_selected')); ?>
                                                </div>

                                            </div>

                                            <div class="col-sm-6">
                                                <div class="carbooking">
                                                    <input type="radio" name="dispatch_garage" id="dishpatch-garage-company" value="2">
                                                    <label for="dishpatch-garage-company"><span class="radio"><?php echo $this->translate('Company Garage'); ?></span></label>
                                                    <?php echo $this->formElement($form->get('comp_garage_selected')); ?>
                                                </div>


                                            </div>

                                        </div>

                                    </div>


                                </div>

                                <div class="form-group clearfix margintopbottom20 display-none" id="own-address">
                                    <div class="col-sm-2 form-group">
                                        <?php echo $this->FormElement($form->get('garage_own_address')); ?>
                                        <?php echo $this->formElementErrors($form->get('garage_own_address'), ['class' => 'error']); ?>
                                    </div>

                                    <div class="col-sm-2">
                                        <div class="row-fluid form-group">
                                            <?php echo $this->FormElement($form->get('garage_own_state')); ?>
                                            <?php echo $this->formElementErrors($form->get('garage_own_state'), ['class' => 'error']); ?>
                                        </div>
                                    </div>

                                    <div class="col-sm-2">
                                        <div class="row-fluid form-group">
                                            <?php echo $this->FormElement($form->get('garage_own_city')); ?>
                                            <?php echo $this->formElementErrors($form->get('garage_own_city'), ['class' => 'error']); ?>
                                        </div>
                                    </div>

                                    <div class="col-sm-2 form-group">
                                        <?php echo $this->FormElement($form->get('garage_own_pincode')); ?>
                                        <?php echo $this->formElementErrors($form->get('garage_own_pincode'), ['class' => 'error']); ?>
                                    </div>

                                    <div class="col-sm-4 pull-right" align="right" >
                                        <div>
                                            <img src="<?php echo $this->basePath() ?>/images/map.jpg" width="100%">
                                        </div>
                                    </div>

                                </div>


                                <div class="form-group clearfix margintopbottom20 display-none " id="company-address">
                                    <div class="col-sm-2 form-group">
                                        <?php echo $this->FormElement($form->get('garage_comp_address')); ?>
                                        <?php echo $this->formElementErrors($form->get('garage_comp_address'), ['class' => 'error']); ?>
                                    </div>

                                    <div class="col-sm-2 form-group">
                                        <div class="row-fluid">
                                            <?php echo $this->FormElement($form->get('garage_comp_state')); ?>
                                            <?php echo $this->formElementErrors($form->get('garage_comp_state'), ['class' => 'error']); ?>
                                        </div>
                                    </div>

                                    <div class="col-sm-2 form-group">
                                        <div class="row-fluid">
                                            <?php echo $this->FormElement($form->get('garage_comp_city')); ?>
                                            <?php echo $this->formElementErrors($form->get('garage_comp_city'), ['class' => 'error']); ?>
                                        </div>
                                    </div>

                                    <div class="col-sm-2 form-group">
                                        <?php echo $this->FormElement($form->get('garage_comp_pincode')); ?>
                                        <?php echo $this->formElementErrors($form->get('garage_comp_pincode'), ['class' => 'error']); ?>
                                    </div>

                                    <div class="col-sm-4 pull-right" align="right" >
                                        <div>
                                            <img src="<?php echo $this->basePath() ?>/images/map.jpg" width="100%">
                                        </div>
                                    </div>
                                </div>

                                <div class="col-sm-12">
                                    <div class="form-group clearfix margintop20 marginbottom20">

                                        <label class="col-sm-1 no-padding"><?php echo $this->translate($this->formLabel($form->get('fare_date_from'))); ?></label>
                                        <div class="col-sm-3 form-group">
                                            <?php echo $this->FormElement($form->get('fare_date_from')->setValue(isset($cabfare_details['date_from'])?date('d-m-Y', strtotime($cabfare_details['date_from'])):'')); ?>
                                            <?php echo $this->formElementErrors($form->get('fare_date_from'), ['class' => 'error']); ?>
                                        </div>

                                        <label class="col-sm-1 "><?php echo $this->translate($this->formLabel($form->get('fare_date_to'))); ?></label>
                                        <div class="col-sm-3 form-group">
                                            <?php echo $this->FormElement($form->get('fare_date_to')->setValue(isset($cabfare_details['date_to'])? date('d-m-Y', strtotime($cabfare_details['date_to'])):'')); ?>
                                            <?php echo $this->formElementErrors($form->get('fare_date_to'), ['class' => 'error']); ?>
                                        </div>

                                        <label class="col-sm-1 "><?php echo $this->translate($this->formLabel($form->get('currency'))); ?></label>
                                        <div class="col-sm-3 ">
                                            <div class="row-fluid form-group">
                                                <?php echo $this->FormElement($form->get('currency')->setValue(isset($cabfare_details['currency_id'])?$cabfare_details['currency_id']:'')); ?>
                                                <?php echo $this->formElementErrors($form->get('currency'), ['class' => 'error']); ?>
                                            </div>

                                        </div>

                                    </div>

                                    <div class="form-group clearfix margintop20 marginbottom20">

                                        <div class="col-sm-10 no-padding">

                                            <div class="col-sm-3 no-padding">

                                                <div class="carbooking">
                                                    <input type="radio" name="commission_type" id="net-rate" checked="checked" value="1"/>
                                                    <label for="net-rate"><span class="radio"><?php echo $this->translate('Net Rate'); ?></span></label>
                                                    <?php echo $this->FormElement($form->get('net_rate_selected')); ?>
                                                </div>

                                            </div>

                                            <div class="col-sm-3">
                                                <div class="carbooking">
                                                    <input type="radio" name="commission_type" id="commission-rate" value="2"/>
                                                    <label for="commission-rate"><span class="radio"><?php echo $this->translate('Commission Rate'); ?></span></label>
                                                    <?php echo $this->FormElement($form->get('commission_rate_selected')); ?>
                                                </div>

                                            </div>

                                            <div class="col-sm-6 no-padding display-none" id="type_of_commission">

                                                <div class="col-sm-3">
                                                    <div class="carbooking">
                                                        <input type="radio" name="comm_type" id="comm_per" checked="checked" value="%"/>
                                                        <label for="comm_per"><span class="radio">%</span></label>
                                                    </div>


                                                </div>

                                                <div class="col-sm-3">
                                                    <div class="carbooking">
                                                        <input type="radio" name="comm_type" id="comm_rs" value="RS"/>
                                                        <label for="comm_rs"><span class="radio"><i class="fa fa-inr"></i></span></label>
                                                    </div>

                                                </div>

                                                <div class="col-sm-6">
                                                    <?php echo $this->FormElement($form->get('commission_value')); ?>
                                                    <?php echo $this->formElementErrors($form->get('commission_value'), ['class' => 'error']); ?>
                                                </div>

                                            </div>

                                        </div>


                                    </div>


                                    <div class="form-group clearfix margintopbottom20">

                                        <label class="col-sm-1 no-padding"><?php echo $this->translate('Weekend'); ?></label>

                                        <?php foreach($week_days['data'] as $week){ ?>
                                                <div class="col-sm-1 radio_class">
                                                <label class="booking-check"><?php echo $week['name']; ?>
                                                    <?php echo $this->FormElement($form->get('weekend[]')->setCheckedValue($week['id'])); ?>

                                                    <span class="checkmark"></span>
                                                </label>
                                                </div>
                                        <?php } ?>
                                        <?php echo $this->formElementErrors($form->get('weekend[]'), ['class' => 'error']); ?>
                                    </div>

                                    <div class="row ">

                       <?php if($fareId==''){ ?>
                            <div class="col-sm-2 pull-right margin-bttom10px" id="basic_fair_manage_cab_save">
                            <?php echo $this->FormElement($form->get('add_fare')); ?>
                            </div>
                       <?php } ?>

                    </div>


                                </div>

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


            </div>


        </div>
    </div>
</div>