templates/adhesion/index.html.twig line 1

Open in your IDE?
  1. {% include 'headerlogin.html.twig' %}
  2. <body>
  3. <div class="container-scroller">
  4. <div class="container-fluid page-body-wrapper full-page-wrapper inscription">
  5. <div class="row flex-grow">
  6. <div class="col-lg-4 mx-auto" style="margin-right: 10%; background: #e8eff4;">
  7. </div>
  8. <div class="col-lg-8 mx-auto" style="margin-right: 10%; background: white;">
  9. <div class="card-body " style="background-color : white; width : 95%; margin-top : 5%; margin-left : 2%;">
  10. <p> <img style="width : 40%; margin-left : 30%;" src="{{asset('images/icones/logo.jpeg')}}"> </p>
  11. <h2 class="font-weight-bold" style="color : #3673bc;"> J'ADHERE AU CNC </h2>
  12. <div class="row" style="font-weight : bold;">
  13. <div class="col-md-12">
  14. <h4 class="font-weight-bold" style="color : #3673bc;"> Choisissez votre Province ; </h4>
  15. <div class="row">
  16. {% for province in provinces %}
  17. <div class="col-md-2" style="margin : 1%;">
  18. <a href="{{ path('adhesion_form', {'id':province.id}) }}" type="button" class="btn btn-inverse-success btn-icon-text font-weight-bold">
  19. <i class="ti-location-pin btn-icon-prepend"></i>
  20. {{province.nom}}
  21. </a>
  22. </div>
  23. {% endfor %}
  24. </div>
  25. </div>
  26. <div class="col-md-6 ml-auto mr-auto">
  27. <div id="worldMap" style="height: 300px;"></div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <!-- content-wrapper ends -->
  36. </div>
  37. <!-- page-body-wrapper ends -->
  38. {#
  39. Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
  40. See https://symfony.com/doc/current/security/remember_me.html
  41. <div class="checkbox mb-3">
  42. <label>
  43. <input type="checkbox" name="_remember_me"> Remember me
  44. </label>
  45. </div>
  46. #}
  47. <script>
  48. window.onload = () => {
  49. let province = document.querySelector("#demande_Province");
  50. let selectCommune = document.querySelector('#demande_commune');
  51. selectCommune.innerHTML = "";
  52. province.addEventListener("change", function(){
  53. let form = this.closest("form");
  54. let data = this.name + "=" + this.value;
  55. fetch(form.action, {
  56. method: form.getAttribute("method"),
  57. body: data,
  58. headers: {
  59. "content-type": "application/x-www-form-urlencoded; charset:UTF-8 "
  60. }
  61. })
  62. .then(response => response.text())
  63. .then(html => {
  64. let content = document.createElement("html");
  65. content.innerHTML = html;
  66. let nouveauSelect = content.querySelector("#demande_ville");
  67. document.querySelector("#demande_ville").replaceWith(nouveauSelect);
  68. let ville = document.querySelector("#demande_ville");
  69. ville.addEventListener("change", function(){
  70. getCommunes(ville.value);
  71. })
  72. })
  73. })
  74. }
  75. </script>
  76. <script>
  77. function getCommunes(idVille){
  78. var communes = "";
  79. const xmlhttp = new XMLHttpRequest();
  80. var params = 'id=' + idVille;
  81. xmlhttp.open("POST", "http://localhost/republic/public/index.php/commune/formdata/", true);
  82. xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
  83. xmlhttp.send("id="+idVille);
  84. xmlhttp.onload = function() {
  85. communes = JSON.parse(this.responseText);
  86. let selectCommune = document.querySelector('#demande_commune');
  87. selectCommune.innerHTML = "";
  88. for (let i = 0; i< communes.length; i++){
  89. let newOption = new Option(communes[i].nom, communes[i].id)
  90. selectCommune.add(newOption);
  91. }
  92. }
  93. }
  94. </script>
  95. {% include 'footer.html.twig' %}