Esempio n. 1
0
function savemember(&$smarty)
{
    $list = $_POST['member_id'];
    $tour_id = trim($_REQUEST['id']);
    $tournaments_factory = new tournament_factory();
    $tournaments = new tournaments($tour_id);
    foreach ($list as $val) {
        $data = $tournaments_factory->getMember($val);
        $player = new player();
        $player->player_id = "";
        $player->tour_id = $tour_id;
        $player->player_members_id = $data['player_members_id'];
        $player->player_name = $data['player_name'];
        $player->player_age = $data['player_age'];
        $player->player_birthdate = $data['birth_date'];
        $player->player_parents_name = $data['player_parents_name'];
        $player->player_contactno = $data['player_contactno'];
        $player->player_email = $data['player_email'];
        $player->player_home_address = $data['player_home_address'];
        $player->player_group = $data['player_group'];
        $tournaments->add_player($player);
    }
}
Esempio n. 2
0
function showForm(&$smarty)
{
    $usn = $_SESSION['usn'];
    $games_fact = new games_factory();
    $member_id = $games_fact->getMemberIDByUSN($usn);
    $tour_fact = new tournament_factory();
    $list = $tour_fact->getTournamentsOpenTopFive();
    $data = $tour_fact->getMember($member_id);
    $smarty->assign('birth_date', date("Y/m/d"));
    $smarty->assign('list', $list);
    $smarty->assign('player_member', $data['player_members_id']);
    $smarty->assign('player_name', $data['player_name']);
    $smarty->assign('player_age', $data['player_age']);
    $smarty->assign('player_parents', $data['player_parents_name']);
    $smarty->assign('player_contactno', $data['player_contactno']);
    $smarty->assign('player_email', $data['player_email']);
    $smarty->assign('player_home_address', $data['player_home_address']);
    $date = $data['birth_date'];
    if ($date == "") {
        $date = date("Y/m/d");
    }
    $smarty->assign('birth_date', substr($date, 0, 4) . "/" . substr($date, 5, 2) . "/" . substr($date, 8, 2));
    switch ($data['player_group']) {
        case "A":
            $smarty->assign('g1', 'selected');
            break;
        case "B":
            $smarty->assign('g2', 'selected');
            break;
        case "C":
            $smarty->assign('g3', 'selected');
            break;
        case "D":
            $smarty->assign('g4', 'selected');
            break;
        case "E":
            $smarty->assign('g5', 'selected');
            break;
    }
}