Exemple #1
0
 /**
  * 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');
 }
Exemple #2
0
 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');
 }
} 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
Exemple #4
0
 /**
  * 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;
     }
 }