<?php
$_page_title = "Add ons";
$_main_root = '../';
require_once $_main_root . 'db/model.php';

$db = new Model();
if (isset($_POST['type'])) {
    if ($_POST['type'] == "list") {
        $list = $db->AddOnsList();
        header('Content-Type: application/json');
        echo json_encode($list);
        exit;
    }
}

include($_main_root . 'content/common/header.php');
if (!Permission(2)) {
    return;
}
?>

<style>
    #dataTable tbody td:nth-child(2){
        text-align: end;
    }
</style>

<!-- modal -->
<div id="modalDiv"></div>

<div class="container container-fluid">
    <div class="my-4 d-flex justify-content-between align-items-center">
        <h2 style="color:var(--s-text-color);">ADD-ONS LIST</h2>
        <div>
            <button class="btn btn-sm btn-outline-info" onclick="DetailAddOns(0)">
                <i class="bi bi-plus-circle me-2"></i> NEW ADD-ONS
            </button>
        </div>
    </div>

    <div class="row my-4">
        <div class="table-responsive-lg">
            <table id="dataTable" class="table table-sm table-dark table-hover table-bordered" style="width: 100%;">

                <thead style="color:var(--s-text-color);" class="mt-3">
                    <th class="">Add Ons Name</th>
                    <th style="width: 80px;">Amount</th>
                    <th style="width: 80px;">Status</th>
                    <th style="width: 50px;">Action</th>
                </thead>
                <tbody>
                </tbody>
            </table>

        </div>
    </div>
</div>

<?php $s_scripts = ['addons']; ?>
<?php include($_main_root . 'content/common/footer.php'); ?>