153 lines
4.8 KiB
PHP
153 lines
4.8 KiB
PHP
<head>
|
|
<style>
|
|
div.dataTables_wrapper div.dataTables_filter{
|
|
margin-top: -30px !important;
|
|
}
|
|
.btn .btn-sm .btn-secondary{
|
|
margin-top:-8px;
|
|
}
|
|
.btn .btn-sm .btn-primary{
|
|
margin-top:-10px;
|
|
}
|
|
|
|
|
|
</style>
|
|
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css'>
|
|
</head>
|
|
<div class="col-md-12 col-sm-12 ">
|
|
<div class="x_panel">
|
|
<div class="x_title">
|
|
<h2>Employee Details </h2>
|
|
<ul class="nav navbar-right panel_toolbox">
|
|
<a href="<?php echo base_url();?>Employee/addEmployee" class="btn btn-sm btn-primary">Add Employee</a>
|
|
<a href="<?php echo base_url();?>Employee/sendemail" class="btn btn-sm btn-primary">send</a>
|
|
</ul>
|
|
<div class="clearfix"></div>
|
|
</div>
|
|
<div class="x_content">
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<table id="datatables" class="table table-striped table-bordered" width="100%">
|
|
<thead>
|
|
<tr class="headings">
|
|
<th hidden >id</th>
|
|
<th class="column-title">Name </th>
|
|
<th class="column-title">Email </th>
|
|
<th class="column-title">Mobile </th>
|
|
<th class="column-title" >Department </th>
|
|
<th class="column-title" >Action </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php if (!is_null($tableData)) {
|
|
foreach ($tableData as $key => $value) { ?>
|
|
<tr class="even pointer">
|
|
<td hidden ><?php echo $value->id; ?> </td>
|
|
<td class=" "> <?php echo $value->name; ?> </td>
|
|
<!-- <?php if (is_superadmin()) { ?>
|
|
<td class=" "> <?php echo $value->business ?> </td>
|
|
<?php
|
|
} ?> -->
|
|
<td class=" "><?php echo $value->email; ?> </td>
|
|
<td class=" "><?php echo $value->mobile; ?></td>
|
|
<td class=" "><?php echo $value->department; ?></td>
|
|
<td style=" text-align: center; font-size: 16px;">
|
|
|
|
<a href="<?php echo base_url()?>Employee/editEmployee/<?php echo md5($value->user_id);?>" ><i class="fa fa-pencil" title="Edit"></i></a>
|
|
|
|
<a><i class="fa fa-trash deleteEmp" data-toggle="modal" data-target=".bs-example-modal-sm" title="Delete" id="<?php echo $value->user_id;?>"></i></a>
|
|
|
|
<!-- <a href="<?php echo base_url()?>Employee/deleteEmployee/<?php echo md5($value->id);?>" ><i class="fa fa-trash" title="Edit"></i></a> -->
|
|
|
|
<!-- <a> <i id="<?php echo md5($value->user_id);?>" class="bi bi-card-list" title="History"></i></a> -->
|
|
</td>
|
|
</tr>
|
|
<?php }}?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<br/>
|
|
|
|
<!-- Large modal -->
|
|
<!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg" hidden>Large modal</button> -->
|
|
<div class="modal fade bs-example-modal-lg" id="ItemModal" tabindex="-1" role="dialog" aria-hidden="true"></div>
|
|
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
|
|
|
|
<div style="display:none" id="sub-value">
|
|
|
|
<script>
|
|
$('.deleteEmp').click(function() {
|
|
var id = $(this).attr('id');
|
|
var url = "<?php echo base_url()?>Employee/deleteEmp";
|
|
|
|
$.ajax({
|
|
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
|
|
type:"GET",
|
|
success:function(data){
|
|
$('#popup').html(JSON.parse(data));
|
|
$('.delete_id').attr('value',id);
|
|
$('.delete_url').attr('action',url);
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
$(document).on('click','.bi-card-list',function(){
|
|
var id = $(this).attr("id")
|
|
$.ajax({
|
|
type: "get",
|
|
url: "<?php echo base_url()?>Employee/view_emp_history/"+id,
|
|
success: function(response) {
|
|
response = JSON.parse(response);
|
|
console.log(response);
|
|
$('.bs-example-modal-lg').html(response);
|
|
$('.bs-example-modal-lg').modal("show");
|
|
},
|
|
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
|
});
|
|
});
|
|
|
|
</script>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#datatables').DataTable({
|
|
"order": [
|
|
[0, 'desc']
|
|
],
|
|
"dom": 'Bfrtip',
|
|
buttons: [
|
|
{
|
|
extend: 'pdfHtml5',
|
|
title: 'Employees',
|
|
text: 'PDF',
|
|
customize: function(doc) {
|
|
doc.content[1].table.body.forEach(function(row) {
|
|
// Remove the first and last columns
|
|
row.splice(0, 1);
|
|
row.pop();
|
|
});
|
|
}
|
|
},
|
|
{
|
|
extend: 'excelHtml5',
|
|
text: 'Excel',
|
|
title: 'Employees',
|
|
exportOptions: {
|
|
columns: ':not(:last-child)'
|
|
}
|
|
}
|
|
]
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</div>
|
|
|