Exemplo n.º 1
0
        $wpdb->query("DELETE FROM {$table1}\n\t\t WHERE id= " . $del_id . "");
    }
}
delete_team();
function delete_tourmanment()
{
    global $wpdb;
    $table1 = $wpdb->prefix . 'igtour';
    if (isset($_REQUEST["deltour_id"])) {
        $del_id = $_REQUEST["deltour_id"];
    }
    if (isset($del_id)) {
        global $wpdb;
        $wpdb->query("DELETE FROM {$table1}\n\t\t WHERE id= " . $del_id . "");
    }
}
delete_tourmanment();
function delete_game()
{
    global $wpdb;
    $table1 = $wpdb->prefix . 'iggame';
    if (isset($_REQUEST["delgame_id"])) {
        $del_id = $_REQUEST["delgame_id"];
    }
    if (isset($del_id)) {
        global $wpdb;
        $wpdb->query("DELETE FROM {$table1}\n\t\t WHERE id= " . $del_id . "");
    }
}
delete_game();
Exemplo n.º 2
0
    $query = sprintf("SELECT t_id FROM c4m_tournament WHERE t_id = '%s'", mysql_real_escape_string($id));
    $result = mysql_query($query, $oR3DCQuery->link);
    if ($result === false) {
        exit(_T('IDS_Admin_Tournament_Games_IDQUERYFAILED', $config));
    }
    $cnt = mysql_num_rows($result);
    if ($cnt == 0) {
        exit(_T('IDS_Admin_Tournament_Games_IDINVALID', $config));
    }
    $__pd['tournament_id'] = $id;
}
if (!isset($__pd['error'])) {
    // Check if a game delete request happened.
    if (isset($_GET['delete'])) {
        $gid = $_GET['delete'];
        $result = delete_game($id, $gid, $oR3DCQuery);
        if ($result['success']) {
            $str = _T('IDS_Admin_Tournament_Games_GAMEDELETED', $config);
            $__pd['delete_msg'] = preg_replace('/\\{id\\}/', $gid, $str);
        } else {
            $str = _T('IDS_Admin_Tournament_Games_GAMEDELETEERROR', $config);
            $__pd['delete_msg'] = preg_replace(array('/\\{id\\}/', '/\\{error\\}/'), array($gid, $result['errormsg']), $str);
        }
        $__pd['delete_success'] = $result['success'];
    }
    // Get the games data.
    $__pd['games'] = __get_games($__pd['tournament_id'], $oR3DCQuery, $config);
}
function __get_games($id, $main, $config)
{
    // Get player list, because we want to show the player names.