@extends('layout.main')
@section('title','TechDms | Create Document')
@section('content')
        <!-- main content start-->
<!-- main content start-->

{{--<!--footer-->--}}
<div id="page-wrapper">

    <div class="main-page">

        <div class="forms">
            <div class="form-grids row widget-shadow" data-example-id="basic-forms"
                 style="position: relative;top:-3.2em;">
                <div class="form-title">
                    <h4>Create New Document</h4>
                </div>
                <div class="form-body">
                    <div class="form-three" style="position: relative;margin-top: -1em;">
                        <div class="widget-shadow">
                            @include('partials.errors')
                            @include('partials.success')
                            <div class="alert alert-danger error_div" style="display: none">
                                <button type="button" class="close" data-dismiss="alert">×</button>
                                <strong>Whoops!</strong>
                                <p class="err_msg"></p>
                            </div>
                            <div class="alert alert-success success_div" style="display: none">
                                <button type="button" class="close" data-dismiss="alert">×</button>
                                <strong>Success!</strong>
                                <p class="suucess_msg"></p>
                            </div>
                        </div>
                        <form class="form-horizontal" name="customer_create" action="/add-documents" method="post"
                              enctype="multipart/form-data">
                            <input type="hidden" name="_token" value="{{csrf_token()}}">
                            <input type="hidden" name="_method" value="post">
                            <div class="form-group">

                                <div class="col-sm-8">
                                    <label for="focusedinput" class="control-label">Document Id:</label>
                                    <span class="err_name" style="color:#c9302c;font-size: 15px;"></span>
                                    <input type="text" class="form-control1" id="document_id" name="document_id"
                                           disabled style="background-color: #EAEAEA;color:#000000"
                                           @if(isset($doc_id))value="{{'DOC-00'.$doc_id}}" @endif
                                           placeholder="Document id">
                                    <input type="hidden" name="doc_id" id="doc_id"
                                           @if(isset($doc_id))value="{{'DOC-00'.$doc_id}}" @endif>
                                </div>


                            </div>
                            <div class="form-group">

                                <div class="col-sm-8">
                                    <label for="focusedinput" class="control-label">Customer Id:</label>
                                    <span class="err_company" style="color:#c9302c;font-size: 15px;"></span>
                                    <select data-placeholder="Choose a Customer Id" class="chosen-select  form-control1"
                                            required
                                            tabindex="2" id="select_customer_id" name="customer_id">
                                        <option value=""></option>
                                        @if(isset($customers))
                                            @forelse($customers as $customer)
                                                <option value="{{$customer->customer_id}}">{{$customer->customer_id}}</option>
                                            @empty
                                            @endforelse
                                        @endif
                                    </select>

                                </div>
                            </div>
                            <div class="form-group">

                                <div class="col-sm-8">
                                    <label for="focusedinput" class="control-label"> Name:</label>
                                    <span class="err_customer_id" style="color:#c9302c;font-size: 15px;"></span>
                                    <input type="text" class="form-control1" id="customer_name" name="customer_name"
                                           disabled style="background-color: #EAEAEA;color:#000000"
                                           placeholder="Customer Name">
                                    <input type="hidden" name="cus_name" id="cus_name">
                                </div>
                            </div>
                            <div class="form-group">

                                <div class="col-sm-8">
                                    <label for="focusedinput" class="control-label">Subject:</label>
                                    <span class="err_address" style="color:#c9302c;font-size: 15px;"></span>
                                    <input type="text" class="form-control1" id="subject" name="subject" required
                                           placeholder="Subject">
                                </div>
                            </div>
                            <div class="form-group">

                                <div class="col-sm-8">
                                    <label for="focusedinput" class="control-label">Reference Date:</label>
                                    <span class="err_mobile" style="color:#c9302c;font-size: 15px;"></span>
                                    <input type="text" class="form-control1 number_fileds" required
                                           id="refer_date" name="refer_date"
                                           placeholder="Reference Date">
                                </div>
                                <div class="col-lg-2">
                                    <span id="errmsg" style="color:#c9302c;font-size: 15px;"></span>
                                </div>
                            </div>
                            <div class="form-group">

                                <div class="col-sm-8">
                                    <label for="focusedinput" class="control-label">Message:</label>
                                    <span class="err_email" style="color:#c9302c;font-size: 15px;"></span>
                                    <textarea class="form-control1 text-area-style" id="message" name="message"
                                              placeholder="Description"></textarea>
                                </div>
                            </div>


                            <div class="form-group">
                                <div class="col-sm-8">
                                    <div class="col-sm-12 nopad">

                                        <div class="btn btn-default btn btn-file center-block">
                                            <i class="fa fa-paperclip"></i> Attach Image
                                            <input type="file" name="attachment_photos[]" id="attachment_photos"
                                                   {{--onchange="this.form.submit()"--}}
                                                   multiple>
                                        </div>
                                        <div class="col-lg-12 nopad" id="preview_photos">

                                        </div>
                                    </div>
                                    <div class="col-lg-12"><br></div>
                                    <div class="col-sm-12 nopad">

                                        <div class="btn btn-default btn btn-file center-block">
                                            <i class="fa fa-paperclip"></i> Attach Doc &nbsp;&nbsp;&nbsp;
                                            <input type="file" name="attachment_doc[]" id="attachment_doc" multiple>
                                        </div>
                                        <div class="col-lg-12 nopad" id="preview_doc">
                                            {{--<div class="col-sm-12 prev_doc">--}}
                                            {{--<p class="pull-left"></p>--}}
                                            {{--<i class="fa fa-window-close pull-right" aria-hidden="true"></i>--}}
                                            {{--</div>--}}

                                        </div>

                                    </div>
                                    <div class="col-lg-12"><br></div>
                                    <div class="col-sm-12 nopad">

                                        <div class="btn btn-default btn btn-file center-block">
                                            <i class="fa fa-paperclip"></i> Attach File &nbsp;&nbsp;&nbsp;
                                            <input type="file" name="attachment_files[]" id="attachment_files" multiple>
                                        </div>
                                        <div class="col-lg-12 nopad" id="preview_files"></div>

                                    </div>
                                    <br>
                                </div>


                            </div>


                            <div class="form-group">
                                <div class="col-lg-8 text-center">
                                    <input type="submit" class="btn btn-info theme-btn document_create" value="Submit">
                                    <a href="/create-customer" class="btn  btn-default theme-btn2">Reset</a>


                                </div>
                            </div>
                        </form>
                    </div>


                </div>
            </div>
            <div class="modal" id="loading" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
                 aria-hidden="true">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">

                        <div class="modal-body text-center">
                            <img src="/images/loading.gif" style="width:20%;" class="center-block">
                            <span class="badge badge-warning">Please Wait</span>
                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<!--footer-->
@endsection