feat: initial foundation for collaborative canteen ordering system in vanilla PHP

This commit is contained in:
2026-08-27 17:29:13 +07:00
commit 5effce30cb
52 changed files with 4915 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
<div style="max-width: 440px; margin: 3rem auto;">
<div class="card" style="box-shadow: var(--shadow-lg);">
<div class="card-header" style="text-align: center; display: block; padding: 2rem 1.5rem 1rem;">
<div style="font-size: 2.5rem; margin-bottom: 0.5rem;">🍱</div>
<h1 style="font-size: 1.5rem; font-weight: 700; color: var(--primary);">Login to CanteenHub</h1>
<p style="font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem;">Order lunch or host food sessions with your team</p>
</div>
<div class="card-body">
<form method="POST" action="/login">
<?= \App\Core\View::csrfField() ?>
<div class="form-group">
<label class="form-label">Username or Email</label>
<input type="text" name="identifier" class="form-control" placeholder="e.g. dea or alex@company.com" required autofocus>
</div>
<div class="form-group">
<label class="form-label">Password</label>
<input type="password" name="password" class="form-control" placeholder="••••••••" required>
</div>
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 0.75rem; font-size: 1rem; margin-top: 0.5rem;">
Sign In &rarr;
</button>
</form>
<div style="text-align: center; margin-top: 1.25rem; font-size: 0.875rem; color: var(--text-muted);">
Don't have an account? <a href="/register" style="color: var(--primary); font-weight: 600;">Register here</a>
</div>
</div>
<!-- Quick Switch Demo Account helper -->
<?php if (!empty($users)): ?>
<div class="card-footer" style="background: #f8fafc;">
<div style="font-size: 0.75rem; text-transform: uppercase; font-weight: 600; color: var(--text-muted); margin-bottom: 0.5rem; text-align: center;">
⚡ 1-Click Quick Demo Login:
</div>
<div style="display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center;">
<?php foreach ($users as $u): ?>
<form method="POST" action="/quick-login" style="display: inline;">
<?= \App\Core\View::csrfField() ?>
<input type="hidden" name="user_id" value="<?= e($u['id']) ?>">
<button type="submit" class="btn btn-secondary btn-sm" style="font-size: 0.75rem; padding: 0.25rem 0.5rem;">
<?= e($u['name']) ?>
</button>
</form>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
+48
View File
@@ -0,0 +1,48 @@
<div style="max-width: 440px; margin: 3rem auto;">
<div class="card" style="box-shadow: var(--shadow-lg);">
<div class="card-header" style="text-align: center; display: block; padding: 2rem 1.5rem 1rem;">
<div style="font-size: 2.5rem; margin-bottom: 0.5rem;">🍱</div>
<h1 style="font-size: 1.5rem; font-weight: 700; color: var(--primary);">Join CanteenHub</h1>
<p style="font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem;">Create your coworker account to order lunch</p>
</div>
<div class="card-body">
<form method="POST" action="/register">
<?= \App\Core\View::csrfField() ?>
<div class="form-group">
<label class="form-label">Full Name <span style="color: var(--danger);">*</span></label>
<input type="text" name="name" class="form-control" placeholder="e.g. Andy Pratama" required autofocus>
</div>
<div class="form-group">
<label class="form-label">Mattermost Username / Handle <span style="color: var(--danger);">*</span></label>
<div style="display: flex; align-items: center; gap: 0.25rem;">
<span style="color: var(--text-muted); font-weight: 600;">@</span>
<input type="text" name="username" class="form-control" placeholder="andy" required>
</div>
</div>
<div class="form-group">
<label class="form-label">Email Address <span style="color: var(--danger);">*</span></label>
<input type="email" name="email" class="form-control" placeholder="andy@company.com" required>
</div>
<div class="form-group">
<label class="form-label">Password <span style="color: var(--danger);">*</span></label>
<input type="password" name="password" class="form-control" placeholder="At least 4 characters" required minlength="4">
</div>
<button type="submit" class="btn btn-primary" style="width: 100%; padding: 0.75rem; font-size: 1rem; margin-top: 0.5rem;">
Create Account &rarr;
</button>
</form>
<div style="text-align: center; margin-top: 1.25rem; font-size: 0.875rem; color: var(--text-muted);">
Already have an account? <a href="/login" style="color: var(--primary); font-weight: 600;">Login here</a>
</div>
</div>
</div>
</div>