bbone/application/modules/Employee/views/emp_list.php
2023-06-29 11:36:03 +05:30

103 lines
3.5 KiB
PHP

<head>
<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>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div class="row">
<div class="col-sm-12">
<table id="datatable-buttons" class="table table-striped table-bordered" width="100%">
<thead>
<tr class="headings">
<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 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> &nbsp;
<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>&nbsp;
<!-- <a href="<?php echo base_url()?>Employee/deleteEmployee/<?php echo md5($value->id);?>" ><i class="fa fa-trash" title="Edit"></i></a> &nbsp; -->
<a> <i id="<?php echo md5($value->user_id);?>" class="bi bi-card-list" title="History"></i></a>&nbsp;
</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>
</div>