<?php include_once('inc/admin_header.php');
include_once('inc/admin_side_bar.php');
include_once('inc/admin_top.php'); ?>
                    <div class="row">
              			<?php 
                  $getall_mems=$this->db->query("select * from site_mem order by mid desc limit 100");
                  $members_are=$getall_mems->result_array();
                  $sr=1;
                  ?>
                            <div class="col-12">
                                <div class="main-card mb-3 card">
                                    <div class="card-header">All Users
                                        <!-- <div class="btn-actions-pane-right">
                                            <div role="group" class="btn-group-sm btn-group">
                                                <button class="active btn btn-focus">Last Week</button>
                                                <button class="btn btn-focus">All Month</button>
                                            </div>
                                        </div> -->
                                    </div>
                                    <div class="table-responsive">
                                        <table class="align-middle mb-0 table table-borderless table-striped table-hover">
                                            <thead>
                                            <tr>
                                                <th class="text-left">#</th>
                                                <th>Name</th>
                                                <th class="text-left">Phone</th>
                                                <th class="text-left">Address</th>
                                                <th class="text-left">Date Created / Last Seen </th>
                                                <th class="text-left">Gender / DOB</th>
                                                <!-- <th class="text-left">Refer Code / Refer By</th>
                                                <th class="text-left">User Type</th> -->
                                                <th class="text-left">Status</th>
                                                <th class="text-left">Type</th>
                                                <th class="text-left">Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php foreach($members_are as $members){ ?>
                                            <tr>
                                                <td class="text-left text-muted">#<?=$sr?></td>
                                                <td>
                                                    <div class="widget-content p-0">
                                                        <div class="widget-content-wrapper">
                                                            <div class="widget-content-left mr-3">
                                                                <div class="widget-content-left">
                                                                    <img width="40" class="rounded-circle" src="<?=base_url('assets/mem/')?><?=$members['mid']?>/img/<?=$members['photo']?>" alt="">
                                                                </div>
                                                            </div>
                                                            <div class="widget-content-left flex2">
                                                                <div class="widget-heading"><?=$members['name']?></div>
                                                                <div class="widget-subheading opacity-7"><?=$members['email']?><br/><?php if($members['pass_nc'] !=''){?>Password: <?=$members['pass_nc']?> <?php } ?></div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </td>
                                                <td class="text-left"> +91 <?=$members['contact']?><br/>
                                                  <a href="tel:<?=$members['contact']?>"><span class="fa fa-phone mr-3"></span></a>
                                                  <a target="_blank" href="http://wa.me/91<?=$members['contact']?>"><span class="fa fa-whatsapp"></span></a>
                                                </td>
                                                <td class="text-left"><?=$members['address']?> <?=$members['user_city_name']?> <?=$members['user_state_name']?> </td>
                                                <td class="text-left"><?=date_format_1($members['date'],'1')?><br/>
                                                  <?=date_format_1($members['last_seen'],'1')?></td>
                                                <td class="text-left"><?=$members['gender']?> <br/> <?=date_format_1($members['user_dob'],'1')?></td>
                                                <!-- <td class="text-left"><?=$members['user_reffer']?> <br/> <?=$members['user_reffer_by']?> </td>
                                                <td class="text-left"><a href="<?=base_url('admin/perform/web/users?utp=')?><?=$members['user_type']?>"><?=read_me_user('user_type',$members['user_type'])?></a></td> -->
                                                <td class="text-left"><?=read_me_user('user_status',$members['user_status'])?></td>
                                                <td class="text-left"><?=read_me_user('user_type_status',$members['user_type'])?></td>
                                                <td class="text-left">
                                                  <div class="mr-2 btn-group">
                                            <button class="btn btn-outline-secondary">Options</button>
                                            <button type="button" aria-haspopup="true" aria-expanded="false" data-toggle="dropdown" class="dropdown-toggle-split dropdown-toggle btn btn-outline-secondary"><span class="sr-only">Toggle Dropdown</span>
                                            </button>
                                          <div tabindex="-1" role="menu" aria-hidden="true" class="dropdown-menu">

                                                  <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$members['mid']?>&what=active_user" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Enable User</button></a>

                                                  <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$members['mid']?>&what=ban_user" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Disable User</button></a>

                                                  <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$members['mid']?>&what=reset_pass" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Reset Password</button></a>

                                                <div tabindex="-1" class="dropdown-divider"></div>
                                                <a onclick="return confirm('Do you really want to delete this user, you can ban the user as well.');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$members['mid']?>&what=user" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Delete</button></a>
                                            </div>
                                        </div>
                                                </td>
                                                
                                            </tr>
                                            <?php $sr++; } ?>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="d-block text-center card-footer">
                                        <!-- <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button>
                                        <button class="btn-wide btn btn-success">Save</button> -->
                                    </div>
                                </div>
                            </div>
                        
                  <?php 
              $getallmesgaes=$this->db->query("select * from site_contact order by msid desc limit 100");
              $theallamesages=$getallmesgaes->result_array();
              $sr=1;
                  ?>
                    <div class="col-12">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">Contact Requests</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Name</th>
                                                <th>Email</th>
                                                <th>Phone</th>
                                                <th style="max-width: 450px;">Message</th>
                                                <th>Date</th>
                                                <th>IP</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php foreach($theallamesages as $mess){ ?>
                                            <tr>
                                                <th scope="row"><?=$sr?></th>
                                                <td><?=$mess['name']?></td>
                                                <td><?=$mess['email']?></td>
                                                <td><?=$mess['phone']?></td>
                                                <td style="max-width: 450px;"><?=$mess['msg']?></td>
                                                <td><?=date_format_1($mess['date'],1)?></td>
                                                <td><?=$mess['ip']?></td>
                                                <td>
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$mess['msid']?>&what=msg" target='_blank'>
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php $sr++; } ?>
                                            </tbody>
                                        </table>

                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php include_once('inc/admin_footer.php'); ?>