<?php
// tools/seed_admin.php
require __DIR__ . '/../includes/db.php';

function make_user($u,$p,$role){
  global $pdo;
  $hash = password_hash($p, PASSWORD_DEFAULT);
  $st = $pdo->prepare('INSERT INTO admin_users (username, password_hash, role) VALUES (:u,:h,:r)');
  $st->execute(['u'=>$u,'h'=>$hash,'r'=>$role]);
  echo "Created user $u ($role)\n";
}

make_user('president','change_me_president','president');
make_user('dm','change_me_dm','dm');

echo "Done.\n";
