
@extends('layouts.admin.app')

@section('content')

    <main id="main" class="main">
        <div class="container" style="margin-top:5%;">
            <form action="{{url('/admin/order/report')}}" method="post">
                @csrf
                <div class="card">
                    <div class="card-body">
                        <p><b>START DATE :</b><input type="date" class="form-control" name="start-date" required/></p>
                        <p><b>END DATE :</b><input type="date" class="form-control" name="end-date" required/></p>
                        <p><b>SELECT AGENT :</b>
                        <select name="agent" id="agent" class="form-control" required>
                            <option value="" selected>Select The Agent</option>
                            @foreach($agents as $agent)
                                <option value="{{$agent->id}}">{{$agent->name}}</option>
                            @endforeach
                        </select></p>
                        <button class="btn btn-primary" type="submit">Search</button>
                    </div>
                </div>
            </form>
            {{$data}}
            @if($data == "")
                {{$data}}
            @else
                {{$data}}
                    <table class="table">
                        <thead>
                            <tr>
                                <th scope="col">#</th>
                                <th scope="col">First</th>
                                <th scope="col">Last</th>
                                <th scope="col">Handle</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <th scope="row">1</th>
                                <td>Mark</td>
                                <td>Otto</td>
                                <td>@mdo</td>
                            </tr>
                            <tr>
                                <th scope="row">2</th>
                                <td>Jacob</td>
                                <td>Thornton</td>
                                <td>@fat</td>
                            </tr>
                            <tr>
                                <th scope="row">3</th>
                                <td colspan="2">Larry the Bird</td>
                                <td>@twitter</td>
                            </tr>
                        </tbody>
                    </table>
            @endif
        </div>
    </main>

@endsection