-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
114 lines (87 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
104
105
106
107
108
109
110
111
112
113
114
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="author" content="Kim Albertsson">
<title>Code Mercenary</title>
<!-- jQuery -->
<script type="text/javascript" src="./js/jquery-2.0.3.js" ></script>
<script type="text/javascript" src="./js/jquery.lorem.js" ></script>
<script type="text/javascript" src="./js/jquery.lazyload.min.js"></script>
<!-- Bootstrap -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="lib/bootstrap/js/bootstrap.min.js"></script>
<!-- Knockout -->
<script type="text/javascript" src="./js/knockout-3.0.0.js"></script>
<!-- Holder -->
<script type="text/javascript" src="./js/holder.js"></script>
<!-- Handrolled -->
<link rel="stylesheet" type="text/css" href="css/styles.css">
<script>
// Global functions
// Turning ratings into stars
$.fn.stars = function()
{
return $(this).each(function()
{
// Get the value
var val = parseFloat($(this).html());
console.log(val);
// Make sure that the value is in 0 - 5 range, multiply to get width
var size = Math.max(0, (Math.min(5, val))) * 16;
// Create stars holder
var $span = $('<span />').width(size);
// Replace the numerical value with stars
$(this).html($span);
});
};
function renderStars()
{
$('span.stars').stars();
};
</script>
</head>
<!-- Kommentera mig mera -->
<body>
<?php include 'html/header.html' ?>
<div class="container">
<?php
if ( isset($_GET["page"]) )
{
$vaildPages = array( "user-view", "project-browse", "project-details", "project-add" );
$page = $_GET["page"];
if ( in_array($page, $vaildPages) )
{
include 'html/' . $page . '.html';
}
else
{
include 'html/error.html';
}
}
else
{
echo '<div class="jumbotron">';
echo '<h1>Hello, world!</h1>';
echo '<p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>';
echo '<p><a class="btn btn-primary btn-lg" role="button">Learn more</a></p>';
echo '</div>';
}
?>
</div>
<?php include 'html/footer.html' ?>
</body>
<script>
function loginTest()
{
if ( sessionStorage.sessionid )
{
document.getElementById("logged-out").style.display = "none";
}
else
{
document.getElementById("logged-in").style.display = "none";
};
}
$(document).ready( loginTest() );
</script>
</html>