{% extends 'base.html' %}

{% block top %}
    <div class='form-outline mb-3 text-center btn-primary h3'>
           {{ HeaderTitle }}
    </div>
    <div clasS='form-outline mb-3 text-center btn-primary h3'>
           Azienda in elaborazione: {{ azienda.nome }}
    </div>
    <div clasS='form-outline mb-3 text-center btn-primary h3'>
           Amministratore: {{ admin.username }}
    </div>
{% endblock %}

{% block body %}
  <form name="inputUtente" method="POST">
  <div class='form-control'>
    <input type='submit' class="btn btn-secondary" name='scelta' value='Nuovo Utente'>
    <input type='submit' class="btn btn-secondary" name='CaricamentiMultipli' value='Caricamenti Multipli'>
     <input type='submit' class="btn btn-primary" name="ritorna" value="Ritorna">
  </div>

  {% csrf_token %}
  <table class='table table-striped table-hover'>
    <thead class='thead-dark'>
      <tr>
        <th scope='col'>Id</th>
        <th scope='col'>Nome</th>
        <th scope='col'>Codice Fiscale</th>
        <th scope='col'>Data di Nascita</th>
	<th scope='col'>Luogo di Nascita</th>
	<th scope='col'>documenti</th>
        <th scope='col'>Mail</th>
	<th scope='col'>Pin</th>
        <th scope='col'>Inserimento</th>
      </tr>
    </thead>
    <tbody>
      {% csrf_token %}
      {% for uu in utenti %}
        <tr>
	  <td> <button type='submit' class='btn btn-primary btn-block btn-lg mb-2 active' name='scelta' value='{{ uu.id }}'>Edit</button></td>
          <td> {{ uu.nome }} </td>
	  <td> {{ uu.codicefiscale }} </td>
	  <td> {{ uu.datanascita|date:'d/m/Y' }} </td>
	  <td> {{ uu.luogonascita }} </td>
	  <td> {{ uu.documenti }} </td>
          <td> {{ uu.mail }} </td>
          <td> {{ uu.pin }} </td>
          <td> {{ uu.inserimento|date:'d/m/Y' }} </td>
	</tr>
      {% endfor %} 
    </tbody>
  </table>
  </form>

{% endblock %}

{% block bodybottom %}
  <div><br><br></div>


  {% if listaok %}
    <table class='table table-striped table-hover'>
      <thead class='thead-dark'>
      <tr>
        <th scope='col'>Documento caricato con successo</th>
      </tr>
      </thead>
      <tbody>
        {% for l in listaok %}
        <tr>
          <td> {{ l }} </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  {% endif %}

  <div><br><br></div>
  {% if listanotok %}
    <table class='table table-striped table-hover'>
      <thead class='thead-dark'>
      <tr>
        <th scope='col'>Documento non caricato perche già presente</th>
      </tr>
      </thead>
      <tbody>
        {% for l in listanotok %}
        <tr>
          <td> {{ l }} </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  {% endif %}

  {% if listaok %}
    {% for i in listaok %}
      {{i }}
    {% endfor %}
  {% endif %}

  {% if listanotok %}
    {% for i in listanotok %}
      {{i }}
    {% endfor %}
  {% endif %}

{% endblock %}

