Passed
Push — master ( f2618d...c254af )
by Maxwell
02:21
created
adminpanel/index.php 2 patches
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("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.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  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.');
36
+    if($result->num_rows === 0) {
37
+        echo('There are no items waiting for approval.');
38
+    }
37 39
     while($row = $result->fetch_assoc()) {
38 40
         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 41
     }
@@ -45,7 +47,9 @@  discard block
 block discarded – undo
45 47
     $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC");
46 48
     $stmt->execute();
47 49
     $result = $stmt->get_result();
48
-    if($result->num_rows === 0) echo('There are no items waiting for approval.');
50
+    if($result->num_rows === 0) {
51
+        echo('There are no items waiting for approval.');
52
+    }
49 53
     while($row = $result->fetch_assoc()) {
50 54
         echo "<a href='/view/profile?id=" . $row['id'] . "'>" . $row['username'] . "</a> | <a href='ban.php?id=" . $row['id'] . "'>Ban</a><br>";
51 55
     }
Please login to merge, or discard this patch.