-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsiteCommon.php
executable file
·87 lines (71 loc) · 2.05 KB
/
siteCommon.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
<?php
/*
Title: Easy Dinner Project
Purpose: Methods to render Common Site Header and Footer
Author: Rick Faulkner
Date: January 2016
*/
function displayPageHeader($pageTitle)
{
$output = <<<ABC
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Easy Dinner</title>
<link rel="stylesheet" href="../stylesCommon.css" type="text/css" />
</head>
<body>
<header>
<div class=image>
<img src="../TheCoverPhoto.jpg" alt="pots and Pans"/>
<h2><span>Easy Dinner: </br></br> $pageTitle</span class="spacer"></h2>
</div>
</header>
<nav>
<ul>
<li><a href="../home.php" target="_self">Home</a></li>
<ul id="Recipes">
<li><a href="../Login_Register/loginForm.php" target="_self"</a></li>
<li><a href="../Recipe/searchRecipe.php" target="_self">Search Recipies</a></li>
<li><a href="../Recipe/newRecipe.php" target="_self">Add A Recipe<a/></li>
<li><a href="../Recipe/editRecipe.php" target="_self">Edit Recipe</a></li>
<ul>
<body>
<div id="bg-right"></div>
<div id="bg-left"></div>
</body>
ABC;
$logStatus = (isset($_SESSION['userInfo']));
// if the user is authenticated, display "Log Out", else Log In"
if ($logStatus)
{
$permission = $_SESSION['userInfo']['userrolefk'];
if($permission == 1){
$output .= '<li><a href="../Login_Register/admin.php">Admin</a></li>';
}
$output .= '<li><a href="../Login_Register/logout.php">Log Out</a></li>';
}
else
{
// echo $_SESSION['userInfo']['UserRoleFK'];
$output .= '<li><a href="../Login_Register/loginform.php">Log In</a></li>';
}
$output .= "</ul></nav>";
echo $output;
}
function displayPageFooter()
{
$year = date('Y');
$output = <<<ABC
<footer>
<address>
© $year Easy Dinner Project
</address>
</footer>
</body>
</html>
ABC;
echo $output;
}
?>