230 lines
5.3 KiB
PHP
230 lines
5.3 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="active">attendance Register</li>
|
|
</ul>
|
|
</div>
|
|
<!-- End of breadcrumb -->
|
|
|
|
<div class="page-content">
|
|
<div id="flexigridDiv" class="table-responsive">
|
|
|
|
<form name="f1" method="post" action="" id="flex_attendance_form">
|
|
<div id="flex1" style="width:100%">
|
|
</div>
|
|
<input type="hidden" name="flex_attendance_id" id="flex_attendance_id" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div><!-- /.page-content -->
|
|
</div>
|
|
</div><!-- /.main-content -->
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
var w = screen.width * .90;
|
|
var h = 0;
|
|
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
|
|
$("#flex1").flexigrid({
|
|
url: 'attendance_list_script.php',
|
|
dataType: 'json',
|
|
colModel: [{
|
|
display: '',
|
|
name: '',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Sr',
|
|
name: 'count',
|
|
width: w * .04,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Date',
|
|
name: 'date',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
{
|
|
display: 'Staff Name',
|
|
name: 'staff_name',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
],
|
|
buttons: [{
|
|
name: 'ADD',
|
|
bclass: 'add',
|
|
onpress: add
|
|
},
|
|
{
|
|
separator: true
|
|
},
|
|
{
|
|
name: 'UPLOAD',
|
|
bclass: 'add',
|
|
onpress: upload
|
|
},
|
|
{
|
|
separator: true
|
|
},
|
|
{
|
|
name: 'Download Template',
|
|
bclass: 'print_excel',
|
|
onpress: download_template
|
|
},
|
|
// {
|
|
// separator: true
|
|
// },
|
|
// {
|
|
// name: 'UPLOAD SPINE ATTANDANCE',
|
|
// bclass: 'add',
|
|
// onpress: upload_spin
|
|
// },
|
|
// {
|
|
// separator: true
|
|
// },
|
|
// {
|
|
// name: 'Download SPINE Template',
|
|
// bclass: 'print_excel',
|
|
// onpress: download_spin_template
|
|
// },
|
|
{
|
|
separator: true
|
|
},
|
|
// {name: 'PDF', bclass: 'print', onpress : pdf},
|
|
// {separator: true},
|
|
// {name: 'Excel', bclass: 'print_excel', onpress : excel},
|
|
// {separator: true}
|
|
],
|
|
searchitems: [{
|
|
display: 'Select Search item',
|
|
name: ''
|
|
},
|
|
|
|
{
|
|
display: 'Date (DD-MM-YYYY)',
|
|
name: 'attendance_date'
|
|
},
|
|
|
|
],
|
|
sortname: "attendance_id",
|
|
sortorder: "desc",
|
|
usepager: true, //pagination
|
|
|
|
useRp: true,
|
|
rp: 50, //records per page
|
|
showTableToggleBtn: false, //toggle button for the whole table
|
|
resizable: true,
|
|
//width: w,
|
|
height: h,
|
|
singleSelect: true
|
|
});
|
|
});
|
|
|
|
function add() {
|
|
window.location = 'attendance_entry.php';
|
|
}
|
|
|
|
function upload() {
|
|
window.location = 'upload_excel_attendance.php';
|
|
}
|
|
// function upload_spin() {
|
|
// window.location = 'upload_excel_spin_attendance.php';
|
|
// }
|
|
|
|
function download_template() {
|
|
window.location = 'templates/attendance template.xlsx';
|
|
}
|
|
// function download_spin_template() {
|
|
// window.location = 'templates/Spine_attendance_upload_templates.xls';
|
|
// }
|
|
|
|
// function pdf(){
|
|
// window.open('attendance_pdf.php');
|
|
// }
|
|
// function excel(){
|
|
// window.location = 'attendance_excel.php';
|
|
// }
|
|
|
|
function delete_attendance(attendance_id) {
|
|
$("#flex_attendance_id").val(attendance_id);
|
|
console.log(attendance_id + " ");
|
|
BootstrapDialog.confirm('Are you sure to delete the attendance Data?', function(result) {
|
|
if (result) {
|
|
$.ajax({
|
|
url: 'delete_attendance.php',
|
|
type: "POST",
|
|
data: $("#flex_attendance_form").serialize(),
|
|
success: function(data) {
|
|
if (data.indexOf("SUCCESS") != -1) {
|
|
BootstrapDialog.alert('attendance Data Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
} else {
|
|
BootstrapDialog.alert('Error Deleting attendance');
|
|
}
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Deleting attendance');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function attendance_pdf(attendance_id) {
|
|
if (attendance_id != null && attendance_id != '') {
|
|
$("#flex_attendance_id").val(attendance_id);
|
|
$("#flex_attendance_form").attr('method', 'POST');
|
|
$("#flex_attendance_form").attr('target', '_blank');
|
|
$("#flex_attendance_form").attr('action', 'attendance_pdf.php');
|
|
$("#flex_attendance_form").submit();
|
|
}
|
|
}
|
|
|
|
function edit_attendance(attendance_id, action) {
|
|
if (attendance_id != null && attendance_id != '') {
|
|
if (action == "V") {
|
|
$("#flex_attendance_id").val(attendance_id);
|
|
$("#flex_attendance_form").attr('method', 'POST');
|
|
$("#flex_attendance_form").attr('action', 'view_attendance.php');
|
|
$("#flex_attendance_form").submit();
|
|
} else {
|
|
$("#flex_attendance_id").val(attendance_id);
|
|
$("#flex_attendance_form").attr('method', 'POST');
|
|
$("#flex_attendance_form").attr('action', 'edit_attendance.php');
|
|
$("#flex_attendance_form").submit();
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|