<?php if ($incoming) { ?> <table class="table table-responsive table-striped table-condensed"> <tr> <td><strong>Name</strong></td> <td><strong>Type</strong></td> <td><strong>CID</strong></td> <td><strong>Rating</strong></td> <td><strong>Pilot Rating</strong></td> <td><strong>Registered</strong></td> <td><strong>Options</strong></td> </tr> <?php foreach ($incoming as $controller) { $pilot = $t->pilotRating($controller->pilot_rating); ?> <tr> <td><?php echo $controller->first_name . ' ' . $controller->last_name; ?> </td> <td><?php echo $controller->status; ?> </td> <td><?php echo $controller->cid; ?> </td> <td><?php
$rating = $data->rating->id; } $pilotRating = $t->pilotRating($data->pilot_rating->rating); $try = $user->create(['id' => $data->id, 'first_name' => $data->name_first, 'last_name' => $data->name_last, 'email' => $data->email, 'rating' => $rating, 'pilot_rating' => $data->pilot_rating->rating, 'pratingstring' => $pilotRating, 'regdate_vatsim' => date("Y-m-d H:i:s", strtotime($data->reg_date)), 'regdate_vateir' => date('Y-m-d H:i:s'), 'vateir_status' => 4]); Session::flash("success", "Thank you for your transfer request. A member of staff will be in touch!"); Redirect::to("../index.php"); } catch (Exception $e) { echo $e->getMessage(); } } elseif (isset($_POST["visiting"])) { //visiting request $t = new Training(); if ($data->rating->id > 7) { //get the CID's real rating (instead of SUP/ADM/INS etc) $rating = $user->getRealRating($data->id); } else { $rating = $data->rating->id; } $pilotRating = $t->pilotRating($data->pilot_rating->rating); try { $try = $user->create(['id' => $data->id, 'first_name' => $data->name_first, 'last_name' => $data->name_last, 'email' => $data->email, 'rating' => $rating, 'pilot_rating' => $data->pilot_rating->rating, 'pratingstring' => $pilotRating, 'regdate_vatsim' => date("Y-m-d H:i:s", strtotime($data->reg_date)), 'regdate_vateir' => date('Y-m-d H:i:s'), 'vateir_status' => 3]); Session::flash("success", "Thank you for your application. A member of staff will be in touch!"); Redirect::to("../index.php"); } catch (Exception $f) { echo $f->getMessage(); } } } else { Session::flash("error", "Cannot access resource!"); Redirect::to("../index.php"); }
} $t = new Training(); $program = $t->program($rating); $studentUpdate = $t->updateStudent(array('program' => $program), [['cid', '=', $user->user->id]]); Session::flash('success', 'You are now logged in!'); Redirect::to('../index.php'); } elseif (!$siteLogin && $user->user->division->code == "EUD" && $user->user->subdivision->code == "IRL") { //Possible future feature - create an account apart from CRON here. try { //Try making an account if they are a member of VATeir... if ($user->user->rating->id > 7) { $rating = $u->getRealRating($user->user->id); } else { $rating = $user->user->rating->id; } $pilotRating = $t->pilotRating($user->user->pilot_rating->rating); $make = $u->create(array('id' => $user->user->id, 'alive' => 1, 'first_name' => $user->user->name_first, 'last_name' => $user->user->name_last, 'email' => $user->user->email, 'rating' => $rating, 'pilot_rating' => $user->user->pilot_rating->rating, 'pratingstring' => $pilotRating, 'regdate_vatsim' => date("Y-m-d H:i:s", strtotime($user->user->reg_date)), 'regdate_vateir' => date('Y-m-d H:i:s'), 'grou' => 10)); if (!$t->getStudent($user->user->id)) { $program = $t->program($rating); $studentMake = $t->createStudent(array('cid' => $user->user->id, 'program' => $program)); } $u->login($user->user->id); Session::flash('success', 'You are now logged in!'); Redirect::to('../index.php'); } catch (Exception $x) { echo $x->getMessage(); } } else { $notAllowed = $user->user->rating->id > 2 ? false : true; //Set the rating to be S2 and above for visiting controller applications echo "<h4>Hey " . $user->user->name_first . ",</h4>";