diff --git a/canapEPFL/cible.php b/canapEPFL/cible.php index 5c4d095c9657f03956891910e5ed7b03365c62e4..701591a6d8b039d5863befba2c5133052683bc37 100644 --- a/canapEPFL/cible.php +++ b/canapEPFL/cible.php @@ -29,7 +29,6 @@ // write in DB insertDataIntoDB($pdo, $candidateData); - // Send mails // mailToResp($candidateData->prenomApprenti, $candidateData->nomApprenti, $candidateData->formation); diff --git a/canapEPFL/form.php b/canapEPFL/form.php index 512f78f74372419ed4b2a2971c7e7336b44c68eb..0f64c81aae360e13fcd59253f230e5624cb3c5f3 100644 --- a/canapEPFL/form.php +++ b/canapEPFL/form.php @@ -7,8 +7,9 @@ $oClient->SetAllowsFilter('categorie=epfl-guests'); $oClient->Authenticate(); $user = $oClient->getValue('user'); - $firstname= $oClient->getValue('firstname'); - $name= $oClient->getValue('name'); + $firstname = $oClient->getValue('firstname'); + $name = $oClient->getValue('name'); + $guest_sciper = $oClient->getValue('uniqueid'); $sKey = $oClient->GetKey(); include('templates/isPostulationOpen.php'); @@ -99,6 +100,9 @@ <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="guestSciper" class="form-control" placeholder="Prénom" value="<?php echo $guest_sciper;?>" readonly hidden /> + <label for="nameApp">Nom *</label> <input type="text" name="nameApp" id="nameApp" class="form-control" placeholder="Nom" value="<?php echo $name;?>" readonly /> @@ -137,7 +141,7 @@ <input type="text" name="langApp" id="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" id="avsNumber" placeholder="Numéro AVS *" class="form-control" value="<?php echo $_SESSION['postedForm']['avsNumber'] != '' ? $_SESSION['postedForm']['avsNumber'] : ''; ?>" minlength="2" maxlength="20" data-required /> + <input type="text" name="avsNumber" id="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> diff --git a/canapEPFL/helpers.php b/canapEPFL/helpers.php index 2293089f1c87e0fd8faf4f23c0156d8932fd9231..6adf6072a773759ba1f219dd9a3f6ce200c45fad 100644 --- a/canapEPFL/helpers.php +++ b/canapEPFL/helpers.php @@ -76,10 +76,11 @@ function insertDataIntoDB ($pdo, $candidateData) { function insertPersonalInfos ($pdo, $candidateData) { $sqlreq = "INSERT INTO applicant - (applicant_formation, applicant_it_section, applicant_formation_location, applicant_maturity, applicant_gender, applicant_name, applicant_fsname, applicant_address_street, applicant_address_npa, applicant_home_phone, applicant_personal_phone, applicant_mail, applicant_birthdate, applicant_origin, applicant_nationality, applicant_foreign_authorization, applicant_avs, applicant_main_language, applicant_speaks_french, applicant_speaks_german, applicant_speaks_english, applicant_speaks_other, applicant_has_majority, applicant_scolarity_end, applicant_already_applicant, applicant_already_applicant_year, applicant_application_date, applicant_application_status, fk_applicant_main_responsible, fk_applicant_sec_responsible) - VALUES (:applicant_formation, :applicant_it_section, :applicant_formation_location, :applicant_maturity, :applicant_gender, :applicant_name, :applicant_fsname, :applicant_address_street, :applicant_address_npa, :applicant_home_phone, :applicant_personal_phone, :applicant_mail, :applicant_birthdate, :applicant_origin, :applicant_nationality, :applicant_foreign_authorization, :applicant_avs, :applicant_main_language, :applicant_speaks_french, :applicant_speaks_german, :applicant_speaks_english, :applicant_speaks_other, :applicant_has_majority, :applicant_scolarity_end, :applicant_already_applicant, :applicant_already_applicant_year, NOW(), 'new', null, null)"; + (applicant_guest_sciper, applicant_formation, applicant_it_section, applicant_formation_location, applicant_maturity, applicant_gender, applicant_name, applicant_fsname, applicant_address_street, applicant_address_npa, applicant_home_phone, applicant_personal_phone, applicant_mail, applicant_birthdate, applicant_origin, applicant_nationality, applicant_foreign_authorization, applicant_avs, applicant_main_language, applicant_speaks_french, applicant_speaks_german, applicant_speaks_english, applicant_speaks_other, applicant_has_majority, applicant_scolarity_end, applicant_already_applicant, applicant_already_applicant_year, applicant_application_date, applicant_application_status, fk_applicant_main_responsible, fk_applicant_sec_responsible) + VALUES (:applicant_guest_sciper, :applicant_formation, :applicant_it_section, :applicant_formation_location, :applicant_maturity, :applicant_gender, :applicant_name, :applicant_fsname, :applicant_address_street, :applicant_address_npa, :applicant_home_phone, :applicant_personal_phone, :applicant_mail, :applicant_birthdate, :applicant_origin, :applicant_nationality, :applicant_foreign_authorization, :applicant_avs, :applicant_main_language, :applicant_speaks_french, :applicant_speaks_german, :applicant_speaks_english, :applicant_speaks_other, :applicant_has_majority, :applicant_scolarity_end, :applicant_already_applicant, :applicant_already_applicant_year, NOW(), 'new', null, null)"; $query = $pdo->prepare($sqlreq); + $query->bindParam(':applicant_guest_sciper', $candidateData->guest_sciper, PDO::PARAM_STR); $query->bindParam(':applicant_formation', $candidateData->formation, PDO::PARAM_STR); $query->bindParam(':applicant_it_section', $candidateData->filiere, PDO::PARAM_STR); $query->bindParam(':applicant_formation_location', $candidateData->lieu, PDO::PARAM_STR); diff --git a/canapEPFL/models/PersonnalData.php b/canapEPFL/models/PersonnalData.php index eaed7f536d7a789129eb0dd8c920f19ade4f9336..63f890c57a224fc2c348d98132e87444f19a96d8 100644 --- a/canapEPFL/models/PersonnalData.php +++ b/canapEPFL/models/PersonnalData.php @@ -18,6 +18,7 @@ class PersonnalData { ); private $dateNow; public $rootpath = 'D:/formdata/'; // \\\\scxdata\\apprentis$\\candidatures\\nouvelles\\ + public $guest_sciper = ""; public $formation = ""; public $lieu = ""; public $filiere = ""; @@ -52,6 +53,7 @@ class PersonnalData { $this->dateNow = date('Y-m-d_H-i-s'); // Rempli les infos $this->postedData = $postedData; + $this->guest_sciper = $postedData['guestSciper']; $this->formation = $postedData['job']; $this->lieu = $postedData['lieu']; if($this->formation =="informaticien"){