utente.welcome.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. {% if "DOCUMENTO" in permesso %}
  36. <th scope='col'>documenti</th>
  37. {% endif %}
  38. {% if "UTENTE.EDIT" in permesso %}
  39. <th scope='col'>Mail</th>
  40. <th scope='col'>Pin</th>
  41. {% endif %}
  42. <th scope='col'>Inserimento</th>
  43. {% if "DOCUMENTO" in permesso %}
  44. <th scope='col'><input class="form-check-input" type="checkbox" id="selectAll" name="selectAll" value='0' onClick="toggle(this);"/></th>
  45. {% endif %}
  46. </tr>
  47. </thead>
  48. <tbody>
  49. {% csrf_token %}
  50. {% for uu in utenti %}
  51. <tr>
  52. {% if "UTENTE.EDIT" in permesso %}
  53. <td> <button type='submit' class='btn btn-primary ' name='scelta' value='{{ uu.id }}'>Edit</button></td>
  54. {% endif %}
  55. <td> {{ uu.nome }} </td>
  56. <td> {{ uu.codicefiscale }} </td>
  57. <td> {{ uu.sede.nome }} </td>
  58. <td> {{ uu.datanascita|date:'d/m/Y' }} </td>
  59. <td> {{ uu.luogonascita }} </td>
  60. {% if "DOCUMENTO" in permesso %}
  61. <td> <a href='{% url 'documento:welcome' uu.id %}'>{{ uu.documenti }}</a></td>
  62. {% endif %}
  63. {% if "UTENTE.EDIT" in permesso %}
  64. <td> {{ uu.mail }} </td>
  65. <td> {{ uu.pin }} </td>
  66. {% endif %}
  67. <td> {{ uu.inserimento|date:'d/m/Y' }} </td>
  68. {% if "DOCUMENTO" in permesso %}
  69. <td>
  70. <input class="form-check-input" type="checkbox" id="select-{{ uu.id}}" name="select" value='{{ uu.id }}'/>
  71. </td>
  72. {% endif %}
  73. </tr>
  74. {% endfor %}
  75. </tbody>
  76. </table>
  77. </form>
  78. {% if "UTENTE.EDIT" in permesso %}
  79. <!-- Modal -->
  80. <div class="modal fade" id="CaricaIndiceModal" tabindex="-1" role="dialog" aria-labelledby="CaricaIndiceLabel" aria-hidden="true">
  81. <div class="modal-dialog" role="document">
  82. <div class="modal-content">
  83. <form name='formCaricaIndice' method='POST' enctype='multipart/form-data'>
  84. {% csrf_token %}
  85. <div class="modal-header">
  86. <h5 class="modal-title" id="CaricaIndiceLabel">Carica Elenco Dipendenti</h5>
  87. <span aria-hidden="true">&times;</span>
  88. </button>
  89. </div>
  90. <div class="modal-body">
  91. Caricamento Lista Dipendenti<br>
  92. Formato File CSV - obbligatorio <br>
  93. Separatore: ';' - prima riga: "Nome colonna".</br>
  94. <table class='table table-striped table-hover'>
  95. <tbody>
  96. <tr>
  97. <td>Nome Cognome</td>
  98. <td>Codice Fiscale</td>
  99. <td>Data di Nascita</td>
  100. <td>Luogo di Nascita</td>
  101. <td>email</td>
  102. <td>Sede</td>
  103. </tr>
  104. </tbody>
  105. </table><br>
  106. <label for='indice'>Elenco Dipendenti:&nbsp;</label>
  107. <input type='file' name='indice' id='indice' value='' accept='text/csv'>
  108. </div>
  109. <div class="modal-footer">
  110. <button type="submit" name="CaricaIndice" value='Carica Lista' class="btn btn-primary">Carica Lista Dipendenti</button>
  111. <button type="button" class="btn btn-primary" data-bs-dismiss="modal">Annulla</button>
  112. </div>
  113. </form>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <!-- end modal -->
  119. {% endif %}
  120. {% endblock %}
  121. {% block bodybottom %}
  122. <div><br><br></div>
  123. {% if listaok %}
  124. <table class='table table-striped table-hover'>
  125. <thead class='thead-dark'>
  126. <tr>
  127. <th scope='col'>Documento caricato con successo</th>
  128. </tr>
  129. </thead>
  130. <tbody>
  131. {% for l in listaok %}
  132. <tr>
  133. <td> {{ l }} </td>
  134. </tr>
  135. {% endfor %}
  136. </tbody>
  137. </table>
  138. {% endif %}
  139. <div><br><br></div>
  140. {% if listanotok %}
  141. <table class='table table-striped table-hover'>
  142. <thead class='thead-dark'>
  143. <tr>
  144. <th scope='col'>Documento non caricato perche già presente</th>
  145. </tr>
  146. </thead>
  147. <tbody>
  148. {% for l in listanotok %}
  149. <tr>
  150. <td> {{ l }} </td>
  151. </tr>
  152. {% endfor %}
  153. </tbody>
  154. </table>
  155. {% endif %}
  156. {% if listaok %}
  157. {% for i in listaok %}
  158. {{i }}
  159. {% endfor %}
  160. {% endif %}
  161. {% if listanotok %}
  162. {% for i in listanotok %}
  163. {{i }}
  164. {% endfor %}
  165. {% endif %}
  166. {% endblock %}