{% extends 'base.html.twig' %}
{% block title %}{% endblock %}
{% block body %}
{% include ("pages/job/header.html.twig") %}
<script type="application/ld+json">
{
"@type" : "JobPosting",
"title" : "{{ data[0]["specialite"] }}",
"description" : "{{ data[0]['infoPratique'] | escape }} ",
"datePosted" : "{{ data[0]["createAt"]['date'] | date('d-m-Y') }}",
"hiringOrganization" : {
"@type" : "Organization",
"name" : "Réseau Médical Service",
"sameAs" : "https://reseaumedical.fr/",
"logo" : "http://img.mailinblue.com/2078301/images/rnb/original/5c20a51c5fb5f9000e5a5a1d.jpg"
},
"jobLocation": {
"@type": "Place",
"address": {
"@type": "PostalAddress",
"streetAddress": "{{ data[0]["departement"] }}",
"addressRegion": "{{ data[0]["departement"] }}",
"postalCode": "{{ data[0]["numeroDepartement"] }}",
"addressCountry": "FR"
}
}
}
</script>
<section class="ftco-section ftco-degree-bg" style="color : black ">
<div class="container">
<div class="row">
<div class="col-md-7 ftco-animate">
<span class="subadge">Intérim</span>
<h1>{{ data[0]["specialite"] }}</h1>
<div class="tagcloud mb-3">
<a href="#" class="tag-cloud-link">
<span class="icon-my_location"></span>  {{ data[0]["departement"] }} {{ data[0]["numeroDepartement"] }}
</a>
<a href="#" class="tag-cloud-link">{{ data| length }} Date(s)</a>
<a href="#" class="tag-cloud-link">
<span class="icon-date_range"></span>
Publié {{ data[0]["createAt"]['date'] | date('d-m-Y') }}
</a>
</div>{{ data[0]["infoPratique"] | raw }}
</div> <!-- .col-md-8 -->
<div class="col-md-5 pl-md-5 sidebar ftco-animate">
<div class="sidebar-box ftco-animate">
<div class="categories" data-spy="scroll" data-offset="0">
<h3 class="heading-3">Date à Pourvoir </h3>
{% for period in periods %}
{% if (period|length) == 1 %}
<li style="font-size: 14px"><a href="#">{{ period[0]["jour"] | date('d-m-Y') }}
<span>{{ period[0]["designation"] }}</span></a></li>
{% else %}
<li style="font-size: 14px"><a href="#">Du {{ period[0]["jour"] | date('d-m-Y') }}
au {{ period[(period|length)-1]["jour"] | date('d-m-Y') }}
<span>{{ period[0]["designation"] }}</span></a></li>
{% endif %}
{% endfor %}
</div>
</div>
<div class="row">
<div class="col-6">
<button class="btn btn-secondary" data-toggle="modal" data-target="#modalMaintenance"
style="font-size: 14px">Postuler avec Myrms
</button>
</div>
<div class="col-6">
<button class="btn btn-primary py-2" data-toggle="modal" data-target="#modalCandidatureCV"
style="font-size: 14px">Postuler avec votre Cv
</button>
</div>
</div>
<div class="sidebar-box ftco-animate">
<h3 class="heading-3">Partager</h3>
<ul class="ftco-footer-social list-unstyled float-md-left float-lft mt-3">
<li class="ftco-animate"><a
href="https://twitter.com/intent/tweet?url={{ url('app_job_single', {'refererence':data[0]['reference'] }) }}&text=Regardez cette offre de Réseau Médical Services!"
target="_blank"><span class="icon-twitter"></span></a></li>
<li class="ftco-animate"><a
href="https://www.linkedin.com/shareArticle?mini=true&url={{ url('app_job_single', {'refererence':data[0]['reference'] }) }}"
target="_blank"><span class="icon-linkedin"></span></a></li>
<li class="ftco-animate"><a
href="https://www.facebook.com/sharer/sharer.php?u={{ url('app_job_single', {'refererence':data[0]['reference'] }) }}"
target="_blank"><span class="icon-facebook"></span></a></li>
</ul>
</div>
</div>
</div>
</div>
</section> <!-- .section -->
<!-- Modal candidature cv -->
<div class="modal fade" id="modalCandidatureCV" tabindex="-1" role="dialog" aria-labelledby="modalCandidatureCV"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalCandidatureCV">Postuler pour cette Offre</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="container-fluid">
{% include ('pages/candidature/candidature_cv.html.twig') %}
</div>
</div>
<div class="modal-footer">
{# <button type="button" class="btn btn-secondary">Candidature avec Myrms</button>#}
{# <a href="{{ path('app_candidature_cv',{reference:data[0]['reference']}) }}" type="button" class="btn btn-primary">Candidature avec Cv</a>#}
</div>
</div>
</div>
</div>
<div class="modal fade" id="modalMaintenance" tabindex="-1" role="dialog" aria-labelledby="modalMaintenance"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalMaintenance">Postuler pour cette Offre</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="container-fluid">
<h2>Espace MyRMS en Maintenance</h2>
<h5>Nous sommes désolés, veillez postuler directement avec votre CV.</h5>
</div>
</div>
<div class="modal-footer">
{# <button type="button" class="btn btn-secondary">Candidature avec Myrms</button>#}
{# <a href="{{ path('app_candidature_cv',{reference:data[0]['reference']}) }}" type="button" class="btn btn-primary">Candidature avec Cv</a>#}
</div>
</div>
</div>
</div>
<!-- Modal candidature MyRMS -->
<div class="modal fade" id="modalCandidatureMyRMS" tabindex="-1" role="dialog"
aria-labelledby="modalCandidatureMyRMS" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalCandidatureMyRMS">Postuler pour cette Offre</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="container-fluid">
<div id = "candidatureMyRMS">
<h2>Espace MyRMS en Maintenance</h2>
<h5>Nous sommes désolés, veillez postuler directement avec votre CV.</h5>
{#<div id="checkbox-container"></div>
<div class="pagination">
<button id="prev-btn" disabled>Précédent</button>
<span id="page-counter">Page 1</span>
<button id="next-btn">Suivant</button>
</div>
<div id="data-container" data-data="{{ data|json_encode }}"></div>
<script>
var dataFromServer = JSON.parse(document.getElementById("data-container").getAttribute("data-data"));
var taille_data = dataFromServer.length;
var n_page = Math.floor(taille_data / 12) + 1;
const checkboxContainer = document.getElementById("checkbox-container");
const prevButton = document.getElementById("prev-btn");
const nextButton = document.getElementById("next-btn");
const pageCounter = document.getElementById("page-counter");
const totalPages = n_page ; // le nombre total de pages
let currentPage = 1;
function formatDateFromString(dateString) {
const parts = dateString.split(' ');
const datePart = parts[0];
const timePart = parts[1];
const dateComponents = datePart.split('-');
const year = parseInt(dateComponents[0]);
const month = parseInt(dateComponents[1]) - 1;
const day = parseInt(dateComponents[2]);
const timeComponents = timePart.split(':');
const hour = parseInt(timeComponents[0]);
const minute = parseInt(timeComponents[1]);
const second = parseInt(timeComponents[2]);
return new Date(year, month, day, hour, minute, second);
}
function formatDate(date) {
const day = String(date.getDate()).padStart(2, '0');
const month = String(date.getMonth() + 1).padStart(2, '0');
const year = date.getFullYear();
return `${day}-${month}-${year}`;
}
function updatePaginationButtons() {
prevButton.disabled = currentPage === 1;
nextButton.disabled = currentPage === totalPages;
pageCounter.textContent = `Page ${currentPage}`;
}
function createCheckboxes(page) {
checkboxContainer.innerHTML = "";
const startIndex = (page - 1) * 12;
const endIndex = Math.min(taille_data, startIndex + 12, totalPages * 12);
const table = document.createElement("table");
table.classList.add("table-paginated");
const row1 = document.createElement("tr");
const titre1 = document.createElement("th");
const titre2 = document.createElement("th");
const titre3 = document.createElement("th");
const titre4 = document.createElement("th");
const titre5 = document.createElement("th");
const titre6 = document.createElement("th");
titre1.textContent = `#`;
titre2.textContent = ` `;
titre3.textContent = `Date`;
titre4.textContent = `Libelle`;
titre5.textContent = `Debut`;
titre6.textContent = `Fin`;
row1.appendChild(titre1);
row1.appendChild(titre2);
row1.appendChild(titre3);
row1.appendChild(titre4);
row1.appendChild(titre5);
row1.appendChild(titre6);
table.appendChild(row1);
for (let i = startIndex; i < endIndex; i++) {
const row = document.createElement("tr");
const content1Cell = document.createElement("td");
content1Cell.textContent = i+1;
const checkboxCell = document.createElement("td");
const checkbox = document.createElement("input");
checkbox.type = "checkbox";
checkboxCell.appendChild(checkbox);
const content2Cell = document.createElement("td");
const inputDate = formatDateFromString(dataFromServer[i]["date"]["date"]);
const formattedDate = formatDate(inputDate);
content2Cell.textContent = formattedDate;
const content3Cell = document.createElement("td");
content3Cell.textContent = dataFromServer[i]["designation"];
const content4Cell = document.createElement("td");
content4Cell.textContent = `...`;
const content5Cell = document.createElement("td");
content5Cell.textContent = `...`;
row.appendChild(content1Cell);
row.appendChild(checkboxCell);
row.appendChild(content2Cell);
row.appendChild(content3Cell);
row.appendChild(content4Cell);
row.appendChild(content5Cell);
table.appendChild(row);
}
checkboxContainer.appendChild(table);
updatePaginationButtons();
}
prevButton.addEventListener("click", () => {
if (currentPage > 1) {
currentPage--;
createCheckboxes(currentPage);
}
});
nextButton.addEventListener("click", () => {
if (currentPage < totalPages) {
currentPage++;
createCheckboxes(currentPage);
}
});
// Initialiser la pagination avec la première page
createCheckboxes(currentPage);
</script>
<br>
<div class="form-check mb-4">
<input class="form-check-input" v-model="cgu" required type="checkbox" value="" id="flexCheckDefault" />
<label class="form-check-label" for="flexCheckDefault">J'ai lu et j'accepte les Conditions Générales d'Utilisation, notamment la mention relative à la protection des données personnelles.<a href="{{ url('app_r_g_p_d') }}">(CGU)</a></label>
</div>
<!-- Submit button -->
<button type="submit" class="btn btn-primary btn-block mb-3">Soumettre</button>
</form>
</div>
</div>
</div>
<div class="modal-footer">#}
{# <button type="button" class="btn btn-secondary">Candidature avec Myrms</button>#}
{# <a href="{{ path('app_candidature_cv',{reference:data[0]['reference']}) }}" type="button" class="btn btn-primary">Candidature avec Cv</a>#}
{#</div>#}
</div>
</div>
</div>
{% endblock %}