« Back to History
add_decision.php
|
20260722_120325.php
Initial Domain Snapshot
Copy Code
<?php require_once __DIR__ . '/../partials/header.php'; require_once __DIR__ . '/../core/db.php'; $msg = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $code = trim($_POST['code'] ?? ''); $title = trim($_POST['title'] ?? ''); $summary = trim($_POST['summary'] ?? ''); $reason = trim($_POST['reason'] ?? ''); if ($code && $title && $summary && $reason) { $stmt = $pdo->prepare(" INSERT INTO decisions (decision_code, title, decision_date, summary, reason, change_policy) VALUES (?,?,CURDATE(),?,?, 'Change only via new decision') "); $stmt->execute([$code, $title, $summary, $reason]); $msg = 'Decision added (immutable)'; } else { $msg = 'All fields required'; } } ?> <h1>Add New Decision</h1> <p class="intro"> ⚠️ Existing decision edit nahi hoga. Har naya decision permanent record hota hai. </p> <?php if ($msg): ?> <p class="notice"><?= htmlspecialchars($msg) ?></p> <?php endif; ?> <form method="post" class="card"> <label>Decision Code (e.g. DL-002)</label> <input type="text" name="code" required> <label>Title</label> <input type="text" name="title" required> <label>Summary</label> <textarea name="summary" required></textarea> <label>Reason</label> <textarea name="reason" required></textarea> <button class="btn">Add Decision</button> </form> <?php require_once __DIR__ . '/../partials/footer.php';