Summary Files Commits Branches @commit @diff @stats
path: root / src / index.php
blob: a855b09b21693e8ae191cc9ff0a711934732e636 (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
<!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">
			<h1 class="site-title"><a href="/">Job Offers</a></h2>
		</header>

		<?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 | Developer links: 
				<a href="/Dashboard">Dashboard</a>,
				<a href="/">Home</a>,
				<a href="/single.html">Single</a>
			</p>
		</footer>
	</div>

</body>
</html>