Esempio n. 1
0
<?php

if (!defined('IN_PHPVMS') && IN_PHPVMS !== true) {
    die;
}
?>
<h3>Give Award</h3>
<?php 
$allawards = AwardsData::GetAllAwards();
if (!$allawards) {
    echo 'You have no added any awards!';
    return;
}
?>

<form id="addaward" method="POST" action="<?php 
echo adminaction('/pilotadmin/pilotawards');
?>
">
<select name="awardid">
<?php 
foreach ($allawards as $award) {
    echo '<option value="' . $award->awardid . '">' . $award->name . '</option>';
}
?>
</select>
<input type="hidden" name="pilotid" value="<?php 
echo $pilotinfo->pilotid;
?>
" />
<input type="hidden" name="action" value="addaward" />
Esempio n. 2
0
 public function awards()
 {
     if (isset($this->post->action)) {
         switch ($this->post->action) {
             case 'addaward':
                 $this->add_award_post();
                 break;
             case 'editaward':
                 $this->edit_award_post();
                 break;
             case 'deleteaward':
                 $ret = AwardsData::DeleteAward($this->post->id);
                 LogData::addLog(Auth::$userinfo->pilotid, 'Deleted an award');
                 echo json_encode(array('status' => 'ok'));
                 return;
                 break;
         }
     }
     $this->set('awards', AwardsData::GetAllAwards());
     $this->render('awards_allawards.tpl');
 }