?> </span></td> <td> Call Sign: <span id="sumCall"><?php echo $aircraft['callsign']; ?> </span> Type: <span id="sumType"><?php echo $aircraft['type']; ?> </span> </td> <td>Aircraft Serial #: <span id="sumSerial"><?php echo $aircraft['serial']; ?> </span></td> </tr> <tr> <td></td> <td>Next Inspection: <span id="sumNex"><?php echo date("d-m-Y", strtotime($aircraft['nextinspection'])); ?> </span></td> <td>Hours Remaining: <span id="sumRemH"><?php echo $airops->date_diff($aircraft['nextinspection'], $today); ?> </span> hour(s)</td> </tr> </table> <?php }
<?php include "airops_con.php"; //Instantiate custom DB class $airops = new AiropsDB(); // Set date to UTC date_default_timezone_set('utc'); $today = date('Y-m-d'); // Get aircraft id $aircraftid = $_GET['aircraftid']; // Select Aircraft Status $selectSQL = "SELECT * from document where entityid={$aircraftid} ORDER BY `expires` ASC"; // Fetch result set and display details $rs = $airops->exec($selectSQL); while ($docs = $rs->fetch_assoc()) { $diff = round($airops->date_diff($docs['expires'], $today) / 24); ?> <tr> <td> <?php if ($diff < 14) { echo '<span class="badge badge-danger">' . $diff . '</span>'; } else { if ($diff >= 14 && $diff < 28) { echo '<span class="badge badge-warning">' . $diff . '</span>'; } else { echo '<span class="badge badge-inverse">' . $diff . '</span>'; } } ?> </td>
<?php include 'airops_con.php'; //Instantiate custom DB class $airops = new AiropsDB(); // Set date to UTC date_default_timezone_set('utc'); // Get aircraft id $aircraftid = $_GET['aircraftid']; $query = "select a.airframe_hrs, a.engine1_hours, a.engine2_hours, \n\ta.engine1_cycles, a.engine2_cycles, a.landings, s.* \n\tfrom aircraft a inner join sector s on a.aircraftid = s.aircraftid\n\twhere a.aircraftid = {$aircraftid}"; $result = $airops->exec($query); echo "<tr>\n\t<tr>\n\t\t<td colspan='10'></td>\t\t\n\t\t<td colspan='2'>engine hours</td>\n\t\t<td colspan='2'>engine cycles</td>\t\t\t\t\n\t\t<td colspan='5'></td>\n\t</tr>\n\t<tr>\n\t\t<td>ID</td>\n\t\t<td>from</td>\n\t\t<td>to</td>\n\t\t<td>dist(nm)</td>\n\t\t<td>pic</td>\n\t\t<td>sic</td>\n\t\t<td>h c/a</td>\n\t\t<td>block time</td>\n\t\t<td>flight time</td>\n\t\t<td>airframe</td>\n\t\t<td>#1</td>\n\t\t<td>#2</td>\n\t\t<td>#1</td>\n\t\t<td>#2</td>\n\t\t<td>lnds</td>\n\t\t<td>fuel</td>\n\t\t<td>pax</td>\n\t\t<td>nature</td>\n\t\t<td>client</td>\n\t</tr>\t \n\t<!--<tr>\n\t\t<td colspan='9' align='right'><b><i>Totals carried forward </b></i></td>\n\t\t<td>3169.7</span></td>\n\t\t<td>3169.7</td>\n\t\t<td>3169.7</td>\n\t\t<td>3169.7</span></td>\n\t\t<td>9778</td>\n\t\t<td>2410</td>\n\t\t<td colspan='4' align='left'> (lbs)</td>\t\t\n\t</tr>-->\n</tr>"; $d2 = time(); $total_fTime = $total_bTime = $total_legs = $total_fuel = $total_pax = 0; $total = array(); while ($data = $result->fetch_assoc()) { $bTime = $airops->date_diff($data['block_on'], $data['block_off']); $fTime = $airops->date_diff($data['flight_on'], $data['flight_off']); echo "<tr>;\n <td align='center'>{$data['sectorid']}</td>\n <td align='center'>{$data['from']}</td>\n\t<td align='center'>{$data['to']}</td>\n\t<td align='center'>{$data['dist']}</td>\n\t<td align='center'>{$data['pic']}</td>\n\t<td align='center'>{$data['sic']}</td>\n\t<td align='center'>{$data['hca']}</td>\n\t<td align='center'>\n\t\t\tOFF " . date("H:m", strtotime($data['block_off'])) . "<span style='float:right; margin-right:5px'>" . $bTime . "</span><br/>\n\t\t\tON " . date("H:m", strtotime($data['block_on'])) . "\n\t\t</td>\n\t<td align='center'>\n\t\t\tOFF " . date("H:m", strtotime($data['flight_off'])) . "<span style='float:right; margin-right:5px'>" . $fTime . "</span><br/>\n\t\t\tON " . date("H:m", strtotime($data['flight_on'])) . "\n\t\t </td>\n\t<td align='center'>{$airops->date_diff($data['flight_on'], $data['flight_off'])}</td>\n\t<td align='center'>{$airops->date_diff($data['flight_on'], $data['flight_off'])}</td>\n\t<td align='center'>{$airops->date_diff($data['flight_on'], $data['flight_off'])}</td>\n\t<td align='center'>{$data['leg']}</td>\n\t<td align='center'>{$data['leg']}</td>\n\t<td align='center'>{$data['leg']}</td>\n\t<td align='center'>{$data['fuel_used']}</td>\n\t<td align='center'>{$data['pax']}</td>\n\t<td align='center'>{$data['nature']}</td>\n\t<td align='center'>{$data['client']}</td>\n\t</tr>"; $total_fTime += $fTime; $total_bTime += $bTime; $total_legs += $data['leg']; $total_fuel += $data['fuel_used']; $total_pax += $data['pax']; $total = array($data['airframe_hrs'], $data['engine1_hours'], $data['engine2_hours'], $data['engine1_cycles'], $data['engine2_cycles'], $data['landings']); } //echo "overal = " .$result->num_rows; echo "<tr>\n\t\t<td colspan='7' align='right'><b><i>Sub-Total: </b></i></td>\n\t\t<td style='margin-right:5px'>{$total_bTime}</td>\n\t\t<td style='margin-right:5px'>{$total_fTime}</td>\n\t\t<td>{$total_fTime}</td>\n\t\t<td>{$total_fTime}</td>\n\t\t<td>{$total_fTime}</td>\n\t\t<td>{$total_legs}</td>\n\t\t<td>{$total_legs}</td>\n\t\t<td>{$total_legs}</td>\n\t\t<td>{$total_fuel}</td>\n\t\t<td colspan='3' align='left'> {$total_pax}</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' colspan='8'><b><i>Grand-Total: </b></i></td>\t\t\n\t\t<td>{$total[0]}</td>\n\t\t<td>{$total[1]}</td>\n\t\t<td>{$total[2]}</td>\n\t\t<td>{$total[3]}</td>\n\t\t<td>{$total[4]}</td>\n\t\t<td>{$total[5]}</td>\n\t</tr>"; $result->free();