csrtechnew.ohctech.in/item_rate.php

934 lines
40 KiB
PHP
Raw Normal View History

2025-04-14 13:28:09 +05:30
<?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="item_rate.php">Inventory</a></li>
<li class="active"><a href="item_rate.php">Item Rate</a></li>
</ul>
</div>
<!-- End of breadcrumb -->
<div class="page-content">
<!-- <div class="box box-primary center" style="padding: 10px; margin: 2px 0px 50px 5px; width: 99.5%; ">
<form id="task_form" method="post">
<div class="box-body">
<div class="row">
<div class="col-sm-3"></div>
<div class="col-sm-6">
<table id="myTable center" class="table table-bordered order-list">
<thead>
<tr>
<th style="padding-right: 50px; margin: 2px 0px 50px 5px; width: 30%; ">
Item Name</th>
<th style="padding-left: 10px; margin: 2px 0px 50px 5px; width: 20%; ">
Approved Rate</th>
<th style="padding-left: 10px; margin: 2px 0px 50px 5px; width: 20%; ">
Unit</th>
<th style="padding-left: 10px;color:red; margin: 2px 0px 50px 5px; width: 30%;display:none"
id='new_id_th'>
Enter New Rate</th>
</tr>
</thead>
<?php
$row = null;
if (isset($_REQUEST['flex_id'])) {
$sql = "select a.*,b.item_name from procurement_items a left join tbl_items b on a.item_id=b.item_id where procurement_item_id = '" . $_REQUEST['flex_id'] . "'";
$result = @mysqli_query($conn, $sql);
$num_rows = @mysqli_num_rows($result);
$row = @mysqli_fetch_array($result);
}
do {
?>
<tbody>
<tr id="main-form">
<td style="width:30%">
2026-01-07 09:12:10 +05:30
<input type="hidden" name="id" id="id" value="<?php echo $row['id'] ?>" />
2025-04-14 13:28:09 +05:30
<select style="width:100%" class="form-control" id="item_id" name="item_id"
data-placeholder="Item...">
<option value="" selected disabled> please select Item</option>
<?php echo generateOption('tbl_items', 'item_name', 'item_id', '', '');
?>
</select>
</td>
<td style="width:10%">
<input type="text" style="width:100%" name="net_value"
2026-01-07 09:12:10 +05:30
value="<?php echo $row['net_value'] ?>" id="net_value" maxlength="50"
2025-04-14 13:28:09 +05:30
class="form-control" />
</td>
<td style="width:10%">
<input type="text" style="width:100%" name="stock_qty"
2026-01-07 09:12:10 +05:30
value="<?php echo $row['stock_qty'] ?>" id="stock_qty" maxlength="50"
2025-04-14 13:28:09 +05:30
class="form-control" />
</td>
<td style="width:20%;display:none" id='new_id_td'>
<input type="text" style="width:100%" name="new_rate"
2026-01-07 09:12:10 +05:30
value="<?php echo $row['new_rate'] ?>" id="new_rate" maxlength="50"
2025-04-14 13:28:09 +05:30
class="form-control" />
</td>
</tr>
<?php
} while ($row = @mysqli_fetch_array($result)) //end of while
?>
</tbody>
<tfoot>
<tr>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
// End box-body
//box-footer
<div class="box-footer" style="text-align: center;">
<button class="btn btn-success new_button" id="new_button" type="reset"
onclick="show_save_button();">
<i class="ace-icon fa fa-plus-square-o bigger-110"></i>
New
</button>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;
<button class="btn btn-info save_button" id="save_button" type="button" onclick="validate();">
<i class="ace-icon fa fa-floppy-o bigger-110"></i>
Save
</button>
&nbsp; &nbsp; &nbsp;
<button class="btn btn-warning" type="reset">
<i class="ace-icon fa fa-undo bigger-110"></i>
Reset
</button>
</div>
//End box-footer
</form>
</div>
-->
<!-- 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: 'item_rate_script.php',
dataType: 'json',
colModel: [{
display: 'Sr',
name: 'count',
width: w * .05,
sortable: false,
align: 'left'
},
{
display: 'Item Name',
name: 'item_name',
width: w * .20,
sortable: true,
align: 'left'
},
{
display: 'Item Rate',
name: 'item_rate',
width: w * .06,
sortable: true,
align: 'left'
},
{
display: 'Subsidy Amount',
name: 'subsidy_percent',
width: w * .10,
sortable: true,
align: 'left'
},
{
display: 'UNIT',
name: 'unit',
width: w * .06,
sortable: true,
align: 'left'
},
{
display: 'Vendor Code',
name: 'employer_contractor_code',
width: w * .10,
sortable: true,
align: 'left'
},
{
display: 'Current Vendor',
name: 'employer_contractor_name',
width: w * .10,
sortable: true,
align: 'left'
},
{
display: 'Vendor Email',
name: 'employer_contractor_email',
width: w * .10,
sortable: true,
align: 'left'
}, {
display: '',
name: 'link',
width: w * .1,
sortable: false,
align: 'left'
},
{
display: 'Add New Rate',
name: 'new_rate',
width: w * .10,
sortable: false,
align: 'left'
},
{
display: 'Rate Change History',
name: 'rate_change_history',
width: w * .10,
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: function() {
pdf('pdf'); // Pass 'pdf' to the pdf function
}
},
{
separator: true
},
{
name: 'Excel',
bclass: 'print_excel',
onpress: function() {
pdf('excel'); // Pass 'excel' to the pdf function
}
},
// {
// separator: true
// },
// {
// name: 'Update All',
// bclass: 'add',
// onpress: Update_all
// },
],
searchitems: [
//{display: 'Appointment Id', name : 'appointment_id',isdefault: true},
{
display: 'Item Name',
name: 'item_name'
},
{
display: 'Vendor Code',
name: 'employer_contractor_code'
},
],
sortname: "item_name",
// sortorder: "type_description",
usepager: true, //pagination
//title:"Employee OPD",
useRp: true,
rp: 30, //records per page
showTableToggleBtn: false, //toggle button for the whole table
resizable: true,
// width: w,
height: h,
singleSelect: true
});
});
// }
function Update_all() {
window.location = 'item_rate_updater.php';
}
function delete_item(id) {
// alert(id);
$.ajax({
url: 'delete_item_rate.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 open_item(id, access, item_id) {
document.getElementById("indent_status_form").reset();
var rateTr = ''
if (access == 'V') {
rateTr = 'net_value';
$("#mrp").prop('disabled', true);
$("#gst").prop('disabled', true);
$("#discount").prop('disabled', true);
$("#item_id").prop('disabled', true);
$("#net_value").prop('disabled', true);
$("#stock_qty").prop('disabled', true);
$("#vendor").prop('disabled', true);
$("#save_button").hide()
$("#remarks_div").hide();
$("#new_id_td").hide();
$("#new_id_th").hide();
} else if (access == 'E') {
$("#new_id_td").hide();
rateTr = 'net_value';
$("#new_id_th").hide();
// $("#net_value").prop('disabled', true);
$("#mrp").prop('disabled', false);
$("#gst").prop('disabled', false);
$("#discount").prop('disabled', false);
$("#vendor").prop('disabled', false);
$("#item_id").prop('disabled', false);
$("#net_value").prop('disabled', true);
$("#stock_qty").prop('disabled', false);
$("#remarks_div").hide();
$("#save_button").show()
} else if (access == 'A') {
$("#mrp").prop('disabled', false);
$("#gst").prop('disabled', false);
$("#discount").prop('disabled', false);
$("#new_id_td").show();
$("#remarks_div").show();
$("#new_id_th").show();
$("#net_value").prop('disabled', true);
rateTr = 'new_rate';
$("#item_id").prop('disabled', false);
$("#net_value").prop('disabled', true);
$("#stock_qty").prop('disabled', false);
$("#remarks_div").show();
$("#save_button").show()
}
$('#rateTr').val(rateTr);
$.ajax({
url: 'select_item_rate.php',
data: {
id: id
},
type: 'POST',
dataType: 'json',
success: function(data) {
// alert(data.item_id);
$("#id").val(data.item_rate_id);
$("#stock_qty").val(data.unit);
$("#subsidy_percent").val(data.subsidy_percent);
$('#vendor').val(data.vendor_id);
$("#mrp").val(data.mrp);
$("#discount").val(data.discount);
$("#gst").val(data.gst);
$("#net_value").val(data.item_rate);
$("#per_unit_rate").val(data.item_rate);
if (data.item_id == '' || data.item_id == null) {
$("#item_id").val(item_id);
} else {
$("#item_id").val(data.item_id);
}
getMrpGst();
getDiscountRate();
$('#modal-indent-status').modal("show");
// $('#modal-add-ambulance-form').modal("show");
},
error: function(data) {
BootstrapDialog.alert('Error Populating Task Details');
return;
}
});
}
2026-01-07 09:12:10 +05:30
function rate_change_history(id, access) {
document.getElementById("rate_change_history_form").reset();
$.ajax({
url: 'select_item_rate_change_history.php',
data: {
id: id
},
type: 'POST',
dataType: 'json',
success: function(data) {
var content = '';
content += '<thead><tr><th style="text-align:center">Sr No</th><th style="text-align:center">Item Name</th><th style="text-align:center">Old Rate</th><th style="text-align:center">New Rate</th><th style="text-align:center">Change By</th><th style="text-align:center">Change Date</th><th style="text-align:center">Remarks</th><th style="text-align:center">Action</th></tr></thead><tbody>';
if (data.length) {
for (var l = 0; l < data.length; l++) {
var history_id = data[l]['id'];
var item_name = data[l]['item_name'];
var last_modified = data[l]['last_modified'];
var modified_by = data[l]['modified_by'];
var old_rate = data[l]['old_rate'];
var new_rate = data[l]['new_rate'];
var remarks = data[l]['remarks'];
var vendor_name = data[l]['vendor_name'] || '';
var vendor_code = data[l]['vendor_code'] || '';
// Format rates to 2 decimal places
var formatted_old_rate = parseFloat(old_rate).toFixed(2);
var formatted_new_rate = parseFloat(new_rate).toFixed(2);
// Format date if needed
var formatted_date = last_modified;
if (last_modified) {
var dateObj = new Date(last_modified);
if (!isNaN(dateObj.getTime())) {
formatted_date = dateObj.toLocaleDateString('en-GB') + ' ' + dateObj.toLocaleTimeString('en-GB', {hour: '2-digit', minute:'2-digit'});
}
}
2025-04-14 13:28:09 +05:30
2026-01-07 09:12:10 +05:30
content += "<tr id='history-row-" + history_id + "'>";
content += "<td>" + (l + 1) + "</td>";
content += "<td>" + item_name + "</td>";
content += "<td class='old-rate'>" + formatted_old_rate + "</td>";
content += "<td class='new-rate'>" + formatted_new_rate + "</td>";
content += "<td class='modified-by'>" + modified_by + "</td>";
content += "<td class='modified-date'>" + formatted_date + "</td>";
content += "<td class='remarks'>" + remarks + "</td>";
content += "<td style='text-align:center'>";
content += "<button type='button' class='btn btn-sm btn-primary edit-btn' onclick='openEditModal(\"" + history_id + "\", \"" + item_name.replace(/"/g, '&quot;') + "\", \"" + old_rate + "\", \"" + new_rate + "\", \"" + remarks.replace(/"/g, '&quot;').replace(/'/g, "\\'") + "\", \"" + modified_by.replace(/"/g, '&quot;') + "\", \"" + last_modified + "\")'>";
content += "<i class='fa fa-edit'></i> Edit";
content += "</button>";
content += "</td>";
content += "</tr>";
}
} else {
content += "<tr><td style='text-align: center;' colspan='8'>NO Rate Change done</td></tr>";
}
content += "</tbody>";
$("#rate_change_history_table").html(content);
$('#modal-rate-change-status').modal("show");
},
error: function(data) {
BootstrapDialog.alert('Error Populating Task Details');
return;
}
});
}
function openEditModal(historyId, itemName, oldRate, newRate, remarks, modifiedBy, modifiedDate) {
// Fill form fields
document.getElementById("edit_history_id").value = historyId;
document.getElementById("edit_item_name").value = itemName;
document.getElementById("edit_old_rate").value = oldRate;
document.getElementById("edit_new_rate").value = newRate;
document.getElementById("edit_remarks").value = remarks;
document.getElementById("edit_modified_by").value = modifiedBy;
alert(modifiedDate);
var testdfate='2025-12-22';
document.getElementById("edit_modified_date").value = modifiedDate;
// Show modal
$('#modal-edit-rate-history').modal("show");
// Return false to prevent any default behavior
return false;
}
function saveEditChanges() {
var historyId = $('#edit_history_id').val();
var oldRate = $('#edit_old_rate').val();
var newRate = $('#edit_new_rate').val();
var remarks = $('#edit_remarks').val();
var modifiedDate = $('#edit_modified_date').val();
// Validation
if (!oldRate || oldRate.trim() === '') {
showAlert('Please enter Old Rate', 'warning');
$('#edit_old_rate').focus();
return false;
}
if (!newRate || newRate.trim() === '') {
showAlert('Please enter New Rate', 'warning');
$('#edit_new_rate').focus();
return false;
}
// Convert to numbers
oldRate = parseFloat(oldRate);
newRate = parseFloat(newRate);
if (isNaN(oldRate) || oldRate < 0) {
showAlert('Please enter valid Old Rate', 'warning');
return false;
}
if (isNaN(newRate) || newRate < 0) {
showAlert('Please enter valid New Rate', 'warning');
return false;
}
// Show loading
$('#save_edit_history').html('<i class="fa fa-spinner fa-spin"></i> Saving...').prop('disabled', true);
// Prepare data
var formData = {
history_id: historyId,
old_rate: oldRate,
new_rate: newRate,
remarks: remarks,
modified_date: modifiedDate
};
// Send AJAX
$.ajax({
url: 'update_rate_history.php',
type: 'POST',
data: formData,
dataType: 'json',
success: function(response) {
console.log('Server Response:', response);
// Check if response is valid
if (response && typeof response === 'object') {
if (response.success === true) {
// Update table row
updateTableRow(historyId, oldRate, newRate, remarks, response);
// Close modal
$('#modal-edit-rate-history').modal('hide');
// Show success message
showAlert(response.message || 'Record updated successfully!', 'success');
} else {
showAlert(response.message || 'Update failed!', 'error');
}
} else {
console.error('Invalid response format:', response);
showAlert('Invalid server response format', 'error');
}
},
error: function(xhr, status, error) {
console.error('AJAX Error:', error);
console.log('Response Text:', xhr.responseText);
// Try to parse error response
try {
var errorResponse = JSON.parse(xhr.responseText);
showAlert(errorResponse.message || 'Server error occurred', 'error');
} catch (e) {
showAlert('Server error: ' + error, 'error');
}
},
complete: function() {
$('#save_edit_history').html('Save Changes').prop('disabled', false);
}
});
return false;
}
function updateTableRow(historyId, oldRate, newRate, remarks, response) {
var row = $('#history-row-' + historyId);
// Update rate values
row.find('.old-rate').text(oldRate.toFixed(2));
row.find('.new-rate').text(newRate.toFixed(2));
row.find('.remarks').text(remarks);
// Update modified by and date if available in response
if (response.data) {
if (response.data.last_modified) {
row.find('.modified-date').text(formatDateTime(response.data.last_modified));
}
if (response.data.modified_by) {
row.find('.modified-by').text(response.data.modified_by);
}
}
}
// Helper function to format date
function formatDateTime(dateString) {
if (!dateString) return '';
try {
var date = new Date(dateString);
if (isNaN(date.getTime())) return dateString;
// Format: DD-MM-YYYY HH:MM
var day = date.getDate().toString().padStart(2, '0');
var month = (date.getMonth() + 1).toString().padStart(2, '0');
var year = date.getFullYear();
var hours = date.getHours().toString().padStart(2, '0');
var minutes = date.getMinutes().toString().padStart(2, '0');
return day + '-' + month + '-' + year + ' ' + hours + ':' + minutes;
} catch (e) {
return dateString;
}
}
// Helper function for alerts
function showAlert(message, type) {
var title = '';
var cssClass = '';
switch(type) {
case 'success':
title = '<i class="fa fa-check-circle"></i> Success';
cssClass = 'alert-success';
break;
case 'error':
title = '<i class="fa fa-exclamation-circle"></i> Error';
cssClass = 'alert-danger';
break;
case 'warning':
title = '<i class="fa fa-exclamation-triangle"></i> Warning';
cssClass = 'alert-warning';
break;
default:
title = 'Message';
cssClass = 'alert-info';
}
BootstrapDialog.show({
title: title,
message: message,
type: BootstrapDialog.TYPE_DEFAULT,
cssClass: cssClass,
buttons: [{
label: 'OK',
cssClass: 'btn-primary',
action: function(dialog) {
dialog.close();
}
}]
});
}
2025-04-14 13:28:09 +05:30
function pdf(type) {
var url = 'item_rate_pdf.php?type=' + encodeURIComponent(type);
window.open(url, '_blank'); // Use '_blank' to open in a new tab
}
$("#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 vendor = $('#vendor').val();
// if (vendor == '' || vendor == null) {
// BootstrapDialog.alert('Please Select vendor.!!!');
// return false;
// }
save();
}
</script>
<style>
#modal-add-vaccine {
overflow-y: scroll;
}
</style>
<?php include('techsyn_footer.php'); ?>
<script type="text/javascript">
function save() {
$("#net_value").prop('disabled', false);
$.ajax({
url: 'save_item_rate.php ',
type: "POST",
data: $("#indent_status_form").serialize(),
success: function(data) {
// alert(data);
BootstrapDialog.alert('Rate Saved Successfully.');
$("#net_value").prop('disabled', true);
$("#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/rate_change_form.php'); ?>
2026-01-07 09:12:10 +05:30
<?php include('form/rate_change_history.php'); ?>
<div class="modal fade" id="modal-edit-rate-history" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header" style="background: #337ab7; color: white;">
<button type="button" class="close" data-dismiss="modal" style="color: white;">&times;</button>
<h4 class="modal-title"><i class="fa fa-edit"></i> Edit Rate History</h4>
</div>
<div class="modal-body">
<form id="editForm" onsubmit="return false;">
<input type="hidden" id="edit_history_id">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Item Name</label>
<input type="text" class="form-control" id="edit_item_name" readonly>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Modified By</label>
<input type="text" class="form-control" id="edit_modified_by" readonly>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Old Rate <span class="text-danger">*</span></label>
<input type="number" class="form-control" id="edit_old_rate" step="0.01" min="0" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>New Rate <span class="text-danger">*</span></label>
<input type="number" class="form-control" id="edit_new_rate" step="0.01" min="0" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Modified Date<span class="text-danger">*</span></label>
<input type="date" class="form-control" id="edit_modified_date" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Remarks</label>
<textarea class="form-control" id="edit_remarks" rows="3"></textarea>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">
<i class="fa fa-times"></i> Cancel
</button>
<button type="button" class="btn btn-primary" id="save_edit_history" onclick="saveEditChanges()">
<i class="fa fa-save"></i> Save Changes
</button>
</div>
</div>
</div>
</div>