function approve_indentRegistrant($indent_id)
 {
     $SQL = "update t_tournaments_indent set";
     $SQL .= "  player_approved= 1";
     $SQL .= " where tour_id ='{$this->tour_id}' and indent_id={$indent_id}";
     $this->SimpleDB->connect();
     $this->SimpleDB->execute($SQL);
     $this->SimpleDB->disconnect();
     // Move To Player
     $this->SimpleDB->connect();
     $SQL = "select indent_id from t_tournaments_player where indent_id={$indent_id}";
     $rst = $this->SimpleDB->query($SQL);
     if (is_object($rst) && !$rst->next()) {
         $data = $this->get_registrant($indent_id);
         $player = new player();
         $player->player_id = "";
         $player->tour_id = $data[0]['tour_id'];
         $player->player_members_id = $data[0]['player_members_id'] == "Not IJGC Members" ? " " : $data[0]['player_members_id'];
         $player->player_name = $data[0]['player_name'];
         $player->player_age = $data[0]['player_age'];
         $player->player_birthdate = $data[0]['player_birthdate'];
         $player->player_parents_name = $data[0]['player_parents_name'];
         $player->player_contactno = $data[0]['player_contactno'];
         $player->player_email = $data[0]['player_email'];
         $player->player_home_address = $data[0]['player_home_address'];
         $player->player_group = $data[0]['player_group'];
         $player->indent_id = $data[0]['indent_id'];
         $player->player_confirmed = 0;
         $tournaments = new tournaments($this->tour_id);
         $tournaments->add_player($player);
     }
     $this->SimpleDB->disconnect();
 }
Ejemplo n.º 2
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);
    }
}