/
Fancy
/
Project_WareHouse
Обзор
Документация
Войти
/
Fancy
/
Project_WareHouse
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
profile.php
230 строк
6 KB
Oleg
add_code5
18 окт 2025, 11:31
18 окт 2025, 11:31
553f763
Код
Авторство
О чём код?
<?php session_start(); // Защита страницы - только для авторизованных if (!isset($_SESSION['is_logged_in']) || $_SESSION['is_logged_in'] !== true) { echo '<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Доступ запрещен</title> <link rel="icon" href="media/LogoWHicon.png"> <style> *{ margin: 0; padding: 0; } body{ width: 100%; height: 100vh; display: flex; justify-content: center; align-items: center; } .main{ width: 30vw; height: 50vh; } .main div{ width: 100%; height: 33%; } #btn-aut{ background-color: #00aaff; width: 10vw; height: 5vh; border: none; color: white; font-size: 1vw; } #btn-aut:hover{ cursor: pointer; scale: 1.1; } .imgicon{ width: 5vw; height: 5vw; } .main div h2{ font-size: 1.3vw; } .main div h3{ margin-top: 2vw; font-size: 1vw; font-weight: 100; } </style> </head> <body> <div class="main"> <div class="icon"><img class="imgicon" src="media/403.png" alt=""></div> <div><h2>Доступ ко входу на Торговую площадку запрещен</h2><h3>Авторизуйтесь для просмотра данной страницы</h3></div> <div><button id="btn-aut">Авторизоваться</button></div> </div> <script> document.getElementById("btn-aut").addEventListener("click", function(){ document.location.href = "index.php"; }) </script> </body> </html>'; exit; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="icon" href="media/LogoWHicon.png"> <title>Профиль <?echo $_SESSION['user_name'];?></title> <style> @font-face { font-family: 'Jun_Italic'; src: url(fonts/Jun_Italic.otf); } @font-face { font-family: 'Jun_Regular'; src: url(fonts/Jun_Regular.otf); } *{ margin: 0; padding: 0; overflow: hidden; } body{ width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; position: absolute; } .main{ display: flex; justify-content: center; align-items: center; flex-direction: column ; gap: 50px; } .main div{ display: flex; justify-content: center; align-items: center; width: 350px; max-height: 100px; font-family: 'Jun_Regular'; } .head{ text-align: center; } div a{ color: black; text-decoration: none; } .miniprof conteiner{ width: 300px; } .imgprof { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; } .imgprof img { width: 100%; /* изменено с 50% на 100% */ height: 100%; /* изменено с 50% на 100% */ object-fit: cover; object-position: center; border-radius: 50%; scale: 0.5; } .miniprof{ border: 1px solid black; border-radius: 20px; background-color: whitesmoke; } .head h1{ font-size: 50px; } .btnTP h2:hover{ color: gray; cursor: pointer; } .basket h2:hover{ color: gray; cursor: pointer; } .logout h2:hover{ color: gray; cursor: pointer; } .btnTP h2:active{ cursor: pointer; scale: 0.9; } .basket h2:active{ cursor: pointer; scale: 0.9; } .logout h2:active{ cursor: pointer; scale: 0.9; } #imgprof{ transition: scale 0.2s ease; } #imgprof:hover{ cursor: pointer; scale: 0.51; } #imgprof:active{ scale: 0.48; } </style> </head> <body> <div class="main"> <div class="head"><h1>Профиль</h1></div> <div class="miniprof"> <conteiner class="imgprof"><img id="imgprof" src="<?php if($_SESSION['photo'] === NULL){echo 'media/profile_default.png';} else{echo $_SESSION['photo'];}; ?>" alt=""></conteiner> <conteiner class="textprof"> <h2><?php echo $_SESSION['user_name'];?></h2> <h3><?php echo $_SESSION['user_email'];?></h3> <h3>Баланс: <?php echo $_SESSION['balance'];?></h3> </conteiner> </div> <div class="btnTP"><h2 id="TP">Торговая Площадка</h2></div> <div class="basket"><h2 id="basket">Корзина</h2></div> <div class="logout"><h2 id="logout">Выйти</h2></div> </div> <script> document.getElementById('TP').addEventListener('click', function() { window.parent.location.href = 'warehouse.php'; }); // Добавьте обработчики для других кнопок document.getElementById('basket').addEventListener('click', function() { window.parent.location.href = 'basket.php'; }); document.getElementById('logout').addEventListener('click', function() { window.location.href = 'logout.php'; }); document.getElementById('imgprof').addEventListener('click', function(){ window.parent.location.href = 'account_profile.php' }) </script> </body> </html>