{% extends 'base.html' %}
{% block content %}


<div class="content container-fluid">

    <div class="page-header">
    <div class="row align-items-center">
    <div class="col">
    <h3 class="page-title">Search Doctor</h3>
    <ul class="breadcrumb">
    <li class="breadcrumb-item"><a href="{% url 'admin_home' %}">Dashboard</a></li>
    <li class="breadcrumb-item active">Search Doctor</li>
    </ul>
    </div>
    
    </div>
    </div>
    
    <div class="row">
    <div class="col-sm-12">
        <div class="card-block">
            <h4 class="sub-title">Search Doctor </h4>
            <form  method="GET">
                
                {% csrf_token %}
                <div class="form-group row">
                    <label class="col-sm-4 col-form-label">Search(By Mobilenumber/Name)</label>
                    <div class="col-sm-10">
                        <input type="text" id="query" name="query" class="form-control" required="">
                    </div>
                </div>
               
             
                <button type="submit" class="btn btn-primary btn-user btn-block">Search</button>    
                        </form>
                    
                        </div>
     
    <div class="card card-table">
    <div class="card-body">
        
        
    <div class="table-responsive">
    <table class="table table-hover table-center mb-0 datatable">
    <thead>
        {% if searchdoc %}
        {% 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 == 'info' %}
       <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 %}
    <tr>
    <th>S.No</th>
    <th>Fullname</th>
    <th>Mobile Number</th>
    <th>Email</th>
    <th>Registration Date</th>
    <th class="text-right">Action</th>
    </tr>
    </thead>
    <tbody>
        {% for i in searchdoc %}

    <tr>
    <td>{{i.id}}</td>
    <td>{{i.admin.first_name}} {{i.admin.last_name}}</td>
    <td>{{i.mobilenumber}}</td>
    <td>{{i.admin.email}}</td>
    <td>{{i.regdate_at}}</td>
    <td class="text-right">
    <div class="actions">
        <a href="{% url 'viewdoctordetails' i.id %}" class="btn btn-sm bg-success-light mr-2">
            Profile
             </a>
             <a href="{% url 'viewdoctorappointmentlist' i.id %}" class="btn btn-sm bg-danger-light">
             Appointment
             </a>
             <a href="{% url 'viewdocpatient' i.id %}" class="btn btn-sm bg-danger-light">
                 Patients Lists
                 </a>
    </a>
    </div>
    </td>
    </tr> {% endfor %}

   
    </tbody>
    </table>
    {% else %}
    {% if query %}
        <p style="font-size: 20px;color: blue;text-align: center;">No records found for: "{{ query }}"</p>
    
    {% endif %}

    {% endif %}
    
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>


{% endblock %}