]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - channels/index.php
Merge pull request #20 from Madriix/main
[irc/unrealircd/unrealircd-webpanel.git] / channels / index.php
1 <?php
2 require_once "../common.php";
3 require_once "../connection.php";
4 require_once "../header.php";
5
6 if (!empty($_POST))
7 {
8 do_log($_POST);
9
10 /* Nothing being posted yet */
11
12 }
13
14 $channels = $rpc->channel()->getAll();
15
16 ?>
17 <h4>Channels Overview</h4><br>
18 <table class="container-xxl table table-sm table-responsive caption-top table-striped">
19 <thead class="table-primary">
20 <th>Name</th>
21 <th>Users</th>
22 <th>Modes</th>
23 <th>Topic</th>
24 <th>Created</th>
25 </thead>
26 <tbody>
27 <?php
28 $columns = array_column($channels, 'num_users');
29 array_multisort($columns, SORT_DESC, $channels);
30
31 foreach($channels as $channel)
32 {
33 echo "<tr>";
34 echo "<td><a href=\"details.php?chan=".urlencode(htmlspecialchars($channel->name))."\">".htmlspecialchars($channel->name)."</a></td>";
35 $s = ($channel->num_users) ? "success" : "danger";
36 echo "<td><span class=\"badge rounded-pill badge-$s\">".$channel->num_users."</span></td>";
37 $modes = (isset($channel->modes)) ? "+" . $channel->modes : "<none>";
38 echo "<td>".htmlspecialchars($modes)."</td>";
39 $topic = (isset($channel->topic)) ? htmlspecialchars($channel->topic) : "";
40 echo "<td>".$topic."</td>";
41 echo "<td>".$channel->creation_time."</td>";
42 echo "</tr>";
43 }
44
45 require_once("../footer.php");
46 ?>
47 </tbody>
48 </table>