diff --git a/assets/css/offres_stages.css b/assets/css/offres_stages.css index 10fcc44..ee70eda 100644 --- a/assets/css/offres_stages.css +++ b/assets/css/offres_stages.css @@ -131,7 +131,7 @@ .flex-row { - width: calc(100% / 2); + width: calc(100% / 4); text-align: center; padding: 0.2em 0.2em; } @@ -227,6 +227,13 @@ font-size: 20px; } +.flex-row-modal +{ + width: calc(100% / 2); + text-align: center; + padding: 0.2em 0.2em; +} + .close { color: #aaa; diff --git a/assets/js/offres_stages.js b/assets/js/offres_stages.js index 449245f..f7403e8 100644 --- a/assets/js/offres_stages.js +++ b/assets/js/offres_stages.js @@ -1,3 +1,5 @@ +var ID_internship=0; + $(document).ready(function(){ $("#li_stages").delay(2000).addClass("hover"); @@ -27,8 +29,10 @@ $(document).ready(function(){ }); $(".button_postuler").click(function() { - $(".modal").show(); + window.ID_internship = $(this).attr("id_internship"); + $(".title_modal").html("Postuler pour " + $(this).attr("name_internship")); $(".info_message").hide(); + $(".modal").show(); }); window.onclick = function(event) { @@ -37,6 +41,13 @@ $(document).ready(function(){ } } + $('.form_postuler').on('submit',(function(){ + check = true; + if ($('#cv').get(0).files.length === 0 || $('#lm').get(0).files.length === 0) { check = false; } + if (check) {$(".form_postuler").append('');} + return check; + + })); }); \ No newline at end of file diff --git a/candidatures.php b/candidatures.php index 5385d83..33d566a 100644 --- a/candidatures.php +++ b/candidatures.php @@ -25,8 +25,6 @@ if (isset($_SESSION["username"])){ $query_candidatures = $bdd->prepare($sql); $query_candidatures->execute(['user' => $_SESSION["username"]]); $results_candidatures = $query_candidatures->fetchALL(PDO::FETCH_OBJ); - - ?>
@@ -60,22 +58,41 @@ if (isset($_SESSION["username"])){| Curriculum Vitae : | -= $result->cv_file_path_candidature; ?> | ++ cv_file_path_candidature != "") {echo 'Déposé ';} + else {echo 'Non disponible ';} + ?> + |
| Lettre de motivation : | -= $result->lm_file_path_candidature; ?> | ++ lm_file_path_candidature != "") {echo 'Déposé ';} + else {echo 'Non disponible ';} + ?> + |
| Fiche de validation : | -= $result->validation_form_file_path_candidature; ?> | ++ validation_form_file_path_candidature != "") {echo 'Déposé ';} + else {echo 'Non disponible ';} + ?> + |
| Convention de stage : | -= $result->internship_agreement_file_path_candidature; ?> | ++ internship_agreement_file_path_candidature != "") {echo 'Déposé ';} + else {echo 'Non disponible ';} + ?> + |
The HTML5 and php file upload was a success!
'; -} else { - echo 'The php and HTML5 file upload failed.
'; + if (!is_dir('./documents/')){ + mkdir("./documents/", 0700); + } + if (!is_dir('./documents/users')){ + mkdir("./documents/users", 0700); + } + if (!is_dir("./documents/users/".$ID_user)){ + mkdir("./documents/users/".$ID_user, 0700); + } + + + try { + move_uploaded_file($_FILES['cv']['tmp_name'], $location_cv); + move_uploaded_file($_FILES['lm']['tmp_name'], $location_lm); + echo "tout est ok"; + } + catch (Exception $e) { + echo "zut une erreur"; + } + } } - -?> - - \ No newline at end of file +?> \ No newline at end of file diff --git a/upload/hotel-mario-non-hd_1.mp4 b/upload/hotel-mario-non-hd_1.mp4 deleted file mode 100644 index 942c9c2..0000000 Binary files a/upload/hotel-mario-non-hd_1.mp4 and /dev/null differ