<div class="panel panel-default display-block" id="map-div">
    <div class="panel-headingnew"> <?php echo $this->translate('Map Driver'); ?> </div>
    <div id="faq-1-1" class="panel-collapse collapse in" aria-expanded="true">
        <div class="panel-body">            
            <div class="tab-content" id="my-tab-content">
                <div id="home" class="tab-pane fade active in">
                    <div class="col-sm-col-sm-offset-1 margin-10auto0 paddingRL10px">
                        <?php  
                            $form = $this->form;
                            $form->prepare();
                            $form->setAttribute('action', $this->url('vehicle-details', ['action' => 'save-map-driver']));
                            $form->setAttribute('method', 'post');
                            $form->setAttribute('id', 'add-map-driver-form');

                            echo $this->form()->openTag($form);
                        ?>
                        <div class="row">
                            <div class="col-sm-10">
                                <div class="form-group clearfix margintopbottom20">
                                    <label class="col-sm-3 control-label labelalign col-sm-3-new" id="state-id"><?php echo $this->translate('State'); ?> </label>
                                    <div class="col-sm-3 col-sm-4-new">
                                        <?php echo $this->FormElement($form->get('state_name')); ?>
                                    </div>

                                    <label class="col-sm-3 control-label labelalign col-sm-3-new" id="city-id"><?php echo $this->translate('City'); ?>  </label>
                                    <div class="col-sm-3 col-sm-4-new">
                                        <?php echo $this->FormElement($form->get('city_name')); ?>
                                    </div>
                                </div>

                                <div class="form-group clearfix margintopbottom20">
                                    <label class="col-sm-3 control-label labelalign col-sm-3-new"><?php echo $this->translate('Driver Name'); ?> </label>
                                    <div class="col-sm-3 col-sm-4-new">
                                        <?php echo $this->FormElement($form->get('driver_name')); ?>
                                        <?php echo $this->formElement($form->get('driver_value')); ?>
                                    </div>

                                    <label class="col-sm-3 control-label labelalign col-sm-3-new"><?php echo $this->translate('Vehicle Number'); ?> </label>
                                    <div class="col-sm-3 col-sm-4-new">
                                        <?php echo $this->FormElement($form->get('vehicle_number')); ?>
                                        <?php echo $this->formElement($form->get('vehicle_value')); ?>
                                    </div>
                                </div>

                                <div class="form-group clearfix margintopbottom20">
                                    <label class="col-sm-3 control-label labelalign col-sm-3-new" id=""><?php echo $this->translate('Status'); ?>  </label>
                                    <div class="col-sm-3 col-sm-4-new">
                                        <div class="col-sm-6 no-padding">
                                            <div class="carbooking">
                                                <input type="radio" name="status" id="activeD" checked='checked'>
                                                <label for="activeD"><span class="radio">Active</span></label>
                                            </div>
                                        </div>
                                        <div class="col-sm-6 no-padding">
                                            <div class="carbooking">
                                                <input type="radio" name="status" id="deactiveD">
                                                <label for="deactiveD"><span class="radio">De-Active</span></label>
                                            </div>
                                        </div>
                                    </div>

                                    <label class="col-sm-3 control-label labelalign col-sm-3-new"></label>
                                    <div class="col-sm-3 col-sm-4-new ">
                                        <a href="#" class="btn btn-red defaultbtnsearch btn-warning"><i class="fa fa-sign-in iconsearch" id="search_me" ></i>Map Driver</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php echo $this->form()->closeTag(); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
//Driver Name Called...
$("#driver-name").autocomplete({
    
    source: function (request, response) {
        $.ajax({
            url: '/vehicle-details/driver-list',
            dataType: "json",
            type: "POST",
            data: {
                term: request.term
            },
            success: function (data) {
                response(data);
            }
        });
    },
    min_length: 3,
    delay: 300,

    focus: function (event, ui) {
        $("#driver-aa").val(ui.item.label);
        return false;
    },
    select: function (event, ui) {
        $("#driver-name").val(ui.item.label);
        $("#driver-value").val(ui.item.value);

        return false;
    }
});     

//Vehicle Number Called...
$("#vehicle-number").autocomplete({
    
    source: function (request, response) {
        $.ajax({
            url: '/vehicle-details/vehicle-number-list',
            dataType: "json",
            type: "POST",
            data: {
                term: request.term
            },
            success: function (data) {
                response(data);
            }
        });
    },
    min_length: 3,
    delay: 300,

    focus: function (event, ui) {
        $("#vehicle-aa").val(ui.item.label);
        return false;
    },
    select: function (event, ui) {
        $("#vehicle-number").val(ui.item.label);
        $("#vehicle-value").val(ui.item.value);

        return false;
    }
});     
</script>    
    