@extends('admin.main')
@section('content')
    <style>
        .previewImage {
            height: 150px;
            width: 95%;
            overflow: hidden;
            object-fit: contain;
        }

    </style>
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                Order Status
                <!-- <small>Optional description</small> -->
            </h1>
            <ol class="breadcrumb">
                <li><a href="{{ url('admin') }}"><i class="fa fa-dashboard"></i> Dashboard</a></li>
                <li class="active"> Order Status</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <div class="box">
                        <div class="box-header with-border">
                            <h4 class="box-title">Order Status</h4>
                        </div>
                        <div class="box-body">
                            <div class="row">
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label class="control-label">Select Date From: <span
                                                class="required">*</span></label>
                                        <input type="text" name="min" class="form-control datepicker-reports min" id="min_tbl_order_status"
                                            placeholder="Select Date" required autocomplete="off" />
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label class="control-label">Select Date To: <span
                                                class="required">*</span></label>
                                        <input type="text" name="max" class="form-control datepicker-reports max" id="max_tbl_order_status"
                                            placeholder="Select Date" required autocomplete="off" />
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <div class="form-group">
                                        <label class="control-label">Filter By Store</label>
                                        <div id="tbl_order_status_filter"></div>
                                    </div>
                                </div>
                                <div class="col-md-12">

                                    <table class="table table-bordered table-condensed nowrap" id="tbl_order_status">
                                        <thead>
                                            <tr>
                                                <th>Teamstore</th>
                                                <th>Invoice No.</th>
                                                <th>Product Name</th>
                                                <th>Order Status</th>
                                                <th>Date Ordered</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            @if (count($order_status) > 0)
                                                @foreach ($order_status as $item)
                                                    <tr>
                                                        <td>{{ $item->StoreName }}</td>
                                                        <td>{{ $item->InvoiceNumber }}</td>
                                                        <td>{{ $item->ProductName }}</td>
                                                        <td>{{ $item->OrderStatus }}</td>
                                                        <td>{{ date("F j, Y g:i A", strtotime($item->DateCreated)) }}</td>
                                                        <td>{{ date('Y/m/d', strtotime($item->DateCreated)) }}</td>

                                                    </tr>
                                                @endforeach
                                            @else
                                                <tr>
                                                    <td colspan="4" colspan="text-center">No Record Found</td>
                                                </tr>
                                            @endif

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <div class="modal fade" id="modal_store_order_details" role="dialog">
        <div class="modal-dialog modal-lg">

            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">Order Details</h4>
                </div>
                <div class="modal-body">
                    <div id="modal_store_order_details_body_content">
                        <p> Loading content <i class="fa fa-spinner fa-spin"></i> </p>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>
@endsection
