本文整理汇总了PHP中PilotData::DeletePilot方法的典型用法代码示例。如果您正苦于以下问题:PHP PilotData::DeletePilot方法的具体用法?PHP PilotData::DeletePilot怎么用?PHP PilotData::DeletePilot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PilotData
的用法示例。
在下文中一共展示了PilotData::DeletePilot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDeleteUser
function testDeleteUser()
{
$result = PilotData::DeletePilot($this->pilotid);
$this->assertTrue($result, 'Deleting pilot');
# Verify deletion
$data = PilotData::GetPilotData($this->pilotid);
$this->assertFalse($data, "Pilot still exists");
# Last test, add a line break
echo "<br />";
}
示例2: viewpilots
public function viewpilots()
{
/* This function is called for *ANYTHING* in that popup box
Preset all of the template items in this function and
call them in the subsequent templates
Confusing at first, but easier than loading each tab
independently via AJAX. Though may be an option later
on, but can certainly be done by a plugin (Add another
tab through AJAX). The hook is available for whoever
wants to use it
*/
switch ($this->post->action) {
case 'changepassword':
$this->ChangePassword();
return;
break;
case 'deletepilot':
$pilotid = $this->post->pilotid;
$pilotinfo = PilotData::getPilotData($pilotid);
PilotData::DeletePilot($pilotid);
CodonEvent::Dispatch('pilot_deleted', 'PilotAdmin', $pilot);
$this->set('message', Lang::gs('pilot.deleted'));
$this->render('core_success.tpl');
LogData::addLog(Auth::$userinfo->pilotid, 'Deleted pilot ' . PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid) . ' ' . $pilotinfo->firstname . ' ' . $pilotinfo->lastname);
break;
/* These are reloaded into the #pilotgroups ID
so the entire groups list is refreshed
*/
/* These are reloaded into the #pilotgroups ID
so the entire groups list is refreshed
*/
case 'addgroup':
$this->AddPilotToGroup();
$this->SetGroupsData($this->post->pilotid);
$this->render('pilots_groups.tpl');
return;
break;
case 'removegroup':
$this->RemovePilotGroup();
$this->SetGroupsData($this->post->pilotid);
$this->render('pilots_groups.tpl');
return;
break;
case 'saveprofile':
if ($this->post->firstname == '' || $this->post->lastname == '') {
$this->set('message', 'The first or lastname cannot be blank!');
$this->render('core_error.tpl');
return;
}
if (intval($this->post->retired) == 1) {
$retired = true;
} else {
$retired = false;
}
$params = array('code' => $this->post->code, 'firstname' => $this->post->firstname, 'lastname' => $this->post->lastname, 'email' => $this->post->email, 'location' => $this->post->location, 'hub' => $this->post->hub, 'retired' => $retired, 'totalhours' => $this->post->totalhours, 'totalflights' => $this->post->totalflights, 'totalpay' => floatval($this->post->totalpay), 'payadjust' => floatval($this->post->payadjust), 'transferhours' => $this->post->transferhours, 'comment' => $this->post->comment);
PilotData::updateProfile($this->post->pilotid, $params);
PilotData::SaveFields($this->post->pilotid, $_POST);
/* Don't calculate a pilot's rank if this is set */
if (Config::Get('RANKS_AUTOCALCULATE') == false) {
PilotData::changePilotRank($this->post->pilotid, $this->post->rank);
} else {
RanksData::calculateUpdatePilotRank($this->post->pilotid);
}
StatsData::UpdateTotalHours();
$this->set('message', 'Profile updated successfully');
$this->render('core_success.tpl');
$pilot = PilotData::getPilotData($this->post->pilotid);
LogData::addLog(Auth::$userinfo->pilotid, 'Updated profile for ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' ' . $pilot->firstname . ' ' . $pilot->lastname);
return;
break;
}
if ($this->get->action == 'viewoptions') {
$this->ViewPilotDetails();
return;
}
$this->ShowPilotsList();
}