

     <%- include('partials/header'); -%>



    <!-- ########## START: MAIN PANEL ########## -->
    <div class="br-mainpanel">
      <div class="br-pageheader">
        <nav class="breadcrumb pd-0 mg-0 tx-12">
          <a class="breadcrumb-item" href="dashboard">Read Consultations || WhispersApp</a>
          
        </nav>
      </div><!-- br-pageheader -->

 

      <div class="br-pagebody">
        <div class="br-section-wrapper">
          

          <div class="table-wrapper">
            <table id="datatable1" class="table table-hover   table-dark responsive nowrap">
              <thead class="thead-colored thead-teal">
                <tr>
                  <th class="wd-10p">Message</th>
                  <th class="wd-10p">Date</th>
                  <th class="wd-15p">Client's Name</th>
                  
                  
                  <th class="wd-10p">Category</th>
                  <th class="wd-10p">Action</th>
                  <th class="wd-20p">Client's  Phone</th>
                  <th class="wd-15p">Client's Email</th>

                  
                  
                </tr>
              </thead>
              <tbody>
                
                <% consultationAll.forEach(function(consultation){ %>
                <% if(consultation.isRead == true && consultation.paidFor == true){ %>
                <tr>
                  <td><%= consultation.message.slice(0, 50) %><br><%= consultation.message.slice(51, 60) %>... 
                      <a href="/consultations/view/<%= consultation._id %> "><i class="fa fa-angle-right mg-r-5"></i>View Consultation</a></td>
                  <td><%= consultation.date %></td>
                  <td><%= consultation.fromName %></td>
                  
                  
                      <td>
                        <% if(consultation.isRead != true && consultation.paidFor == true){ %>
                      <button class="btn bg-success text-white btn-sm">Paid For & Unread</button>
                        <% } %>

                        <% if(consultation.isRead == true && consultation.paidFor == true){ %>
                      <button class="btn bg-secondary text-white btn-sm">Paid For & Read</button>
                        <% } %>
                        <% if(consultation.paidFor != undefined){ %>
                      <button class="btn bg-warning text-white btn-sm">Unpaid For</button>
                        <% } %>
                      </td>
                  <td><a href="/consultations/view/<%= consultation._id %>" class="btn btn-teal btn-sm">View Details</a></td>
                  <td><%= consultation.fromPhone %></td>
                  <td><%= consultation.fromEmail %></td>
                  
                </tr>
                <% } %>
                <% }) %>
                
               
              </tbody>
            </table>
          </div><!-- table-wrapper -->

         


          

        </div><!-- br-section-wrapper -->
      </div><!-- br-pagebody -->


<%- include('partials/footer'); -%>