569 lines
25 KiB
PHP
569 lines
25 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="active"><a href="yearly_budget.php">Yearly Budget</a></li>
|
||
|
</ul>
|
||
|
|
||
|
</div>
|
||
|
<!-- End of breadcrumb -->
|
||
|
|
||
|
|
||
|
|
||
|
<div class="page-content">
|
||
|
|
||
|
<!-- 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>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<div id="flexigridDiv" class="table-responsive">
|
||
|
|
||
|
<form name="f1" method="post" id="flex_appointment_form" action="#">
|
||
|
<div id="flex1" style="width:100%">
|
||
|
<input type="hidden" name="flex_item_id" id="flex_item_id" />
|
||
|
</div>
|
||
|
|
||
|
</form>
|
||
|
|
||
|
<form name="export_form" method="post" id="export_form" action="">
|
||
|
|
||
|
<input type="hidden" name="pdf_action" id="pdf_action" value="item_rate_pdf.php" />
|
||
|
<input type="hidden" name="excel_action" id="excel_action" value="item_rate_excel.php" />
|
||
|
</form>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
$(function() {
|
||
|
var w = screen.width * .90;
|
||
|
var h = 0;
|
||
|
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) *
|
||
|
.85;
|
||
|
$("#flex1").flexigrid({
|
||
|
url: 'yearly_budget_script.php',
|
||
|
dataType: 'json',
|
||
|
colModel: [{
|
||
|
display: 'Sr',
|
||
|
name: 'count',
|
||
|
width: w * .05,
|
||
|
sortable: false,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Year',
|
||
|
name: 'year',
|
||
|
width: w * .20,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Primary Budget',
|
||
|
name: 'primary_budget',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Additional Approved Budget',
|
||
|
name: 'additional_approved_budget',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
}, {
|
||
|
display: 'Total Budget',
|
||
|
name: 'total_budget',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
}, {
|
||
|
display: 'Available Budget',
|
||
|
name: 'available_budget',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: '',
|
||
|
name: 'link',
|
||
|
width: w * .1,
|
||
|
sortable: false,
|
||
|
align: 'left'
|
||
|
},
|
||
|
|
||
|
{
|
||
|
display: '',
|
||
|
name: 'budget_change_history_button',
|
||
|
width: w * .14,
|
||
|
sortable: false,
|
||
|
align: 'left'
|
||
|
}
|
||
|
|
||
|
],
|
||
|
buttons: [
|
||
|
|
||
|
{
|
||
|
name: 'Add',
|
||
|
bclass: 'add',
|
||
|
onpress: add
|
||
|
},
|
||
|
{
|
||
|
separator: true
|
||
|
},
|
||
|
//{name: 'PDFReport', bclass: 'print', onpress : pdfReport},
|
||
|
// {separator: true},
|
||
|
{
|
||
|
name: 'PDF',
|
||
|
bclass: 'print',
|
||
|
onpress: pdf
|
||
|
},
|
||
|
{
|
||
|
separator: true
|
||
|
},
|
||
|
{
|
||
|
name: 'Excel',
|
||
|
bclass: 'print_excel',
|
||
|
onpress: excel
|
||
|
},
|
||
|
{
|
||
|
separator: true
|
||
|
}
|
||
|
],
|
||
|
searchitems: [
|
||
|
//{display: 'Appointment Id', name : 'appointment_id',isdefault: true},
|
||
|
{
|
||
|
display: 'Year',
|
||
|
name: 'year'
|
||
|
},
|
||
|
|
||
|
|
||
|
],
|
||
|
sortname: "year",
|
||
|
// sortorder: "type_description",
|
||
|
usepager: true, //pagination
|
||
|
//title:"Employee OPD",
|
||
|
useRp: true,
|
||
|
rp: 50, //records per page
|
||
|
showTableToggleBtn: false, //toggle button for the whole table
|
||
|
resizable: true,
|
||
|
// width: w,
|
||
|
height: h,
|
||
|
singleSelect: true
|
||
|
});
|
||
|
});
|
||
|
|
||
|
|
||
|
// }
|
||
|
|
||
|
|
||
|
|
||
|
function delete_item(id) {
|
||
|
// alert(id);
|
||
|
$.ajax({
|
||
|
url: 'delete_yearly_budget.php',
|
||
|
data: {
|
||
|
id: id
|
||
|
},
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
|
||
|
if (data == 'SUCCESS') {
|
||
|
|
||
|
BootstrapDialog.alert('Stock Item Deleted Successfully!');
|
||
|
|
||
|
$("#flex1").flexReload();
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error: Stock Not Deleted!');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
function show_save_button() {
|
||
|
$("#save_button").show()
|
||
|
$("#id").val("");
|
||
|
|
||
|
}
|
||
|
|
||
|
function add() {
|
||
|
|
||
|
approve_indent_budget();
|
||
|
|
||
|
|
||
|
}
|
||
|
const wage = document.getElementById('utilized_budget');
|
||
|
wage.addEventListener('keydown', (e) => {
|
||
|
if (e.key === 'Enter') {
|
||
|
calculatetotal_budget();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
function open_item(id, access) {
|
||
|
document.getElementById("indent_status_form").reset();
|
||
|
if (access == 'V') {
|
||
|
$("#year").prop('disabled', true);
|
||
|
$("#primary_budget").prop('disabled', true);
|
||
|
$("#additional_approved_budget").prop('disabled', true);
|
||
|
$("#total_budget").prop('disabled', true);
|
||
|
$("#utilized_budget").prop('disabled', true);
|
||
|
$("#available_budget").prop('disabled', true);
|
||
|
$("#save_button").hide()
|
||
|
// $("#new_id_th").hide();
|
||
|
} else if (access == 'E') {
|
||
|
$("#year").prop('disabled', false);
|
||
|
$("#primary_budget").prop('disabled', false);
|
||
|
$("#additional_approved_budget").prop('disabled', false);
|
||
|
$("#total_budget").prop('disabled', false);
|
||
|
$("#utilized_budget").prop('disabled', false);
|
||
|
$("#available_budget").prop('disabled', false);
|
||
|
$("#save_button").show()
|
||
|
$("#remarks_div").show();
|
||
|
} else if (access == 'A') {
|
||
|
// $("#new_id_td").show();
|
||
|
// $("#remarks_div").show();
|
||
|
// $("#new_id_th").show();
|
||
|
// $("#net_value").prop('disabled', true);
|
||
|
|
||
|
// $("#item_id").prop('disabled', false);
|
||
|
// $("#net_value").prop('disabled', false);
|
||
|
// $("#stock_qty").prop('disabled', false);
|
||
|
// $("#remarks_div").show();
|
||
|
$("#save_button").show()
|
||
|
}
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'select_yearly_budget.php',
|
||
|
data: {
|
||
|
id: id
|
||
|
},
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
// alert(data.item_id);
|
||
|
approve_indent_budget(data.year);
|
||
|
$("#id").val(data.id);
|
||
|
$("#year").val(data.year);
|
||
|
$("#primary_budget").val(data.primary_budget);
|
||
|
$("#additional_approved_budget").val(data.additional_approved_budget);
|
||
|
$("#total_budget").val(data.total_budget);
|
||
|
$("#utilized_budget").val(data.utilized_budget);
|
||
|
$("#available_budget").val(data.available_budget);
|
||
|
|
||
|
$('#modal-indent-status').modal("show");
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// $('#modal-add-ambulance-form').modal("show");
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Populating Task Details');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
function calculatetotal_budget() {
|
||
|
|
||
|
var pb = $("#primary_budget").val();
|
||
|
var aab = $("#additional_approved_budget").val();
|
||
|
var ub = $('#utilized_budget').val();
|
||
|
// alert(pb + '---' + aab);
|
||
|
if (pb == null || pb == '') {
|
||
|
pb = 0;
|
||
|
}
|
||
|
if (aab == null || aab == '') {
|
||
|
aab = 0;
|
||
|
}
|
||
|
// alert(pb + '---' + aab);
|
||
|
|
||
|
pb = parseFloat(pb);
|
||
|
aab = parseFloat(aab);
|
||
|
ub = parseFloat(ub);
|
||
|
|
||
|
var tb = pb + aab;
|
||
|
var ab = tb - ub;
|
||
|
$("#total_budget").val(tb.toFixed(2));
|
||
|
$("#available_budget").val(ab.toFixed(2));
|
||
|
$("#primary_budget").val(pb.toFixed(2));
|
||
|
$("#additional_approved_budget").val(aab.toFixed(2));
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
function approve_indent_budget(year) {
|
||
|
document.getElementById("indent_status_form").reset();
|
||
|
$.ajax({
|
||
|
url: 'select_indent_budget.php',
|
||
|
data: {
|
||
|
year: year
|
||
|
},
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
// alert(data.year)
|
||
|
var year = data.year;
|
||
|
$("#year").val(year);
|
||
|
$("#total_budget").prop('disabled', true);
|
||
|
$("#available_budget").prop('disabled', true);
|
||
|
|
||
|
// $("#year").prop('disabled', true);
|
||
|
$("#utilized_budget").val(data.total_pending_indent_budget);
|
||
|
|
||
|
$("#utilized_budget").prop('disabled', true);
|
||
|
$('#modal-indent-status').modal("show");
|
||
|
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Populating Task Details');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
function budget_change_history(id, access) {
|
||
|
// $('#flex_item_id').val(id);
|
||
|
// document.getElementById("budget_change_history_form").reset();
|
||
|
$.ajax({
|
||
|
url: 'select_yearly_budget_change_history.php',
|
||
|
data: {
|
||
|
id: id
|
||
|
},
|
||
|
type: 'POST',
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
// alert(data);
|
||
|
var content = '';
|
||
|
content +=
|
||
|
' <thead><tr><th style="text-align:center">Sr No</th><th style="text-align:center;width:10%">Year</th><th style="text-align:center">Old Primary Budget</th><th style="text-align:center">Old Additional Budget</th><th style="text-align:center">New Primary Budget</th><th style="text-align:center">New Additional Budget</th><th style="text-align:center"> Change By</th><th style="text-align:center"> Change Date</th><th style="text-align:center"> Remarks</th></tr></thead><tbody'
|
||
|
if (data.length) {
|
||
|
for (var l = 0; l < data.length; l++) {
|
||
|
var year = data[l]['year'] + ' - ' + (parseInt(data[l]['year']) + 1);
|
||
|
var last_modified = data[l]['last_modified'];
|
||
|
var modified_by = data[l]['modified_by'];
|
||
|
var old_additional_approved_budget = data[l][
|
||
|
'old_additional_approved_budget'
|
||
|
];
|
||
|
var new_additional_approved_budget = data[l][
|
||
|
'new_additional_approved_budget'
|
||
|
];
|
||
|
var new_primary_budget = data[l]['new_primary_budget'];
|
||
|
var old_primary_budget = data[l]['old_primary_budget'];
|
||
|
|
||
|
var remarks = data[l]['remarks'];
|
||
|
|
||
|
|
||
|
content += "<tr><td> " + (l + 1) + " </td> <td> " +
|
||
|
year +
|
||
|
" </td> <td> " + old_primary_budget + " </td> <td> " +
|
||
|
old_additional_approved_budget + " </td> <td> " +
|
||
|
new_primary_budget + " </td> <td> " +
|
||
|
new_additional_approved_budget +
|
||
|
" </td><td> " + modified_by + "</td><td> " + last_modified +
|
||
|
"</td><td> " + remarks +
|
||
|
"</td> </tr> ";
|
||
|
}
|
||
|
|
||
|
} else {
|
||
|
|
||
|
content +=
|
||
|
"<tr><td style='text-align: center; 'colspan = 10 > NO Budget Change done " +
|
||
|
"</td> </tr> ";
|
||
|
|
||
|
}
|
||
|
$("#budget_change_history_table").html(content);
|
||
|
|
||
|
|
||
|
$('#modal-budget-change-status').modal("show");
|
||
|
|
||
|
|
||
|
|
||
|
// $('#modal-add-ambulance-form').modal("show");
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Populating Task Details');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
function pdf() {
|
||
|
window.open('ajax_pdf.php', 'Vaccine List');
|
||
|
}
|
||
|
|
||
|
function excel() {
|
||
|
window.open('ajax_excel.php', 'Task List');
|
||
|
}
|
||
|
|
||
|
$("#new_button").on("click", function() {
|
||
|
$("id").val("");
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
<?php include('techsyn_footer.php'); ?>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<!-- End of page-content -->
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<script>
|
||
|
function validate() {
|
||
|
|
||
|
// var item_name = $('#item_name').val();
|
||
|
|
||
|
// if (item_name == '') {
|
||
|
|
||
|
// BootstrapDialog.alert('Please Enter Item Name.!!!');
|
||
|
|
||
|
// return false;
|
||
|
|
||
|
// }
|
||
|
|
||
|
// var item_mrp = $('#net_value').val();
|
||
|
|
||
|
// if (item_mrp == '') {
|
||
|
|
||
|
// BootstrapDialog.alert('Please Enter Item Rate.!!!');
|
||
|
|
||
|
// return false;
|
||
|
|
||
|
// }
|
||
|
|
||
|
save();
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style>
|
||
|
#modal-add-vaccine {
|
||
|
overflow-y: scroll;
|
||
|
}
|
||
|
</style>
|
||
|
|
||
|
|
||
|
|
||
|
<?php include('techsyn_footer.php'); ?>
|
||
|
<script type="text/javascript">
|
||
|
function save() {
|
||
|
$("#total_budget").prop('disabled', false);
|
||
|
$("#utilized_budget").prop('disabled', false);
|
||
|
$("#available_budget").prop('disabled', false);
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'save_yearly_budget.php',
|
||
|
type: "POST",
|
||
|
data: $("#indent_status_form").serialize(),
|
||
|
success: function(data) {
|
||
|
// alert(data);
|
||
|
BootstrapDialog.alert('Rate Saved Successfully.');
|
||
|
|
||
|
$("#net_value").prop('disabled', false);
|
||
|
$("#flex1").flexReload();
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Saving vaccine');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
$('.close').click();
|
||
|
// location.href="procurement_list.php";
|
||
|
}
|
||
|
$('.date-picker').datepicker({
|
||
|
autoclose: true,
|
||
|
format: 'dd/mm/yyyy'
|
||
|
}).next().on(ace.click_event, function() {
|
||
|
$(this).prev().focus();
|
||
|
});
|
||
|
</script>
|
||
|
<!-- bootstrap & fontawesome -->
|
||
|
<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
|
||
|
|
||
|
<!-- page specific plugin styles -->
|
||
|
<link rel="stylesheet" href="assets/css/jquery-ui.custom.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/chosen.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-timepicker.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/daterangepicker.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-datetimepicker.min.css" />
|
||
|
<link rel="stylesheet" href="assets/css/bootstrap-colorpicker.min.css" />
|
||
|
<script type="text/javascript" src="js/typeahead.bundle.js"></script>
|
||
|
<script src="assets/js/jquery-ui.custom.min.js"></script>
|
||
|
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
|
||
|
<script src="assets/js/chosen.jquery.min.js"></script>
|
||
|
<script src="assets/js/spinbox.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-datepicker.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-timepicker.min.js"></script>
|
||
|
<script src="assets/js/jquery.dataTables.min.js"></script>
|
||
|
<script src="assets/js/jquery.dataTables.bootstrap.min.js"></script>
|
||
|
<script src="assets/js/dataTables.buttons.min.js"></script>
|
||
|
<script src="assets/js/buttons.flash.min.js"></script>
|
||
|
<script src="assets/js/buttons.html5.min.js"></script>
|
||
|
<script src="assets/js/buttons.print.min.js"></script>
|
||
|
<script src="assets/js/buttons.colVis.min.js"></script>
|
||
|
<script src="assets/js/dataTables.select.min.js"></script>
|
||
|
|
||
|
|
||
|
<script src="assets/js/moment.min.js"></script>
|
||
|
<script src="assets/js/daterangepicker.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-datetimepicker.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-colorpicker.min.js"></script>
|
||
|
<script src="assets/js/jquery.knob.min.js"></script>
|
||
|
<script src="assets/js/autosize.min.js"></script>
|
||
|
<script src="assets/js/jquery.inputlimiter.min.js"></script>
|
||
|
<script src="assets/js/jquery.maskedinput.min.js"></script>
|
||
|
<script src="assets/js/bootstrap-tag.min.js"></script>
|
||
|
<script src="assets/js/ace-elements.min.js"></script>
|
||
|
<?php include('form/budget_change_form.php'); ?>
|
||
|
<?php include('form/budget_change_history.php'); ?>
|