Invalid user type.
'; + break; + } + ?> +diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..7d4e90b --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,25 @@ +body { + background-color: #f8f9fa; +} + +.header-gradient { + background: linear-gradient(90deg, #007BFF, #0056b3); +} + +.card { + border: none; + border-radius: 0.5rem; +} + +.btn-primary { + background-color: #007BFF; + border: none; +} + +.btn-primary:hover { + background-color: #0056b3; +} + +.footer { + background-color: #e9ecef; +} diff --git a/dashboard.php b/dashboard.php new file mode 100644 index 0000000..2ab0a73 --- /dev/null +++ b/dashboard.php @@ -0,0 +1,64 @@ + + + +
+ + +Invalid user type.
'; + break; + } + ?> +This is your dashboard. More features will be added soon.
diff --git a/donor_registration.php b/donor_registration.php new file mode 100644 index 0000000..f537b63 --- /dev/null +++ b/donor_registration.php @@ -0,0 +1,186 @@ +prepare( + 'INSERT INTO donors (full_name, email, phone, blood_type, organs_to_donate, medical_history, password_hash) VALUES (?, ?, ?, ?, ?, ?, ?)' + ); + $stmt->execute([$full_name, $email, $phone, $blood_type, $organs_to_donate, $medical_history, $password_hash]); + + $donor_id = db()->lastInsertId(); + $_SESSION['user_id'] = $donor_id; + $_SESSION['user_type'] = 'donor'; + $_SESSION['user_email'] = $email; + + header("Location: dashboard.php"); + exit; + } catch (PDOException $e) { + if ($e->getCode() == 23000) { // Integrity constraint violation (duplicate entry) + $error_message = "The email address you entered is already registered."; + } else { + $error_message = "An error occurred while processing your request. Please try again later."; + } + } catch (Exception $e) { + $error_message = $e->getMessage(); + } +} +?> + + + + + +This is your dashboard. More features will be added soon.
diff --git a/hospital_registration.php b/hospital_registration.php new file mode 100644 index 0000000..1c43f0a --- /dev/null +++ b/hospital_registration.php @@ -0,0 +1,131 @@ +prepare("SELECT id FROM hospitals WHERE email = ?"); + $stmt->execute([$email]); + if ($stmt->fetch()) { + $error_message = "A hospital with this email is already registered."; + } else { + $hashed_password = password_hash($password, PASSWORD_BCRYPT); + $sql = "INSERT INTO hospitals (name, email, phone, address, password) VALUES (?, ?, ?, ?, ?)"; + $stmt = $pdo->prepare($sql); + $stmt->execute([$name, $email, $phone, $address, $hashed_password]); + + $hospital_id = $pdo->lastInsertId(); + $_SESSION['user_id'] = $hospital_id; + $_SESSION['user_type'] = 'hospital'; + $_SESSION['user_email'] = $email; + + header("Location: dashboard.php"); + exit; + } + } catch (PDOException $e) { + $error_message = "Database error: " . $e->getMessage(); + // In a real application, you would log this error, not show it to the user + } + } +} +?> + + + + + += ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.
-This page will update automatically as the plan is implemented.
-Runtime: PHP = htmlspecialchars($phpVersion) ?> — UTC = htmlspecialchars($now) ?>
Your decision to become an organ donor can save up to eight lives.
Join our community of heroes today.
Register yourself as an organ donor and become a potential lifesaver.
+ Register as a Donor +Register your hospital to manage recipients and coordinate with donors.
+ Register Your Hospital +Fill out the secure registration form with your details. It only takes a few minutes.
+Our team verifies your information to ensure safety and eligibility for donation.
+Once matched, you get a chance to make a life-changing impact.
+Click the button below to find potential matches between approved donors and recipients.
+ + +No matches found yet.
+ +| Donor | +Recipient | +Hospital | +Status | +Action | +
|---|---|---|---|---|
| = htmlspecialchars($match['donor_name']) ?> | += htmlspecialchars($match['recipient_name']) ?> | += htmlspecialchars($match['hospital_name']) ?> | ++ + = htmlspecialchars(ucfirst($match['status'])) ?> + + | ++ + + + | +
No pending donor registrations.
+ +| Name | +Blood Type | +Organs | +Action | +|
|---|---|---|---|---|
| = htmlspecialchars($donor['name']) ?> | += htmlspecialchars($donor['email']) ?> | += htmlspecialchars($donor['blood_type']) ?> | += htmlspecialchars($donor['organs']) ?> | ++ + | +
No pending hospital registrations.
+ +| Name | +Phone | +Address | +Action | +|
|---|---|---|---|---|
| = htmlspecialchars($hospital['name']) ?> | += htmlspecialchars($hospital['email']) ?> | += htmlspecialchars($hospital['phone']) ?> | += htmlspecialchars($hospital['address']) ?> | ++ + | +