{% extends 'dashboard_screen/base.html' %}

{% block content %}

            <!-- ============================================================== -->
            <!-- Start right Content here -->
            <!-- ============================================================== -->
            <div class="content-page">
                <!-- Start content -->
                <div class="content">
                    <div class="container">
                        <div class="row">

                            <div class="col-lg-12">
                                 <!-- Basic Form Wizard -->

                            	<div class="card-box">
                            		<h4 class="m-t-0 header-title"><b>All Clients</b></h4>
                                <div class="panel">
                                        {% if clients %}

                                        <div class="panel-body">


                                            <div class="">
                                	            <table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
                                                    <thead>
                                                        <tr>
                                                            <th>Code</th>
                                                            <th>Representative</th>
                                                            <th>Legal Name</th>
                                                            <th>Phone</th>
                                                            <th>Status</th>
                                                            <th>Actions</th>
                                                        </tr>
                                                    </thead>
	                                                <tbody>
                                                    {% for client in clients %}

                                                        {% if forloop.counter|divisibleby:2 %}
                                                            <tr class="gradeX">
                                                                <td>{{ client.client_code }}</td>
                                                                <td>{{ client.get_full_name }}</td>
                                                                <td>{{ client.business_legal_name }}</td>
                                                                <td>{{ client.business_phone }}</td>
                                                                 <td>{% if not client.is_aproved or not client.has_price %} <span class="label label-warning">Pending</span>{% else %}<span class="label label-success">Aproved</span>{% endif %}</td>
                                                                <td class="actions">
                                                                    <a href="/dashboard/edit_client/{{ client.client_id }}/" class="on-default edit-row"><i class="fa fa-pencil"></i></a>
                                                                    <a href="/dashboard/invoice/{{ client.client_id }}/" class="on-default remove-row"><i class="fa fa-institution"></i></a>
                                                                    <a href="/dashboard/del_client/{{ client.client_id }}/" class="on-default remove-row"><i class="fa fa-trash-o"></i></a>
                                                                    <a href="/dashboard/update_client_price/{{ client.client_id }}/" class="on-default edit-row"><i class="fa fa-money"></i></a>
                                                                </td>
                                                            </tr>
                                                        {% else %}
                                                            <tr class="gradeC">
                                                                <td>{{ client.client_code }}</td>
                                                                <td>{{ client.get_full_name }}</td>
                                                                <td>{{ client.business_legal_name }}</td>
                                                                <td>{{ client.business_phone }}</td>
                                                                <td>{% if not client.is_aproved or not client.has_price %} <span class="label label-warning">Pending</span>{% else %}<span class="label label-success">Aproved</span>{% endif %}</td>
                                                                <td class="actions">
                                                                    <a href="/dashboard/edit_client/{{ client.client_id }}/" class="on-default edit-row"><i class="fa fa-pencil"></i></a>
                                                                    <a href="/dashboard/invoice/{{ client.client_id }}/" class="on-default remove-row"><i class="fa fa-institution"></i></a>
                                                                    <a href="/dashboard/del_result/{{ client.client_id }}/" class="on-default remove-row"><i class="fa fa-trash-o"></i></a>
                                                                    <a href="/dashboard/update_client_price/{{ client.client_id }}/" class="on-default edit-row"><i class="fa fa-money"></i></a>
                                                                </td>
                                                            </tr>
                                                        {% endif %}

                                                    {% endfor %}



                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                        <!-- end: page -->
                                        {% endif %}

                                    </div> <!-- end Panel -->



                            	</div>


                            <!-- End row -->

                            </div> <!-- end col -->
                        </div>

						<!-- end row -->



                    </div> <!-- container -->

                </div> <!-- content -->


{% endblock %}