Blame view

index.php 1.78 KB
392aea79   Jean Wasilewski   Added database na...
1
  <?php
1e17bb7e   Jean Wasilewski   Added session var...
2
  session_start();
392aea79   Jean Wasilewski   Added database na...
3
  require_once("creds.php");
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
4
  
bfaa212b   Geoffrey PREUD'HOMME   $page definition ...
5
6
7
8
9
  $url = $_SERVER["REQUEST_URI"];
  $parsedUrl = parse_url($url);
  $path = $parsedUrl['path'];
  $explodedUrl = explode('/', $path);
  $page = end($explodedUrl);
847ea853   Geoffrey PREUD'HOMME   Ensure no .php ha...
10
  $page = str_replace('.php', '', $page);
3fe59fff   Geoffrey PREUD'HOMME   Quick sanitization
11
  $page = str_replace('.', '', $page); // TODO Better sanitization
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
12
  
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
13
14
  if ($page == '') {
  	$page = 'home';
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
15
  }
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
16
17
  $toLoad = "pages/$page.php";
  
cdf55d6e   Geoffrey PREUD'HOMME   Quick 404 redirec...
18
19
20
  if (!file_exists($toLoad)) {
  	$toLoad = '404.php';
  }
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
21
  
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
22
  if (isset($_GET['c'])) {
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
23
  	require_once("$toLoad");
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
24
  } else {
392aea79   Jean Wasilewski   Added database na...
25
  ?>
86112ecf   Geoffrey PREUD'HOMME   Added html to DOC...
26
  <!DOCTYPE html>
83cfb6f1   Jean Wasilewski   Initial scheme
27
28
  <html>
  	<head>
bff153e8   Geoffrey PREUD'HOMME   Re-ordered <head>
29
30
31
32
  		<title>Coupe de Robotique des Ecoles Primaires</title>
  		<meta name="description" content="Site Web de la Coupe de Robotique des Ecoles Primaires">
  		<meta name="author" content="Club Informatique de Polytech Lille">
  		<link rel="shortcut icon" href="favicon.ico"/>
66d6b134   Jean Wasilewski   Added viewport meta
33
  		<meta name="viewport" content="width=device-width, initial-scale=1.0">
d8c7aa8a   Jean Wasilewski   UTF8 encoding
34
  		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
f9e2f87a   Jean Wasilewski   Header completed
35
  		<meta http-equiv="X-UA-Compatible" content="IE=edge">
bff153e8   Geoffrey PREUD'HOMME   Re-ordered <head>
36
  		<link rel="stylesheet" href="css/bootstrap.min.css">
fc27b313   Jean Wasilewski   Added paffing for...
37
  		<link rel="stylesheet" href="css/crep.css">
ba995b4e   Geoffrey PREUD'HOMME   Included jquery i...
38
  		<script type="text/javascript" src="js/jquery.min.js"></script>
3d7135c9   henyxia   Now trying with t...
39
  		<script type="text/javascript" src="js/bootstrap.min.js"></script>
bff153e8   Geoffrey PREUD'HOMME   Re-ordered <head>
40
  		<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>
d447cece   Geoffrey PREUD'HOMME   Replaced &nbsp; w...
41
  		<!-- <script type="text/javascript" src="js/whirlpool.min.js"></script> -->
56c75c13   Geoffrey PREUD'HOMME   [Navigation] Ouvr...
42
  		<script type="text/javascript" src="js/crep.js"></script>
d447cece   Geoffrey PREUD'HOMME   Replaced &nbsp; w...
43
  		<!-- <script type="text/javascript" src="js/base64.js"></script> -->
83cfb6f1   Jean Wasilewski   Initial scheme
44
45
  	</head>
  	<body>
389dfe1b   Jean Wasilewski   Fixed issue with ...
46
  <?php require_once("topnavbar.php");?>
f9e2f87a   Jean Wasilewski   Header completed
47
  <?php require_once("menu.php");?>
cf13ef6c   henyxia   New menu
48
49
  		<div class="col-md-12 center-block">
  			<div class="col-md-12" id="mainContainer">
bce06567   Geoffrey PREUD'HOMME   Static PHP naviga...
50
  <?php
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
51
  	require_once("$toLoad");
bce06567   Geoffrey PREUD'HOMME   Static PHP naviga...
52
  ?>
f9e2f87a   Jean Wasilewski   Header completed
53
54
  			</div>
  		</div>
f57188db   henyxia   New footer
55
  <?php require_once("footer.php");?>
83cfb6f1   Jean Wasilewski   Initial scheme
56
  	</body>
389dfe1b   Jean Wasilewski   Fixed issue with ...
57
  </html>
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
58
59
60
61
  
  <?php
  }
  ?>