/** * Profile::view() * * @param string $pilotid * @return */ public function view($pilotid = '') { $pilotid = PilotData::parsePilotID($pilotid); $pilot = PilotData::getPilotData($pilotid); $this->title = 'Profile of ' . $pilot->firstname . ' ' . $pilot->lastname; $this->set('userinfo', $pilot); $this->set('pilot', $pilot); $this->set('allfields', PilotData::getFieldData($pilotid, false)); $pirep_list = PIREPData::getAllReportsForPilot($pilotid); $this->set('pireps', $pirep_list); $this->set('pirep_list', $pirep_list); $this->set('pilotcode', PilotData::getPilotCode($pilot->code, $pilot->pilotid)); $this->set('allawards', AwardsData::getPilotAwards($pilot->pilotid)); $this->render('pilot_public_profile.tpl'); $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'); }
/** * Profile::view() * * @param string $pilotid * @return */ public function view($pilotid = '') { #replacement for OFC charts - Google Charts API - simpilot $this->set('chart_url', ChartsData::build_pireptable($pilotid, 30)); #end $pilotid = PilotData::parsePilotID($pilotid); $pilot = PilotData::getPilotData($pilotid); $this->title = 'Profile of ' . $pilot->firstname . ' ' . $pilot->lastname; $this->set('userinfo', $pilot); $this->set('pilot', $pilot); $this->set('allfields', PilotData::getFieldData($pilotid, false)); $pirep_list = PIREPData::getAllReportsForPilot($pilotid); $this->set('pireps', $pirep_list); $this->set('pirep_list', $pirep_list); $this->set('pilotcode', PilotData::getPilotCode($pilot->code, $pilot->pilotid)); $this->set('allawards', AwardsData::getPilotAwards($pilot->pilotid)); $this->render('pilot_public_profile.tpl'); $this->render('pireps_viewall.tpl'); }
<?php if (!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die; } ?> <h3>Give Award</h3> <?php $allawards = AwardsData::GetAllAwards(); if (!$allawards) { echo 'You have no added any awards!'; return; } ?> <form id="addaward" method="POST" action="<?php echo adminaction('/pilotadmin/pilotawards'); ?> "> <select name="awardid"> <?php foreach ($allawards as $award) { echo '<option value="' . $award->awardid . '">' . $award->name . '</option>'; } ?> </select> <input type="hidden" name="pilotid" value="<?php echo $pilotinfo->pilotid; ?> " /> <input type="hidden" name="action" value="addaward" />
protected function edit_award_post() { if ($this->post->name == '' || $this->post->image == '') { $this->set('message', 'The name and image must be entered'); $this->render('core_error.tpl'); return; } $ret = AwardsData::EditAward($this->post->awardid, $this->post->name, $this->post->descrip, $this->post->image); $this->set('message', 'Award Added!'); $this->render('core_success.tpl'); LogData::addLog(Auth::$userinfo->pilotid, 'Edited the award "' . $this->post->name . '"'); }
} else { $ivao = 'Not a IVAO Member'; } //Avatar if (!file_exists(SITE_ROOT . AVATAR_PATH . '/' . $pilotcode . '.png')) { $avatar = 'No avatar'; } else { $avatar = '<img src="' . SITE_URL . AVATAR_PATH . '/' . $pilotcode . '.png' . '" alt="Pilot Avatar" /> '; } //Vorstellungstext $vorstellungstext = PilotData::GetFieldValue($pilotid, 'Vorstellungstext'); if ($vorstellungstext == '') { $vorstellungstext = 'Pilot has set no description yet'; } //Awards $allawards = AwardsData::GetPilotAwards($userinfo->pilotid); if (count($allawards) != 0) { $zaehler = 0; foreach ($allawards as $award) { if ($zaehler < 2) { $awardpics = $awardpics . '<img src="' . $award->image . '" alt="' . $award->descrip . '"/> '; $zaehler = $zaehler + 1; } else { $awardpics = $awardpics . '<img src="' . $award->image . '" alt="' . $award->descrip . '"/> <br/><br/>'; $zaehler = 0; } } } else { $awardpics = 'This pilot has no awards yet'; } //Variablen Smarty übergeben
protected function DeleteAward() { AwardsData::DeletePilotAward($this->post->id); if ($award) { $this->set('message', Lang::gs('award.deleted')); $this->render('core_success.tpl'); return; } }