From d774cb58afb023aefd7b2537744b879a3361be64 Mon Sep 17 00:00:00 2001 From: nicrausaz <n.crausaz99@gmail.com> Date: Fri, 5 Oct 2018 16:19:07 +0200 Subject: [PATCH] form --- canapEPFL/form.php | 143 ++++++++++++++++---------- canapEPFL/templates/filieresinfos.php | 42 ++++---- 2 files changed, 110 insertions(+), 75 deletions(-) diff --git a/canapEPFL/form.php b/canapEPFL/form.php index fc23265..b990932 100644 --- a/canapEPFL/form.php +++ b/canapEPFL/form.php @@ -17,7 +17,7 @@ <!doctype html> <html lang="fr"> <head> - <title>Formulaire Apprentissage</title> + <title>Postulation Apprentis | Formulaire</title> <?php include('templates/head.php'); ?> </head> <body> @@ -43,7 +43,7 @@ <div class="form-group"> <label>Je suis intéressé par la formation de:</label> <select name="job" id="jbLausanne" class="custom-select" data-required> - <option selected disabled>Choisir une formation...</option> + <option value="menu" selected disabled>Choisir une formation...</option> <?php foreach ($LISTJOB['Lausanne'] as $jobKey => $jobVal) { if ($_SESSION['postedForm']['job'] == $jobKey) { @@ -68,7 +68,7 @@ </select> </div> <!-- / Choix formation --> - <div id="all" style="display: none;"> + <div id="all"> <!-- hide it --> <div class="form-group"> <!-- Infos filières informaticien --> <div id="infoOnly"> @@ -76,69 +76,106 @@ </div> <!-- / Infos filières informaticien --> <!-- Maturité --> + <label>Je désire m'inscire en maturité professionnelle intégrée*:</label> <div class="custom-control custom-radio"> <input type="radio" name="mpt" id="mpt1" class="custom-control-input" value="false" <?php echo (!isset($_SESSION['postedForm']['mpt']) || $_SESSION['postedForm']['mpt'] == "false") ? "checked=\"checked\"" : ''; ?>> - <label class="custom-control-label" for="mpt1">EPFL Lausanne</label> + <label class="custom-control-label" for="mpt1">Non</label> </div> <div class="custom-control custom-radio"> <input type="radio" name="mpt" id="mpt2" class="custom-control-input" value="true" <?php echo ($_SESSION['postedForm']['mpt'] == "true") ? "checked=\"checked\"" : ''; ?>> - <label class="custom-control-label" for="mpt2">EPFL Valais Sion</label> + <label class="custom-control-label" for="mpt2">Oui</label> </div> - <button class="btn btn-primary" id="infoMpt">Infos sur la maturité professionnelle</button> + <button class="btn btn-primary btn-sm mt-3 mb-2" id="infoMpt">Infos sur la maturité professionnelle</button> <!-- / Maturité --> </div> + <hr> + <h3>2. Données</h3> + <!-- Info perso --> + <h5>2.1 Données personnelles</h5> + <div class="form-group"> + <label for="genreApp">Genre:</label> + <select name="genreApp" id="genreApp" class="custom-select" data-required> + <option value="notSelected" <?php echo (!isset($_SESSION['postedForm']['genreApp'])) ? "selected" : ''; ?> disabled> Choisissez un genre*</option> + <option value="Homme" <?php echo ($_SESSION['postedForm']['genreApp'] == "Homme") ? "selected" : ''; ?>>Homme</option> + <option value="Femme" <?php echo ($_SESSION['postedForm']['genreApp'] == "Femme") ? "selected" : ''; ?>>Femme</option> + </select> + <label for="nameApp">Nom *</label> + <input type="text" name="nameApp" id="nameApp" class="form-control" placeholder="Nom" value="<?php echo $name;?>" readonly /> + + <label for="surnameApp">Prénom *</label> + <input type="text" name="surnameApp" id="surnameApp" class="form-control" placeholder="Prénom" value="<?php echo $firstname;?>" readonly /> + + <label for="adrApp">Rue *</label> + <input type="text" name="adrApp" placeholder="Rue" class="form-control" value="<?php echo $_SESSION['postedForm']['adrApp'] != '' ? $_SESSION['postedForm']['adrApp'] : ''; ?>" minlength="2" maxlength="40" data-required/> + + <label for="nameApp">NPA\Domicile *</label> + <input type="text" name="NPAApp" placeholder="NPA\Domicile" class="form-control" value="<?php echo $_SESSION['postedForm']['NPAApp'] != '' ? $_SESSION['postedForm']['NPAApp'] : ''; ?>" minlength="2" maxlength="40" data-required/> + + <label for="telApp">Téléphone *</label> + <input type="tel" name="telApp" placeholder="+41 21 123 45 67" class="form-control" value="<?php echo $_SESSION['postedForm']['telApp'] != '' ? $_SESSION['postedForm']['telApp'] : ''; ?>" minlength="2" maxlength="20" data-required/> + + <label for="telApp">Mobile *</label> + <input type="tel" name="phoneApp" placeholder="+41 79 123 45 67" class="form-control" value="<?php echo $_SESSION['postedForm']['phoneApp'] != '' ? $_SESSION['postedForm']['phoneApp'] : ''; ?>" minlength="2" maxlength="20" data-required/> + + <label for="mailApp">Email *</label> + <input type="email" name="mailApp" id="mailApp" value="<?php echo $user;?>" class="form-control" readonly /> + + <label for="birthApp">Date de naissance *</label> + <input type="text" name="birthApp" id="birthApp" class="form-control" value="<?php echo $_SESSION['postedForm']['birthApp'] != '' ? $_SESSION['postedForm']['birthApp'] : ''; ?>" data-required /> + <section id="errorMsg"></section> + + <label for="originApp">Lieu d'origine *</label> + <input type="text" name="originApp" placeholder="Lieu d'origine" class="form-control" value="<?php echo $_SESSION['postedForm']['originApp'] != '' ? $_SESSION['postedForm']['originApp'] : ''; ?>" minlength="2" maxlength="35" data-required /> + + <label for="nationApp">Nationalité *</label> + <input type="text" name="nationApp" placeholder="Nationalité" class="form-control" value="<?php echo $_SESSION['postedForm']['nationApp'] != '' ? $_SESSION['postedForm']['nationApp'] : ''; ?>" minlength="2" maxlength="30" data-required /> + + <label for="permisEtrangerApp">Catégorie de permis pour étrangers</label> + <input type="text" name="permisEtrangerApp" class="form-control" placeholder="Catégorie de permis pour étrangers" value="<?php echo $_SESSION['postedForm']['permisEtrangerApp'] != '' ? $_SESSION['postedForm']['permisEtrangerApp'] : ''; ?>" maxlength="1" /> + + <label for="langApp">Langue maternelle *</label> + <input type="text" name="langApp" placeholder="Langue maternelle" class="form-control" value="<?php echo $_SESSION['postedForm']['langApp'] != '' ? $_SESSION['postedForm']['langApp'] : ''; ?>" minlength="2" maxlength="20" data-required /> + + <label for="avsNumber">Numéro AVS*</label> + <input type="text" name="avsNumber" placeholder="Numéro AVS *" class="form-control" value="<?php echo $_SESSION['postedForm']['avsNumber'] != '' ? $_SESSION['postedForm']['avsNumber'] : ''; ?>" minlength="2" maxlength="20" data-required /> + + <div class="form-group"> + <label>Connaissances linguistiques *</label> + + <div class="custom-control custom-checkbox"> + <input type="checkbox" class="custom-control-input" value="fr" id="french" name="languesApp[]" <?php echo (is_int(array_search('fr', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>> + <label class="custom-control-label" for="french">Français</label> + </div> + <div class="custom-control custom-checkbox"> + <input type="checkbox" class="custom-control-input" value="de" id="german" name="languesApp[]" <?php echo (is_int(array_search('de', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>> + <label class="custom-control-label" for="german">Allemand</label> + </div> + <div class="custom-control custom-checkbox"> + <input type="checkbox" class="custom-control-input" value="en" id="english" name="languesApp[]" <?php echo (is_int(array_search('en', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>> + <label class="custom-control-label" for="english">Anglais</label> + </div> + <div class="custom-control custom-checkbox"> + <input type="checkbox" class="custom-control-input" value="others" id="other" name="languesApp[]" <?php echo (is_int(array_search('others', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>> + <label class="custom-control-label" for="other">Autres</label> + </div> + </div> + </div> </div> + <h5>2.2 Représentants légaux</h5> + <div class="form-group"> + test + </div> + </div> <!-- end div all --> </form> </main> - - <label for="mpt">Je désire m'inscire en maturité professionnelle intégrée*:</label><p> - <dl class="radio-list-left"> - <dd> - <input type="radio" name="mpt" id="mpt1" value="false" <?php echo (!isset($_SESSION['postedForm']['mpt']) || $_SESSION['postedForm']['mpt'] == "false") ? "checked=\"checked\"" : ''; ?>> - <label for="mpt1">Non</label> - </dd> - <dd> - <input type="radio" name="mpt" id="mpt2" value="true" <?php echo ($_SESSION['postedForm']['mpt'] == "true") ? "checked=\"checked\"" : ''; ?>> - <label for="mpt2">Oui</label> - </dd> - </dl> - <button type="button" id="infoMpt" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent buttonRight"> - Infos sur la maturité professionnelle - </button> - </fieldset> - <fieldset> - <legend><span class="number">2</span> Données </legend> - <fieldset> - <legend><span class="number">2.1</span> Données personnelles</legend> - <select name="genreApp" id="genreApp"> - <option value="notSelected" <?php echo (!isset($_SESSION['postedForm']['genreApp'])) ? "selected" : ''; ?> disabled> Choisissez un genre*</option> - <option value="Homme" <?php echo ($_SESSION['postedForm']['genreApp'] == "Homme") ? "selected" : ''; ?>>Homme</option> - <option value="Femme" <?php echo ($_SESSION['postedForm']['genreApp'] == "Femme") ? "selected" : ''; ?>>Femme</option> - </select> - <input type="text" name="nameApp" placeholder="Nom *" value="<?php echo $name;?>" readonly /> - <input type="text" name="surnameApp" placeholder="Prénom *" value="<?php echo $firstname;?>" readonly /> - <input type="text" name="adrApp" placeholder="Rue *" value="<?php echo $_SESSION['postedForm']['adrApp'] != '' ? $_SESSION['postedForm']['adrApp'] : ''; ?>" minlength="2" maxlength="40" data-required/> - <input type="text" name="NPAApp" placeholder="NPA\Domicile *" value="<?php echo $_SESSION['postedForm']['NPAApp'] != '' ? $_SESSION['postedForm']['NPAApp'] : ''; ?>" minlength="2" maxlength="40" data-required/> - <input type="tel" name="telApp" placeholder="Téléphone (+41 21 123 45 67) *" value="<?php echo $_SESSION['postedForm']['telApp'] != '' ? $_SESSION['postedForm']['telApp'] : ''; ?>" minlength="2" maxlength="20" data-required/> - <input type="tel" name="phoneApp" placeholder="Mobile (+41 79 123 45 67) *" value="<?php echo $_SESSION['postedForm']['phoneApp'] != '' ? $_SESSION['postedForm']['phoneApp'] : ''; ?>" minlength="2" maxlength="20" data-required/> - <input type="email" name="mailApp" id="mailApp" value="<?php echo $user;?>" readonly /> - <input type="text" name="birthApp" id="birthApp" placeholder="Date de naissance *" value="<?php echo $_SESSION['postedForm']['birthApp'] != '' ? $_SESSION['postedForm']['birthApp'] : ''; ?>" data-required /> - <section id="errorMsg"></section> - <input type="text" name="originApp" placeholder="Lieu d'origine *" value="<?php echo $_SESSION['postedForm']['originApp'] != '' ? $_SESSION['postedForm']['originApp'] : ''; ?>" minlength="2" maxlength="35" data-required /> - <input type="text" name="nationApp" placeholder="Nationalité *" value="<?php echo $_SESSION['postedForm']['nationApp'] != '' ? $_SESSION['postedForm']['nationApp'] : ''; ?>" minlength="2" maxlength="30" data-required /> - <input type="text" name="permisEtrangerApp" placeholder="Catégorie de permis pour étrangers" value="<?php echo $_SESSION['postedForm']['permisEtrangerApp'] != '' ? $_SESSION['postedForm']['permisEtrangerApp'] : ''; ?>" maxlength="1" /> - <input type="text" name="langApp" placeholder="Langue Maternelle *" value="<?php echo $_SESSION['postedForm']['langApp'] != '' ? $_SESSION['postedForm']['langApp'] : ''; ?>" minlength="2" maxlength="20" data-required /> - <input type="text" name="avsNumber" placeholder="Numéro AVS *" value="<?php echo $_SESSION['postedForm']['avsNumber'] != '' ? $_SESSION['postedForm']['avsNumber'] : ''; ?>" minlength="2" maxlength="20" data-required /> - <label for="languesApp">Connaissance linguistiques*:</label> - <p><input type="checkbox" name="languesApp[]" value="fr" id="french" <?php echo (is_int(array_search('fr', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>><label for="french"><span class="ui"></span>Français</label></p> - <p><input type="checkbox" name="languesApp[]" value="de" id="german" <?php echo (is_int(array_search('de', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>><label for="german"><span class="ui"></span>Allemand</label></p> - <p><input type="checkbox" name="languesApp[]" value="en" id="english" <?php echo (is_int(array_search('en', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>><label for="english"><span class="ui" ></span>Anglais</label></p> - <p><input type="checkbox" name="languesApp[]" value="others" id="other" <?php echo (is_int(array_search('others', $_SESSION['postedForm']['languesApp']))) ? 'checked="checked"' : ''; ?>><label for="other"><span class="ui" ></span>Autres</label></p> - </fieldset> - <fieldset> - <legend><span class="number">2.2</span> Représentants légaux</legend> + <!-- / Info perso --> + <!-- use this for errors messages + <small id="awesome-input-help" class="form-text text-muted"> + Help text about the text field. + </small> + --> <label for="maj">Avez vous plus de 18 ans?*</label><p> <dl class="radio-list-left"> <dd> diff --git a/canapEPFL/templates/filieresinfos.php b/canapEPFL/templates/filieresinfos.php index 096dc7c..a8445ae 100644 --- a/canapEPFL/templates/filieresinfos.php +++ b/canapEPFL/templates/filieresinfos.php @@ -1,22 +1,20 @@ -<label for="filInfo">Filières informatiques:*</label> -<dl class="radio-list-left" required> -<dd> - <input type="radio" name="filInfo" id="fill1" value="developpementApplications" <?php echo ($_SESSION['postedForm']['filInfo'] == "developpementApplications") ? "checked=\"checked\"" : ''; ?>/> - <label for="fill1">Développement d'application</label> -</dd> -<dd> - <input type="radio" name="filInfo" id="fill2" value="entreprise" <?php echo ($_SESSION['postedForm']['filInfo'] == "entreprise") ? "checked=\"checked\"" : ''; ?>/> - <label for="fill2">Informatique d'entreprise</label> -</dd> -<dd> - <input type="radio" name="filInfo" id="fill3" value="techniqueSysteme" <?php echo ($_SESSION['postedForm']['filInfo'] == "techniqueSysteme") ? "checked=\"checked\"" : ''; ?>/> - <label for="fill3">Technique des systèmes</label> -</dd> -<dd> - <input type="radio" name="filInfo" id="fill4" value="neSaisPas" <?php echo (!isset($_SESSION['postedForm']['filInfo']) || $_SESSION['postedForm']['mpt'] == "neSaisPas") ? "checked=\"checked\"" : ''; ?> /> - <label for="fill4">Je ne sais pas</label> -</dd> -</dl> -<button type="button" id="infoFilieres" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent buttonRight"> - Infos sur les filières -</button> \ No newline at end of file +<div class="form-group"> + <label>Filières informatiques:*</label> + <div class="custom-control custom-radio"> + <input type="radio" name="filInfo" id="fill1" class="custom-control-input" value="developpementApplications" <?php echo ($_SESSION['postedForm']['filInfo'] == "developpementApplications") ? "checked=\"checked\"" : ''; ?>> + <label class="custom-control-label" for="fill1">Développement d'application</label> + </div> + <div class="custom-control custom-radio"> + <input type="radio" name="filInfo" id="fill2" class="custom-control-input" value="entreprise" <?php echo ($_SESSION['postedForm']['filInfo'] == "entreprise") ? "checked=\"checked\"" : ''; ?>> + <label class="custom-control-label" for="fill2">Informatique d'entreprise</label> + </div> + <div class="custom-control custom-radio"> + <input type="radio" name="filInfo" id="fill3" class="custom-control-input" value="techniqueSysteme" <?php echo ($_SESSION['postedForm']['filInfo'] == "techniqueSysteme") ? "checked=\"checked\"" : ''; ?>> + <label class="custom-control-label" for="fill3">Technique des systèmes</label> + </div> + <div class="custom-control custom-radio"> + <input type="radio" name="filInfo" id="fill4" class="custom-control-input" value="neSaisPas" <?php echo (!isset($_SESSION['postedForm']['filInfo']) || $_SESSION['postedForm']['mpt'] == "neSaisPas") ? "checked=\"checked\"" : ''; ?>> + <label class="custom-control-label" for="fill4">Je ne sais pas</label> + </div> +</div> +<button class="btn btn-primary btn-sm mb-3" id="infoFilieres">Infos sur les filières</button> \ No newline at end of file -- GitLab