<div class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <h1 class="m-0 text-dark">Customer Info
                </h1>
            </div>
            <!-- /.col -->
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="<?= base_url(); ?>/dashboard">Dashboard</a></li>
                    <li class="breadcrumb-item active">Customer Info</li>
                </ol>
            </div>
        </div>
    </div>
</div>
<section class="content">
    <div class="container-fluid">
        <div class="card">
            <div class="card-body p-0">
                <div class="table-responsive">
                    <table id="custtbl" class="table card-table table-vcenter text-nowrap">
                        <thead>
                            <tr>
                                <th>Name</th>
                                <th>Mobile</th>
                                <th>Email</th>
                                <th>date Of Birth</th>


                                <?php if (userpermission('lr_cust_edit')) { ?>
                                <th>Image</th>
                                <th>Actions</th>
                                <?php } ?>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                     if (!empty($customerlist)) {
                        $count = 1;
                        foreach ($customerlist["user"] as $id => $customerlists) {
                     ?>
                            <tr>
                                <td> <?php echo output($customerlists['fullname']); ?></td>
                                <td> <?php echo output($customerlists['userPhone']); ?></td>
                                <td><?php echo output($customerlists['email']); ?></td>
                                <td><?php echo output($customerlists['dateOfBirth']); ?></td>


                                <?php if (userpermission('lr_cust_edit')) { ?>
                                <td>
                                    <?php if ($customerlists['imageUrl'] != "") { ?>

                                    <img class="img-thumbnail" width="100" height="100" src="<?php echo output($customerlists['imageUrl']); ?>">
                                    <?php } else { ?>
                                    <img class="img-thumbnail" src="http://placehold.jp/100x100.png">
                                    <?php } ?>
                                </td>
                                <td>
                                    <?php if ($customerlists["isSuspend"] && !is_null($customerlists["isSuspend"])) {
                                    ?>
                                    <a class="icon" href="<?php echo base_url(); ?>customer/unSuspendCustomer/<?php echo output($id); ?>">
                                        <button class="btn btn-success">Activate</button>
                                    </a>
                                    <?php
                                    } else {
                                    ?>
                                    <a class="icon" href="<?php echo base_url(); ?>customer/suspendCustomer/<?php echo output($id); ?>">
                                        <button class="btn btn-warning btn-block">Suspend</button>
                                    </a>
                                    <?php
                                    } ?>
                                    <a class="icon" href="<?php echo base_url(); ?>customer/editcustomer/<?php echo output($id); ?>">
                                        <button class="btn btn-info btn-block mt-2">Edit</button>
                                    </a>
                                    <a class="icon" href="<?php echo base_url(); ?>customer/deleteCustomer/<?php echo output($id); ?>">
                                        <button class="btn btn-danger btn-block mt-2">Delete</button>
                                    </a>
                                </td>
                                <?php } ?>
                            </tr>

                            <?php }
                     } ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>