199 lines
5.3 KiB
PHP
199 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>
|
|
<i class="ace-icon fa fa-home home-icon"></i>
|
|
<a href="#">Home</a>
|
|
</li>
|
|
<li class="#">Master</li><li class="active">Events</li>
|
|
</ul>
|
|
</div>
|
|
<!-- End of breadcrumb -->
|
|
|
|
|
|
<div>
|
|
|
|
<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><!-- /.page-content -->
|
|
</div>
|
|
</div><!-- /.main-content -->
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
var w=screen.width*.50;
|
|
var h =$(".main-content").height()+100;
|
|
$("#flex1").flexigrid({
|
|
url: '',
|
|
dataType: 'json',
|
|
colModel: [
|
|
{display: 'Sr', name: 'count', width: w*.04, sortable: false, align: 'left'},
|
|
|
|
{display: 'Event ID', name: 'event_id', width: w*.2, sortable: true, align: 'left'},
|
|
{display: 'Event Name', name: 'event_name', width: w*.2, sortable: true, align: 'left'},
|
|
//{display: 'To Date', name: 'to_date', width: w*.2, sortable: true, align: 'left'},
|
|
//{display: 'Trainer Name', name: 'trainer_name', width: w*.2, sortable: true, align: 'left'},
|
|
//{display: 'Location', name: 'location', width: w*.2, sortable: true, align: 'left'},
|
|
//{display: 'Remark', name: 'remark', width: w*.2, sortable: true, align: 'left'},
|
|
|
|
{display: '', name: '', width: w*.3, 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: 'Event ID', name: 'event_id', isdefault: true},
|
|
{display: 'Event Name', name: 'event_name'},
|
|
{display: '', name: ''},
|
|
|
|
],
|
|
sortname: "event_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 add(){
|
|
$(".save_button").show();
|
|
$("#event_id").val("")
|
|
$("#event_name").val("");
|
|
$("#last_modify").val("");
|
|
$("#modify_by").val("");
|
|
//$("#trainer_name").val("");
|
|
//$("#location").val("");
|
|
//$("#remark").val("");
|
|
|
|
$('#modal-add-event').modal("show");
|
|
}
|
|
|
|
function pdf(){
|
|
window.open('pdf_event.php');
|
|
}
|
|
function excel(){
|
|
window.location = 'excel_event.php';
|
|
}
|
|
function delete_training(secheduleId){
|
|
$("#flex_event_id").val(eventId);
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete the Event?', function(result){
|
|
if(result) {
|
|
$.ajax({
|
|
url : 'delete_event.php',
|
|
type : "POST",
|
|
data : $("#flex_event_form").serialize(),
|
|
success : function(data) {
|
|
if(data.indexOf("SUCCESS")!=-1){
|
|
BootstrapDialog.alert('Event Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
}else{
|
|
BootstrapDialog.alert('Error Deleting Event ');
|
|
}
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Deleting Event');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function save_schedule(){
|
|
$.ajax({
|
|
url : 'save_add_event.php ',
|
|
type : "POST",
|
|
data : $("#sechedule_form").serialize(),
|
|
success : function(data) {
|
|
BootstrapDialog.alert('Event Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Saving Event');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
|
|
var training_id = "";
|
|
function open_training(trainingId, action) {
|
|
var training_id = "";
|
|
if(action=="V"){
|
|
$(".save_button").hide();
|
|
|
|
}else{
|
|
$(".save_button").show();
|
|
}
|
|
$.ajax({
|
|
url : 'select_add_event.php?scheduleId='+eventId+' ',
|
|
type : 'POST',
|
|
success : function(data) {
|
|
//alert(data);
|
|
var data = $.parseJSON(data);
|
|
//alert(data);
|
|
|
|
$("#event_id").val(data.event_id);
|
|
$("#event_name").val(data.event_name);
|
|
$("#last_modify").val(data.last_modify);
|
|
$("#modify_by").val(data.modify_by);
|
|
//$("#trainer_name").val(data.trainer_name);
|
|
//$("#location").val(data.location);
|
|
//$("#remark").val(data.remark);
|
|
|
|
$('#modal-add-event').modal("show");
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error Populating Event');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<?php include('form/add_event.php');?>
|