* @license MIT */ declare(strict_types=1); use MyPrayerJournal\Auth; use MyPrayerJournal\Domain\{RecurrencePeriod, Request, RequestAction}; use MyPrayerJournal\UI\{Component, Layout}; require '../../start.php'; if ($_SERVER['REQUEST_METHOD'] <> 'GET') not_found(); Auth::requireUser(); $isNew = $_GET['id'] == 'new'; $req = match ($isNew) { true => new Request('new'), false => Request::byId($_GET['id'])->getOrCall(not_found(...)) }; $cancelLink = match (true) { str_ends_with($_SERVER['HTTP_REFERER'] ?? '', 'active') => '/requests/active', str_ends_with($_SERVER['HTTP_REFERER'] ?? '', 'snoozed') => '/requests/snoozed', default => '/journal' }; $action = $_GET['id'] == 'new' ? 'Add' : 'Edit'; Layout::pageHead("$action Prayer Request");?>

Prayer Request

=/request/save hx-target=#top hx-push-url=true> id?>> >


value?> checked>
value?>>
value?>>

Recurrence   After prayer, request reappears…

value?> onclick="mpj.edit.toggleRecurrence(event)"recurrence->period == RecurrencePeriod::Immediate) echo ' checked'; ?>>
recurrence->period <> RecurrencePeriod::Immediate) echo ' checked'; ?>>
recurrence->interval->getOrDefault(0)?> style="width:6rem;"recurrence->period === RecurrencePeriod::Immediate) echo ' disabled'; ?>>
'btn btn-secondary ms-2'])?>