

<?php $__env->startSection('title'); ?> Add Vendor <?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>

<!-- Single pro tab review Start-->
<div class="single-pro-review-area">
    <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.add')); ?>" 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>Add 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" value="<?php echo e(old('vendor_name')); ?>" placeholder="Vendor Name*" name="vendor_name"  id="outName" required>
                                                </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; border-color: #CED4D9">+64</div>
                                                        <input type="tel" class="form-control" value="<?php echo e(old('vendor_mobile_num')); ?>" placeholder="Mobile Number*" name="vendor_mobile_num"  id="vendor_mobile_num" required>
                                                    </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="locations[]"  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;">
                                                        
                                                </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" value="<?php echo e(old('vendor_email')); ?>" placeholder="Email" name="vendor_email" id="owMail" required>
                                                </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="password">Password</label>
                                                    <input type="password" class="form-control" placeholder="Password" name="vendor_password" id="password" required>
                                                    <input type="checkbox" id="pass_visible" onclick="changePasswordVisible('password')"><label for="pass_visible" style="font-weight: 500">Show Password</label>
                                                </div>
                                                <div class=" mg-b-pro-edt col-lg-6 col-md-6 col-sm-6 col-xs-12">
                                                    <label for="cpassword">Confirm Password</label>
                                                    <input type="password" class="form-control" placeholder="Confirm Password" name="cpassword" id="cpassword" required>
                                                    <input type="checkbox" id="cpass_visible" onclick="changePasswordVisible('cpassword')"><label for="cpass_visible" style="font-weight: 500">Show Password</label>
                                                </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' value="<?php echo e(old('carton_cost', 0)); ?>" class="cp_iptxt" placeholder="Carton" name="carton_cost" id="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' value="<?php echo e(old('pallet_cost', 0)); ?>" class="cp_iptxt" placeholder="Pallets" name="pallet_cost" id="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" value="<?php echo e(old('stock_move_cost', 0)); ?>" placeholder="Stock Move" name="stock_move_cost" id="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" value="<?php echo e(old('appliance_cost', 0)); ?>" placeholder="Appliances" name="appliance_cost" id="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" value="<?php echo e(old('furniture_cost', 0)); ?>" placeholder="Furniture" name="furniture_cost" id="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" value="<?php echo e(old('hazardous_goods_cost', 0)); ?>" placeholder="Hazardous Goods" name="hazardous_goods_cost" id="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" value="<?php echo e(old('others_cost', 0)); ?>" placeholder="Others" name="others_cost" id="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' value="<?php echo e(old('installation_cost', 0)); ?>" class="cp_iptxt" placeholder="Installation Fare " name="installation_cost" id="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' value="<?php echo e(old('unwrapping_cost', 0)); ?>" class="cp_iptxt" placeholder="Unwrapping Fare " name="unwrapping_cost" id="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' value="<?php echo e(old('fragile_cost', 0)); ?>" class="cp_iptxt" placeholder="Fragile Fare " name="fragile_cost" id="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="listFloor_var" style="margin: 0; padding: 0; box-shadow: none;">
                                                            <div class="duplicate">
                                                                <input id="floor_0" name="floor[]" data-name-format="floor[%d]" type="number" 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_0" name="floorFare[]" data-name-format="floorFare[%d]" type="number" step='any' class="cp_iptxt" placeholder="Floor Fare" >
                                                                    <i class="fas fa-dollar-sign"></i>
                                                                </div>
                                                                <div class="col" style="padding: 5px; width: 30%;">
                                                                    <button id="plus_f_0" name="plus_0" type="button" class="listFloor_add btn btn-info btn-round"><i class="fas fa-plus"></i></button>
                                                                    <button id="minus_f_0" name="minus_0" type="button" class="listFloor_del btn btn-danger btn-round"><i class="fas fa-minus"></i></button>
                                                                </div>
                                                            </div>
                                                        </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' value="<?php echo e(old('fragile_cost', 0)); ?>" class="cp_iptxt" placeholder="Stairs Fair " name="stair_cost" id="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' value="<?php echo e(old('lift_cost', 0)); ?>" class="cp_iptxt" placeholder="Lift Fair " name="lift_cost" id="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="list" class="form-group">
                                                        <div class="list_var" style="margin: 0; padding: 0; box-shadow: none;">
                                                            <div class="duplicate">
                                                                <input id="KiloMeterFrom_0" name="KiloMeterFrom[]" data-name-format="KiloMeterFrom[%d]" type="number" style="width: 15%;" step='any' class="form-control" placeholder="Km From" >
                                                                <input id="KiloMeterTo_0" name="KiloMeterTo[]" data-name-format="KiloMeterTo[%d]" type="number" style="width: 15%; margin-left: 5px;" step='any' class="form-control" placeholder="Km To" >
                                                                <div class="cp_iptxt" style="width: 15%; margin-left: 5px;" >
                                                                    <input id="KiloMeterFare_0" name="KiloMeterFare[]" data-name-format="KiloMeterFare[%d]" type="number" step='any' class="cp_iptxt" placeholder="Km Fare" >
                                                                    <i class="fas fa-dollar-sign"></i>
                                                                </div>
                                                                <div class="cp_iptxt" style="width: 15%; margin-left: 5px;" >
                                                                    <input id="baseFare_0" name="baseFare[]" data-name-format="baseFare[%d]" type="number" step='any' class="cp_iptxt" placeholder="Base Fare" >
                                                                    <i class="fas fa-dollar-sign"></i>
                                                                </div>
                                                                <div class="cp_iptxt" style="width: 15%; margin-left: 5px;" >
                                                                    <input id="cubicFare_0" name="cubicFare[]" data-name-format="cubicFare[%d]" 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> -->
                                                                <div class="col" style="padding: 5px; width: 30%; margin-left: 5px;">
                                                                    <button id="plus_k_0" name="plus_0" type="button" class="list_add btn btn-info btn-round"><i class="fas fa-plus"></i></button>
                                                                    <button id="minus_k_0" name="minus_0" type="button" class="list_del btn btn-danger btn-round"><i class="fas fa-minus"></i></button>
                                                                </div>
                                                            </div>
                                                        </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 " value="<?php echo e(old('hourly_rate', 0)); ?>" placeholder="Hourly Rate" name="hourly_rate" id="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" value="1" name="apply_km_rate" id="switchKm" <?php if(old('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" value="1" name="apply_cubic_rate" id="switchCubic" <?php if(old('apply_cubic_rate')): echo 'checked'; endif; ?>>
                                                        <label for="switchCubic"><span></span></label>
                                                        <div class="swImg"></div>
                                                    </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" >Create
                                            </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>
</div>
<?php $__env->stopSection(); ?>
        
    <?php $__env->startPush('scripts'); ?>
    <!-- Dynamic inputs area -->
    <script type="text/javascript">
        $('#list').addInputArea();
        $('#listFloor').addInputArea();
    </script>

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

            var divAddressInput = document.getElementById('divAddressInput');
            var divAddedLocations = document.getElementById('divAddedLocations');
            var divAddedLocation = document.getElementById('divAddedLocation');
            var divAddedButton = document.getElementById('divAddedButton');
            
            var locations = document.querySelectorAll('[name="locations[]"]');
            var i = locations.length;
            
            var DeleteBtnCode = '<button id="btnDelete_' + i + '" name="btnAdd" type="button" style="margin-left: 1.9rem;" class="btn btn-danger btn-round" onclick="deleteLocation(' + i + ')"><i class="fas fa-times"></i></button>';
            var LocationCode = '<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 + '">' + DeleteBtnCode;
            divAddedLocation.insertAdjacentHTML('afterbegin', LocationCode);

            document.getElementById('autocomplete').value = "";
        }
        function deleteLocation(i) {
            document.getElementById('location_' + i).remove();
            document.getElementById('btnDelete_' + 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/addvendor.blade.php ENDPATH**/ ?>