248 lines
6.5 KiB
PHP
248 lines
6.5 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="#">Data Setup</li>
|
|
<li class="#">Masters</li>
|
|
<li class="active">Disposal Agency</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_designation">
|
|
<div id="flex1" style="width:100%">
|
|
</div>
|
|
<input type="hidden" name="flex_designation_id" id="flex_designation_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: 'disposal_agency_script.php',
|
|
dataType: 'json',
|
|
colModel: [{
|
|
display: 'Sr',
|
|
name: 'count',
|
|
width: w * .04,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: ' ',
|
|
name: '',
|
|
width: w * .10,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
|
|
{
|
|
display: 'Agency Name',
|
|
name: 'agency_name',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Agency Address',
|
|
name: 'agency_address',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Regestration No.',
|
|
name: 'regestration_no',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Allocated Reg. No. to OHC',
|
|
name: 'allocated_reg_no',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
|
|
],
|
|
buttons: [
|
|
|
|
{
|
|
name: 'Add',
|
|
bclass: 'add',
|
|
onpress: add
|
|
},
|
|
{
|
|
name: 'PDF',
|
|
bclass: 'print',
|
|
onpress: pdf
|
|
},
|
|
{
|
|
name: 'EXCEL',
|
|
bclass: 'print_excel',
|
|
onpress: excel
|
|
},
|
|
|
|
{
|
|
separator: true
|
|
}
|
|
],
|
|
searchitems: [
|
|
|
|
{
|
|
display: 'Agency Name',
|
|
name: 'agency_name',
|
|
isdefault: true
|
|
},
|
|
{
|
|
display: 'Agency Address',
|
|
name: 'agency_address'
|
|
}
|
|
],
|
|
sortname: "agency_name",
|
|
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();
|
|
$("#agency_id").val("");
|
|
$("#agency_name").val("");
|
|
$("#agency_address").val("");
|
|
$("#regestration_no").val("");
|
|
$("#allocated_reg_no").val("");
|
|
|
|
$('#modal-add-designation').modal("show");
|
|
}
|
|
|
|
function pdf() {
|
|
window.open('disposal_agency_pdf.php');
|
|
}
|
|
|
|
function excel() {
|
|
window.location = 'designation_excel.php';
|
|
}
|
|
|
|
function delete_designation(agencyId) {
|
|
$("#flex_designation_id").val(agencyId);
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete the Agency?', function(result) {
|
|
if (result) {
|
|
$.ajax({
|
|
url: 'delete_agency.php',
|
|
type: "POST",
|
|
data: $("#flex_form_designation").serialize(),
|
|
success: function(data) {
|
|
if (data.indexOf("SUCCESS") != -1) {
|
|
BootstrapDialog.alert('Agency Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
} else {
|
|
BootstrapDialog.alert('Error Deleting Agency');
|
|
}
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Deleting Agency');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function save_designation() {
|
|
$.ajax({
|
|
url: 'save_agency.php',
|
|
type: "POST",
|
|
data: $("#designation_form").serialize(),
|
|
success: function(data) {
|
|
BootstrapDialog.alert('Agency Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Agency');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
|
|
|
|
function open_designation(agencyId, action) {
|
|
var agency_id = "";
|
|
if (action == "V") {
|
|
$(".save_button").hide();
|
|
|
|
} else {
|
|
$(".save_button").show();
|
|
}
|
|
$.ajax({
|
|
url: 'select_agency.php?agencyId=' + agencyId + ' ',
|
|
type: 'POST',
|
|
success: function(data) {
|
|
//alert(data);
|
|
var data = $.parseJSON(data);
|
|
//alert(data);
|
|
|
|
$("#agency_id").val(data.agency_id);
|
|
$("#agency_name").val(data.agency_name);
|
|
$("#agency_address").val(data.agency_address);
|
|
$("#regestration_no").val(data.regestration_no);
|
|
$("#allocated_reg_no").val(data.allocated_reg_no);
|
|
$('#modal-add-designation').modal("show");
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating Disposal Agency');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<?php include('form/add_agency.php');?>
|