bbone/application/modules/Employee/views/emp_sub_list.php
2023-06-24 16:02:54 +05:30

461 lines
19 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="x_panel">
<div class="x_title">
<h2>Details</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<ul class="nav nav-tabs bar_tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link" id="add_edu-tab" data-toggle="tab" href="#add_education" role="tab" aria-controls="add_edu-tab" aria-selected="true">Employee Education</a>
</li>
<li class="nav-item">
<a class="nav-link" id="emp_history-tab" data-toggle="tab" href="#employee_history" role="tab" aria-controls="emp_history-tab" aria-selected="true">Employee History</a>
</li>
<li class="nav-item">
<a class="nav-link" id="upload_files" data-toggle="tab" href="#upload_image" role="tab" aria-controls="upload_files" aria-selected="true">Upload Files</a>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<!------------------------------ add_education ------------------------------->
<div class="tab-pane fade" id="add_education" role="tabpanel" aria-labelledby="add_edu-tab">
<ul class="nav navbar-right panel_toolbox">
<?php if(user()->action_permit != 'view' ) { ?>
<a type="button" class="add_education" id="<?php echo md5($id) ?>" data-toggle="modal" data-target="#edit-form_add_education" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
<li class="fa fa-plus-circle" title="Add New"></li></a>
<?php } ?>
</ul> </br>
<div class="card-box table-responsive">
<table class="table table-bordered table-striped" cellspacing="0" width="100%">
<thead>
<tr class="headings">
<th class="column-title" width="15%">Level </th>
<th class="column-title" width="15%">Institute </th>
<th class="column-title" width="15%">Major </th>
<th class="column-title" width="10%">GPA/Score </th>
<th class="column-title" width="15%">From </th>
<th class="column-title" width="15%">To </th>
<th class="column-title" width="10%">Action </th>
</tr>
</thead>
<tbody>
<?php foreach ($add_education as $key => $value) { ?>
<tr class="even pointer">
<td class=" "><?php echo $value->level; ?></td>
<td class=" "><?php echo $value->institute; ?></td>
<td class=" "><?php echo $value->major; ?></td>
<td class=" "><?php echo $value->cgpa; ?></td>
<td class=" "><?php echo $value->q_from; ?></td>
<td class=" "><?php echo $value->q_to; ?></td>
<?php if(user()->action_permit != 'view' ) { ?>
<td>
<a class="edit_education" id="<?php echo md5($value->emp_id); ?>" style="font-size: 16px;" >
<i class="fa fa-pencil" title="Edit"></i></a>
&nbsp;
<a class="deleteAddEducationData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
<i class="fa fa-trash " ></i></a>
<!-- <a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
</td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<!------------------------------ emp_hostory --------------------------------->
<div class="tab-pane fade" id="employee_history" role="tabpanel" aria-labelledby="emp_history-tab">
<ul class="nav navbar-right panel_toolbox">
<?php if(user()->action_permit != 'view' ) { ?>
<a type="button" class="employee_history" id="<?php echo md5($id) ?>" data-toggle="modal" data-target="#edit-form_add_history" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
<li class="fa fa-plus-circle" title="Add New"></li></a>
<?php } ?>
</ul> </br>
<div class="card-box table-responsive">
<table class="table table-bordered table-striped" cellspacing="0" width="100%">
<thead>
<tr class="headings">
<th class="column-title" width="15%">Company Name </th>
<th class="column-title" width="15%">Role </th>
<th class="column-title" width="15%">From </th>
<th class="column-title" width="15%">To </th>
<th class="column-title" width="10%">Action </th>
</tr>
</thead>
<tbody>
<?php foreach ($employee_history as $key => $value) { ?>
<tr class="even pointer">
<td class=" "><?php echo $value->c_name; ?></td>
<td class=" "><?php echo $value->role; ?></td>
<td class=" "><?php echo $value->h_from; ?></td>
<td class=" "><?php echo $value->h_to; ?></td>
<?php if(user()->action_permit != 'view' ) { ?>
<td>
<a class="edit_employee_history" id="<?php echo md5($id) ?>" style="font-size: 16px;" >
<i class="fa fa-pencil" title="Edit"></i></a>
&nbsp;
<a class="deleteEmpHistoryData" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id); ?>">
<i class="fa fa-trash " ></i></a>
<!-- <a href="<?php echo base_url()?>Asset/deleteThirdPartyData/<?php echo md5($value->id); ?>" style="font-size: 16px;"><i class="fa fa-trash" title="Delete"></i></a> -->
</td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<!------------------------------ UPLOAD FILE DATA ---------------------------->
<div class="tab-pane fade" id="upload_image" role="tabpanel" aria-labelledby="upload_files">
<ul class="nav navbar-right panel_toolbox">
<!-- <?php if(user()->action_permit != 'view' ) { ?> -->
<a type="button" class="add_image_emp" id="<?php echo md5($id) ?>" data-toggle="modal" data-target="#edit-form_add_image" style=" text-align: center; font-size: 25px; color:#2A3F54; ">
<li class="fa fa-plus-circle" title="Add New"></li></a>
<!-- <?php } ?> -->
</ul> </br> </br>
<div class="row">
<div class="col-md-12">
<div class="x_panel">
<div class="x_content">
<div class="row">
<?php foreach ($images as $key => $value) { $EXTENSION = pathinfo($value->file_name, PATHINFO_EXTENSION); ?>
<div class="col-md-55">
<div class="thumbnail">
<div class="image view view-first">
<?php if($EXTENSION == 'pdf') { ?>
<embed style="width: 100%; display: block;" src="<?php echo base_url(); ?>assets/uploads/<?php echo $value->file_name; ?>" alt="image" />
<?php } else { ?>
<img style="width: 100%; display: block;" src="<?php echo base_url(); ?>assets/uploads/<?php echo $value->file_name; ?>" alt="image" />
<?php } ?>
<div class="mask">
<p>&nbsp;</p>
<div class="tools tools-bottom">
<a class="deleteuploadImage" data-toggle="modal" data-target=".bs-example-modal-sm" style="font-size: 16px;" id="<?php echo md5($value->id);?>"><i class="fa fa-trash" ></i></a>
<?php if($EXTENSION == 'pdf') { ?>
<a href="<?php echo base_url()?>/assets/uploads/<?php echo $value->file_name; ?>" download><i class="fa fa-download" title="Download"></i></a>
<?php } ?>
</div>
</div>
</div>
<p><?php echo $value->f_name; ?></p>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- ################################################################### -->
<!-------------------------------FORM------------------------------>
<!-------------------------------FILE MODEL FORM------------------------------>
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="edit-form_add_image">
<div class="modal-dialog modal-lm">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h3>
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
</div>
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/add_employee_file" enctype="multipart/form-data">
<div class="modal-body">
<div class="x_content">
<br />
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
<input type="hidden" name="emp_id" value="<?php echo $id; ?>">
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">Name<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input type="text" id="f_name" name="f_name" value="" required="required" class="form-control ">
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">File Upload<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input type="file" id="file_name" name="file_name" value="" required="required" class="form-control ">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
</div>
</form>
</div>
</div>
</div>
<!-------------------------------add_education MODEL FORM--------------------->
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="edit-form_add_education">
<div class="modal-dialog modal-lm">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h3>
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
</div>
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/add_employee_education" enctype="multipart/form-data">
<div class="modal-body">
<div class="x_content">
<br />
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
<input type="hidden" name="emp_id" value="<?php echo $id; ?>">
<input type="hidden" name="id" class="edu_id" value="">
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">Level<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input type="text" id="level" name="level" value="" required="required" class="form-control ">
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">Institute<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input id="institute" name="institute" value="" required="required" class="form-control" type="text" >
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">Major<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input type="text" id="major" name="major" value="" required="required" class="form-control ">
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">GPA/Score<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input id="cgpa" name="cgpa" value="" required="required" class="form-control" type="text" >
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">From<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input id="q_from" name="q_from" value="" required="required" class="form-control" type="text">
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">To<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input id="q_to" name="q_to" value="" required="required" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
</div>
</form>
</div>
</div>
</div>
<!-------------------------------emp_history MODEL FORM--------------------->
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="edit-form_add_history">
<div class="modal-dialog modal-lm">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="myModalLabel2"><?php echo $heading; ?></h3>
<button type="button" id="close-form" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
</div>
<form data-parsley-validate class="form-horizontal form-label-left" method="post" action="<?php echo base_url();?>Employee/add_employee_history" enctype="multipart/form-data">
<div class="modal-body">
<div class="x_content">
<br />
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>">
<input type="hidden" name="emp_id" value="<?php echo $id; ?>">
<input type="hidden" name="id" class="his_id" value="">
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">Company Name<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input type="text" id="c_name" name="c_name" value="" required="required" class="form-control ">
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">Role<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input id="role" name="role" value="" required="required" class="form-control" type="text" >
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">From<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input id="h_from" name="h_from" value="" required="required" class="form-control" type="text">
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3 col-sm-3 ">To<a style="color:red;">*</a></label>
<div class="col-md-9 col-sm-9 ">
<input id="h_to" name="h_to" value="" required="required" class="form-control" type="text">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="close-form">Close</button>
<button type="submit" class="btn btn-primary"><?php echo $submit_button_title; ?></button>
</div>
</form>
</div>
</div>
</div>
<!-------------------------------------------------------------------------->
</div>
</div>
</div>
<div class="modal bs-example-modal-sm" tabindex="-1" role="dialog" aria-hidden="true" id="popup"> </div>
<script>
$(document).on('click','.edit_education',function(){
var id = $(this).attr("id");
console.log(id);
var URL = "<?php echo base_url();?>Employee/editEmp_qualification/"+id
$.ajax({
url: URL,
type:"get",
success:function(data){
value = JSON.parse(data);
console.log(value);
$('.edu_id').val(value[0].id);
$('#level').val(value[0].level);
$('#institute').val(value[0].institute);
$('#major').val(value[0].major);
$('#cgpa').val(value[0].cgpa);
$('#q_from').val(value[0].q_from);
$('#q_to').val(value[0].q_to);
$('#edit-form_add_education').modal("show");
}
});
});
$(document).on('click','.edit_employee_history',function(){
var id = $(this).attr("id");
var URL = "<?php echo base_url();?>Employee/editEmp_history/"+id
$.ajax({
url: URL,
type:"get",
success:function(data){
value = JSON.parse(data);
$('.his_id').val(value[0].id);
$('#c_name').val(value[0].c_name);
$('#role').val(value[0].role);
$('#h_from').val(value[0].h_from);
$('#h_to').val(value[0].h_to);
$('#edit-form_add_history').modal("show");
}
});
});
$(document).on('click','.add_image',function(){
var id = $(this).attr("id")
if (id) {
var URL = "<?php echo base_url();?>Employee/uploadForm/"+id
}
else {
var URL = "<?php echo base_url();?>Employee/uploadForm/"+"uploadform"
}
$.ajax({
url: URL,
type:"GET",
success:function(data){
$('#edit-form_add_image').html(JSON.parse(data));
$('.bs-example-modal-sm add_image').modal("show");
}
});
});
$('.deleteAddEducationData').click(function() {
var id = $(this).attr('id');
var url = "<?php echo base_url()?>Employee/deleteEmpQualification";
$.ajax({
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
type:"GET",
success:function(data){
$('#edit-form_add_image').html(JSON.parse(data));
$('.delete_id').attr('value',id);
$('.delete_url').attr('action',url);
}
});
});
$('.deleteEmpHistoryData').click(function() {
var id = $(this).attr('id');
var url = "<?php echo base_url()?>Employee/deleteEmpHistory";
$.ajax({
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
type:"GET",
success:function(data){
$('#edit-form_add_image').html(JSON.parse(data));
$('.delete_id').attr('value',id);
$('.delete_url').attr('action',url);
}
});
});
$('.deleteuploadImage').click(function() {
var id = $(this).attr('id');
var url = "<?php echo base_url()?>Employee/deleteEmpImage";
$.ajax({
url: "<?php echo base_url()?>Employee/getDeleteConfirmationPopup",
type:"GET",
success:function(data){
$('#edit-form_add_image').html(JSON.parse(data));
$('.delete_id').attr('value',id);
$('.delete_url').attr('action',url);
}
});
});
</script>