<?php $__env->startSection('content'); ?>
    <div class="container">
    <h2 class="content-heading">Report <small>view maintenance report</small></h2>
    <!-- <h2 class="table-header">Tower Report</h2> -->
            <table id="Report" class="styled-table">
                        
                        <thead>
                            <tr>
                                <th>S/N</th>
                                            <th>Aircraft Name</th>
            <th>Aircraft Type</th>
            <th>Aircraft Operator</th>
            <th>Call-Sign</th>
            <th>Length (Meters)</th>
            <th>Status</th>
            <th>Mileage</th>
            <th>MTOW</th>
            <th>Year of Manufacture</th>
            <th>Maintenance Agent</th>
            <th>Agent NCAA ID No.</th>
            <th>Maintenance Engineer</th>
            <th>Engineer GSM</th>
            <th>Maintenance Schedule 1</th>
            <th>Maintenance Schedule 2</th>
            <th>Maintenance Schedule 3</th>
            <th>Maintenance Schedule 4</th>
            <th>Maintenance Schedule 5</th>
            <th>Maintenance Schedule 6</th>
            <th>Maintenance Schedule 7</th>
            <th>Maintenance Schedule 8</th>
                            </tr>
                        </thead>

                        <tfoot>
                            <tr>
                                <th>S/N</th>
                                           <th>Aircraft Name</th>
            <th>Aircraft Type</th>
            <th>Aircraft Operator</th>
            <th>Call-Sign</th>
            <th>Length (Meters)</th>
            <th>Status</th>
            <th>Mileage</th>
            <th>MTOW</th>
            <th>Year of Manufacture</th>
            <th>Maintenance Agent</th>
            <th>Agent NCAA ID No.</th>
            <th>Maintenance Engineer</th>
            <th>Engineer GSM</th>
            <th>Maintenance Schedule 1</th>
            <th>Maintenance Schedule 2</th>
            <th>Maintenance Schedule 3</th>
            <th>Maintenance Schedule 4</th>
            <th>Maintenance Schedule 5</th>
            <th>Maintenance Schedule 6</th>
            <th>Maintenance Schedule 7</th>
            <th>Maintenance Schedule 8</th>
                            </tr>
                        </tfoot>

                        <tbody>
                       <?php
                       $servername = "localhost:3306";
                        $username = "ncaa_controlportal";
                        $password = "?)*Sx8_GBX1C";
                        $dbname = "ncaa_portal";
                        
                        // Create connection
                        $conn = new mysqli($servername, $username, $password, $dbname);
                        
                        // Check connection
                        if ($conn->connect_error) {
                            die("Connection failed: " . $conn->connect_error);
                        }
                        
                        // SQL query to select data from the database
                        $sql = "SELECT * FROM RoutineMaintenance";
                        $result = $conn->query($sql);

if ($result->num_rows > 0) {
  
  


    while ($row = $result->fetch_assoc()) {
        echo '<tr>';
        echo '<td>' . $row['SNo'] . '</td>';
        echo '<td>' . $row['AircraftName'] . '</td>';
        echo '<td>' . $row['AircraftType'] . '</td>';
        echo '<td>' . $row['AircraftOperator'] . '</td>';
        echo '<td>' . $row['CallSign'] . '</td>';
        echo '<td>' . $row['LengthMeters'] . '</td>';
        echo '<td>' . $row['Status'] . '</td>';
        echo '<td>' . $row['Mileage'] . '</td>';
        echo '<td>' . $row['MTOW'] . '</td>';
        echo '<td>' . $row['YearOfManufacture'] . '</td>';
        echo '<td>' . $row['MaintenanceAgent'] . '</td>';
        echo '<td>' . $row['AgentNCAANo'] . '</td>';
        echo '<td>' . $row['MaintenanceEngineer'] . '</td>';
        echo '<td>' . $row['EngineerGSM'] . '</td>';
        echo '<td>' . $row['MaintenanceSchedule1'] . '</td>';
        echo '<td>' . $row['MaintenanceSchedule2'] . '</td>';
        echo '<td>' . $row['MaintenanceSchedule3'] . '</td>';
        echo '<td>' . $row['MaintenanceSchedule4'] . '</td>';
        echo '<td>' . $row['MaintenanceSchedule5'] . '</td>';
        echo '<td>' . $row['MaintenanceSchedule6'] . '</td>';
        echo '<td>' . $row['MaintenanceSchedule7'] . '</td>';
        echo '<td>' . $row['MaintenanceSchedule8'] . '</td>';
        echo '</tr>';
    }

    echo '</tbody></table>';
} else {
    echo "No records found.";
}

// Close the database connection
$conn->close();
                       
                       ?>
                       
                        </tbody>
                    </table>
                </div>
            </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js_after'); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.report', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ncaa/public_html/resources/views/reports/maintenances/index.blade.php ENDPATH**/ ?>