templates/formations/add_demande_formation.html.twig line 1

Open in your IDE?
  1. {% extends 'register_admin.html.twig' %}
  2. {% block title %}{{ "L'OFFICE DE L'ELEVAGE ET DES PATURAGES"|trans }}{% endblock %}
  3. {% block body %}
  4. <form method="post" action="{{ path('demande_formation_add') }}" enctype="multipart/form-data" >
  5.     <h1 class="text-center mb-4 text-uppercase font-weight-bold text-primary">{{ "Demande de Formation"|trans }}</h1>
  6.     <div class="alert-box mt-3">
  7.         {% for type, messages in {'failure_insert': "Veuillez cocher le recaptcha"|trans, 'failure_insert_pdf': "Le fichier doit être un PDF."|trans} %}
  8.             {% for message in app.flashes(type) %}
  9.                 {% if message == true %}
  10.                     <div class="alert alert-danger" role="alert">
  11.                         <div class="alert-body">{{ messages }}</div>
  12.                     </div>
  13.                 {% endif %}
  14.             {% endfor %}
  15.         {% endfor %}
  16.     </div>
  17.     <div class="row align-items-center mb-4">
  18.         <div class="col-md-3 text-md-right text-left">
  19.             <label class="font-weight-bold">{{ "Formation en"|trans }} :<span class="text-danger">*</span></label>
  20.         </div>
  21.         <div class="col-md-9 d-flex">
  22.             <div class="custom-control custom-radio mr-4">
  23.                 <input type="radio" id="customRadio1" name="demande_formation[typeFormation]" value="Insémination Artificielle Bovine" class="custom-control-input" required>
  24.                 <label class="custom-control-label" for="customRadio1">{{ "Insémination Artificielle"|trans }}</label>
  25.             </div>
  26.             <div class="custom-control custom-radio">
  27.                 <input type="radio" id="customRadio2" name="demande_formation[typeFormation]" value="Apiculture" class="custom-control-input">
  28.                 <label class="custom-control-label" for="customRadio2">{{ "Apiculture"|trans }}</label>
  29.             </div>
  30.         </div>
  31.     </div>
  32.     <div class="row mb-2">
  33.         <div class="col-md-6">
  34.             <div class="form-group">
  35.                 <label class="font-weight-bold">{{ 'user.nom-prenom-fr'|trans }} :<span class="text-danger">*</span></label>
  36.                 {{ form_widget(form.nprElvLt, { 'attr': {'class': 'form-control form-control-lg'} }) }}
  37.             </div>
  38.         </div>
  39.         <div class="col-md-6">
  40.             <div class="form-group">
  41.                 <label class="font-weight-bold">{{ 'user.nom-prenom-ar'|trans }} :<span class="text-danger">*</span></label>
  42.                 {{ form_widget(form.nprElvLi, { 'attr': {'class': 'form-control form-control-lg'} }) }}
  43.             </div>
  44.         </div>
  45.     </div>
  46.     <div class="row mb-2">
  47.         <div class="col-md-6">
  48.             <div class="form-group">
  49.                 <label class="font-weight-bold">{{ "E-mail"|trans }} :<span class="text-danger">*</span></label>
  50.                 {{ form_widget(form.email, { 'attr': {'class': 'form-control form-control-lg'} }) }}
  51.             </div>
  52.         </div>
  53.         <div class="col-md-6">
  54.             <div class="form-group">
  55.                 <label class="font-weight-bold">{{ "N° Carte d'Identité Nationale"|trans }} :<span class="text-danger">*</span></label>
  56.                 {{ form_widget(form.cin, { 'attr': {'class': 'form-control form-control-lg'} }) }}
  57.             </div>
  58.         </div>
  59.     </div>
  60.     <div class="row mb-2">
  61.         <div class="col-md-6">
  62.             <div class="form-group">
  63.                 <label class="font-weight-bold">{{ "Niveau d'Education"|trans }} :<span class="text-danger">*</span></label>
  64.                 {{ form_widget(form.niveauEducation, { 'attr': {'class': 'form-control form-control-lg'} }) }}
  65.             </div>
  66.         </div>
  67.         <div class="col-md-6">
  68.             <div class="form-group">
  69.                 <label class="font-weight-bold">{{ "Numéro de Telephone"|trans }} :<span class="text-danger">*</span></label>
  70.                 {{ form_widget(form.numTel, { 'attr': {'class': 'form-control form-control-lg'} }) }}
  71.             </div>
  72.         </div>
  73.     </div>
  74.     <div class="row mb-2">
  75.         <div class="col-md-6">
  76.             <div class="form-group">
  77.                 <label class="font-weight-bold">{{ "Adresse"|trans }} :<span class="text-danger">*</span></label>
  78.                 {{ form_widget(form.adresse, { 'attr': {'class': 'form-control form-control-lg'} }) }}
  79.             </div>
  80.         </div>
  81.         <div class="col-md-6">
  82.             <div class="form-group">
  83.                 <label class="font-weight-bold">{{ "Gouvernorats"|trans }} :<span class="text-danger">*</span></label>
  84.                 {{ form_widget(form.gouvernorat, { 'attr': {'class': 'form-control form-control-lg'} }) }}
  85.             </div>
  86.         </div>
  87.     </div>
  88.     <div class="row mb-2">
  89.         <div class="col-md-12">
  90.             <div class="form-group">
  91.                 <label class="font-weight-bold">
  92.                     {{ "Charger Diplôme"|trans }} <span class="text-danger">*</span>
  93.                 </label>
  94.                 <div class="file-upload-wrapper" style="position: relative;">
  95.                     <input type="file" name="demande_formation[docDiplomes]" class="form-control file-upload-input" accept=".pdf" style="border: 2px solid #ced4da; padding: 10px; border-radius: 8px; cursor: pointer;" required>
  96.                 </div>
  97.             </div>
  98.         </div>
  99.     </div>
  100.     <div class="row mb-2">
  101.         <div class="col-12 text-center">
  102.             <div  class="form-group mt-2" style="">
  103.                 {{ form_row(form.recaptcha) }}
  104.                 {{ form_errors(form.recaptcha) }}
  105.             </div>
  106.         </div>
  107.     </div>
  108.     {{ form_widget(form._token) }}
  109.     <div class="form-group text-center mt-4">
  110.         <button class="btn btn-primary btn-lg w-50 btn-rounded text-uppercase">{{ "S'inscrire"|trans }}</button>
  111.     </div>
  112.     <div class="form-group text-center mt-2">
  113.         <a href="{{ path('login') }}" class="text-info">{{ "Vous avez un compte?"|trans }} <strong>{{ "S'authentifier"|trans }}</strong></a>
  114.     </div>
  115. </form>
  116. {% endblock %}
  117. {% block javascripts %}
  118.     <script type="text/javascript">
  119.     $(function() {
  120.         $(".preloader ").fadeOut();
  121.     });
  122.     $("form").submit(function(event) {
  123.      var recaptcha = $("#g-recaptcha-response").val();
  124.      if (recaptcha === "") {
  125.       event.preventDefault();
  126.   }
  127. });
  128.     function changeType(val){
  129.         var type = val.value;
  130.         if(type=="P"){
  131.             $('#cin').show();
  132.             $('#matricule').hide();
  133.         }else{
  134.             $('#cin').hide();
  135.             $('#matricule').show();
  136.         }
  137.     }
  138.     function getDelegation(sel)
  139.     {
  140.         var name= 'agent[delegation]';
  141.         var nameImada= 'agent[imada]';
  142.         var formURL = "{{ path('get_delegation_ajax') }}";
  143.         var id_gouvernorat = sel.value;
  144.         $.ajax({
  145.             url: formURL,
  146.             data: {'id': id_gouvernorat},
  147.             dataType: "json",
  148.             type: 'post',
  149.             success: function (data, textStatus, jqXHR) {
  150.                 $('select[name="'+name+'"]').empty();
  151.                 $('select[name="'+name+'"]').append(
  152.                     "<option value=" + ">" + "-----" + "</option>"
  153.                     );
  154.                 $('select[name="'+nameImada+'"]').empty();
  155.                 $('select[name="'+nameImada+'"]').append(
  156.                     "<option value=" + ">" + "-----" + "</option>"
  157.                     );
  158.                 i = 0;
  159.                 $.each(data, function (index, delegation) {
  160.                     if (delegation != null ) {
  161.                         $('select[name="'+name+'"]').append(
  162.                             delegation.nom
  163.                             + "<option value=" + delegation.id + ">" + delegation.nom + "</option>"
  164.                             )
  165.                     } 
  166.                     i++;
  167.                 }
  168.                 );
  169.             },
  170.             error: function (jqXHR, textStatus, errorThrown) {
  171.                 console.log('nom: ' + errorThrown);
  172.                 console.log('Not Ok: ' + jqXHR);
  173.             }
  174.         });
  175.         console.log("Handler for .change() called." + name);
  176.     }
  177.     function getImada(sel)
  178.     {
  179.         var name= 'agent[imada]';
  180.         var formURL = "{{ path('get_imada_ajax') }}";
  181.         var id_gouvernorat = sel.value;
  182.         $.ajax({
  183.             url: formURL,
  184.             data: {'id': id_gouvernorat},
  185.             dataType: "json",
  186.             type: 'post',
  187.             success: function (data, textStatus, jqXHR) {
  188.                 $('select[name="'+name+'"]').empty();
  189.                 $('select[name="'+name+'"]').append(
  190.                     "<option value=" + ">" + "-----" + "</option>"
  191.                     );
  192.                 i = 0;
  193.                 $.each(data, function (index, delegation) {
  194.                     if (delegation != null ) {
  195.                         $('select[name="'+name+'"]').append(
  196.                             delegation.nom
  197.                             + "<option value=" + delegation.id + ">" + delegation.nom + "</option>"
  198.                             )
  199.                     } 
  200.                     i++;
  201.                 }
  202.                 );
  203.             },
  204.             error: function (jqXHR, textStatus, errorThrown) {
  205.                 console.log('nom: ' + errorThrown);
  206.                 console.log('Not Ok: ' + jqXHR);
  207.             }
  208.         });
  209.         console.log("Handler for .change() called." + name);
  210.     }
  211.     </script>
  212.     {% endblock %}