Passed
Push — master ( f431a1...522a8a )
by Maxwell
02:35
created
adminpanel/approve.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 require(__DIR__ . "/dependencies.php");
3 3
 
4
-if(isset($_SESSION['user'])) {
5
-    if(isset($_GET['id'])) {
6
-        if(isAdmin($_SESSION['user'], $conn)) {
4
+if (isset($_SESSION['user'])) {
5
+    if (isset($_GET['id'])) {
6
+        if (isAdmin($_SESSION['user'], $conn)) {
7 7
             $stmt = $conn->prepare("UPDATE files SET status = 'y' WHERE id = ?");
8 8
             $stmt->bind_param("i", $_GET['id']);
9 9
             $stmt->execute();
Please login to merge, or discard this patch.
adminpanel/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 require(__DIR__ . "/dependencies.php");
3 3
 
4
-if(isset($_SESSION['user'])) {
5
-    if(isAdmin($_SESSION['user'], $conn)) {
4
+if (isset($_SESSION['user'])) {
5
+    if (isAdmin($_SESSION['user'], $conn)) {
6 6
         echo "<h1>Welcome</h1>";
7 7
     } else {
8 8
         die("not a admin");
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
     $stmt = $conn->prepare("SELECT * FROM files WHERE status = 'n'");
34 34
     $stmt->execute();
35 35
     $result = $stmt->get_result();
36
-    if($result->num_rows === 0) echo('There are no items waiting for approval.');
37
-    while($row = $result->fetch_assoc()) {
36
+    if ($result->num_rows === 0) echo('There are no items waiting for approval.');
37
+    while ($row = $result->fetch_assoc()) {
38 38
         echo "<a href='/view/?id=" . $row['id'] . "'>" . $row['title'] . "</a> by <a href='/view/profile?id=" . getID($row['author'], $conn) . "'>" . $row['author'] . "</a> @ " . $row['date'] . " | <a href='approve.php?id=" . $row['id'] . "'>Approve</a> | <a href='deny.php?id=" . $row['id'] . "'>Deny</a><br>";
39 39
     }
40 40
 ?>
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC");
46 46
     $stmt->execute();
47 47
     $result = $stmt->get_result();
48
-    if($result->num_rows === 0) echo('There are no items waiting for approval.');
49
-    while($row = $result->fetch_assoc()) {
48
+    if ($result->num_rows === 0) echo('There are no items waiting for approval.');
49
+    while ($row = $result->fetch_assoc()) {
50 50
         echo "<a href='/view/profile?id=" . $row['id'] . "'>" . $row['username'] . "</a> | <a href='ban.php?id=" . $row['id'] . "'>Ban</a><br>";
51 51
     }
52 52
 ?>
53 53
\ No newline at end of file
Please login to merge, or discard this patch.
adminpanel/ban.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 require(__DIR__ . "/dependencies.php");
3 3
 
4
-if(isset($_SESSION['user'])) {
5
-    if(isset($_GET['id'])) {
6
-        if(isAdmin($_SESSION['user'], $conn)) {
4
+if (isset($_SESSION['user'])) {
5
+    if (isset($_GET['id'])) {
6
+        if (isAdmin($_SESSION['user'], $conn)) {
7 7
             $stmt = $conn->prepare("DELETE FROM users WHERE id = ?");
8 8
             $stmt->bind_param("i", $_GET['id']);
9 9
             $stmt->execute();
Please login to merge, or discard this patch.
adminpanel/deny.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 require(__DIR__ . "/dependencies.php");
3 3
 
4
-if(isset($_SESSION['user'])) {
5
-    if(isset($_GET['id'])) {
6
-        if(isAdmin($_SESSION['user'], $conn)) {
4
+if (isset($_SESSION['user'])) {
5
+    if (isset($_GET['id'])) {
6
+        if (isAdmin($_SESSION['user'], $conn)) {
7 7
             $stmt = $conn->prepare("UPDATE files SET status = 'd' WHERE id = ?");
8 8
             $stmt->bind_param("i", $_GET['id']);
9 9
             $stmt->execute();
Please login to merge, or discard this patch.