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

<!-- main content start-->
<div id="page-wrapper">

    <div class="main-page">

        <div class="tables">
            <div class="pull-left">
                <h3 class="title1">Documents Lists</h3>
            </div>
            <div class="pull-right" style="position: relative;margin-top:-3em;">
                <div class="">
                    <div class="form-body widget-shadow" data-example-id="simple-form-inline">
                        <span style="font-size: 11px;position: relative;left:-1em;">You can search either by 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="pull-right" style="position: relative;margin-top:-3em;">
                <div class="widget-shadow">
                    <div class="form-body " style="position: relative;margin-right:-5em;"
                         data-example-id="simple-form-inline">
                        <span style="font-size: 11px;position: relative;left:0em;">You can search the From and To date Filter(dd-mm-yyyy) </span>
                        <form class="form-inline" method="get" name="date-filter" id="date_filter"
                              action="/report/date-filter"
                              style="position: relative;left:0em;">
                            <input type="hidden" name="_token" value="{{csrf_token()}}">
                            <input type="hidden" name="_method" value="post">
                            <div class="form-group" style="width:30%">
                                <input type="text" class="form-control input-theme-style"
                                       id="select_from_date" name="select_from_date"
                                       @if(isset($from_dates)) value="{{\Carbon\Carbon::parse($from_dates)->format('d-m-Y')}}"
                                       @else  @endif
                                       placeholder="From Date" required>
                            </div>
                            <div class="form-group" style="width:30%">
                                <input type="text" class="form-control input-theme-style"
                                       id="select_to_date" name="select_to_date"
                                       @if(isset($to_dates)) value="{{\Carbon\Carbon::parse($to_dates)->format('d-m-Y')}}"
                                       @else  @endif
                                       placeholder="To Date">
                            </div>
                            <div class="form-group" style="width: 30%">
                                <input type="submit" class="btn btn-info theme-btn"
                                       style="padding: 11px;position: relative;top:-0em;"
                                       value="Search">
                            </div>
                        </form>
                    </div>
                </div>
            </div>


            <div class="" style="position: relative;top:2em;" 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 document_delete" data-toggle="tooltip"
                                       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>

<!--footer-->
@endsection




