35845-vm/project.php
Flatlogic Bot 390ee703a3 simulator
2025-11-19 15:06:22 +00:00

121 lines
5.8 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
require_once __DIR__ . '/db/config.php';
$project = null;
$project_id = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT);
if ($project_id) {
try {
$pdo = db();
if ($pdo) {
$stmt = $pdo->prepare("SELECT * FROM projects WHERE id = ?");
$stmt->execute([$project_id]);
$project = $stmt->fetch(PDO::FETCH_ASSOC);
}
} catch (PDOException $e) {
error_log("Database error: " . $e->getMessage());
}
}
$page_title = $project ? htmlspecialchars($project['title']) . ' | Проект' : 'Проект не найден';
$page_description = $project ? htmlspecialchars($project['description']) : 'Запрошенный проект не найден.';
?>
<title><?php echo $page_title; ?></title>
<meta name="description" content="<?php echo $page_description; ?>">
<!-- Open Graph / Facebook -->
<meta property="og:title" content="<?php echo $page_title; ?>">
<meta property="og:description" content="<?php echo $page_description; ?>">
<meta property="og:image" content="<?php echo $project ? htmlspecialchars($project['image_url']) : htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
<!-- Twitter -->
<meta name="twitter:title" content="<?php echo $page_title; ?>">
<meta name="twitter:description" content="<?php echo $page_description; ?>">
<meta name="twitter:image" content="<?php echo $project ? htmlspecialchars($project['image_url']) : htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
<!-- Google Fonts: Poppins -->
<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=Poppins:wght@300;400;600;700&display=swap" rel="stylesheet">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
</head>
<body class="dark-theme">
<!-- Particles.js container -->
<div id="particles-js"></div>
<!-- Header -->
<header class="sticky-top">
<nav class="navbar navbar-expand-lg">
<div class="container">
<a class="navbar-brand fw-bold" href="index.php">Имя Фамилия</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#about">Обо мне</a></li>
<li class="nav-item"><a class="nav-link" href="projects.php">Портфолио</a></li>
<li class="nav-item"><a class="nav-link" href="index.php#contact">Контакт</a></li>
<li class="nav-item"><a class="nav-link" href="/admin">Админка</a></li>
<li class="nav-item"><a class="nav-link" href="tools.php">Инструменты</a></li>
<li class="nav-item"><a class="nav-link" href="simulator.php">Симулятор</a></li>
</ul>
</div>
</div>
</nav>
</header>
<main class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-10">
<?php if ($project): ?>
<div class="project-details">
<h1 class="project-title text-center mb-4"><?php echo htmlspecialchars($project['title']); ?></h1>
<img src="<?php echo htmlspecialchars($project['image_url'] ?: 'https://picsum.photos/seed/'.htmlspecialchars($project['id']).'/1200/800'); ?>" class="img-fluid rounded-3 mb-4 project-image" alt="<?php echo htmlspecialchars($project['title']); ?>">
<div class="project-description">
<p><?php echo nl2br(htmlspecialchars($project['description'])); ?></p>
</div>
<div class="text-center mt-4">
<a href="projects.php" class="btn btn-outline-accent">Назад к проектам</a>
</div>
</div>
<?php else: ?>
<div class="alert alert-danger text-center" role="alert">
<h4 class="alert-heading">Ошибка 404</h4>
<p>К сожалению, проект с таким ID не найден.</p>
<hr>
<a href="projects.php" class="btn btn-primary">Вернуться к проектам</a>
</div>
<?php endif; ?>
</div>
</div>
</main>
<!-- Footer -->
<footer class="text-center p-4 mt-auto">
<div class="container">
<p class="mb-0">&copy; <?php echo date("Y"); ?> Имя Фамилия. Все права защищены.</p>
</div>
</footer>
<!-- Bootstrap JS Bundle -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<!-- Particles.js -->
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
</body>
</html>