<?php
namespace Bdp\Modules\EventParticipants\Controllers;

use Bdp\Modules\EventParticipants\Models\EventParticipant;

class DeleteMemberController {
	public function __construct() {
		global $_POST, $_REQUEST, $dbHandler;
		$participant = EventParticipant::loadById($_REQUEST['participant-id']);

		$dbHandler->deleteFromDb(MainController::KOMPASS_EVENTS_PARTICIPANTS, ['id' => $participant->id]);


		kompass_print_message_box(__('The participant was deleted.', BDP_LV_PLUGIN_SLUG));
		new ListGroupsAndMembersController($participant->eventId);
	}
}