Esempio n. 1
0
 public function editaircraft()
 {
     $id = $this->get->id;
     $this->set('aircraft', OperationsData::GetAircraftInfo($id));
     $this->set('title', 'Edit Aircraft');
     $this->set('action', 'editaircraft');
     $this->set('allranks', RanksData::getAllRanks());
     $this->render('ops_aircraftform.tpl');
 }
Esempio n. 2
0
 /**
  * Get the active load count based on the load factor
  *  based on the flight type: P(assenger), C(argo), H(Charter)
  */
 public static function getLoadCount($aircraft_id, $flighttype = 'P')
 {
     $flighttype = strtoupper($flighttype);
     # Calculate our load factor for this flight
     #	Charter flights always will have a 100% capacity
     if ($flighttype == 'H') {
         $load = 100;
     } else {
         # Not a charter
         $loadfactor = intval(Config::Get('LOAD_FACTOR'));
         $load = rand($loadfactor - LOAD_VARIATION, $loadfactor + LOAD_VARIATION);
         # Don't allow a load of more than 95%
         if ($load > 95) {
             $load = 95;
         } elseif ($load <= 0) {
             $load = 92;
         }
         # Use ATA standard of 72%
     }
     /*
      * Get the maximum allowed based on the aircraft flown
      */
     $aircraft = OperationsData::GetAircraftInfo($aircraft_id);
     if (!$aircraft) {
         if ($flighttype == 'C') {
             # Check cargo if cargo flight
             $count = Config::Get('DEFAULT_MAX_CARGO_LOAD');
         } else {
             $count = Config::Get('DEFAULT_MAX_PAX_LOAD');
         }
     } else {
         if ($flighttype == 'C') {
             # Check cargo if cargo flight
             $count = $aircraft->maxcargo;
         } else {
             $count = $aircraft->maxpax;
         }
     }
     $load = $load / 100;
     $currload = ceil($count * $load);
     return $currload;
 }
Esempio n. 3
0
 /**
  * Operations::editaircraft()
  * 
  * @return
  */
 public function editaircraft()
 {
     $this->checkPermission(EDIT_FLEET);
     $id = $this->get->id;
     $this->set('aircraft', OperationsData::GetAircraftInfo($id));
     $this->set('title', 'Edit Aircraft');
     $this->set('action', 'editaircraft');
     $this->set('allranks', RanksData::getAllRanks());
     $this->render('ops_aircraftform.php');
 }