302 lines
8.0 KiB
PHP
302 lines
8.0 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');
|
|
error_reporting(E_ERROR | E_PARSE);
|
|
?>
|
|
|
|
<?php
|
|
|
|
$id = $_POST['flex_opd_id'];
|
|
$query = "select * from patient_master where id = '".$id."' ";
|
|
//echo $query;
|
|
if (!$result = @mysqli_query($conn,$query)) {
|
|
exit(mysqli_error($conn));
|
|
|
|
} else{
|
|
$row=@mysqli_fetch_array($result);
|
|
@extract($row);
|
|
}
|
|
?>
|
|
|
|
<!--breadcrumb-->
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
|
|
<li class="#">Data Setup</li> <li class="#">Organizational Event</li> <li class="#"> Checkup Assign </li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
<!-- End of breadcrumb -->
|
|
|
|
<div class="page-content">
|
|
<div id="flexigridDiv" class="table-responsive">
|
|
|
|
<form name="f1" method="post" action="" id="flex_form_checkup_assign">
|
|
<div id="flex1" style="width:100%">
|
|
</div>
|
|
<input type="hidden" name="flex_checkup_assign_id" id="flex_checkup_assign_id"/>
|
|
<input type="hidden" name="emp_id_history" id="emp_id_history"/>
|
|
|
|
</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: ' assign_checkup_script.php',
|
|
dataType: 'json',
|
|
colModel: [
|
|
|
|
|
|
{display: 'Sr', name: '', width: w*.04, sortable: false, align: 'left'},
|
|
{display: 'Credit To ', name: 'credit_to', width: w*.15, sortable: true, align: 'left'},
|
|
{display: 'Employee Categories ', name: 'emp_cat_id', width: w*.2, sortable: true, align: 'left'},
|
|
{display: 'Checkup Schedule ', name: 'checkup_schedule', width: w*.24, sortable: true, align: 'left'},
|
|
|
|
{display: 'Assign Date', name: 'date_assigned', width: w*.14, 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: 'Credit To', name: 'credit_to', isdefault: true},
|
|
{display: 'Employee Categories', name: 'emp_cat_name'},
|
|
// {display: 'Checkup Schedule', name: 'checkup_schedule'},
|
|
{display: 'Assign Date', name: 'date_assigned'}
|
|
|
|
],
|
|
sortname: " date_assigned",
|
|
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('emp_checkup_schedule_pdf.php');
|
|
}
|
|
function excel(){
|
|
window.location = 'emp_checkup_schedule_excel.php';
|
|
}
|
|
function add(){
|
|
$("#credit_to").val("");
|
|
$('#credit_to').trigger('chosen:updated');
|
|
$("#employee_cat").val("");
|
|
$("#schedule_id").val("");
|
|
$("#schedule_id").trigger('chosen:updated');;
|
|
$("#assign_date").val("");
|
|
|
|
$('#employee_cat').trigger('chosen:updated');
|
|
|
|
$('#modal-add-checkup-assign').modal("show");
|
|
}
|
|
|
|
|
|
function getSpecificEmployee(assign_checkup_id){
|
|
|
|
$.ajax({
|
|
url:'selectSpecificEmpForAssignedCheckup.php',
|
|
data: {assign_checkup_id : assign_checkup_id},
|
|
|
|
async:false,
|
|
dataType:'json',
|
|
success : function(data) {
|
|
$("#employee_id").val(data.emp_id);
|
|
$(employee_id).trigger('chosen:updated');
|
|
},
|
|
error:function(data){
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function open_assign_checkup_schedule(assign_checkup_id,action){
|
|
$("#credit_to").val("");
|
|
$('#credit_to').trigger('chosen:updated');
|
|
$("#employee_cat").val("");
|
|
$("#schedule_id").val("");
|
|
$("#schedule_id").trigger('chosen:updated');
|
|
$("#assign_date").val("");
|
|
|
|
$('#employee_cat').trigger('chosen:updated');
|
|
|
|
if(action=="V"){
|
|
$(".save_button").hide();
|
|
|
|
}else{
|
|
$(".save_button").show();
|
|
}
|
|
|
|
$.ajax({
|
|
url : 'select_assign_checkup.php',
|
|
data: {assign_checkup_id : assign_checkup_id},
|
|
dataType:'json',
|
|
success : function(data) {
|
|
|
|
$("#assign_checkup_id").val(data.assign_checkup_id);
|
|
$("#employee_cat").val("");
|
|
$('#employee_cat').trigger('chosen:updated');
|
|
$("#credit_to").val(data.credit_to);
|
|
if(data.credit_to=='3'){
|
|
getSpecificEmployee(data.assign_training_id);
|
|
|
|
|
|
}
|
|
|
|
$('#credit_to').trigger('chosen:updated');
|
|
addingDiv(data.credit_to);
|
|
var emp_cat_ids=[];
|
|
if(data.credit_to=='2'){
|
|
if(data.emp_cat_id!="" && data.emp_cat_id!=null)
|
|
emp_cat_ids=data.emp_cat_id.split(",");
|
|
var element = document.getElementById('employee_cat');
|
|
for (var i = 0; i < element.options.length; i++) {
|
|
element.options[i].selected = emp_cat_ids.indexOf(element.options[i].value) >= 0;
|
|
}
|
|
$('#employee_cat').trigger('chosen:updated');
|
|
|
|
}
|
|
|
|
//$("#employee_cat").val(data.);
|
|
$("#schedule_id").val(data.checkup_schedule);
|
|
$('#schedule_id').trigger('chosen:updated');
|
|
$("#assign_date").val(myDateFormatter(data.date_assigned));
|
|
|
|
|
|
//$('#training_mode_id').trigger('chosen:updated');
|
|
$('#modal-add-checkup-assign').modal("show");
|
|
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Populating Checkup');
|
|
return;
|
|
}
|
|
});
|
|
|
|
}
|
|
function myDateFormatter( d){
|
|
var date= new Date(d);
|
|
return date.getDate()+"/"+(date.getMonth()+1)+"/"+date.getFullYear();
|
|
}
|
|
function getSpecificEmployee(assign_checkup_id){
|
|
|
|
$.ajax({
|
|
url:'selectSpecificEmpForAssignedTraining.php',
|
|
data: {assign_checkup_id : assign_checkup_id},
|
|
|
|
async:false,
|
|
dataType:'json',
|
|
success : function(data) {
|
|
$("#employee_id").val(data.emp_id);
|
|
$(employee_id).trigger('chosen:updated');
|
|
},
|
|
error:function(data){
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function delete_assign_checkup_schedule(assign_checkup_id){
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete checkup Details?', function(result){
|
|
if(result) {
|
|
$.ajax({
|
|
url : 'delete_assign_checkup.php',
|
|
data : {assign_checkup_id : assign_checkup_id},
|
|
success : function(data) {
|
|
if(data.indexOf("SUCCESS")!=-1){
|
|
BootstrapDialog.alert('Assign Checkup Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
}else{
|
|
BootstrapDialog.alert('Error Deleting Checkup Training ');
|
|
}
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Deleting Assign Checkup ');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
function save_assign_checkup(){
|
|
$.ajax({
|
|
url : 'save_assign_checkup.php',
|
|
type : "POST",
|
|
data : $("#checkup_assign_form").serialize(),
|
|
|
|
success : function(data) {
|
|
BootstrapDialog.alert('Assign Checkup Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Saving Assign Checkup ');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
<?php include('form/add_assign_checkup_form.php'); ?>
|
|
<?php include('common_ace.php'); ?>
|
|
<?php include('techsyn_footer.php'); ?>
|
|
|
|
|