<?php
require __DIR__ . '/_bootstrap.php';
$full = trim($_POST['full_name'] ?? '');
$email = trim($_POST['email'] ?? '');
$pass  = $_POST['password'] ?? '';
if ($full==='' || $email==='' || $pass===''){ die('All fields required'); }
$hash = password_hash($pass, PASSWORD_DEFAULT);
$stmt = $pdo->prepare("INSERT INTO admins (full_name, email, password_hash) VALUES (?,?,?)");
$stmt->execute([$full,$email,$hash]);
header('Location: ' . url_for('/admin/admins.php'));
