331 lines
9.8 KiB
PHP
331 lines
9.8 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">States</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_city_list.php" />
|
|
<input type="hidden" name="excel_action" id="excel_action" value="excel_city_list.php" />
|
|
</form>
|
|
|
|
<form name="f1" method="post" action="" id="flex_form_city">
|
|
<div id="flex1" style="width:100%">
|
|
</div>
|
|
<input type="hidden" name="flex_city_id" id="flex_city_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: 'state_script.php',
|
|
dataType: 'json',
|
|
colModel: [{
|
|
display: 'Sr no.',
|
|
name: 'count',
|
|
width: w * .04,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: '',
|
|
name: '',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'State Name',
|
|
name: 'state_code',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'LAST MODIFIED',
|
|
name: 'last_modified',
|
|
width: w * .12,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
// {
|
|
// display: 'AC Per Km Cost',
|
|
// name: 'AC_cost',
|
|
// width: w * .15,
|
|
// sortable: true,
|
|
// align: 'left'
|
|
// }, {
|
|
// display: 'AC Ambulance Charge',
|
|
// name: 'AC_amb_charge',
|
|
// width: w * .15,
|
|
// sortable: true,
|
|
// align: 'left'
|
|
// },
|
|
// {
|
|
// display: 'NON-AC Per Km Cost',
|
|
// name: 'NON_AC_cost',
|
|
// width: w * .15,
|
|
// sortable: true,
|
|
// align: 'left'
|
|
// }, {
|
|
// display: 'NON-AC Ambulance Charge',
|
|
// name: 'NON_AC_amb_charge',
|
|
// width: w * .15,
|
|
// sortable: true,
|
|
// 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: 'state',
|
|
name: 'state_code',
|
|
isdefault: true
|
|
},
|
|
// {
|
|
// display: 'ambulance_type',
|
|
// name: 'ambulance_type',
|
|
// isdefault: true
|
|
// },
|
|
|
|
// {
|
|
// display: ' AC Per Km Cost',
|
|
// name: 'AC_cost',
|
|
// isdefault: true
|
|
// },
|
|
// {
|
|
// display: 'AC Ambulance Charge',
|
|
// name: 'AC_amb_charge',
|
|
// isdefault: true
|
|
// },
|
|
// {
|
|
// display: ' NON-AC Per Km Cost',
|
|
// name: 'NON_AC_cost',
|
|
// isdefault: true
|
|
// },
|
|
// {
|
|
// display: 'NON-AC Ambulance Charge',
|
|
// name: 'NON_AC_amb_charge',
|
|
// isdefault: true
|
|
// }
|
|
],
|
|
sortname: "state_code",
|
|
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 excel()
|
|
|
|
{
|
|
|
|
window.open('state_list_excel.php');
|
|
|
|
}
|
|
|
|
function pdf() {
|
|
window.open('state_list_pdf.php');
|
|
}
|
|
|
|
|
|
function add() {
|
|
$(".save_button").show();
|
|
$("#city_id").val("");
|
|
$("#state").val("");
|
|
$("#AC_cost").val("");
|
|
$("#AC_amb_charge").val("");
|
|
$("#NON_AC_cost").val("");
|
|
$("#NON_AC_amb_charge").val("");
|
|
|
|
|
|
|
|
$("#city").prop('disabled', false);
|
|
$("#AC_cost").prop('disabled', false);
|
|
$("#AC_amb_charge").prop('disabled', false);
|
|
$("#NON_AC_cost").prop('disabled', false);
|
|
$("#NON_AC_amb_charge").prop('disabled', false);
|
|
|
|
|
|
$('#modal-add-city').modal("show");
|
|
}
|
|
|
|
function delete_section(cityId) {
|
|
$("#flex_city_id").val(cityId);
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete the state?', function(result) {
|
|
if (result) {
|
|
$.ajax({
|
|
url: 'delete_state.php',
|
|
type: "POST",
|
|
data: $("#flex_form_city").serialize(),
|
|
success: function(data) {
|
|
if (data.indexOf("SUCCESS") != -1) {
|
|
BootstrapDialog.alert('State details Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
} else {
|
|
BootstrapDialog.alert('Error Deleting state details');
|
|
}
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Deleting Complaint');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
function save_section() {
|
|
$.ajax({
|
|
url: 'save_state.php ',
|
|
type: "POST",
|
|
data: $("#city_form").serialize(),
|
|
success: function(data) {
|
|
BootstrapDialog.alert('state Saved Successfully.');
|
|
$("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving update city');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
|
|
|
|
function open_section(id, action) {
|
|
|
|
if (action == "V") {
|
|
$(".save_button").hide();
|
|
$("#state").prop('disabled', true);
|
|
|
|
|
|
|
|
} else {
|
|
$("#city").prop('disabled', false);
|
|
$("#AC_cost").prop('disabled', false);
|
|
$("#AC_amb_charge").prop('disabled', false);
|
|
$("#NON_AC_cost").prop('disabled', false);
|
|
$("#NON_AC_amb_charge").prop('disabled', false);
|
|
|
|
$(".save_button").show();
|
|
}
|
|
$.ajax({
|
|
url: 'select_state.php?id=' + id + ' ',
|
|
type: 'POST',
|
|
success: function(data) {
|
|
|
|
var data = $.parseJSON(data);
|
|
$("#state").val(data.state);
|
|
$("#id").val(data.id);
|
|
$("#state").val(data.state_code);
|
|
$('#modal-add-city').modal("show");
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating state details');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function loadSBUList(bu_id, selectId) {
|
|
$("#" + selectId).empty();
|
|
$.ajax({
|
|
url: 'getDynamicData.php?tableName=department&where_clause_field=bu_id&where_clause_value=' + bu_id,
|
|
type: 'GET',
|
|
success: function(data) {
|
|
|
|
var data = $.parseJSON(data);
|
|
|
|
for (i = 0; i < data.length; i++) {
|
|
var o = new Option(data[i].dept_name, data[i].dept_id)
|
|
$("#" + selectId).append(o);
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating Section');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<?php include('form/add_state.php'); ?>
|