<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">&times;</button>
    <h4 class="modal-title">Map Driver</h4>
</div>
<div id="displayMsg"></div>
<div class="modal-body ">
 
    <?php
    $form = $this->form;
    $form->prepare();
    $form->setAttribute('action', $this->url('vehicle-details', ['action' => 'mapping-driver']));
    $form->setAttribute('enctype', 'multipart/form-data');
    echo $this->form()->openTag($form);
    echo $this->FormElement($form->get('mapped_id')->setValue($mapped_id));
    //echo'<pre>';print_r($result);die();
    ?>
    
        <div class="form-group clearfix margintopbottom20">

            <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport">Name of Vehicle</label>
            <div class="col-sm-3 col-sm-4-new">
                <?php
                    echo $this->FormElement($form->get('vehicle_name_mapping')->setValue($result['mapped_vehicle_id']));
                    echo $this->formElementErrors($form->get('vehicle_name_mapping'), ['class' => 'error']);              
                ?>
            </div>
        </div>

   


    <div class="form-group clearfix margintopbottom20 ">
        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"> Driver </label>
        <div class="col-sm-3 col-sm-4-new">
            <div class="col-sm-12 driver_map no-padding">
               <?php   echo $this->FormElement($form->get('driver_name')->setValue($result['user_id'])); ?>
            </div>
        </div>



    </div>

    <div class="form-group clearfix margintopbottom20 ">
        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport">Status </label>
        <div class="col-sm-4 col-sm-4-new">
            <?php
            if (isset($result['mapping_id']) && $result['mapping_id'] != "") {
                $selectedmap = "selected";
                $selectedmap1 = "";
            } else {
                $selectedmap1 = "selected";
                $selectedmap = "";
            }
            ?>
            <select class="form-control" name="map_status" id="map_status">
                <option value="" selected="selected">--Select Status--</option>
                <option value="1" <?php echo $selectedmap; ?>>Mapped</option>
                <option value="0" <?php echo $selectedmap1; ?>>Unmapped</option>
            </select>
        </div>
    </div>

</div>
<div class="col-sm-12 " align="right" style="float:none;">

    <a class="reset_btn btn btn-success btn-new-vehile" href="#">
        <i class="fa fa-retweet"></i>
        Reset
    </a>
    <?php echo $this->formElement($form->get('mapping_submit')); ?>

</div>


<?php echo $this->form()->closeTag(); ?>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>