{% extends 'base.html' %}
{% block content %}
<section class="content-header">
    <div class="container-fluid">
      <div class="row mb-2">
        <div class="col-sm-6">
          <h1>Answered Enquiry</h1>
        </div>
        <div class="col-sm-6">
          <ol class="breadcrumb float-sm-right">
            <li class="breadcrumb-item"><a href="{% url 'dashboard' %}">Home</a></li>
            <li class="breadcrumb-item active">Answered Enquiry</li>
          </ol>
        </div>
      </div>
    </div><!-- /.container-fluid -->
  </section>    <section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-12">
          <div class="card">
            <div class="card-header">
              
            </div>
            <!-- /.card-header -->
            <div class="card-body">
                {% if messages %}
                {% for message in messages %}
                 {% if message.tags == 'error' %}
                <div class="alert alert-warning alert-dismissible fade show" role="alert">
                {{message}}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
                 </button>
                  </div>
                {% endif %}
                {% endfor %}
                {% endif %}
                   {% if messages %}
                {% for message in messages %}
                 {% if message.tags == 'success' %}
                <div class="alert alert-warning alert-dismissible fade show" role="alert">
                {{message}}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
                 </button>
                  </div>
                {% endif %}
                {% endfor %}
                {% endif %}
              <table id="example2" class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th>S.NO</th>
                  
                       
                          <th>Enquiry Number</th>
                          <th>Full Name</th>
                          <th>Mobile Number</th>
                          <th>Date of Enquiry</th>
                          <th>Status</th>
                                <th>Action</th>
                      </tr>
                </thead>
                <tbody>
                    {% for i in answered_enq %}
                <tr>
                  <td>{{ forloop.counter }}</td>
                  <td>{{i.enquirynumber }}
                </td>
                  <td>{{i.fullname}}
                  </td>
                  <td>{{i.mobnum }}
                </td>
               
                  <td>{{i.enquiry_date}}</td>
                  <td>{% if i.status == '' %}
                    <span class="badge badge-danger">Not Answered Yet</span>
                {% elif i.status == 'Answered' %}
                    <span class="badge badge-success">Answered</span>
                
                {% endif %}</td>
                  <td><a href="{% url 'view-enquiry' i.id %}" class="btn btn-success">
                        View Details</a></td>
                </tr>{% endfor %}
                </tbody>
                <tfoot>
                    <tr>
                        <th>S.NO</th>
                  
                       
                          <th>Enquiry Number</th>
                          <th>Full Name</th>
                          <th>Mobile Number</th>
                          <th>Date of Enquiry</th>
                          <th>Status</th>
                                <th>Action</th>
                      </tr>
                </tfoot>
              </table>
              <div class="pagination" style="padding-top: 10px;text-align: center;">
                <span class="step-links">
                    {% if answered_enq.has_previous %}
                        <a href="?page=1">&laquo; first</a>
                        <a href="?page={{ answered_enq.previous_page_number }}">previous</a>
                    {% endif %}
            
                    <span class="current">
                        Page {{ answered_enq.number }} of {{ answered_enq.paginator.num_pages }}.
                    </span>
            
                    {% if answered_enq.has_next %}
                        <a href="?page={{ answered_enq.next_page_number }}">next</a>
                        <a href="?page={{ answered_enq.paginator.num_pages }}">last &raquo;</a>
                    {% endif %}
                </span>
            </div>
            </div>
          
            <!-- /.card-body -->
          </div>
          
          <!-- /.card -->

          <!-- /.card -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </div>
    <!-- /.container-fluid -->
  </section>{% endblock %}
  