JezK
Edit File: seed_admin_s4.php
<?php // seed_admin_s4.php - Seed initial admin for Software 4 require_once __DIR__ . '/config/config.php'; require_once __DIR__ . '/config/db.php'; $pdo = db(); try { $email = 'admin@xray.com'; $pass = 'admin123'; $hash = password_hash($pass, PASSWORD_BCRYPT); // Ensure admin role exists with Technican (Operator) $stmt = $pdo->prepare("SELECT id FROM users WHERE email = ?"); $stmt->execute([$email]); if ($stmt->fetch()) { echo "Admin user $email already exists.\n"; } else { $pdo->prepare("INSERT INTO users (name, email, password_hash, role_id, status) VALUES (?, ?, ?, ?, ?)") ->execute(['Super Admin', $email, $hash, 1, 'active']); echo "Admin user created: $email / $pass\n"; } } catch (PDOException $e) { die("Database Error: " . $e->getMessage()); }