{% extends 'app/baseAdmin.html' %} {% block content %}

<div class="market-updates">
<a href="{% url 'allUsers' %}">

  <div class="col-md-4 market-update-gd">
    <div class="market-update-block clr-block-1">
      <div class="col-md-8 market-update-left">
        <h3>{{customerCount}}</h3>
        <h4>Registered Customer</h4>
      </div>

      <div class="col-md-4 market-update-right">
        <i class="fa fa-users"></i>
      </div>

      <div class="clearfix"></div>
    </div>
  </div>
</a>

  <a href="{% url 'adminProductView' %}">
  <div class="col-md-4 market-update-gd">
    <div class="market-update-block clr-block-2">
      <div class="col-md-8 market-update-left">
        <h3>{{productCount}}</h3>
        <h4>Total Product</h4>
      </div>

      <div class="col-md-4 market-update-right">
        <i class="fa fa-shopping-cart"></i>
      </div>

      <div class="clearfix"></div>
    </div>
  </div>
</a>

<a href="adminOrders">
  <div class="col-md-4 market-update-gd">
    <div class="market-update-block clr-block-3">
      <div class="col-md-8 market-update-left">
        <h3>{{orderCount}}</h3>
        <h4>Total Orders</h4>
      </div>
      <div class="col-md-4 market-update-right">
        <i class="fa fa-bar-chart"> </i>
      </div>
      <div class="clearfix"></div>
    </div>
  </div>
</div>
</a>
<div class="container Table">
  <div class="panel panel-danger">
    <div class="panel-heading" style="text-align: center">
      <h6 class="panel-title">Recent Booking</h6>
    </div>
    <table class="table table-hover table-bordered" id="dev-table">
      <thead>
        <tr>
          <th>Customer</th>
          <th>Contact</th>
          <th>Address</th>
          <th>Product</th>
          <th>Ordered Date</th>
          <th>Status</th>
          <th>Payment</th>
          <th>Amount</th>
        </tr>
      </thead>

      {% for order in orders reversed %}
      <tr>
        <td>{{order.customer}}</td>
        <td>{{order.customer.mobile}}</td>
        <td>
          {{order.customer.city}}
        </td>
        <td>
          {{order.product}}
        </td>
        <td>{{order.ordered_date}}</td>

        {% if order.status == 'Pending' %}
        <td><span class="label label-info">{{order.status}}</span></td>
        {% elif order.status == 'Delivered' %}
        <td><span class="label label-success">{{order.status}}</span></td>
        {% elif order.status == 'Out for Delivery' %}
        <td><span class="label label-warning">{{order.status}}</span></td>
        {% else %}
        <td><span class="label label-primary">{{order.status}}</span></td>
        {% endif %}
        <td>{{order.payment}}</td>
        <td>{{order.amount}}</td>
      </tr>
      {% endfor %}
    </table>
  </div>
</div>

{% endblock content %} 