2019-01-13 17:36:09 +00:00
|
|
|
<?php
|
2019-01-19 23:06:11 +00:00
|
|
|
$session_timeout_days = 3;
|
2019-01-17 12:26:20 +00:00
|
|
|
$session_timeout_hours = 0;
|
|
|
|
$session_timeout_minutes = 0;
|
|
|
|
$session_timeout_seconds = 0;
|
|
|
|
$session_timeout = ($session_timeout_days*86400)+($session_timeout_hours*3600)+($session_timeout_minutes*60)+$session_timeout_seconds;
|
|
|
|
session_set_cookie_params ( $session_timeout, "/" );
|
2019-01-16 23:40:15 +00:00
|
|
|
session_start ();
|
2019-01-17 12:26:20 +00:00
|
|
|
$section_page_titles = [
|
|
|
|
0 => '',
|
2019-01-13 17:36:09 +00:00
|
|
|
1 => 'Home',
|
|
|
|
2 => 'About myself',
|
|
|
|
3 => 'What I\'ve done so far',
|
|
|
|
4 => 'Who I would like to be',
|
2019-01-20 18:50:49 +00:00
|
|
|
5 => 'Web Form contact'
|
2019-01-13 17:36:09 +00:00
|
|
|
];
|
2019-01-17 12:26:20 +00:00
|
|
|
if ( ! isset ( $_POST ['section'] ) ) {
|
|
|
|
$requested_section_title = 'Home';
|
2019-01-13 17:36:09 +00:00
|
|
|
}
|
|
|
|
else {
|
2019-01-17 12:26:20 +00:00
|
|
|
if ( ! in_array ( $_POST ['section'], array_keys( $section_page_titles ) ) ) {
|
|
|
|
$page_content_array = [
|
|
|
|
'status' => 400,
|
|
|
|
'errorCode' => 'Bad Request',
|
|
|
|
'errorText' => 'Requested section \'' . $_POST [ 'section' ] . '\' does not exist: do not attempt to compromise the website.',
|
|
|
|
];
|
|
|
|
$page_content_json = json_encode ( $page_content_array );
|
|
|
|
header('Content-Type: application/json');
|
|
|
|
echo $page_content_json;
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
$requested_section = $_POST ['section'];
|
|
|
|
if ( $requested_section == 0 ) {
|
2019-01-16 23:40:15 +00:00
|
|
|
if ( isset ( $_SESSION [ 'section' ] ) ) {
|
2019-01-17 12:26:20 +00:00
|
|
|
$requested_section = $_SESSION [ 'section' ];
|
2019-01-16 23:40:15 +00:00
|
|
|
}
|
|
|
|
else {
|
2019-01-17 12:26:20 +00:00
|
|
|
$requested_section = 1;
|
2019-01-16 23:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
2019-01-17 12:26:20 +00:00
|
|
|
$_SESSION [ 'section' ] = $requested_section;
|
|
|
|
$requested_section_title = $section_page_titles [ $requested_section ];
|
|
|
|
$section_templates = [
|
|
|
|
1 => file_get_contents ( 'templates/home.phtml' ),
|
|
|
|
2 => file_get_contents ( 'templates/description.phtml' ),
|
|
|
|
3 => file_get_contents ( 'templates/projects.phtml' ),
|
|
|
|
4 => file_get_contents ( 'templates/ideas.phtml' ),
|
|
|
|
5 => file_get_contents ( 'templates/contact-form.phtml' ),
|
2019-01-13 17:36:09 +00:00
|
|
|
];
|
2019-01-17 12:26:20 +00:00
|
|
|
$page_content_array = [
|
2019-01-13 17:36:09 +00:00
|
|
|
'status' => 200,
|
2019-01-19 23:06:11 +00:00
|
|
|
'pageTitle' => $requested_section_title.' | Bryan Pedini',
|
2019-01-17 12:26:20 +00:00
|
|
|
'html' => $section_templates [ $requested_section ]
|
2019-01-13 17:36:09 +00:00
|
|
|
];
|
2019-01-17 12:26:20 +00:00
|
|
|
$page_content_json = json_encode($page_content_array);
|
2019-01-13 17:36:09 +00:00
|
|
|
header('Content-Type: application/json');
|
2019-01-17 12:26:20 +00:00
|
|
|
echo $page_content_json;
|
2019-01-13 17:36:09 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
|
|
<meta name="description" content="">
|
|
|
|
<meta name="author" content="">
|
2019-01-17 12:26:20 +00:00
|
|
|
<title id="page-title"><?=$requested_section_title?> | Bryan Pedini</title>
|
2019-01-13 17:36:09 +00:00
|
|
|
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
|
|
|
|
<link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
|
|
|
|
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
|
|
|
|
<link href="css/clean-blog.min.css" rel="stylesheet">
|
2019-01-17 12:26:20 +00:00
|
|
|
<link href="css/hidden-scrollbar-GUI.css" rel="stylesheet">
|
2019-01-13 17:36:09 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
|
|
|
|
<div class="container">
|
|
|
|
<a class="navbar-brand" href="#" id="navbar-home">Bryan Pedini</a>
|
|
|
|
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
|
|
|
Menu <i class="fas fa-bars"></i>
|
|
|
|
</button>
|
|
|
|
<div class="collapse navbar-collapse" id="navbarResponsive">
|
|
|
|
<ul class="navbar-nav ml-auto">
|
|
|
|
<li class="nav-item dropdown">
|
|
|
|
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">About me</a>
|
2019-01-16 23:40:15 +00:00
|
|
|
<ul class="dropdown-menu">
|
|
|
|
<li class="dropdown-item"><a href="#" id="navbar-description">A brief description</a></li>
|
|
|
|
<li class="dropdown-divider"></li>
|
|
|
|
<li class="dropdown-item"><a href="#" id="navbar-work">My current projects</a></li>
|
|
|
|
<li class="dropdown-item"><a href="#" id="navbar-ideas">My future ideas</a></li>
|
|
|
|
</ul>
|
2019-01-13 17:36:09 +00:00
|
|
|
</li>
|
|
|
|
<li class="nav-item dropdown">
|
|
|
|
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Contact me</a>
|
|
|
|
<div class="dropdown-menu">
|
|
|
|
<a href="#" class="dropdown-item" id="navbar-contact-form">Web form</a>
|
|
|
|
<a href="#" class="dropdown-item" id="navbar-contact-email">Email</a>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
<div id="user-content">
|
2019-01-16 23:40:15 +00:00
|
|
|
|
2019-01-13 17:36:09 +00:00
|
|
|
</div>
|
2019-01-19 23:06:11 +00:00
|
|
|
<footer>
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-8 col-md-10 mx-auto">
|
|
|
|
<ul class="list-inline text-center">
|
|
|
|
<li class="list-inline-item">
|
2019-01-21 06:19:07 +00:00
|
|
|
<a href="https://www.instagram.com/bryanpedini/">
|
2019-01-19 23:06:11 +00:00
|
|
|
<span class="fa-stack fa-lg">
|
|
|
|
<i class="fas fa-circle fa-stack-2x"></i>
|
|
|
|
<i class="fab fa-instagram fa-stack-1x fa-inverse"></i>
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="list-inline-item">
|
2019-01-21 06:19:07 +00:00
|
|
|
<a href="https://git.bryanpedini.it/">
|
2019-01-19 23:06:11 +00:00
|
|
|
<span class="fa-stack fa-lg">
|
|
|
|
<i class="fas fa-circle fa-stack-2x"></i>
|
|
|
|
<i class="fab fa-git fa-stack-1x fa-inverse"></i>
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="list-inline-item">
|
2019-01-21 06:19:07 +00:00
|
|
|
<a href="https://dev.bryanpedini.it/">
|
2019-01-19 23:06:11 +00:00
|
|
|
<span class="fa-stack fa-lg">
|
|
|
|
<i class="fas fa-circle fa-stack-2x"></i>
|
|
|
|
<i class="fab fa-dev fa-stack-1x fa-inverse"></i>
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p class="copyright text-muted">© Bryan Pedini <?php echo date("Y"); ?> - All rights reserved.<br>Send me an email at <a href="mailto:copyright@bryanpedini.it">this</a> link for copyright and permissions questions.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</footer>
|
2019-01-13 17:36:09 +00:00
|
|
|
<script src="vendor/jquery/jquery.min.js"></script>
|
2019-01-17 12:26:20 +00:00
|
|
|
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
|
2019-01-13 17:36:09 +00:00
|
|
|
<script src="js/clean-blog.min.js"></script>
|
2019-01-17 12:26:20 +00:00
|
|
|
<script src="js/onePageApp-sections-control.js"></script>
|
2019-01-13 17:36:09 +00:00
|
|
|
</body>
|
|
|
|
</html>
|