<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">

    <title>{{election['title']}}</title>
  </head>
  <body>
    
    <div class="container text-center mt-5">
        <h3 style="text-transform: capitalize;">Election Status {{election['year']}}</h3>
        <table class="table">
          <thead>
            <tr>
              <th scope="col">#</th>
              <th scope="col">Zone</th>
              <th scope="col">Voter ID</th>
              <th scope="col">Voter name</th>
              {% if viewstatus == 1 %}
              {% if election_types %}
              {% for key, type in all_election_types %}
              
              <th scope="col" class="text-left">{{type['title']}}</th>

              {% endfor %}
              {% endif %}
              {% endif %}
            </tr>
          </thead>
          <tbody>
            {% if voters %}
            {% for key, voter in voters %}
            <tr>
              <th scope="row">{{ loop.index }}</th>
              <td>{{voter['zone']}}</td>
              <td>{{key}}</td>
              <td>{{voter['votername']}}</td>
              {% if viewstatus == 1 %}
              <td class="text-left">{{voter['pre']}}</td>
              <td class="text-left">{{voter['sec']}}</td>
              <td class="text-left">{{voter['jsec']}}</td>
              <td class="text-left">{{voter['tres']}}</td>
              <td class="text-left">{{voter['zpres']}}</td>
              <td class="text-left">{{voter['zcoun']}}</td>
              {% endif %}
            </tr>
            {% endfor %}
            {% else %}
            <tr>
              <td class="text-center" colspan="4">No results</td>
            </tr>
            {% endif %}
            
          </tbody>
        </table>
        <button class="btn btn-success" onclick="window.print()"><i class="fa fa-user"></i>Save as PDF</button>
    </div>

    <!-- Optional JavaScript; choose one of the two! -->

    <!-- Option 1: jQuery and Bootstrap Bundle (includes Popper) -->
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>

    <!-- Option 2: jQuery, Popper.js, and Bootstrap JS
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s" crossorigin="anonymous"></script>
    -->
  </body>
</html>