|
|
@@ -65,17 +65,20 @@ function delete_player( $player ) {
|
|
|
} catch (PDOException $e) {
|
|
|
// handle the exception here
|
|
|
}
|
|
|
- $maintainer = $_REQUEST['m'];
|
|
|
+ $maintainer_id = $_REQUEST['maintainer'];
|
|
|
|
|
|
$query = "DELETE FROM player WHERE player = ? AND maintainer = ?;";
|
|
|
$stmt = $pdo->prepare( $query );
|
|
|
- $stmt->execute( [$player, $maintainer] );
|
|
|
- $maintainer = get_maintainer( $maintainer );
|
|
|
- if ( $player == $maintainer ) {
|
|
|
+ $stmt->execute( [$player, $maintainer_id] );
|
|
|
+ $maintainer = get_maintainer( $maintainer_id );
|
|
|
+ if ( $player == $maintainer_id ) {
|
|
|
// Poof
|
|
|
$query = "DELETE FROM maintainer WHERE maintainer = ?";
|
|
|
$stmt = $pdo->prepare( $query );
|
|
|
$stmt->execute( [$maintainer] );
|
|
|
+ unset( $_REQUEST['action'] );
|
|
|
+ unset( $_REQUEST['maintainer'] );
|
|
|
+ unset( $_REQUEST['player'] );
|
|
|
$maintainer = [0, '?'];
|
|
|
}
|
|
|
return $maintainer;
|