

<?php $__env->startSection('title'); ?> Edit Vendor <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?> 
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="container-fluid">
    
    <div class="row">
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <div class="review-tab-pro-inner">
                <?php if(session('success')): ?>
                <div class="alert alert-success">
                <?php echo e(session('success')); ?>

                </div> 
                <?php endif; ?>
                <?php if(session('error')): ?>
                <div class="alert alert-warning">
                    <?php echo e(session('error')); ?>

                </div> 
                <?php endif; ?>
                <div id="myTabContent" class="tab-content custom-product-edit">
                    <form action="<?php echo e(route('admin.vendors.edit', $vendor_data->vendor_id)); ?>" method="POST">
                        <?php echo e(csrf_field()); ?>

                        <div class="product-tab-list tab-pane fade active in" id="description">
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                    <h4>Edit Vendor</h4>
                                    <div class="review-content-section">
                                        <div class="form-div">
                                            <div class="mg-b-pro-edt col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                                <label for="outName">Vendor Name</label>
                                                <input type="text" class="form-control" placeholder="Vendor Name*" name="vendor_name"  id="outName" required value="<?php echo e($vendor_data->vendor_name); ?>">
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                                <label for="owMobile">Mobile Number</label>
                                                <div class="input-group" style="display: flex; align-items: center;background-color: #E9ECEF;border-radius: 0.5rem;">
                                                    <div class="input-group-text" style="padding-right: 1rem; padding-left: 1rem; ">+64</div>
                                                    <input type="text" style="display: inline-block" class="form-control" placeholder="Mobile Number*" name="vendor_mobile_num"  id="owMobile" required value="<?php echo e($vendor_data->vendor_mobile_num); ?>">
                                                </div>
                                            </div>
                                        </div>
                                        <div id="divAddressInput" class="form-div" style="display: flex; align-items: end;">
                                            <div class="mg-b-pro-edt col-lg-10 col-md-10 col-sm-12 col-xs-12 " style="text-align: left;">
                                                <label for="autocomplete">Address</label>
                                                <input type="text" name="location_input[]" id="autocomplete" class="form-control" placeholder="Enter Location" >
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-2 col-md-2 col-sm-12 col-xs-12" style="text-align: left;">
                                                <button id="btnAdd" name="btnAdd" type="button" class="btn btn-info btn-round" onclick="addLocation()"><i class="fas fa-plus"></i></button>
                                            </div>
                                        </div>

                                        <div id="divAddedLocations" class="form-div" style="display: flex; align-items: end;">
                                            <div id="divAddedLocation" class="mg-b-pro-edt col-lg-12 col-md-12 col-sm-12 col-xs-12 " style="text-align: left;">
                                                
                                                <?php $__currentLoopData = $vendoraddresses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $indexKey => $vendoraddress): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <div id="LocationSet_<?php echo e($indexKey); ?>" style="display: flex; align-items: center">
                                                    <input id="location_<?php echo e($indexKey); ?>" name="locations[]" class="locations form-control" style="display: inline; width: 83%; background-color:#fff; border-width:0; box-shadow: none;" readOnly 
                                                        value="<?=str_replace('%', ',', $vendoraddress->vendor_address )?>">
                                                    <button id="btnDelete_LocationSet_<?php echo e($indexKey); ?>" name="btnAdd" type="button" style="margin-left: 1.9rem;" class="btn btn-danger btn-round" onclick="deleteInputField('LocationSet', <?php echo e($indexKey); ?>)"><i class="fas fa-times"></i></button>
                                                </div>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </div>
                                        </div>
                                        <div class="form-div">
                                            <div class=" mg-b-pro-edt col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                                <label for="owMail">Email</label>
                                                <input type="Email" class="form-control" placeholder="Email" name="vendor_email" id="owMail" required value="<?php echo e($vendor_data->email); ?>">
                                            </div>
                                        </div>
                                        <div class="form-div text-left">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align: left;">
                                                <label>Product Type</label>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                Carton
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Carton" name="carton_cost" id="carton_cost" value="<?php echo e($vendor_data->carton_cost); ?>">
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                Pallets
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Pallets" name="pallet_cost" id="pallet_cost" value="<?php echo e($vendor_data->pallet_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                Stock Move
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Stock Move" name="stock_move_cost" id="stock_move_cost" value="<?php echo e($vendor_data->stock_move_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                Appliances
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Appliances" name="appliance_cost" id="appliance_cost" value="<?php echo e($vendor_data->appliance_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                Furniture
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Furniture" name="furniture_cost" id="furniture_cost"  value="<?php echo e($vendor_data->furniture_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div> 
                                            <div class="mg-b-pro-edt col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                Hazardous Goods
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Hazardous Goods" name="hazardous_goods_cost" id="hazardous_goods_cost"  value="<?php echo e($vendor_data->hazardous_goods_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-3 col-md-4 col-sm-6 col-xs-12">
                                                Others
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Others" name="others_cost" id="others_cost"  value="<?php echo e($vendor_data->others_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-div text-left">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align: left;">
                                                <label>Installation</label>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Installation Fare" name="installation_cost" id="installationFar" value="<?php echo e($vendor_data->installation_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-div text-left">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align: left;">
                                                <label>Unwrapping</label>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Unwrapping Fare" name="unwrapping_cost" id="unwrapping_cost" value="<?php echo e($vendor_data->unwrapping_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>   
                                        </div>

                                            <div class="form-div text-left">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align: left;">
                                                <label>
                                                Fragile</label>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Fragile Fare" name="fragile_cost" id="fragile_cost" value="<?php echo e($vendor_data->fragile_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>   
                                        </div>
                                        
                                        <div class="form-div text-left">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align: left;">
                                                <label>Floor</label>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                                <div id="listFloor" class="form-group">
                                                    <div class="duplicate">
                                                        <input id="floor_input" name="floor_input" style="width: 30%;" step='any' class="form-control" placeholder="Floor">
                                                        <div class="col" style="padding: 5px;"></div>
                                                        <div class="cp_iptxt" style="width: 30%;" >
                                                            <input id="floorFare_input" name="floorFare_input" type="number" class="cp_iptxt" placeholder="Floor Fare">
                                                            <i class="fas fa-dollar-sign"></i>
                                                        </div>
                                                        <div class="col" style="padding: 5px;"></div>
                                                        <button id="btnAddFloor" name="btnAddFloor" type="button" class="btn btn-info btn-round" onclick="addFloor()"><i class="fas fa-plus"></i></button>
                                                    </div>
                                                    <div id="FloorList"  >
                                                        <div id="added_floor" ></div>
                                                        <?php $__currentLoopData = $vendorFloorFares; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $indexKey => $vendorFloorFare): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <div id="floorSet_<?php echo e($indexKey); ?>" style="display: flex; align-items: center">
                                                            <input id="floor_<?php echo e($indexKey); ?>" name="floor[]" type="number" style="width: 30%;" class="form-control" placeholder="Floor" value="<?php echo e($vendorFloorFare->floor_num); ?>">
                                                            <div class="col" style="padding: 5px;"></div>
                                                            <div class="cp_iptxt" style="width: 30%;" >
                                                                <input id="floorFare_<?php echo e($indexKey); ?>" name="floorFare[]" type="number" class="cp_iptxt" placeholder="Floor Fare" value="<?php echo e($vendorFloorFare->floor_fare); ?>">
                                                                <i class="fas fa-dollar-sign"></i>
                                                            </div>
                                                            <div class="col" style="padding: 5px;"></div>
                                                            <button id="btnDelete_floorSet_<?php echo e($indexKey); ?>"  name="btnRemove" type="button" class="listFloor_del btn btn-danger btn-round" onclick="deleteInputField('floorSet', <?php echo e($indexKey); ?>)"><i class="fas fa-times"></i></button>
                                                        </div>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-div text-left">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align: left;">
                                                <label>Stairs Or Lift</label>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Stairs Fair " name="stair_cost" id="stair_cost" value="<?php echo e($vendor_data->stair_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>   
                                            <div class="mg-b-pro-edt col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt" placeholder="Lift Fair " name="lift_cost" id="lift_cost" value="<?php echo e($vendor_data->lift_cost); ?>" >
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div> 
                                        </div>
                                        <div class="form-div text-left">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align: left;">
                                                <label>(Km) KiloMeter Fare</label>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                                <div id="listKilometer" class="form-group">
                                                    <div class="duplicate">
                                                        <input id="KiloMeterFrom_input" name="KiloMeterFrom_input" style="width: 30%;" step='any' class="form-control" placeholder="From">
                                                        <div class="col" style="padding: 5px;"></div>
                                                        <input id="KiloMeterTo_input" name="KiloMeterTo_input" style="width: 30%;" step='any' class="form-control" placeholder="To">
                                                        <div class="col" style="padding: 5px;"></div>
                                                        <div class="cp_iptxt" style="width: 30%;" >
                                                            <input id="KiloMeterFare_input" name="KiloMeterFare_input" type="number" step="any" class="cp_iptxt" placeholder="Km Fare">
                                                            <i class="fas fa-dollar-sign"></i>
                                                        </div>
                                                        <div class="col" style="padding: 5px;"></div>
                                                        <div class="cp_iptxt" style="width: 30%;" >
                                                            <input id="BaseFare_input" name="BaseFare_input" type="number" step="any" class="cp_iptxt" placeholder="Base Fare">
                                                            <i class="fas fa-dollar-sign"></i>
                                                        </div>
                                                        <div class="col" style="padding: 5px;"></div>
                                                        <div class="cp_iptxt" style="width: 30%;" >
                                                            <input id="CubicFare_input" name="CubicFare_input" type="number" step="any" class="cp_iptxt" placeholder="Cubic Fare">
                                                            <i class="fas fa-dollar-sign"></i>
                                                        </div>
                                                        <div class="col" style="padding: 5px;"></div>
                                                        <button id="btnAddKilometer" name="btnAddKilometer" type="button" class="btn btn-info btn-round" onclick="addKilometer()"><i class="fas fa-plus"></i></button>
                                                    </div>
                                                    <div id="KiloMeterList"  >
                                                        <div id="added_Kilometer" ></div>
                                                        <?php $__currentLoopData = $vendorKilometerFares; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $indexKey => $vendorKilometerFare): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <div id="KiloMeterSet_<?php echo e($indexKey); ?>" style="display: flex; align-items: center">
                                                            <input id="KiloMeterFrom_<?php echo e($indexKey); ?>" name="KiloMeterFrom[]" type="number" step="any" style="width: 30%;" class="form-control" placeholder="Floor" value="<?php echo e($vendorKilometerFare->min_distance); ?>">
                                                            <div class="col" style="padding: 5px;"></div>
                                                            <input id="KiloMeterTo_<?php echo e($indexKey); ?>" name="KiloMeterTo[]" type="number" step="any" style="width: 30%;" class="form-control" placeholder="Floor" value="<?php echo e($vendorKilometerFare->max_distance); ?>">
                                                            <div class="col" style="padding: 5px;"></div>
                                                            <div class="cp_iptxt" style="width: 30%;" >
                                                                <input id="KiloMeterFare_<?php echo e($indexKey); ?>" name="KiloMeterFare[]" type="number" step="any" class="cp_iptxt" placeholder="Floor Fare" value="<?php echo e($vendorKilometerFare->km_fare); ?>">
                                                                <i class="fas fa-dollar-sign"></i>
                                                            </div>
                                                            <div class="col" style="padding: 5px;"></div>
                                                            <div class="cp_iptxt" style="width: 30%;" >
                                                                <input id="baseFare_<?php echo e($indexKey); ?>" name="baseFare[]" type="number" step="any" class="cp_iptxt" placeholder="Floor Fare" value="<?php echo e($vendorKilometerFare->base_fare); ?>">
                                                                <i class="fas fa-dollar-sign"></i>
                                                            </div>
                                                            <div class="col" style="padding: 5px;"></div>
                                                            <div class="cp_iptxt" style="width: 30%;" >
                                                                <input id="cubicFare_<?php echo e($indexKey); ?>" name="cubicFare[]" type="number" step="any" class="cp_iptxt" placeholder="Floor Fare" value="<?php echo e($vendorKilometerFare->cubic_fare); ?>">
                                                                <i class="fas fa-dollar-sign"></i>
                                                            </div>
                                                            <div class="col" style="padding: 5px;"></div>
                                                            <button id="btnDelete_KiloMeterSet_<?php echo e($indexKey); ?>" name="btnRemove" type="button" class="listFloor_del btn btn-danger btn-round" onclick="deleteInputField('KiloMeterSet', <?php echo e($indexKey); ?>)"><i class="fas fa-times"></i></button>
                                                        </div>


                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </div>
                                                </div>
                                            </div>
                                        

                                    </div>
                                    <div class="form-div text-left">
                                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align: left;">
                                                <label>Hourly Rate</label>
                                            </div>
                                            <div class=" mg-b-pro-edt col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                                <div class="cp_iptxt">
                                                    <input type="number" step='any' class="cp_iptxt " placeholder="Hourly Rate" name="hourly_rate" id="hourly_rate"  value="<?php echo e($vendor_data->hourly_rate); ?>">
                                                    <i class="fas fa-dollar-sign"></i>
                                                </div>
                                            </div>  
                                        </div>
                                        
                                        <div class="form-div text-left">
                                            <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" style="text-align: left;">
                                                <label>Apply Km Rate</label>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-2 col-md-2 col-sm-6 col-xs-12">
                                                <div class="switchArea">
                                                    <input type="checkbox" name="apply_km_rate" value="1" id="switchKm" <?php if( $vendor_data->apply_km_rate ): echo 'checked'; endif; ?>>
                                                    <label for="switchKm"><span></span></label>
                                                    <div class="swImg"></div>
                                                </div>
                                            </div>  
                                        </div>
                                        <div class="form-div text-left">
                                            <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" style="text-align: left;">
                                                <label>Apply Cubic Rate</label>
                                            </div>
                                            <div class="mg-b-pro-edt col-lg-2 col-md-2 col-sm-6 col-xs-12">
                                                <div class="switchArea">
                                                    <input type="checkbox" name="apply_cubic_rate" value="1" id="switchCubic" <?php if( $vendor_data->apply_cubic_rate ): echo 'checked'; endif; ?>>
                                                    <label for="switchCubic"><span></span></label>
                                                    <div class="swImg"></div>
                                                </div>
                                            </div>
                                        </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                    <div class="text-center custom-pro-edt-ds">
                                        <button type="submit" id="create_vendor" class="btn btnSubmit btn-ctl-bt waves-effect waves-light m-r-10 " name="event" value="add_vendor" >Save</button>
                                        <button type="button" class="btn btn-ctl-bt waves-effect waves-light" onclick="window.location = `<?php echo e(route('admin.vendor_list')); ?>`">Back</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <input type="hidden"   name="countDropRule1" id="countDropRule1" value="1">
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
    <!-- Add/Delete Locations -->
    <script>
        function addLocation() {
            var inputAddress = document.getElementById('autocomplete').value;
            if (inputAddress == "") {
                return;
            }

            var divAddedLocation = document.getElementById('divAddedLocation');
            var i = document.querySelectorAll('[name="locations[]"]').length + 1;
            
            // var DeleteBtnCode = ;
            var LocationCode = 
                '<div id= LocationSet_' + i + '" style="display: flex; align-items: center">'
                + '<input id="location_' + i + '" name="locations[]" '
                + 'class="locations form-control" style="display: inline; width: 83%; background-color:#fff; border-width:0; box-shadow: none;" readOnly ' 
                + 'value="'+ inputAddress + '">' 
                + '<button id="btnDelete_LocationSet_' + i + '" name="btnRemove" type="button" style="margin-left: 1.9rem;" ' 
                + 'class="btn btn-danger btn-round" onclick="deleteInputField(\'LocationSet\',' + i + ')"><i class="fas fa-times"></i></button></div>';
            divAddedLocation.insertAdjacentHTML('afterbegin', LocationCode);

            document.getElementById('autocomplete').value = "";
        }
        function addFloor() {
            var inputFloor = document.getElementById('floor_input').value;
            var inputFareFloor = document.getElementById('floorFare_input').value;
            if (inputFloor == "" || inputFareFloor == "") {
                return;
            }

            var divFloorList = document.getElementById('added_floor');
            var i = document.querySelectorAll('[name="floor[]"]').length + 1;
            
            var FloorCode = 
                '<div id= "floorSet_' + i + '" style="display: flex; align-items: center">'
                + '<input id="floor_' + i + '" name="floor[]" type="number" style="width: 30%;" class="form-control" placeholder="Floor" value="' + inputFloor + '">'
                + '<div class="col" style="padding: 5px;"></div>'
                + '<div class="cp_iptxt" style="width: 30%;" >'
                + '<input id="floorFare_' + i + '" name="floorFare[]" type="number" class="cp_iptxt" placeholder="Floor Fare" value="' + inputFareFloor + '">'
                + '<i class="fas fa-dollar-sign"></i></div>'
                + '<div class="col" style="padding: 5px;"></div>'
                + '<button id="btnDelete_floorSet_' + i + '" name="btnRemove" type="button" class="listFloor_del btn btn-danger btn-round" onclick="deleteInputField(\'floorSet\',' + i + ')"><i class="fas fa-times"></i></button></div>'
            divFloorList.insertAdjacentHTML('afterbegin', FloorCode);

            document.getElementById('floor_input').value = "";
            document.getElementById('floorFare_input').value = "";
        }
        function addKilometer() {
            var KiloMeterFrom_input = document.getElementById('KiloMeterFrom_input').value;
            var KiloMeterTo_input = document.getElementById('KiloMeterTo_input').value;
            var KiloMeterFare_input = document.getElementById('KiloMeterFare_input').value;
            var BaseFare_input = document.getElementById('BaseFare_input').value;
            var CubicFare_input = document.getElementById('CubicFare_input').value;
            if (KiloMeterFrom_input == "" || KiloMeterTo_input == "" || KiloMeterFare_input == ""  || 
                BaseFare_input == "" || CubicFare_input == "" ) {
                return;
            }

            var added_Kilometer = document.getElementById('added_Kilometer');
            var i = document.querySelectorAll('[name="KiloMeterFrom[]"]').length + 1;
            
            var KilometerCode = 
                '<div id= "KiloMeterSet_' + i + '" style="display: flex; align-items: center">'
                + '<input id="KiloMeterFrom_' + i + '" name="KiloMeterFrom[]" type="number" style="width: 30%;" class="form-control" placeholder="Floor" value="' + KiloMeterFrom_input + '">'
                + '<div class="col" style="padding: 5px;"></div>'
                + '<input id="KiloMeterTo_' + i + '" name="KiloMeterTo[]" type="number" style="width: 30%;" class="form-control" placeholder="Floor" value="' + KiloMeterTo_input + '">'
                
                + '<div class="col" style="padding: 5px;"></div>'
                + '<div class="cp_iptxt" style="width: 30%;" >'
                + '<input id="KiloMeterFare_' + i + '" name="KiloMeterFare[]" type="number" class="cp_iptxt" placeholder="Floor Fare" value="' + KiloMeterFare_input + '">'
                + '<i class="fas fa-dollar-sign"></i></div>'
 
                + '<div class="col" style="padding: 5px;"></div>'
                + '<div class="cp_iptxt" style="width: 30%;" >'
                + '<input id="baseFare_' + i + '" name="baseFare[]" type="number" class="cp_iptxt" placeholder="Floor Fare" value="' + BaseFare_input + '">'
                + '<i class="fas fa-dollar-sign"></i></div>'
 
                + '<div class="col" style="padding: 5px;"></div>'
                + '<div class="cp_iptxt" style="width: 30%;" >'
                + '<input id="cubicFare_' + i + '" name="cubicFare[]" type="number" class="cp_iptxt" placeholder="Floor Fare" value="' + CubicFare_input + '">'
                + '<i class="fas fa-dollar-sign"></i></div>'

                + '<button id="btnDelete_floorSet_' + i + '" name="btnRemove" type="button" class="listFloor_del btn btn-danger btn-round" onclick="deleteInputField(\'KiloMeterSet\',' + i + ')"><i class="fas fa-times"></i></button></div>'
            added_Kilometer.insertAdjacentHTML('afterbegin', KilometerCode);

            document.getElementById('KiloMeterFrom_input').value = "";
            document.getElementById('KiloMeterTo_input').value = "";
            document.getElementById('KiloMeterFare_input').value = "";
            document.getElementById('BaseFare_input').value = "";
            document.getElementById('CubicFare_input').value = "";
        }
        function deleteInputField(target, i) {
            document.getElementById( target + '_' + i).remove();
        }
    </script>

    <!--Google Places API-->
    <script type="text/javascript"
    src="https://maps.google.com/maps/api/js?key=<?php echo e(env('GOOGLE_MAP_KEY')); ?>&libraries=places" ></script>
    <script>
        $(document).ready(function () {
            $("#latitudeArea").addClass("d-none");
            $("#longtitudeArea").addClass("d-none");
        });
    </script>
    <script>
        google.maps.event.addDomListener(window, 'load', initialize);
    
        function initialize() {
            
            var input = document.getElementById('autocomplete');
                var options = {
                
                componentRestrictions: {country: "nz"}
                    };
            var autocomplete = new google.maps.places.Autocomplete(input, options);
    
            autocomplete.addListener('place_changed', function () {
                var place = autocomplete.getPlace();
                $('#latitude').val(place.geometry['location'].lat());
                $('#longitude').val(place.geometry['location'].lng());
    
                $("#latitudeArea").removeClass("d-none");
                $("#longtitudeArea").removeClass("d-none");
            });
        }
    </script>

    <script>
        function changePasswordVisible(targetId) {
            var target = document.getElementById(targetId);
            if (target.type === "password") {
                target.type = "text";
            } else {
                target.type = "password";
            }
        }
    </script>

<?php $__env->stopPush(); ?>

<?php echo $__env->make('admin.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/w84938540/public_html/resources/views/admin/vendor_edit.blade.php ENDPATH**/ ?>