Summary Files Commits Branches @commit @diff @stats
path: root / src / index.php
blob: be262cd3774bd0d02f31939ed87e022fb3a397c3 (plain) (blame)
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
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Jobs</title>
	<link rel="preconnect" href="https://fonts.gstatic.com">

	<link rel="stylesheet" href="/css/master.css">
	<link rel="stylesheet" href="/css/prog.css">
	<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap" rel="stylesheet">
</head>
<body>
	<div class="site-wrapper">
		<header class="site-header">
			<h2 class="site-title"><a href="/">Job Offers</a></h2>
		</header>

		<nav class="site-nav">
			<div class="job-card">
				<a href="/">Home</a>
			</div>
			<div class="job-card">
				<a href="/CreateOffer">Create a new job offer</a>
			</div>
			<div class="job-card">
				<a href="/Dashboard">Dashboard</a>
			</div>
		</nav>

		<?php
			include_once('controllers/LandingController.php');
			include_once('controllers/CreateOfferController.php');
			include_once('controllers/DashboardLoginController.php');
			
			/* The landing page practically acts as our page router.
			 * All request get redirected to here (look at the devrix-job-board.conf) 
			 * Thanks https://www.taniarascia.com/the-simplest-php-router/
			 */
			
			$request = $_SERVER['REQUEST_URI'];
			
			switch ($request) {
				case '':
				case '/':
					LandingController::invoke();
					break;
				case '/CreateOffer':
				case '/CreateOffer/':
					CreateOfferController::invoke();
					break;
				case '/Dashboard':
				case '/Dashboard/':
					DashboardLoginController::invoke();
					break;
				default:
					http_response_code(404);
					break;
			}
		?>

		<footer class="site-footer">
			<p>Copyright 2020</p>
		</footer>
	</div>

</body>
</html>