|
|
@ -26,17 +26,15 @@ if(isset($_SESSION["role"])){ |
|
|
|
<?php |
|
|
|
include "menu.php"; |
|
|
|
?> |
|
|
|
<hr> |
|
|
|
<!-- PHP výpis pro příspěvky --> |
|
|
|
<h2>Příspěvky</h2> |
|
|
|
|
|
|
|
<table> |
|
|
|
<table class="table"> |
|
|
|
<tr> |
|
|
|
<th>id</th> |
|
|
|
<th>title</th> |
|
|
|
<th>msg</th> |
|
|
|
<th>Autor</th> |
|
|
|
<th>role autora</th> |
|
|
|
<th>čas vytvoření</th> |
|
|
|
<th>delete</th> |
|
|
|
<th>update</th> |
|
|
@ -51,15 +49,24 @@ if(isset($_SESSION["role"])){ |
|
|
|
|
|
|
|
if (mysqli_num_rows($result) > 0) { |
|
|
|
while ($row = mysqli_fetch_assoc($result)){ |
|
|
|
echo "<tr>"; |
|
|
|
if ($row["role"] == "1"){ |
|
|
|
echo "<tr class=\"bg-primary-subtle\">";//admin |
|
|
|
} |
|
|
|
if ($row["role"] == "3"){ |
|
|
|
echo "<tr class=\"bg-success-subtle\">";//moderator |
|
|
|
} |
|
|
|
if ($row["role"] == "5"){ |
|
|
|
echo "<tr class=\"bg-warning-subtle\">";//ucet |
|
|
|
} |
|
|
|
|
|
|
|
echo "<td>".$row["id"]."</td>"; |
|
|
|
echo "<td>".$row["title"]."</td>"; |
|
|
|
echo "<td><strong>".$row["title"]."</strong></td>"; |
|
|
|
echo "<td>".$row["msg"]."</td>"; |
|
|
|
echo "<td><i>".$row["username"]."</i></td>"; |
|
|
|
//echo "<td>".$row["role"]."</td>"; //id=5"> |
|
|
|
echo "<td>".$row["created"]."</td>"; |
|
|
|
echo "<td>".$row["username"]."</td>"; |
|
|
|
echo "<td>".$row["role"]."</td>"; //id=5"> |
|
|
|
echo "<td> <a href=\"action_delete.php?id=".$row["id"]."\">Delete</a></td>"; |
|
|
|
echo "<td> <a href=\"update_prispevky.php?id=".$row["id"]."\">UPDATE</a></td>"; |
|
|
|
echo "<td> <a class=\"btn btn-danger\" href=\"action_delete.php?id=".$row["id"]."\">Delete</a></td>"; |
|
|
|
echo "<td> <a class=\"btn btn-warning\" href=\"update_prispevky.php?id=".$row["id"]."\">UPDATE</a></td>"; |
|
|
|
echo "</tr>"; |
|
|
|
} |
|
|
|
} |
|
|
@ -67,6 +74,12 @@ if(isset($_SESSION["role"])){ |
|
|
|
</table> |
|
|
|
|
|
|
|
<h2>Users</h2> |
|
|
|
<table class="table"> |
|
|
|
<tr> |
|
|
|
<th>ID</th> |
|
|
|
<th>Username</th> |
|
|
|
<th>role</th> |
|
|
|
</tr> |
|
|
|
<?php |
|
|
|
|
|
|
|
$sql = "SELECT * FROM nk_users"; |
|
|
@ -74,11 +87,26 @@ if(isset($_SESSION["role"])){ |
|
|
|
|
|
|
|
if (mysqli_num_rows($result) > 0) { |
|
|
|
while ($row = mysqli_fetch_assoc($result)){ |
|
|
|
echo "<p>id:".$row["id"]."; user:".$row["username"]."</p>"; |
|
|
|
//echo "<p>id:".$row["id"]."; user:".$row["username"]."</p>"; |
|
|
|
|
|
|
|
if ($row["role"] == "1"){ |
|
|
|
echo "<tr class=\"bg-primary-subtle\">";//admin |
|
|
|
} |
|
|
|
if ($row["role"] == "3"){ |
|
|
|
echo "<tr class=\"bg-success-subtle\">";//moderator |
|
|
|
} |
|
|
|
if ($row["role"] == "5"){ |
|
|
|
echo "<tr class=\"bg-warning-subtle\">";//ucet |
|
|
|
} |
|
|
|
echo "<td>".$row["id"]."</td>"; |
|
|
|
echo "<td>".$row["username"]."</td>"; |
|
|
|
echo "<td>".$row["role"]."</td>"; |
|
|
|
echo "</tr>"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
?> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
|
|
|
|
<?php |
|
|
|