utente.welcome.html 5.6 KB

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