-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
172 lines (159 loc) · 7.38 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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="shortcut icon" href="../images/icon.png" type="image/jpeg" />
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<title>Admin Dashboard</title>
<!-- strat of javascript -->
<script type="text/javascript">
history.pushState(null, null, location.href);
window.onpopstate = function () {
history.go(1);
};
// history.pushState(null, null, "/");
</script>
</head>
<body>
<div class="fluid_container">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<h4>
<a class="navbar-brand" href="#">Admin Dashboard</a>
</h4>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<h5>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="sponser.php">ADD Sponser</a>
</li>
<li>
<a href="register.php">View Participant</a>
</li>
<!-- <li>
<a href="img.php">Add Partner</a>
</li> -->
<li>
<a href="index.php">LOGOUT</a>
</li>
</ul>
</h5>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<!--End of Navbar-->
<div class="container">
<div class="row">
<div class="col-md-12">
<!-- PHP -->
<!-- CODE FOR SELECTING DATA -->
<?php
session_start();
if(isset($_POST['ed_uname'])){
$ed_uname=$_POST['ed_uname'];
$_SESSION['ed_uname']=$ed_uname;
}
if(isset($_POST['ed_passw'])){
$ed_passw=$_POST['ed_passw'];
$_SESSION['ed_passw']=$ed_passw;
}
if(isset($_POST['btn_login'])){
$_SESSION['logged']=true;
if($ed_uname=="joel_charles" && $ed_passw=="joel_@123"){
// echo $_SESSION['logged'];
if (isset($_SESSION['logged']) && $_SESSION['logged'] == true){
$con=mysqli_connect("localhost","root","123456") or die("unable to connect");
mysqli_select_db($con, 'hackathon');
$sql="SELECT * FROM rsvp";
$res=mysqli_query($con,$sql);
if($res){
echo ' <h3 style="padding-top: 30px; text-align: center; text-decoration: underline; font-weight: bolder; color: #2e7af4">Admin Dashboard</h3>';
echo " <table class='table table-striped table-hover table-responsive table-bordered'>
<tr class='success'>
<th>Team Name</th>
<th>Describes</th>
<th>Member 1 - Name</th>
<th>Member 1 - Email</th>
<th>Member 1 - Contact</th>
<th>Member 2 - Name</th>
<th>Member 2 - Email</th>
<th>Member 2 - Contact</th>
<th>Member 3 - Name</th>
<th>Member 3 - Email</th>
<th>Member 3 - Contact</th>
<th>Member 4 - Name</th>
<th>Member 4 - Email</th>
<th>Member 4 - Contact</th>
<th>Coupon Code</th>
</tr>";
}
while($row=mysqli_fetch_assoc($res)){
echo " <tr class='info'>";
echo "<td>".$row['team_name']."</td>";
echo "<td>".$row['describes']."</td>";
echo "<td>".$row['m1_name']."</td>";
echo "<td>".$row['m1_email']."</td>";
echo "<td>".$row['m1_contact']."</td>";
echo "<td>".$row['m2_name']."</td>";
echo "<td>".$row['m2_email']."</td>";
echo "<td>".$row['m2_contact']."</td>";
echo "<td>".$row['m3_name']."</td>";
echo "<td>".$row['m3_email']."</td>";
echo "<td>".$row['m3_contact']."</td>";
echo "<td>".$row['m4_name']."</td>";
echo "<td>".$row['m4_email']."</td>";
echo "<td>".$row['m4_contact']."</td>";
echo "<td>".$row['coupon_name']."</td>";
echo "</tr>";
}
echo "</table>";
}
}
else {
echo '<script type="text/javascript">alert("wrong password")</script>';
echo "<script type='text/javascript'>window.location.href = 'login.php'</script>";
}
}
else{
header("location:login.php");
}
if(isset($_POST['logout'])){
header("location:login.php");
}
?>
</div>
</div>
<div class="row">
<div class="col-sm-5 col-md-5 col-lg-5"></div>
<div class="col-sm-4 col-md-4 col-lg-4">
<!-- <form action="index.php" method="POST">
<button class="btn btn-primary" name="logout" >LogOut</button>
</form> -->
</div>
<div class="col-sm-3 col-md-3 col-lg-3"></div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"></script>
</body>
</html>