<?php $this->load->view('template/header'); ?>

<div class="container">
    <div class="card my-5 text-dark bg-light mb-3">
        <div class="card-header">Data Menu Besok</div>
        <div class="card-body">
            <?= $this->session->flashdata('pesan'); ?>
            <div class="table-responsive">
                <table class="table" id="datatable" data-ordering="false">
                    <thead>
                        <tr>
                            <th>No</th>
                            <th>Nama Produk</th>
                            <th>Foto</th>
                            <th>Tanggal Input</th>
                            <th>Aksi</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $no = 1;
                        foreach ($menu as $row) : ?>
                            <tr>
                                <td><?= $no++ ?></td>
                                <td><?= $row['nama_produk'] ?></td>
                                <td><img src="<?= base_url('assets/images/produk/' . $row['foto']) ?>" class="img-thumbnail" width="60"></td>
                                <td><?= $row['date_created'] ?></td>
                                <td>
                                    <a href="#" data-href="<?= base_url('home/hapus/' . $row['id_menu']); ?>" data-bs-toggle="modal" data-bs-target="#deleteModal" class="btn btn-danger btn-sm" title="Hapus">Hapus</a>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<?php $this->load->view('template/js'); ?>
<?php $this->load->view('template/footer'); ?>