@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb pb-3">
                      <li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
                      <li class="breadcrumb-item"><a href="{{ route('laporan') }}">Laporan</a></li>
                      <li class="breadcrumb-item active" aria-current="page">Audit Trail</li>
                    </ol>
                  </nav>

                <div class="card-body text-center">
                    <div class="row form-group">
                        <div class="col-md-2">
                        </div>
                        <div class="col-md-10">
                        </div>
                    </div>

                    @if(session()->has('errormessage'))
                  <div class="alert alert-danger">
                      {{ session()->get('errormessage') }}
                  </div>
                @endif

                    <div class="container">
                        <div class="row">
                            <div class="col-md-5 mx-auto">
                                <form action="{{ route('audittrail.laporancetak') }}" method="post">
                                    @csrf
                                    <div class="input-group mb-3">
                                        <div class="input-group-prepend">
                                            <span class="input-group-text" id="basic-addon1">Mula</span>
                                        </div>
                                        <input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="dateaudit" name="dateaudit">
                                        <input type="submit" class="btn btn-primary ml-md-5" id="submit_button" name="submit_button" value="Cetak">
                                    </div>
                                
                            </div>
                        </div>
                    </form>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">

    var tablecustomers = $('#myTable').DataTable({
        "ordering": false
    });

    $(document).ready( function () {
        var today = new Date();

        var dateObject = '';
        $('#dateaudit').datepicker({
            maxViewMode:1,
            format: 'dd-mm-yyyy',
            autoclose:true,
            endDate: "today",
            maxDate: today
        });
        
        // $('#datemula').change(function() {

        //     $('#datehingga').datepicker('option', 'maxDate', new Date($(this).val()));
        //     console.log($(this).val());

        // });

    });
   
</script>
@endsection

