-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainpage.php
More file actions
83 lines (68 loc) · 2.48 KB
/
Copy pathmainpage.php
File metadata and controls
83 lines (68 loc) · 2.48 KB
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
<?php
session_start();
if( !$_SESSION['user']['type'] )
{
echo "you are not logged in";
}
?>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>MainPage</title>
</head>
<style>
.login-panel {
margin-top: 150px;
}
.link1 {
display: inline-block;
position: center;
}
.link2 {
display: inline-block;
margin-left: 20px;
}
</style>
<body>
<div class="container"><!-- container class is used to centered the body of the browser with some decent width-->
<div class="row"><!-- row class is used for grid system in Bootstrap-->
<div class="col-md-4 col-md-offset-4"><!--col-md-4 is used to create the no of colums in the grid also use for medimum and large devices-->
<div class="login-panel panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">MainPage</h3>
</div>
<div class="panel-body">
<fieldset>
<!--//sign in button-->
<?php
if( !isset($_SESSION['user']['type']) && empty($_SESSION['user']['type']) ){
echo ("<button onclick= \"location.href='signin.php'\">Sign in</button>");
}
?>
<?php //userpage button
if ( isset($_SESSION['user']['type']) ){
echo ("<button onclick= \"location.href='user.php'\">UserPage</button>");
}
?>
<div class="link1">
<?php
if ($_SESSION['user']['type'] == 1){
?><button onclick= location.href='admin.php'>Adminpage</button><?php
}
?>
</div>
</fieldset>
<div class="link2">
</div>
<?php
if( isset($_SESSION['user']['type']) ) {
echo ("<button onclick= \"location.href='logout.php'\">Log out</button>");
}
?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>