<div class="col-lg-12">
    <!-- <div class="card">
        <div class="card-body p-0">
            <div class="row justify-content-end">
                <div class="col-auto">
                    
                </div>
                
            </div>
        </div>
    </div> -->
    <div class="card">
        <div class="card-body pb-1">
            <div class="row">
                 <?php if(session()->getFlashdata('success')) : ?>
                  
                  <div class="alert alert-success">
                  <?= session()->getFlashdata('success') ?>
                  </div>
                  
                  <?php endif; ?>
                  
                  <?php if(session()->getFlashdata('error')) : ?>
                    
                    <div class="alert alert-danger">
                    <?= session()->getFlashdata('error') ?>
                    </div>
                    
                    <?php endif; ?>
            </div>
            <div class="row justify-content-between">
                <div class="col-auto"><h4 class="card-title">Filters</h4></div>
                <div class="col-auto justify-content-end"><a href="addcustomer" class="btn btn-sm btn-facebook"><i class="mdi mdi-plus"></i>Add Customer</a></div>
            </div>
           
            
            <form action="customerlist" class="row g-3" name="filters">
            <div class="col-auto">
                <label for="custname">Customer Name</label>
                <input type="text" class="form-control form-controll-sm" id="custname" value="Abdullah" name="cn">
             </div>
            <div class="col-auto">
                <label for="mobile">Mobile</label>
                <input type="text" class="form-control form-controll-sm" id="mobile" value="059xxxxxxx" name="m">
             </div>
            <div class="col-auto">
                <label for="vat">VAT</label>
                <input type="text" class="form-control form-controll-sm" id="vat" value="12345678" name="v">
             </div>
            <div class="col-auto">
                <label for="status">Status</label>
                <select class="form-select form-select-sm" name="s" id="status" aria-label="status">
                    <option value="1" selected>Active</option>
                    <option value="2">Inactive</option>
                    <option value="3">Hold</option>
                    <option value="4">Blacklist</option>
                </select>
             </div>
            <div class="col-auto align-content-end">
                <input type="submit" value="Search" class="btn btn-success" readonly disabled>
                <input type="reset" value="Reset" class="btn btn-secondary text-white">
             </div>
        </form>
        </div>
        
    </div>
</div>
<div class="col-lg-12 grid-margin stretch-card mt-1">
    <!-- Summary Table Limit 50 -->
<div class="card">
    <div class="card-body p-2">
        <table class="table table-bordered ga-table-small">
            <thead>
            <tr>
                
                <th>Customer ID</th>
                <th>Company Name</th>
                <th>Contact Person</th>
                <th>Mobile</th>
                <th>email</th>
                <th>VAT No</th>
                <th>City</th>
                <th>Credit Limit</th>
                <th>Time</th>
                <th>Status</th>
                <th>Actions</th>
            </tr>
            </thead>
            <tbody>
                <?php foreach($customers as $customer): ?>
                    <tr>
                        
                        <td> CUST-<?= str_pad($customer['cid'], 5, '0', STR_PAD_LEFT) ?></td>
                        <td><?= esc($customer['c_cname']) ?></td>
                        <td> <?= esc($customer['c_fname'].' '.$customer['c_lname']) ?></td>
                        <td><?= esc($customer['c_mobile']) ?></td>
                        <td><?= esc($customer['c_email']) ?></td>
                        <td><?= esc($customer['c_cvat']) ?></td>
                        <td><?= esc($customer['c_ccity']) ?></td>
                        <td><?= esc($customer['c_ccrlimit']) ?></td>
                        <td><?= esc($customer['c_ccrduration']." Days")?></td>
                        <?php $badge ="badge-success";
                        switch ($customer['c_status']) {
                            case 'hold':
                                $badge="badge-warning";
                                break;
                            case 'block':
                                $badge="badge-danger";
                                break;
                            
                            default:
                                $badge;
                                break;
                        }
                        ?>
                        <td><label class="badge <?php echo $badge;?> text-capitalize"><?= esc($customer['c_status']) ?></label></td>
                        <td>
                            <a href="<?php echo  site_url('admin/viewcustomer/'.$customer['cid']);?>"><i class="mdi mdi-eye mdi-18px text-info"></i></a>
                            <a href="<?php echo site_url('admin/updatecustomer/'.$customer['cid']);?>"><i class="mdi mdi-pen mdi-18px text-success"></i></a>
                            <a href="<?= site_url('admin/deletecustomer/'.$customer['cid']);?>" onclick="return confirm('Are you sure you want to delete this customer?');"><i class="mdi mdi-trash-can mdi-18px text-danger"></i></a>
                        </td>
                    </tr>
                <?php endforeach; ?>
            
            </tbody>
        </table>
    </div>
</div>
</div>
<div class="col-lg-12 grid-margin stretch-card">
<div class="card">
    <div class="card-body">
    <h4 class="card-title">Payment Due Time </h4>
    
    </p>
    <table class="table table-striped">
        <thead>
        <tr>
            <th> User </th>
            <th> First name </th>
            <th> Progress </th>
            <th> Amount </th>
            <th> Deadline </th>
            <th> Action </th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td class="py-1">
            <img src="../../assets/images/faces-clipart/pic-1.png" alt="image" />
            </td>
            <td> Herman Beck </td>
            <td>
            <div class="progress">
                <div class="progress-bar bg-success" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
            </div>
            </td>
            <td> SAR 77.99 </td>
            <td> May 15, 2015 </td>
            <td> <a href="#sendreminder" class="btn btn-primary">Send Reminder</a> </td>
        </tr>
        <tr>
            <td class="py-1">
            <img src="../../assets/images/faces-clipart/pic-2.png" alt="image" />
            </td>
            <td> Messsy Adam </td>
            <td>
            <div class="progress">
                <div class="progress-bar bg-danger" role="progressbar" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
            </div>
            </td>
            <td> SAR245.30 </td>
            <td> July 1, 2015 </td>
            <td> <a href="#sendreminder" class="btn btn-primary">Send Reminder</a> </td>
        </tr>
        <tr>
            <td class="py-1">
            <img src="../../assets/images/faces-clipart/pic-3.png" alt="image" />
            </td>
            <td> John Richards </td>
            <td>
            <div class="progress">
                <div class="progress-bar bg-warning" role="progressbar" style="width: 90%" aria-valuenow="90" aria-valuemin="0" aria-valuemax="100"></div>
            </div>
            </td>
            <td> SAR138.00 </td>
            <td> Apr 12, 2015 </td>
            <td> <a href="#sendreminder" class="btn btn-primary">Send Reminder</a> </td>
        </tr>
        <tr>
            <td class="py-1">
            <img src="../../assets/images/faces-clipart/pic-4.png" alt="image" />
            </td>
            <td> Peter Meggik </td>
            <td>
            <div class="progress">
                <div class="progress-bar bg-primary" role="progressbar" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
            </div>
            </td>
            <td> SAR 77.99 </td>
            <td> May 15, 2015 </td>
            <td> <a href="#sendreminder" class="btn btn-primary">Send Reminder</a> </td>
        </tr>
        <tr>
            <td class="py-1">
            <img src="../../assets/images/faces-clipart/pic-1.png" alt="image" />
            </td>
            <td> Edward </td>
            <td>
            <div class="progress">
                <div class="progress-bar bg-danger" role="progressbar" style="width: 35%" aria-valuenow="35" aria-valuemin="0" aria-valuemax="100"></div>
            </div>
            </td>
            <td> SAR 160.25 </td>
            <td> May 03, 2015 </td>
            <td> <a href="#sendreminder" class="btn btn-primary">Send Reminder</a> </td>
        </tr>
        <tr>
            <td class="py-1">
            <img src="../../assets/images/faces-clipart/pic-2.png" alt="image" />
            </td>
            <td> John Doe </td>
            <td>
            <div class="progress">
                <div class="progress-bar bg-info" role="progressbar" style="width: 65%" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100"></div>
            </div>
            </td>
            <td> SAR 123.21 </td>
            <td> April 05, 2015 </td>
            <td> <a href="#sendreminder" class="btn btn-primary">Send Reminder</a> </td>
        </tr>
        <tr>
            <td class="py-1">
            <img src="../../assets/images/faces-clipart/pic-3.png" alt="image" />
            </td>
            <td> Henry Tom </td>
            <td>
            <div class="progress">
                <div class="progress-bar bg-warning" role="progressbar" style="width: 20%" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"></div>
            </div>
            </td>
            <td> SAR 150.00 </td>
            <td> June 16, 2015 </td>
            <td> <a href="#sendreminder" class="btn btn-primary">Send Reminder</a> </td>
        </tr>
        </tbody>
    </table>
    </div>
</div>
</div>