-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
71 lines (62 loc) · 1.99 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
<?php
session_start();
if(isset($_COOKIE['member_login']) && $_COOKIE['member_login']!=''){
if(isset($_SESSION['USER_ID']) && $_SESSION['USER_ID']!=''){
}else{
echo"<script>window.location.href='login.php'</script>";
}
}else{
echo"<script>window.location.href='login.php'</script>";
}
ob_start();
require_once('./classes/DBConnection.php');
$db = new DBConnection();
$page = isset($_GET['p']) ? $_GET['p'] : "forms";
ob_end_flush();
$uid=$_SESSION['USER_ID'];
?>
<!DOCTYPE html>
<html lang="en">
<style>
/* canvas {
height: 250px !important
} */
table th,
table td {
padding: 3px !important
}
</style>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Form Builder</title>
<?php include('./header.php') ?>
</head>
<body class=''>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark w-100 border-bottom border-light mb-2" id="top-nav">
<a class="navbar-brand" href="./">Form Builder App</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#nav-menu"
aria-controls="nav-menu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="nav-menu">
<ul class="navbar-nav mr-auto">
<li class="nav-item nav-forms">
<a class="nav-link" href="./index.php?p=forms"><i class="fa fa-th-list"></i> Forms</a>
</li>
<li class="nav-item nav-manage_forms">
<a class="nav-link" href="./index.php?p=manage_forms"><i class="fa fa-plus"></i> Create New</a>
</li>
</div>
</nav>
<div class="container-fluid">
<?php include("./".$page.".php") ?>
</div>
</body>
<script>
$(function() {
var page = "<?php echo $page ?>";
$('#nav-menu').find(".nav-item.nav-" + page).addClass("active")
})
</script>
</html>