-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
86 lines (70 loc) · 2.63 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
<?php
session_start();
if(!isset($_SESSION["username"])){
header("Location: login.php");
die;
}
function getDSN(){
$dsn = "mysql:host=localhost;port=8889;dbname=reclub";
return $dsn;
}
function getUsername(){
return 'root';
}
function getPassword(){
return 'root';
}
function getPDO(){
return new PDO(getDSN(), getUsername(), getPassword());
}
$pdo = getPDO();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "SELECT event_name, event_date, event_id FROM events";
$statement = $pdo->query($sql);
$sql2 = "SELECT event_id, first_name, last_name, email FROM event_attendances";
$statement2 = $pdo->query($sql2);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Register</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="icon" href="club_logo.png">
</head>
</head>
<body class = "w3-sand">
<header>
<div class="w3-bar w3-deep-purple" >
<h1 style="text-align:center">SIUE Real Estate club</h1>
</div>
<div class="w3-bar w3-black" >
<a href="index.php" class="w3-bar-item w3-button">Home</a>
<a href="schedule.php" class="w3-bar-item w3-button">Upcoming events</a>
<a href="about.php" class="w3-bar-item w3-button">Our team</a>
<a href="https://www.instagram.com/re.club.siue/" class="w3-bar-item w3-button"><img src="instagram_icon.png" alt="instagram icon." width="30" height="23"></a>
</div>
</header>
<div class="w3-container w3-sand" style="text-align:center;">
<u><h1 style="font-family:garamond; text-align:center" >
Current events:
</h1></u>
<div class="w3-container w3-sand" style="text-align:center;">
<h2 style="font-family:garamond; text-align:center" >
<?php
while ($row = $statement->fetch()) {
echo"
$row[2]. $row[0] on $row[1]</label><br>
";
}
?>
</h2>
</div>
<form action="event_add.php" method="GET" style="text-align:center;" >
<button class="w3-button w3-black">Add event</button>
</form> <br>
<form action="event_delete.php" method="GET" style="text-align:center;" >
<button class="w3-button w3-black">Delete event</button>
</form> <br>
</body>
</html>