当前位置: 首页>>代码示例>>PHP>>正文


PHP PilotData::GetAllPilots方法代码示例

本文整理汇总了PHP中PilotData::GetAllPilots方法的典型用法代码示例。如果您正苦于以下问题:PHP PilotData::GetAllPilots方法的具体用法?PHP PilotData::GetAllPilots怎么用?PHP PilotData::GetAllPilots使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PilotData的用法示例。


在下文中一共展示了PilotData::GetAllPilots方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testTimesAdded

    public function testTimesAdded()
    {
        echo '<h3>Checking Times</h3>';
        $sql = 'SELECT `flighttime`
			  FROM ' . TABLE_PREFIX . 'pireps 
			  WHERE `accepted`=' . PIREP_ACCEPTED;
        $results = DB::get_results($sql);
        $this->added_time = 0;
        foreach ($results as $row) {
            $this->added_time = Util::AddTime($this->added_time, $row->flighttime);
        }
        heading('Time added, all PIREPS at once');
        $this->assertNotEqual(0, $this->added_time);
        heading('Time added, pilot by pilot');
        // Now calculate by PIREP
        $allpilots = PilotData::GetAllPilots();
        $total = 0;
        foreach ($allpilots as $pilot) {
            $p_hours = PilotData::getPilotHours($pilot->pilotid);
            $total = Util::AddTime($total, $p_hours);
        }
        $this->assertNotEqual(0, $total);
        heading('Comparing pilot to pilot vs all PIREPS');
        $this->assertEqual($total, $this->added_time);
        heading('Compare to STAT total hours');
        StatsData::UpdateTotalHours();
        $this->assertEqual($total, StatsData::TotalHours());
        echo '<br />';
    }
开发者ID:deanstalker,项目名称:phpVMS,代码行数:29,代码来源:times_test.php

示例2: testTimesAdded

    public function testTimesAdded()
    {
        $sql = 'SELECT `flighttime`
			  FROM ' . TABLE_PREFIX . 'pireps 
			  WHERE `accepted`=' . PIREP_ACCEPTED;
        $results = DB::get_results($sql);
        if (!$results) {
            $this->markTestSkipped('No PIREPs to test against');
        }
        $this->added_time = 0;
        foreach ($results as $row) {
            $this->added_time = Util::AddTime($this->added_time, $row->flighttime);
        }
        $this->assertNotEqual(0, $this->added_time);
        // Now calculate by PIREP
        $allpilots = PilotData::GetAllPilots();
        $total = 0;
        foreach ($allpilots as $pilot) {
            $p_hours = PilotData::getPilotHours($pilot->pilotid);
            $total = Util::AddTime($total, $p_hours);
        }
        $this->assertNotEqual(0, $total);
        $this->assertEqual($total, $this->added_time);
        StatsData::UpdateTotalHours();
        $this->assertEqual($total, StatsData::TotalHours());
    }
开发者ID:Galihom,项目名称:phpVMS,代码行数:26,代码来源:TimesTest.php

示例3: send_pilots

 public static function send_pilots()
 {
     if (!self::central_enabled()) {
         return false;
     }
     if (self::$debug === false) {
         $within_timelimit = CronData::check_hoursdiff('update_pilots', self::$limits['update_pilots']);
         if ($within_timelimit == true) {
             return false;
         }
     }
     self::set_xml('update_pilots');
     $allpilots = PilotData::GetAllPilots();
     self::$xml->addChild('total', count($allpilots));
     foreach ($allpilots as $pilot) {
         $pilot_xml = self::$xml->addChild('pilot');
         $pilot_xml->addChild('pilotid', PilotData::GetPilotCode($pilot->code, $pilot->pilotid));
         $pilot_xml->addChild('pilotname', $pilot->firstname . ' ' . $pilot->lastname);
         $pilot_xml->addChild('location', $pilot->location);
     }
     CronData::set_lastupdate('update_pilots');
     return self::send_xml();
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:23,代码来源:CentralData.class.php

示例4: resethours

 /**
  * Maintenance::resethours()
  * 
  * @return
  */
 public function resethours()
 {
     CodonModule::checkPermission(MAINTENANCE);
     echo '<h3>Updating Total Hours Count</h3>';
     $total = 0;
     echo '<p>Calculating hours for all pilots: <br />';
     $allpilots = PilotData::GetAllPilots();
     foreach ($allpilots as $pilot) {
         $hours = PilotData::UpdateFlightHours($pilot->pilotid);
         $total = Util::AddTime($total, $hours);
         echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid) . " - found {$hours} flight hours for number <br />";
     }
     echo "Pilots have a total of <strong>{$total} hours</strong><br /><br />";
     echo "<strong>Now counting from PIREPS</strong><br />";
     StatsData::UpdateTotalHours();
     echo 'Found ' . StatsData::TotalHours() . ' total hours, updated<br /></p>';
     LogData::addLog(Auth::$userinfo->pilotid, 'Reset hours');
 }
开发者ID:phpmods,项目名称:phpvms_5.5.x,代码行数:23,代码来源:Maintenance.php

示例5: edit_admin_setting

 protected function edit_admin_setting()
 {
     $pilot_id = DB::escape($this->post->pilot_id);
     $admin_level = DB::escape($this->post->admin_level);
     $cur_level = DB::escape($this->post->cur_level);
     if ($cur_level == $admin_level) {
         $this->set('pilots', PilotData::GetAllPilots());
         $this->show('exams/exam_assign_admin');
     } elseif ($cur_level == '0') {
         ExamsData::add_admin($pilot_id, $admin_level);
         $this->set('message', '<div id="success">Pilot Administrator Status Changed.</div>');
         $this->set('pilots', PilotData::GetAllPilots());
         $this->show('exams/exam_assign_admin');
     } elseif ($admin_level == '0') {
         ExamsData::delete_admin($pilot_id);
         $this->set('message', '<div id="success">Pilot Administrator Status Changed.</div>');
         $this->set('pilots', PilotData::GetAllPilots());
         $this->show('exams/exam_assign_admin');
     } else {
         ExamsData::edit_admin($pilot_id, $admin_level);
         $this->set('message', '<div id="success">Pilot Administrator Status Changed.</div>');
         $this->set('pilots', PilotData::GetAllPilots());
         $this->show('exams/exam_assign_admin');
     }
 }
开发者ID:web541,项目名称:phpVMS-ExamCenter,代码行数:25,代码来源:Exams.php

示例6: array

        $hours = PilotData::UpdateFlightHours($pilot->pilotid);
        $total = Util::AddTime($total, $hours);
    }
    echo "Pilots have a total of <strong>{$total} hours</strong><br /><br />";
    echo "<strong>Updating PIREPS  Hours</strong><br />";
    StatsData::UpdateTotalHours();
    echo 'Found ' . StatsData::TotalHours() . ' total hours, updated<br />';
}
if ($version < 20854) {
    Installer::add_to_config('USERS_ONLINE_TIME', 20, 'The StatsData::UserOnline() function - how many minutes to check');
    Installer::sql_file_update(SITE_ROOT . '/install/update_854.sql');
}
Installer::sql_file_update(SITE_ROOT . '/install/update.sql');
OperationsData::updateAircraftRankLevels();
/* Add them to the default group */
$allpilots = PilotData::GetAllPilots();
foreach ($allpilots as $pilot) {
    PilotGroups::AddUsertoGroup($pilot->pilotid, DEFAULT_GROUP);
}
/* Update expenses */
//FinanceData::updateAllExpenses();
/* Manually specify a revenue value for all PIREPs */
/*$allpireps = PIREPData::findPIREPS(array());
	if(is_array($allpireps))
	{
		foreach($allpireps as $pirep)
		{	
			$data = array(
				'price' => $pirep->price,
				'load' => $pirep->load,
				'fuelprice' => $pirep->fuelprice,
开发者ID:deanstalker,项目名称:phpVMS,代码行数:31,代码来源:update.php


注:本文中的PilotData::GetAllPilots方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。