utente.welcome.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. {% extends 'base.html' %}
  2. {% block headersupplement %}
  3. <script language="JavaScript">
  4. function toggle(source) {
  5. checkboxes = document.getElementsByName('select');
  6. for(var i=0, n=checkboxes.length;i<n;i++) {
  7. checkboxes[i].checked = source.checked;
  8. }
  9. }
  10. </script>
  11. {% endblock %}
  12. {% block body %}
  13. <form name="inputUtente" method="POST">
  14. <div class='form-control'>
  15. {% if "UTENTE.CREA" in permesso %}
  16. <button type='submit' class="btn btn-primary" name='scelta' value='Nuovo Dipendente'>Nuovo Dipendente</button>
  17. <button type='button' class="btn btn-primary" name='TastoCaricaIndici' data-bs-toggle='modal' data-bs-target='#CaricaIndiceModal'>Carica Lista Nuovi Dipendenti</button>
  18. <button type='submit' class="btn btn-primary" name='ScaricaSelezionati' value="Scarica Selezionati"/>Scarica Selezionati</button>
  19. {% endif %}
  20. <button type='submit' class="btn btn-primary" name="indietro" value="Indietro">Indietro</button>
  21. </div>
  22. <div class='form-control'>
  23. Numero di dipendenti selezionati {{ numeroRecordAttuali }} su un totale di {{ numeroRecordAzienda }}.
  24. </div>
  25. {% csrf_token %}
  26. <table class='table table-striped table-hover'>
  27. <thead class='thead-dark'>
  28. <tr>
  29. {% if "UTENTE.CREA" in permesso %}<th scope='col'>*</th>{% endif %}
  30. <th scope='col'>Nome</th>
  31. <th scope='col'>Codice Fiscale</th>
  32. <th scope='col'>Sede</th>
  33. <th scope='col'>Data di Nascita</th>
  34. <th scope='col'>Luogo di Nascita</th>
  35. <th scope='col'>documenti</th>
  36. {% if "UTENTE.EDIT" in permesso %}
  37. <th scope='col'>Mail</th>
  38. <th scope='col'>Pin</th>
  39. {% endif %}
  40. <th scope='col'>Inserimento</th>
  41. <th scope='col'><input class="form-check-input" type="checkbox" id="selectAll" name="selectAll" value='0' onClick="toggle(this);"/></th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. {% csrf_token %}
  46. {% for uu in utenti %}
  47. <tr>
  48. {% if "UTENTE.EDIT" in permesso %}
  49. <td> <button type='submit' class='btn btn-primary ' name='scelta' value='{{ uu.id }}'>Edit</button></td>
  50. {% endif %}
  51. <td> {{ uu.nome }} </td>
  52. <td> {{ uu.codicefiscale }} </td>
  53. <td> {{ uu.sede.nome }} </td>
  54. <td> {{ uu.datanascita|date:'d/m/Y' }} </td>
  55. <td> {{ uu.luogonascita }} </td>
  56. <td> <a href='{% url 'documento:welcome' uu.id %}'>{{ uu.documenti }}</a></td>
  57. {% if "UTENTE.EDIT" in permesso %}
  58. <td> {{ uu.mail }} </td>
  59. <td> {{ uu.pin }} </td>
  60. {% endif %}
  61. <td> {{ uu.inserimento|date:'d/m/Y' }} </td>
  62. <td>
  63. <input class="form-check-input" type="checkbox" id="select-{{ uu.id}}" name="select" value='{{ uu.id }}'/>
  64. </td>
  65. </tr>
  66. {% endfor %}
  67. </tbody>
  68. </table>
  69. </form>
  70. {% if "UTENTE.EDIT" in permesso %}
  71. <!-- Modal -->
  72. <div class="modal fade" id="CaricaIndiceModal" tabindex="-1" role="dialog" aria-labelledby="CaricaIndiceLabel" aria-hidden="true">
  73. <div class="modal-dialog" role="document">
  74. <div class="modal-content">
  75. <form name='formCaricaIndice' method='POST' enctype='multipart/form-data'>
  76. {% csrf_token %}
  77. <div class="modal-header">
  78. <h5 class="modal-title" id="CaricaIndiceLabel">Carica Elenco Dipendenti</h5>
  79. <span aria-hidden="true">&times;</span>
  80. </button>
  81. </div>
  82. <div class="modal-body">
  83. Caricamento Lista Dipendenti<br>
  84. Formato File CSV - obbligatorio <br>
  85. Separatore: ';' - prima riga: "Nome colonna".</br>
  86. <table class='table table-striped table-hover'>
  87. <tbody>
  88. <tr>
  89. <td>Nome Cognome</td>
  90. <td>Codice Fiscale</td>
  91. <td>Data di Nascita</td>
  92. <td>Luogo di Nascita</td>
  93. <td>email</td>
  94. <td>Sede</td>
  95. </tr>
  96. </tbody>
  97. </table><br>
  98. <label for='indice'>Elenco Dipendenti:&nbsp;</label>
  99. <input type='file' name='indice' id='indice' value='' accept='text/csv'>
  100. </div>
  101. <div class="modal-footer">
  102. <button type="submit" name="CaricaIndice" value='Carica Lista' class="btn btn-primary">Carica Lista Dipendenti</button>
  103. <button type="button" class="btn btn-primary" data-bs-dismiss="modal">Annulla</button>
  104. </div>
  105. </form>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <!-- end modal -->
  111. {% endif %}
  112. {% endblock %}
  113. {% block bodybottom %}
  114. <div><br><br></div>
  115. {% if listaok %}
  116. <table class='table table-striped table-hover'>
  117. <thead class='thead-dark'>
  118. <tr>
  119. <th scope='col'>Documento caricato con successo</th>
  120. </tr>
  121. </thead>
  122. <tbody>
  123. {% for l in listaok %}
  124. <tr>
  125. <td> {{ l }} </td>
  126. </tr>
  127. {% endfor %}
  128. </tbody>
  129. </table>
  130. {% endif %}
  131. <div><br><br></div>
  132. {% if listanotok %}
  133. <table class='table table-striped table-hover'>
  134. <thead class='thead-dark'>
  135. <tr>
  136. <th scope='col'>Documento non caricato perche già presente</th>
  137. </tr>
  138. </thead>
  139. <tbody>
  140. {% for l in listanotok %}
  141. <tr>
  142. <td> {{ l }} </td>
  143. </tr>
  144. {% endfor %}
  145. </tbody>
  146. </table>
  147. {% endif %}
  148. {% if listaok %}
  149. {% for i in listaok %}
  150. {{i }}
  151. {% endfor %}
  152. {% endif %}
  153. {% if listanotok %}
  154. {% for i in listanotok %}
  155. {{i }}
  156. {% endfor %}
  157. {% endif %}
  158. {% endblock %}