initial docker setup

This commit is contained in:
matt committed 2026-10-17 04:43:52 -07:00
1 parent 2e3e8d8514
commit 6776bf9726
8 files changed
+119 -5

No files matched your search

+14 -4
View File
@@ -32,11 +32,14 @@ function callApi(string $method, string $path, $body = null)
$rateOptionsSetting = callApi('GET', '/settings/rate_options');
$rateOptions = [];
if ($rateOptionsSetting && isset($rateOptionsSetting['value'])) {
$rateOptions = explode(',', $rateOptionsSetting['value']);
/*
$parsed = json_decode($rateOptionsSetting['value'], true);
if (is_array($parsed)) {
$rateOptions = $parsed;
}
echo "Rate options:".$parsed;
echo "Rate options:".$rateOptionsSetting['value'];
*/
}
// Update form handling to process selected rates
@@ -110,6 +113,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</div>
<?php endif; ?>
<form method="post" action="">
<?php
echo $rateOptions[0];
?>
<label>Name:<br><input type="text" name="name" value="<?=htmlspecialchars($_POST['name'] ?? '')?>" required></label>
<label>Phone:<br><input type="text" name="phone" value="<?=htmlspecialchars($_POST['phone'] ?? '')?>"></label>
<label>Age:<br><input type="number" name="age" value="<?=htmlspecialchars($_POST['age'] ?? '')?>"></label>
@@ -117,10 +124,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<?php if (!empty($rateOptions)) : ?>
<label>Rate Options:<br>
<?php foreach ($rateOptions as $option) :
$key = key($option);
$value = $option[$key];
// echo $option;
$key = $option;
$value = 0;
?>
<input type="checkbox" name="rates[]" value="<?=htmlspecialchars($key . ':' . $value)?>" <?php if (in_array($key . ':' . $value, $selectedRates)) echo 'checked'; ?>> <?=htmlspecialchars($key)?>: <?=htmlspecialchars($value)?>
<input type="checkbox" name="rates[]" value="<?=htmlspecialchars($key . ':' . $value)?>"
<?php if (in_array($key . ':' . $value, $selectedRates)) echo 'checked'; ?>>
<?=htmlspecialchars($key)?>: <?=htmlspecialchars($value)?> <br>
<?php endforeach; ?>
</label>
<?php endif; ?>
View File
Whitespace-only changes.