<!-- Begin Page Content -->
<div class="container-fluid">

    <!-- Page Heading -->
    <h1 class="h3 mb-2 text-gray-800">All Users</h1>
    <!-- DataTales Example -->
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <!-- <h6 class="m-0 font-weight-bold text-primary">DataTables Example</h6> -->
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                    <thead>
                        <tr>
                            <th>Full Name</th>
                            <th>UserName</th>
                            <th>Phone</th>
                            <th>Total Reminder</th>
                            <th>Archived Reminder</th>
                            <th>Email</th>

                            <th>Country</th>
                            <th>Login</th>
                            <th>Image</th>
                            <th>Actions</th>
                        </tr>
                    </thead>
                    <tfoot>
                        <tr>
                            <th>Full Name</th>
                            <th>UserName</th>
                            <th>Phone</th>
                            <th>Total Reminder</th>
                            <th>Archived Reminder</th>
                            <th>Email</th>
                            <th>Country</th>
                            <th>Login</th>
                            <th>Image</th>
                            <th>Actions</th>
                        </tr>
                    </tfoot>
                    <tbody>
                        <?php
                           if (!empty($customerlist)) {
                              $count = 1;
                              foreach ($customerlist as  $customerlists) {
                                $totalreminder=0;
                                $archiver=0;
                                $requiredKeys = ['userId', 'isArchive'];
                                /*
                                if(isset($customerlists['id'])){
                                    
                                foreach($reminderlist as $r){
                                    if($r !=""){
                                    if(isset($r['userId'])){
                                        
                                         
                                        if($customerlists['id']== $r['userId']){
                                            $totalreminder=$totalreminder+1;
                                       
                                            if(isset($r['isArchive'])){
                                            if($r['isArchive']==true){
                                                $archiver=$archiver+1;
                                                } 
                                            }
                                             
                                                
                                        }
                                            
                                    }
                                        
                                  }
                                //   echo "<pre>";
                                //   print_r($r);
                                //   echo "</pre>";
                                //   exit;
                                        
                                        

                                }
                                
                                
                             }    
                                */
                                
                              //exit;
                        ?>
                        <tr>
                        <td> <?php echo output($customerlists['firstName']." ".$customerlists['lastName']); ?></td>
                        <td> <?php echo output($customerlists['userName']); ?></td>
                            <td> <?php echo output($customerlists['phoneNumber']); ?></td>
                            <td> <?php echo output($totalreminder); ?></td>
                            <td> <?php echo output($archiver); ?></td>
                            <td><?php echo output($customerlists['email']); ?></td>
                            <td><?php echo output($customerlists['country']); ?></td>
                            <td><?php echo output($customerlists['deviceType']); ?></td>

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

                                <img class="img-thumbnail" width="100" height="100" src="<?php echo output($customerlists['image']); ?>">
                                <?php } else { ?>
                                <img class="img-thumbnail" src="http://placehold.jp/100x100.png">
                                <?php } ?>
                            </td>
                            <td>
                                 <?php if ($customerlists["isActive"] == false) {
                                    ?>
                                <a class="icon" style="text-decoration: none;" href="<?php echo base_url(); ?>customer/filounSuspendCustomer/<?php echo output($customerlists['id']); ?>">
                                    <button class="btn btn-success btn-block mt-2">Activate</button>
                                </a>
                                <?php
                                    } else {
                                    ?>
                                <a class="icon" style="text-decoration: none;" href="<?php echo base_url(); ?>customer/filosuspendCustomers/<?php echo output($customerlists['id']); ?>">
                                    <button class="btn btn-warning btn-block mt-2">Suspend</button>
                                </a>
                                <?php
                                    } ?> 
                                <!-- <a class="icon" style="text-decoration: none;" href="<?php echo base_url(); ?>customer/editcustomer/<?php echo output($id); ?>">
                                    <button class="btn btn-info btn-block mt-2">Update</button>
                                </a> -->
                                <a class="icon" style="text-decoration: none;" href="<?php echo base_url(); ?>customer/filodeleteCustomer/<?php echo output($customerlists['id']); ?>">
                                    <button class="btn btn-danger btn-block mt-2">Delete</button>
                                </a>
                            </td>
                        </tr>
                        <?php  } } ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

</div>
<!-- /.container-fluid -->