diff --git a/Design/Style.css b/Design/Style.css new file mode 100644 index 0000000..7a3dc1c --- /dev/null +++ b/Design/Style.css @@ -0,0 +1,388 @@ +:root { + --Primary_Color: #2563EB; + --Secondary_Color: #64748B; + --Background_Color: #F8FAFC; + --Surface_Color: #FFFFFF; + --Text_Primary: #1E293B; + --Text_Secondary: #475569; + --Border_Color: #E2E8F0; + --Success_Color: #10B981; + --Error_Color: #EF4444; + --Overlay_Color: rgba(0, 0, 0, 0.65); +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body, html { + height: 100%; + width: 100%; + font-family: 'Inter', system-ui, -apple-system, sans-serif; + color: var(--Text_Primary); + line-height: 1.5; + overflow-x: hidden; +} + +/* Landing Page Styles */ +.Landing_Wrapper { + position: relative; + width: 100%; + height: 100vh; + background: url('../assets/pasted-20260204-200305-388a4105.jpg') no-repeat center center; + background-size: cover; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + color: white; + text-align: center; + overflow: hidden; /* Prevent overflow */ +} + +.Landing_Wrapper::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: var(--Overlay_Color); + z-index: 1; +} + +.Landing_Header { + position: absolute; + top: 30px; + left: 30px; + z-index: 10; +} + +.Logo_Pill { + background: white; + padding: 8px 24px 8px 10px; + border-radius: 50px; + display: flex; + align-items: center; + gap: 12px; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); +} + +.Logo_Circle { + width: 40px; + height: 40px; + background: #fff; + border-radius: 50%; + display: flex; + justify-content: center; + align-items: center; + overflow: hidden; +} + +.Logo_Circle img { + width: 100%; + height: 100%; + object-fit: contain; +} + +.Logo_Text { + text-align: left; +} + +.Logo_Title { + color: #0F172A; + font-weight: 700; + font-size: 0.8rem; + line-height: 1.2; + text-transform: uppercase; +} + +.Logo_Subtitle { + color: #64748B; + font-size: 0.65rem; + font-weight: 500; +} + +.Landing_Content { + position: relative; + z-index: 2; + max-width: 800px; + padding: 20px; + animation: fadeInScale 0.8s ease-out; +} + +@keyframes fadeInScale { + from { opacity: 0; transform: scale(0.95); } + to { opacity: 1; transform: scale(1); } +} + +.Landing_Title { + font-size: clamp(2.5rem, 8vw, 4rem); + font-weight: 800; + text-transform: uppercase; + letter-spacing: 2px; + margin-bottom: 24px; +} + +.Landing_Description { + font-size: clamp(0.9rem, 2.5vw, 1.15rem); + line-height: 1.6; + margin-bottom: 40px; + font-weight: 400; + color: rgba(255, 255, 255, 0.9); +} + +.Landing_Description strong { + font-weight: 700; +} + +.Btn_Landing_Login { + display: inline-flex; + align-items: center; + gap: 10px; + background: white; + color: var(--Primary_Color); + padding: 16px 45px; + border-radius: 40px; + text-decoration: none; + font-weight: 700; + font-size: 1rem; + text-transform: uppercase; + transition: all 0.3s ease; + border: none; + cursor: pointer; + box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3); +} + +.Btn_Landing_Login:hover { + transform: translateY(-3px); + box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.4); + background: #f8fafc; +} + +.Landing_Footer { + position: absolute; + bottom: 20px; + left: 0; + right: 0; + z-index: 2; + font-size: 0.7rem; + color: rgba(255, 255, 255, 0.6); + padding: 0 20px; +} + +/* Modal Styles */ +.Modal_Overlay { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(15, 23, 42, 0.85); + backdrop-filter: blur(8px); + z-index: 100; + justify-content: center; + align-items: center; + padding: 20px; +} + +.Modal_Overlay.Active { + display: flex; +} + +.Login_Card { + background: var(--Surface_Color); + border-radius: 12px; + width: 100%; + max-width: 440px; + padding: 40px; + position: relative; + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); + animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); +} + +@keyframes slideIn { + from { opacity: 0; transform: translateY(30px); } + to { opacity: 1; transform: translateY(0); } +} + +.Btn_Close_Modal { + position: absolute; + top: 20px; + right: 20px; + background: #f1f5f9; + border: none; + width: 32px; + height: 32px; + border-radius: 50%; + font-size: 1.2rem; + color: var(--Secondary_Color); + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; + transition: all 0.2s; +} + +.Btn_Close_Modal:hover { + background: #e2e8f0; + color: var(--Text_Primary); +} + +.Login_Card .Title_Large { + font-size: 1.85rem; + color: var(--Text_Primary); + margin-bottom: 8px; + text-align: left; + font-weight: 800; +} + +.Login_Card .Text_Muted { + text-align: left; + margin-bottom: 32px; + color: var(--Text_Secondary); +} + +/* Form Styles */ +.Form_Group { + margin-bottom: 20px; +} + +.Label { + display: block; + font-size: 0.8rem; + font-weight: 700; + margin-bottom: 8px; + color: var(--Text_Primary); + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.Input { + width: 100%; + padding: 14px 16px; + border: 1px solid var(--Border_Color); + border-radius: 8px; + font-size: 0.95rem; + background: #F8FAFC; + transition: all 0.2s; + font-family: inherit; +} + +.Input:focus { + outline: none; + border-color: var(--Primary_Color); + background: white; + box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); +} + +.Button_Primary { + width: 100%; + padding: 16px; + background-color: var(--Primary_Color); + color: white; + border: none; + border-radius: 8px; + font-weight: 700; + cursor: pointer; + font-size: 1rem; + margin-top: 10px; + transition: all 0.2s; + text-transform: uppercase; + letter-spacing: 1px; +} + +.Button_Primary:hover { + background-color: #1D4ED8; + transform: translateY(-1px); + box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); +} + +.Password_Toggle_Wrapper { + position: relative; +} + +.Toggle_Button { + position: absolute; + right: 16px; + top: 50%; + transform: translateY(-50%); + background: none; + border: none; + cursor: pointer; + font-size: 0.75rem; + font-weight: 700; + color: var(--Primary_Color); +} + +/* Responsive Design */ +@media (max-width: 768px) { + .Landing_Header { + top: 20px; + left: 20px; + } + + .Logo_Pill { + padding: 6px 16px 6px 8px; + } + + .Logo_Circle { + width: 32px; + height: 32px; + } + + .Logo_Title { + font-size: 0.7rem; + } + + .Logo_Subtitle { + display: none; + } + + .Landing_Content { + padding: 30px; + } + + .Login_Card { + padding: 30px 20px; + max-width: 100%; + } +} + +@media (max-width: 480px) { + .Landing_Title { + margin-bottom: 16px; + } + + .Landing_Description { + margin-bottom: 30px; + } + + .Btn_Landing_Login { + width: 100%; + justify-content: center; + padding: 14px 20px; + } + + .Login_Card .Title_Large { + font-size: 1.5rem; + } +} + +/* Common Utilities */ +.Alert { + padding: 16px; + border-radius: 8px; + font-size: 0.9rem; + margin-bottom: 24px; + font-weight: 500; +} + +.Alert_Error { + background-color: #FEF2F2; + color: var(--Error_Color); + border: 1px solid #FEE2E2; +} \ No newline at end of file diff --git a/Logic/Backend/Authentication_Handler.php b/Logic/Backend/Authentication_Handler.php new file mode 100644 index 0000000..270bc9b --- /dev/null +++ b/Logic/Backend/Authentication_Handler.php @@ -0,0 +1,55 @@ +pdo = db(); + } + + public function Login($User_Type, $Email, $Password, $User_ID) { + $Table = ($User_Type === 'Voter') ? 'Voters' : 'Officers'; + + $sql = "SELECT * FROM $Table WHERE Email = ? AND User_ID = ?"; + $stmt = $this->pdo->prepare($sql); + $stmt->execute([$Email, $User_ID]); + $User = $stmt->fetch(); + + if ($User && password_verify($Password, $User['Password'])) { + $_SESSION['User_ID'] = $User['User_ID']; + $_SESSION['User_Role'] = ($User_Type === 'Voter') ? 'Voter' : $User['Role']; + $_SESSION['Access_Level'] = ($User_Type === 'Voter') ? 0 : $User['Access_Level']; + $_SESSION['User_Name'] = $User['Name'] ?? 'Voter'; + + // Log to Audit_Trail if Access_Level >= 1 + if ($_SESSION['Access_Level'] >= 1) { + $this->Log_Action($User['User_ID'], $_SESSION['User_Role'], 'Login', 'Successful login to the system'); + } + + return ['success' => true]; + } + + return ['success' => false, 'error' => 'Invalid credentials']; + } + + public function Log_Action($User_ID, $User_Role, $Action_Type, $Action_Details) { + $sql = "INSERT INTO Audit_Trail (User_ID, User_Role, Action_Type, Action_Details) VALUES (?, ?, ?, ?)"; + $stmt = $this->pdo->prepare($sql); + $stmt->execute([$User_ID, $User_Role, $Action_Type, $Action_Details]); + } + + public function Check_Auth() { + if (!isset($_SESSION['User_ID'])) { + header('Location: ../../Screens/Login.php'); + exit; + } + } + + public function Logout() { + session_destroy(); + header('Location: ../../Screens/Login.php'); + exit; + } +} diff --git a/Logic/Frontend/Frontend_Script.js b/Logic/Frontend/Frontend_Script.js new file mode 100644 index 0000000..e69de29 diff --git a/Screens/Audit_Trail.html b/Screens/Audit_Trail.html new file mode 100644 index 0000000..e69de29 diff --git a/Screens/Election_Dashboard.php b/Screens/Election_Dashboard.php new file mode 100644 index 0000000..d48ac82 --- /dev/null +++ b/Screens/Election_Dashboard.php @@ -0,0 +1,52 @@ +Check_Auth(); + +if ($_SESSION['Access_Level'] < 1) { + header('Location: Voting_Screen.php'); + exit; +} +?> + + + + + + Election Dashboard - Online School Election System + + + + + +
+ Election History + Election Dashboard + Officers + Voters + Audit Trail +
+ +
+

Election Dashboard

+
+
+

Active Election

+

No active election currently running.

+ +
+
+

Voter Participation

+
0%
+

0 of 0 voters have cast their ballots.

+
+
+
+ + diff --git a/Screens/Election_History.html b/Screens/Election_History.html new file mode 100644 index 0000000..e69de29 diff --git a/Screens/Login.php b/Screens/Login.php new file mode 100644 index 0000000..6f2cf80 --- /dev/null +++ b/Screens/Login.php @@ -0,0 +1,155 @@ +Login( + $_POST['User_Type'], + $_POST['Email'], + $_POST['Password'], + $_POST['User_ID'] + ); + + if ($Result['success']) { + if ($_SESSION['Access_Level'] >= 1) { + header('Location: Election_Dashboard.php'); + } else { + header('Location: Voting_Screen.php'); + } + exit; + } else { + $Error = $Result['error']; + } +} +?> + + + + + + Click to Vote - School Election System + + + + + + +
+
+
+
+ INHS Logo +
+
+
Iloilo National High School
+
Luna St., La Paz, Iloilo City
+
+
+
+ +
+

Click to Vote

+

+ This portal is currently a PROTOTYPE MODEL under active development to demonstrate the digital election process. + Please be aware that all features are in a testing phase and interactions are for demonstration purposes only. + We are continuously refining the system to ensure a seamless experience for the final implementation. +

+ +
+ + +
+ + + + + + + \ No newline at end of file diff --git a/Screens/Logout.php b/Screens/Logout.php new file mode 100644 index 0000000..e71b062 --- /dev/null +++ b/Screens/Logout.php @@ -0,0 +1,4 @@ +Logout(); diff --git a/Screens/Officers.html b/Screens/Officers.html new file mode 100644 index 0000000..e69de29 diff --git a/Screens/Voters.html b/Screens/Voters.html new file mode 100644 index 0000000..e69de29 diff --git a/Screens/Voting_Screen.php b/Screens/Voting_Screen.php new file mode 100644 index 0000000..26e6f04 --- /dev/null +++ b/Screens/Voting_Screen.php @@ -0,0 +1,33 @@ +Check_Auth(); +?> + + + + + + Voting Screen - Online School Election System + + + + + +
+

Welcome,

+ +
+
🗳️
+

Election Status

+

There is no active election at the moment. Please check back later during the scheduled voting period.

+
+
+ + diff --git a/assets/pasted-20260204-200027-bc93fd52.png b/assets/pasted-20260204-200027-bc93fd52.png new file mode 100644 index 0000000..a5a3222 Binary files /dev/null and b/assets/pasted-20260204-200027-bc93fd52.png differ diff --git a/assets/pasted-20260204-200305-388a4105.jpg b/assets/pasted-20260204-200305-388a4105.jpg new file mode 100644 index 0000000..6976256 Binary files /dev/null and b/assets/pasted-20260204-200305-388a4105.jpg differ diff --git a/assets/pasted-20260204-200612-dffb96f0.png b/assets/pasted-20260204-200612-dffb96f0.png new file mode 100644 index 0000000..2f98938 Binary files /dev/null and b/assets/pasted-20260204-200612-dffb96f0.png differ diff --git a/index.php b/index.php index 7205f3d..35d0283 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,3 @@ - - - - - - New Style - - - - - - - - - - - - - - - - - - - - - -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

-
-
- - - +header('Location: Screens/Login.php'); +exit; \ No newline at end of file diff --git a/init_db.php b/init_db.php new file mode 100644 index 0000000..bef0599 --- /dev/null +++ b/init_db.php @@ -0,0 +1,71 @@ +exec($query); + } + + // Insert default admin (Password: Admin123) + $stmt = $pdo->prepare("INSERT IGNORE INTO Officers (User_ID, Role, Access_Level, Email, Password, Name) VALUES (?, ?, ?, ?, ?, ?)"); + $stmt->execute(['ADMIN-001', 'Admin', 3, 'admin@school.edu', password_hash('Admin123', PASSWORD_DEFAULT), 'System Administrator']); + + echo "Database initialized successfully.\n"; + +} catch (Exception $e) { + die("Error initializing database: " . $e->getMessage()); +}