@ -1,2 +0,0 @@ |
|||||||
/mvnw text eol=lf |
|
||||||
*.cmd text eol=crlf |
|
@ -1,33 +0,0 @@ |
|||||||
HELP.md |
|
||||||
target/ |
|
||||||
!.mvn/wrapper/maven-wrapper.jar |
|
||||||
!**/src/main/**/target/ |
|
||||||
!**/src/test/**/target/ |
|
||||||
|
|
||||||
### STS ### |
|
||||||
.apt_generated |
|
||||||
.classpath |
|
||||||
.factorypath |
|
||||||
.project |
|
||||||
.settings |
|
||||||
.springBeans |
|
||||||
.sts4-cache |
|
||||||
|
|
||||||
### IntelliJ IDEA ### |
|
||||||
.idea |
|
||||||
*.iws |
|
||||||
*.iml |
|
||||||
*.ipr |
|
||||||
|
|
||||||
### NetBeans ### |
|
||||||
/nbproject/private/ |
|
||||||
/nbbuild/ |
|
||||||
/dist/ |
|
||||||
/nbdist/ |
|
||||||
/.nb-gradle/ |
|
||||||
build/ |
|
||||||
!**/src/main/**/build/ |
|
||||||
!**/src/test/**/build/ |
|
||||||
|
|
||||||
### VS Code ### |
|
||||||
.vscode/ |
|
@ -0,0 +1,15 @@ |
|||||||
|
{ |
||||||
|
"extends": [ |
||||||
|
"development" |
||||||
|
], |
||||||
|
"hints": { |
||||||
|
"compat-api/css": [ |
||||||
|
"default", |
||||||
|
{ |
||||||
|
"ignore": [ |
||||||
|
"text-size-adjust" |
||||||
|
] |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
} |
@ -1,19 +0,0 @@ |
|||||||
# Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
# or more contributor license agreements. See the NOTICE file |
|
||||||
# distributed with this work for additional information |
|
||||||
# regarding copyright ownership. The ASF licenses this file |
|
||||||
# to you under the Apache License, Version 2.0 (the |
|
||||||
# "License"); you may not use this file except in compliance |
|
||||||
# with the License. You may obtain a copy of the License at |
|
||||||
# |
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0 |
|
||||||
# |
|
||||||
# Unless required by applicable law or agreed to in writing, |
|
||||||
# software distributed under the License is distributed on an |
|
||||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
# KIND, either express or implied. See the License for the |
|
||||||
# specific language governing permissions and limitations |
|
||||||
# under the License. |
|
||||||
wrapperVersion=3.3.2 |
|
||||||
distributionType=only-script |
|
||||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip |
|
@ -0,0 +1,152 @@ |
|||||||
|
<?php |
||||||
|
// submit_contact.php |
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
||||||
|
// Get form data |
||||||
|
$name = $_POST['name']; |
||||||
|
$email = $_POST['email']; |
||||||
|
$message = $_POST['message']; |
||||||
|
|
||||||
|
// Sanitize data (basic example, can be enhanced) |
||||||
|
$name = htmlspecialchars($name); |
||||||
|
$email = htmlspecialchars($email); |
||||||
|
$message = htmlspecialchars($message); |
||||||
|
|
||||||
|
// Send email or store data as needed |
||||||
|
// Example of sending an email (adjust to your mail server configuration) |
||||||
|
$to = 'support@donateease.com'; |
||||||
|
$subject = 'Contact Us Form Submission'; |
||||||
|
$body = "Name: $name\nEmail: $email\nMessage: $message"; |
||||||
|
$headers = 'From: ' . $email; |
||||||
|
|
||||||
|
if (mail($to, $subject, $body, $headers)) { |
||||||
|
echo '<script>alert("Your message has been sent successfully!");</script>'; |
||||||
|
} else { |
||||||
|
echo '<script>alert("There was an error sending your message. Please try again later.");</script>'; |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Contact Us - DonateEase</title> |
||||||
|
<style> |
||||||
|
main { |
||||||
|
margin: 0; |
||||||
|
font-family: Arial, sans-serif; |
||||||
|
background-color: #f4f4f4; |
||||||
|
display: flex; |
||||||
|
justify-content: center; /* Center horizontally */ |
||||||
|
align-items: center; /* Center vertically */ |
||||||
|
height: 90vh; /* Full viewport height */ |
||||||
|
} |
||||||
|
.main { |
||||||
|
max-width: 800px; |
||||||
|
margin: 14px; |
||||||
|
padding: 16px; |
||||||
|
background-color: #ffffff; |
||||||
|
border-radius: 6px; |
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
||||||
|
} |
||||||
|
h2 { |
||||||
|
text-align: center; |
||||||
|
color: #2d572c; /* Forest green */ |
||||||
|
} |
||||||
|
p { |
||||||
|
color: #555; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
.form-group { |
||||||
|
margin-bottom: 15px; |
||||||
|
} |
||||||
|
label { |
||||||
|
display: block; |
||||||
|
font-weight: bold; |
||||||
|
color: #2d572c; |
||||||
|
margin-bottom: 5px; |
||||||
|
} |
||||||
|
input, textarea { |
||||||
|
width: 100%; |
||||||
|
padding: 5px; |
||||||
|
border: 1px solid #ccc; border-radius: 4px; |
||||||
|
font-size: 16px; |
||||||
|
} |
||||||
|
textarea { |
||||||
|
height: 150px; |
||||||
|
resize: none; |
||||||
|
} |
||||||
|
button { |
||||||
|
display: block; |
||||||
|
width: 100%; |
||||||
|
padding: 10px; |
||||||
|
background-color: #8bbc8b; /* Fresh green */ |
||||||
|
color: #ffffff; |
||||||
|
border: none; |
||||||
|
border-radius: 4px; |
||||||
|
font-size: 18px; |
||||||
|
font-weight: bold; |
||||||
|
cursor: pointer; |
||||||
|
transition: background-color 0.3s ease; |
||||||
|
} |
||||||
|
button:hover { |
||||||
|
background-color: #77c774; /* Vibrant green */ |
||||||
|
} |
||||||
|
.contact-info { |
||||||
|
margin-top: 20px; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
.contact-info p { |
||||||
|
margin: 5px 0; |
||||||
|
} |
||||||
|
.contact-info a { |
||||||
|
color: #2d572c; |
||||||
|
text-decoration: none; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
.contact-info a:hover { |
||||||
|
text-decoration: underline; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<?php include('includes/header.php'); ?> |
||||||
|
<main> |
||||||
|
<div class="main"> |
||||||
|
<br> |
||||||
|
<br> |
||||||
|
<h2>Contact Us</h2> |
||||||
|
<p>If you have any questions, feel free to reach out to us using the form below.</p> |
||||||
|
<form action="contactus.php" method="POST"> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="name">Your Name</label> |
||||||
|
<input type="text" id="name" name="name" placeholder="Enter your name" required> |
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="email">Your Email</label> |
||||||
|
<input type="email" id="email" name="email" placeholder="Enter your email" required> |
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="message">Your Message</label> |
||||||
|
<textarea id="message" name="message" placeholder="Enter your message" required></textarea> |
||||||
|
</div> |
||||||
|
<button type="submit">Send Message</button> |
||||||
|
</form> |
||||||
|
<div class="contact-info"> |
||||||
|
<p><strong>Email:</strong> <a href="mailto:support@donateease.com">support@donateease.com</a></p> |
||||||
|
<p><strong>Phone:</strong> +977 9803666391</p> |
||||||
|
<p><strong>Address:</strong> Maitidevi, Kathmandu, Nepal</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
</div> |
||||||
|
<!-- Embed Google Maps iframe --> |
||||||
|
<div id="map"> |
||||||
|
|
||||||
|
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d14129.445442684992!2d85.333259!3d27.706127!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x39eb19a00bd8d7c1%3A0xe01225b704668023!2sLord%20Buddha%20Education%20Foundation-%20LBEF%20CAMPUS%20(The%20First%20IT%20College%20of%20Nepal)!5e0!3m2!1sen!2snp!4v1736672731872!5m2!1sen!2snp" |
||||||
|
width="1100" height="600" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe> |
||||||
|
</div> |
||||||
|
</main> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,258 @@ |
|||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
|
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>About Us</title> |
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
<style> |
||||||
|
/* Global Styles */ |
||||||
|
body { |
||||||
|
font-family: 'Arial', sans-serif; |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
background-color: #f1f8f4; |
||||||
|
color: #333; |
||||||
|
} |
||||||
|
|
||||||
|
h1, h2 { |
||||||
|
text-align: center; |
||||||
|
color: #2e7d32; |
||||||
|
} |
||||||
|
|
||||||
|
p { |
||||||
|
text-align: center; |
||||||
|
margin: 10px 0; |
||||||
|
} |
||||||
|
|
||||||
|
/* Container for Left and Right Sections */ |
||||||
|
.about-container { |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
padding: 20px; |
||||||
|
gap: 30px; |
||||||
|
flex-wrap: wrap; |
||||||
|
} |
||||||
|
|
||||||
|
/* Left Section for Image */ |
||||||
|
.left-side { |
||||||
|
flex: 1; |
||||||
|
max-width: 40%; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.left-side img { |
||||||
|
width: 110%; |
||||||
|
height: 300px; /* Adjust this value to your desired height */ |
||||||
|
border-radius: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
/* Right Section for About Content */ |
||||||
|
.right-side { |
||||||
|
flex: 1; |
||||||
|
max-width: 55%; |
||||||
|
} |
||||||
|
|
||||||
|
.about-content { |
||||||
|
background-color: #fff; |
||||||
|
padding: 30px; |
||||||
|
border-radius: 12px; |
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.about-content h2 { |
||||||
|
color: #2e7d32; |
||||||
|
font-size: 2rem; |
||||||
|
} |
||||||
|
|
||||||
|
.about-content p { |
||||||
|
font-size: 1rem; |
||||||
|
line-height: 1.6; |
||||||
|
color: #555; |
||||||
|
} |
||||||
|
/* Mission and Vision Section Container */ |
||||||
|
.mission-vision-container { |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; /* Equal spacing */ |
||||||
|
padding: 30px; |
||||||
|
} |
||||||
|
|
||||||
|
/* Mission and Vision Card Styles */ |
||||||
|
.mission-vision-card { |
||||||
|
flex: 1; /* Allow cards to grow equally */ |
||||||
|
max-width: 48%; /* Control width for better spacing */ |
||||||
|
background-color: #fff; /* White background for cards */ |
||||||
|
padding: 30px; /* Inner padding for content */ |
||||||
|
border-radius: 12px; /* Rounded corners */ |
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow effect */ |
||||||
|
text-align: center; /* Center text */ |
||||||
|
margin: 10px; /* Margin for spacing between boxes */ |
||||||
|
} |
||||||
|
|
||||||
|
/* Card Title and Paragraph Styles */ |
||||||
|
.mission-vision-card h3 { |
||||||
|
color: #2e7d32; /* Header color */ |
||||||
|
font-size: 1.8rem; /* Header size */ |
||||||
|
} |
||||||
|
|
||||||
|
.mission-vision-card p { |
||||||
|
font-size: 1rem; /* Paragraph size */ |
||||||
|
line-height: 1.6; /* Line height for readability */ |
||||||
|
color: #555; /* Text color */ |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/* Contact Us Section */ |
||||||
|
.contact-section { |
||||||
|
text-align: center; |
||||||
|
margin-top: 50px; |
||||||
|
} |
||||||
|
|
||||||
|
.contact-section h1 { |
||||||
|
color: #2e7d32; |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.contact-grid { |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
gap: 20px; |
||||||
|
flex-wrap: wrap; |
||||||
|
} |
||||||
|
|
||||||
|
.contact-card { |
||||||
|
text-align: center; |
||||||
|
width: 180px; |
||||||
|
} |
||||||
|
|
||||||
|
.contact-card img { |
||||||
|
width: 120px; |
||||||
|
height: 120px; |
||||||
|
border-radius: 50%; |
||||||
|
object-fit: cover; |
||||||
|
margin-bottom: 15px; |
||||||
|
} |
||||||
|
|
||||||
|
.contact-card h4 { |
||||||
|
font-size: 1.1rem; |
||||||
|
color: #333; |
||||||
|
} |
||||||
|
|
||||||
|
.contact-card p { |
||||||
|
font-size: 1rem; |
||||||
|
color: #555; |
||||||
|
} |
||||||
|
|
||||||
|
.contact-card button { |
||||||
|
background-color: #2e7d32; |
||||||
|
color: white; |
||||||
|
border: none; |
||||||
|
padding: 8px 15px; |
||||||
|
border-radius: 5px; |
||||||
|
cursor: pointer; |
||||||
|
font-size: 0.9rem; |
||||||
|
transition: background-color 0.3s ease; |
||||||
|
} |
||||||
|
|
||||||
|
.contact-card button:hover { |
||||||
|
background-color: #1b5e20; |
||||||
|
} |
||||||
|
|
||||||
|
/* Responsive Design */ |
||||||
|
@media (max-width: 768px) { |
||||||
|
.about-container { |
||||||
|
flex-direction: column; |
||||||
|
} |
||||||
|
|
||||||
|
.left-side { |
||||||
|
max-width: 100%; |
||||||
|
height: 400px; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
.right-side { |
||||||
|
max-width: 100%; |
||||||
|
height: auto; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.mission-vision-card { |
||||||
|
width: 90%; /* Ensure cards are responsive */ |
||||||
|
margin: 0 auto; /* Center the cards */ |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
<div class="about-container"> |
||||||
|
<div class="left-side"> |
||||||
|
<img src="donations.jpg" alt="DonateEase Image"> |
||||||
|
</div> |
||||||
|
<div class="right-side"> |
||||||
|
<div class="about-content"> |
||||||
|
<h2>About Us</h2> |
||||||
|
<p>DonateEase is a platform designed to help individuals and organizations donate effortlessly. Our mission is to provide a seamless and secure way to donate to causes that matter, improving the lives of people in need.</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<!-- Mission and Vision Section with Card Layout --> |
||||||
|
<div class="mission-vision-container"> |
||||||
|
<div class="mission-vision-card"> |
||||||
|
<h3>Our Mission</h3> |
||||||
|
<p>Our mission is to connect people with causes that need their support the most. Through our platform, we aim to foster a community of kindness, making it easier to donate and contribute to various causes globally.</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="mission-vision-card"> |
||||||
|
<h3>Our Vision</h3> |
||||||
|
<p>We envision a world where every person has the opportunity to give, and every cause receives the support it needs. Together, we can create a global network of givers, helping to make a real difference in the world.</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Contact Us Section --> |
||||||
|
<div class="contact-section"> |
||||||
|
<h1>Our Team</h1> |
||||||
|
<div class="contact-grid"> |
||||||
|
<div class="contact-card"> |
||||||
|
<img src="ashok.jpg" alt="Ashok Sedhain"> |
||||||
|
<h4>Ashok Sedhain</h4> |
||||||
|
<p>+977 9840200020</p> |
||||||
|
<button onclick="window.location.href='https://www.facebook.com/ashok.sedhain.7?mibextid=ZbWKwL'">Visit Profile</button> |
||||||
|
</div> |
||||||
|
<div class="contact-card"> |
||||||
|
<img src="deekshya.jpg" alt="Diksha Rai"> |
||||||
|
<h4>Diksha Rai</h4> |
||||||
|
<p>+977 9842587018</p> |
||||||
|
<button onclick="window.location.href='https://www.facebook.com/dikshya.themnuhang?mibextid=ZbWKwL'">Visit Profile</button> |
||||||
|
</div> |
||||||
|
<div class="contact-card"> |
||||||
|
<img src="jyoti.jpg" alt="Jyoti Yadav"> |
||||||
|
<h4>Jyoti Yadav</h4> |
||||||
|
<p>+977 9761782008</p> |
||||||
|
<button onclick="window.location.href='https://www.facebook.com/profile.php?id=100036298035305&mibextid=ZbWKwL'">Visit Profile</button> |
||||||
|
</div> |
||||||
|
<div class="contact-card"> |
||||||
|
<img src="niraj.jpg" alt="Niraj Pandit"> |
||||||
|
<h4>Niraj Pandit</h4> |
||||||
|
<p>+977 9842192040</p> |
||||||
|
<button onclick="window.location.href='https://www.facebook.com/niraj.pandit.794628?mibextid=ZbWKwL'">Visit Profile</button> |
||||||
|
</div> |
||||||
|
<div class="contact-card"> |
||||||
|
<img src="shristi.jpg" alt="Shristi Ghalan"> |
||||||
|
<h4>Shristi Ghalan</h4> |
||||||
|
<p>+977 9803666391</p> |
||||||
|
<button onclick="window.location.href='https://www.facebook.com/davidbrown'">Visit Profile</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php include 'includes/footer.php'; ?> |
||||||
|
|
||||||
|
<!-- Optionally add any extra scripts --> |
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script> |
||||||
|
</body> |
||||||
|
|
||||||
|
</html> |
@ -0,0 +1,123 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Ensure the admin is logged in |
||||||
|
if (!isset($_SESSION['user_email']) || $_SESSION['role'] !== 'admin') { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Fetch dashboard metrics |
||||||
|
$total_users = $conn->query("SELECT COUNT(*) AS count FROM users")->fetch_assoc()['count']; |
||||||
|
$total_donations = $conn->query("SELECT COUNT(*) AS count FROM material_donations")->fetch_assoc()['count']; |
||||||
|
$pending_donations = $conn->query("SELECT COUNT(*) AS count FROM material_donations WHERE status = 'pending'")->fetch_assoc()['count']; |
||||||
|
|
||||||
|
// Fetch users and donations |
||||||
|
$users = $conn->query("SELECT * FROM users ORDER BY created_at DESC"); |
||||||
|
$donations = $conn->query("SELECT * FROM material_donations ORDER BY created_at DESC"); |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Admin Dashboard</title> |
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<div class="container mt-5"> |
||||||
|
<h2>Admin Dashboard</h2> |
||||||
|
|
||||||
|
<!-- Dashboard Metrics --> |
||||||
|
<div class="row text-center my-4"> |
||||||
|
<div class="col-md-4"> |
||||||
|
<div class="card bg-primary text-white"> |
||||||
|
<div class="card-body"> |
||||||
|
<h3><?php echo $total_users; ?></h3>
|
||||||
|
<p>Total Users</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="col-md-4"> |
||||||
|
<div class="card bg-success text-white"> |
||||||
|
<div class="card-body"> |
||||||
|
<h3><?php echo $total_donations; ?></h3>
|
||||||
|
<p>Total Donations</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="col-md-4"> |
||||||
|
<div class="card bg-warning text-white"> |
||||||
|
<div class="card-body"> |
||||||
|
<h3><?php echo $pending_donations; ?></h3>
|
||||||
|
<p>Pending Approvals</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Users Management --> |
||||||
|
<h3>Manage Users</h3> |
||||||
|
<table class="table table-bordered"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>ID</th> |
||||||
|
<th>Email</th> |
||||||
|
<th>Role</th> |
||||||
|
<th>Actions</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<?php while ($user = $users->fetch_assoc()): ?> |
||||||
|
<tr> |
||||||
|
<td><?php echo $user['id']; ?></td>
|
||||||
|
<td><?php echo $user['email']; ?></td>
|
||||||
|
<td><?php echo ucfirst($user['role']); ?></td>
|
||||||
|
<td> |
||||||
|
<a href="edit_user.php?id=<?php echo $user['id']; ?>" class="btn btn-sm btn-primary">Edit</a>
|
||||||
|
<a href="delete_user.php?id=<?php echo $user['id']; ?>" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure you want to delete this user?');">Delete</a>
|
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<?php endwhile; ?> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
|
||||||
|
<!-- Donations Management --> |
||||||
|
<h3 class="mt-5">Manage Donations</h3> |
||||||
|
<table class="table table-bordered"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>ID</th> |
||||||
|
<th>Item Name</th> |
||||||
|
<th>Condition</th> |
||||||
|
<th>Quantity</th> |
||||||
|
<th>Status</th> |
||||||
|
<th>Actions</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<?php while ($donation = $donations->fetch_assoc()): ?> |
||||||
|
<tr> |
||||||
|
<td><?php echo $donation['id']; ?></td>
|
||||||
|
<td><?php echo $donation['item_name']; ?></td>
|
||||||
|
<td><?php echo $donation['conditions']; ?></td>
|
||||||
|
<td><?php echo $donation['quantity']; ?></td>
|
||||||
|
<td><?php echo ucfirst($donation['status']); ?></td>
|
||||||
|
<td> |
||||||
|
<?php if ($donation['status'] === 'pending'): ?> |
||||||
|
<a href="approve_donation.php?id=<?php echo $donation['id']; ?>" class="btn btn-sm btn-success">Approve</a>
|
||||||
|
<a href="reject_donation.php?id=<?php echo $donation['id']; ?>" class="btn btn-sm btn-warning">Reject</a>
|
||||||
|
<?php endif; ?> |
||||||
|
<a href="delete_donation.php?id=<?php echo $donation['id']; ?>" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure you want to delete this donation?');">Delete</a>
|
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<?php endwhile; ?> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,32 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Check if the admin is logged in |
||||||
|
if (!isset($_SESSION['user_email']) || $_SESSION['role'] !== 'admin') { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Check if the donation ID is provided |
||||||
|
if (isset($_GET['id']) && is_numeric($_GET['id'])) { |
||||||
|
$donation_id = $_GET['id']; |
||||||
|
|
||||||
|
// Update the donation status to 'approved' |
||||||
|
$stmt = $conn->prepare("UPDATE material_donations SET status = 'approved' WHERE id = ?"); |
||||||
|
$stmt->bind_param("i", $donation_id); |
||||||
|
|
||||||
|
if ($stmt->execute()) { |
||||||
|
$_SESSION['success_message'] = "Donation approved successfully."; |
||||||
|
} else { |
||||||
|
$_SESSION['error_message'] = "Failed to approve the donation."; |
||||||
|
} |
||||||
|
|
||||||
|
$stmt->close(); |
||||||
|
} else { |
||||||
|
$_SESSION['error_message'] = "Invalid donation ID."; |
||||||
|
} |
||||||
|
|
||||||
|
header("Location: admin_dashboard.php"); |
||||||
|
exit; |
||||||
|
?> |
@ -0,0 +1,271 @@ |
|||||||
|
<?php |
||||||
|
// Initialize variables for form data (if form is submitted) |
||||||
|
$name = $age = $blood_group = $contact = $email = $address = ""; |
||||||
|
|
||||||
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
||||||
|
$name = $_POST['name']; |
||||||
|
$age = $_POST['age']; |
||||||
|
$blood_group = $_POST['blood-group']; |
||||||
|
$contact = $_POST['contact']; |
||||||
|
$email = $_POST['email']; |
||||||
|
$address = $_POST['address']; |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||||
|
<title>Blood Donation - Save Lives</title> |
||||||
|
<style> |
||||||
|
/* General Styles */ |
||||||
|
body { |
||||||
|
margin: 0; |
||||||
|
font-family: Arial, sans-serif; |
||||||
|
background-color: #f9f9f9; |
||||||
|
color: #333; |
||||||
|
} |
||||||
|
|
||||||
|
header { |
||||||
|
background-color: #d32f2f; |
||||||
|
color: white; |
||||||
|
padding: 10px 20px; |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
align-items: center; |
||||||
|
} |
||||||
|
|
||||||
|
header .logo { |
||||||
|
font-size: 24px; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
|
||||||
|
header nav ul { |
||||||
|
list-style: none; |
||||||
|
display: flex; |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
} |
||||||
|
|
||||||
|
header nav ul li { |
||||||
|
margin: 0 10px; |
||||||
|
} |
||||||
|
|
||||||
|
header nav ul li a { |
||||||
|
color: white; |
||||||
|
text-decoration: none; |
||||||
|
font-size: 16px; |
||||||
|
} |
||||||
|
|
||||||
|
header nav ul li a:hover { |
||||||
|
text-decoration: underline; |
||||||
|
} |
||||||
|
|
||||||
|
/* Hero Section */ |
||||||
|
.hero { |
||||||
|
background: url("bloods.jpg") no-repeat center center/cover; |
||||||
|
height: 600px; |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
align-items: center; |
||||||
|
text-align: center; |
||||||
|
color: white; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
|
||||||
|
.hero::before { |
||||||
|
content: ""; |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
left: 0; |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
background-color: rgba(0, 0, 0, 0.5); /* Dark overlay */ |
||||||
|
} |
||||||
|
|
||||||
|
.hero-content { |
||||||
|
z-index: 1; |
||||||
|
} |
||||||
|
|
||||||
|
.hero-content h1 { |
||||||
|
font-size: 48px; |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.hero-content button { |
||||||
|
background-color: #c62828; |
||||||
|
color: white; |
||||||
|
padding: 12px 20px; |
||||||
|
font-size: 18px; |
||||||
|
border: none; |
||||||
|
border-radius: 5px; |
||||||
|
cursor: pointer; |
||||||
|
transition: background-color 0.3s ease; |
||||||
|
} |
||||||
|
|
||||||
|
/* Hidden Form */ |
||||||
|
#donation-form { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
/* Container */ |
||||||
|
.container { |
||||||
|
max-width: 800px; |
||||||
|
margin: 40px auto; |
||||||
|
padding: 20px; |
||||||
|
background-color: white; |
||||||
|
border-radius: 8px; |
||||||
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); |
||||||
|
} |
||||||
|
|
||||||
|
.container h2 { |
||||||
|
text-align: center; |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.donation-form { |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
gap: 15px; |
||||||
|
} |
||||||
|
|
||||||
|
.donation-form label { |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
|
||||||
|
.donation-form input, |
||||||
|
.donation-form select, |
||||||
|
.donation-form textarea { |
||||||
|
width: 100%; |
||||||
|
padding: 10px; |
||||||
|
border: 1px solid #ccc; |
||||||
|
border-radius: 5px; |
||||||
|
} |
||||||
|
|
||||||
|
.donation-form button { |
||||||
|
background-color: #2fd371; |
||||||
|
color: white; |
||||||
|
padding: 12px; |
||||||
|
font-size: 18px; |
||||||
|
border: none; |
||||||
|
border-radius: 5px; |
||||||
|
cursor: pointer; |
||||||
|
transition: background-color 0.3s ease; |
||||||
|
} |
||||||
|
|
||||||
|
.donation-form button:hover { |
||||||
|
} |
||||||
|
|
||||||
|
/* Footer */ |
||||||
|
footer { |
||||||
|
color: white; |
||||||
|
text-align: center; |
||||||
|
padding: 10px; |
||||||
|
margin-top: 20px; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<section |
||||||
|
class="hero" |
||||||
|
style="background: url('bloodee.png') no-repeat center center/cover" |
||||||
|
> |
||||||
|
<div class="hero-content"> |
||||||
|
<h1>Donate Blood, Save Lives</h1> |
||||||
|
<h2>Become a Donor</h2> |
||||||
|
<button onclick="showForm()">Click Here</button> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<div class="container" id="donation-form"> |
||||||
|
<h2>Blood Donation Registration</h2> |
||||||
|
<form class="donation-form" action="blood.php" method="POST"> |
||||||
|
<!-- Full Name --> |
||||||
|
<label for="name">Full Name:</label> |
||||||
|
<input |
||||||
|
type="text" |
||||||
|
id="name" |
||||||
|
name="name" |
||||||
|
placeholder="Enter your full name" |
||||||
|
value="<?php echo htmlspecialchars($name); ?>"
|
||||||
|
required |
||||||
|
/> |
||||||
|
|
||||||
|
<!-- Age --> |
||||||
|
<label for="age">Age:</label> |
||||||
|
<input |
||||||
|
type="number" |
||||||
|
id="age" |
||||||
|
name="age" |
||||||
|
placeholder="Enter your age" |
||||||
|
min="18" |
||||||
|
max="65" |
||||||
|
value="<?php echo htmlspecialchars($age); ?>"
|
||||||
|
required |
||||||
|
/> |
||||||
|
|
||||||
|
<!-- Blood Group --> |
||||||
|
<label for="blood-group">Blood Group:</label> |
||||||
|
<select id="blood-group" name="blood-group" required> |
||||||
|
<option value="">Select your blood group</option> |
||||||
|
<option value="A+" <?php if ($blood_group == 'A+') echo 'selected'; ?>>A+</option>
|
||||||
|
<option value="A-" <?php if ($blood_group == 'A-') echo 'selected'; ?>>A-</option>
|
||||||
|
<option value="B+" <?php if ($blood_group == 'B+') echo 'selected'; ?>>B+</option>
|
||||||
|
<option value="B-" <?php if ($blood_group == 'B-') echo 'selected'; ?>>B-</option>
|
||||||
|
<option value="O+" <?php if ($blood_group == 'O+') echo 'selected'; ?>>O+</option>
|
||||||
|
<option value="O-" <?php if ($blood_group == 'O-') echo 'selected'; ?>>O-</option>
|
||||||
|
<option value="AB+" <?php if ($blood_group == 'AB+') echo 'selected'; ?>>AB+</option>
|
||||||
|
<option value="AB-" <?php if ($blood_group == 'AB-') echo 'selected'; ?>>AB-</option>
|
||||||
|
</select> |
||||||
|
|
||||||
|
<!-- Contact Number --> |
||||||
|
<label for="contact">Contact Number:</label> |
||||||
|
<input |
||||||
|
type="tel" |
||||||
|
id="contact" |
||||||
|
name="contact" |
||||||
|
placeholder="Enter your phone number" |
||||||
|
value="<?php echo htmlspecialchars($contact); ?>"
|
||||||
|
required |
||||||
|
/> |
||||||
|
|
||||||
|
<!-- Email --> |
||||||
|
<label for="email">Email:</label> |
||||||
|
<input |
||||||
|
type="email" |
||||||
|
id="email" |
||||||
|
name="email" |
||||||
|
placeholder="Enter your email address" |
||||||
|
value="<?php echo htmlspecialchars($email); ?>"
|
||||||
|
required |
||||||
|
/> |
||||||
|
|
||||||
|
<!-- Address --> |
||||||
|
<label for="address">Address:</label> |
||||||
|
<textarea |
||||||
|
id="address" |
||||||
|
name="address" |
||||||
|
rows="3" |
||||||
|
placeholder="Enter your complete address" |
||||||
|
required |
||||||
|
><?php echo htmlspecialchars($address); ?></textarea>
|
||||||
|
|
||||||
|
<!-- Submit Button --> |
||||||
|
<button type="submit">Register as a Donor</button> |
||||||
|
</form> |
||||||
|
|
||||||
|
<?php if ($_SERVER["REQUEST_METHOD"] == "POST"): ?> |
||||||
|
<p>Thank you, <?php echo htmlspecialchars($name); ?>! You have successfully registered as a blood donor.</p>
|
||||||
|
<?php endif; ?> |
||||||
|
</div> |
||||||
|
|
||||||
|
<script> |
||||||
|
function showForm() { |
||||||
|
const form = document.getElementById("donation-form"); |
||||||
|
form.style.display = "block"; |
||||||
|
form.scrollIntoView({ behavior: "smooth" }); |
||||||
|
} |
||||||
|
</script> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 8.4 KiB |
@ -0,0 +1,142 @@ |
|||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Causes</title> |
||||||
|
<link rel="stylesheet" href="styles.css"> <!-- Replace with your CSS file --> |
||||||
|
<style> |
||||||
|
|
||||||
|
|
||||||
|
/* Header Styles */ |
||||||
|
header { |
||||||
|
margin-top: 60px; /* Offset for fixed navbar */ |
||||||
|
color: #2e7d32; |
||||||
|
text-align: center; |
||||||
|
padding: 1.5em 0; |
||||||
|
} |
||||||
|
|
||||||
|
header h1 { |
||||||
|
font-size: 2em; |
||||||
|
margin: 0; |
||||||
|
} |
||||||
|
|
||||||
|
header p { |
||||||
|
margin: 0.5em 0 0; |
||||||
|
font-size: 1.2em; |
||||||
|
} |
||||||
|
|
||||||
|
/* Content Container */ |
||||||
|
.container { |
||||||
|
padding: 2em; |
||||||
|
max-width: 1200px; |
||||||
|
margin: 0 auto; |
||||||
|
} |
||||||
|
|
||||||
|
/* Cause Card Styles */ |
||||||
|
.cause { |
||||||
|
background-color: white; |
||||||
|
border: 1px solid #ddd; |
||||||
|
border-radius: 8px; |
||||||
|
margin-bottom: 1.5em; |
||||||
|
padding: 1.5em; |
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.cause img { |
||||||
|
max-width: 100%; |
||||||
|
height: auto; |
||||||
|
border-radius: 8px; |
||||||
|
} |
||||||
|
|
||||||
|
.cause h2 { |
||||||
|
color: #2e7d32; /* Green */ |
||||||
|
margin: 1em 0 0.5em; |
||||||
|
} |
||||||
|
|
||||||
|
.cause p { |
||||||
|
color: #555; |
||||||
|
font-size: 1em; |
||||||
|
line-height: 1.5em; |
||||||
|
} |
||||||
|
|
||||||
|
.cause button { |
||||||
|
background-color: #4caf50; /* Bright Green */ |
||||||
|
color: white; |
||||||
|
border: none; |
||||||
|
border-radius: 5px; |
||||||
|
padding: 0.7em 1.5em; |
||||||
|
cursor: pointer; |
||||||
|
font-size: 1em; |
||||||
|
margin-top: 1em; |
||||||
|
text-decoration: none; |
||||||
|
} |
||||||
|
|
||||||
|
.cause button:hover { |
||||||
|
background-color: #388e3c; /* Darker Green */ |
||||||
|
} |
||||||
|
|
||||||
|
.cause button a { |
||||||
|
color: white; |
||||||
|
text-decoration: none; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
|
||||||
|
.cause button a:hover { |
||||||
|
text-decoration: underline; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
|
||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<header> |
||||||
|
<h1>Explore Causes</h1> |
||||||
|
<p>Find a cause that resonates with you and make a difference today!</p> |
||||||
|
</header> |
||||||
|
|
||||||
|
<!-- Causes Section --> |
||||||
|
<div class="container"> |
||||||
|
<div class="cause"> |
||||||
|
<img src="disaster.jpg" alt="Environment" /> |
||||||
|
<h2>Protect the Environment</h2> |
||||||
|
<p> |
||||||
|
Support initiatives aimed at combating climate change, conserving |
||||||
|
biodiversity, and reducing pollution. |
||||||
|
</p> |
||||||
|
<button> |
||||||
|
<a href="donations.php">Donate Now</a> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
<div class="cause"> |
||||||
|
<img src="education.jpg" alt="Education" /> |
||||||
|
<h2>Education for All</h2> |
||||||
|
<p> |
||||||
|
Help provide access to quality education for underprivileged children |
||||||
|
around the globe. |
||||||
|
</p> |
||||||
|
<button> |
||||||
|
<a href="donations.php">Donate Now</a> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
<div class="cause"> |
||||||
|
<img src="healthcare.jpg" alt="Healthcare" /> |
||||||
|
<h2>Healthcare Initiatives</h2> |
||||||
|
<p> |
||||||
|
Join efforts to improve healthcare systems and provide medical aid to |
||||||
|
those in need. |
||||||
|
</p> |
||||||
|
<button> |
||||||
|
<a href="donations.php">Donate Now</a> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php include 'includes/footer.php'; ?> |
||||||
|
|
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 9.6 KiB |
@ -0,0 +1,255 @@ |
|||||||
|
<?php |
||||||
|
// Initialize form data array |
||||||
|
$formData = []; |
||||||
|
|
||||||
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
||||||
|
// Collect form data when the form is submitted |
||||||
|
// $formData['donorName'] = $_POST['donor-name']; |
||||||
|
// $formData['email'] = $_POST['email']; |
||||||
|
// $formData['clothesType'] = $_POST['clothes-type']; |
||||||
|
// $formData['clothesCondition'] = $_POST['clothes-condition']; |
||||||
|
// $formData['pickupLocation'] = $_POST['pickup-location']; |
||||||
|
// $formData['message'] = $_POST['message']; |
||||||
|
} |
||||||
|
?> |
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||||
|
<title>Clothes Donation</title> |
||||||
|
<!-- Bootstrap CDN --> |
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> |
||||||
|
<style> |
||||||
|
/* Your CSS styles here */ |
||||||
|
body { |
||||||
|
font-family: 'Arial', sans-serif; |
||||||
|
padding: 0; |
||||||
|
margin: 0; |
||||||
|
} |
||||||
|
|
||||||
|
#donation-form-page { |
||||||
|
padding: 60px 20px; |
||||||
|
} |
||||||
|
|
||||||
|
#donation-form { |
||||||
|
background: white; |
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); |
||||||
|
border-radius: 12px; |
||||||
|
padding: 30px; |
||||||
|
max-width: 700px; |
||||||
|
margin: auto; |
||||||
|
transition: all 0.3s ease; |
||||||
|
} |
||||||
|
|
||||||
|
#donation-form h2 { |
||||||
|
color: #333; |
||||||
|
font-weight: 600; |
||||||
|
margin-bottom: 20px; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
label { |
||||||
|
display: block; |
||||||
|
margin-top: 15px; |
||||||
|
font-weight: 600; |
||||||
|
color: #333; |
||||||
|
} |
||||||
|
|
||||||
|
input, select, textarea { |
||||||
|
width: 100%; |
||||||
|
padding: 12px; |
||||||
|
margin-top: 8px; |
||||||
|
border: 1px solid #ccc; |
||||||
|
border-radius: 8px; |
||||||
|
font-size: 1rem; |
||||||
|
transition: all 0.3s ease; |
||||||
|
} |
||||||
|
|
||||||
|
input:focus, select:focus, textarea:focus { |
||||||
|
border-color: #4CAF50; |
||||||
|
outline: none; |
||||||
|
box-shadow: 0 0 8px rgba(72, 185, 105, 0.4); |
||||||
|
} |
||||||
|
|
||||||
|
.form-control { |
||||||
|
transition: all 0.3s ease; |
||||||
|
} |
||||||
|
|
||||||
|
.form-control:hover { |
||||||
|
border-color: #45a049; |
||||||
|
} |
||||||
|
|
||||||
|
button { |
||||||
|
margin-top: 20px; |
||||||
|
padding: 12px 20px; |
||||||
|
font-size: 1rem; |
||||||
|
background-color: #4CAF50; |
||||||
|
color: white; |
||||||
|
border: none; |
||||||
|
border-radius: 6px; |
||||||
|
cursor: pointer; |
||||||
|
transition: background-color 0.3s ease, transform 0.2s; |
||||||
|
width: 100%; |
||||||
|
max-width: 200px; |
||||||
|
display: block; |
||||||
|
margin-left: auto; |
||||||
|
margin-right: auto; |
||||||
|
} |
||||||
|
|
||||||
|
button:hover { |
||||||
|
background-color: #45a049; |
||||||
|
transform: scale(1.05); |
||||||
|
} |
||||||
|
|
||||||
|
.fade-in { |
||||||
|
animation: fadeIn 1s ease-in; |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes fadeIn { |
||||||
|
from { |
||||||
|
opacity: 0; |
||||||
|
} |
||||||
|
to { |
||||||
|
opacity: 1; |
||||||
|
} |
||||||
|
} |
||||||
|
/* Adjusting the map container */ |
||||||
|
#map { |
||||||
|
width: 100%; /* Full width */ |
||||||
|
height: 400px; /* Adjust height as needed */ |
||||||
|
border: none; /* Remove border */ |
||||||
|
margin-bottom: 20px; /* Space below the map */ |
||||||
|
} |
||||||
|
|
||||||
|
.step-container { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
/* Full-width map */ |
||||||
|
#map { |
||||||
|
width: 100%; /* Full width */ |
||||||
|
height: 400px; /* Adjust height as needed */ |
||||||
|
border: none; /* Remove border */ |
||||||
|
margin-bottom: 20px; /* Space below the map */ |
||||||
|
} |
||||||
|
|
||||||
|
/* Mobile responsiveness */ |
||||||
|
@media (max-width: 768px) { |
||||||
|
.navbar { |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<section id="donation-form-page"> |
||||||
|
<div class="text-center fade-in"> |
||||||
|
<h1 class="display-4">Clothes Donation</h1> |
||||||
|
<p>Thank you for your willingness to donate clothes. Please fill in the form step by step.</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Step 1: Personal Information --> |
||||||
|
<div id="step-1" class="step-container fade-in" style="display: block;"> |
||||||
|
<h2>Your Information</h2> |
||||||
|
<form method="POST" action="clothes.php" id="donationForm"> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="donor-name" class="form-label">Your Name:</label> |
||||||
|
<input type="text" id="donor-name" name="donor-name" class="form-control" placeholder="Enter your full name" value="<?php echo isset($formData['donorName']) ? $formData['donorName'] : ''; ?>" required />
|
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="mb-3"> |
||||||
|
<label for="email" class="form-label">Email Address:</label> |
||||||
|
<input type="email" id="email" name="email" class="form-control" placeholder="Enter your email address" value="<?php echo isset($formData['email']) ? $formData['email'] : ''; ?>" required />
|
||||||
|
</div> |
||||||
|
|
||||||
|
<button type="submit" name="step" value="2">Next</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Step 2: Clothes Details --> |
||||||
|
<div id="step-2" class="step-container fade-in" style="display: <?php echo isset($_POST['step']) && $_POST['step'] == '2' ? 'block' : 'none'; ?>;">
|
||||||
|
<h2>Clothes Details</h2> |
||||||
|
<form method="POST" action="clothes.php" id="clothes-details-form"> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="clothes-type" class="form-label">Type of Clothes:</label> |
||||||
|
<select id="clothes-type" name="clothes-type" class="form-select" required> |
||||||
|
<option value="shirts" <?php echo (isset($formData['clothesType']) && $formData['clothesType'] == 'shirts') ? 'selected' : ''; ?>>Shirts</option>
|
||||||
|
<option value="pants" <?php echo (isset($formData['clothesType']) && $formData['clothesType'] == 'pants') ? 'selected' : ''; ?>>Pants</option>
|
||||||
|
<option value="jackets" <?php echo (isset($formData['clothesType']) && $formData['clothesType'] == 'jackets') ? 'selected' : ''; ?>>Jackets</option>
|
||||||
|
<option value="shoes" <?php echo (isset($formData['clothesType']) && $formData['clothesType'] == 'shoes') ? 'selected' : ''; ?>>Shoes</option>
|
||||||
|
<option value="others" <?php echo (isset($formData['clothesType']) && $formData['clothesType'] == 'others') ? 'selected' : ''; ?>>Others</option>
|
||||||
|
</select> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="mb-3"> |
||||||
|
<label for="clothes-condition" class="form-label">Condition of Clothes:</label> |
||||||
|
<select id="clothes-condition" name="clothes-condition" class="form-select" required> |
||||||
|
<option value="new" <?php echo (isset($formData['clothesCondition']) && $formData['clothesCondition'] == 'new') ? 'selected' : ''; ?>>New</option>
|
||||||
|
<option value="gently-used" <?php echo (isset($formData['clothesCondition']) && $formData['clothesCondition'] == 'gently-used') ? 'selected' : ''; ?>>Gently Used</option>
|
||||||
|
<option value="old" <?php echo (isset($formData['clothesCondition']) && $formData['clothesCondition'] == 'old') ? 'selected' : ''; ?>>Old</option>
|
||||||
|
</select> |
||||||
|
</div> |
||||||
|
|
||||||
|
<button type="submit" name="step" value="3">Next</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Step 3: Pickup Location and Message --> |
||||||
|
<div id="step-3" class="step-container fade-in" style="display: <?php echo isset($_POST['step']) && $_POST['step'] == '3' ? 'block' : 'none'; ?>;">
|
||||||
|
<h2>Pickup Details</h2> |
||||||
|
<form method="POST" action="clothes.php" id="pickup-details-form"> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="pickup-location" class="form-label">Pickup Location:</label> |
||||||
|
<input type="text" id="pickup-location" name="pickup-location" class="form-control" placeholder="Enter pickup address" value="<?php echo isset($formData['pickupLocation']) ? $formData['pickupLocation'] : ''; ?>" required />
|
||||||
|
</div> |
||||||
|
|
||||||
|
<div id="map"> |
||||||
|
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d14129.445442684992!2d85.333259!3d27.706127!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x39eb19a00bd8d7c1%3A0xe01225b704668023!2sLord%20Buddha%20Education%20Foundation-%20LBEF%20CAMPUS%20(The%20First%20IT%20College%20of%20Nepal)!5e0!3m2!1sen!2snp!4v1736672731872!5m2!1sen!2snp" width="1400" height="400" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="mb-3"> |
||||||
|
<label for="message" class="form-label">Message (Optional):</label> |
||||||
|
<textarea id="message" name="message" class="form-control" placeholder="Add a message" rows="4"><?php echo isset($formData['message']) ? $formData['message'] : ''; ?></textarea>
|
||||||
|
</div> |
||||||
|
|
||||||
|
<button type="submit" name="step" value="4">Next</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Step 4: Review and Download Receipt --> |
||||||
|
<div id="step-4" class="step-container fade-in" style="display: <?php echo isset($_POST['step']) && $_POST['step'] == '4' ? 'block' : 'none'; ?>;">
|
||||||
|
<h2>Review and Download Receipt</h2> |
||||||
|
<div id="review-details"> |
||||||
|
<h4>Your Details</h4> |
||||||
|
<p><strong>Name:</strong> <?php echo isset($formData['donorName']) ? $formData['donorName'] : ''; ?></p>
|
||||||
|
<p><strong>Email:</strong> <?php echo isset($formData['email']) ? $formData['email'] : ''; ?></p>
|
||||||
|
<p><strong>Clothes Type:</strong> <?php echo isset($formData['clothesType']) ? $formData['clothesType'] : ''; ?></p>
|
||||||
|
<p><strong>Clothes Condition:</strong> <?php echo isset($formData['clothesCondition']) ? $formData['clothesCondition'] : ''; ?></p>
|
||||||
|
<p><strong>Pickup Location:</strong> <?php echo isset($formData['pickupLocation']) ? $formData['pickupLocation'] : ''; ?></p>
|
||||||
|
<p><strong>Message:</strong> <?php echo isset($formData['message']) && $formData['message'] ? $formData['message'] : 'None'; ?></p>
|
||||||
|
</div> |
||||||
|
<button id="download-receipt" onclick="downloadReceipt()">Download Receipt</button> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<script> |
||||||
|
function downloadReceipt() { |
||||||
|
const { jsPDF } = window.jspdf; |
||||||
|
const doc = new jsPDF(); |
||||||
|
|
||||||
|
doc.text('Donation Receipt', 20, 20); |
||||||
|
doc.text(`Name: ${<?php echo json_encode($formData['donorName']); ?>}`, 20, 30);
|
||||||
|
doc.text(`Email: ${<?php echo json_encode($formData['email']); ?>}`, 20, 40);
|
||||||
|
doc.text(`Clothes Type: ${<?php echo json_encode($formData['clothesType']); ?>}`, 20, 50);
|
||||||
|
doc.text(`Clothes Condition: ${<?php echo json_encode($formData['clothesCondition']); ?>}`, 20, 60);
|
||||||
|
doc.text(`Pickup Location: ${<?php echo json_encode($formData['pickupLocation']); ?>}`, 20, 70);
|
||||||
|
doc.text(`Message: ${<?php echo json_encode($formData['message']); ?> || 'None'}`, 20, 80);
|
||||||
|
|
||||||
|
doc.save('donation-receipt.pdf'); |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,90 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Check if the user is logged in |
||||||
|
if (!isset($_SESSION['user_email'])) { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Get user details from the session |
||||||
|
$user_email = $_SESSION['user_email']; |
||||||
|
|
||||||
|
// Fetch user information from the database |
||||||
|
$stmt = $conn->prepare("SELECT * FROM users WHERE email = ?"); |
||||||
|
$stmt->bind_param("s", $user_email); |
||||||
|
echo"$user_email"; |
||||||
|
$stmt->execute(); |
||||||
|
$result = $stmt->get_result(); |
||||||
|
$user = $result->fetch_assoc(); |
||||||
|
|
||||||
|
if (!$user) { |
||||||
|
echo "User not found."; |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>User Dashboard</title> |
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<div class="container mt-5"> |
||||||
|
<h1>Welcome, <?= htmlspecialchars($user['first_name']) ?>!</h1>
|
||||||
|
<p>You are logged in as: <strong><?= htmlspecialchars($user['role']) ?></strong></p>
|
||||||
|
|
||||||
|
<hr> |
||||||
|
|
||||||
|
<h3>Your Details</h3> |
||||||
|
<table class="table table-bordered"> |
||||||
|
<tr> |
||||||
|
<th>Email</th> |
||||||
|
<td><?= htmlspecialchars($user['email']) ?></td>
|
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>First Name</th> |
||||||
|
<td><?= htmlspecialchars($user['first_name']) ?></td>
|
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>Last Name</th> |
||||||
|
<td><?= htmlspecialchars($user['last_name']) ?></td>
|
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>Phone</th> |
||||||
|
<td><?= htmlspecialchars($user['phone']) ?></td>
|
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>Role</th> |
||||||
|
<td><?= htmlspecialchars($user['role']) ?></td>
|
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<th>Account Created</th> |
||||||
|
<td><?= htmlspecialchars($user['created_at']) ?></td>
|
||||||
|
</tr> |
||||||
|
</table> |
||||||
|
|
||||||
|
<hr> |
||||||
|
|
||||||
|
<h3>Quick Actions</h3> |
||||||
|
<div class="d-flex gap-3"> |
||||||
|
<?php if ($user['role'] === 'donor'): ?> |
||||||
|
<a href="donate_material.php" class="btn btn-primary">Donate Material</a> |
||||||
|
<a href="donate_monetary.php" class="btn btn-success">Donate Money</a> |
||||||
|
<a href="donor_profile.php" class="btn btn-danger">Donate Blood</a> |
||||||
|
<?php elseif ($user['role'] === 'recipient'): ?> |
||||||
|
<a href="view_donations.php" class="btn btn-info">View Available Donations</a> |
||||||
|
<a href="submit_request.php" class="btn btn-warning">Submit a Request</a> |
||||||
|
<?php elseif ($user['role'] === 'admin'): ?> |
||||||
|
<a href="admin_dashboard.php" class="btn btn-secondary">Admin Dashboard</a> |
||||||
|
<?php endif; ?> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,12 @@ |
|||||||
|
<?php |
||||||
|
$servername = "localhost"; |
||||||
|
$username = "root"; |
||||||
|
$password = ""; |
||||||
|
$dbname = "donateease"; |
||||||
|
|
||||||
|
$conn = new mysqli($servername, $username, $password, $dbname); |
||||||
|
|
||||||
|
if ($conn->connect_error) { |
||||||
|
die("Connection failed: " . $conn->connect_error); |
||||||
|
} |
||||||
|
?> |
After Width: | Height: | Size: 48 KiB |
@ -0,0 +1,29 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Check if admin is logged in |
||||||
|
if (!isset($_SESSION['role']) || $_SESSION['role'] !== 'admin') { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Check if the user ID is provided |
||||||
|
if (isset($_GET['id'])) { |
||||||
|
$user_id = intval($_GET['id']); |
||||||
|
|
||||||
|
// Delete user |
||||||
|
$stmt = $conn->prepare("DELETE FROM users WHERE id = ?"); |
||||||
|
$stmt->bind_param("i", $user_id); |
||||||
|
|
||||||
|
if ($stmt->execute()) { |
||||||
|
header("Location: admin_dashboard.php"); |
||||||
|
exit; |
||||||
|
} else { |
||||||
|
echo "Error deleting user."; |
||||||
|
} |
||||||
|
} else { |
||||||
|
header("Location: admin_dashboard.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
?> |
@ -0,0 +1,133 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Disaster Relief</title> |
||||||
|
<h3><a href="index.php" class="button">Back To Home Page</a></h3> |
||||||
|
|
||||||
|
<style> |
||||||
|
body { |
||||||
|
font-family: 'Arial', sans-serif; |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
background-color: #f9f9f9; |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
align-items: center; |
||||||
|
height: 100vh; |
||||||
|
} |
||||||
|
|
||||||
|
.button { |
||||||
|
display: inline-block; |
||||||
|
padding: 15px 25px; |
||||||
|
font-size: 16px; |
||||||
|
color: rgb(16, 15, 15); |
||||||
|
background-color: #c1e8ad; |
||||||
|
border: none; |
||||||
|
border-radius: 5px; |
||||||
|
text-decoration: none; |
||||||
|
cursor: pointer; |
||||||
|
text-align: center; |
||||||
|
text-size-adjust: bold; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
.book-container { |
||||||
|
width: 80%; |
||||||
|
max-width: 1000px; |
||||||
|
height: 500px; |
||||||
|
background: #f4e3c1; |
||||||
|
border: 2px solid #d4af37; |
||||||
|
border-radius: 10px; |
||||||
|
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); |
||||||
|
display: flex; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.book-page { |
||||||
|
flex: 1; |
||||||
|
background: #ffffff; |
||||||
|
position: relative; |
||||||
|
padding: 20px; |
||||||
|
clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%); |
||||||
|
} |
||||||
|
|
||||||
|
.book-page::before { |
||||||
|
content: ""; |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
right: 0; |
||||||
|
width: 30%; |
||||||
|
height: 100%; |
||||||
|
background: #f4e3c1; |
||||||
|
box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.1); |
||||||
|
clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%); |
||||||
|
} |
||||||
|
|
||||||
|
.folded-paper { |
||||||
|
position: relative; |
||||||
|
background: #ffffff; |
||||||
|
width: 90%; |
||||||
|
height: 90%; |
||||||
|
margin: auto; |
||||||
|
padding: 20px; |
||||||
|
box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2); |
||||||
|
border-radius: 5px; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.folded-paper::after { |
||||||
|
content: ""; |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
right: 0; |
||||||
|
width: 50px; |
||||||
|
height: 50px; |
||||||
|
background: linear-gradient(135deg, #ffffff 50%, #f4e3c1 50%); |
||||||
|
clip-path: polygon(0 0, 100% 0, 0% 100%); |
||||||
|
} |
||||||
|
|
||||||
|
.content { |
||||||
|
font-size: 1.2em; |
||||||
|
line-height: 1.6; |
||||||
|
color: #333; |
||||||
|
text-align: justify; |
||||||
|
} |
||||||
|
|
||||||
|
.book-title { |
||||||
|
text-align: center; |
||||||
|
font-size: 2em; |
||||||
|
margin-bottom: 10px; |
||||||
|
color: #4dcf76; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div class="book-container"> |
||||||
|
<div class="book-page"> |
||||||
|
<div class="folded-paper"> |
||||||
|
<h1 class="book-title">Disaster Relief</h1> |
||||||
|
<div class="content"> |
||||||
|
<p> |
||||||
|
Natural disasters can strike anytime, leaving devastation in their wake. Immediate and effective disaster relief efforts |
||||||
|
are essential to saving lives and helping communities rebuild. |
||||||
|
</p> |
||||||
|
<p> |
||||||
|
<strong>Our Mission:</strong> |
||||||
|
<ul> |
||||||
|
<li>Provide emergency supplies like food, water, and shelter to affected areas.</li> |
||||||
|
<li>Support rebuilding efforts to restore homes and infrastructure.</li> |
||||||
|
<li>Facilitate medical aid and healthcare services for disaster victims.</li> |
||||||
|
<li>Offer long-term support for community resilience and preparedness.</li> |
||||||
|
</ul> |
||||||
|
</p> |
||||||
|
<p> |
||||||
|
Every donation makes a difference. Together, we can help communities recover and thrive after disasters. |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,68 @@ |
|||||||
|
/* Global Styles */ |
||||||
|
body { |
||||||
|
margin: 0; |
||||||
|
font-family: Arial, sans-serif; |
||||||
|
background-color: #f8f9fa; |
||||||
|
color: #333; |
||||||
|
} |
||||||
|
|
||||||
|
/* Navbar */ |
||||||
|
|
||||||
|
|
||||||
|
/* Main Content main */ |
||||||
|
.main { |
||||||
|
width: 80%; /* Limit the size of the main main */ |
||||||
|
max-width: 600px; /* Restrict the maximum width */ |
||||||
|
margin: 30px auto; /* Center the main horizontally */ |
||||||
|
text-align: center; |
||||||
|
background-color: white; /* Optional: background for the main */ |
||||||
|
padding: 20px; |
||||||
|
border-radius: 10px; |
||||||
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); |
||||||
|
} |
||||||
|
|
||||||
|
.main h1 { |
||||||
|
font-size: 1.8em; /* Slightly smaller title font size */ |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
/* Categories Section */ |
||||||
|
.categories { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(2, 1fr); /* Two columns */ |
||||||
|
gap: 15px; /* Smaller spacing between items */ |
||||||
|
justify-items: center; |
||||||
|
padding: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.category-box { |
||||||
|
background-color: #d6f5d6; |
||||||
|
border-radius: 10px; |
||||||
|
text-align: center; |
||||||
|
padding: 15px; |
||||||
|
width: 150px; /* Reduce the size of boxes */ |
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); |
||||||
|
cursor: pointer; |
||||||
|
transition: transform 0.3s, box-shadow 0.3s; |
||||||
|
} |
||||||
|
|
||||||
|
.category-box:hover { |
||||||
|
transform: translateY(-5px); |
||||||
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); |
||||||
|
} |
||||||
|
|
||||||
|
.category-box img { |
||||||
|
width: 80px; /* Smaller image */ |
||||||
|
height: 80px; |
||||||
|
object-fit: cover; |
||||||
|
margin-bottom: 10px; |
||||||
|
border-radius: 50%; |
||||||
|
} |
||||||
|
|
||||||
|
.category-box h2 { |
||||||
|
font-size: 1em; /* Reduce font size */ |
||||||
|
color: #333; |
||||||
|
margin-top: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
|
@ -0,0 +1,214 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Check if the user is logged in |
||||||
|
if (!isset($_SESSION['user_email'])) { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Retrieve logged-in user details |
||||||
|
$user_email = $_SESSION['user_email']; |
||||||
|
$stmt = $conn->prepare("SELECT id, first_name, last_name FROM users WHERE email = ?"); |
||||||
|
$stmt->bind_param("s", $user_email); |
||||||
|
$stmt->execute(); |
||||||
|
$result = $stmt->get_result(); |
||||||
|
$user = $result->fetch_assoc(); |
||||||
|
$user_id = $user['id']; |
||||||
|
$stmt->close(); |
||||||
|
|
||||||
|
// Handle form submission |
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
||||||
|
$item_name = $_POST['item_name']; |
||||||
|
$condition = $_POST['condition']; |
||||||
|
$quantity = $_POST['quantity']; |
||||||
|
$latitude = $_POST['latitude']; |
||||||
|
$longitude = $_POST['longitude']; |
||||||
|
|
||||||
|
// Validate inputs |
||||||
|
if (empty($item_name) || empty($condition) || empty($quantity) || empty($latitude) || empty($longitude)) { |
||||||
|
$error_message = "All fields are required, including location."; |
||||||
|
} else { |
||||||
|
// Insert donation into the database |
||||||
|
$stmt = $conn->prepare("INSERT INTO material_donations (donor_id, item_name, conditions, quantity, latitude, longitude, status) VALUES (?, ?, ?, ?, ?, ?, 'pending')"); |
||||||
|
|
||||||
|
if ($stmt) { |
||||||
|
$stmt->bind_param("issidd", $user_id, $item_name, $condition, $quantity, $latitude, $longitude); |
||||||
|
$execute = $stmt->execute(); |
||||||
|
|
||||||
|
if ($execute) { |
||||||
|
$success_message = "Your donation has been submitted successfully and is pending approval."; |
||||||
|
header("Location: dashboard.php"); // Redirect to the dashboard after successful submission |
||||||
|
exit; |
||||||
|
} else { |
||||||
|
$error_message = "Failed to submit your donation. Please try again. Error: " . $stmt->error; |
||||||
|
} |
||||||
|
} else { |
||||||
|
$error_message = "Failed to prepare SQL query. Please check your database connection."; |
||||||
|
} |
||||||
|
|
||||||
|
$stmt->close(); |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
|
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Donate Materials</title> |
||||||
|
<!-- Link to Bootstrap 5 CSS for a clean design --> |
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
<!-- Leaflet CSS for map --> |
||||||
|
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" /> |
||||||
|
<style> |
||||||
|
body { |
||||||
|
background-color: #f8f9fa; |
||||||
|
} |
||||||
|
|
||||||
|
.container { |
||||||
|
margin-top: 30px; |
||||||
|
padding: 30px; |
||||||
|
background-color: white; |
||||||
|
border-radius: 8px; |
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); |
||||||
|
} |
||||||
|
|
||||||
|
.map-container { |
||||||
|
height: 400px; |
||||||
|
width: 100%; |
||||||
|
border-radius: 8px; |
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); |
||||||
|
} |
||||||
|
|
||||||
|
.btn-submit { |
||||||
|
background-color: #007bff; |
||||||
|
color: white; |
||||||
|
} |
||||||
|
|
||||||
|
.btn-submit:hover { |
||||||
|
background-color: #0056b3; |
||||||
|
} |
||||||
|
|
||||||
|
.alert { |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.form-label { |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
</style> |
||||||
|
<script> |
||||||
|
// Function to get user location and update map |
||||||
|
function getLocation() { |
||||||
|
if (navigator.geolocation) { |
||||||
|
navigator.geolocation.getCurrentPosition(showPosition, showError); |
||||||
|
} else { |
||||||
|
alert("Geolocation is not supported by this browser."); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function showPosition(position) { |
||||||
|
const latitude = position.coords.latitude; |
||||||
|
const longitude = position.coords.longitude; |
||||||
|
|
||||||
|
// Update hidden fields with the latitude and longitude |
||||||
|
document.getElementById("latitude").value = latitude; |
||||||
|
document.getElementById("longitude").value = longitude; |
||||||
|
|
||||||
|
// Update map with user location |
||||||
|
var map = L.map('map').setView([latitude, longitude], 13); |
||||||
|
|
||||||
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
||||||
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' |
||||||
|
}).addTo(map); |
||||||
|
|
||||||
|
L.marker([latitude, longitude]).addTo(map) |
||||||
|
.bindPopup("Your Location") |
||||||
|
.openPopup(); |
||||||
|
} |
||||||
|
|
||||||
|
function showError(error) { |
||||||
|
switch (error.code) { |
||||||
|
case error.PERMISSION_DENIED: |
||||||
|
alert("User denied the request for Geolocation."); |
||||||
|
break; |
||||||
|
case error.POSITION_UNAVAILABLE: |
||||||
|
alert("Location information is unavailable."); |
||||||
|
break; |
||||||
|
case error.TIMEOUT: |
||||||
|
alert("The request to get user location timed out."); |
||||||
|
break; |
||||||
|
case error.UNKNOWN_ERROR: |
||||||
|
alert("An unknown error occurred."); |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// Trigger location fetching when the page loads |
||||||
|
window.onload = getLocation; |
||||||
|
</script> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<div class="container"> |
||||||
|
<h2 class="text-center mb-4">Donate Materials</h2> |
||||||
|
|
||||||
|
<!-- Display success or error messages --> |
||||||
|
<?php if (isset($success_message)): ?> |
||||||
|
<div class="alert alert-success"> |
||||||
|
<?php echo $success_message; ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<?php if (isset($error_message)): ?> |
||||||
|
<div class="alert alert-danger"> |
||||||
|
<?php echo $error_message; ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<form method="POST" action="material_donations.php"> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="item_name" class="form-label">Item Name</label> |
||||||
|
<input type="text" name="item_name" id="item_name" class="form-control" required> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="mb-3"> |
||||||
|
<label for="condition" class="form-label">Condition</label> |
||||||
|
<select name="condition" id="condition" class="form-select" required> |
||||||
|
<option value="">Select Condition</option> |
||||||
|
<option value="New">New</option> |
||||||
|
<option value="Good">Good</option> |
||||||
|
<option value="Used">Used</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="mb-3"> |
||||||
|
<label for="quantity" class="form-label">Quantity</label> |
||||||
|
<input type="number" name="quantity" id="quantity" class="form-control" min="1" required> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Hidden fields to store latitude and longitude --> |
||||||
|
<input type="hidden" name="latitude" id="latitude" required> |
||||||
|
<input type="hidden" name="longitude" id="longitude" required> |
||||||
|
|
||||||
|
<div id="map" class="map-container"></div> |
||||||
|
|
||||||
|
<div class="d-flex justify-content-center mt-4"> |
||||||
|
<button type="submit" class="btn btn-submit px-4 py-2">Submit Donation</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php include 'includes/footer.php'; ?> |
||||||
|
|
||||||
|
<!-- Leaflet JS for map functionality --> |
||||||
|
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script> |
||||||
|
</body> |
||||||
|
|
||||||
|
</html> |
@ -0,0 +1,145 @@ |
|||||||
|
<?php |
||||||
|
// Handle form submission (if needed) |
||||||
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
||||||
|
// Collect form data |
||||||
|
// $food_type = $_POST['food-type']; |
||||||
|
// $quantity = $_POST['quantity']; |
||||||
|
// $pickup = $_POST['pickup']; |
||||||
|
// $pickup_address = $_POST['pickup-address']; |
||||||
|
// $comments = $_POST['comments']; |
||||||
|
|
||||||
|
// You can process or store the data here, such as saving it to a database |
||||||
|
// For now, let's display a thank-you message |
||||||
|
// echo "<p>Thank you for your donation of $quantity units of $food_type.</p>"; |
||||||
|
// echo "<p>Pickup Address: $pickup_address</p>"; |
||||||
|
// echo "<p>Preferred Pickup Time: $pickup</p>"; |
||||||
|
// echo "<p>Additional Comments: $comments</p>"; |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||||
|
<title>Donate to Organization</title> |
||||||
|
<style> |
||||||
|
body { |
||||||
|
margin: 0; |
||||||
|
font-family: Arial, sans-serif; |
||||||
|
color: #333; /* Dark green text */ |
||||||
|
} |
||||||
|
header { |
||||||
|
text-align: center; |
||||||
|
padding: 20px; |
||||||
|
} |
||||||
|
h1 { |
||||||
|
color: #5cae5c; /* Medium green for the title */ |
||||||
|
} |
||||||
|
h2 { |
||||||
|
color: #4cae4c; /* Slightly lighter green for section headings */ |
||||||
|
} |
||||||
|
p { |
||||||
|
color: #555; /* Darker grey for paragraph text */ |
||||||
|
} |
||||||
|
#donation-form { |
||||||
|
max-width: 600px; |
||||||
|
margin: 20px auto; |
||||||
|
padding: 20px; |
||||||
|
background-color: #ffffff; /* White background for the form */ |
||||||
|
border-radius: 8px; |
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
||||||
|
} |
||||||
|
label { |
||||||
|
display: block; |
||||||
|
margin-bottom: 5px; |
||||||
|
font-weight: bold; |
||||||
|
color: #2d572c; /* Dark green for labels */ |
||||||
|
} |
||||||
|
select, |
||||||
|
input[type="text"], |
||||||
|
input[type="number"], |
||||||
|
input[type="datetime-local"], |
||||||
|
textarea { |
||||||
|
width: 100%; |
||||||
|
padding: 10px; |
||||||
|
border: 1px solid #b2d3b2; /* Light green border */ |
||||||
|
border-radius: 4px; |
||||||
|
font-size: 16px; |
||||||
|
margin-bottom: 15px; |
||||||
|
} |
||||||
|
button { |
||||||
|
width: 100%; |
||||||
|
padding: 10px; |
||||||
|
background-color: #5cb85c; /* Button green */ |
||||||
|
color: #ffffff; /* White text on button */ |
||||||
|
border: none; |
||||||
|
border-radius: 4px; |
||||||
|
font-size: 18px; |
||||||
|
font-weight: bold; |
||||||
|
cursor: pointer; |
||||||
|
transition: background-color 0.3s ease; |
||||||
|
} |
||||||
|
button:hover { |
||||||
|
background-color: #4cae4c; /* Darker green on hover */ |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<section id="donation-form-page"> |
||||||
|
<header> |
||||||
|
<h1> |
||||||
|
Donate to <span id="organization-name-display">Organization</span> |
||||||
|
</h1> |
||||||
|
<p> |
||||||
|
Thank you for your willingness to help. Please fill out the donation |
||||||
|
details below. |
||||||
|
</p> |
||||||
|
</header> |
||||||
|
|
||||||
|
<!-- Donation Form --> |
||||||
|
<div id="donation-form"> |
||||||
|
<h2>Donate Food</h2> |
||||||
|
<form id="donationForm" action="thankyou.php" method="POST"> |
||||||
|
<label for="food-type">Food Type:</label> |
||||||
|
<select id="food-type" name="food-type" required> |
||||||
|
<option value="canned">Canned Goods</option> |
||||||
|
<option value="fresh">Fresh Produce</option> |
||||||
|
<option value="prepared">Prepared Meals</option> |
||||||
|
</select> |
||||||
|
|
||||||
|
<label for="quantity">Quantity:</label> |
||||||
|
<input |
||||||
|
type="number" |
||||||
|
id="quantity" |
||||||
|
name="quantity" |
||||||
|
placeholder="Enter quantity" |
||||||
|
required |
||||||
|
/> |
||||||
|
|
||||||
|
<label for="pickup">Preferred Pickup/Drop-off Time:</label> |
||||||
|
<input type="datetime-local" id="pickup" name="pickup" required /> |
||||||
|
|
||||||
|
<label for="pickup-address">Pickup Address:</label> |
||||||
|
<input |
||||||
|
type="text" |
||||||
|
id="pickup-address" |
||||||
|
name="pickup-address" |
||||||
|
placeholder="Enter pickup address" |
||||||
|
required |
||||||
|
/> |
||||||
|
|
||||||
|
<label for="comments">Additional Comments:</label> |
||||||
|
<textarea |
||||||
|
id="comments" |
||||||
|
name="comments" |
||||||
|
placeholder="Any additional information" |
||||||
|
rows="4" |
||||||
|
></textarea> |
||||||
|
|
||||||
|
<button type="submit">Submit Donation</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,77 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Ensure the user is logged in |
||||||
|
if (!isset($_SESSION['user_email'])) { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Get the logged-in user's ID and role |
||||||
|
$user_id = $_SESSION['user_id']; |
||||||
|
$role = $_SESSION['role']; |
||||||
|
|
||||||
|
// Query the database based on the user's role |
||||||
|
if ($role === 'donor') { |
||||||
|
// Fetch donations made by the logged-in donor |
||||||
|
$stmt = $conn->prepare("SELECT * FROM material_donations WHERE user_id = ?"); |
||||||
|
$stmt->bind_param("i", $user_id); |
||||||
|
$stmt->execute(); |
||||||
|
$result = $stmt->get_result(); |
||||||
|
$donations = $result->fetch_all(MYSQLI_ASSOC); |
||||||
|
} elseif ($role === 'recipient') { |
||||||
|
// Fetch donations available for the recipient (donations by other users) |
||||||
|
$stmt = $conn->prepare("SELECT * FROM material_donations WHERE user_id != ?"); |
||||||
|
$stmt->bind_param("i", $user_id); |
||||||
|
$stmt->execute(); |
||||||
|
$result = $stmt->get_result(); |
||||||
|
$donations = $result->fetch_all(MYSQLI_ASSOC); |
||||||
|
} else { |
||||||
|
// If the user is neither donor nor recipient (should not happen) |
||||||
|
echo "Invalid role."; |
||||||
|
exit; |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Donation List</title> |
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<div class="container mt-5"> |
||||||
|
<h2><?php echo $role === 'donor' ? 'Your Donation List' : 'Available Donations for You'; ?></h2>
|
||||||
|
|
||||||
|
<?php if (empty($donations)): ?> |
||||||
|
<div class="alert alert-info">No donations available.</div> |
||||||
|
<?php else: ?> |
||||||
|
<table class="table table-bordered"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>Item Name</th> |
||||||
|
<th>Condition</th> |
||||||
|
<th>Quantity</th> |
||||||
|
<th>Notes</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<?php foreach ($donations as $donation): ?> |
||||||
|
<tr> |
||||||
|
<td><?php echo htmlspecialchars($donation['item_name']); ?></td>
|
||||||
|
<td><?php echo htmlspecialchars($donation['condition']); ?></td>
|
||||||
|
<td><?php echo htmlspecialchars($donation['quantity']); ?></td>
|
||||||
|
<td><?php echo htmlspecialchars($donation['notes']); ?></td>
|
||||||
|
</tr> |
||||||
|
<?php endforeach; ?> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
<?php endif; ?> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,61 @@ |
|||||||
|
|
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||||
|
<title>Donation Categories</title> |
||||||
|
<link rel="stylesheet" href="donate1.css" /> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<!-- Navbar Section --> |
||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<!-- Main Content Section --> |
||||||
|
<div class="container main mt-5"> |
||||||
|
<h1 class="text-center">Choose Donation Category</h1> |
||||||
|
<div class="categories row justify-content-center"> |
||||||
|
<!-- Food Box --> |
||||||
|
<div |
||||||
|
class="category-box col-md-3" |
||||||
|
onclick="window.location.href='fooddonation.php';" |
||||||
|
> |
||||||
|
<img src="foods.jpg" alt="Food Donation" class="img-fluid" /> |
||||||
|
<h2>Food</h2> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Monetary Box --> |
||||||
|
<div |
||||||
|
class="category-box col-md-3" |
||||||
|
onclick="window.location.href='monetary.php';" |
||||||
|
> |
||||||
|
<img src="money.jpg" alt="Monetary Donation" class="img-fluid" /> |
||||||
|
<h2>Monetary</h2> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Blood Box --> |
||||||
|
<div class="category-box col-md-3" onclick="window.location.href='blood.php';"> |
||||||
|
<img src="bloods.png" alt="Blood Donation" class="img-fluid" /> |
||||||
|
<h2>Blood</h2> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Clothes Box --> |
||||||
|
<div |
||||||
|
class="category-box col-md-3" |
||||||
|
onclick="window.location.href='clothes.php';" |
||||||
|
> |
||||||
|
<img src="clothes.jpg" alt="Clothes Donation" class="img-fluid" /> |
||||||
|
<h2>Clothes</h2> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<br /> |
||||||
|
<br /> |
||||||
|
<br /> |
||||||
|
|
||||||
|
<!-- Optional Footer Section --> |
||||||
|
<?php include 'includes/footer.php'; ?> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,108 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Check if the user is logged in |
||||||
|
if (!isset($_SESSION['user_email'])) { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Retrieve logged-in user details |
||||||
|
$user_email = $_SESSION['user_email']; |
||||||
|
$stmt = $conn->prepare("SELECT id, first_name, last_name FROM users WHERE email = ?"); |
||||||
|
$stmt->bind_param("s", $user_email); |
||||||
|
$stmt->execute(); |
||||||
|
$result = $stmt->get_result(); |
||||||
|
$user = $result->fetch_assoc(); |
||||||
|
$user_id = $user['id']; |
||||||
|
$stmt->close(); |
||||||
|
|
||||||
|
// Handle form submission |
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
||||||
|
$blood_type = $_POST['blood_type']; |
||||||
|
$availability = $_POST['availability']; |
||||||
|
$last_donation_date = $_POST['last_donation_date']; |
||||||
|
|
||||||
|
// Validate inputs |
||||||
|
if (empty($blood_type) || empty($availability) || empty($last_donation_date)) { |
||||||
|
$error_message = "All fields are required."; |
||||||
|
} else { |
||||||
|
// Insert donor profile into the database |
||||||
|
$stmt = $conn->prepare("INSERT INTO blood_donors (donor_id, blood_type, availability, last_donation_date) VALUES (?, ?, ?, ?)"); |
||||||
|
$stmt->bind_param("isss", $user_id, $blood_type, $availability, $last_donation_date); |
||||||
|
|
||||||
|
if ($stmt->execute()) { |
||||||
|
$success_message = "Your donor profile has been created successfully."; |
||||||
|
} else { |
||||||
|
$error_message = "Failed to create your donor profile. Please try again."; |
||||||
|
} |
||||||
|
|
||||||
|
$stmt->close(); |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
|
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Donor Profile</title> |
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<div class="container mt-4"> |
||||||
|
<h2>Create Donor Profile</h2> |
||||||
|
|
||||||
|
<!-- Display success or error messages --> |
||||||
|
<?php if (isset($success_message)): ?> |
||||||
|
<div class="alert alert-success"> |
||||||
|
<?php echo $success_message; ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<?php if (isset($error_message)): ?> |
||||||
|
<div class="alert alert-danger"> |
||||||
|
<?php echo $error_message; ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<form method="POST" action="donor_profile.php"> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="blood_type" class="form-label">Blood Type</label> |
||||||
|
<select name="blood_type" id="blood_type" class="form-select" required> |
||||||
|
<option value="">Select Blood Type</option> |
||||||
|
<option value="A+">A+</option> |
||||||
|
<option value="A-">A-</option> |
||||||
|
<option value="B+">B+</option> |
||||||
|
<option value="B-">B-</option> |
||||||
|
<option value="O+">O+</option> |
||||||
|
<option value="O-">O-</option> |
||||||
|
<option value="AB+">AB+</option> |
||||||
|
<option value="AB-">AB-</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="mb-3"> |
||||||
|
<label for="availability" class="form-label">Availability</label> |
||||||
|
<textarea name="availability" id="availability" class="form-control" rows="3" required></textarea> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="mb-3"> |
||||||
|
<label for="last_donation_date" class="form-label">Last Donation Date</label> |
||||||
|
<input type="date" name="last_donation_date" id="last_donation_date" class="form-control" required> |
||||||
|
</div> |
||||||
|
|
||||||
|
<button type="submit" class="btn btn-primary">Create Profile</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php include 'includes/footer.php'; ?> |
||||||
|
</body> |
||||||
|
|
||||||
|
</html> |
@ -0,0 +1,87 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Check if admin is logged in |
||||||
|
if (!isset($_SESSION['role']) || $_SESSION['role'] !== 'admin') { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Check if the user ID is provided |
||||||
|
if (isset($_GET['id'])) { |
||||||
|
$user_id = intval($_GET['id']); |
||||||
|
$user = $conn->query("SELECT * FROM users WHERE id = $user_id")->fetch_assoc(); |
||||||
|
|
||||||
|
if (!$user) { |
||||||
|
echo "User not found."; |
||||||
|
exit; |
||||||
|
} |
||||||
|
} else { |
||||||
|
header("Location: admin_dashboard.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Update user details on form submission |
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
||||||
|
$email = $_POST['email']; |
||||||
|
$role = $_POST['role']; |
||||||
|
$first_name = $_POST['first_name']; |
||||||
|
$last_name = $_POST['last_name']; |
||||||
|
$phone = $_POST['phone']; |
||||||
|
|
||||||
|
$stmt = $conn->prepare("UPDATE users SET email = ?, role = ?, first_name = ?, last_name = ?, phone = ? WHERE id = ?"); |
||||||
|
$stmt->bind_param("sssssi", $email, $role, $first_name, $last_name, $phone, $user_id); |
||||||
|
|
||||||
|
if ($stmt->execute()) { |
||||||
|
header("Location: admin_dashboard.php"); |
||||||
|
exit; |
||||||
|
} else { |
||||||
|
echo "Error updating user."; |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Edit User</title> |
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<div class="container mt-5"> |
||||||
|
<h1>Edit User</h1> |
||||||
|
<form method="POST"> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="email" class="form-label">Email</label> |
||||||
|
<input type="email" class="form-control" id="email" name="email" value="<?= htmlspecialchars($user['email']) ?>" required>
|
||||||
|
</div> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="role" class="form-label">Role</label> |
||||||
|
<select class="form-select" id="role" name="role" required> |
||||||
|
<option value="donor" <?= $user['role'] === 'donor' ? 'selected' : '' ?>>Donor</option>
|
||||||
|
<option value="recipient" <?= $user['role'] === 'recipient' ? 'selected' : '' ?>>Recipient</option>
|
||||||
|
<option value="admin" <?= $user['role'] === 'admin' ? 'selected' : '' ?>>Admin</option>
|
||||||
|
</select> |
||||||
|
</div> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="first_name" class="form-label">First Name</label> |
||||||
|
<input type="text" class="form-control" id="first_name" name="first_name" value="<?= htmlspecialchars($user['first_name']) ?>">
|
||||||
|
</div> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="last_name" class="form-label">Last Name</label> |
||||||
|
<input type="text" class="form-control" id="last_name" name="last_name" value="<?= htmlspecialchars($user['last_name']) ?>">
|
||||||
|
</div> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="phone" class="form-label">Phone</label> |
||||||
|
<input type="text" class="form-control" id="phone" name="phone" value="<?= htmlspecialchars($user['phone']) ?>">
|
||||||
|
</div> |
||||||
|
<button type="submit" class="btn btn-primary">Update User</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,129 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Education for All</title> |
||||||
|
<h3><a href="index.php" class="button">Back To Home Page</a></h3> |
||||||
|
|
||||||
|
<style> |
||||||
|
body { |
||||||
|
font-family: 'Arial', sans-serif; |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
background-color: #f9f9f9; |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
align-items: center; |
||||||
|
height: 100vh; |
||||||
|
} |
||||||
|
|
||||||
|
.button { |
||||||
|
display: inline-block; |
||||||
|
padding: 15px 25px; |
||||||
|
font-size: 16px; |
||||||
|
color: rgb(16, 15, 15); |
||||||
|
background-color: #c1e8ad; |
||||||
|
border: none; |
||||||
|
border-radius: 5px; |
||||||
|
text-decoration: none; |
||||||
|
cursor: pointer; |
||||||
|
text-align: center; |
||||||
|
text-size-adjust: bold; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
.book-container { |
||||||
|
width: 80%; |
||||||
|
max-width: 1000px; |
||||||
|
height: 500px; |
||||||
|
background: #f4e3c1; |
||||||
|
border: 2px solid #d4af37; |
||||||
|
border-radius: 10px; |
||||||
|
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); |
||||||
|
display: flex; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.book-page { |
||||||
|
flex: 1; |
||||||
|
background: #ffffff; |
||||||
|
position: relative; |
||||||
|
padding: 20px; |
||||||
|
clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%); |
||||||
|
} |
||||||
|
|
||||||
|
.book-page::before { |
||||||
|
content: ""; |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
right: 0; |
||||||
|
width: 30%; |
||||||
|
height: 100%; |
||||||
|
background: #f4e3c1; |
||||||
|
box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.1); |
||||||
|
clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%); |
||||||
|
} |
||||||
|
|
||||||
|
.folded-paper { |
||||||
|
position: relative; |
||||||
|
background: #ffffff; |
||||||
|
width: 90%; |
||||||
|
height: 90%; |
||||||
|
margin: auto; |
||||||
|
padding: 20px; |
||||||
|
box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2); |
||||||
|
border-radius: 5px; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.folded-paper::after { |
||||||
|
content: ""; |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
right: 0; |
||||||
|
width: 50px; |
||||||
|
height: 50px; |
||||||
|
background: linear-gradient(135deg, #ffffff 50%, #f4e3c1 50%); |
||||||
|
clip-path: polygon(0 0, 100% 0, 0% 100%); |
||||||
|
} |
||||||
|
|
||||||
|
.content { |
||||||
|
font-size: 1.2em; |
||||||
|
line-height: 1.6; |
||||||
|
color: #333; |
||||||
|
text-align: justify; |
||||||
|
} |
||||||
|
|
||||||
|
.book-title { |
||||||
|
text-align: center; |
||||||
|
font-size: 2em; |
||||||
|
margin-bottom: 10px; |
||||||
|
color: #4dcf76; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div class="book-container"> |
||||||
|
<div class="book-page"> |
||||||
|
<div class="folded-paper"> |
||||||
|
<h1 class="book-title">Education for All</h1> |
||||||
|
<div class="content"> |
||||||
|
<p> |
||||||
|
Education is the foundation for a brighter future. It empowers individuals to achieve their full potential and creates opportunities for economic and social development. |
||||||
|
</p> |
||||||
|
<p> |
||||||
|
<strong>Our Goals:</strong> |
||||||
|
<ul> |
||||||
|
<li>Provide access to quality education for underprivileged children.</li> |
||||||
|
<li>Build schools in remote areas.</li> |
||||||
|
<li>Offer scholarships for deserving students.</li> |
||||||
|
<li>Promote adult literacy programs worldwide.</li> |
||||||
|
</ul> |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,131 @@ |
|||||||
|
<?php |
||||||
|
// You can add PHP processing here if needed |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||||
|
<title>Food Donation</title> |
||||||
|
<style> |
||||||
|
/* General Styles */ |
||||||
|
body { |
||||||
|
margin: 0; |
||||||
|
font-family: Arial, sans-serif; |
||||||
|
background-color: #f7f9f7; /* Light background color */ |
||||||
|
color: #333; /* Dark text color for better readability */ |
||||||
|
} |
||||||
|
|
||||||
|
/* Header Section */ |
||||||
|
header { |
||||||
|
padding: 40px; |
||||||
|
color: rgb(10, 10, 10); /* White text in header */ |
||||||
|
text-align: center; /* Center header content */ |
||||||
|
border-bottom: 4px solid #5cae5c; /* Darker green bottom border */ |
||||||
|
} |
||||||
|
|
||||||
|
h1 { |
||||||
|
font-size: 40px; /* Larger font size for the main title */ |
||||||
|
margin: 0; /* Remove default margin */ |
||||||
|
} |
||||||
|
|
||||||
|
p { |
||||||
|
font-size: 20px; /* Font size for the description */ |
||||||
|
margin: 10px 0 0; /* Add margin for spacing */ |
||||||
|
} |
||||||
|
|
||||||
|
/* Organization Selection Section */ |
||||||
|
#organization-selection { |
||||||
|
padding: 20px; |
||||||
|
background-color: white; /* White background for contrast */ |
||||||
|
border-radius: 8px; /* Rounded corners */ |
||||||
|
max-width: 500px; /* Limit width */ |
||||||
|
margin: 40px auto; /* Center on the page with space above and below */ |
||||||
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */ |
||||||
|
} |
||||||
|
|
||||||
|
h2 { |
||||||
|
font-size: 28px; /* Font size for section title */ |
||||||
|
margin-bottom: 15px; /* Margin below the title */ |
||||||
|
color: #77c774; /* Green color for section title */ |
||||||
|
} |
||||||
|
|
||||||
|
label { |
||||||
|
font-size: 16px; /* Font size for labels */ |
||||||
|
display: block; /* Display labels as block elements */ |
||||||
|
margin-bottom: 5px; /* Margin below labels */ |
||||||
|
color: #555; /* Dark grey color for labels */ |
||||||
|
} |
||||||
|
|
||||||
|
input[type="text"] { |
||||||
|
width: 100%; /* Full width input */ |
||||||
|
padding: 7px; /* Padding for input */ |
||||||
|
margin-bottom: 15px; /* Margin below input */ |
||||||
|
border: 1px solid #ccc; /* Light grey border */ |
||||||
|
border-radius: 4px; /* Rounded corners */ |
||||||
|
font-size: 16px; /* Font size for input */ |
||||||
|
transition: border-color 0.3s ease; /* Smooth transition for border */ |
||||||
|
} |
||||||
|
|
||||||
|
input[type="text"]:focus { |
||||||
|
border-color: #77c774; /* Change border color on focus */ |
||||||
|
outline: none; /* Remove default outline */ |
||||||
|
} |
||||||
|
|
||||||
|
button { |
||||||
|
background-color: #5cae5c; /* Darker green button */ |
||||||
|
color: white; /* White text on button */ |
||||||
|
padding: 12px 20px; /* Padding for button */ |
||||||
|
border: none; /* Remove default border */ |
||||||
|
border-radius: 4px; /* Rounded corners */ |
||||||
|
font-size: 18px; /* Font size for button */ |
||||||
|
cursor: pointer; /* Pointer cursor on hover */ |
||||||
|
transition: background-color 0.3s ease; /* Smooth transition */ |
||||||
|
width: 100%; /* Full width button */ |
||||||
|
} |
||||||
|
|
||||||
|
button:hover { |
||||||
|
background-color: #4a9a4a; /* Darker green on hover */ |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<section id="food-page"> |
||||||
|
<header> |
||||||
|
<h1>Food Donation</h1> |
||||||
|
<p> |
||||||
|
Join us in helping those in need by donating food and making a |
||||||
|
difference in our community. |
||||||
|
</p> |
||||||
|
</header> |
||||||
|
|
||||||
|
<!-- Organization Selection --> |
||||||
|
<div id="organization-selection"> |
||||||
|
<h2>Enter Organization/Orphanage Name</h2> |
||||||
|
<form action="donation-forn.php" method="POST"> |
||||||
|
<label for="organization-name">Organization Name:</label> |
||||||
|
<input |
||||||
|
type="text" |
||||||
|
id="organization-name" |
||||||
|
name="organization-name" |
||||||
|
placeholder="Enter organization name" |
||||||
|
required |
||||||
|
/> |
||||||
|
|
||||||
|
<button type="submit" >Proceed to Donation</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
</body> |
||||||
|
</html> |
||||||
|
|
||||||
|
<?php |
||||||
|
// Handle form submission |
||||||
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
||||||
|
$organization_name = $_POST['organization-name']; |
||||||
|
|
||||||
|
// You can process or store the submitted data here, e.g., store in the database |
||||||
|
echo "<p>Thank you for selecting: $organization_name</p>"; |
||||||
|
} |
||||||
|
?> |
@ -0,0 +1,133 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Health Access for All</title> |
||||||
|
|
||||||
|
<h3><a href="index.php" class="button">Back To Home Page</a></h3> |
||||||
|
|
||||||
|
<style> |
||||||
|
body { |
||||||
|
font-family: 'Arial', sans-serif; |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
background-color: #f9f9f9; |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
align-items: center; |
||||||
|
height: 100vh; |
||||||
|
} |
||||||
|
|
||||||
|
.button { |
||||||
|
display: inline-block; |
||||||
|
padding: 15px 25px; |
||||||
|
font-size: 16px; |
||||||
|
color: rgb(16, 15, 15); |
||||||
|
background-color: #c1e8ad; |
||||||
|
border: none; |
||||||
|
border-radius: 5px; |
||||||
|
text-decoration: none; |
||||||
|
cursor: pointer; |
||||||
|
text-align: center; |
||||||
|
text-size-adjust: bold; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
.book-container { |
||||||
|
width: 80%; |
||||||
|
max-width: 1000px; |
||||||
|
height: 500px; |
||||||
|
background: #f4e3c1; |
||||||
|
border: 2px solid #d4af37; |
||||||
|
border-radius: 10px; |
||||||
|
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); |
||||||
|
display: flex; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.book-page { |
||||||
|
flex: 1; |
||||||
|
background: #ffffff; |
||||||
|
position: relative; |
||||||
|
padding: 20px; |
||||||
|
clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%); |
||||||
|
} |
||||||
|
|
||||||
|
.book-page::before { |
||||||
|
content: ""; |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
right: 0; |
||||||
|
width: 30%; |
||||||
|
height: 100%; |
||||||
|
background: #f4e3c1; |
||||||
|
box-shadow: inset -2px 0 4px rgba(0, 0, 0, 0.1); |
||||||
|
clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%); |
||||||
|
} |
||||||
|
|
||||||
|
.folded-paper { |
||||||
|
position: relative; |
||||||
|
background: #ffffff; |
||||||
|
width: 90%; |
||||||
|
height: 90%; |
||||||
|
margin: auto; |
||||||
|
padding: 20px; |
||||||
|
box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2); |
||||||
|
border-radius: 5px; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.folded-paper::after { |
||||||
|
content: ""; |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
right: 0; |
||||||
|
width: 50px; |
||||||
|
height: 50px; |
||||||
|
background: linear-gradient(135deg, #ffffff 50%, #f4e3c1 50%); |
||||||
|
clip-path: polygon(0 0, 100% 0, 0% 100%); |
||||||
|
} |
||||||
|
|
||||||
|
.content { |
||||||
|
font-size: 1.2em; |
||||||
|
line-height: 1.6; |
||||||
|
color: #333; |
||||||
|
text-align: justify; |
||||||
|
} |
||||||
|
|
||||||
|
.book-title { |
||||||
|
text-align: center; |
||||||
|
font-size: 2em; |
||||||
|
margin-bottom: 10px; |
||||||
|
color: #4dcf76; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div class="book-container"> |
||||||
|
<div class="book-page"> |
||||||
|
<div class="folded-paper"> |
||||||
|
<h1 class="book-title">Health Access for All</h1> |
||||||
|
<div class="content"> |
||||||
|
<p> |
||||||
|
Access to healthcare is a fundamental right that ensures the well-being of every individual. Together, we can make essential health services available to underserved communities. |
||||||
|
</p> |
||||||
|
<p> |
||||||
|
<strong>Our Objectives:</strong> |
||||||
|
<ul> |
||||||
|
<li>Deliver medical supplies to remote and underserved regions.</li> |
||||||
|
<li>Provide free health checkups and preventive care.</li> |
||||||
|
<li>Support vaccination drives to combat preventable diseases.</li> |
||||||
|
<li>Empower local healthcare workers with training and resources.</li> |
||||||
|
</ul> |
||||||
|
</p> |
||||||
|
<p> |
||||||
|
By supporting health access initiatives, you are contributing to saving lives, improving health, and building stronger communities. |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 7.9 KiB |
@ -0,0 +1,9 @@ |
|||||||
|
<footer class="bg-light text-center py-3 mt-5"> |
||||||
|
<div class="container"> |
||||||
|
<p class="mb-0">© 2025 DonateEase. All Rights Reserved.</p> |
||||||
|
</div> |
||||||
|
</footer> |
||||||
|
<!-- Bootstrap JavaScript --> |
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,60 @@ |
|||||||
|
<?php if (isset($_SESSION['user_email'])): ?> |
||||||
|
<!-- <li class="nav-item"> |
||||||
|
<a class="nav-link" href="dashboard.php">Dashboard</a> |
||||||
|
</li> |
||||||
|
<li class="nav-item"> |
||||||
|
<a class="nav-link" href="donate_material.php">Donate Material</a> |
||||||
|
</li> --> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>DonateEase</title> |
||||||
|
<!-- Bootstrap CSS --> |
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
<!-- Custom CSS --> |
||||||
|
<link rel="stylesheet" href="../assets/css/style.css"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<nav class="navbar navbar-expand-lg navbar-light bg-light"> |
||||||
|
<div class="container"> |
||||||
|
<a class="navbar-brand" href="index.php">DonateEase</a> |
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> |
||||||
|
<span class="navbar-toggler-icon"></span> |
||||||
|
</button> |
||||||
|
<div class="collapse navbar-collapse" id="navbarNav"> |
||||||
|
<ul class="navbar-nav ms-auto"> |
||||||
|
<li class="nav-item"> |
||||||
|
<a class="nav-link" href="index.php">Home</a> |
||||||
|
</li> |
||||||
|
<li class="nav-item"> |
||||||
|
<a class="nav-link" href="about.php">About</a> |
||||||
|
</li> |
||||||
|
<li class="nav-item"> |
||||||
|
<a class="nav-link" href="donations.php">Donations</a> |
||||||
|
</li> |
||||||
|
<li class="nav-item"> |
||||||
|
<a class="nav-link" href="ContactUs.php">Contact Us</a> |
||||||
|
</li> |
||||||
|
<?php if (!isset($_SESSION['user_id'])): ?> |
||||||
|
<li class="nav-item"> |
||||||
|
<a class="nav-link" href="login.php">Login</a> |
||||||
|
</li> |
||||||
|
<li class="nav-item"> |
||||||
|
<a class="nav-link" href="register.php">Sign Up</a> |
||||||
|
</li> |
||||||
|
<?php else: ?> |
||||||
|
<li class="nav-item"> |
||||||
|
<a class="nav-link" href="dashboard.php">Dashboard</a> |
||||||
|
</li> |
||||||
|
<li class="nav-item"> |
||||||
|
<a class="nav-link" href="logout.php">Logout</a> |
||||||
|
</li> |
||||||
|
<?php endif; ?> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</nav> |
@ -0,0 +1,380 @@ |
|||||||
|
<?php include('includes/header.php'); ?> |
||||||
|
|
||||||
|
<style> |
||||||
|
/* DonateEase Stylesheet */ |
||||||
|
@media (max-width: 768px) { |
||||||
|
.causes-grid { |
||||||
|
flex-wrap: wrap; /* Allow wrapping on smaller screens */ |
||||||
|
} |
||||||
|
.cause { |
||||||
|
flex: 1 1 100%; /* Make each card take full width */ |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/* General Styles */ |
||||||
|
body { |
||||||
|
font-family: "Arial", sans-serif; |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
line-height: 1.6; |
||||||
|
color: #333; |
||||||
|
} |
||||||
|
|
||||||
|
.container { |
||||||
|
width: 100%; |
||||||
|
max-width: 1200px; |
||||||
|
margin: 0 auto; |
||||||
|
} |
||||||
|
|
||||||
|
h1, |
||||||
|
h2, |
||||||
|
h3, |
||||||
|
h4 { |
||||||
|
color: #2e1789; /* Dark green for headings */ |
||||||
|
} |
||||||
|
|
||||||
|
p { |
||||||
|
margin: 0.5em 0; |
||||||
|
} |
||||||
|
|
||||||
|
/* Header */ |
||||||
|
header { |
||||||
|
background: #3a7736; /* Green header background */ |
||||||
|
padding: 1rem 0; |
||||||
|
color: white; |
||||||
|
} |
||||||
|
|
||||||
|
.navbar { |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
align-items: center; |
||||||
|
} |
||||||
|
|
||||||
|
.nav-links { |
||||||
|
list-style: none; |
||||||
|
padding: 0; |
||||||
|
margin: 0; |
||||||
|
display: flex; |
||||||
|
} |
||||||
|
|
||||||
|
.nav-links li { |
||||||
|
margin: 0 1rem; |
||||||
|
} |
||||||
|
|
||||||
|
.nav-links a { |
||||||
|
text-decoration: none; |
||||||
|
color: white; |
||||||
|
font-weight: bold; |
||||||
|
transition: color 0.3s; |
||||||
|
} |
||||||
|
|
||||||
|
.nav-links a:hover { |
||||||
|
color: #8ccf78; /* Light green hover color */ |
||||||
|
} |
||||||
|
|
||||||
|
.logo { |
||||||
|
font-size: 1.5rem; |
||||||
|
font-weight: bold; |
||||||
|
} |
||||||
|
|
||||||
|
.btn-primary, |
||||||
|
.btn-secondary { |
||||||
|
padding: 0.75rem 1.5rem; |
||||||
|
border-radius: 5px; |
||||||
|
text-decoration: none; |
||||||
|
color: white; |
||||||
|
font-weight: bold; |
||||||
|
transition: background-color 0.3s; |
||||||
|
} |
||||||
|
|
||||||
|
.btn-primary { |
||||||
|
background: #4caf50; /* Primary green button */ |
||||||
|
} |
||||||
|
|
||||||
|
.btn-primary:hover { |
||||||
|
background: #388e3c; /* Darker green hover */ |
||||||
|
} |
||||||
|
|
||||||
|
.btn-secondary { |
||||||
|
background: #8bc34a; /* Secondary green button */ |
||||||
|
} |
||||||
|
|
||||||
|
.btn-secondary:hover { |
||||||
|
background: #689f38; /* Darker secondary green */ |
||||||
|
} |
||||||
|
|
||||||
|
/* Hero Section */ |
||||||
|
.hero { |
||||||
|
background: url("assets/images/hero-bg.jpg") no-repeat center center/cover; |
||||||
|
height: 100vh; |
||||||
|
color: white; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.hero-text h1 { |
||||||
|
font-size: 3rem; |
||||||
|
margin-bottom: 1rem; |
||||||
|
} |
||||||
|
|
||||||
|
.hero-text p { |
||||||
|
font-size: 1.25rem; |
||||||
|
margin-bottom: 2rem; |
||||||
|
} |
||||||
|
|
||||||
|
/* Featured Causes */ |
||||||
|
.featured-causes { |
||||||
|
padding: 2rem 0; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.causes-grid { |
||||||
|
display: flex; |
||||||
|
gap: 2rem; |
||||||
|
flex-wrap: wrap; |
||||||
|
justify-content: center; |
||||||
|
} |
||||||
|
|
||||||
|
.cause { |
||||||
|
background: white; |
||||||
|
border: 1px solid #c8e6c9; /* Light green border */ |
||||||
|
border-radius: 10px; |
||||||
|
overflow: hidden; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); |
||||||
|
width: 400px; |
||||||
|
transition: transform 0.3s; |
||||||
|
} |
||||||
|
|
||||||
|
.cause:hover { |
||||||
|
transform: scale(1.05); |
||||||
|
} |
||||||
|
|
||||||
|
.cause img { |
||||||
|
width: 100%; |
||||||
|
height: 150px; |
||||||
|
object-fit: cover; |
||||||
|
} |
||||||
|
|
||||||
|
.cause h3 { |
||||||
|
margin: 1rem 0; |
||||||
|
font-size: 1.25rem; |
||||||
|
color: #2e7d32; /* Heading green */ |
||||||
|
} |
||||||
|
|
||||||
|
.cause p { |
||||||
|
padding: 0 1rem; |
||||||
|
font-size: 0.9rem; |
||||||
|
} |
||||||
|
|
||||||
|
/* Testimonials */ |
||||||
|
.testimonials { |
||||||
|
background: #e8f5e9; /* Light green background */ |
||||||
|
padding: 2rem 0; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
.testimonial-slider { |
||||||
|
display: flex; |
||||||
|
gap: 2rem; |
||||||
|
overflow-x: auto; |
||||||
|
padding: 1rem; |
||||||
|
} |
||||||
|
|
||||||
|
.testimonial { |
||||||
|
background: white; |
||||||
|
border: 1px solid #c8e6c9; /* Light green border */ |
||||||
|
border-radius: 10px; |
||||||
|
padding: 1rem; |
||||||
|
flex: 0 0 300px; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); |
||||||
|
} |
||||||
|
|
||||||
|
.testimonial p { |
||||||
|
font-style: italic; |
||||||
|
margin-bottom: 1rem; |
||||||
|
} |
||||||
|
|
||||||
|
.testimonial h4 { |
||||||
|
font-size: 1rem; |
||||||
|
font-weight: bold; |
||||||
|
color: #2c5f27; /* Dark green */ |
||||||
|
} |
||||||
|
|
||||||
|
/* Footer */ |
||||||
|
footer { |
||||||
|
background: #2e7d32; /* Dark green footer */ |
||||||
|
color: white; |
||||||
|
padding: 1rem 0; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
footer .social-links { |
||||||
|
list-style: none; |
||||||
|
padding: 0; |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
gap: 1rem; |
||||||
|
} |
||||||
|
|
||||||
|
footer .social-links a { |
||||||
|
color: white; |
||||||
|
font-size: 1.5rem; |
||||||
|
transition: color 0.3s; |
||||||
|
} |
||||||
|
|
||||||
|
footer .social-links a:hover { |
||||||
|
color: #8ccf78; /* Light green hover */ |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.hero { |
||||||
|
background: url("donation.jpg") no-repeat center center/cover; |
||||||
|
height: 100vh; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
text-align: center; |
||||||
|
color: white; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
.hero-text { |
||||||
|
z-index: 1; |
||||||
|
position: relative; |
||||||
|
text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7); |
||||||
|
} |
||||||
|
|
||||||
|
.causes-grid { |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; /* Space between items */ |
||||||
|
align-items: stretch; /* Ensure all cards have the same height */ |
||||||
|
gap: 1rem; /* Add spacing between items */ |
||||||
|
flex-wrap: nowrap; /* Prevent wrapping to a new line */ |
||||||
|
} |
||||||
|
|
||||||
|
.cause { |
||||||
|
flex: 1; /* Ensure all cards have equal width */ |
||||||
|
max-width: 300px; /* Optional: Limit the width of each card */ |
||||||
|
background: white; |
||||||
|
border: 1px solid #ddd; |
||||||
|
border-radius: 10px; |
||||||
|
overflow: hidden; |
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); |
||||||
|
transition: transform 0.3s; |
||||||
|
} |
||||||
|
|
||||||
|
.cause img { |
||||||
|
width: 100%; |
||||||
|
height: 200px; |
||||||
|
object-fit: cover; |
||||||
|
} |
||||||
|
</style> |
||||||
|
<section class="hero"> |
||||||
|
<div class="container"> |
||||||
|
<div class="hero-text"> |
||||||
|
<h1>Transform Lives with Your Support</h1> |
||||||
|
<p> |
||||||
|
Join us in creating a better future for those in need. Every |
||||||
|
contribution makes a difference. |
||||||
|
</p> |
||||||
|
<a href="donate.html" class="btn-primary">Donate Now</a> |
||||||
|
<a href="causes.php" class="btn-secondary">Explore Causes</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<!-- Featured Causes Section --> |
||||||
|
<section class="featured-causes"> |
||||||
|
<div class="container"> |
||||||
|
<h2>Featured Causes</h2> |
||||||
|
<div class="causes-grid"> |
||||||
|
<div class="cause"> |
||||||
|
<img src="education.jpg" alt="Education for All" /> |
||||||
|
<h3>Education for All</h3> |
||||||
|
<p> |
||||||
|
Help us provide education to underprivileged children in rural |
||||||
|
areas. |
||||||
|
</p> |
||||||
|
<br> |
||||||
|
<a href="education.html" class="btn-secondary">Learn More</a> |
||||||
|
<br> |
||||||
|
</div> |
||||||
|
<div class="cause"> |
||||||
|
<img src="healthcare.jpg" alt="Healthcare Access" /> |
||||||
|
<h3>Healthcare Access</h3> |
||||||
|
<p>Support health camps and medical aid for remote communities.</p> |
||||||
|
<br> |
||||||
|
<a href="healthcare.html" class="btn-secondary">Learn More</a> |
||||||
|
<br> |
||||||
|
</div> |
||||||
|
<div class="cause"> |
||||||
|
<img src="disaster.jpg" alt="Disaster Relief" /> |
||||||
|
<br> |
||||||
|
<h3>Disaster Relief</h3> |
||||||
|
<br> |
||||||
|
<p> |
||||||
|
Provide immediate assistance to families affected by disasters. |
||||||
|
</p> |
||||||
|
<a href="disaster.html" class="btn-secondary">Learn More</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<!-- Testimonials Section --> |
||||||
|
<section class="testimonials"> |
||||||
|
<div class="container"> |
||||||
|
<h2>What Our Donors Say</h2> |
||||||
|
<div class="testimonial-slider"> |
||||||
|
<div class="testimonial"> |
||||||
|
<p> |
||||||
|
"DonateEase made it so simple to contribute to a cause I care |
||||||
|
about. Seeing the impact of my donation is truly rewarding." |
||||||
|
</p> |
||||||
|
<h4>- Dikshya Sharma</h4> |
||||||
|
</div> |
||||||
|
<div class="testimonial"> |
||||||
|
<p> |
||||||
|
"The transparency of this platform builds trust. I know my money |
||||||
|
is making a real difference." |
||||||
|
</p> |
||||||
|
<h4>- Shristi Adhikari</h4> |
||||||
|
</div> |
||||||
|
<div class="testimonial"> |
||||||
|
<p> |
||||||
|
"The transparency of this platform builds trust. I know my money |
||||||
|
is making a real difference." |
||||||
|
</p> |
||||||
|
<h4>- Jyoti Tamang</h4> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<!-- Call to Action Section --> |
||||||
|
<section class="call-to-action"> |
||||||
|
<div class="container mt-3"> |
||||||
|
<h2>Ready to Make a Difference?</h2> |
||||||
|
<br> |
||||||
|
<a href="donate.html" class="btn-primary ">Donate Now</a> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
<br /> |
||||||
|
<br /> |
||||||
|
<br /> |
||||||
|
|
||||||
|
<div class="row mt-4"> |
||||||
|
<div class="col-md-12 text-center"> |
||||||
|
<?php if (isset($_SESSION['user_email'])): ?> |
||||||
|
<p>Welcome, <?= htmlspecialchars($_SESSION['user_email']) ?>! You are logged in.</p>
|
||||||
|
<?php else: ?> |
||||||
|
<p>Welcome! Please log in to access more features.</p> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php include('includes/footer.php'); ?> |
@ -0,0 +1,66 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
||||||
|
// Get user inputs |
||||||
|
$email = $_POST['email']; |
||||||
|
$password = $_POST['password']; |
||||||
|
|
||||||
|
// Query the database to fetch user details |
||||||
|
$stmt = $conn->prepare("SELECT * FROM users WHERE email = ?"); |
||||||
|
$stmt->bind_param("s", $email); |
||||||
|
$stmt->execute(); |
||||||
|
$result = $stmt->get_result(); |
||||||
|
$user = $result->fetch_assoc(); |
||||||
|
|
||||||
|
// Check if user exists and password is correct |
||||||
|
if ($user && password_verify($password, $user['password'])) { |
||||||
|
// Store user data in session |
||||||
|
$_SESSION['user_email'] = $user['email']; |
||||||
|
$_SESSION['role'] = $user['role']; |
||||||
|
$_SESSION['user_id'] = $user['id']; |
||||||
|
|
||||||
|
// Redirect to user dashboard or admin dashboard based on role |
||||||
|
if ($user['role'] === 'admin') { |
||||||
|
header("Location: admin_dashboard.php"); |
||||||
|
} else { |
||||||
|
header("Location: dashboard.php"); |
||||||
|
} |
||||||
|
exit; |
||||||
|
} else { |
||||||
|
$error_message = "Invalid email or password."; |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Login</title> |
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div class="container mt-5"> |
||||||
|
<h2>Login</h2> |
||||||
|
|
||||||
|
<?php if (isset($error_message)): ?> |
||||||
|
<div class="alert alert-danger"><?= $error_message ?></div>
|
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<form method="POST"> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="email" class="form-label">Email</label> |
||||||
|
<input type="email" class="form-control" id="email" name="email" required> |
||||||
|
</div> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="password" class="form-label">Password</label> |
||||||
|
<input type="password" class="form-control" id="password" name="password" required> |
||||||
|
</div> |
||||||
|
<button type="submit" class="btn btn-primary">Login</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,14 @@ |
|||||||
|
<?php |
||||||
|
// Start the session |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Unset all session variables |
||||||
|
$_SESSION = []; |
||||||
|
|
||||||
|
// Destroy the session |
||||||
|
session_destroy(); |
||||||
|
|
||||||
|
// Redirect to the login page or homepage |
||||||
|
header("Location: index.php"); |
||||||
|
exit; |
||||||
|
?> |
@ -0,0 +1,367 @@ |
|||||||
|
<?php |
||||||
|
// PHP code to handle form submission and payment processing could be added here |
||||||
|
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
||||||
|
// Handle form data and payment processing (e.g., store user data, send payment info, etc.) |
||||||
|
$name = $_POST['name']; |
||||||
|
$email = $_POST['email']; |
||||||
|
$donation_amount = $_POST['donation-amount']; |
||||||
|
// Further processing as needed |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||||
|
<title>Step-by-Step Donation with Payment Integration</title> |
||||||
|
<style> |
||||||
|
/* General Styles */ |
||||||
|
body { |
||||||
|
margin: 0; |
||||||
|
font-family: Arial, sans-serif; |
||||||
|
background-color: #f9f9f9; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
min-height: 100vh; |
||||||
|
} |
||||||
|
/* Main Content */ |
||||||
|
main { |
||||||
|
flex: 1; |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
align-items: center; |
||||||
|
padding: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.container { |
||||||
|
width: 90%; |
||||||
|
max-width: 500px; |
||||||
|
background-color: white; |
||||||
|
border: 2px solid #4caf50; |
||||||
|
padding: 20px; |
||||||
|
border-radius: 10px; |
||||||
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); |
||||||
|
} |
||||||
|
|
||||||
|
.container h1 { |
||||||
|
text-align: center; |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.step { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
.step.active { |
||||||
|
display: block; |
||||||
|
} |
||||||
|
|
||||||
|
.form-group { |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.form-group label { |
||||||
|
display: block; |
||||||
|
font-weight: bold; |
||||||
|
margin-bottom: 5px; |
||||||
|
} |
||||||
|
|
||||||
|
.form-group input[type="text"], |
||||||
|
.form-group input[type="email"], |
||||||
|
.form-group input[type="number"], |
||||||
|
.form-group textarea { |
||||||
|
width: 70%; |
||||||
|
padding: 10px; |
||||||
|
border: 1px solid #ccc; |
||||||
|
border-radius: 5px; |
||||||
|
} |
||||||
|
|
||||||
|
.payment-options button { |
||||||
|
flex: 1; |
||||||
|
padding: 10px; |
||||||
|
border: none; |
||||||
|
background-color: #4caf50; |
||||||
|
color: white; |
||||||
|
font-size: 16px; |
||||||
|
border-radius: 5px; |
||||||
|
cursor: pointer; |
||||||
|
transition: background-color 0.3s ease; |
||||||
|
} |
||||||
|
|
||||||
|
.payment-options button:hover { |
||||||
|
background-color: #45a049; |
||||||
|
} |
||||||
|
|
||||||
|
.navigation-buttons { |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
} |
||||||
|
|
||||||
|
.navigation-buttons button { |
||||||
|
padding: 10px 20px; |
||||||
|
background-color: #4caf50; |
||||||
|
color: white; |
||||||
|
border: none; |
||||||
|
border-radius: 5px; |
||||||
|
cursor: pointer; |
||||||
|
font-size: 16px; |
||||||
|
transition: background-color 0.3s ease; |
||||||
|
} |
||||||
|
|
||||||
|
.navigation-buttons button:hover { |
||||||
|
background-color: #45a049; |
||||||
|
} |
||||||
|
/* Hidden for dynamic forms */ |
||||||
|
.hidden { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<!-- Navigation --> |
||||||
|
|
||||||
|
|
||||||
|
<!-- Main Content --> |
||||||
|
<main> |
||||||
|
<div class="container"> |
||||||
|
<h1>Make a Difference Today!</h1> |
||||||
|
|
||||||
|
<!-- Step 1: Personal Information --> |
||||||
|
<div class="step active" id="step1"> |
||||||
|
<form method="POST" action="monetary.php"> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="name">Your Name:</label> |
||||||
|
<input |
||||||
|
type="text" |
||||||
|
id="name" |
||||||
|
name="name" |
||||||
|
placeholder="Enter your full name" |
||||||
|
required |
||||||
|
/> |
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="email">Your Email:</label> |
||||||
|
<input |
||||||
|
type="email" |
||||||
|
id="email" |
||||||
|
name="email" |
||||||
|
placeholder="Enter your email address" |
||||||
|
required |
||||||
|
/> |
||||||
|
</div> |
||||||
|
<div class="navigation-buttons"> |
||||||
|
<button type="button" onclick="nextStep()">Next</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Step 2: Payment Method --> |
||||||
|
<div class="step" id="step2"> |
||||||
|
<h2>Select Payment Method</h2> |
||||||
|
<div class="payment-options"> |
||||||
|
<button type="button" onclick="showCreditCardForm()"> |
||||||
|
Credit Card |
||||||
|
</button> |
||||||
|
<button type="button" onclick="redirectToKhalti()">Khalti</button> |
||||||
|
<button type="button" onclick="showBankTransferForm()"> |
||||||
|
Bank Transfer |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
<div id="dynamic-form" class="hidden"> |
||||||
|
<!-- Placeholder for dynamically loaded forms --> |
||||||
|
</div> |
||||||
|
<br /> |
||||||
|
<br /> |
||||||
|
<br /> |
||||||
|
<br /> |
||||||
|
<div class="navigation-buttons"> |
||||||
|
<button type="button" onclick="prevStep()">Back</button> |
||||||
|
<button type="button" onclick="nextStep()">Next</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Step 3: Donation Amount --> |
||||||
|
<div class="step" id="step3"> |
||||||
|
<h2>Enter Donation Amount</h2> |
||||||
|
<div class="form-group"> |
||||||
|
<input |
||||||
|
type="number" |
||||||
|
id="donation-amount" |
||||||
|
name="donation-amount" |
||||||
|
placeholder="Enter amount (USD)" |
||||||
|
min="1" |
||||||
|
step="0.01" |
||||||
|
required |
||||||
|
/> |
||||||
|
</div> |
||||||
|
<div class="navigation-buttons"> |
||||||
|
<button type="button" onclick="prevStep()">Back</button> |
||||||
|
<button type="submit">Donate Now</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</main> |
||||||
|
|
||||||
|
<!-- Footer --> |
||||||
|
|
||||||
|
|
||||||
|
<script> |
||||||
|
// JavaScript code for step navigation and dynamic forms |
||||||
|
let currentStep = 1; |
||||||
|
|
||||||
|
function showStep(step) { |
||||||
|
document.querySelectorAll(".step").forEach((stepDiv, index) => { |
||||||
|
stepDiv.classList.toggle("active", index + 1 === step); |
||||||
|
}); |
||||||
|
currentStep = step; |
||||||
|
} |
||||||
|
|
||||||
|
function nextStep() { |
||||||
|
showStep(currentStep + 1); |
||||||
|
} |
||||||
|
|
||||||
|
function prevStep() { |
||||||
|
showStep(currentStep - 1); |
||||||
|
} |
||||||
|
|
||||||
|
function showCreditCardForm() { |
||||||
|
const dynamicForm = document.getElementById("dynamic-form"); |
||||||
|
dynamicForm.innerHTML = ` |
||||||
|
<div class="form-group"> |
||||||
|
<label for="card-number">Card Number:</label> |
||||||
|
<input type="text" id="card-number" name="card-number" placeholder="Enter your card number" required /> |
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="expiry-date">Expiry Date:</label> |
||||||
|
<input type="text" id="expiry-date" name="expiry-date" placeholder="MM/YY" required /> |
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="cvv">CVV:</label> |
||||||
|
<input type="text" id="cvv" name="cvv" placeholder="Enter CVV" required /> |
||||||
|
</div> |
||||||
|
`; |
||||||
|
dynamicForm.classList.remove("hidden"); |
||||||
|
} |
||||||
|
|
||||||
|
function redirectToKhalti() { |
||||||
|
window.location.href = "https://test-admin.khalti.com/#/"; |
||||||
|
} |
||||||
|
|
||||||
|
function showBankTransferForm() { |
||||||
|
const dynamicForm = document.getElementById("dynamic-form"); |
||||||
|
dynamicForm.innerHTML = ` |
||||||
|
<h3>Bank Transfer Instructions</h3> |
||||||
|
<p>Please provide the details of your bank transfer:</p> |
||||||
|
|
||||||
|
<!-- Bank Selection --> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="bank-name">Select Your Bank:</label> |
||||||
|
<select id="bank-name" name="bank-name" required> |
||||||
|
<option value="">-- Select Bank --</option> |
||||||
|
<option value="Nabil Bank">Nabil Bank</option> |
||||||
|
<option value="Standard Chartered Bank">Standard Chartered Bank</option> |
||||||
|
<option value="Himalayan Bank">Himalayan Bank</option> |
||||||
|
<option value="Nepal SBI Bank">Nepal SBI Bank</option> |
||||||
|
<option value="Everest Bank">Everest Bank</option> |
||||||
|
<option value="Global IME Bank">Global IME Bank</option> |
||||||
|
<option value="NIC Asia Bank">NIC Asia Bank</option> |
||||||
|
<option value="Prabhu Bank">Prabhu Bank</option> |
||||||
|
<option value="Machhapuchhre Bank">Machhapuchhre Bank</option> |
||||||
|
<option value="Sanima Bank">Sanima Bank</option> |
||||||
|
<!-- Add more banks if necessary --> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Account Holder's Name --> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="account-holder-name">Account Holder Name:</label> |
||||||
|
<input |
||||||
|
type="text" |
||||||
|
id="account-holder-name" |
||||||
|
name="account-holder-name" |
||||||
|
placeholder="Enter account holder's name" |
||||||
|
required |
||||||
|
/> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Account Number --> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="account-number">Account Number:</label> |
||||||
|
<input |
||||||
|
type="text" |
||||||
|
id="account-number" |
||||||
|
name="account-number" |
||||||
|
placeholder="Enter account number" |
||||||
|
required |
||||||
|
/> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Bank Branch --> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="bank-branch">Bank Branch Location:</label> |
||||||
|
<input |
||||||
|
type="text" |
||||||
|
id="bank-branch" |
||||||
|
name="bank-branch" |
||||||
|
placeholder="Enter branch location (e.g., Kathmandu)" |
||||||
|
required |
||||||
|
/> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Amount Transferred --> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="transfer-amount">Amount Transferred (NPR):</label> |
||||||
|
<input |
||||||
|
type="number" |
||||||
|
id="transfer-amount" |
||||||
|
name="transfer-amount" |
||||||
|
placeholder="Enter the amount you transferred" |
||||||
|
min="1" |
||||||
|
required |
||||||
|
/> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Date of Transfer --> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="transfer-date">Date of Transfer:</label> |
||||||
|
<input |
||||||
|
type="date" |
||||||
|
id="transfer-date" |
||||||
|
name="transfer-date" |
||||||
|
required |
||||||
|
/> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Transaction Reference Number --> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="transfer-reference">Transaction Reference Number:</label> |
||||||
|
<input |
||||||
|
type="text" |
||||||
|
id="transfer-reference" |
||||||
|
name="transfer-reference" |
||||||
|
placeholder="Enter transaction reference number" |
||||||
|
required |
||||||
|
/> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Upload Proof of Payment --> |
||||||
|
<div class="form-group"> |
||||||
|
<label for="proof-of-payment">Upload Proof of Payment:</label> |
||||||
|
<input |
||||||
|
type="file" |
||||||
|
id="proof-of-payment" |
||||||
|
name="proof-of-payment" |
||||||
|
accept=".jpg,.jpeg,.png,.pdf" |
||||||
|
required |
||||||
|
/> |
||||||
|
</div> |
||||||
|
|
||||||
|
<!-- Submit Button --> |
||||||
|
<button type="submit" class="submit">Submit Details</button> |
||||||
|
`; |
||||||
|
dynamicForm.classList.remove("hidden"); |
||||||
|
} |
||||||
|
</script> |
||||||
|
</body> |
||||||
|
</html> |
@ -1,259 +0,0 @@ |
|||||||
#!/bin/sh |
|
||||||
# ---------------------------------------------------------------------------- |
|
||||||
# Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
# or more contributor license agreements. See the NOTICE file |
|
||||||
# distributed with this work for additional information |
|
||||||
# regarding copyright ownership. The ASF licenses this file |
|
||||||
# to you under the Apache License, Version 2.0 (the |
|
||||||
# "License"); you may not use this file except in compliance |
|
||||||
# with the License. You may obtain a copy of the License at |
|
||||||
# |
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0 |
|
||||||
# |
|
||||||
# Unless required by applicable law or agreed to in writing, |
|
||||||
# software distributed under the License is distributed on an |
|
||||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
# KIND, either express or implied. See the License for the |
|
||||||
# specific language governing permissions and limitations |
|
||||||
# under the License. |
|
||||||
# ---------------------------------------------------------------------------- |
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------- |
|
||||||
# Apache Maven Wrapper startup batch script, version 3.3.2 |
|
||||||
# |
|
||||||
# Optional ENV vars |
|
||||||
# ----------------- |
|
||||||
# JAVA_HOME - location of a JDK home dir, required when download maven via java source |
|
||||||
# MVNW_REPOURL - repo url base for downloading maven distribution |
|
||||||
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven |
|
||||||
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output |
|
||||||
# ---------------------------------------------------------------------------- |
|
||||||
|
|
||||||
set -euf |
|
||||||
[ "${MVNW_VERBOSE-}" != debug ] || set -x |
|
||||||
|
|
||||||
# OS specific support. |
|
||||||
native_path() { printf %s\\n "$1"; } |
|
||||||
case "$(uname)" in |
|
||||||
CYGWIN* | MINGW*) |
|
||||||
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" |
|
||||||
native_path() { cygpath --path --windows "$1"; } |
|
||||||
;; |
|
||||||
esac |
|
||||||
|
|
||||||
# set JAVACMD and JAVACCMD |
|
||||||
set_java_home() { |
|
||||||
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched |
|
||||||
if [ -n "${JAVA_HOME-}" ]; then |
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ]; then |
|
||||||
# IBM's JDK on AIX uses strange locations for the executables |
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java" |
|
||||||
JAVACCMD="$JAVA_HOME/jre/sh/javac" |
|
||||||
else |
|
||||||
JAVACMD="$JAVA_HOME/bin/java" |
|
||||||
JAVACCMD="$JAVA_HOME/bin/javac" |
|
||||||
|
|
||||||
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then |
|
||||||
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 |
|
||||||
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 |
|
||||||
return 1 |
|
||||||
fi |
|
||||||
fi |
|
||||||
else |
|
||||||
JAVACMD="$( |
|
||||||
'set' +e |
|
||||||
'unset' -f command 2>/dev/null |
|
||||||
'command' -v java |
|
||||||
)" || : |
|
||||||
JAVACCMD="$( |
|
||||||
'set' +e |
|
||||||
'unset' -f command 2>/dev/null |
|
||||||
'command' -v javac |
|
||||||
)" || : |
|
||||||
|
|
||||||
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then |
|
||||||
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 |
|
||||||
return 1 |
|
||||||
fi |
|
||||||
fi |
|
||||||
} |
|
||||||
|
|
||||||
# hash string like Java String::hashCode |
|
||||||
hash_string() { |
|
||||||
str="${1:-}" h=0 |
|
||||||
while [ -n "$str" ]; do |
|
||||||
char="${str%"${str#?}"}" |
|
||||||
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) |
|
||||||
str="${str#?}" |
|
||||||
done |
|
||||||
printf %x\\n $h |
|
||||||
} |
|
||||||
|
|
||||||
verbose() { :; } |
|
||||||
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } |
|
||||||
|
|
||||||
die() { |
|
||||||
printf %s\\n "$1" >&2 |
|
||||||
exit 1 |
|
||||||
} |
|
||||||
|
|
||||||
trim() { |
|
||||||
# MWRAPPER-139: |
|
||||||
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. |
|
||||||
# Needed for removing poorly interpreted newline sequences when running in more |
|
||||||
# exotic environments such as mingw bash on Windows. |
|
||||||
printf "%s" "${1}" | tr -d '[:space:]' |
|
||||||
} |
|
||||||
|
|
||||||
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties |
|
||||||
while IFS="=" read -r key value; do |
|
||||||
case "${key-}" in |
|
||||||
distributionUrl) distributionUrl=$(trim "${value-}") ;; |
|
||||||
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; |
|
||||||
esac |
|
||||||
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" |
|
||||||
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" |
|
||||||
|
|
||||||
case "${distributionUrl##*/}" in |
|
||||||
maven-mvnd-*bin.*) |
|
||||||
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ |
|
||||||
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in |
|
||||||
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; |
|
||||||
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;; |
|
||||||
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;; |
|
||||||
:Linux*x86_64*) distributionPlatform=linux-amd64 ;; |
|
||||||
*) |
|
||||||
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 |
|
||||||
distributionPlatform=linux-amd64 |
|
||||||
;; |
|
||||||
esac |
|
||||||
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" |
|
||||||
;; |
|
||||||
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; |
|
||||||
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; |
|
||||||
esac |
|
||||||
|
|
||||||
# apply MVNW_REPOURL and calculate MAVEN_HOME |
|
||||||
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash> |
|
||||||
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" |
|
||||||
distributionUrlName="${distributionUrl##*/}" |
|
||||||
distributionUrlNameMain="${distributionUrlName%.*}" |
|
||||||
distributionUrlNameMain="${distributionUrlNameMain%-bin}" |
|
||||||
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" |
|
||||||
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" |
|
||||||
|
|
||||||
exec_maven() { |
|
||||||
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : |
|
||||||
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" |
|
||||||
} |
|
||||||
|
|
||||||
if [ -d "$MAVEN_HOME" ]; then |
|
||||||
verbose "found existing MAVEN_HOME at $MAVEN_HOME" |
|
||||||
exec_maven "$@" |
|
||||||
fi |
|
||||||
|
|
||||||
case "${distributionUrl-}" in |
|
||||||
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; |
|
||||||
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; |
|
||||||
esac |
|
||||||
|
|
||||||
# prepare tmp dir |
|
||||||
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then |
|
||||||
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } |
|
||||||
trap clean HUP INT TERM EXIT |
|
||||||
else |
|
||||||
die "cannot create temp dir" |
|
||||||
fi |
|
||||||
|
|
||||||
mkdir -p -- "${MAVEN_HOME%/*}" |
|
||||||
|
|
||||||
# Download and Install Apache Maven |
|
||||||
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." |
|
||||||
verbose "Downloading from: $distributionUrl" |
|
||||||
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" |
|
||||||
|
|
||||||
# select .zip or .tar.gz |
|
||||||
if ! command -v unzip >/dev/null; then |
|
||||||
distributionUrl="${distributionUrl%.zip}.tar.gz" |
|
||||||
distributionUrlName="${distributionUrl##*/}" |
|
||||||
fi |
|
||||||
|
|
||||||
# verbose opt |
|
||||||
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' |
|
||||||
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v |
|
||||||
|
|
||||||
# normalize http auth |
|
||||||
case "${MVNW_PASSWORD:+has-password}" in |
|
||||||
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; |
|
||||||
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; |
|
||||||
esac |
|
||||||
|
|
||||||
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then |
|
||||||
verbose "Found wget ... using wget" |
|
||||||
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" |
|
||||||
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then |
|
||||||
verbose "Found curl ... using curl" |
|
||||||
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" |
|
||||||
elif set_java_home; then |
|
||||||
verbose "Falling back to use Java to download" |
|
||||||
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" |
|
||||||
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" |
|
||||||
cat >"$javaSource" <<-END |
|
||||||
public class Downloader extends java.net.Authenticator |
|
||||||
{ |
|
||||||
protected java.net.PasswordAuthentication getPasswordAuthentication() |
|
||||||
{ |
|
||||||
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); |
|
||||||
} |
|
||||||
public static void main( String[] args ) throws Exception |
|
||||||
{ |
|
||||||
setDefault( new Downloader() ); |
|
||||||
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); |
|
||||||
} |
|
||||||
} |
|
||||||
END |
|
||||||
# For Cygwin/MinGW, switch paths to Windows format before running javac and java |
|
||||||
verbose " - Compiling Downloader.java ..." |
|
||||||
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" |
|
||||||
verbose " - Running Downloader.java ..." |
|
||||||
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" |
|
||||||
fi |
|
||||||
|
|
||||||
# If specified, validate the SHA-256 sum of the Maven distribution zip file |
|
||||||
if [ -n "${distributionSha256Sum-}" ]; then |
|
||||||
distributionSha256Result=false |
|
||||||
if [ "$MVN_CMD" = mvnd.sh ]; then |
|
||||||
echo "Checksum validation is not supported for maven-mvnd." >&2 |
|
||||||
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 |
|
||||||
exit 1 |
|
||||||
elif command -v sha256sum >/dev/null; then |
|
||||||
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then |
|
||||||
distributionSha256Result=true |
|
||||||
fi |
|
||||||
elif command -v shasum >/dev/null; then |
|
||||||
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then |
|
||||||
distributionSha256Result=true |
|
||||||
fi |
|
||||||
else |
|
||||||
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 |
|
||||||
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 |
|
||||||
exit 1 |
|
||||||
fi |
|
||||||
if [ $distributionSha256Result = false ]; then |
|
||||||
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 |
|
||||||
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 |
|
||||||
exit 1 |
|
||||||
fi |
|
||||||
fi |
|
||||||
|
|
||||||
# unzip and move |
|
||||||
if command -v unzip >/dev/null; then |
|
||||||
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" |
|
||||||
else |
|
||||||
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" |
|
||||||
fi |
|
||||||
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" |
|
||||||
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" |
|
||||||
|
|
||||||
clean || : |
|
||||||
exec_maven "$@" |
|
@ -1,149 +0,0 @@ |
|||||||
<# : batch portion |
|
||||||
@REM ---------------------------------------------------------------------------- |
|
||||||
@REM Licensed to the Apache Software Foundation (ASF) under one |
|
||||||
@REM or more contributor license agreements. See the NOTICE file |
|
||||||
@REM distributed with this work for additional information |
|
||||||
@REM regarding copyright ownership. The ASF licenses this file |
|
||||||
@REM to you under the Apache License, Version 2.0 (the |
|
||||||
@REM "License"); you may not use this file except in compliance |
|
||||||
@REM with the License. You may obtain a copy of the License at |
|
||||||
@REM |
|
||||||
@REM http://www.apache.org/licenses/LICENSE-2.0 |
|
||||||
@REM |
|
||||||
@REM Unless required by applicable law or agreed to in writing, |
|
||||||
@REM software distributed under the License is distributed on an |
|
||||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
|
||||||
@REM KIND, either express or implied. See the License for the |
|
||||||
@REM specific language governing permissions and limitations |
|
||||||
@REM under the License. |
|
||||||
@REM ---------------------------------------------------------------------------- |
|
||||||
|
|
||||||
@REM ---------------------------------------------------------------------------- |
|
||||||
@REM Apache Maven Wrapper startup batch script, version 3.3.2 |
|
||||||
@REM |
|
||||||
@REM Optional ENV vars |
|
||||||
@REM MVNW_REPOURL - repo url base for downloading maven distribution |
|
||||||
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven |
|
||||||
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output |
|
||||||
@REM ---------------------------------------------------------------------------- |
|
||||||
|
|
||||||
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) |
|
||||||
@SET __MVNW_CMD__= |
|
||||||
@SET __MVNW_ERROR__= |
|
||||||
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% |
|
||||||
@SET PSModulePath= |
|
||||||
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( |
|
||||||
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) |
|
||||||
) |
|
||||||
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% |
|
||||||
@SET __MVNW_PSMODULEP_SAVE= |
|
||||||
@SET __MVNW_ARG0_NAME__= |
|
||||||
@SET MVNW_USERNAME= |
|
||||||
@SET MVNW_PASSWORD= |
|
||||||
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) |
|
||||||
@echo Cannot start maven from wrapper >&2 && exit /b 1 |
|
||||||
@GOTO :EOF |
|
||||||
: end batch / begin powershell #> |
|
||||||
|
|
||||||
$ErrorActionPreference = "Stop" |
|
||||||
if ($env:MVNW_VERBOSE -eq "true") { |
|
||||||
$VerbosePreference = "Continue" |
|
||||||
} |
|
||||||
|
|
||||||
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties |
|
||||||
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl |
|
||||||
if (!$distributionUrl) { |
|
||||||
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" |
|
||||||
} |
|
||||||
|
|
||||||
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { |
|
||||||
"maven-mvnd-*" { |
|
||||||
$USE_MVND = $true |
|
||||||
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" |
|
||||||
$MVN_CMD = "mvnd.cmd" |
|
||||||
break |
|
||||||
} |
|
||||||
default { |
|
||||||
$USE_MVND = $false |
|
||||||
$MVN_CMD = $script -replace '^mvnw','mvn' |
|
||||||
break |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
# apply MVNW_REPOURL and calculate MAVEN_HOME |
|
||||||
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash> |
|
||||||
if ($env:MVNW_REPOURL) { |
|
||||||
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } |
|
||||||
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" |
|
||||||
} |
|
||||||
$distributionUrlName = $distributionUrl -replace '^.*/','' |
|
||||||
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' |
|
||||||
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" |
|
||||||
if ($env:MAVEN_USER_HOME) { |
|
||||||
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" |
|
||||||
} |
|
||||||
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' |
|
||||||
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" |
|
||||||
|
|
||||||
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { |
|
||||||
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" |
|
||||||
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" |
|
||||||
exit $? |
|
||||||
} |
|
||||||
|
|
||||||
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { |
|
||||||
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" |
|
||||||
} |
|
||||||
|
|
||||||
# prepare tmp dir |
|
||||||
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile |
|
||||||
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" |
|
||||||
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null |
|
||||||
trap { |
|
||||||
if ($TMP_DOWNLOAD_DIR.Exists) { |
|
||||||
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } |
|
||||||
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null |
|
||||||
|
|
||||||
# Download and Install Apache Maven |
|
||||||
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." |
|
||||||
Write-Verbose "Downloading from: $distributionUrl" |
|
||||||
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" |
|
||||||
|
|
||||||
$webclient = New-Object System.Net.WebClient |
|
||||||
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { |
|
||||||
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) |
|
||||||
} |
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
|
||||||
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null |
|
||||||
|
|
||||||
# If specified, validate the SHA-256 sum of the Maven distribution zip file |
|
||||||
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum |
|
||||||
if ($distributionSha256Sum) { |
|
||||||
if ($USE_MVND) { |
|
||||||
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." |
|
||||||
} |
|
||||||
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash |
|
||||||
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { |
|
||||||
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
# unzip and move |
|
||||||
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null |
|
||||||
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null |
|
||||||
try { |
|
||||||
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null |
|
||||||
} catch { |
|
||||||
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { |
|
||||||
Write-Error "fail to move MAVEN_HOME" |
|
||||||
} |
|
||||||
} finally { |
|
||||||
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } |
|
||||||
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } |
|
||||||
} |
|
||||||
|
|
||||||
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" |
|
@ -1,74 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
||||||
<modelVersion>4.0.0</modelVersion> |
|
||||||
<parent> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-parent</artifactId> |
|
||||||
<version>3.4.1</version> |
|
||||||
<relativePath/> <!-- lookup parent from repository --> |
|
||||||
</parent> |
|
||||||
<groupId>com.donateease</groupId> |
|
||||||
<artifactId>demo</artifactId> |
|
||||||
<version>0.0.1-SNAPSHOT</version> |
|
||||||
<name>demo</name> |
|
||||||
<description>Demo project for Spring Boot</description> |
|
||||||
<url/> |
|
||||||
<licenses> |
|
||||||
<license/> |
|
||||||
</licenses> |
|
||||||
<developers> |
|
||||||
<developer/> |
|
||||||
</developers> |
|
||||||
<scm> |
|
||||||
<connection/> |
|
||||||
<developerConnection/> |
|
||||||
<tag/> |
|
||||||
<url/> |
|
||||||
</scm> |
|
||||||
<properties> |
|
||||||
<java.version>23</java.version> |
|
||||||
</properties> |
|
||||||
<dependencies> |
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-thymeleaf</artifactId> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-web-services</artifactId> |
|
||||||
</dependency> |
|
||||||
|
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-devtools</artifactId> |
|
||||||
<scope>runtime</scope> |
|
||||||
<optional>true</optional> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>com.mysql</groupId> |
|
||||||
<artifactId>mysql-connector-j</artifactId> |
|
||||||
<scope>runtime</scope> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>org.mariadb.jdbc</groupId> |
|
||||||
<artifactId>mariadb-java-client</artifactId> |
|
||||||
<scope>runtime</scope> |
|
||||||
</dependency> |
|
||||||
<dependency> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-starter-test</artifactId> |
|
||||||
<scope>test</scope> |
|
||||||
</dependency> |
|
||||||
</dependencies> |
|
||||||
|
|
||||||
<build> |
|
||||||
<plugins> |
|
||||||
<plugin> |
|
||||||
<groupId>org.springframework.boot</groupId> |
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId> |
|
||||||
</plugin> |
|
||||||
</plugins> |
|
||||||
</build> |
|
||||||
|
|
||||||
</project> |
|
@ -0,0 +1,101 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
|
||||||
|
// Handle search request |
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
||||||
|
$blood_type = $_POST['blood_type']; |
||||||
|
$urgency = $_POST['urgency_level']; |
||||||
|
|
||||||
|
$sql = "SELECT users.first_name, users.last_name, blood_donors.blood_type, blood_donors.availability |
||||||
|
FROM blood_donors |
||||||
|
JOIN users ON blood_donors.donor_id = users.id |
||||||
|
WHERE blood_donors.blood_type = ?"; |
||||||
|
|
||||||
|
if ($urgency !== "") { |
||||||
|
$sql .= " AND blood_donors.availability LIKE ?"; |
||||||
|
} |
||||||
|
|
||||||
|
$stmt = $conn->prepare($sql); |
||||||
|
if ($urgency !== "") { |
||||||
|
$stmt->bind_param("ss", $blood_type, "%$urgency%"); |
||||||
|
} else { |
||||||
|
$stmt->bind_param("s", $blood_type); |
||||||
|
} |
||||||
|
$stmt->execute(); |
||||||
|
$result = $stmt->get_result(); |
||||||
|
} |
||||||
|
|
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
|
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Search Blood Donors</title> |
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<div class="container mt-4"> |
||||||
|
<h2>Search for Blood Donors</h2> |
||||||
|
|
||||||
|
<form method="POST" action="recipient_search.php"> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="blood_type" class="form-label">Blood Type</label> |
||||||
|
<select name="blood_type" id="blood_type" class="form-select" required> |
||||||
|
<option value="">Select Blood Type</option> |
||||||
|
<option value="A+">A+</option> |
||||||
|
<option value="A-">A-</option> |
||||||
|
<option value="B+">B+</option> |
||||||
|
<option value="B-">B-</option> |
||||||
|
<option value="O+">O+</option> |
||||||
|
<option value="O-">O-</option> |
||||||
|
<option value="AB+">AB+</option> |
||||||
|
<option value="AB-">AB-</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="mb-3"> |
||||||
|
<label for="urgency_level" class="form-label">Urgency Level</label> |
||||||
|
<select name="urgency_level" id="urgency_level" class="form-select"> |
||||||
|
<option value="">Select Urgency Level</option> |
||||||
|
<option value="Low">Low</option> |
||||||
|
<option value="Medium">Medium</option> |
||||||
|
<option value="High">High</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
|
||||||
|
<button type="submit" class="btn btn-primary">Search Donors</button> |
||||||
|
</form> |
||||||
|
|
||||||
|
<?php if (isset($result)): ?> |
||||||
|
<h4 class="mt-4">Donors List</h4> |
||||||
|
<table class="table table-bordered"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>Name</th> |
||||||
|
<th>Blood Type</th> |
||||||
|
<th>Availability</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<?php while ($row = $result->fetch_assoc()): ?> |
||||||
|
<tr> |
||||||
|
<td><?php echo $row['first_name'] . ' ' . $row['last_name']; ?></td>
|
||||||
|
<td><?php echo $row['blood_type']; ?></td>
|
||||||
|
<td><?php echo $row['availability']; ?></td>
|
||||||
|
</tr> |
||||||
|
<?php endwhile; ?> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
<?php endif; ?> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php include 'includes/footer.php'; ?> |
||||||
|
</body> |
||||||
|
|
||||||
|
</html> |
@ -0,0 +1,97 @@ |
|||||||
|
<?php |
||||||
|
session_start(); |
||||||
|
require 'db_connection.php'; // Include database connection file |
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
||||||
|
$email = trim($_POST['email']); |
||||||
|
$password = trim($_POST['password']); |
||||||
|
$role = trim($_POST['role']); |
||||||
|
$first_name = trim($_POST['first_name']); |
||||||
|
$last_name = trim($_POST['last_name']); |
||||||
|
$phone = trim($_POST['phone']); |
||||||
|
|
||||||
|
// Validation |
||||||
|
if (empty($email) || empty($password) || empty($role) || empty($first_name) || empty($last_name)) { |
||||||
|
$error = "All fields except phone are required."; |
||||||
|
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { |
||||||
|
$error = "Invalid email format."; |
||||||
|
} elseif (!in_array($role, ['donor', 'recipient', 'admin'])) { |
||||||
|
$error = "Invalid role selected."; |
||||||
|
} else { |
||||||
|
// Check if email already exists |
||||||
|
$query = "SELECT id FROM users WHERE email = ?"; |
||||||
|
$stmt = $conn->prepare($query); |
||||||
|
$stmt->bind_param("s", $email); |
||||||
|
$stmt->execute(); |
||||||
|
$result = $stmt->get_result(); |
||||||
|
|
||||||
|
if ($result->num_rows > 0) { |
||||||
|
$error = "Email is already registered."; |
||||||
|
} else { |
||||||
|
// Hash the password |
||||||
|
$hashed_password = password_hash($password, PASSWORD_BCRYPT); |
||||||
|
|
||||||
|
// Insert into the database |
||||||
|
$query = "INSERT INTO users (email, password, role, first_name, last_name, phone) VALUES (?, ?, ?, ?, ?, ?)"; |
||||||
|
$stmt = $conn->prepare($query); |
||||||
|
$stmt->bind_param("ssssss", $email, $hashed_password, $role, $first_name, $last_name, $phone); |
||||||
|
|
||||||
|
if ($stmt->execute()) { |
||||||
|
$_SESSION['success'] = "Registration successful. Please log in."; |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} else { |
||||||
|
$error = "Registration failed. Please try again."; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
?> |
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Register</title> |
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div class="container mt-5"> |
||||||
|
<h2>Register</h2> |
||||||
|
<?php if (isset($error)): ?> |
||||||
|
<div class="alert alert-danger"><?= $error ?></div>
|
||||||
|
<?php endif; ?> |
||||||
|
<form method="POST" action=""> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="email" class="form-label">Email</label> |
||||||
|
<input type="email" name="email" class="form-control" id="email" required> |
||||||
|
</div> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="password" class="form-label">Password</label> |
||||||
|
<input type="password" name="password" class="form-control" id="password" required> |
||||||
|
</div> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="role" class="form-label">Role</label> |
||||||
|
<select name="role" class="form-control" id="role" required> |
||||||
|
<option value="donor">Donor</option> |
||||||
|
<option value="recipient">Recipient</option> |
||||||
|
<option value="admin">Admin</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="first_name" class="form-label">First Name</label> |
||||||
|
<input type="text" name="first_name" class="form-control" id="first_name" required> |
||||||
|
</div> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="last_name" class="form-label">Last Name</label> |
||||||
|
<input type="text" name="last_name" class="form-control" id="last_name" required> |
||||||
|
</div> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="phone" class="form-label">Phone</label> |
||||||
|
<input type="text" name="phone" class="form-control" id="phone"> |
||||||
|
</div> |
||||||
|
<button type="submit" class="btn btn-primary">Register</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,32 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Check if the admin is logged in |
||||||
|
if (!isset($_SESSION['user_email']) || $_SESSION['role'] !== 'admin') { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Check if the donation ID is provided |
||||||
|
if (isset($_GET['id']) && is_numeric($_GET['id'])) { |
||||||
|
$donation_id = $_GET['id']; |
||||||
|
|
||||||
|
// Update the donation status to 'rejected' |
||||||
|
$stmt = $conn->prepare("UPDATE material_donations SET status = 'rejected' WHERE id = ?"); |
||||||
|
$stmt->bind_param("i", $donation_id); |
||||||
|
|
||||||
|
if ($stmt->execute()) { |
||||||
|
$_SESSION['success_message'] = "Donation rejected successfully."; |
||||||
|
} else { |
||||||
|
$_SESSION['error_message'] = "Failed to reject the donation. Please try again."; |
||||||
|
} |
||||||
|
|
||||||
|
$stmt->close(); |
||||||
|
} else { |
||||||
|
$_SESSION['error_message'] = "Invalid donation ID."; |
||||||
|
} |
||||||
|
|
||||||
|
header("Location: admin_dashboard.php"); |
||||||
|
exit; |
||||||
|
?> |
@ -0,0 +1,77 @@ |
|||||||
|
<?php |
||||||
|
require 'db_connection.php'; |
||||||
|
session_start(); |
||||||
|
|
||||||
|
// Check if the user is logged in |
||||||
|
if (!isset($_SESSION['user_email'])) { |
||||||
|
header("Location: login.php"); |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
// Handle scheduling |
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') { |
||||||
|
$donor_id = $_SESSION['user_id']; // Assumed session variable to store logged-in user ID |
||||||
|
$hospital_name = $_POST['hospital_name']; |
||||||
|
$appointment_date = $_POST['appointment_date']; |
||||||
|
|
||||||
|
// Insert appointment |
||||||
|
$stmt = $conn->prepare("INSERT INTO appointments (donor_id, hospital_name, appointment_date) VALUES (?, ?, ?)"); |
||||||
|
$stmt->bind_param("iss", $donor_id, $hospital_name, $appointment_date); |
||||||
|
|
||||||
|
if ($stmt->execute()) { |
||||||
|
$success_message = "Appointment scheduled successfully."; |
||||||
|
} else { |
||||||
|
$error_message = "Failed to schedule the appointment."; |
||||||
|
} |
||||||
|
$stmt->close(); |
||||||
|
} |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
|
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<title>Schedule Appointment</title> |
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
<?php include 'includes/header.php'; ?> |
||||||
|
|
||||||
|
<div class="container mt-4"> |
||||||
|
<h2>Schedule Blood Donation Appointment</h2> |
||||||
|
|
||||||
|
<!-- Display success or error messages --> |
||||||
|
<?php if (isset($success_message)): ?> |
||||||
|
<div class="alert alert-success"> |
||||||
|
<?php echo $success_message; ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<?php if (isset($error_message)): ?> |
||||||
|
<div class="alert alert-danger"> |
||||||
|
<?php echo $error_message; ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<form method="POST" action="schedule_appointment.php"> |
||||||
|
<div class="mb-3"> |
||||||
|
<label for="hospital_name" class="form-label">Hospital Name</label> |
||||||
|
<input type="text" name="hospital_name" id="hospital_name" class="form-control" required> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="mb-3"> |
||||||
|
<label for="appointment_date" class="form-label">Appointment Date and Time</label> |
||||||
|
<input type="datetime-local" name="appointment_date" id="appointment_date" class="form-control" required> |
||||||
|
</div> |
||||||
|
|
||||||
|
<button type="submit" class="btn btn-primary">Schedule Appointment</button> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php include 'includes/footer.php'; ?> |
||||||
|
</body> |
||||||
|
|
||||||
|
</html> |
After Width: | Height: | Size: 131 KiB |
@ -1,13 +0,0 @@ |
|||||||
package com.donateease.demo; |
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication; |
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|
||||||
|
|
||||||
@SpringBootApplication |
|
||||||
public class DemoApplication { |
|
||||||
|
|
||||||
public static void main(String[] args) { |
|
||||||
SpringApplication.run(DemoApplication.class, args); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1 +0,0 @@ |
|||||||
spring.application.name=demo |
|
@ -1,13 +0,0 @@ |
|||||||
package com.donateease.demo; |
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test; |
|
||||||
import org.springframework.boot.test.context.SpringBootTest; |
|
||||||
|
|
||||||
@SpringBootTest |
|
||||||
class DemoApplicationTests { |
|
||||||
|
|
||||||
@Test |
|
||||||
void contextLoads() { |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,108 @@ |
|||||||
|
<?php |
||||||
|
// Collect the query parameters from the URL |
||||||
|
$food_type = isset($_GET['food-type']) ? $_GET['food-type'] : 'N/A'; |
||||||
|
$quantity = isset($_GET['quantity']) ? $_GET['quantity'] : 'N/A'; |
||||||
|
$pickup_time = isset($_GET['pickup']) ? $_GET['pickup'] : 'N/A'; |
||||||
|
$pickup_address = isset($_GET['pickup-address']) ? $_GET['pickup-address'] : 'N/A'; |
||||||
|
$comments = isset($_GET['comments']) ? $_GET['comments'] : 'N/A'; |
||||||
|
?> |
||||||
|
|
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||||
|
<title>Thank You for Your Donation</title> |
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script> |
||||||
|
<style> |
||||||
|
body { |
||||||
|
margin: 0; |
||||||
|
font-family: Arial, sans-serif; |
||||||
|
} |
||||||
|
header { |
||||||
|
text-align: center; |
||||||
|
padding: 20px; |
||||||
|
color: #333; |
||||||
|
} |
||||||
|
h1 { |
||||||
|
margin: 0; |
||||||
|
} |
||||||
|
p { |
||||||
|
color: #555; |
||||||
|
} |
||||||
|
#donation-details { |
||||||
|
max-width: 600px; |
||||||
|
margin: 20px auto; |
||||||
|
padding: 20px; |
||||||
|
background-color: #ffffff; |
||||||
|
border-radius: 8px; |
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
||||||
|
} |
||||||
|
strong { |
||||||
|
color: #3b9b3a; |
||||||
|
} |
||||||
|
button { |
||||||
|
display: block; |
||||||
|
width: 100%; |
||||||
|
padding: 10px; |
||||||
|
color: #080808; |
||||||
|
border: none; |
||||||
|
border-radius: 4px; |
||||||
|
font-size: 18px; |
||||||
|
font-weight: bold; |
||||||
|
cursor: pointer; |
||||||
|
margin-top: 20px; |
||||||
|
transition: background-color 0.3s ease; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<section id="thank-you-page"> |
||||||
|
<header> |
||||||
|
<h1>Thank You for Your Donation!</h1> |
||||||
|
<p> |
||||||
|
Your donation form has been successfully submitted. Below are the |
||||||
|
details: |
||||||
|
</p> |
||||||
|
</header> |
||||||
|
|
||||||
|
<div id="donation-details"> |
||||||
|
<p> |
||||||
|
<strong>Food Type:</strong> <span><?php echo htmlspecialchars($food_type); ?></span>
|
||||||
|
</p> |
||||||
|
<p><strong>Quantity:</strong> <span><?php echo htmlspecialchars($quantity); ?></span></p>
|
||||||
|
<p> |
||||||
|
<strong>Preferred Pickup Time:</strong> <span><?php echo htmlspecialchars($pickup_time); ?></span>
|
||||||
|
</p> |
||||||
|
<p> |
||||||
|
<strong>Pickup Address:</strong> <span><?php echo htmlspecialchars($pickup_address); ?></span>
|
||||||
|
</p> |
||||||
|
<p> |
||||||
|
<strong>Additional Comments:</strong> <span><?php echo htmlspecialchars($comments); ?></span>
|
||||||
|
</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<button id="download-pdf">Download Donation Details</button> |
||||||
|
</section> |
||||||
|
|
||||||
|
<script> |
||||||
|
// Download PDF functionality |
||||||
|
document |
||||||
|
.getElementById("download-pdf") |
||||||
|
.addEventListener("click", function () { |
||||||
|
const { jsPDF } = window.jspdf; |
||||||
|
const doc = new jsPDF(); |
||||||
|
|
||||||
|
doc.text("Donation Details", 20, 20); |
||||||
|
doc.text("Food Type: <?php echo addslashes($food_type); ?>", 20, 30);
|
||||||
|
doc.text("Quantity: <?php echo addslashes($quantity); ?>", 20, 40);
|
||||||
|
doc.text("Pickup Time: <?php echo addslashes($pickup_time); ?>", 20, 50);
|
||||||
|
doc.text("Pickup Address: <?php echo addslashes($pickup_address); ?>", 20, 60);
|
||||||
|
doc.text("Additional Comments: <?php echo addslashes($comments); ?>", 20, 70);
|
||||||
|
|
||||||
|
// Save the PDF |
||||||
|
doc.save("donation-details.pdf"); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
</body> |
||||||
|
</html> |