<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
 
 
					<div class="row">
						<div class="col-md-12">
							<div class="hs_heading medium">
								<h3>Users (<?php if(!empty($all_users)){ echo count($all_users); }else{ echo 0; } ?>) <a href="<?= base_url('admin/add_new_user') ?>" class="btn">Add new</a></h3>
							</div>
							<div class="hs_datatable_wrapper">
								<table class="hs_datatable table table-bordered">
									<thead>
										<tr>
											<th>Id</th>
											<th>Name</th>
											<th>Email</th>
											<th>Mobile</th>
											<th>Address</th>
											<th>Status</th>
											<th>Action</th>
										</tr>
									</thead>
									<tbody>
									 
									<?php 
									  $i= 0;
									  if(!empty($all_users)){
										 foreach($all_users as $user){ ?>
									 <tr>
											<td><?php echo ++$i; ?></td>
											<td width="200">
												<div class="hs_user">
													<div class="user_img"> 
													  <?php  if($user->user_image !== ''){ ?>
														 <img src="<?php echo base_url().$user->user_image; ?>" alt="user" />
													  <?php }else{ ?>
														<span class="hs_user_initials"><?php 
														$uname_arr = explode(" ", $user->user_name);
														$first_letter='';
														 foreach($uname_arr as $name){
														 $first_letter .= substr($name, 0, 1);
														 }	 
														 echo $first_letter;
														 ?></span>
													  <?php } ?>
													</div>
													<div class="user_name">
														<p><?php echo $user->user_name; ?></p>
														<span>Created at - <?php echo date('d M Y', strtotime($user->registration_date)) ?></span>
													</div>
												</div>
											</td>
											<td><?php echo $user->user_email; ?></td>
											<td><?php echo $user->user_mobile; ?></td>
											<td><?php echo $user->user_address; ?></td>
											<td>
												<label class="switch">
													<input id="userstatus_<?php echo $user->user_id; ?>" onclick="change_user_status(<?php echo $user->user_id; ?>);"  type="checkbox" value="" <?php if($user->user_status == 1){ echo "checked"; } ?> >
													<span class="slider"></span>
												</label>
											</td>
											<td width="200">
												<a href="<?php echo base_url().'admin/update_user_data/'.$user->user_id;  ?>" class="btn" title="Edit"><i class="fa fa-pencil" aria-hidden="true"></i></a>
												<a href="javascript:;" onclick="add_wallet_amount(<?php echo $user->user_id;  ?>);" class="btn" title="Wallet Credit"><i class="fa fa-money" aria-hidden="true"></i></a>
												<a  href="<?php echo base_url().'admin/delete_user/'.$user->user_id;  ?>" class="btn" title="Delete" onclick="return delete_confirmation()"><i class="fa fa-trash" aria-hidden="true"></i></a>
										   </td>
									</tr> 
								   <?php
									  }
									} 
									?>				
									</tbody>
								</table>
							</div>
						</div>
					</div>
			 
				<!------user tab end--------->
				
				
				
<!-- page body end -->

<!-- Add Wallet Amount popup start -->
<div class="modal_box">
<div id="wallet_credit" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title"><span>Credit </span> User Wallet</h4>
            </div>
            <div class="modal-body">
			<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" >
			<form method="post"   id="wallet_credit_form">
                <div class="hs_input">
                    <label>Add Amount</label>
                    <input type="text" class="form-control add_cate_form" name="cd_wallet_amount" id="cd_wallet_amount" value="">
                </div>
				<div class="hs_input">
                    <label>Wallet Note (Description)</label>
                    <input type="text" class="form-control add_cate_form" name="cd_wallet_note" id="cd_wallet_note" value="">
                </div>
				<div class="hs_input">
					<input type="hidden" value="" name="old_wallet_uid" id="old_wallet_uid">
					<button type="submit" id="add"  class="btn">ADD Amount</button>
                </div>
            </div>
			</form>
        </div>
    </div>
</div>
</div>
<!-- Add Wallet Amount popup end -->
