-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin.php
152 lines (149 loc) · 4.26 KB
/
admin.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
session_start();
include('pdo.php');
if(isset($_SESSION['id'])){
if(!empty($_SESSION['id'])){
$sql3 = "SELECT * FROM user_from WHERE user_id = :u_id";
$stmt3 = $pdo->prepare($sql3);
$id = $_SESSION['id'];
$stmt3->execute(array(
":u_id" => $id
));
$rows = $stmt3->fetch(PDO::FETCH_ASSOC);
if($rows){
$found=0;
$notfound=0;
$i=0;
foreach($rows as $x => $val){
//print_r($x."=>".$val);
if(strpos($x, "form_key")>(-1)){
if($val==""){
$notfound = $notfound+1;
}
else{
$found = $found+1;
}
}
}
}
else{
header('Location: login.php?error=ACCESS INAVLID');
}
}
else{
header('Location: login.php?error=ACCESS INAVLID');
}
}
else{
header('Location: login.php?error=ACCESS INAVLID');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Form-Builder</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.14.0/css/all.css" integrity="sha384-HzLeBuhoNPvSl5KYnjx0BT+WB0QEEqLprO+NBkkk5gbc67FTaL7XIGa2w1L0Xbgc" crossorigin="anonymous">
</head>
<style>
body{
background-color:antiquewhite;
}
.navbar-dark .navbar-nav .nav-item:hover .nav-link{
border-bottom:2px solid #F67107;
transition:0.5s ease;
color:white;
}
.navbar-dark .navbar-nav .nav-link{
color:black;
font-size:18px;
border-bottom:2px solid transparent;
}
.navbar-dark .navbar-brand{
font-size:3vw;
font-family:sofia;
}
.navbar-expand-md .navbar-collapse{
justify-content:flex-end;
}
.navbar-expand-md .navbar-nav .nav-link{
padding :0.5rem 1.5rem;
}
@media only screen and (max-width:576px){
.navbar-expand-md .navbar-collapse{
justify-content:flex-start;
}
.navbar-dark .navbar-brand{
font-size:10vw;
}
}
</style>
<body>
<header>
<nav class="navbar navbar-expand-md bg-primary navbar-dark">
<!-- Brand -->
<a class="navbar-brand" href="admin.php">Form-Builder</a>
<!-- Toggler/collapsibe Button -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Navbar links -->
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="admin.php">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="admin_forms.php">Forms</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Extra</a>
</li>
<li class="nav-item">
<a class="nav-link" href="logout.php">Logout</a>
</li>
</ul>
</div>
</nav>
</header>
<div class="container">
<div class="card mt-2 shadow rounded">
<div class="card-body">
<?php
if(isset($_GET['success'])){
if(!empty($_GET['success'])){
$msg = ' <div class="alert alert-success alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">×</button>
'.$_GET['success'].'.
</div>';
echo $msg;
}
}
else if(isset($_GET['error'])){
if(!empty($_GET['error'])){
$msg = ' <div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">×</button>
'.$_GET['error'].'.
</div>';
echo $msg;
}
}
?>
<h3><strong>Total Forms Created By User : <?php echo $found; ?></strong></h3>
</div>
</div>
<div class="card mt-2 shadow rounded">
<div class="card-body">
<h4>Let's Get Started : <a class="nav-link" href="admin_forms.php">Form Section</a></h4>
</div>
</div>
</div>
</body>
</html>