add remove
							parent
							
								
									67b68cebec
								
							
						
					
					
						commit
						bc0c8816b9
					
				|  | @ -2,6 +2,15 @@ | ||||||
| 	$HTML->setHTMLTitle("Online Anzeige"); | 	$HTML->setHTMLTitle("Online Anzeige"); | ||||||
| 	$HTML->importSeitenInhalt("pages/HTML/online-anzeige.html"); | 	$HTML->importSeitenInhalt("pages/HTML/online-anzeige.html"); | ||||||
| 
 | 
 | ||||||
|  |     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 = ?"); | ||||||
|  |         $statementMembership->execute(array($_REQUEST['uuid'], $_SESSION['UUID']));  | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     $table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Optionen</th></thead><tbody>%%ENTRY%%</tbody></table>'; |     $table = '<table class="table"><thead><tr><th scope="col">Name</th><th scope="col">Optionen</th></thead><tbody>%%ENTRY%%</tbody></table>'; | ||||||
|      |      | ||||||
|     $statement = $RUNTIME['PDO']->prepare("SELECT * FROM Friends WHERE PrincipalID = ? ORDER BY Friend ASC"); |     $statement = $RUNTIME['PDO']->prepare("SELECT * FROM Friends WHERE PrincipalID = ? ORDER BY Friend ASC"); | ||||||
|  | @ -13,14 +22,14 @@ | ||||||
|         $FriendData = explode(";", $row['Friend']); |         $FriendData = explode(";", $row['Friend']); | ||||||
|         $Friend = $FriendData[0]; |         $Friend = $FriendData[0]; | ||||||
| 
 | 
 | ||||||
|         $entry = '<tr><td>'.trim($RUNTIME['OPENSIM']->getUserName($Friend)).'</td><td>LÖSCHEN</td></tr>'; |         $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>'; | ||||||
| 
 | 
 | ||||||
|         if(count($FriendData) > 1) |         if(count($FriendData) > 1) | ||||||
|         { |         { | ||||||
|             $FriendData[1] = str_replace("http://", "", $FriendData[1]); |             $FriendData[1] = str_replace("http://", "", $FriendData[1]); | ||||||
|             $FriendData[1] = str_replace("https://", "", $FriendData[1]); |             $FriendData[1] = str_replace("https://", "", $FriendData[1]); | ||||||
|             $FriendData[1] = str_replace("/", "", $FriendData[1]); |             $FriendData[1] = str_replace("/", "", $FriendData[1]); | ||||||
|             $entry = '<tr><td>'.trim($RUNTIME['OPENSIM']->getUserName($Friend)).' @ '.strtolower($FriendData[1]).'</td><td>LÖSCHEN</td></tr>'; |             $entry = '<tr><td>'.trim($RUNTIME['OPENSIM']->getUserName($Friend)).' @ '.strtolower($FriendData[1]).'</td><td><a href="index.php?page=friends&action=remove&uuid='.$row['Friend'].'">LÖSCHEN</a></td></tr>'; | ||||||
| 
 | 
 | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,9 +2,21 @@ | ||||||
| 	$HTML->setHTMLTitle("Deine Regionen"); | 	$HTML->setHTMLTitle("Deine Regionen"); | ||||||
| 	$HTML->importSeitenInhalt("pages/HTML/deine-regionen.html"); | 	$HTML->importSeitenInhalt("pages/HTML/deine-regionen.html"); | ||||||
| 
 | 
 | ||||||
|  |     if(@$_REQUEST['action'] == 'remove' && @$_REQUEST['region'] != '') | ||||||
|  |     { | ||||||
|  |         if(@$_SESSION['LEVEL'] >= 100) | ||||||
|  |         { | ||||||
|  |             $statementMembership = $RUNTIME['PDO']->prepare("DELETE FROM regions WHERE uuid = ?"); | ||||||
|  |             $statementMembership->execute(array($_REQUEST['region']));  | ||||||
|  |         }else{ | ||||||
|  |             $statementMembership = $RUNTIME['PDO']->prepare("DELETE FROM regions WHERE uuid = ? AND owner_uuid = ?"); | ||||||
|  |             $statementMembership->execute(array($_REQUEST['region'], $_SESSION['UUID']));  | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     $table = '<table class="table"><thead><tr><th scope="col">Region Name</th><th scope="col">Eigentümer</th><th scope="col">Position</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>'; |     $table = '<table class="table"><thead><tr><th scope="col">Region Name</th><th scope="col">Eigentümer</th><th scope="col">Position</th><th scope="col">Aktionen</th></thead><tbody>%%ENTRY%%</tbody></table>'; | ||||||
| 
 | 
 | ||||||
|     if(@$_SESSION['LEVEL'] > 100 && @$_REQUEST['SHOWALL'] == "1") |     if(@$_SESSION['LEVEL'] >= 100 && @$_REQUEST['SHOWALL'] == "1") | ||||||
|     { |     { | ||||||
|         $statement = $RUNTIME['PDO']->prepare("SELECT * FROM regions ORDER BY owner_uuid ASC"); |         $statement = $RUNTIME['PDO']->prepare("SELECT * FROM regions ORDER BY owner_uuid ASC"); | ||||||
|         $statement->execute(array($_SESSION['UUID']));  |         $statement->execute(array($_SESSION['UUID']));  | ||||||
|  | @ -17,7 +29,7 @@ | ||||||
| 
 | 
 | ||||||
|     while($row = $statement->fetch())  |     while($row = $statement->fetch())  | ||||||
|     { |     { | ||||||
|         $entry = '<tr><td>'.$row['regionName'].'</td><td>'.$RUNTIME['OPENSIM']->getUserName($row['owner_uuid']).'</td><td>'.fillString(($row['locX'] / 256), 4).' / '.fillString(($row['locY'] / 256), 4).'</td><td>TELEPORT | LÖSCHEN</td></tr>';        |         $entry = '<tr><td>'.$row['regionName'].'</td><td>'.$RUNTIME['OPENSIM']->getUserName($row['owner_uuid']).'</td><td>'.fillString(($row['locX'] / 256), 4).' / '.fillString(($row['locY'] / 256), 4).'</td><td><a href="index.php?page=regions&action=remove®ion='.$row['uuid'].'">LÖSCHEN</a></td></tr>';        | ||||||
|         $table = str_replace("%%ENTRY%%", $entry."%%ENTRY%%", $table); |         $table = str_replace("%%ENTRY%%", $entry."%%ENTRY%%", $table); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Chris
						Chris