319 lines
9.9 KiB
PHP
319 lines
9.9 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="#">Master</li>
|
||
|
|
<li class="active">Agencies</li>
|
||
|
|
</ul>
|
||
|
|
</div>
|
||
|
|
<!-- End of breadcrumb -->
|
||
|
|
|
||
|
|
<div class="page-content">
|
||
|
|
<div id="flexigridDiv" class="table-responsive">
|
||
|
|
<form name="export_form" method="post" id="export_form" action="">
|
||
|
|
|
||
|
|
<input type="hidden" name="pdf_action" id="pdf_action" value="pdf_agency_list.php" />
|
||
|
|
<input type="hidden" name="excel_action" id="excel_action" value="excel_contractor_list.php" />
|
||
|
|
</form>
|
||
|
|
|
||
|
|
<form name="f1" method="post" action="" id="flex_form_patient">
|
||
|
|
<div id="flex1" style="width:100%">
|
||
|
|
</div>
|
||
|
|
<input type="hidden" name="flex_patient_id" id="flex_patient_id" />
|
||
|
|
</form>
|
||
|
|
</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: 'agency_list_script.php',
|
||
|
|
dataType: 'json',
|
||
|
|
colModel: [{
|
||
|
|
display: 'Sr',
|
||
|
|
name: 'count',
|
||
|
|
width: w * .04,
|
||
|
|
sortable: false,
|
||
|
|
align: 'left'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
display: '',
|
||
|
|
name: '',
|
||
|
|
width: w * .1,
|
||
|
|
sortable: false,
|
||
|
|
align: 'left'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
display: 'Agency Name',
|
||
|
|
name: 'agency_name',
|
||
|
|
width: w * .2,
|
||
|
|
sortable: true,
|
||
|
|
align: 'left'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
display: 'Code',
|
||
|
|
name: 'agency_code',
|
||
|
|
width: w * .1,
|
||
|
|
sortable: true,
|
||
|
|
align: 'left'
|
||
|
|
},
|
||
|
|
|
||
|
|
{
|
||
|
|
display: 'Address',
|
||
|
|
name: 'agency_Address',
|
||
|
|
width: w * .1,
|
||
|
|
sortable: true,
|
||
|
|
align: 'left'
|
||
|
|
},
|
||
|
|
|
||
|
|
{
|
||
|
|
display: 'Contact',
|
||
|
|
name: 'agency_contact',
|
||
|
|
width: w * .1,
|
||
|
|
sortable: true,
|
||
|
|
align: 'left'
|
||
|
|
},
|
||
|
|
{
|
||
|
|
display: 'Email',
|
||
|
|
name: 'agency_email',
|
||
|
|
width: w * .2,
|
||
|
|
sortable: true,
|
||
|
|
align: 'left'
|
||
|
|
},
|
||
|
|
|
||
|
|
{
|
||
|
|
display: 'Remarks',
|
||
|
|
name: 'agency_desc',
|
||
|
|
width: w * .2,
|
||
|
|
sortable: true,
|
||
|
|
align: 'left'
|
||
|
|
},
|
||
|
|
|
||
|
|
|
||
|
|
],
|
||
|
|
buttons: [{
|
||
|
|
name: 'PDF',
|
||
|
|
bclass: 'print',
|
||
|
|
onpress: function() {
|
||
|
|
pdf('pdf'); // Pass 'pdf' to the pdf function
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
separator: true
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: 'Excel',
|
||
|
|
bclass: 'print_excel',
|
||
|
|
onpress: function() {
|
||
|
|
pdf('excel'); // Pass 'pdf' to the pdf function
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
{
|
||
|
|
separator: true
|
||
|
|
},
|
||
|
|
|
||
|
|
{
|
||
|
|
name: 'Add',
|
||
|
|
bclass: 'add',
|
||
|
|
onpress: add
|
||
|
|
},
|
||
|
|
|
||
|
|
{
|
||
|
|
separator: true
|
||
|
|
},
|
||
|
|
|
||
|
|
],
|
||
|
|
searchitems: [
|
||
|
|
|
||
|
|
{
|
||
|
|
display: 'Employer/Contractor',
|
||
|
|
name: 'agency_name',
|
||
|
|
isdefault: true
|
||
|
|
},
|
||
|
|
{
|
||
|
|
display: 'Code',
|
||
|
|
name: 'agency_code',
|
||
|
|
isdefault: true
|
||
|
|
},
|
||
|
|
{
|
||
|
|
display: 'Address',
|
||
|
|
name: 'agency_address',
|
||
|
|
isdefault: true
|
||
|
|
},
|
||
|
|
{
|
||
|
|
display: 'Contact',
|
||
|
|
name: 'agency_contact',
|
||
|
|
isdefault: true
|
||
|
|
},
|
||
|
|
{
|
||
|
|
display: 'Email',
|
||
|
|
name: 'agency_email',
|
||
|
|
isdefault: true
|
||
|
|
},
|
||
|
|
{
|
||
|
|
display: 'Remarks',
|
||
|
|
name: 'agency_desc'
|
||
|
|
}
|
||
|
|
],
|
||
|
|
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();
|
||
|
|
$("#id").val("");
|
||
|
|
$("#agency").val("");
|
||
|
|
$("#agency_email").val("");
|
||
|
|
$("#agency_contact").val("");
|
||
|
|
$("#agency_code").val("");
|
||
|
|
$("#agency_address").val("");
|
||
|
|
$("#remarks").val("");
|
||
|
|
|
||
|
|
$('#modal-add-agency').modal("show");
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function save_agency() {
|
||
|
|
|
||
|
|
$.ajax({
|
||
|
|
url: 'save_agencies.php',
|
||
|
|
type: "POST",
|
||
|
|
data: $("#agency_form").serialize(),
|
||
|
|
success: function(data) {
|
||
|
|
BootstrapDialog.alert('Agency Saved Successfully.');
|
||
|
|
$("#flex1").flexReload();
|
||
|
|
return;
|
||
|
|
},
|
||
|
|
error: function(data) {
|
||
|
|
BootstrapDialog.alert('Error In Saving Agency');
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
$('.close').click();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function pdf(type) {
|
||
|
|
var url = 'agency_pdf.php?type=' + encodeURIComponent(type);
|
||
|
|
window.open(url, '_blank'); // Use '_blank' to open in a new tab
|
||
|
|
}
|
||
|
|
|
||
|
|
function open_agency(id, action) {
|
||
|
|
|
||
|
|
|
||
|
|
if (action == "V") {
|
||
|
|
$(".save_button").hide();
|
||
|
|
|
||
|
|
} else {
|
||
|
|
$(".save_button").show();
|
||
|
|
}
|
||
|
|
$.ajax({
|
||
|
|
url: 'select_agencies.php',
|
||
|
|
type: 'POST',
|
||
|
|
data: {
|
||
|
|
id: id
|
||
|
|
},
|
||
|
|
dataType: 'json',
|
||
|
|
success: function(data) {
|
||
|
|
|
||
|
|
$("#agency_id").val(data.id);
|
||
|
|
$("#agency").val(data.agency_name);
|
||
|
|
$("#agency_code").val(data.agency_code);
|
||
|
|
$("#agency_address").val(data.agency_address);
|
||
|
|
$("#agency_contact").val(data.agency_contact);
|
||
|
|
$("#agency_email").val(data.agency_email);
|
||
|
|
$("#gst_no").val(data.gst_no);
|
||
|
|
$("#fertilizer_l_no").val(data.fertilizer_l_no);
|
||
|
|
$("#pesticides_lic_no").val(data.pesticides_lic_no);
|
||
|
|
$("#seed_lic_no").val(data.seed_lic_no);
|
||
|
|
|
||
|
|
$("#remarks").val(data.agency_desc);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
$('#modal-add-agency').modal("show");
|
||
|
|
},
|
||
|
|
error: function(data) {
|
||
|
|
BootstrapDialog.alert('Error Populating Agency');
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
function delete_agency(id) {
|
||
|
|
BootstrapDialog.confirm('Are you sure to delete the employer?', function(result) {
|
||
|
|
if (result) {
|
||
|
|
$.ajax({
|
||
|
|
url: 'delete_agency.php',
|
||
|
|
data: {
|
||
|
|
id: id
|
||
|
|
},
|
||
|
|
type: 'POST',
|
||
|
|
dataType: 'json',
|
||
|
|
success: function(data) {
|
||
|
|
|
||
|
|
if (data == 'SUCCESS') {
|
||
|
|
|
||
|
|
BootstrapDialog.alert('Deleted Agency Successfully');
|
||
|
|
$("#flex1").flexReload();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
},
|
||
|
|
error: function(data) {
|
||
|
|
BootstrapDialog.alert('Error Deleting Agency ');
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<?php include('techsyn_footer.php'); ?>
|
||
|
|
<?php include('agencies_form.php'); ?>
|