<?php
require_once '../includes/auth.php';
require_once '../../includes/config.php';

if ($_POST) {
    $pdo->prepare("
        INSERT INTO mega_prompts (title,slug,prompt_text,status)
        VALUES (?,?,?,?)
    ")->execute([
        $_POST['title'],
        $_POST['slug'],
        $_POST['prompt_text'],
        $_POST['status']
    ]);
    header("Location: index.php");
    exit;
}
?>

<h2>➕ ساخت مگاپرامپت</h2>

<form method="post">
عنوان:<br>
<input name="title" required><br><br>

Slug (لینک):<br>
<input name="slug" required><br><br>

پرامپت اصلی:<br>
<textarea name="prompt_text" rows="8" required></textarea><br><br>

وضعیت:
<select name="status">
  <option value="active">فعال</option>
  <option value="inactive">غیرفعال</option>
</select><br><br>

<button>ذخیره</button>
</form>
