hasPermission("HACHEPORTAL_EDIT")) { header("Location: ./app.php?msg=no_permission"); die(); } $editing = false; $data = [ "id" => "", "family" => "", "amount" => 1.0, "date" => date("Y-m-d"), "type" => "", "paid" => true ]; if (!empty($_GET['id']) && $database->has('payments', ['paymentid' => $_GET['id']])) { $editing = true; $payment = $database->get("payments", ['paymentid (id)', "familyid (family)", "amount", "amountpaid", "date", "type"], ["paymentid" => $_GET['id']]); $payment["date"] = date("Y-m-d", strtotime($payment["date"])); $data = $payment; } ?>

get("Edit Payment"); } else { $Strings->get("Add Payment"); } ?>
get("Cancel"); ?>

"Total Amount", "icon" => "fas fa-dollar-sign", "name" => "amount", "type" => "number", "maxlength" => 5, "value" => $data["amount"], "width" => 2, "error" => "Enter a dollar amount." ], [ "label" => "Amount Paid", "icon" => "fas fa-dollar-sign", "name" => "amountpaid", "type" => "number", "maxlength" => 5, "value" => $data["amountpaid"], "width" => 2, "error" => "Enter a dollar amount." ], [ "label" => "Date", "icon" => "fas fa-calendar", "name" => "date", "type" => "date", "value" => $data["date"], "width" => 3, "error" => "Choose a date for the payment." ], [ "label" => "Type", "icon" => "fas fa-money-bill", "name" => "type", "type" => "select", "value" => $data["type"], "options" => [ "" => $Strings->get("Choose...", false), "Online" => "Online", "Cash" => "Cash", "Check" => "Check", "Free" => "Free", "Other" => "Other" ], "width" => 3, "error" => "Select a payment type." ] ]; foreach ($textboxes as $item) { ?>
">
" name="" class="form-control" placeholder="" aria-label="" maxlength="" pattern="" value="" required />
" />