{% extends 'Admin/Sidebar2.html' %}
{% block content %}
{% load widget_tweaks %}
{%load static%}
<head>
        <!-- Font special for pages-->
        <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">

        <!-- Main CSS-->

        <link href="{% static "css/main.css" %}"rel="stylesheet" media="all">
</head>
<div class=" >
    <div class="wrapper wrapper 0">

        <div style="margin-left: 0px;" class="card card-5">

            {% if messages %}
<ul class="messages">
    {% for message in messages %}
    <li  {% if message.tags %} class=" {{ message.tags }} " {% endif %}> {{ message }} </li>
    {% endfor %}
</ul>
{% endif %}

            <div class="card-heading">
                <h2 class="title mt-3" style="color: #02111f;"> CUSTOMER DATA   </h2>
            </div>


         <div id="myDiv">
                        <div id="div_print">
                        <div class="card card-body printableArea">



          <div class="container" style="overflow-x:auto;">

                            <table class="table table-striped">
                                 <thead>
                                    <tr>
                                        <th> Customer ID </th>
                                        <th> Customer Name </th>
                                        <th> Mobile Number</th>
                                        <th> NIC </th>
                                        <th> Distance (Km) </th>
                                        <th> Vehicle No</th>
                                        <th> Vehicle Type</th>
                                        <th> Service ID </th>
                                        <th> Service Price </th>
                                        <th> Service Quality Rating</th>
                                        <th> Response Time Rating</th>
                                        <th> Customer Service Rating</th>
                                        <th> Invoice No</th>
                                        <th> Invoice Date </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {% if d %}
                                    {% for i in d %}
                                    <tr>
                                        <td>{{i.CustomerID}}</td>
                                        <td>{{i.CustomerName}}</td>
                                        <td>{{i.MobileNumber}}</td>
                                        <td>{{i.NIC}}</td>
                                        <td>{{i.Distance}}</td>
                                        <td>{{i.VehicleNo}}</td>
                                        <td>{{i.VehicleType}}</td>
                                        <td>{{i.ServiceID}}</td>
                                        <td>{{i.ServicePrice}}</td>
                                        <td>{{i.ServiceQualityRating}}</td>
                                        <td>{{i.ResponseTimeRating}}</td>
                                        <td>{{i.CustomerServiceRating}}</td>
                                        <td>{{i.InvoiceNo}}</td>
                                        <td>{{i.InvoiceDate}}</td>
                                    </tr>
                                    {% endfor %}
                                    {% endif %}
                                </tbody>
                            </table>
                        </div>

</div>

</div></div>

     <script language="javascript">
        function printdiv(printpage) {
            var headstr = "<html><head><title></title></head><body>";
            var footstr = "</body>";
            var newstr = document.all.item(printpage).innerHTML;
            var oldstr = document.body.innerHTML;
            document.body.innerHTML = headstr + newstr + footstr;
            window.print();
            document.body.innerHTML = oldstr;
            location.reload();
            return false;
        }
    </script>


            <div class="card-body">

            <input name="b_print" type="button" class="btn btn-print" onClick="printdiv('div_print');" value=" Print " style="background: #02111f;">
 </div>

          <div class="alert alert-primary fixed-bottom mb-0 text-center" style="background: #747578; border: none; color: white;" role="alert"  > © SERVPORT 2022   </div>


            </div>
        </div>
    </div>
</div>

{% endblock content %}
