Files
order/views/account/index.php
T
Ty Clifford 16235369cb - Implemented the full Fat Bottom Grille storefront and staff dashboard.
Highlights include configurable menus, specials, cart/checkout, taxes, 
customer accounts with email 2FA, newsletters, analytics, refunds, 
PDF/CSV exports, Square/Mailgun adapters, and optional MySQL migration.

See README.md for setup and production configuration. Verified 
PHP/JavaScript syntax, responsive layouts, registration, 2FA, checkout, 
dashboard workflows, settings persistence, and PDF generation.
Real Square, Mailgun, and MySQL connections require credentials/server 
access. Square implementation follows the official Payments API and 
Refunds API.
2026-06-10 13:27:42 -04:00

93 lines
4.1 KiB
PHP

<section class="page-hero page-hero-compact">
<div class="container">
<span class="eyebrow">Good to see you</span>
<h1>My Account</h1>
</div>
</section>
<div class="container account-grid section">
<section class="panel">
<div class="panel-heading">
<div>
<span class="eyebrow">Your details</span>
<h2>Pickup Profile</h2>
</div>
<span class="account-email"><?= e($currentUser['email']) ?></span>
</div>
<form class="form-stack" action="/account" method="post">
<?= csrf_field() ?>
<div class="form-grid">
<label>Full name
<input type="text" name="full_name" required value="<?= e($currentUser['full_name']) ?>">
</label>
<label>Phone
<input type="tel" name="phone" required value="<?= e($currentUser['phone']) ?>">
</label>
<label class="field-wide">Street address
<input type="text" name="street_address" value="<?= e($currentUser['street_address']) ?>">
</label>
<label>City
<input type="text" name="city" value="<?= e($currentUser['city']) ?>">
</label>
<label>State
<input type="text" name="state" maxlength="2" value="<?= e($currentUser['state']) ?>">
</label>
<label>ZIP code
<input type="text" name="postal_code" value="<?= e($currentUser['postal_code']) ?>">
</label>
</div>
<label class="check-control">
<input type="checkbox" name="newsletter_opt_in" value="1" <?= checked($currentUser['newsletter_opt_in']) ?>>
<span>
<strong>Send me restaurant news and specials</strong>
<small>You can change this any time.</small>
</span>
</label>
<details class="account-password">
<summary>Change password</summary>
<div class="form-stack">
<label>Current password
<input type="password" name="current_password" autocomplete="current-password">
</label>
<div class="form-grid">
<label>New password
<input type="password" name="new_password" minlength="10" autocomplete="new-password">
</label>
<label>Confirm new password
<input type="password" name="new_password_confirmation" minlength="10" autocomplete="new-password">
</label>
</div>
</div>
</details>
<button class="button" type="submit">Save Account</button>
</form>
</section>
<section class="panel">
<div class="panel-heading">
<div>
<span class="eyebrow">Past pickups</span>
<h2>Order History</h2>
</div>
<a class="button button-small" href="/menu">Order Again</a>
</div>
<?php if (!$orders): ?>
<div class="empty-state compact">
<p>Your first online order will appear here.</p>
</div>
<?php else: ?>
<div class="order-history">
<?php foreach ($orders as $order): ?>
<article>
<div>
<strong><?= e($order['order_number']) ?></strong>
<span><?= e(store_datetime((string) $order['placed_at'])) ?></span>
</div>
<span class="status-pill status-<?= e($order['status']) ?>"><?= e(ucwords(str_replace('_', ' ', (string) $order['status']))) ?></span>
<strong><?= money($order['total_cents']) ?></strong>
</article>
<?php endforeach; ?>
</div>
<?php endif; ?>
</section>
</div>