@extends('layout.main')
@section('title', config('app.name') . ' | Customer Views')
@section('content')
        <!-- main content start-->
<!-- main content start-->

<!-- main content start-->
<div id="page-wrapper">
    {{--<div class="pull-right" style="position: relative;top:-3em;">--}}
    {{--<div class="">--}}
    {{--<div class="form-body widget-shadow" data-example-id="simple-form-inline">--}}
    {{--<span style="font-size: 11px;position: relative;left:0em;">You can search either by Customer id, Name,Email,Phone  </span>--}}
    {{--<form class="form-inline" method="get" action="/filter-customer"--}}
    {{--style="position: relative;left:0em;">--}}
    {{--<input type="hidden" name="_token" value="{{csrf_token()}}">--}}
    {{--<input type="hidden" name="_method" value="post">--}}
    {{--<div class="form-group">--}}
    {{--<input type="text" class="form-control input-theme-style"--}}
    {{--id="serach_id" name="search_id" @if(isset($set_name) && $set_name) value="{{$set_name}}"--}}
    {{--@else @endif--}}
    {{--placeholder="Search Here" required>--}}
    {{--</div>--}}
    {{--<div class="form-group">--}}
    {{--<input type="submit" class="btn btn-info theme-btn"--}}
    {{--value="submit">--}}
    {{--</div>--}}
    {{--</form>--}}
    {{--</div>--}}
    {{--</div>--}}
    {{--</div>--}}
    {{--<div class="pull-right" style="position: relative;top:-3em;">--}}
    {{--<div class="">--}}
    {{--<div class="form-body widget-shadow" data-example-id="simple-form-inline">--}}
    {{--<span style="font-size: 15px;position: relative;left:0em;">Filter Category List  </span>--}}
    {{--<form name="order_status" method="get" id="order-status-form" action="/customer-category-filter"--}}
    {{-->--}}
    {{--<input type="hidden" name="_token" value="{{csrf_token()}}">--}}
    {{--<input type="hidden" name="_method" value="post">--}}


    {{--<select class="form-control input-theme-style" id="show_status_order" name="category_name"--}}
    {{--onchange="this.form.submit()">--}}
    {{--<option @if(isset($set_category) && $set_category==0) selected @else @endif value="0">Show All--}}
    {{--Category--}}
    {{--</option>--}}
    {{--<option @if(isset($set_category) && $set_category==1) selected @else @endif value="1">--}}
    {{--Indvidual--}}
    {{--</option>--}}
    {{--<option @if(isset($set_category) && $set_category==2) selected @else @endif value="2">Company--}}
    {{--</option>--}}

    {{--</select>--}}
    {{--</form>--}}
    {{--</div>--}}
    {{--</div>--}}
    {{--</div>--}}
    {{--<div class="pull-right" style="position: relative;top:-3em;">--}}
    {{--<div class="">--}}
    {{--<div class="form-body widget-shadow" data-example-id="simple-form-inline">--}}
    {{--<span style="font-size: 15px;position: relative;left:0em;">Filter Company List  </span>--}}
    {{--<form name="order_status" method="get" id="order-status-form"--}}
    {{--action="/customer-company-filter/"--}}
    {{-->--}}
    {{--<input type="hidden" name="_token" value="{{csrf_token()}}">--}}
    {{--<input type="hidden" name="_method" value="post">--}}

    {{--<select class="form-control input-theme-style " id="show_status_order" name="company"--}}
    {{--onchange="this.form.submit()">--}}
    {{--<option value="">Show all Company</option>--}}
    {{--@foreach($customer_lists as $customer_list)--}}
    {{--<option @if(@isset($set_company) && $set_company==$customer_list->company)--}}
    {{--selected @else @endif value="{{$customer_list->company}}--}}
    {{--">{{$customer_list->company}}</option>--}}

    {{--@endforeach--}}
    {{--<option value="0">Show All Company</option>--}}

    {{--</select>--}}
    {{--</form>--}}
    {{--</div>--}}
    {{--</div>--}}
    {{--</div>--}}
    <div class="main-page">

        <div class="tables">
            <h3 class="title1">Documents Lists</h3>
            {{--<div class="pull-right col-lg-4 widget-shadow" style="position: relative;margin-top:-5em;padding: 10px;">--}}
            {{--<label>Filter Customer Id or Document Id</label>--}}
            {{--<form name="filter_list" action="/select-doc-list-id" method="get">--}}
            {{--<select data-placeholder="Choose a Customer Id Or Document Id" class="chosen-select  form-control1"--}}
            {{--style="width:100% !important;" onchange="this.form.submit()"--}}
            {{--required--}}
            {{--tabindex="2" id="select_customer_id" name="select_doc_id">--}}
            {{--<option value=""></option>--}}
            {{--@if(isset($doc_lists))--}}
            {{--@forelse($doc_lists as $doc_list)--}}
            {{--<option @if(isset($selected_file)&&$selected_file==$doc_list->document_id)selected--}}
            {{--@endif value="{{$doc_list->document_id}}">--}}
            {{--Doc id:--}}
            {{--<p>{{$doc_list->document_id}}</p> |--}}
            {{--Customer id: {{$doc_list->customer_id}}</option>--}}
            {{--@empty--}}
            {{--@endforelse--}}
            {{--@endif--}}
            {{--</select>--}}
            {{--</form>--}}
            {{--</div>--}}
            <div class="pull-right" style="position: relative;margin-top:-6.8em;">
                <div class="">
                    <div class="form-body widget-shadow" data-example-id="simple-form-inline">
                        <span style="font-size: 15px;position: relative;left:-0em;"> Customer id,Doc id and Customer Name </span>
                        <form class="form-inline" name="filter_list" action="/select-doc-list-id" method="get"
                              style="position: relative;left:0em;">
                            <input type="hidden" name="_token" value="{{csrf_token()}}">
                            <input type="hidden" name="_method" value="post">
                            <div class="form-group">
                                <input type="text" class="form-control input-theme-style"
                                       id="serach_id" name="select_doc_id"
                                       @if(isset($selected_file) && $selected_file) value="{{$selected_file}}"
                                       @else @endif
                                       placeholder="Search Here" required>
                            </div>
                            <div class="form-group">
                                <input type="submit" class="btn btn-info theme-btn" style="padding: 10px;"
                                       value="submit">
                            </div>
                        </form>
                    </div>
                </div>
            </div>


            <div class="" style="position: relative;top:2.3em;" data-example-id="bordered-table">
                <div class="widget-shadow">
                    @include('partials.errors')
                    @include('partials.success')
                </div>
                <table class="table table-bordered">
                    <thead style="background: #4F52BA; color: #FFFFFF;font-size: 15px;">
                    <tr>
                        <th>#</th>
                        <th>Doc id</th>

                        <th>Customer Name</th>
                        <th>Customer_id</th>
                        <th>Subject</th>
                        <th>Reference Date</th>
                        {{--<th>Message</th>--}}

                        {{--<th>Created_at</th>--}}

                        <th>Actions</th>
                    </tr>
                    </thead>
                    <tbody style="font-size: 15px;">
                    <?php
                    $i = 1;
                    ?>
                    @if(isset($documents) && $documents !='')
                        @forelse($documents as $document)
                            <tr>
                                <th scope="row">{{$i++}}</th>
                                <td>{{$document->document_id}}</td>

                                <td>{{$document->customer_name}}</td>
                                <td>{{$document->customer_id}}</td>
                                <td>{{$document->subject}}</td>
                                <td>{{\Carbon\Carbon::parse($document->refer_date)->format('d-m-Y')}}</td>
                                {{--<td>{{$document->message}}</td>--}}
                                {{--<td>{{\Carbon\Carbon::parse($document->created_at)->format('d-M-Y , g:i A')}}</td>--}}
                                <td class="bs-example-tooltips">
                                    <a href="/document-gallery/{{$document->id}}/{{$document->customer_id}}/{{1}}"
                                       class="btn btn-primary view_picture_list" data-toggle="tooltip"
                                       data-placement="top" title="View Images" data-original-title="Tooltip on top">
                                        <i class="fa fa-picture-o"></i></a>
                                    <a href="/document-gallery/{{$document->id}}/{{$document->customer_id}}/{{2}}"
                                       class="btn btn-success view_docs" data-toggle="tooltip"
                                       data-placement="top" title="View Doc files" data-original-title="Tooltip on top"><i
                                                class="fa fa-files-o"></i></a>
                                    <a href="/document-gallery/{{$document->id}}/{{$document->customer_id}}/{{3}}"
                                       class="btn btn-info view_file" data-toggle="tooltip"
                                       data-placement="top" title="View Archived file"
                                       data-original-title="Tooltip on top"><i class="fa fa-file"> </i></a>
                                    <a href=""
                                       class="btn btn-danger btn-orange view_edit_docs" data-toggle="tooltip" id="{{$document->id}}"
                                       data-placement="top" title="Edit" data-original-title="Tooltip on top">
                                        <i class="fa fa-edit"></i></a>
                                    <a href="#" class="btn btn-danger document_delete" data-toggle="tooltip"
                                       id="{{$document->id}}"
                                       data-placement="top" title="Delete file"
                                       data-original-title="Tooltip on top"><i
                                                class="fa fa-trash-o"></i></a>
                                </td>

                            </tr>



                        @empty
                            <tr>
                                <td class="text-center" colspan="9"><span
                                            class="badge badge-danger"> No Record Found!</span></td>
                            </tr>
                        @endforelse
                    @endif


                    {{--image view start here--}}


                    {{--image view--}}
                    {{--doc view--}}

                    </tbody>
                </table>
            </div>

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


{{--editable modal--}}
<div class="modal fade edit_documents lg" id="exampleModal" tabindex="-1" role="dialog"
     aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="exampleModalLabel">Created By : <span
                            class="badge badge-primary created_by_edit" style="position: relative;top:-0.1em;"></span>
                </h4>

            </div>
            <form name="update-customer" action="/update-customer" method="post">
                <div class="modal-body">
                    <input type="hidden" name="_token" value="{{csrf_token()}}">
                    <input type="hidden" name="_method" value="post">
                    <input type="hidden" name="customer_table_id" id="customer_table_id">
                    <div class="row">
                        <div class="form-group col-lg-12">
                            <label for="recipient-name" class="control-label">Name</label>
                            <input type="text" class="form-control" id="customer_name" name="customer_name" disabled>
                        </div>

                    </div>
                    <div class="row">
                        <div class="form-group col-lg-6">
                            <label for="recipient-name" class="control-label">Document Id</label>
                            <input type="text" class="form-control"  id="document_id" name="document_id" disabled>
                        </div>
                        <div class="form-group col-lg-6">
                            <label for="recipient-name" class="control-label">Customer Id</label>
                            <input type="text" class="form-control" id="select_customer_id" name="customer_id" disabled>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group col-lg-12">
                            <label for="recipient-name" class="control-label">Subject</label>
                            <input type="text" class="form-control"  id="subject" name="subject">
                        </div>


                    </div>
                    <div class="row">
                        <div class="form-group col-lg-12">
                            <label for="recipient-name" class="control-label">Reference Date</label>
                            <input type="text" class="form-control" id="refer_date" name="refer_date">
                        </div>

                    </div>
                    <div class="row">
                        <div class="form-group col-lg-12">
                            <label for="recipient-name" class="control-label">Message</label>
                            <textarea class="form-control" id="message" name="message"></textarea>
                        </div>

                    </div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default theme-btn2" data-dismiss="modal">Close</button>
                    <input type="submit" class="btn btn-primary theme-btn update-docs" value="save">
                </div>
            </form>
        </div>
    </div>
</div>
<!--footer-->

{{--loading cotent--}}
<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>
@endsection