1
0
Fork 0

add leave group

master
Chris 2021-01-06 15:28:13 +01:00
parent 21be4b89ea
commit 67b68cebec
1 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,12 @@
$HTML->setHTMLTitle("Gruppen");
$HTML->importSeitenInhalt("pages/HTML/deine-regionen.html");
if(@$_REQUEST['action'] == 'leave' && @$_REQUEST['group'] != '')
{
$statementMembership = $RUNTIME['PDO']->prepare("DELETE FROM os_groups_membership WHERE GroupID = ? AND PrincipalID = ?");
$statementMembership->execute(array($_REQUEST['group'], $_SESSION['UUID']));
}
$table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Gründer</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>';
$statementMembership = $RUNTIME['PDO']->prepare("SELECT * FROM os_groups_membership WHERE PrincipalID = ? ORDER BY GroupID ASC");
@ -14,7 +20,7 @@
while($rowGroups = $statementGroups->fetch())
{
$entry = '<tr><td>'.$rowGroups['Name'].'</td><td>'.$RUNTIME['OPENSIM']->getUserName($rowGroups['FounderID']).'</td><td>VERLASSEN</td></tr>';
$entry = '<tr><td>'.$rowGroups['Name'].'</td><td>'.$RUNTIME['OPENSIM']->getUserName($rowGroups['FounderID']).'</td><td><a href="index.php?page=groups&action=leave&group='.$rowGroups['GroupID'].'">VERLASSEN</a></td></tr>';
$table = str_replace("%%ENTRY%%", $entry."%%ENTRY%%", $table);
}
}