<?php
/**
 * ONE-TIME PASSWORD SETUP SCRIPT
 * Run this once after uploading the site to generate correct bcrypt hashes.
 * Then DELETE this file from your server immediately.
 * 
 * Access: https://yourdomain.com/ship/setup-password.php
 */

require_once __DIR__ . '/includes/db.php';

// Generate hashes
$adminHash = password_hash('Admin@1234', PASSWORD_BCRYPT);
$staffHash = password_hash('Staff@1234', PASSWORD_BCRYPT);

// Update users table
$pdo->prepare("UPDATE users SET password=? WHERE email='admin@turischool.com'")->execute([$adminHash]);
$pdo->prepare("UPDATE users SET password=? WHERE email='staff@turischool.com'")->execute([$staffHash]);

echo '<h2 style="font-family:sans-serif;color:green;">Passwords set successfully!</h2>';
echo '<p style="font-family:sans-serif;">Admin: admin@turischool.com / <strong>Admin@1234</strong></p>';
echo '<p style="font-family:sans-serif;">Staff: staff@turischool.com / <strong>Staff@1234</strong></p>';
echo '<p style="font-family:sans-serif;color:red;"><strong>IMPORTANT: Delete this file (setup-password.php) from your server now!</strong></p>';
echo '<p><a href="admin/signin.php">Go to Admin Login</a></p>';
