<?= $this->extend("layouts/default") ?>

<?= $this->section("title") ?>Category<?= $this->endSection() ?>


<?= $this->section("content") ?>
<style>
    :root {
        --background: --background-body;
    }
</style>

<?= view(
    "layouts/bcr-nav",
    [
        "title" => "Category",
        "controller" => "Categories",
        "links" => [
            "Back" =>  ["url" => url_to("Categories::index"), "auth_check" => true]
        ]
    ]
) ?>

<div class="round-border">

    <?= view("layouts/backtolist", ["urltoindex" => "Categories::index"]) ?>

    <h1>Category</h1>

    <table>
        <tr>
            <td><b>ID</b></td>
            <td><?= $category->CategoryID ?></td>
        </tr>
        <tr>
            <td><b>Category</b></td>
            <td><?= $category->Category ?></td>
        </tr>
        <tr>
            <td><b>Discount 1</b></td>
            <td><?= $category->Discount1 ?></td>
        </tr>
        <tr>
            <td><b>Discount 2</b></td>
            <td><?= $category->Discount2 ?></td>
        </tr>
        <tr>
            <td><b>Discount 3</b></td>
            <td><?= $category->Discount3 ?></td>
        </tr>
        <tr>
            <td><b>Header Colour</b></td>
            <td>
                <div style="background-color: <?= $category->HeaderColour ?>; width: 20px; height: 20px;"></div>
            </td>
        </tr>
        <tr>
            <td><b>Body Colour</b></td>
            <td>
                <div style="background-color: <?= $category->BodyColour ?>; width: 20px; height: 20px;"></div>
            </td>
        </tr>
        <tr>
            <td><b>Footer Colour</b></td>
            <td>
                <div style="background-color: <?= $category->FooterColour ?>; width: 20px; height: 20px;"></div>
            </td>
        </tr>
        <tr>
            <td><b>Last updated</b></td>
            <td><?= $category->lastupdated ?></td>
        </tr>
    </table>
    <?= view("layouts/deletebtnrecipes", ["controller" => "Categories", 'id' => (string)$category->CategoryID, "urltodelete" => "Categories::confirmDelete", "urltoedit" => "Categories::edit"]) ?>
</div>

<?= $this->include("layouts/usedbyrecipes") ?>

<?= $this->endSection() ?>