internetprogrammierung/index.php

137 lines
3.9 KiB
PHP
Raw Normal View History

<?php
session_start();
require('dbConnect.php');
?>
2018-05-25 20:59:06 +02:00
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<title>FriendsBook</title>
2018-05-25 20:59:06 +02:00
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<!-- ccs stylesheet for Particles.js -->
<link rel="stylesheet" media="screen" href="css/style.css">
2018-06-17 23:05:13 +02:00
<script>
var PHPSESSIONUSER = '<?php echo $_SESSION['user']; ?>';
console.log(PHPSESSIONUSER);
</script>
</head>
<body>
<!-- PARTICLES JS -->
<!-- particles.js container -->
<div id="particles-js"></div>
<!-- count particles -->
<div class="count-particles">
<span class="js-count-particles">--</span> particles
</div>
<!-- Include the header-->
<?php
2018-06-17 22:23:11 +02:00
if(isset($_SESSION['user'])){
include('segments/_headerSession.php');
} else {
include('segments/_header.php');
}
?>
2018-06-17 22:23:11 +02:00
<?php #include('segments/_indexTestLoginVals.php'); ?><!-- For forms testing -->
2018-06-17 22:23:11 +02:00
<!-- Welche seite soll geladen werden-->
<?php
2018-06-17 22:23:11 +02:00
$page = '_404.html';
$p = '';
if(isset($_GET['page'])){$p = $_GET['page'];}
2018-06-17 22:23:11 +02:00
if($p == '' || $p == 'home'){
$page = '_home.php';
}
2018-06-17 22:23:11 +02:00
if($p == 'newEntry'){
$page = '_entryForm.php';
}
2018-06-17 22:23:11 +02:00
if($p == 'myFriendsBook'){
$page = '_myFriendsBook.php';
}
2018-06-17 22:23:11 +02:00
if($p == 'login'){
if(isset($_SESSION['user'])){
header('Location: index.php');
} else {
$page = '_login.php';
}
}
2018-06-17 22:23:11 +02:00
if($p == 'register'){
$page = '_register.php';
}
2018-06-17 22:23:11 +02:00
require('segments/'.$page);
2018-06-17 20:34:25 +02:00
?>
<div id="footer">
<div id="content">
2018-06-17 23:24:47 +02:00
<?php
if(isset($_SESSION['username'])){
echo("<br><span> Herzlich Willkomen " . $_SESSION['username'] . "</span>");
}
?>
2018-06-17 23:05:13 +02:00
<br>
</div>
</div>
2018-05-26 13:49:29 +02:00
<!-- Include the footer-->
<?php include('segments/_footer.html'); ?>
2018-05-25 20:59:06 +02:00
<!-- Optional JavaScript -->
<!-- scripts -->
<script src="js/particles.js"></script>
<script src="js/app.js"></script>
<!-- stats.js -->
<script src="js/stats.js"></script>
<script>
var count_particles, stats, update;
stats = new Stats;
stats.setMode(0);
stats.domElement.style.position = 'fixed';
stats.domElement.style.right = '0px';
stats.domElement.style.bottom = '35px';
document.body.appendChild(stats.domElement);
count_particles = document.querySelector('.js-count-particles');
update = function() {
stats.begin();
stats.end();
if (window.pJSDom[0].pJS.particles && window.pJSDom[0].pJS.particles.array) {
count_particles.innerText = window.pJSDom[0].pJS.particles.array.length;
}
requestAnimationFrame(update);
};
requestAnimationFrame(update);
</script>
2018-05-25 20:59:06 +02:00
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
2018-05-26 14:33:15 +02:00
<!-- import contentloader-->
<script src="js/contentloader.js"></script>
2018-05-25 20:59:06 +02:00
</body>
</html>