Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Create connection
- $conn = new mysqli("localhost", "root", "", "enohub");
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $stmt = $conn->prepare("SELECT is_full FROM info");
- $stmt->execute();
- $res = $stmt->get_result();
- $row = $res->fetch_assoc();
- if($row['is_full'] == 0) {
- echo "Certs got room";
- } else {
- echo "Certs be full";
- }
- $stmt->close();
- ?>
- <!DOCTYPE html>
- <html>
- <title>Admin</title>
- <link rel="stylesheet" href="css/main.css">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
- <head>
- <style>
- body{
- font-family:helvetica;
- }
- @media (prefers-color-scheme: dark) {
- body{
- background-color:#000;
- color:#fff;
- }
- p{
- color:#fff;
- }
- .card-block{
- background-color:#0f0f0f;
- box-shadow:none;
- }
- .top{
- box-shadow:none;
- }
- .contact-form{
- background-color:#111;
- padding:20px;
- width:90%;
- margin:10px;
- border-radius:10px;
- box-shadow:none;
- }
- .contact-form h1{
- font-size:30px;
- color:#fff;
- }
- .contact-form input{
- max-width:300px;
- display:block;
- padding:10px;
- border-radius:10px;
- margin:10px;
- border:none;
- background-color:#222;
- color:#fff;
- width:90%;
- }
- .contact-form textarea{
- padding:10px;
- border-radius:20px;
- max-width:300px;
- border:none;
- background-color:#222;
- color:#fff;
- width:90%;
- }
- }
- </style>
- </head>
- <body>
- <center>
- <form class="contact-form" action="dashboard_handler.php" method="post" enctype="multipart/form-data">
- <input type="file" name="ipa_zip">
- <select style="max-width:300px;display:block;padding:10px;border-radius:10px;margin:10px;border:none;background-color:#222;color:#fff;width:90%;" id="group-number" name="group">
- <?php
- $groups = 0;
- while (true) {
- if(!$stmt = $conn->prepare("SELECT * FROM group" . $groups)) {
- break;
- } else {
- echo "<option value='" . $groups . "'>Group " . $groups . "</option>";
- $groups++;
- }
- }
- ?>
- </select>
- <br>
- <br>
- <button style="padding:10px;border-radius:30px;width:90%;max-width:300px;border:none;color:#fff;background-color:#303066;" type="submit" name="submit_ipa_zip">Submit</button>
- </form>
- <form class="contact-form" action="dashboard_handler.php" method="post" enctype="multipart/form-data">
- <input type="file" name="config">
- <button style="padding:10px;border-radius:30px;width:90%;max-width:300px;border:none;color:#fff;background-color:#303066;" type="submit" name="submit_config">Submit</button>
- </form>
- <form class="contact-form" action="dashboard_handler.php" method="post">
- <button style="padding:10px;border-radius:30px;width:90%;max-width:300px;border:none;color:#fff;background-color:#303066;" type="submit" name="new_group">Add a new cert Group</button>
- </form>
- <br>
- <h1>Certficiate Groups</h1>
- <table>
- <tr>
- <th>Group</th>
- <th>Number Of Users</th>
- </tr>
- <?php
- $groups = 0;
- while (true) {
- if(!$stmt = $conn->prepare("SELECT COUNT(*) FROM group" . $groups)) {
- break;
- } else {
- $stmt = $conn->prepare("SELECT COUNT(*) FROM group" . $groups);
- $stmt->execute();
- $res = $stmt->get_result();
- $row = $res->fetch_assoc();
- echo "<tr>
- <td>Group " . $groups . "</td>
- <td>" . $row['COUNT(*)'] . "</td>
- </tr>";
- $stmt->close();
- $groups++;
- }
- }
- ?>
- </table>
- <br>
- <h1>UUIDs to Add</h1>
- <table>
- <tr>
- <th>Username</th>
- <th>UUID</th>
- <th>Group</th>
- <th>Status Change</th>
- </tr>
- <?php
- $groups = 0;
- while (true) {
- if(!$stmt = $conn->prepare("SELECT username, uuid, group_num FROM group" . $groups . " WHERE status='0'")) {
- break;
- } else {
- $stmt = $conn->prepare("SELECT username, uuid, group_num FROM group" . $groups . " WHERE status='0'");
- $stmt->execute();
- $res = $stmt->get_result();
- while ($row = $res->fetch_assoc()) {
- echo "<tr>
- <td>" . $row['username'] . "</td>
- <td>" . $row['uuid'] . "</td>
- <td>" . $row['group_num'] . "</td>
- <td><form class="contact-form" action=\"dashboard_handler.php\" method=\"post\">
- <input type=\"hidden\" name=\"username_pointer\" value=" . $row['username'] . ">
- <input type=\"hidden\" name=\"group_pointer\" value=" . $row['group_num'] . ">
- <button style="padding:10px;border-radius:30px;width:90%;max-width:300px;border:none;color:#fff;background-color:#303066;" type=\"submit\" name=\"status_change\">Done!</button>
- <br>
- <br>
- <button style="padding:10px;border-radius:30px;width:90%;max-width:300px;border:none;color:#fff;background-color:#303066;" type=\"submit\" name=\"bad_uuid\">Bad UUID!</button>
- </form></td>
- </tr>";
- }
- $stmt->close();
- $groups++;
- }
- }
- ?>
- </table>
- </center>
- </body>
- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement