<?php

if (!isset($gCms)) exit;

if (! $this->CheckPermission('Use Play'))
	return $this->DisplayErrorPage($id, $params, $returnid,$this->Lang('accessdenied'));

if (!isset($params['playerid']))
	return $this->DisplayErrorPage($id, $params, $returnid,$this->Lang('error_noplayerid'));


include_once dirname(__FILE__).'/class.player.php';

$errors = array();


$playerid = $params['playerid'];
$player = new pPlayer();
$player->loaddb($playerid);
if (!$player->deletedb())
	$errors[] = $this->lang('error_deletedb');


if (count($errors)>0)
{
	$module_error = '';
	foreach ($errors as $error)
		$module_error .= $error."<br />";
	$module_error = array("module_error"=>$module_error);
}
else
	$module_error = array();

$this->redirect($id,'defaultadmin','',array_merge(array("active_tab"=>"players"),$module_error));



?>