@extends('layouts.main')
@section('content')
    <div class="table mt-2 p-3 table-responsive">
        <div class="row mb-3">
            <div class="col-md-3">
                <label for="" class="form-label">Dari Tanggal</label>
                <input type="date" class="form-control" name="dariTanggal" id="tglMulai" value="{{ date('Y-m-d') }}">
            </div>
            <div class="col-md-3">
                <label for="" class="form-label">Sampai Tanggal</label>
                <input type="date" class="form-control" name="sampaiTanggal" id="tglSelesai" value="{{ date('Y-m-d') }}">
            </div>
            <div class="col-md-2">
                <label for="status" class="form-label">Status</label>
                <select class="form-select" aria-label="Default select example" name="status" required id="statuss">
                    {{-- <option value="">Status</option> --}}
                    <option value="pending">pending</option>
                    <option value="paid">paid</option>
                    <option value="on_delivery">on_delivery</option>
                    <option value="delivered">delivered</option>
                    <option value="expired">expired</option>
                    <option value="cancelled">cancelled</option>
                </select>
            </div>
            <div class="col-md-2">
                <label for="btn-cetak" class="form-label">&nbsp;</label><br>
                <a class="btn btn-primary text-black btn-hover-white" id="btn-cetak"
                    onclick="this.href='/admin/ceklaporan/'+document.getElementById('tglMulai').value + '/' + document.getElementById('tglSelesai').value + '/' + document.getElementById('statuss').value">Proses</a>
            </div>
        </div>
        <table class="table table-bordered table-striped" id="table-menu">
            <thead>
                <tr>
                    <th>No</th>
                    <th>Tgl Penjualan</th>
                    <th>Kasir</th>
                    <th>Produk</th>
                    <th>Jumlah</th>
                    <th>Harga</th>
                    <th>Diskon</th>
                    <th>Status</th>

                </tr>
            </thead>
            <tbody>

            </tbody>
            <tfoot>
                {{-- @if ($sumTotal == 0)
                    <tr>
                        <td colspan="8">
                            <center><b>Data tidak Ditemukan !
                                </b></center>
                        </td>
                    </tr>
                @endif --}}
                {{-- @if ($jumlah != null) --}}
                <tr>
                    {{-- <th colspan="9">Total Pendapatan :</th> --}}
                    {{-- <th>{{ $sumTotal }}</td> --}}
                </tr>
                {{-- @endif --}}

            </tfoot>
        </table>
        <a href="" class="btn btn-primary" id="btn-cetak" targe="_blank"
            onclick="this.href='/admin/laporan/cetak/'+ document.getElementById('tglMulai').value + '/' + document.getElementById('tglSelesai').value + '/' + document.getElementById('statuss').value">Cetak
            Laporan</a>
    </div>
@endsection

@push('script')
    <script>
        $(document).ready(function() {
            $('#table-menu').DataTable();
        });
    </script>
@endpush
