401 lines
11 KiB
PHP
401 lines
11 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="#">Program Mgmt</li>
|
|
<li class="#">Assign Program Schedule</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_training">
|
|
|
|
<div id="flex1" style="width:100%">
|
|
</div>
|
|
|
|
<input type="hidden" name="flex_checkup_id" id="flex_checkup_id" />
|
|
<input type="hidden" name="emp_id_history" id="emp_id_history" />
|
|
|
|
</form>
|
|
<form name="export_form" method="post" id="export_form" action="">
|
|
<input type="hidden" name="pdf_action" id="pdf_action"
|
|
value="pdf_assign_traning_schedule_list.php" />
|
|
<input type="hidden" name="excel_action" id="excel_action"
|
|
value="excel_assign_traning_schedule_list.php" />
|
|
</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_training_schedule.php',
|
|
dataType: 'json',
|
|
colModel: [
|
|
|
|
{
|
|
display: 'Sr',
|
|
name: '',
|
|
width: w * .04,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Credit To ',
|
|
name: '',
|
|
width: w * .15,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Employee Categories ',
|
|
name: '',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Employee Name ',
|
|
name: '',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Program Schedule ',
|
|
name: '',
|
|
width: w * .24,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
{
|
|
display: 'Assign Date',
|
|
name: '',
|
|
width: w * .14,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
{
|
|
display: '',
|
|
name: '',
|
|
width: w * .1,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
|
|
],
|
|
buttons: [
|
|
|
|
|
|
{
|
|
name: 'Assign Program Schedule',
|
|
bclass: 'add',
|
|
onpress: add
|
|
},
|
|
{
|
|
separator: true
|
|
},
|
|
{
|
|
name: 'PDF',
|
|
bclass: 'print',
|
|
onpress: pdf
|
|
},
|
|
{
|
|
separator: true
|
|
},
|
|
{
|
|
name: 'Excel',
|
|
bclass: 'print_excel',
|
|
onpress: excel
|
|
},
|
|
|
|
],
|
|
searchitems: [
|
|
|
|
{
|
|
display: 'Credit To',
|
|
name: 'credit_to',
|
|
isdefault: true
|
|
},
|
|
{
|
|
display: 'Employee Categories',
|
|
name: 'emp_cat_name'
|
|
},
|
|
{
|
|
display: 'Employee Name',
|
|
name: 'employee_id'
|
|
},
|
|
{
|
|
display: 'Program Schedule',
|
|
name: 'training_name'
|
|
},
|
|
{
|
|
display: 'Assign Date(DD/MM/YYYY)',
|
|
name: 'date_assigned'
|
|
},
|
|
{
|
|
display: 'Assign Date Between(dd/mm/yyyy-dd/mm/yyyy)',
|
|
name: 'date_assigned_between'
|
|
}
|
|
],
|
|
sortname: "assign_training_id",
|
|
sortorder: "asc",
|
|
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 pdf() {
|
|
window.open('ajax_pdf.php', 'Assign Training Schedule');
|
|
}
|
|
|
|
function excel() {
|
|
window.open('ajax_excel.php', 'Assign Training Schedule');
|
|
}
|
|
|
|
|
|
|
|
function add() {
|
|
$('#assign_training_id').val("");
|
|
$("#credit_to").val("");
|
|
$('#credit_to').trigger('chosen:updated');
|
|
$("#emp_cat_id").val("");
|
|
$('#emp_cat_id').trigger('chosen:updated');
|
|
$('#employee_id').val("");
|
|
$('#employee_id').trigger('chosen:updated');
|
|
$("#schedule_id").val("");
|
|
$("#schedule_id").trigger('chosen:updated');;
|
|
$("#assign_date").val("");
|
|
$('#modal-add-training-assign').modal("show");
|
|
}
|
|
|
|
function open_assign_training_schedule(assign_training_schedule_id, action) {
|
|
$("#credit_to").val("");
|
|
$('#credit_to').trigger('chosen:updated');
|
|
$("#emp_cat_id").val("");
|
|
$('#employee_id').val("");
|
|
$('#employee_id').trigger('chosen:updated');
|
|
$("#schedule_id").val("");
|
|
$("#schedule_id").trigger('chosen:updated');;
|
|
$("#assign_date").val("");
|
|
|
|
$('#emp_cat_id').trigger('chosen:updated');
|
|
|
|
if (action == "V") {
|
|
$(".save_button").hide();
|
|
|
|
} else {
|
|
$(".save_button").show();
|
|
}
|
|
|
|
$.ajax({
|
|
url: 'select_assign_training_schedule.php',
|
|
data: {
|
|
assign_training_id: assign_training_schedule_id
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
$("#status").val(data.status);
|
|
$("#assign_training_id").val(data.assign_training_id);
|
|
$("#emp_cat_id").val("");
|
|
$('#emp_cat_id').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('emp_cat_id');
|
|
for (var i = 0; i < element.options.length; i++) {
|
|
element.options[i].selected = emp_cat_ids.indexOf(element.options[i].value) >= 0;
|
|
}
|
|
$('#emp_cat_id').trigger('chosen:updated');
|
|
|
|
}
|
|
|
|
//$("#employee_cat").val(data.);
|
|
$("#schedule_id").val(data.training_schedule_id);
|
|
$('#schedule_id').trigger('chosen:updated');
|
|
$("#assign_date").val(myDateFormatter(data.date_assigned));
|
|
|
|
|
|
//$('#training_mode_id').trigger('chosen:updated');
|
|
$('#modal-add-training-assign').modal("show");
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating injury');
|
|
return;
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function getSpecificEmployee(assign_training_id) {
|
|
|
|
$.ajax({
|
|
url: 'selectSpecificEmpForAssignedTraining.php',
|
|
data: {
|
|
assign_training_id: assign_training_id
|
|
},
|
|
|
|
async: false,
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
// $("#employee_id").val(data.emp_id);
|
|
// $('#employee_id').trigger('chosen:updated');
|
|
|
|
console.log(data);
|
|
var data_emp_id = '';
|
|
for (var i = 0; i < data.length; i++) {
|
|
data_emp_id += data[i]['emp_id'] + ',';
|
|
}
|
|
// alert(data_emp_cat_id);
|
|
|
|
var emp_ids = [];
|
|
|
|
if (data_emp_id != "" && data_emp_id != null)
|
|
emp_ids = data_emp_id.split(",");
|
|
var element = document.getElementById('employee_id');
|
|
for (var i = 0; i < element.options.length; i++) {
|
|
element.options[i].selected = emp_ids.indexOf(element.options[i].value) >= 0;
|
|
}
|
|
$('#employee_id').trigger('chosen:updated');
|
|
|
|
|
|
|
|
|
|
},
|
|
error: function(data) {
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function delete_assign_training_schedule(assign_training_schedule_id) {
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete Training Details?', function(result) {
|
|
if (result) {
|
|
$.ajax({
|
|
url: 'delete_assign_training.php',
|
|
data: {
|
|
assign_training_id: assign_training_schedule_id
|
|
},
|
|
success: function(data) {
|
|
if (data.indexOf("SUCCESS") != -1) {
|
|
BootstrapDialog.alert('Assign Training Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
} else {
|
|
BootstrapDialog.alert('Error Deleting Assign Training ');
|
|
}
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Deleting Assign Training ');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
function save_training_assign() {
|
|
//alert(" gfgdgdg");
|
|
BootstrapDialog.alert("Please Wait ...!");
|
|
$('#employee_ids').val($('#employee_id').val());
|
|
$(".btn btn-default").hide();
|
|
$.ajax({
|
|
url: 'save_training_assign.php',
|
|
type: "POST",
|
|
data: $("#training_assign_form").serialize(),
|
|
|
|
success: function(data) {
|
|
$(".close").click();
|
|
BootstrapDialog.alert('Assign Training Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Assign Training ');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
|
|
|
|
}
|
|
|
|
function myDateFormatter(d) {
|
|
var date = new Date(d);
|
|
return date.getDate() + "/" + (date.getMonth() + 1) + "/" + date.getFullYear();
|
|
}
|
|
</script>
|
|
|
|
|
|
<?php include('form/add_training_assign_form.php'); ?>
|
|
<?php include('common_ace.php'); ?>
|
|
<?php include('techsyn_footer.php'); ?>
|