Database Check"; $db = Database::getInstance()->getConnection(); // Check if admin user exists $stmt = $db->prepare("SELECT * FROM users WHERE email = 'admin@sanatandharmajagruti.com'"); $stmt->execute(); $admin = $stmt->fetch(); if ($admin) { echo "

Admin user found:

"; echo ""; // Test password verification if (!empty($admin['password'])) { $testPassword = 'admin123'; $isValid = password_verify($testPassword, $admin['password']); echo "

Password Test: " . ($isValid ? 'VALID' : 'INVALID') . "

"; } } else { echo "

Admin user NOT found!

"; // Create admin user echo "

Creating admin user...

"; try { $hashedPassword = password_hash('admin123', PASSWORD_DEFAULT); $stmt = $db->prepare("INSERT INTO users (name, email, password, mobile, gender, dob, sdw_type, sdw_name, aadhar, state, district, address, pincode, membership_type, user_type, status, registration_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $result = $stmt->execute([ 'Admin User', 'admin@sanatandharmajagruti.com', $hashedPassword, '9999999999', 'Male', '1990-01-01', 'S/O', 'Admin Father', '123456789012', 'Delhi', 'New Delhi', 'Admin Address', '110001', 'senior_membership', 'admin', 'approved', 'ADMIN001' ]); if ($result) { echo "

Admin user created successfully!

"; } else { echo "

Failed to create admin user!

"; } } catch (Exception $e) { echo "

Error creating admin user: " . $e->getMessage() . "

"; } } // Check table structure echo "

Users Table Structure:

"; $stmt = $db->prepare("DESCRIBE users"); $stmt->execute(); $columns = $stmt->fetchAll(); echo ""; echo ""; foreach ($columns as $column) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
FieldTypeNullKeyDefault
" . htmlspecialchars($column['Field']) . "" . htmlspecialchars($column['Type']) . "" . htmlspecialchars($column['Null']) . "" . htmlspecialchars($column['Key']) . "" . htmlspecialchars($column['Default']) . "
"; echo "
"; echo "

Login Credentials:

"; echo "

Email: admin@sanatandharmajagruti.com

"; echo "

Password: admin123

"; echo "

Go to Login Page

"; ?>