Sure! To integrate the logo (images/white-logo.png) into your existing index.php file, you'll want to add an <img> tag within the container where you currently have your title and introductory text. Below is the complete code for your index.php, with the logo added above the title.
Here's the modified code:
<?php
session_start();
// Check if a user is already logged in
if (isset($_SESSION['admin_id'])) {
header("Location: admin_dashboard.php");
exit();
} elseif (isset($_SESSION['patient_id'])) {
header("Location: patient_dashboard.php");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Patient Health Record System</title>
<!-- Link to the external CSS file (optional) -->
<link rel="stylesheet" href="css/styles.css">
<style>
/* Import Google Fonts for modern typography */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
/* Custom CSS for modern design with gradients and animations */
body {
background-image: url('images/background-image-admin.jpg');
background-size: cover; /* Cover the entire background */
background-position: center; /* Center the background image */
background-repeat: no-repeat;
font-family: 'Roboto', Arial, sans-serif;
margin: 0;
padding: 0;
height: 100vh; /* Full viewport height */
display: flex;
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
position: relative;
overflow: hidden;
}
/* Gradient Overlay for enhanced visual appeal */
.overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
/* Linear gradient overlay */
background: linear-gradient(135deg, rgba(79, 63, 2, 0.8), rgba(209, 194, 135, 0.8));
z-index: 1;
opacity: 0;
animation: overlayFadeIn 2s forwards;
}
/* Fade-in animation for the overlay */
@keyframes overlayFadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
/* Container Styling */
.container {
position: relative;
background: rgba(255, 255, 255, 0.85); /* Semi-transparent white background */
padding: 50px 40px;
border-radius: 15px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
text-align: center;
max-width: 450px;
width: 90%;
z-index: 2; /* Above the overlay */
transform: translateY(-50px);
animation: slideUp 1s ease-out forwards;
}
/* Slide-up animation for the container */
@keyframes slideUp {
to {
transform: translateY(0);
opacity: 1;
}
from {
transform: translateY(-50px);
opacity: 0;
}
}
/* Dashboard Header */
.dashboard-header {
background: linear-gradient(135deg, #4F3F02, #D1C287);
color: #ffffff;
padding: 20px 30px;
border-radius: 10px;
margin-bottom: 30px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.dashboard-header h1 {
font-size: 28px;
margin: 0;
font-weight: 700;
letter-spacing: 1px;
color: white;
}
/* Introductory Text */
p {
font-size: 18px;
margin-bottom: 40px;
color: #333333;
line-height: 1.6;
}
/* Login Options */
.login-options {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
gap: 20px;
}
.login-options a {
flex: 1 1 45%;
padding: 15px 0;
border: none;
border-radius: 8px;
text-decoration: none;
font-size: 18px;
font-weight: 700;
transition: transform 0.3s, box-shadow 0.3s;
cursor: pointer;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
/* Primary Button (Admin Login) */
.btn-primary {
background: linear-gradient(135deg, #D1C287, #4F3F02);
color: #ffffff;
}
.btn-primary:hover {
transform: translateY(-5px);
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}
/* Secondary Button (Patient Login) */
.btn-secondary {
background: linear-gradient(135deg, #4F3F02, #D1C287);
color: #ffffff;
}
.btn-secondary:hover {
transform: translateY(-5px);
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}
/* Responsive Design */
@media (max-width: 768px) {
.container {
padding: 40px 30px;
}
.dashboard-header h1 {
font-size: 24px;
}
p {
font-size: 16px;
margin-bottom: 30px;
}
.login-options {
gap: 15px;
}
.login-options a {
flex: 1 1 100%;
font-size: 16px;
padding: 12px 0;
}
}
@media (max-width: 480px) {
.container {
padding: 30px 20px;
}
.dashboard-header h1 {
font-size: 22px;
}
p {
font-size: 14px;
margin-bottom: 25px;
}
.login-options a {
font-size: 14px;
padding: 10px 0;
}
}
</style>
</head>
<body>
<div class="overlay"></div> <!-- Gradient Overlay -->
<div class="container">
<img src="images/white-logo.png" alt="White Logo" style="max-width: 100%; height: auto; margin-bottom: 20px;"> <!-- Logo -->
<div class="dashboard-header">
<h1>Patient Health Record System</h1>
</div>
<p>Please select your login type to continue:</p>
<div class="login-options">
<a href="admin_login.php" class="btn-primary">Admin Login</a>
<a href="patients/patient_login.php" class="btn-secondary">Patient Login</a>
</div>
</div>
<!-- Optional: Additional Animations or JavaScript can be added here -->
</body>
</html>
Explanation of Changes:
-
Logo Addition:
- The logo image is added using an
<img> tag just above the dashboard header (where the title is). The style attribute ensures the logo is responsive with max-width: 100% and height: auto.
- Adjust the
margin-bottom to create some space between the logo and the title.
-
Styling:
- The image styling is added inline for simplicity, but you can also move it to your CSS for better separation of concerns.
This code will display the logo at the top of your container, right before the title of your health record system. Adjust paths as necessary to fit your actual directory structure or if your logo is located elsewhere.