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 "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 "| Field | Type | Null | Key | Default |
|---|---|---|---|---|
| " . htmlspecialchars($column['Field']) . " | "; echo "" . htmlspecialchars($column['Type']) . " | "; echo "" . htmlspecialchars($column['Null']) . " | "; echo "" . htmlspecialchars($column['Key']) . " | "; echo "" . htmlspecialchars($column['Default']) . " | "; echo "
Email: admin@sanatandharmajagruti.com
"; echo "Password: admin123
"; echo ""; ?>