<!-- Begin Page Content -->
<div class="container-fluid">
    <div class="row column_title">
        <div class="col-md-12">
            <div class="page_title">
                <h2>Audit Logs</h2>
            </div>
        </div>
    </div>

    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <!-- <h6 class="m-0 font-weight-bold text-primary">DataTables Example</h6> -->
        </div>
        <form method="get" id="booking_report" class="card basicvalidation" action="<?php echo base_url();?>admin/audit">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-4">
                        <div class="form-group row">
                            <label for="booking_from" class="col-sm-5 col-form-label"> From</label>
                            <div class="col-sm-6 form-group">
                                <input type="date" required="true" class="form-control form-control-sm datepicker" value="<?php echo $fromdate ?>" id="fromdate" name="fromdate" placeholder="Date From">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group row">
                            <label for="booking_to" class="col-sm-5 col-form-label"> To</label>
                            <div class="col-sm-6 form-group">
                                <input type="date" required="true" class="form-control " value="<?php echo $todate ?>" id="todate" name="todate" placeholder="Date To">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-2 ml-auto">
                        <button type="submit" class="btn btn-block btn-outline-info btn-sm"> Filter</button>
                    </div>
                </div>
            </div>
    </div>
    </form>
    <div class="card-body">


        <div class="table-responsive">

            <br>
            <table class="table table-bordered" id="songTable1" width="100%" cellspacing="0">
                <thead class="thead-dark">
                    <tr>
                        <th>Admin Name</th>
                        <th>Admin Email</th>
                        <th>Log Action</th>
                        <th>Log Time</th>
                        <th>Log Details</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                        if (!empty($logs)) {
                            $count = 1;
                            foreach ($logs as $id => $log) {
                        ?>
                    <tr>
                        <td> <?php echo $log['adminName']; ?></td>
                        <td> <?php echo $log['adminEmail']; ?></td>
                        <td> <?php echo $log['action']; ?></td>
                        <td> <?php echo date('Y-m-d h:i:s A',$log['time']); ?></td>
                        <td><?php echo $log['details']; ?></td>

                    </tr>
                    <?php }
                        } ?>
                </tbody>
            </table>
        </div>
    </div>
</div>

</div>