<div class="row">
    <div class="col-md-7 my-2">
        <h3 class="fmon">Vendors</h3>
    </div>
    <div class="col-md-5 my-2">
        <!-- <div class="row">
            <div class="col-md-6">
                <a href="<?php echo base_url('vendors'); ?>" class="btn btnC w-100">New Vendors</a>
            </div>
            <div class="col-md-6">
                <a href="<?php echo base_url('vendors/approvedVendor'); ?>" class="btn btnC2 w-100">Approved Vendors</a>
            </div>
        </div> -->
    </div>

</div>

<div class="row">
    <div class="col-md-12">
        <table class="table table-striped" id="vendortable">
            <thead class="thead-dark">
                <tr>
                    <th scope="col">Name</th>
                    <th scope="col">Email</th>
                    <th scope="col">Phone</th>
                    <th scope="col">Address</th>
                    <th scope="col" class="text-nowrap">Store Name</th>
                    <!--
                    <th scope="col">Products</th>
                    <th scope="col">Total</th>
-->
                    <th scope="col">Actions</th>

                </tr>
            </thead>
            <tbody>
                <?php foreach ($vendorlist as $v => $d) {
                    // echo "<prE>";
                    // print_r($d);
                    // echo "</pre>";

                ?>
                <tr>
                    <td class="text-nowrap"><?php echo $d['firstName'] . " " . $d['lastName']; ?></td>
                    <td><?php echo $d['email'] ?></td>
                    <td><?php echo $d['phoneNumber'] ?></td>
                    <td><?php echo $d['address'] ?></td>
                    <td><?php echo $d['shopName'] ?></td>
<!--
                    <td>35 Products</td>
                    <td>$2158.00</td>
                -->
                    <td>
                        <div class="dropdown">
                            <button class="btn btnelep" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                                <img src="<?php echo base_url() ?>/assets/images/ellep.png" alt="">
                            </button>
                            <ul class="dropdown-menu">
                                <?php if ($d['isApproved'] == true) { ?>
                                <li><a class="dropdown-item"
                                        href="<?php echo base_url('vendors/disablevendor/') . $v; ?>">Disable</a>

                                    <?php } else { ?>
                                <li><a class="dropdown-item"
                                        href="<?php echo base_url('vendors/approveVendor/') . $v; ?>">Approved</a>
                                    <?php } ?>

                                    <?php ?>
                                <li><a class="dropdown-item"
                                        href="<?php echo base_url('vendors/editvendor/') . $v; ?>">edit</a>

                                </li>
                                <li><a class="dropdown-item"
                                        href="<?php echo base_url('vendors/deletevendor/') . $v; ?>">delete</a></li>

                            </ul>
                        </div>
                    </td>
                </tr>
                <?php } ?>
            </tbody>
        </table>
    </div>
</div>



<script src="<?php echo base_url('assets/js/jquery.min.js'); ?>"></script>
<script>
$(document).ready(function() {
    $('#vendortable').DataTable();
});
</script>