made auto phpcbf changes; added some documentation

This commit is contained in:
2024-02-10 09:58:54 -06:00
parent e900175c4d
commit b37c414111
91 changed files with 30552 additions and 107 deletions

View File

@@ -1,4 +1,4 @@
<?php $content = function() { ?>
<?php $content = function () { ?>
<h2>Login</h2>
<form action="/login" method="post">
<div class="form-group">
@@ -11,4 +11,4 @@
</div>
<button type="submit" class="btn btn-primary">Login</button>
</form>
<?php }; include __DIR__ . '/../layouts/app.php'; ?>
<?php }; require __DIR__ . '/../layouts/app.php'; ?>

View File

@@ -10,13 +10,13 @@ if (isset($_SESSION['user_id'])) {
$error = $_SESSION['error'] ?? '';
unset($_SESSION['error']); // Clear the error after displaying
$content = function() use ($error) { ?>
$content = function () use ($error) { ?>
<div class="row justify-content-center">
<div class="col-md-6">
<h2 class="mt-5">Register</h2>
<?php if ($error): ?>
<?php if ($error) : ?>
<div class="alert alert-danger" role="alert">
<?= htmlspecialchars($error) ?>
<?php echo htmlspecialchars($error) ?>
</div>
<?php endif; ?>
<form action="/register" method="post">
@@ -39,4 +39,4 @@ $content = function() use ($error) { ?>
</div>
<?php };
include __DIR__ . '/../layouts/app.php';
require __DIR__ . '/../layouts/app.php';

View File

@@ -9,9 +9,10 @@ if (!isset($_SESSION['user_id'])) {
exit;
}
$content = function() { /* use ($bills) if fetching bills from the database */
$content = function () {
/* use ($bills) if fetching bills from the database */
?>
?>
<div class="row justify-content-center">
<div class="col-md-8">
<h2 class="mt-5">Dashboard</h2>
@@ -71,4 +72,4 @@ $content = function() { /* use ($bills) if fetching bills from the database */
</div>
<?php };
include __DIR__ . '/layouts/app.php';
require __DIR__ . '/layouts/app.php';

View File

@@ -1,7 +1,7 @@
<?php
// Assuming session_start() is called in the front controller or app.php
$content = function() { ?>
$content = function () { ?>
<div class="jumbotron">
<h1 class="display-4">Welcome to Bill Reminder!</h1>
<p class="lead">Never miss a payment again with our easy-to-use bill management system.</p>
@@ -27,4 +27,4 @@ $content = function() { ?>
</div>
<?php };
include __DIR__ . '/layouts/app.php';
require __DIR__ . '/layouts/app.php';

View File

@@ -21,13 +21,14 @@
</nav>
<div class="container">
<?php if (isset($error) && !empty($error)): ?>
<?php if (isset($error) && !empty($error)) : ?>
<div class="alert alert-danger" role="alert">
<?php echo $error; ?>
</div>
<?php endif; ?>
<?php if (isset($content) && is_callable($content)) $content(); ?>
<?php if (isset($content) && is_callable($content)) { $content();
} ?>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>