]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - misc/channel-lookup-misc.php
Add functions for listing bans/invites/exceptions and user list
[irc/unrealircd/unrealircd-webpanel.git] / misc / channel-lookup-misc.php
1 <?php
2
3 function generate_chanbans_table($channel)
4 {
5 ?>
6 <form method="post"><p>
7 <button class="btn btn-info btn-sm" type="submit" name="delete_sel_ban">Delete</button>
8 </p>
9 <table class="table table-responsive table-hover">
10 <thead class="table-info">
11 <th><input type="checkbox" label='selectall' onClick="toggle_checkbox(this)" /></th>
12 <th>Name</th>
13 <th>Set by</th>
14 <th>Set at</th>
15 <th></th>
16 </thead>
17 <tbody>
18 <?php
19 foreach ($channel->bans as $ban) {
20 echo "<tr>";
21 echo "<td scope=\"row\"><input type=\"checkbox\" value='$ban->name' name=\"checkboxes[]\"></td>";
22 echo "<td><code>".htmlspecialchars($ban->name)."</code></td>";
23 $set_by = htmlspecialchars($ban->set_by);
24 echo "<td>$set_by</td>";
25 $set_at = $ban->set_at;
26 echo "<td>$set_at</td>";
27 echo "<td></td>";
28 echo "</tr>";
29 }
30
31 ?>
32 </tbody>
33 </table>
34 </form>
35 <?php
36 }
37 function generate_chaninvites_table($channel)
38 {
39 ?>
40 <form method="post"><p>
41 <button class="btn btn-info btn-sm" type="submit" name="delete_sel_inv">Delete</button>
42 </p>
43 <table class="table table-responsive table-hover">
44 <thead class="table-info">
45 <th><input type="checkbox" label='selectall' onClick="toggle_checkbox(this)" /></th>
46 <th>Name</th>
47 <th>Set by</th>
48 <th>Set at</th>
49 <th></th>
50 </thead>
51 <tbody>
52 <?php
53 foreach ($channel->invite_exceptions as $inv) {
54 echo "<tr>";
55 echo "<td scope=\"row\"><input type=\"checkbox\" value='$inv->name' name=\"checkboxes[]\"></td>";
56 echo "<td><code>".htmlspecialchars($inv->name)."</code></td>";
57 $set_by = htmlspecialchars($inv->set_by);
58 echo "<td>$set_by</td>";
59 $set_at = $inv->set_at;
60 echo "<td>$set_at</td>";
61 echo "<td></td>";
62 echo "</tr>";
63 }
64
65 ?>
66 </tbody>
67 </table>
68 </form>
69 <?php
70 }
71
72
73 function generate_chanexcepts_table($channel)
74 {
75 ?>
76 <form method="post"><p>
77 <button class="btn btn-info btn-sm" type="submit" name="delete_sel_ex">Delete</button>
78 </p>
79 <table class="table table-responsive table-hover">
80 <thead class="table-info">
81 <th><input type="checkbox" label='selectall' onClick="toggle_checkbox(this)" /></th>
82 <th>Name</th>
83 <th>Set by</th>
84 <th>Set at</th>
85 <th></th>
86 </thead>
87 <tbody>
88 <?php
89 foreach ($channel->ban_exemptions as $ex) {
90 echo "<tr>";
91 echo "<td scope=\"row\"><input type=\"checkbox\" value='$ex->name' name=\"checkboxes[]\"></td>";
92 echo "<td><code>".htmlspecialchars($ex->name)."</code></td>";
93 $set_by = htmlspecialchars($ex->set_by);
94 echo "<td>$set_by</td>";
95 $set_at = $ex->set_at;
96 echo "<td>$set_at</td>";
97 echo "<td></td>";
98 echo "</tr>";
99 }
100
101 ?>
102 </tbody>
103 </table>
104 </form>
105 <?php
106 }
107
108
109 function generate_chan_occupants_table($channel)
110 {
111 ?>
112 <form method="post"><p>
113
114 </p>
115 <table class="table table-responsive table-hover">
116 <thead class="table-info">
117 <th><input type="checkbox" label='selectall' onClick="toggle_checkbox(this)" /></th>
118 <th>Name</th>
119 <th>Status</th>
120 <th>Actions</th>
121 <th></th>
122 </thead>
123 <tbody>
124 <?php
125 foreach ($channel->members as $member) {
126 echo "<tr>";
127 echo "<td scope=\"row\"><input type=\"checkbox\" value='$member->id' name=\"checkboxes[]\"></td>";
128 echo "<td><a href=\"".BASE_URL."users/details.php?nick=$member->id\">".htmlspecialchars($member->name)."</a></td>";
129 echo "<td>Status</td>";
130 echo "<td>Op</td>";
131 echo "<td>Deop</td>";
132 echo "</tr>";
133 }
134
135 ?>
136 </tbody>
137 </table>
138 </form>
139
140 <?php
141 }