@extends('template.app')



@section('meta')

@endsection



@section('title')

    Vendor Profile

@endsection 



@section('styles')

<link href="{{ asset('assets/css/dropify.min.css') }}" rel="stylesheet">

<link href="{{ asset('assets/css/sweetalert2.bundle.css') }}" rel="stylesheet">

@endsection



@section('content')



<div class="page-breadcrumb">

    <div class="row">

        <div class="col-7 align-self-center">

            <h4 class="page-title text-truncate text-dark font-weight-medium mb-1">Vendor</h4>

            <div class="d-flex align-items-center">

                <nav aria-label="breadcrumb">

                    <ol class="breadcrumb m-0 p-0">

                        <li class="breadcrumb-item"><a href="{{ route('dashboard') }}" class="text-muted">Dashboard</a></li>

                        <li class="breadcrumb-item"><a href="{{ route('vendor.profile')}}" class="text-muted">Profile</a></li>

                        <li class="breadcrumb-item text-muted active" aria-current="page">Quotation</li>

                    </ol>

                </nav>

            </div>

        </div>

    </div>

</div>



<div class="container-fluid">

    <div class="row">

        <div class="col-12">

            <div class="card">

                <div class="card-body">

                    

               



                    <form action="{{ route('vendor.quotationstore')}}" name="form" id="form" method="post" enctype="multipart/form-data">

                        @csrf

                          @method('POST')

                        <div class="row">

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

                               

                                

                                

                                <label for="vendor_code">Quotation Name</label>

                                <input type="text" name="name_of_quotation" class="form-control" placeholder="Enter Name">

                                

                                <label for="vendor_code">Description</label>

                                <input type="text" name="name_of_description" class="form-control" placeholder="Enter Description">


                                <label for="vendor_code">Quotation Attechment</label>

                                <input type="file" name="attechment[]" id="documents"  onchange="previewMultiple(event,'documents_multi','documents')" placeholder="Enter Attechment"  class="form-control dropify" data-default-file="" data-allowed-file-extensions="jpg png jpeg pdf" data-max-file-size-preview="2M" multiple>


                                <label for="quotation_amount">Quotation Amount</label>

                                <input type="number" name="quotation_amount" class="form-control" placeholder="Enter Quotation Amount">

                                
                                <label for="vendor_code">Remark</label>

                                <input type="text" name="remark" class="form-control" placeholder="Enter Remark">

                                

                                

                                <span class="kt-form__help error vendor_code"></span>

                            </div> 

                             

                           

                        </div> 

                        

                        <div class="form-group">

                            

                            <button type="submit" class="btn waves-effect waves-light btn-rounded btn-outline-primary">Submit</button>

                            <a href="{{ route('vendor.quotation') }}" class="btn waves-effect waves-light btn-rounded btn-outline-secondary">Back</a>

                        </div>

                       

                    </form>

                  



                </div>

            </div>

        </div>

    </div>

</div>

@endsection



@section('scripts')

<script src="{{ asset('assets/js/promise.min.js') }}"></script>

<script src="{{ asset('assets/js/sweetalert2.bundle.js') }}"></script>

<script>

    $(document).ready(function() {

        var form = $('#form');

        $('.kt-form__help').html('');

        form.submit(function(e) {

            $('.help-block').html('');

            $('.m-form__help').html('');

            $.ajax({

                url: form.attr('action'),

                type: form.attr('method'),

                data: new FormData($(this)[0]),

                dataType: 'json',

                async: false,

                processData: false,

                contentType: false,

                success: function(json) {

                    return true;

                },

                error: function(json) {

                    if (json.status === 422) {

                        e.preventDefault();

                        var errors_ = json.responseJSON;

                        $('.kt-form__help').html('');

                        $.each(errors_.errors, function(key, value) {

                            $('.' + key).html(value);

                        });

                    }

                }

            });

        });

    });

</script>

@endsection