function save()
 {
     JRequest::checkToken() or jexit(JText::_('COM_JOOMLEAGUE_GLOBAL_INVALID_TOKEN'));
     $msg = '';
     $link = '';
     $post = JRequest::get('post');
     $project_id = JRequest::getInt('p', 0);
     $match_id = JRequest::getInt('mid', 0);
     $changes = JRequest::getInt('changes_check', 0);
     $model = $this->getModel('editevents');
     $user = JFactory::getUser();
     $post['playerpositions'] = $model->getProjectPositions(0, 1);
     $post['staffpositions'] = $model->getProjectPositions(0, 2);
     $post['refereepositions'] = $model->getProjectPositions(0, 3);
     if ($changes && ($model->isAllowed() || $model->isMatchAdmin($match_id, $user->id))) {
         if ($model->saveMatchStartingLineUps($post)) {
             $msg .= JText::_('Changes on selected match were saved');
         } else {
             $msg .= JText::_('Error while saving changes on selected match');
         }
     } else {
         $msg .= JText::_('Found any changes or you are no match admin. So nothing is saved!');
     }
     $link = JoomleagueHelperRoute::getEditEventsRouteNew($project_id, $match_id);
     //echo '<br />'; echo $link; echo '<br />'; echo $msg; echo '<br />'; die();
     $this->setRedirect($link, $msg);
 }