This commit is contained in:
Flatlogic Bot 2025-10-27 04:21:59 +00:00
parent 44092f8e5c
commit 90a64d2c57
7 changed files with 300 additions and 145 deletions

41
assets/css/custom.css Normal file
View File

@ -0,0 +1,41 @@
body {
background-color: #F9F9F9;
font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
color: #333;
}
.navbar {
background: linear-gradient(90deg, #4A90E2, #50E3C2);
}
.navbar-brand {
font-weight: bold;
}
.main-content {
padding-top: 4rem;
padding-bottom: 4rem;
}
.holiday-card {
background-color: #FFFFFF;
border: none;
border-radius: 0.5rem;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
margin-bottom: 1rem;
padding: 1.5rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.holiday-date {
font-weight: bold;
color: #4A90E2;
}
.footer {
padding: 2rem 0;
background-color: #343a40;
color: white;
}

0
assets/js/main.js Normal file
View File

12
db/migrate.php Normal file
View File

@ -0,0 +1,12 @@
<?php
require_once __DIR__ . '/config.php';
try {
$pdo = db();
$sql = file_get_contents(__DIR__ . '/migrations/001_create_holidays_table.sql');
$pdo->exec($sql);
echo "Migration completed successfully.\n";
} catch (PDOException $e) {
die("Migration failed: " . $e->getMessage());
}

View File

@ -0,0 +1,5 @@
CREATE TABLE IF NOT EXISTS holidays (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
holiday_date DATE NOT NULL
);

35
db/seed.php Normal file
View File

@ -0,0 +1,35 @@
<?php
require_once __DIR__ . '/config.php';
try {
$pdo = db();
// Check if table is empty
$stmt = $pdo->query("SELECT COUNT(*) FROM holidays");
if ($stmt->fetchColumn() > 0) {
echo "Holidays table is not empty. Skipping seeding.\n";
exit;
}
$holidays = [
['name' => 'New Year\'s Day', 'holiday_date' => '2025-01-01'],
['name' => 'Martin Luther King, Jr. Day', 'holiday_date' => '2025-01-20'],
['name' => 'Presidents\' Day', 'holiday_date' => '2025-02-17'],
['name' => 'Memorial Day', 'holiday_date' => '2025-05-26'],
['name' => 'Juneteenth', 'holiday_date' => '2025-06-19'],
['name' => 'Independence Day', 'holiday_date' => '2025-07-04'],
['name' => 'Labor Day', 'holiday_date' => '2025-09-01'],
['name' => 'Thanksgiving Day', 'holiday_date' => '2025-11-27'],
['name' => 'Christmas Day', 'holiday_date' => '2025-12-25'],
];
$stmt = $pdo->prepare("INSERT INTO holidays (name, holiday_date) VALUES (:name, :holiday_date)");
foreach ($holidays as $holiday) {
$stmt->execute($holiday);
}
echo "Holidays table seeded successfully.\n";
} catch (PDOException $e) {
die("Could not seed database: " . $e->getMessage());
}

95
holidays.php Normal file
View File

@ -0,0 +1,95 @@
<?php
require_once __DIR__ . '/db/config.php';
try {
$pdo = db();
$stmt = $pdo->prepare("SELECT name, holiday_date FROM holidays WHERE YEAR(holiday_date) = YEAR(CURDATE()) ORDER BY holiday_date ASC");
$stmt->execute();
$holidays = $stmt->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
// In a real app, log this error. For now, show a simple message.
$holidays = [];
$error_message = "Database error. Please check configuration.";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Company Holidays - HRMS WEBAPP</title>
<meta name="description" content="View the official company holiday calendar. Built with Flatlogic Generator.">
<meta name="keywords" content="hrms, human resources, holiday calendar, company holidays, employee portal, leave management, Built with Flatlogic Generator">
<meta property="og:title" content="Company Holidays - HRMS WEBAPP">
<meta property="og:description" content="View the official company holiday calendar.">
<meta property="og:image" content="">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="index.php">HRMS WEBAPP</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 active" aria-current="page" href="holidays.php">Holidays</a>
</li>
</ul>
</div>
</div>
</nav>
<main class="main-content">
<div class="container">
<div class="text-center mb-5">
<h1 class="display-4">Company Holidays 2025</h1>
<p class="lead">Official list of holidays for the current year.</p>
</div>
<?php if (isset($error_message)): ?>
<div class="alert alert-danger" role="alert">
<?php echo htmlspecialchars($error_message); ?>
</div>
<?php elseif (empty($holidays)): ?>
<div class="alert alert-info" role="alert">
No holidays found for this year. Please check back later.
</div>
<?php else: ?>
<div class="row justify-content-center">
<div class="col-lg-8">
<?php foreach ($holidays as $holiday): ?>
<div class="holiday-card">
<span><?php echo htmlspecialchars($holiday['name']); ?></span>
<span class="holiday-date"><?php echo date("F j, Y", strtotime($holiday['holiday_date'])); ?></span>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
</main>
<footer class="footer text-center">
<div class="container">
<p>&copy; <?php echo date("Y"); ?> HRMS WEBAPP. All Rights Reserved.</p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>

243
index.php
View File

@ -1,150 +1,117 @@
<?php <!DOCTYPE html>
declare(strict_types=1);
@ini_set('display_errors', '1');
@error_reporting(E_ALL);
@date_default_timezone_set('UTC');
$phpVersion = PHP_VERSION;
$now = date('Y-m-d H:i:s');
?>
<!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Style</title> <title>HRMS WEBAPP</title>
<?php <meta name="description" content="A modern Human Resource Management System. Built with Flatlogic Generator.">
// Read project preview data from environment <meta name="keywords" content="hrms, human resources, employee management, payroll, attendance, leave tracking, Built with Flatlogic Generator">
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? ''; <meta property="og:title" content="HRMS WEBAPP">
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? ''; <meta property="og:description" content="A modern Human Resource Management System. Built with Flatlogic Generator.">
?> <meta property="og:image" content="">
<?php if ($projectDescription): ?> <meta name="twitter:card" content="summary_large_image">
<!-- Meta description --> <meta name="twitter:image" content="">
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
<!-- Open Graph meta tags --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" /> <link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
<!-- Twitter meta tags -->
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
<?php endif; ?>
<?php if ($projectImageUrl): ?>
<!-- Open Graph image -->
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<!-- Twitter image -->
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
<?php endif; ?>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<style>
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
}
body::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
animation: bg-pan 20s linear infinite;
z-index: -1;
}
@keyframes bg-pan {
0% { background-position: 0% 0%; }
100% { background-position: 100% 100%; }
}
main {
padding: 2rem;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}
.loader {
margin: 1.25rem auto 1.25rem;
width: 48px;
height: 48px;
border: 3px solid rgba(255, 255, 255, 0.25);
border-top-color: #fff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.hint {
opacity: 0.9;
}
.sr-only {
position: absolute;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap; border: 0;
}
h1 {
font-size: 3rem;
font-weight: 700;
margin: 0 0 1rem;
letter-spacing: -1px;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
}
code {
background: rgba(0,0,0,0.2);
padding: 2px 6px;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
footer {
position: absolute;
bottom: 1rem;
font-size: 0.8rem;
opacity: 0.7;
}
</style>
</head> </head>
<body> <body>
<main>
<div class="card"> <nav class="navbar navbar-expand-lg navbar-dark fixed-top">
<h1>Analyzing your requirements and generating your website…</h1> <div class="container">
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes"> <a class="navbar-brand" href="index.php">HRMS WEBAPP</a>
<span class="sr-only">Loading…</span> <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 active" aria-current="page" href="index.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="holidays.php">Holidays</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="py-5" style="background: linear-gradient(90deg, #4A90E2, #50E3C2);">
<div class="container px-5">
<div class="row gx-5 align-items-center justify-content-center">
<div class="col-lg-8 col-xl-7 col-xxl-6">
<div class="my-5 text-center text-xl-start">
<h1 class="display-2 text-white fw-bolder mb-2">HRMS Web App</h1>
<p class="lead fw-normal text-white-50 mb-4">Streamline your HR processes, from employee management to payroll, with our intuitive and powerful HRMS solution.</p>
<div class="d-grid gap-3 d-sm-flex justify-content-sm-center justify-content-xl-start">
<a class="btn btn-light btn-lg px-4 me-sm-3" href="#features">Get Started</a>
<a class="btn btn-outline-light btn-lg px-4" href="holidays.php">View Holidays</a>
</div>
</div>
</div>
<div class="col-xl-5 col-xxl-6 d-none d-xl-block text-center">
<!-- Placeholder for an image or illustration -->
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="feather feather-users"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>
</div>
</div>
</div>
</header>
<main id="features">
<div class="container px-4 py-5">
<h2 class="pb-2 border-bottom">Features</h2>
<div class="row row-cols-1 row-cols-md-2 align-items-md-center g-5 py-5">
<div class="col d-flex flex-column align-items-start gap-2">
<h3 class="fw-bold">A modern solution for your HR needs</h3>
<p class="text-muted">This is the first step in building your custom HRMS. We've started with a clean landing page and a company holiday calendar. More features are coming soon!</p>
<a href="holidays.php" class="btn btn-primary">Check out the calendar</a>
</div>
<div class="col">
<div class="row row-cols-1 row-cols-sm-2 g-4">
<div class="col d-flex flex-column gap-2">
<div class="feature-icon-small d-inline-flex align-items-center justify-content-center text-bg-primary bg-gradient fs-4 rounded-3" style="width: 3rem; height: 3rem; background-color: #4A90E2 !important;">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
</div>
<h4 class="fw-semibold mb-0">Holiday Calendar</h4>
<p class="text-muted">A company-wide calendar, visible to all employees.</p>
</div>
<div class="col d-flex flex-column gap-2">
<div class="feature-icon-small d-inline-flex align-items-center justify-content-center text-bg-primary bg-gradient fs-4 rounded-3" style="width: 3rem; height: 3rem; background-color: #4A90E2 !important;">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
</div>
<h4 class="fw-semibold mb-0">Attendance Tracking</h4>
<p class="text-muted">Coming soon: Automatic login/logout time tracking.</p>
</div>
<div class="col d-flex flex-column gap-2">
<div class="feature-icon-small d-inline-flex align-items-center justify-content-center text-bg-primary bg-gradient fs-4 rounded-3" style="width: 3rem; height: 3rem; background-color: #4A90E2 !important;">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>
</div>
<h4 class="fw-semibold mb-0">Payslip Management</h4>
<p class="text-muted">Coming soon: View and download your monthly payslips.</p>
</div>
<div class="col d-flex flex-column gap-2">
<div class="feature-icon-small d-inline-flex align-items-center justify-content-center text-bg-primary bg-gradient fs-4 rounded-3" style="width: 3rem; height: 3rem; background-color: #4A90E2 !important;">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-users"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>
</div>
<h4 class="fw-semibold mb-0">Employee Profiles</h4>
<p class="text-muted">Coming soon: View and manage your employee profile.</p>
</div>
</div>
</div>
</div> </div>
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will update automatically as the plan is implemented.</p>
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
</div> </div>
</main> </main>
<footer>
Page updated: <?= htmlspecialchars($now) ?> (UTC) <footer class="footer text-center">
<div class="container">
<p>&copy; <?php echo date("Y"); ?> HRMS WEBAPP. All Rights Reserved.</p>
</div>
</footer> </footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body> </body>
</html> </html>