151 lines
6.4 KiB
PHP
151 lines
6.4 KiB
PHP
<!-- ============================================================== -->
|
|
<!-- Start Page Content here -->
|
|
<!-- ============================================================== -->
|
|
|
|
<div class="content-page">
|
|
<!-- Start Content-->
|
|
<div class="container-fluid">
|
|
|
|
<!-- start page title -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="page-title-box page-title-box-alt">
|
|
<h4 class="page-title">Client List</h4>
|
|
<div class="page-title-right">
|
|
<a href="<?= base_url('client_create'); ?>" class="btn btn-primary waves-effect waves-light">
|
|
Create Client
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
|
|
|
|
<table id="datatable-buttonss" class="table table-striped dt-responsive nowrap w-100">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>PAN</th>
|
|
<th>Mobile</th>
|
|
<th>Email</th>
|
|
<th>Shared Docs</th>
|
|
<th>Status</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($clientList as $key => $value) { ?>
|
|
|
|
<tr>
|
|
<td> <?php echo $value['name']; ?></td>
|
|
<td> <?php echo $value['pan_no']; ?></td>
|
|
<td><?php echo $value['mobile_no']; ?></td>
|
|
<td><?php echo $value['email']; ?></td>
|
|
<td><?php echo $value['docs_count']; ?></td>
|
|
<td>
|
|
<?php if($value['is_active'] == 1): ?>
|
|
<span style="color:green">Active</span>
|
|
<?php else: ?>
|
|
<span style="color:red">Inactive</span>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td>
|
|
<div class="btn-group dropdown">
|
|
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
|
<div class="dropdown-menu dropdown-menu-right">
|
|
<a class="dropdown-item" href="<?= base_url()."client_edit?client_id=".md5($value['client_id']); ?>" > <i class='mdi mdi-pencil-outline mr-1' style="margin-right: 16px !important;margin-left: 5px;"></i>Edit</a>
|
|
|
|
<?php if($value['is_active'] == 1): ?>
|
|
<a class="dropdown-item" data-id="<?php echo $value['client_id']; ?>" data-isactive="<?php echo $value['is_active']; ?>" title="Deactivate" onclick="statusChange(this)"><i class="ri-shield-user-line"></i><i class="fa fa-times" style="font-size: x-small;margin-right:10px"></i>Deactivate</a>
|
|
<?php else: ?>
|
|
<a class="dropdown-item" data-id="<?php echo $value['client_id']; ?>" data-isactive="<?php echo $value['is_active']; ?>" title="Activate" onclick="statusChange(this)"><i class="ri-shield-user-line" style="margin-right:10px"></i>Activate</a>
|
|
<?php endif; ?>
|
|
|
|
<a class="dropdown-item" href="<?= base_url()."shared_docs_list?client_id=".$value['client_id']; ?>" > <i class='mdi mdi-file-document-outline mr-1' style="margin-right: 16px !important;margin-left: 5px;"></i>Documents</a>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
</div> <!-- end card body-->
|
|
</div> <!-- end card -->
|
|
</div><!-- end col-->
|
|
</div>
|
|
|
|
|
|
|
|
</div> <!-- container -->
|
|
|
|
</div> <!-- content -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ============================================================== -->
|
|
<!-- End Page content -->
|
|
<!-- ============================================================== -->
|
|
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#datatable-buttonss').DataTable({
|
|
|
|
|
|
"ordering": false
|
|
});
|
|
});
|
|
|
|
function statusChange(params) {
|
|
console.log(params);
|
|
var status = params.getAttribute('data-isactive');
|
|
var client_id = params.getAttribute('data-id');
|
|
if(status == 1){
|
|
var is_active= 0;
|
|
}else{
|
|
var is_active= 1;
|
|
}
|
|
|
|
var formData = {
|
|
client_id: client_id,
|
|
is_active: is_active
|
|
};
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: '<?php echo base_url()."status_client"?>',
|
|
data: formData,
|
|
dataType: 'json',
|
|
success: function(response) {
|
|
if (response.data) {
|
|
window.location.reload();
|
|
}
|
|
},
|
|
error: function(xhr, status, error) {
|
|
// Handle error response here
|
|
console.error(xhr.responseText);
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|