Compare commits

..

4 Commits

Author SHA1 Message Date
Flatlogic Bot
b24331fb7d 03 2025-10-08 16:04:05 +00:00
Flatlogic Bot
47b6ef60e9 02 2025-09-23 14:53:19 +00:00
Flatlogic Bot
ce38f4a92c 01 2025-09-23 14:44:19 +00:00
Flatlogic Bot
8e88192aea 00 2025-09-23 14:27:36 +00:00
15 changed files with 1229 additions and 124 deletions

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

@ -0,0 +1,107 @@
:root {
--primary-color: #7f5af0;
--secondary-color: #2cb67d;
--bg-color: #16161a;
--surface-color: #242629;
--text-color: #fffffe;
--text-secondary: #94a1b2;
--border-color: rgba(255, 255, 255, 0.1);
--bs-primary-rgb: 127, 90, 240;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
}
.navbar {
background-color: var(--surface-color);
box-shadow: 0 2px 4px rgba(0,0,0,.5);
border-bottom: 1px solid var(--border-color);
}
.navbar-brand, .nav-link, .navbar-toggler-icon {
color: var(--text-color) !important;
}
.navbar-light .navbar-brand, .navbar-light .nav-link {
color: var(--text-color);
}
.navbar-toggler {
border-color: var(--border-color);
}
.card {
background-color: var(--surface-color);
border: 1px solid var(--border-color);
border-radius: 0.5rem;
box-shadow: 0 4px 12px rgba(0,0,0,.5);
transition: transform .2s ease-in-out, box-shadow .2s ease-in-out;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(0,0,0,.7);
}
.card-title {
color: var(--text-color);
}
.card-text {
color: var(--text-secondary);
}
.card-img-top {
border-top-left-radius: 0.5rem;
border-top-right-radius: 0.5rem;
}
.footer {
background-color: var(--surface-color);
border-top: 1px solid var(--border-color);
color: var(--text-secondary);
}
.hero {
background: linear-gradient(135deg, var(--primary-color) 0%, #2d1e5c 100%);
padding: 4rem 0;
color: white;
}
.btn-primary {
background-color: var(--primary-color);
border-color: var(--primary-color);
color: var(--text-color);
}
.btn-primary:hover {
background-color: #6b44d6;
border-color: #6b44d6;
}
.btn-secondary {
background-color: var(--secondary-color);
border-color: var(--secondary-color);
color: var(--text-color);
}
.btn-secondary:hover {
background-color: #249d6b;
border-color: #249d6b;
}
.text-muted {
color: var(--text-secondary) !important;
}
a {
color: var(--primary-color);
text-decoration: none;
}
a:hover {
color: #9d7fee;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

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

@ -0,0 +1 @@
// Future JavaScript for interactivity will go here.

153
contact.php Normal file
View File

@ -0,0 +1,153 @@
<?php
require_once __DIR__ . '/mail/MailService.php';
$success_message = '';
$error_message = '';
$name = '';
$email = '';
$message = '';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$message = trim($_POST['message']);
$to = 'vision.info.contact@gmail.com';
$subject = 'Contact Form Submission';
if (empty($name) || empty($email) || empty($message)) {
$error_message = 'Please fill in all fields.';
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error_message = 'Invalid email format.';
} else {
$res = MailService::sendContactMessage($name, $email, $message, $to, $subject);
if (!empty($res['success'])) {
$success_message = 'Thank you for your message! We will get back to you shortly.';
// Clear form
$name = '';
$email = '';
$message = '';
} else {
$error_message = 'Sorry, there was an error sending your message. Please try again later.';
// Optionally log the detailed error: error_log($res['error']);
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Us</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<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=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css">
<style>
body {
background-color: #F4F7F9;
font-family: 'Inter', sans-serif;
}
.navbar {
background-color: #FFFFFF;
box-shadow: 0 2px 4px rgba(0,0,0,.05);
}
.footer {
background-color: #FFFFFF;
padding: 2rem 0;
margin-top: 4rem;
box-shadow: 0 -2px 4px rgba(0,0,0,.05);
}
.contact-form-container {
background-color: #FFFFFF;
padding: 3rem;
border-radius: 0.5rem;
box-shadow: 0 4px 12px rgba(0,0,0,.08);
margin-top: 3rem;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light sticky-top">
<div class="container">
<a class="navbar-brand fw-bold" href="/"><i class="bi bi-shield-check"></i> ComplianceOS</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="/">Frameworks</a>
</li>
<li class="nav-item">
<a class="nav-link" href="vision_demo.php">Vision Demo</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="pricing.php">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="contact.php">Contact</a>
</li>
<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">Register</a>
</li>
</ul>
</div>
</div>
</nav>
<main class="container">
<div class="row justify-content-center">
<div class="col-lg-8">
<div class="contact-form-container">
<h1 class="text-center mb-4" style="font-weight: 700; color: #333;">Contact Us</h1>
<p class="text-center text-muted mb-5">Have a question or feedback? Fill out the form below to get in touch with us.</p>
<?php if ($success_message): ?>
<div class="alert alert-success"><?php echo $success_message; ?></div>
<?php endif; ?>
<?php if ($error_message): ?>
<div class="alert alert-danger"><?php echo $error_message; ?></div>
<?php endif; ?>
<form action="contact.php" method="POST">
<div class="mb-3">
<label for="name" class="form-label">Name</label>
<input type="text" class="form-control" id="name" name="name" value="<?php echo htmlspecialchars($name); ?>" required>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<input type="email" class="form-control" id="email" name="email" value="<?php echo htmlspecialchars($email); ?>" required>
</div>
<div class="mb-3">
<label for="message" class="form-label">Message</label>
<textarea class="form-control" id="message" name="message" rows="5" required><?php echo htmlspecialchars($message); ?></textarea>
</div>
<div class="d-grid">
<button type="submit" class="btn btn-primary" style="background-color: #4A90E2; border-color: #4A90E2;">Send Message</button>
</div>
</form>
</div>
</div>
</div>
</main>
<footer class="footer">
<div class="container text-center">
<p class="text-muted mb-0">&copy; <?php echo date("Y"); ?> ComplianceTool. 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"></script>
</body>
</html>

View File

@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

154
framework.php Normal file
View File

@ -0,0 +1,154 @@
<?php
// --- Data ---
// In a real application, this would come from a database.
$frameworks = [
'nis2' => [
'name' => 'NIS2 Directive',
'description' => 'An EU-wide legislation on cybersecurity. It provides legal measures to boost the overall level of cybersecurity in the EU.',
'controls' => [
['id' => 'C001', 'title' => 'Risk Assessment and Security Policies', 'description' => 'Conduct regular risk assessments and establish clear information security policies.'],
['id' => 'C002', 'title' => 'Incident Handling', 'description' => 'Establish procedures to detect, handle, and report cybersecurity incidents.'],
['id' => 'C003', 'title' => 'Business Continuity Management', 'description' => 'Develop plans for business continuity and crisis management to ensure operational resilience.'],
['id' => 'C004', 'title' => 'Supply Chain Security', 'description' => 'Address security in the supply chain, including relationships with suppliers and service providers.'],
['id' => 'C005', 'title' => 'Cryptography and Encryption', 'description' => 'Use of cryptography and encryption to protect data at rest and in transit.'],
]
],
'dora' => [
'name' => 'DORA',
'description' => 'The Digital Operational Resilience Act is an EU regulation that creates a binding, comprehensive information and communication technology (ICT) risk management framework for the EU financial sector.',
'controls' => [
['id' => 'D001', 'title' => 'ICT Risk Management Framework', 'description' => 'Implement a comprehensive ICT risk management framework with clear strategies and policies.'],
['id' => 'D002', 'title' => 'ICT-Related Incident Reporting', 'description' => 'Establish a process for classifying and reporting major ICT-related incidents to authorities.'],
['id' => 'D003', 'title' => 'Digital Operational Resilience Testing', 'description' => 'Conduct regular resilience testing, including threat-led penetration testing (TLPT).'],
['id' => 'D004', 'title' => 'Third-Party Risk Management', 'description' => 'Manage risks associated with third-party ICT service providers, including cloud services.'],
]
],
'iso27001' => [
'name' => 'ISO 27001',
'description' => 'An international standard on how to manage information security. It details requirements for establishing, implementing, maintaining and continually improving an Information Security Management System (ISMS).',
'controls' => [
['id' => 'A.5.1', 'title' => 'Policies for information security', 'description' => 'A set of policies for information security shall be defined, approved by management, published and communicated.'],
['id' => 'A.6.1', 'title' => 'Information security roles and responsibilities', 'description' => 'All information security responsibilities shall be defined and allocated.'],
['id' => 'A.7.2', 'title' => 'Information security awareness, education and training', 'description' => 'All employees of the organization and, where relevant, contractors shall receive appropriate awareness education and training.'],
['id' => 'A.8.1', 'title' => 'Management of assets', 'description' => 'Assets associated with information and information processing facilities shall be identified and an inventory of these assets shall be drawn up and maintained.'],
['id' => 'A.12.1', 'title' => 'Protection against malware', 'description' => 'Controls for protection against malware shall be implemented and combined with user awareness.'],
]
]
];
// --- Logic ---
$framework_id = $_GET['id'] ?? '';
$framework = $frameworks[$framework_id] ?? null;
// If framework not found, redirect to home
if (!$framework) {
header('Location: /');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($framework['name']); ?> - ComplianceOS</title>
<meta name="description" content="Controls and requirements for <?php echo htmlspecialchars($framework['name']); ?>.">
<!-- Google Fonts -->
<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=Inter:wght@400;600&display=swap" rel="stylesheet">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light sticky-top">
<div class="container">
<a class="navbar-brand fw-bold" href="/"><i class="bi bi-shield-check"></i> ComplianceOS</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="/">Frameworks</a>
</li>
<li class="nav-item">
<a class="nav-link" href="vision_demo.php">Vision Demo</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="pricing.php">Pricing</a>
</li>
<li class="nav-item">
<li class="nav-item">
<a class="nav-link" href="contact.php">Contact</a>
</li>
<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">Register</a>
</li>
</li>
</ul>
</div>
</div>
</nav>
<header class="hero text-center">
<div class="container">
<h1 class="display-4 fw-bold"><?php echo htmlspecialchars($framework['name']); ?></h1>
<p class="lead"><?php echo htmlspecialchars($framework['description']); ?></p>
</div>
</header>
<main class="container my-5">
<div class="d-flex justify-content-between align-items-center mb-4">
<h2 class="h3">Control Requirements</h2>
<a href="#" class="btn btn-primary"><i class="bi bi-plus-circle"></i> Add New Control</a>
</div>
<div class="list-group">
<?php foreach ($framework['controls'] as $control): ?>
<div class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1 fw-bold"><?php echo htmlspecialchars($control['id']); ?>: <?php echo htmlspecialchars($control['title']); ?></h5>
<small class="text-muted">Status: Not Assessed</small>
</div>
<p class="mb-1"><?php echo htmlspecialchars($control['description']); ?></p>
<div class="mt-2">
<a href="#" class="btn btn-sm btn-outline-secondary">View Details</a>
<a href="#" class="btn btn-sm btn-outline-secondary">Assess Control</a>
</div>
</div>
<?php endforeach; ?>
</div>
</main>
<footer class="footer mt-auto py-3">
<div class="container text-center">
<span class="text-muted">&copy; <?php echo date("Y"); ?> ComplianceOS. All Rights Reserved.</span>
<div class="mt-2">
<small class="text-muted">
PHP: <?php echo phpversion(); ?> | Current time: <?php echo date('Y-m-d H:i:s'); ?> | <a href="/healthz">Health Check</a>
</small>
</div>
</div>
</footer>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>

8
healthz.php Normal file
View File

@ -0,0 +1,8 @@
<?php
// Simple health check endpoint
header('Content-Type: application/json');
echo json_encode([
'status' => 'ok',
'timestamp' => date('c'),
'php_version' => phpversion()
]);

27
includes/pexels.php Normal file
View File

@ -0,0 +1,27 @@
<?php
// includes/pexels.php
function pexels_key() {
$k = getenv('PEXELS_KEY');
return $k && strlen($k) > 0 ? $k : 'Vc99rnmOhHhJAbgGQoKLZtsaIVfkeownoQNbTj78VemUjKh08ZYRbf18';
}
function pexels_get($url) {
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Authorization: '. pexels_key() ],
CURLOPT_TIMEOUT => 15,
]);
$resp = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($code >= 200 && $code < 300 && $resp) return json_decode($resp, true);
return null;
}
function download_to($srcUrl, $destPath) {
$data = file_get_contents($srcUrl);
if ($data === false) return false;
if (!is_dir(dirname($destPath))) mkdir(dirname($destPath), 0775, true);
return file_put_contents($destPath, $data) !== false;
}
?>

240
index.php
View File

@ -1,131 +1,123 @@
<?php <?php
declare(strict_types=1); $frameworks = [
@ini_set('display_errors', '1'); [
@error_reporting(E_ALL); 'id' => 'nis2',
@date_default_timezone_set('UTC'); 'name' => 'NIS2 Directive',
'description' => 'An EU-wide legislation on cybersecurity. It provides legal measures to boost the overall level of cybersecurity in the EU.',
$phpVersion = PHP_VERSION; 'image' => 'assets/images/pexels/10330117.jpg',
$now = date('Y-m-d H:i:s'); 'alt' => 'Stylized image of the EU flag representing the NIS2 directive.'
],
[
'id' => 'dora',
'name' => 'DORA',
'description' => 'The Digital Operational Resilience Act is an EU regulation that creates a binding, comprehensive information and communication technology (ICT) risk management framework for the EU financial sector.',
'image' => 'assets/images/pexels/159888.jpg',
'alt' => 'Image of a modern financial district representing the DORA regulation.'
],
[
'id' => 'iso27001',
'name' => 'ISO 27001',
'description' => 'An international standard on how to manage information security. It details requirements for establishing, implementing, maintaining and continually improving an Information Security Management System (ISMS).',
'image' => 'assets/images/pexels/3829224.jpg',
'alt' => 'Image of a person working with a certified quality standard document, representing ISO 27001.'
]
];
?> ?>
<!doctype html> <!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>ComplianceOS - Frameworks</title>
<link rel="preconnect" href="https://fonts.googleapis.com"> <meta name="description" content="A tool to manage and assess compliance with regulatory and standard requirements like NIS2, DORA, and ISO 27001.">
<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"> <!-- Google Fonts -->
<style> <link rel="preconnect" href="https://fonts.googleapis.com">
:root { <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
--bg-color-start: #6a11cb; <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
--bg-color-end: #2575fc;
--text-color: #ffffff; <!-- Bootstrap CSS -->
--card-bg-color: rgba(255, 255, 255, 0.01); <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
--card-border-color: rgba(255, 255, 255, 0.1); <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
}
body { <!-- Custom CSS -->
margin: 0; <link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
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-light sticky-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 fw-bold" href="/"><i class="bi bi-shield-check"></i> ComplianceOS</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">
</div> <span class="navbar-toggler-icon"></span>
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWiZZy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p> </button>
<p class="hint">This page will update automatically as the plan is implemented.</p> <div class="collapse navbar-collapse" id="navbarNav">
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p> <ul class="navbar-nav ms-auto">
</div> <li class="nav-item">
</main> <a class="nav-link" href="/">Frameworks</a>
<footer> </li>
Page updated: <?= htmlspecialchars($now) ?> (UTC) <li class="nav-item">
</footer> <a class="nav-link" href="vision_demo.php">Vision Demo</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="pricing.php">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.php">Contact</a>
</li>
<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">Register</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="hero text-center">
<div class="container">
<h1 class="display-4 fw-bold">Compliance Frameworks</h1>
<p class="lead">Translate abstract requirements into measurable, checkable safeguards.</p>
</div>
</header>
<main class="container my-5">
<div class="row g-4">
<?php foreach ($frameworks as $framework): ?>
<div class="col-lg-4 col-md-6 d-flex align-items-stretch">
<div class="card w-100">
<img src="<?php echo htmlspecialchars($framework['image']); ?>" class="card-img-top" alt="<?php echo htmlspecialchars($framework['alt']); ?>">
<div class="card-body d-flex flex-column">
<h5 class="card-title fw-bold"><?php echo htmlspecialchars($framework['name']); ?></h5>
<p class="card-text flex-grow-1"><?php echo htmlspecialchars($framework['description']); ?></p>
<a href="framework.php?id=<?php echo $framework['id']; ?>" class="btn btn-primary mt-auto">View Details</a>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</main>
<footer class="footer mt-auto py-3">
<div class="container text-center">
<span class="text-muted">&copy; <?php echo date("Y"); ?> ComplianceOS. All Rights Reserved.</span>
<div class="mt-2">
<small class="text-muted">
PHP: <?php echo phpversion(); ?> | Current time: <?php echo date('Y-m-d H:i:s'); ?> | <a href="/healthz">Health Check</a>
</small>
</div>
</div>
</footer>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body> </body>
</html> </html>

123
login.php Normal file
View File

@ -0,0 +1,123 @@
<?php
session_start();
require_once 'db/config.php';
$pageTitle = "Login";
$pageDescription = "Login to your account.";
$error_message = '';
if (isset($_SESSION['user_id'])) {
header("Location: index.php"); // Redirect if already logged in
exit;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$email = trim($_POST['email']);
$password = $_POST['password'];
if (empty($email) || empty($password)) {
$error_message = "Please fill in all fields.";
} else {
try {
$pdo = db();
$stmt = $pdo->prepare("SELECT * FROM users WHERE email = :email");
$stmt->execute([':email' => $email]);
$user = $stmt->fetch();
if ($user && password_verify($password, $user['password'])) {
$_SESSION['user_id'] = $user['id'];
$_SESSION['username'] = $user['username'];
header("Location: index.php");
exit;
} else {
$error_message = "Invalid email or password.";
}
} catch (PDOException $e) {
$error_message = "Database error: " . $e->getMessage();
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($pageTitle); ?> - Compliance Vision</title>
<meta name="description" content="<?php echo htmlspecialchars($pageDescription); ?>">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="/">Compliance Vision</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="/">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="pricing.php">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.php">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="login.php">Login</a>
</li>
<li class="nav-item">
<a class="nav-link" href="register.php">Register</a>
</li>
</ul>
</div>
</div>
</nav>
<main class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-6">
<div class="card">
<div class="card-body">
<h1 class="card-title text-center mb-4"><?php echo htmlspecialchars($pageTitle); ?></h1>
<?php if ($error_message): ?>
<div class="alert alert-danger"><?php echo htmlspecialchars($error_message); ?></div>
<?php endif; ?>
<form action="login.php" method="post">
<div class="mb-3">
<label for="email" class="form-label">Email address</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>
<div class="d-grid">
<button type="submit" class="btn btn-primary">Login</button>
</div>
</form>
<div class="text-center mt-3">
<p>Don't have an account? <a href="register.php">Register here</a>.</p>
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="text-center mt-5 py-3 bg-light">
<p>&copy; <?php echo date("Y"); ?> Compliance Vision. All rights reserved.</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>

95
pricing.php Normal file
View File

@ -0,0 +1,95 @@
<?php
$pageTitle = "Pricing Plans";
$pageDescription = "Choose a subscription plan that fits your needs.";
$pageRobots = "index, follow";
require_once 'framework.php'; // Reuse header/footer
// Define pricing tiers
$tiers = [
[
'name' => 'Basic',
'price' => '€99',
'period' => '/month',
'features' => [
'Single User',
'Gap Analysis + Reporting',
],
'button_text' => 'Choose Basic',
'button_link' => 'register.php',
'popular' => false,
],
[
'name' => 'Pro',
'price' => '€499',
'period' => '/month',
'features' => [
'Integrations',
'Vendor Risk',
'Unlimited Reports',
],
'button_text' => 'Choose Pro',
'button_link' => 'register.php',
'popular' => true,
],
[
'name' => 'Enterprise',
'price' => 'Contact Us',
'period' => 'for custom pricing',
'features' => [
'API Access',
'Consulting Add-ons',
],
'button_text' => 'Contact Sales',
'button_link' => 'contact.php',
'popular' => false,
],
];
?>
<div class="container mt-5">
<div class="text-center mb-5">
<h1 class="display-4">Our Pricing</h1>
<p class="lead">Simple, transparent pricing for teams of all sizes.</p>
</div>
<div class="row">
<?php foreach ($tiers as $tier): ?>
<div class="col-lg-4 mb-4">
<div class="card h-100 shadow-sm <?php echo $tier['popular'] ? 'border-primary' : ''; ?>">
<div class="card-header text-center">
<h4 class="my-0 font-weight-normal"><?php echo htmlspecialchars($tier['name']); ?></h4>
</div>
<div class="card-body d-flex flex-column">
<h1 class="card-title pricing-card-title text-center"><?php echo htmlspecialchars($tier['price']); ?> <small class="text-muted"><?php echo htmlspecialchars($tier['period']); ?></small></h1>
<ul class="list-unstyled mt-3 mb-4">
<?php foreach ($tier['features'] as $feature): ?>
<li class="py-2"><i class="bi bi-check-circle-fill text-success me-2"></i><?php echo htmlspecialchars($feature); ?></li>
<?php endforeach; ?>
</ul>
<a href="<?php echo htmlspecialchars($tier['button_link']); ?>" class="btn btn-lg btn-block <?php echo $tier['popular'] ? 'btn-primary' : 'btn-outline-primary'; ?> mt-auto"><?php echo htmlspecialchars($tier['button_text']); ?></a>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="row mt-5">
<div class="col-md-8 offset-md-2">
<div class="card">
<div class="card-body text-center">
<h5 class="card-title">Consulting Upsell</h5>
<p class="card-text">Partner with security consultants (including us) to provide “Copilot + human.</p>
<a href="contact.php" class="btn btn-success">Contact Us for Consulting</a>
</div>
</div>
</div>
</div>
</div>
<?php
// We can reuse the footer from framework.php
// The 'framework.php' file already includes the logic to render the footer.
// So, no need to call a separate footer file.
?>

140
register.php Normal file
View File

@ -0,0 +1,140 @@
<?php
require_once 'db/config.php';
require_once 'mail/MailService.php';
$pageTitle = "Register";
$pageDescription = "Create a new account to access our services.";
$error_message = '';
$success_message = '';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = trim($_POST['username']);
$email = trim($_POST['email']);
$password = $_POST['password'];
if (empty($username) || empty($email) || empty($password)) {
$error_message = "Please fill in all fields.";
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error_message = "Invalid email format.";
} else {
try {
$pdo = db();
// Check if username or email already exists
$stmt = $pdo->prepare("SELECT * FROM users WHERE username = :username OR email = :email");
$stmt->execute([':username' => $username, ':email' => $email]);
if ($stmt->fetch()) {
$error_message = "Username or email already exists.";
} else {
// Insert new user
$password_hash = password_hash($password, PASSWORD_DEFAULT);
$stmt = $pdo->prepare("INSERT INTO users (username, email, password) VALUES (:username, :email, :password)");
$stmt->execute([
':username' => $username,
':email' => $email,
':password' => $password_hash
]);
$success_message = "Registration successful! You can now log in.";
// Optional: Send a welcome email
// MailService::sendMail($email, "Welcome to Our Service!", "Thank you for registering.", "Thank you for registering.");
}
} catch (PDOException $e) {
// In a real app, you would log this error, not show it to the user
$error_message = "Database error: " . $e->getMessage();
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo htmlspecialchars($pageTitle); ?> - Compliance Vision</title>
<meta name="description" content="<?php echo htmlspecialchars($pageDescription); ?>">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="/">Compliance Vision</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="/">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="pricing.php">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.php">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="login.php">Login</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="register.php">Register</a>
</li>
</ul>
</div>
</div>
</nav>
<main class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-6">
<div class="card">
<div class="card-body">
<h1 class="card-title text-center mb-4"><?php echo htmlspecialchars($pageTitle); ?></h1>
<?php if ($error_message): ?>
<div class="alert alert-danger"><?php echo htmlspecialchars($error_message); ?></div>
<?php endif; ?>
<?php if ($success_message): ?>
<div class="alert alert-success"><?php echo htmlspecialchars($success_message); ?></div>
<?php else: ?>
<form action="register.php" method="post">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" id="username" name="username" required>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email address</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>
<div class="d-grid">
<button type="submit" class="btn btn-primary">Register</button>
</div>
</form>
<?php endif; ?>
<div class="text-center mt-3">
<p>Already have an account? <a href="login.php">Login here</a>.</p>
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="text-center mt-5 py-3 bg-light">
<p>&copy; <?php echo date("Y"); ?> Compliance Vision. All rights reserved.</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>

298
vision_demo.php Normal file
View File

@ -0,0 +1,298 @@
<?php
// Mock Data
$gaps = [
[
'id' => 'GAP-001',
'regulation' => 'NIS2',
'description' => 'Multi-factor authentication (MFA) is not enforced for all administrative accounts.',
'severity' => 'High',
'recommendation' => 'Enable MFA for all privileged users immediately.',
'status' => 'Open'
],
[
'id' => 'GAP-002',
'regulation' => 'DORA',
'description' => 'The disaster recovery plan has not been tested in the last 12 months.',
'severity' => 'High',
'recommendation' => 'Schedule and conduct a full disaster recovery test.',
'status' => 'Open'
],
[
'id' => 'GAP-003',
'regulation' => 'ISO27001',
'description' => 'Vulnerability scanning is not performed on a regular, automated basis.',
'severity' => 'Medium',
'recommendation' => 'Implement a weekly automated vulnerability scanning solution.',
'status' => 'In Progress'
],
[
'id' => 'GAP-004',
'regulation' => 'NIS2',
'description' => 'Employee security awareness training records for the current year are incomplete.',
'severity' => 'Low',
'recommendation' => 'Ensure all employees complete the annual security training and track completion.',
'status' => 'Open'
],
[
'id' => 'GAP-005',
'regulation' => 'DORA',
'description' => 'The firewall rule set has not been reviewed in over 90 days.',
'severity' => 'Medium',
'recommendation' => 'Perform a quarterly review of all firewall rules.',
'status' => 'Resolved'
]
];
// Mock compliance data for donut charts
$compliance_data = [
'NIS2' => 85,
'DORA' => 60,
'ISO27001' => 95
];
function get_severity_badge($severity) {
switch (strtolower($severity)) {
case 'high':
return 'bg-danger';
case 'medium':
return 'bg-warning text-dark';
case 'low':
return 'bg-info text-dark';
default:
return 'bg-secondary';
}
}
function get_status_badge($status) {
switch (strtolower($status)) {
case 'open':
return 'bg-danger';
case 'in progress':
return 'bg-warning text-dark';
case 'resolved':
return 'bg-success';
default:
return 'bg-secondary';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vision Tool Demo - ComplianceOS</title>
<meta name="description" content="A demonstration of the Vision Tool, showing compliance levels and identified gaps for various regulations.">
<!-- Google Fonts -->
<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=Inter:wght@400;600&display=swap" rel="stylesheet">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<!-- Chart.js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light sticky-top">
<div class="container">
<a class="navbar-brand fw-bold" href="/"><i class="bi bi-shield-check"></i> ComplianceOS</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="/">Frameworks</a>
</li>
<li class="nav-item">
<a class="nav-link" href="vision_demo.php">Vision Demo</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="pricing.php">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.php">Contact</a>
</li>
<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">Register</a>
</li>
</ul>
</div>
</div>
</nav>
<header class="hero text-center">
<div class="container">
<h1 class="display-4 fw-bold">Vision Tool Demo</h1>
<p class="lead">An overview of your organization's compliance posture across key regulations.</p>
</div>
</header>
<main class="container my-5">
<!-- Compliance Donuts -->
<div class="row text-center mb-5">
<h2 class="mb-4">Compliance by Regulation</h2>
<div class="col-md-4">
<div class="card h-100">
<div class="card-body">
<h3 class="card-title">NIS2</h3>
<canvas id="nis2Chart"></canvas>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100">
<div class="card-body">
<h3 class="card-title">DORA</h3>
<canvas id="doraChart"></canvas>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100">
<div class="card-body">
<h3 class="card-title">ISO 27001</h3>
<canvas id="isoChart"></canvas>
</div>
</div>
</div>
</div>
<!-- Gaps Section -->
<div class="mb-5">
<h2 class="mb-4 text-center">Identified Gaps by Regulation</h2>
<?php
$gaps_by_regulation = [];
foreach ($gaps as $gap) {
$gaps_by_regulation[$gap['regulation']][] = $gap;
}
$regulations = ['NIS2', 'DORA', 'ISO27001'];
foreach ($regulations as $regulation):
if (!isset($gaps_by_regulation[$regulation])) continue;
?>
<div class="card mb-4">
<div class="card-header">
<h3 class="h4 mb-0"><?php echo htmlspecialchars($regulation); ?> Gaps</h3>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover">
<thead class="table-light">
<tr>
<th scope="col">ID</th>
<th scope="col">Description</th>
<th scope="col">Severity</th>
<th scope="col">Status</th>
<th scope="col">Recommendation</th>
</tr>
</thead>
<tbody>
<?php foreach ($gaps_by_regulation[$regulation] as $gap): ?>
<tr>
<th scope="row"><?php echo htmlspecialchars($gap['id']); ?></th>
<td><?php echo htmlspecialchars($gap['description']); ?></td>
<td><span class="badge <?php echo get_severity_badge($gap['severity']); ?>"><?php echo htmlspecialchars($gap['severity']); ?></span></td>
<td><span class="badge <?php echo get_status_badge($gap['status']); ?>"><?php echo htmlspecialchars($gap['status']); ?></span></td>
<td><?php echo htmlspecialchars($gap['recommendation']); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</main>
<footer class="footer mt-auto py-3">
<div class="container text-center">
<span class="text-muted">&copy; <?php echo date("Y"); ?> ComplianceOS. All Rights Reserved.</span>
</div>
</footer>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
const complianceData = <?php echo json_encode($compliance_data); ?>;
const createDonutChart = (canvasId, label, percentage) => {
const ctx = document.getElementById(canvasId).getContext('2d');
const data = {
labels: ['Compliant', 'Non-Compliant'],
datasets: [{
data: [percentage, 100 - percentage],
backgroundColor: [
'rgba(25, 135, 84, 0.7)', // Green for compliant
'rgba(220, 53, 69, 0.7)' // Red for non-compliant
],
borderColor: [
'rgba(25, 135, 84, 1)',
'rgba(220, 53, 69, 1)'
],
borderWidth: 1
}]
};
const options = {
responsive: true,
cutout: '70%',
plugins: {
legend: {
display: false
},
tooltip: {
callbacks: {
label: function(context) {
return context.label + ': ' + context.raw + '%';
}
}
},
title: {
display: true,
text: percentage + '%',
position: 'top',
font: {
size: 24,
weight: 'bold'
},
padding: {
top: 30,
bottom: -20
}
}
}
};
new Chart(ctx, {
type: 'doughnut',
data: data,
options: options
});
};
createDonutChart('nis2Chart', 'NIS2', complianceData.NIS2);
createDonutChart('doraChart', 'DORA', complianceData.DORA);
createDonutChart('isoChart', 'ISO 27001', complianceData.ISO27001);
});
</script>
</body>
</html>