Example #1
0
function deleteCoachs()
{
    global $db;
    $coachs = TCFunctions::request('coachs');
    if (empty($coachs)) {
        redirectMsg('coachs.php', __('Selecciona al menos un entrenador', 'admin_template'), 1);
        die;
    }
    foreach ($coachs as $k) {
        $coach = new TCCoach($k);
        $coach->delete();
    }
    redirectMsg('coachs.php', __('Base de datos actulizada correctamente', 'admin_template'), 0);
}
Example #2
0
<?php

// $Id$
// --------------------------------------------------------------
// Equipo Club Gallos
// Un modulo sencillo para el manejo de equipos
// Author: Eduardo Cortés <*****@*****.**>
// Email: i.bitcero@gmail.com
// License: GPL 2.0
// --------------------------------------------------------------
define('TC_LOCATION', 'players');
include '../../mainfile.php';
$id = TCFunctions::get('id');
if ($id == '') {
    redirect_header(TC_URL, 1, _MS_TC_ERRID);
    die;
}
$myts =& MyTextSanitizer::getInstance();
$id = $myts->addSlashes($id);
$id = str_replace("/", "", $id);
$player = new TCPlayer($id);
if ($player->isNew()) {
    redirect_header(TC_URL, 1, _MS_TC_ERRNOEXISTIS);
    die;
}
$xoopsOption['template_main'] = "coach_player.html";
include 'header.php';
$tpl->assign('coach_title', $player->name() . " (#" . $player->number() . ")");
$tpl->assign('lang_comment', _MS_TC_COMMENT);
$tpl->assign('lang_data', _MS_TC_DATA);
$tpl->assign('lang_name', _MS_TC_NAME);
Example #3
0
function deletePlayer()
{
    global $db;
    $team = TCFunctions::request('team');
    $players = TCFunctions::request('players');
    if (empty($players)) {
        redirectMsg('players.php?team=' . $team, __('No has seleccionado jugadores para eliminar', 'admin_team'), 1);
        die;
    }
    foreach ($players as $k) {
        $player = new TCPlayer($k);
        $player->delete();
    }
    redirectMsg('players.php?team=' . $team, __('¡Jugadores eliminados!', 'admin_team'), 0);
}
Example #4
0
function deleteTeams()
{
    global $db;
    $teams = TCFunctions::request('teams');
    if (empty($teams)) {
        redirectMsg('teams.php', __('No has seleccionado ningún equipo', 'admin_team'), 1);
        die;
    }
    foreach ($teams as $k) {
        $team = new TCTeam($k);
        $team->delete();
    }
    redirectMsg('teams.php', __('Base de datos actualizada correctamente', 'admin_team'), 0);
}
Example #5
0
function deleteCategory()
{
    $id = TCFunctions::get('id');
    if ($id <= 0) {
        redirectMsg('cats.php', __('Id no válido', 'admin_team'), 1);
        die;
    }
    $cat = new TCCategory($id);
    if ($cat->isNew()) {
        redirectMsg('cats.php', __('La categoría especificada no existe', 'admin_team'), 1);
        die;
    }
    if ($cat->delete()) {
        redirectMsg('cats.php', __('Base de datos actualizada correctamente', 'admin_team'), 0);
    } else {
        redirectMsg('cats.php', __('No se puedo actualizar la base de datos', 'admin_team') . "<br />" . $cat->errors(), 1);
    }
}