<!doctype html> <html lang="fr"> <head> <title>Postulation Apprentis | Consultation</title> <?php require_once("tequila/tequila.php"); $oClient = new TequilaClient(); $oClient->SetApplicationName('Formulaire apprentissage'); $oClient->SetWantedAttributes(array('uniqueid','firstname','name')); $oClient->SetWishedAttributes(array('user')); $oClient->SetAllowsFilter('categorie=epfl-guests'); $oClient->Authenticate(); $user = $oClient->getValue('user'); $firstname = $oClient->getValue('firstname'); $name = $oClient->getValue('name'); $guest_sciper = $oClient->getValue('uniqueid'); $sKey = $oClient->GetKey(); include('templates/head.php'); include('./helpers.php'); ?> </head> <body> <?php include('templates/header.php'); $postulations = getPostulationBySciper($pdo, $guest_sciper);?> <main id="main" role="main" class="content container-grid"> <h3 class="mb-5">Candidature pour un apprentissage</h3> <!-- si plusieures postulations --> <?php if (count($postulations) > 1) { ?> <div class="form-group"> <label>Vous avez effectué plusieurs postulations, merci de choisir</label> <form action="<?= $_SERVER['PHP_SELF'] ?>" method="post" name="postSelector"> <select id="selectPost" name="selected_post" class="custom-select mb-3" onselect="postSelector.submit()"> <?php foreach ($postulations as $key => $postulation) { ?> <option <?= $key == $_POST['selected_post'] ? 'selected' : '' ?> value="<?=$key?>"><?=$LISTJOB[$postulation['applicant_formation_location']][$postulation['applicant_formation']] . ", " . date('d/m/Y', strtotime($postulation['applicant_application_date'])) ?></option> <?php } ?> </select> </form> </div> <?php } ?> <article> <?php if ($_POST['selected_post']) { $postulation = $postulations[$_POST['selected_post']]; } else { $postulation = $postulations[0]; } include('templates/viewPostulationTables/personnalInfosTable.php'); include('templates/viewPostulationTables/responsiblesInfosTable.php'); include('templates/viewPostulationTables/scolaritiesInfosTable.php'); include('templates/viewPostulationTables/proActivitiesInfosTable.php'); include('templates/viewPostulationTables/practicesInfosTable.php'); include('templates/viewPostulationTables/filesTables.php'); ?> </pre> <button type="button" class="btn btn-primary btn-block btn-sm mt-3 mb-2" id="delPostB">Retirer ma postulation</button> </article> </main> </body> </html>