1
0
Fork 0
Manager/pages/friends.php

46 lines
2.1 KiB
PHP
Raw Normal View History

2020-08-06 01:15:07 +00:00
<?php
2021-01-06 14:42:48 +00:00
if(@$_REQUEST['action'] == 'remove' && @$_REQUEST['uuid'] != '')
{
$statementMembership = $RUNTIME['PDO']->prepare("DELETE FROM Friends WHERE Friend = ? AND PrincipalID = ?");
$statementMembership->execute(array($_REQUEST['uuid'], $_SESSION['UUID']));
$statementMembership = $RUNTIME['PDO']->prepare("DELETE FROM Friends WHERE PrincipalID = ? AND Friend = ?");
2023-08-23 16:16:34 +00:00
$statementMembership->execute(array($_REQUEST['uuid'], $_SESSION['UUID']));
header('Location: index.php?page=friends');
die();
2021-01-06 14:42:48 +00:00
}
2023-08-23 16:16:34 +00:00
$HTML->setHTMLTitle("Online Anzeige");
$HTML->importSeitenInhalt("pages/HTML/online-anzeige.html");
2020-08-06 01:15:07 +00:00
$table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Optionen</th></thead><tbody>%%ENTRY%%</tbody></table>';
2023-08-23 16:16:34 +00:00
$statement = $RUNTIME['PDO']->prepare("SELECT PrincipalID,Friend FROM Friends WHERE PrincipalID = ? ORDER BY Friend ASC");
2020-08-06 01:15:07 +00:00
$statement->execute([$_SESSION['UUID']]);
while($row = $statement->fetch())
{
$PrincipalID = explode(";", $row['PrincipalID'])[0];
$FriendData = explode(";", $row['Friend']);
$Friend = $FriendData[0];
2021-01-06 14:42:48 +00:00
$entry = '<tr><td>'.trim($RUNTIME['OPENSIM']->getUserName($Friend)).'</td><td><a href="index.php?page=friends&action=remove&uuid='.$row['Friend'].'">LÖSCHEN</a></td></tr>';
2020-08-06 01:15:07 +00:00
if(count($FriendData) > 1)
{
$FriendData[1] = str_replace("http://", "", $FriendData[1]);
$FriendData[1] = str_replace("https://", "", $FriendData[1]);
$FriendData[1] = str_replace("/", "", $FriendData[1]);
$entry = '<tr><td>'.htmlspecialchars(trim($RUNTIME['OPENSIM']->getUserName($Friend)).' @ '.strtolower($FriendData[1])).'</td><td><a href="index.php?page=friends&action=remove&uuid='.urlencode($row['Friend']).'">LÖSCHEN</a></td></tr>';
2020-08-06 01:15:07 +00:00
}
$table = str_replace("%%ENTRY%%", $entry."%%ENTRY%%", $table);
}
$table = str_replace("%%ENTRY%%", "", $table);
$HTML->ReplaceSeitenInhalt("%%ONLINE-LIST%%", $table);
$HTML->build();
echo $HTML->ausgabe();
?>