예제 #1
0
파일: PIREPS.php 프로젝트: rallin/phpVMS
 public function viewreport($pirepid = '')
 {
     if ($pirepid == '') {
         $this->set('message', 'No report ID specified!');
         $this->render('core_error.tpl');
         return;
     }
     $pirep = PIREPData::getReportDetails($pirepid);
     if (!$pirep) {
         $this->set('message', 'This PIREP does not exist!');
         $this->render('core_error.tpl');
         return;
     }
     $this->set('pirep', $pirep);
     $this->set('fields', PIREPData::GetFieldData($pirepid));
     $this->set('comments', PIREPData::GetComments($pirepid));
     $this->render('pirep_viewreport.tpl');
     $this->render('route_map.tpl');
 }
예제 #2
0
 public function editpirep()
 {
     $this->set('pirep', PIREPData::GetReportDetails($this->get->pirepid));
     $this->set('allairlines', OperationsData::GetAllAirlines());
     $this->set('allairports', OperationsData::GetAllAirports());
     $this->set('allaircraft', OperationsData::GetAllAircraft());
     $this->set('fielddata', PIREPData::GetFieldData($this->get->pirepid));
     $this->set('pirepfields', PIREPData::GetAllFields());
     $this->set('comments', PIREPData::GetComments($this->get->pirepid));
     $this->render('pirep_edit.tpl');
 }
예제 #3
0
    ?>
</td>
	<td><strong>Revenue: </strong><?php 
    echo FinanceData::formatMoney($pirep->revenue);
    ?>
</td>
	<td><strong>Gross: </strong><?php 
    echo FinanceData::formatMoney($pirep->gross);
    ?>
</td>

</tr>
<?php 
    // Get the additional fields
    //	I know, badish place to put it, but it's pulled per-PIREP
    $fields = PIREPData::GetFieldData($pirep->pirepid);
    if (!$fields) {
        echo 'No additional data found';
    } else {
        $i = 1;
        echo '<tr>';
        foreach ($fields as $field) {
            if ($i == 1) {
                echo '<tr>';
            }
            echo "<td><strong>{$field->title}:</strong> {$field->value}</td>";
            if ($i == 5) {
                echo '</tr>';
                $i = 0;
            }
            $i++;