ESH/employee_checkup_schedule_list.php
2024-10-23 18:28:06 +05:30

184 lines
5.7 KiB
PHP

<?php include('techsyn_header.php'); ?>
<!-- Main Content Container for side bar and body-->
<div class="main-container ace-save-state" id="main-container">
<script type="text/javascript">
try{ace.settings.loadState('main-container')}catch(e){}
</script>
<?php include('techsyn_sidebar.php'); ?>
<!--breadcrumb-->
<div class="main-content">
<div class="main-content-inner">
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
<ul class="breadcrumb">
<li class="#">Checkup Mgmt</li><li class="#">Employee Checkup Assign Schedule</li>
</ul>
</div>
<!-- End of breadcrumb -->
<div class="page-content">
<div id="flexigridDiv" class="table-responsive">
<form name="f1" method="post" action=""id="">
<div id="flex1" style="width:100%">
</div>
<input type="hidden" name="flex_schedule_id" id="flex_schedule_id"/>
</form>
</div>
</div>
</div><!-- /.page-content -->
</div>
</div><!-- /.main-content -->
<script type="text/javascript">
$(function () {
var w=screen.width*.50;
var h =0;
h =(window.innerHeight-($("#navbar").height()+$(".breadcrumbs").height()))*.75;
$("#flex1").flexigrid({
url: 'emp_checkup_schedule.php',
dataType: 'json',
colModel: [
{display: 'Sr', name: 'count', width: w*.05, sortable: false, align: 'left'},
{display: 'Employee Name', name: 'fname', width: w*.2, sortable: true, align: 'left'},
{display: 'checkup Name', name: 'checkup_schedule_id', width: w*.2, sortable: true, align: 'left'},
{display: 'From Date (Schedule)', name: 'checkup_schedule_id', width: w*.17, sortable: false, align: 'left'},
{display: 'To Date (Schedule)', name: 'checkup_schedule_id', width: w*.17, sortable: false, align: 'left'},
{display: 'Checkup By', name: 'checkup_schedule_id', width: w*.2, sortable: true, align: 'left'},
{display: 'checkup Location', name: 'checkup_schedule_id', width: w*.2, sortable: true, align: 'left'},
{display: 'Status', name: 'status', width: w*.15, sortable: true, align: 'left'},
{display: '', name: '', width: w*.1, sortable: false, align: 'left'},
],
buttons: [
//{name: 'Add', bclass: 'add', onpress : add},
// {separator: true},
{name: 'PDF', bclass: 'print', onpress : pdf},
{separator: true},
{name: 'Excel', bclass: 'print_excel', onpress : excel},
{separator: true}
],
searchitems: [
{display: 'checkup Name', name: 'checkup_name'},
{display: 'From Date(DD/MM/YYYY)', name : 'assign_date'},
],
sortname: "checkup_schedule_id",
sortorder: "asc",
usepager: true, //pagination
useRp: true,
rp: 20, //records per page
showTableToggleBtn: false, //toggle button for the whole table
resizable: true,
//width: w,
height: h,
singleSelect: true
});
});
function pdf(){
window.open('employee_checkup_schedule_pdf.php');
}
function excel(){
window.location = 'employee_checkup_schedule_excel.php';
}
function open_assign_checkup_schedule(emp_assign_checkup_id){
$("#schedule").val("");
$("#location").val("");
$("#status").val("");
$("#completion_date").val("");
$('#status').trigger('chosen:updated');
var currentDate = new Date();
var today = currentDate.getDate() + '/' + (currentDate.getMonth() + 1) + '/' + currentDate.getFullYear();
$("#completion_date").val(today);
$.ajax({
url : 'select_emp_assign_checkup.php?emp_assign_checkup_id='+emp_assign_checkup_id+' ',
type : 'POST',
data:{emp_assign_checkup_id:emp_assign_checkup_id},
dataType:'json',
success : function(data) {
//alert(data);
$("#emp_assign_checkup_id").val(data.emp_assign_checkup_id);
//alert(data);
var schedule= data.checkup_type_name+" ("+data.checkup_by+' '+myDateFormatter(data.from_date)+' '+myDateFormatter(data.to_date)+")";
getEmployeeDetails(data.emp_id);
$("#schedule").val(schedule);
$("#location").val(data.checkup_location);
$("#status").val(data.status);
$('#status').trigger('chosen:updated');
// $("#completion_date").val(data.completion_date);
$('#modal-emp-assign-schedule-status').modal("show");
},
error : function(data) {
BootstrapDialog.alert('Error Populating checkup Schedule');
return;
}
});
$('.close').click();
}
function getEmployeeDetails(emp_id){
$.ajax({
url:'select_employee.php',
data:{employeeId:emp_id},
async:false,
dataType:'json',
success:function(data){
$("#emp_id").val(data.fname+' '+data.lname);
},error:function(data){
BootstrapDialog.alert('Error Populating Employee Details');
}
});
}
function save_emp_assign_schedule_status_form(){
$('#modal-emp-assign-schedule-status').modal("hide");
$.ajax({
url:'save_emp_assign_checkup_form.php',
data:$("#emp_assign_schedule_status_form").serialize(),
type:'POST',
success:function(data){
BootstrapDialog.alert('Employee Assign checkup Status Saved Successfully');
$("#flex1").flexReload();
}
,error:function(data){
BootstrapDialog.alert('Error In Saving Employee Assign checkup Status');
}
});
}
function myDateFormatter( d){
var date= new Date(d);
return date.getDate()+"/"+(date.getMonth()+1)+"/"+date.getFullYear();
}
</script>
<?php include('techsyn_footer.php'); ?>
<?php include('form/assign_checkup_status_form.php');?>