<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } $editDecName = $editStore ? Encryption::render($editStore['store_name'] ?? '') : ''; $editDecCampaign = $editStore ? Encryption::render($editStore['campaign_name'] ?? '') : ''; $editDecTagline = $editStore ? Encryption::render($editStore['tagline'] ?? '') : ''; $editDecDomain = $editStore ? Encryption::render($editStore['domain'] ?? '') : ''; ?> <div class="str-form"> <form method="POST"><?= CSRF::field() ?> <input type="hidden" name="store_action" value="save"> <input type="hidden" name="sid" value="<?= $editStore['id'] ?? '' ?>"> <div style="display:grid;grid-template-columns:1fr 1fr;gap:14px"> <div><label>Domain <span style="opacity:.4">(encrypted at rest)</span></label><input type="text" name="domain" value="<?= htmlspecialchars($editDecDomain ?: '') ?>" required placeholder="shop.example.com"></div> <div><label>Nickname (Dashboard Only)</label><input type="text" name="nickname" value="<?= htmlspecialchars($editStore['nickname'] ?? '') ?>" placeholder="e.g. Main Store" maxlength="100"></div> <div><label>Store Name <span style="opacity:.4">(encrypted at rest)</span></label><input type="text" name="store_name" value="<?= htmlspecialchars($editDecName ?: '') ?>" required placeholder="Customer-facing store name"></div> <div><label>Campaign Name <span style="opacity:.4">(encrypted)</span></label><input type="text" name="campaign_name" value="<?= htmlspecialchars($editDecCampaign ?: '') ?>" placeholder="Campaign label"></div> <div><label>Tagline <span style="opacity:.4">(encrypted)</span></label><input type="text" name="tagline" value="<?= htmlspecialchars($editDecTagline ?: '') ?>" placeholder="Store tagline"></div> <div><label>Accent Color</label><input type="color" name="accent_color" value="<?= htmlspecialchars($editStore['accent_color'] ?? '#2D6A4F') ?>" style="height:42px;padding:4px"></div> <div><label>Store Type</label> <select name="store_type"> <option value="replica"<?= ($editStore['store_type'] ?? 'replica') === 'replica' ? 'selected' : '' ?>>Replica (full clone)</option> <option value="redirect"<?= ($editStore['store_type'] ?? '') === 'redirect' ? 'selected' : '' ?>>Redirect</option> </select> </div><?php if (!$editStore): ?> <div style="grid-column:1/-1"> <label style="font-weight:600;margin-bottom:8px;display:block">DNS Provisioning</label> <div style="display:flex;gap:20px;align-items:center"> <label style="display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:400"><input type="radio" name="dns_mode" value="full" checked style="accent-color:#2D6A4F"><span>Full DNS <span style="opacity:.5">(create zone + ns1/ns2 + A + MX + SPF)</span></span></label> <label style="display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:400"><input type="radio" name="dns_mode" value="arecord" style="accent-color:#2D6A4F"><span>A record only <span style="opacity:.5">(point to proxy)</span></span></label> <label style="display:flex;align-items:center;gap:6px;cursor:pointer;font-weight:400"><input type="radio" name="dns_mode" value="none" style="accent-color:#2D6A4F"><span>No DNS <span style="opacity:.5">(manual setup)</span></span></label> </div> </div><?php endif; ?> </div> <div style="display:flex;justify-content:flex-end;gap:10px;margin-top:10px"> <a href="?view=stores" class="btn btn-ghost">CANCEL</a> <button type="submit" class="btn btn-primary"><?= $editStore ? 'ENCRYPT &amp; SAVE' : 'ENCRYPT &amp; CREATE' ?></button> </div> </form> </div>