Exemplo n.º 1
0
echo '<div class="col-md-10 col-md-offset-1">';
echo '<h3 class="text-center">Validation List';
echo !isset($_GET['v']) || $_GET['v'] == '0' ? ' <small>Sector View</small>' : ' <small>Positions View</small>';
echo '</h3>';
echo '<div class="text-right">';
echo !isset($_GET['v']) || $_GET['v'] == '0' ? '<a href="validations.php?v=1">Position View</a>' : '<a href="validations.php?v=0">Sectors View</a>';
echo '</div>';
if (!isset($_GET['v']) || $_GET['v'] == '0') {
    try {
        $majors = $t->getAirports();
        if (!$majors) {
            echo 'No major airports available';
        } else {
            foreach ($majors as $major) {
                echo '<h4>' . $major->name . '</h4>';
                $sectors = $t->getSectorTypes($major->icao);
                if ($sectors) {
                    foreach ($sectors as $sector => $call) {
                        $students = array();
                        $not = array();
                        $check = array();
                        $vals = $t->getValidatedSector($major->icao, $sector);
                        //get list of validations by sector
                        // echo '<pre>';
                        // print_r($vals);
                        // echo '</pre>';
                        if ($vals) {
                            foreach ($vals as $val) {
                                if ($t->maxValidatedSectorType($major->icao, $val->cid)->position_type_id == $val->position_type_id) {
                                    //Makes sure the sector type is the highest for this cid and icao
                                    $not[] = $val->cid;