| Server IP : 195.130.67.5 / Your IP : 216.73.216.231 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/icd/msc/sources/ |
Upload File : |
<h2>User Management</h2>
<?php
global $mCtrl;
$action = Utils::vGet("action");
$uid = Utils::vGet("u");
switch ($action) {
case 'delete':
$query = "DELETE FROM `msc_staff` WHERE `username` = '{$uid}'";
DBUtils::execute_query($query);
$mCtrl->redirectTo("@[URLROOT]/admin_users.php");
break;
default:
break;
}
$query = "SELECT * FROM `msc_staff` ORDER BY `username`";
$rows = NULL;
$num = 0;
DBUtils::getrows($query, $rows, $num);
?>
<style>
.userstable {
border-collapse: collapse;
border: solid 1px;
}
.userstable th{
border-collapse: collapse;
border: solid 1px;
text-align: center;
font-size: 1.1em;
}
.userstable td{
border-collapse: collapse;
border: solid 1px;
text-align: center;
}
</style>
<a href="@[URLROOT]/admin_user_edit.php?mode=new">add new user</a>
<table class="userstable">
<tr>
<th>no.</th>
<th></th>
<th>Username</th>
<th>Surname</th>
<th>Forename</th>
<th>Admin</th>
<th>Roles</th>
<th>Comments</th>
</tr>
<?php
$counter = 0;
while ($row = mysqli_fetch_object($rows)){
$counter++;
Utils::prline("<tr>");
Utils::prline("<td>{$counter}</td>");
Utils::prline("<td><a href=\"@[URLROOT]/admin_users.php?action=delete&u={$row->username}\" onclick=\"return confirm('Are you sure you want to delete user \'{$row->username}\'?')\" /><img src=\"@[URLROOT]/images/action-delete.png\" border=\"0\" /></a></td>");
Utils::prline("<td><a href=\"@[URLROOT]/admin_user_edit.php?u={$row->username}\">{$row->username}</a></td>");
Utils::prline("<td>{$row->surname}</td>");
Utils::prline("<td>{$row->forname}</td>");
Utils::prline("<td>{$row->flagAdmin}</td>");
Utils::prline("<td>{$row->hasRoles}</td>");
Utils::prline("<td>{$row->Comments}</td>");
Utils::prline("</tr>");
}
?>
</table>