/
index.php
103 lines (96 loc) · 2.52 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
require_once('user.inc');
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Oceń-bryke.pl</title>
<link rel='stylesheet' type='text/css' href='style.css'>
<script type='text/javascript'>
function resizeUpdate()
{
iframe = document.getElementById('content_iframe');
iframe.style.height = '0px';
contentHeight = iframe.contentWindow.document.body.scrollHeight + 100;
iframe.style.height = contentHeight + 'px';
wrapper = document.getElementById('wrapper');
wrapper.style.height = '200px';
wrapHeight = contentHeight + 50;
wrapper.style.height = wrapHeight + 'px';
}
</script>
</head>
<body>
<header>
<h1 class='title'>Ocen-bryke.pl</h1>
</header>
<div id='wrapper'>
<nav>
<ul class='navbar'>
<li class='navbar'>
<div id='triangle-topright'></div>
</li>
<li class='navbar'>
<a class='navbar_link' target='content_iframe'
href='news.php' onClick="resizeUpdate()">
Nowe
</a>
</li>
<?php
if(isset($_SESSION["user"]))
{
$user = $_SESSION["user"];
if($user->zalogowany)
{
echo "
<li class='navbar'>
<a class='navbar_link' target='content_iframe'
href='logout.php' onClick='resizeUpdate()'>
Wyloguj<br>("; echo $user->nick; echo ")
</a>
</li>";
echo "
<li class='navbar'>
<a class='navbar_link' target='content_iframe'
href='myAccount.php' onClick='resizeUpdate()'>
Moje konto
</a>
</li>";
echo "
<li class='navbar'>
<a class='navbar_link' target='content_iframe'
href='myCars.php' onClick='resizeUpdate()'>
Moje bryki
</a>
</li>";
}
}
else
{
echo "
<li class='navbar'>
<a class='navbar_link' target='content_iframe'
href='login.php' onClick='resizeUpdate()'>
Zaloguj
</a>
</li>";
}
?>
</li>
<li class='navbar'>
<a class='navbar_link' target='content_iframe' href='find.php' onClick="resizeUpdate()">
Wyszukaj
</a>
</li>
<li class='navbar'>
<div id='triangle-topleft'></div>
</li>
</ul>
</nav>
<article>
<iframe id='content_iframe' name='content_iframe' src='news.php' onLoad="resizeUpdate()"></iframe>
</article>
</div>
</body>
</html>