示例#1
0
     if ($group_check) {
         $delete_exercises = mysqli_query($db, "DELETE FROM `group` WHERE groupID = '{$getid}'");
         if ($delete_exercises) {
             $msg = "Delete group successful";
             echo "<script> alert('Group Deleted Successfully');</script>";
             $page = "./?page=admin";
             header("Refresh: 2; URL=\"" . $page . "\"");
         }
     } else {
         echo "<script> alert('Delete Group Failed');</script>";
         $page = "./?page=admin";
         header("Refresh: 2; URL=\"" . $page . "\"");
     }
     break;
 case "perm":
     $perm_check = permissionInUse($db, $getid, "Check");
     echo $perm_check;
     if ($perm_check) {
         $delete_perm = mysqli_query($db, "DELETE FROM `group_permissions` WHERE permissionID = '{$getid}'");
         if ($delete_perm) {
             $msg = "Delete group permissions successful";
             echo "<script> alert('Group Added Successfully');</script>";
             $page = "./?page=admin";
             header("Refresh: 2; URL=\"" . $page . "\"");
         }
     } else {
         echo "<script> alert('Delete Permission Failed');</script>";
         $page = "./?page=admin";
         header("Refresh: 2; URL=\"" . $page . "\"");
     }
     break;
示例#2
0
}
?>

    <h2>Permissions Management</h2>
    <?php 
if (mysqli_num_rows($permissions) > 0) {
    print "\n        <table border=\"1\">\n        <tr>\n            <td>Permission ID</td>\n            <td>Permission Name</td>\n            <td>Create Content</td>\n            <td>Create Comments</td>\n            <td>Vote</td>\n            <td>Edit Vote (Admin)</td>\n            <td>Edit Content</td>\n            <td>Edit Comments</td>\n            <td>View Content</td>\n            <td>View Comments</td>\n            <td>Edit</td>\n            <td>Delete</td>\n        </tr>";
    while ($info = mysqli_fetch_array($permissions)) {
        echo "<trstyle='background-color:#000000;'>";
        echo "<td>" . $info['permissionID'] . "</td>";
        echo "<td>" . $info['permissionName'] . "</td>";
        echo "<td>" . $info['create_Content'] . "</td>";
        echo "<td>" . $info['create_Comments'] . "</td>";
        echo "<td>" . $info['vote'] . "</td>";
        echo "<td>" . $info['edit_Vote_Admin'] . "</td>";
        echo "<td>" . $info['edit_Content'] . "</td>";
        echo "<td>" . $info['edit_Comments'] . "</td>";
        echo "<td>" . $info['view_Content'] . "</td>";
        echo "<td>" . $info['view_Comments'] . "</td>";
        echo '<td><a href="./?page=edit_perm&id=' . $info['permissionID'] . '">Edit</a></td>';
        echo permissionInUse($db, $info['permissionID'], "Row");
        echo "</tr>";
    }
    echo "</table>";
} else {
    echo "<p>No permissions registered add one below:</p>";
}
echo "<h2>Add Permission</h2>";
include "includes/group/add_permission.php";
?>
</div>