public static function getLocation($pilot) { $query = "SELECT * FROM fltbook_location WHERE pilot_id='{$pilot}'"; $real_location = DB::get_row($query); $pirep_location = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, ''); if ($real_location->last_update > $pirep_location->submitdate) { return $real_location; } else { return $pirep_location; } }
/** * Profile::index() * * @return */ public function index() { if (!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.tpl'); return; } /* * This is from /profile/editprofile */ if (isset($this->post->action)) { if ($this->post->action == 'saveprofile') { $this->save_profile_post(); } /* this comes from /profile/changepassword */ if ($this->post->action == 'changepassword') { $this->change_password_post(); } } $pilot = PilotData::getPilotData(Auth::$pilot->pilotid); if (Config::Get('TRANSFER_HOURS_IN_RANKS') == true) { $totalhours = $pilot->totalhours + $pilot->transferhours; } else { $totalhours = $pilot->totalhours; } $this->set('pilotcode', PilotData::getPilotCode($pilot->code, $pilot->pilotid)); $this->set('report', PIREPData::getLastReports($pilot->pilotid)); $this->set('nextrank', RanksData::getNextRank($totalhours)); $this->set('allawards', AwardsData::getPilotAwards($pilot->pilotid)); $this->set('userinfo', $pilot); $this->set('pilot', $pilot); $this->set('pilot_hours', $totalhours); $this->render('profile_main.tpl'); CodonEvent::Dispatch('profile_viewed', 'Profile'); }
echo url('/FBSV11/jumpseat'); ?> " method="get"> <table> <tr> <td>select airport to transfer : </td> <td > <select name="depicao" onchange="listSel(this,'cost')"> <option value="">--Select--</option> <?php foreach ($airports as $airport) { $distance = round(SchedulesData::distanceBetweenPoints($last_name->lat, $last_name->lng, $airport->lat, $airport->lng), 0); $permile = Config::Get('JUMPSEAT_COST'); $cost = $permile * $distance; $check = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, 1); if ($cost >= Auth::$userinfo->totalpay) { continue; } elseif ($check->accepted == PIREP_ACCEPTED || !$check) { echo "<option name='{$cost}' value='{$airport->icao}'>{$airport->icao} - {$airport->name} /Cost - <font color='#66FF00'>\$ {$cost}</font></option>"; } ?> <hr> <?php } ?> </select> </td> <?php