<?php
include_once "global.php";


$pageTitle = 'Add Daily Expense - ';
include_once 'header.php';
?>

<!--breadcrumb-->
<div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3">
    <div class="breadcrumb-title pe-3">Expense Management</div>
    <div class="ps-3">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb mb-0 p-0">
                <li class="breadcrumb-item"><a href="javascript:;"></a>
                </li>
                <li class="breadcrumb-item active" aria-current="page">Add Daily Ticket</li>
            </ol>
        </nav>
    </div>
</div>
<!--end breadcrumb-->
<div class="card">
    <div class="card-body p-4">
        <h5 class="mb-4">Add Daily Expense</h5>
        <form id="expenseAddForm" class="row g-3" method="post">
            <div class="col-md-6">
                <label for="title" class="form-label">Title <span>*</span></label>
                <input type="text" name="title" id="title" class="form-control" required>
            </div>
            <div class="col-md-6">
                <label for="category" class="form-label">Category <span>*</span></label>
                <select id="category" name="category" class="form-select" required>
                    <option selected="" value="">Select...</option>
                    <?php
                    $expenseCategories = $productClass->getExpenseCategories();
                    foreach ($expenseCategories as $expenseCategory) {
                        $categoryId = $expenseCategory["id"];
                        $name = $expenseCategory["category"];
                        echo "<option value='$categoryId'>$name</option>";
                    }
                    ?>
                </select>
            </div>
            <div class="col-md-6">
                <label for="paidto" class="form-label">Paid To <span>*</span></label>
                <input type="text" name="paidto" id="paidto" class="form-control" required>
            </div>
            <div class="col-md-6">
                <label for="amount" class="form-label">Amount <span>*</span></label>
                <input type="number" name="amount" id="amount" class="form-control" required>
            </div>
            <div class="col-md-6">
                <label for="date" class="form-label">Date <span>*</span></label>
                <input type="date" name="date" id="date" class="form-control" required>
            </div>
            <div class="col-md-12">
                <button type="submit" class="btn btn-grd-primary px-4">Submit</button>
            </div>
        </form>
    </div>
</div>

<?php
include_once 'footer.php';
?>