-
Notifications
You must be signed in to change notification settings - Fork 2
/
panel.php
140 lines (133 loc) · 4.89 KB
/
panel.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
<?php
session_start();
require_once("conf.ini.php");
if (!isset($_SESSION['logged_in'])) {
header("Location: .");
}
$user = $_SESSION['logged_in'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<title>LAHS Hack Club | Admin</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<link href="css/panel.css" type="text/css" rel="stylesheet" media="screen,projection"/>
</head>
<body>
<nav class="blue darken-3" role="navigation">
<div class="nav-wrapper container">
<ul class="right hide-on-med-and-down">
<li><a href="logout.php">Log Out</a></li>
</ul>
<ul id="nav-mobile" class="side-nav">
<li>
<div class="user-view">
<a href="panel.php"><span class="name"><img src="img/lahshackclub.png" /> Logged in as <?php echo $user; ?></span></a>
</div>
</li>
<br>
<li><div class="divider"></div></li>
<li><a class="waves-effect" href="panel.php?list">Mailing List</a></li>
<li><a class="waves-effect" href="panel.php?email">Send New Email</a></li>
<li><a class="waves-effect" href="panel.php?custom">Custom Domain</a></li>
</ul>
<a href="#" data-activates="nav-mobile" class="button-collapse"><i class="material-icons">menu</i></a>
</div>
</nav>
<ul id="navigation-sidebar" class="side-nav fixed">
<li>
<div class="user-view">
<a href="panel.php"><span class="name"><img src="img/lahshackclub.png" /> Logged in as <?php echo $user; ?></span></a>
</div>
</li>
<br>
<li><div class="divider"></div></li>
<li><a class="waves-effect" href="panel.php?list">Mailing List</a></li>
<li><a class="waves-effect" href="panel.php?email">Send New Email</a></li>
<li><a class="waves-effect" href="panel.php?custom">Custom Domain</a></li>
</ul>
<div class="row" style="padding: 10px 25px">
<?php
if (isset($_GET['list'])) {
?>
<table class="responsive-table">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Year of Graduation</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
$connection = mysqli_connect("127.0.0.1", $username, $password, $database);
$query = mysqli_query($connection, "SELECT * FROM `users`;");
while ($row = mysqli_fetch_array($query)) {
echo "<tr><td>" . $row['first_name'] . "</td><td>" . $row['last_name'] . "</td><td>" . $row['email'] . "</td><td>" . $row['year'] . "</td><td><a class='waves-effect waves-light btn red delete' id='" . $row['email']. "'>delete</a></td></tr>";
}
?>
</tbody>
</table>
<?php
} else if (isset($_GET['email'])) {
?>
<h5 class='center'>This will be sent to everyone on the mailing list.</h5>
<div class="container">
<div class="input-field">
<input id="subject" type="text" class="validate">
<label for="subject">Subject</label>
</div>
<div class="input-field">
<textarea id="message" class="materialize-textarea"></textarea>
<label for="message">Message</label>
</div>
<div class="input-field">
<a class="btn waves-effect waves-light col s12 blue darken-3" id="send-mail">Send</a>
</div>
</div>
<?php
} else if (isset($_GET['custom'])) {
?>
<div class="container">
<div class="row">
<div class="input-field col s12 m6 l6">
<input id="custom_username" type="text" class="validate" maxlength="255">
<label for="custom_username">Username</label>
</div>
<div class="input-field col s6 l6">
<input id="custom_email" type="email" class="validate">
<label for="custom_email" data-error="Invalid Email!" data-success="Valid Email">Email</label>
</div>
<h6 class="center"><a class="btn waves-effect waves-light col s12 blue darken-3" id="custom_submit">Submit</a></h6>
</div>
</div>
<?php
} else {
echo "<h4 class='center'>Choose an option on the left to get started.</h4>";
}
?>
</div>
<div id="info-modal" class="modal">
<div class="modal-content">
<h4 id="info-modal-header"></h4>
<p id="info-modal-content"></p>
</div>
<div class="modal-footer">
<a class="modal-action waves-effect waves-green btn-flat" id="continue-delete">Continue</a>
<a class="modal-action modal-close waves-effect waves-green btn-flat">Dismiss</a>
</div>
</div>
<!-- Scripts-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="js/materialize.js"></script>
<script src="js/init.js"></script>
<script src="js/panel.js"></script>
</body>
</html>