Mini Shell
<?php
$rootPath = realpath(dirname(__FILE__) . '/..');
require_once $rootPath . '/Portal/config/config.php'; // Use clean config file
// Start session BEFORE any output
session_start();
//If User has already logged in, redirect to dashboard page.
if (isset($_SESSION['user_logged_in']) && $_SESSION['user_logged_in'] == TRUE) {
if ($_SESSION['User_Type'] = 'Official'){
header('Location:AdminPortal.php');
exit;}
else if ($_SESSION['User_Type'] = 'Student'){
header('Location:Portal.php');
exit;}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link href="img/loogo.png" rel="icon">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MHC - IMS</title>
<style>
:root {
--primary-color: #2e7d32; /* Changed from blue to green */
--secondary-color: #1b5e20; /* Changed from blue to dark green */
--success-color: #27ae60;
--warning-color: #f39c12;
--danger-color: #e74c3c;
--light-color: #ecf0f1;
--dark-color: #1b5e20; /* Changed from blue to dark green */
--sidebar-width: 250px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background-color: #ffffff; /* Changed from #f5f7fa to pure white */
color: #333;
min-height: 100vh;
background-image: url('Portal/img/Background.jpeg');
background-size: cover;
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
}
/* Login Container */
.login-container {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: rgba(255, 255, 255, 0.9); /* Changed from green gradient to white with transparency */
padding: 20px;
}
.login-box {
background: white;
border-radius: 15px;
padding: 40px;
width: 100%;
max-width: 500px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
.login-header {
text-align: center;
margin-bottom: 30px;
}
.login-logo {
font-size: 32px;
color: var(--primary-color);
margin-bottom: 10px;
}
.login-title {
font-size: 24px;
color: var(--secondary-color);
margin-bottom: 5px;
}
.login-subtitle {
color: #7f8c8d;
font-size: 14px;
}
.user-type-selector {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
margin-bottom: 20px;
}
.user-type-btn {
padding: 10px;
border: 2px solid #ddd;
background: white;
border-radius: 5px;
cursor: pointer;
text-align: center;
transition: all 0.3s;
}
.user-type-btn.active {
border-color: var(--primary-color);
background: var(--primary-color);
color: white;
}
.user-type-btn i {
font-size: 24px;
margin-bottom: 5px;
display: block;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: var(--secondary-color);
}
input, select {
width: 100%;
padding: 12px 15px;
border: 1px solid #ddd;
border-radius: 5px;
font-size: 16px;
transition: all 0.3s;
}
input:focus, select:focus {
border-color: var(--primary-color);
outline: none;
box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2); /* Changed from blue to green */
}
.btn {
padding: 14px 20px;
border: none;
border-radius: 5px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.btn-primary {
background: var(--primary-color);
color: white;
width: 100%;
}
.btn-primary:hover {
background: #1b5e20; /* Changed from blue to dark green */
}
.btn-success {
background: var(--success-color);
color: white;
}
.btn-danger {
background: var(--danger-color);
color: white;
}
.alert {
padding: 15px;
border-radius: 5px;
margin-bottom: 20px;
font-size: 14px;
}
.alert-success {
background: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.alert-error {
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.alert-info {
background: #d1ecf1;
color: #0c5460;
border: 1px solid #bee5eb;
}
.debug-info {
background: #f8f9fa;
border: 1px solid #ddd;
border-radius: 5px;
padding: 15px;
margin-top: 20px;
font-family: 'Courier New', monospace;
font-size: 12px;
max-height: 300px;
overflow-y: auto;
}
.debug-info h4 {
margin-bottom: 10px;
color: #6c757d;
}
.debug-info pre {
white-space: pre-wrap;
word-wrap: break-word;
}
.system-actions {
display: flex;
gap: 10px;
margin-top: 20px;
flex-wrap: wrap;
}
.system-actions .btn {
flex: 1;
min-width: 150px;
padding: 10px;
font-size: 14px;
}
.demo-credentials {
background: #f8f9fa;
border: 1px solid #dee2e6;
border-radius: 5px;
padding: 15px;
margin-top: 20px;
font-size: 13px;
}
.demo-credentials h4 {
color: var(--secondary-color);
margin-bottom: 10px;
font-size: 14px;
}
.demo-credentials table {
width: 100%;
border-collapse: collapse;
}
.demo-credentials td {
padding: 5px;
border-bottom: 1px solid #eee;
}
.demo-credentials td:first-child {
font-weight: 600;
color: var(--primary-color);
}
.troubleshooting {
background: #fff3cd;
border: 1px solid #ffeaa7;
border-radius: 5px;
padding: 15px;
margin-top: 20px;
font-size: 13px;
}
.troubleshooting h4 {
color: #856404;
margin-bottom: 10px;
font-size: 14px;
}
.troubleshooting ul {
padding-left: 20px;
}
.troubleshooting li {
margin-bottom: 5px;
}
@media (max-width: 768px) {
.login-box {
padding: 20px;
}
.user-type-selector {
grid-template-columns: repeat(2, 1fr);
}
.system-actions .btn {
min-width: 100%;
}
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
<!-- Login Page -->
<div class="login-container">
<div class="login-box">
<div class="login-header">
<div class="school-logo">
<img class="img-fluid" src="img/loogo.png" width="50" height="60" alt="">
</div>
<h2 class="login-title">MHC - IMS</h2>
<p class="login-subtitle">A password will be sent to the email Attached to this account</p>
<?php include('./include/flash_messages.php') ?>
</div>
<form class="form loginform" method="POST" action="sendmailPassword.php">
<div class="form-group">
<label for="username">
<i class="fas fa-user"></i> Enter Full Name
</label>
<input type="text" id="FullName" name="FullName" required
placeholder="Full Name of the account holder (Student)"
value="">
</div>
<div class="form-group">
<label for="username">
<i class="fa fa-envelope"></i> Enter Your Email Address
</label>
<input type="email" id="username" name="email" required
placeholder="Email attached to this account"
value="">
</div>
<button type="submit" name="login" class="btn btn-primary col-lg-4">
<i class="fas fa-sign-in-alt"></i> Send
</button>
<br><br><a href="../" align = "right"><i class="fas fa-home" ></i><span> Home</span></a> <a href="login"><i class="fas fa-arrow-circle-left"></i><span>Back</span></a>
</form>
</div>
</div>
</body>
</html>