1
|
<?php
|
2
|
session_start();
|
3
|
?>
|
4
|
|
5
|
<!doctype html>
|
6
|
|
7
|
<html >
|
8
|
<head>
|
9
|
<meta charset="utf-8">
|
10
|
<title>Dalimilova kronika</title>
|
11
|
|
12
|
<!-- css -->
|
13
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
|
14
|
<link rel="stylesheet" href="view/style.css">
|
15
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
16
|
|
17
|
<!-- jQuery library -->
|
18
|
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
|
19
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script>
|
20
|
|
21
|
<!-- JavaScript -->
|
22
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
|
23
|
|
24
|
</head>
|
25
|
<body>
|
26
|
<div class="container-fluid">
|
27
|
<?php include "./view/header.html" ?>
|
28
|
<div class="row app-content">
|
29
|
<?php include "./view/menu.php" ?>
|
30
|
|
31
|
<div class="col-xs-12 col-sm-10 p-4 content d-flex">
|
32
|
<?php include "./view/indexContent.html" ?>
|
33
|
</div>
|
34
|
</div>
|
35
|
<?php include "./view/footer.html" ?>
|
36
|
</div>
|
37
|
<!--TODO logování upravit, zde pouze příklad -->
|
38
|
<?php include "./view/modals/loginModal.html" ?>
|
39
|
<?php if(isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] == true) {?>
|
40
|
<h1>LOGGEDIN!!!!!!!!!</h1>
|
41
|
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="logout()">Odhlásit se</button>
|
42
|
<?php }?>
|
43
|
</body>
|
44
|
</html>
|
45
|
|
46
|
<script>
|
47
|
function logout () {
|
48
|
var data = new FormData();
|
49
|
var xhr = new XMLHttpRequest();
|
50
|
xhr.open("POST", "controller/LogoutController.php");
|
51
|
xhr.onload = function(){
|
52
|
let search = JSON.parse(this.response);
|
53
|
console.log(search);
|
54
|
};
|
55
|
xhr.send(data);
|
56
|
return false;
|
57
|
}
|
58
|
|
59
|
</script>
|