public function reports($pilotid = '') { if ($pilotid == '') { $this->set('message', 'No pilot specified!'); $this->render('core_error.tpl'); return; } $this->set('pireps', PIREPData::GetAllReportsForPilot($pilotid)); $this->render('pireps_viewall.tpl'); }
/** * This is the public profile for the pilot */ public function view($pilotid = '') { if (!is_numeric($pilotid)) { preg_match('/^([A-Za-z]*)(\\d*)/', $pilotid, $matches); $code = $matches[1]; $pilotid = intval($matches[2]) - Config::Get('PILOTID_OFFSET'); } $userinfo = PilotData::getPilotData($pilotid); $this->title = 'Profile of ' . $userinfo->firstname . ' ' . $userinfo->lastname; $this->set('userinfo', $userinfo); $this->set('allfields', PilotData::GetFieldData($pilotid, false)); $this->set('pireps', PIREPData::GetAllReportsForPilot($pilotid)); $this->set('pilotcode', PilotData::GetPilotCode($userinfo->code, $userinfo->pilotid)); $this->set('allawards', AwardsData::GetPilotAwards($userinfo->pilotid)); $this->render('pilot_public_profile.tpl'); $this->render('pireps_viewall.tpl'); }
public function viewpireps() { if (!Auth::LoggedIn()) { $this->set('message', 'You are not logged in!'); $this->render('core_error.tpl'); return; } if (isset($this->post->submit_pirep) && $this->post->submit_pirep) { if (!$this->SubmitPIREP()) { $this->FilePIREPForm(); return false; } } if (isset($this->post->submit)) { /* See if the PIREP is valid, and whether it's being edited by the owner, not someone else */ $pirep = PIREPData::getReportDetails($this->post->pirepid); if (!$pirep) { $this->set('message', 'Invalid PIREP'); $this->render('core_error.tpl'); return; } # Make sure pilot ID's match if ($pirep->pilotid != Auth::$userinfo->pilotid) { $this->set('message', 'This PIREP is not yours!'); $this->render('core_error.tpl'); return; } /* Now do the edit actions */ if ($this->post->action == 'addcomment') { $ret = PIREPData::addComment($this->post->pirepid, Auth::$userinfo->pilotid, $this->post->comment); $this->set('message', 'Comment added!'); $this->render('core_success.tpl'); } elseif ($this->post->action == 'editpirep') { $ret = PIREPData::saveFields($this->post->pirepid, $_POST); $this->set('message', 'PIREP edited!'); $this->render('core_success.tpl'); } } // Show PIREPs filed $this->set('userinfo', Auth::$userinfo); $this->set('pireps', PIREPData::GetAllReportsForPilot(Auth::$userinfo->pilotid)); $this->render('pireps_viewall.tpl'); }
protected function ViewPilotDetails() { //This is for the main tab $this->set('pilotinfo', PilotData::GetPilotData($this->get->pilotid)); $this->set('customfields', PilotData::GetFieldData($this->get->pilotid, true)); $this->set('allawards', AwardsData::GetPilotAwards($this->get->pilotid)); $this->set('pireps', PIREPData::GetAllReportsForPilot($this->get->pilotid)); $this->set('countries', Countries::getAllCountries()); $this->SetGroupsData($this->get->pilotid); // For the PIREP list $this->set('pending', false); $this->set('load', 'pilotpireps'); $this->render('pilots_detailtabs.tpl'); }
/** * PilotAdmin::ViewPilotDetails() * * @return */ protected function ViewPilotDetails() { //This is for the main tab if (PilotGroups::group_has_perm(Auth::$usergroups, EDIT_PILOTS) || PilotGroups::group_has_perm(Auth::$usergroups, EDIT_GROUPS) || PilotGroups::group_has_perm(Auth::$usergroups, EDIT_AWARDS) || PilotGroups::group_has_perm(Auth::$usergroups, MODERATE_PIREPS)) { $this->set('pilotinfo', PilotData::GetPilotData($this->get->pilotid)); $this->set('customfields', PilotData::GetFieldData($this->get->pilotid, true)); $this->set('allawards', AwardsData::GetPilotAwards($this->get->pilotid)); $this->set('pireps', PIREPData::GetAllReportsForPilot($this->get->pilotid)); $this->set('countries', Countries::getAllCountries()); $this->SetGroupsData($this->get->pilotid); // For the PIREP list $this->set('pending', false); $this->set('load', 'pilotpireps'); $this->render('pilots_detailtabs.php'); } else { Debug::showCritical('Unauthorized access - Invalid Permissions.'); die; } }