csrtechnew.ohctech.in/training_batch_enrollment_hod.php
2025-04-14 13:28:09 +05:30

250 lines
8.6 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="#">Enrollment</li>
<li class="active">Training Batch Enrollment</li>
</ul>
</div>
<!-- End of breadcrumb -->
<div class="page-content">
<div id="flexigridDiv" class="table-responsive">
<form name="batch_fee_schedule_form" method="post" id="batch_fee_schedule_form" action="">
<input type="hidden" name="pdf_action" id="pdf_action" value="pdf_enrol_list.php" />
<input type="hidden" name="excel_action" id="excel_action" value="excel_enrol_list.php" />
</form>
<form name="f1" method="post" action="" id="flex_form_schedule">
<div id="flex1" style="width:100%"></div>
<input type="hidden" name="flex_patient_id" id="flex_patient_id" value=""/>
</form>
</div>
</div><!-- /.page-content -->
</div>
</div><!-- /.main-content -->
<script type="text/javascript">
$(function() {
var w = screen.width * .90;
var h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
$("#flex1").flexigrid({
url: 'enrol_list_hod_script.php',
dataType: 'json',
colModel: [
{
display: 'Actions',
name: '',
width: w * 0.10,
sortable: true,
align: 'center'
},
{
display: 'Sr',
name: 'sr',
width: w * .05,
sortable: false,
align: 'center'
},
{
display: 'Batch Name',
name: 'batch_id',
width: w * .15,
sortable: true,
align: 'left'
},
{
display: 'Center Name',
name: 'ohc_type_id',
width: w * .15,
sortable: true,
align: 'left'
},
{
display: 'Batch Start Date',
name: 'batch_start_date',
width: w * .07,
sortable: true,
align: 'left'
},
{
display: 'Batch End Date',
name: 'batch_end_date',
width: w * .07,
sortable: true,
align: 'left'
},
{
display: 'Course',
name: 'Subject',
width: w * .15,
sortable: true,
align: 'left'
},
{
display: 'Status',
name: 'status',
width: w * .1,
sortable: true,
align: 'left'
},
{
display: 'Batch Started',
name: 'batch_started',
width: w * .05,
sortable: true,
align: 'left'
},
{
display: 'Beneficiaries',
name: 'beneficiary_id',
width: w * .05,
sortable: true,
align: 'center'
},
],
buttons: [{
name: 'PDF',
bclass: 'print',
onpress: pdf
},
{
separator: true
},
{
name: 'Excel',
bclass: 'print_excel',
onpress: excel
},
{
separator: true
},
{
name: 'Create Batch',
bclass: 'add',
onpress: add_bulk
},
],
searchitems: [{
display: 'Batch name',
name: 'batch_id',
isdefault: true
},
{
display: 'Comment',
name: 'comment'
},
],
sortname: "id",
sortorder: "asc",
usepager: true,
useRp: true,
rp: 50,
showTableToggleBtn: false,
resizable: true,
height: h,
singleSelect: true
});
});
function excel() {
window.open('excel_enrol_list.php', 'Training Batch Enrollment List');
}
function pdf() {
window.open('pdf_enrol_list.php', 'Training Batch Enrollment List');
}
function add() {
$(".save_button").show();
$("#batch_id").val("");
$("#beneficiary_id").val("");
$("#status").val("");
$("#status_comments").val("");
$('#modal-add-patient').modal("show");
}
function add_bulk() {
location.href = "add_training_batch_enrollment.php";
}
function save_enrol() {
$.ajax({
url: 'save_enrol.php',
type: "POST",
data: $("#enrol_form").serialize(),
success: function(data) {
BootstrapDialog.alert('Schedule Saved Successfully.');
$("#flex1").flexReload();
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
BootstrapDialog.alert('Error In Saving Training Batch Enrollment');
}
});
$('.close').click();
}
function open_enrol(id, action) {
$("#flex_patient_id").val(id);
$("#flex_form_schedule").attr('method', 'POST');
$("#flex_form_schedule").attr('action', 'add_training_batch_enrollment.php');
$("#flex_form_schedule").submit();
}
function delete_enrol(id) {
BootstrapDialog.confirm('Are you sure to delete the Batch?', function(result) {
if (result) {
$.ajax({
url: 'delete_enrol_list.php',
type: "POST",
data: {
flex_patient_id: id
},
success: function(data) {
if (data.indexOf("SUCCESS") != -1) {
BootstrapDialog.alert('Batch Deleted Successfully.');
$("#flex1").flexReload();
} else {
BootstrapDialog.alert('Error Deleting Batch');
}
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
BootstrapDialog.alert('Error Deleting Batch');
}
});
}
});
}
</script>
<?php include('techsyn_footer.php'); ?>
<?php include('add_enrol_form.php'); ?>