163 lines
4.8 KiB
PHP
163 lines
4.8 KiB
PHP
|
|
||
|
<main class="wraper responsive-width" id="main">
|
||
|
<div class="from-group adding-class form-group_lng form-group_full-width ">
|
||
|
<a href="<?php echo base_url() . 'admin/users/ae-user/0' ?>"><button type="button" class="btn btn-success btn-sm">Add New User</button></a>
|
||
|
</div>
|
||
|
<!----admin template section---->
|
||
|
<div class="admin_tempblock form-group_full-width">
|
||
|
<div class="admin_tempsec">
|
||
|
<div class="admin_sec">
|
||
|
<form>
|
||
|
<div class="subsec_sec ">
|
||
|
<div class="subject_r subject_r_lng">
|
||
|
<div class="subject_lsec">
|
||
|
<div class="subject_lhead">Users List</div>
|
||
|
|
||
|
<?php if($this->session->flashdata('success')) { ?>
|
||
|
|
||
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||
|
<p><?php echo $this->session->flashdata('success') ?></p>
|
||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||
|
<span aria-hidden="true">×</span>
|
||
|
</button>
|
||
|
</div>
|
||
|
|
||
|
<?php } ?>
|
||
|
|
||
|
<?php if($this->session->flashdata('failed')) { ?>
|
||
|
|
||
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||
|
<p><?php echo $this->session->flashdata('failed') ?></p>
|
||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||
|
<span aria-hidden="true">×</span>
|
||
|
</button>
|
||
|
</div>
|
||
|
|
||
|
<?php } ?>
|
||
|
|
||
|
|
||
|
</div>
|
||
|
<div class="">
|
||
|
<table id="tbl" class="display table-responsive">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>Sl.No</th>
|
||
|
<th>User</th>
|
||
|
<th>Email</th>
|
||
|
<th>User Role</th>
|
||
|
<th>Status</th>
|
||
|
<th>Created On</th>
|
||
|
<th>Modified On</th>
|
||
|
<th>Actions</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<?php
|
||
|
|
||
|
foreach($result as $key => $value) {
|
||
|
$createdDate = date(MY_DATE_FORMAT, strtotime($value['created']));
|
||
|
$modifiedDate = $value['modified'] == null ? '-' : date(MY_DATE_FORMAT, strtotime($value['modified']));
|
||
|
|
||
|
|
||
|
?>
|
||
|
<tr>
|
||
|
<td><?php echo $key + 1 ?></td>
|
||
|
<td><?php echo ucfirst($value['admin_name']) ?></td>
|
||
|
<td><?php echo ucfirst($value['email']) ?></td>
|
||
|
<td><?php echo ucfirst($value['role_name']) ?></td>
|
||
|
<td><?php echo ucfirst($value['status']) ?></td>
|
||
|
<td><?php echo $createdDate ?></td>
|
||
|
<td><?php echo $modifiedDate ?></td>
|
||
|
|
||
|
<td>
|
||
|
<div class="sub_tabbtnsec">
|
||
|
<div class="sub_editbtn"><a href="<?php echo base_url() ?>admin/users/ae-user/<?php echo $value['id'] ?>"><i class="fas fa-pencil-alt"></i></a></div>
|
||
|
|
||
|
|
||
|
<?php
|
||
|
if($value['can_delete'] == 'Yes') { ?>
|
||
|
|
||
|
<a data-toggle="modal" onclick = "delItem(<?php echo $value['id'] ?>)" href="#deleteModal">
|
||
|
<div class="sub_delbtn" >
|
||
|
<i class="fa fa-trash" aria-hidden="true"></i>
|
||
|
</div>
|
||
|
</a>
|
||
|
|
||
|
<?php } ?>
|
||
|
</div>
|
||
|
</td>
|
||
|
|
||
|
</tr>
|
||
|
<?php } ?>
|
||
|
|
||
|
</tbody>
|
||
|
|
||
|
</table>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!----admin template section end---->
|
||
|
</main>
|
||
|
<!--End right-top side-->
|
||
|
|
||
|
<div class="viewDoc delete-modal-wrap">
|
||
|
<div class="modal fade" id="deleteModal" role="dialog">
|
||
|
<div class="modal-dialog">
|
||
|
<div class="modal-content">
|
||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||
|
<div class="delete-modal">
|
||
|
|
||
|
<i class="far fa-times-circle"></i>
|
||
|
<input type = "hidden" id = "btid" />
|
||
|
<h4>Are you sure?</h4>
|
||
|
<p><?php echo str_replace('%s', 'User', THE_DELETE_ALERT_MSG) ?></p>
|
||
|
<div class="delete-modal-btn">
|
||
|
|
||
|
<a onclick="deletedata($('#btid').val());" class="text-white subject_addbtn subject_addbtn_red">Delete</a>
|
||
|
<button type="button" class="subject_addbtn subject_addbtn_cancel" data-dismiss="modal">Cancel</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<script>
|
||
|
$(document).ready(function(){
|
||
|
$('.user-drpdown').click(function(){
|
||
|
$('.drpdown-items').toggle();
|
||
|
});
|
||
|
|
||
|
|
||
|
//table js
|
||
|
$('#tbl').DataTable( {
|
||
|
"lengthMenu": [[50, 75, 100, -1],
|
||
|
[50, 75, 100, "All"]]
|
||
|
} );
|
||
|
//table js end
|
||
|
|
||
|
});
|
||
|
|
||
|
</script>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
function delItem(icn){
|
||
|
// alert(icn);
|
||
|
$('#btid').val(icn);
|
||
|
}
|
||
|
function deletedata(id){
|
||
|
let url = window.location.pathname.split( '/' );
|
||
|
let postUrl = url[1] +'/'+ url[2];
|
||
|
// console.log('admin/delete-section/'+postUrl + id);
|
||
|
window.location.replace('<?php echo base_url() ?>' + 'admin/delete_user/' + id);
|
||
|
}
|
||
|
</script>
|
||
|
|