function store()
 {
     global $mainframe, $db, $user;
     $tourID = Request::getVar('tourID', 0);
     $post = $_POST;
     $model = Matches::getInstance();
     global $user;
     if (!$user->isSuperAdmin()) {
         YiiMessage::raseNotice("Your account not have permission to change Tournament");
         $this->redirect(Router::buildLink("gamesport", array('view' => 'tournament')));
     }
     $tourID = Request::getVar('tourID', 0);
     $db = Yii::app()->db;
     $matches_data_table = json_decode($post['matches_data_table']);
     $matches_make_first_data = $post['matches_make_first_data'];
     if ($matches_make_first_data == 1) {
         $model->make_matches($tourID, $matches_data_table);
     }
     return true;
 }