function store() { global $mainframe, $db, $user; $post = $_POST; $model = Tournaments::getInstance(); global $user; if (!$user->isSuperAdmin()) { YiiMessage::raseNotice("Your account not have permission to add/edit Tournament"); $this->redirect(Router::buildLink("gamesport", array('view' => 'tournaments'))); } $id = Request::getVar("id", 0); $obj_tblTournament = YiiTables::getInstance(TBL_GS_TOURNAMEMANTS); $obj_tblTournament->load($id); $obj_tblTournament->_ordering = isset($post['ordering']) ? $post['ordering'] : null; $obj_tblTournament->_old_parent = $obj_tblTournament->parentID; $obj_tblTournament->bind($post); $obj_tblTournament->store(); return $obj_tblTournament->id; }
function showRound(&$smarty, $tour_id) { $tour = new Tournaments($tour_id); $date = date("Y/m/d"); $smarty->assign('round_date', $date); $smarty->assign('datalist', $tour->getRoundList()); }