706 lines
22 KiB
PHP
706 lines
22 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="#">Medical Items</li>
|
||
|
<li class="#">Stock Level</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_item">
|
||
|
<table id="flex1">
|
||
|
</table>
|
||
|
<input type="hidden" name="flex_item_id" id="flex_item_id" />
|
||
|
</form>
|
||
|
<form name="export_form" method="post" id="export_form" action="">
|
||
|
<input type="hidden" name="pdf_action" id="pdf_action" value="pdf_manage_item.php" />
|
||
|
<input type="hidden" name="excel_action" id="excel_action" value="excel_manage_item.php" />
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div><!-- /.page-content -->
|
||
|
</div>
|
||
|
</div><!-- /.main-content -->
|
||
|
<!-- 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>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
$(function() {
|
||
|
var w = screen.width * .90;
|
||
|
var h = 0;
|
||
|
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
|
||
|
$("#flex1").flexigrid({
|
||
|
url: 'item_list_script.php',
|
||
|
dataType: 'json',
|
||
|
colModel: [{
|
||
|
display: '',
|
||
|
name: '',
|
||
|
width: w * .1,
|
||
|
sortable: false,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Sr',
|
||
|
name: 'count',
|
||
|
width: w * .05,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Item Code',
|
||
|
name: 'item_code',
|
||
|
width: w * .1,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Item Name',
|
||
|
name: 'item_name',
|
||
|
width: w * .2,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Ailment Systems',
|
||
|
name: 'ailments',
|
||
|
width: w * .12,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Item Form ',
|
||
|
name: 'item_form_id',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Category ',
|
||
|
name: 'cat',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Usage Category',
|
||
|
name: 'medicine_usage_cat_id',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
// {
|
||
|
// display: 'Classification',
|
||
|
// name: 'medicine_usage_cat_id',
|
||
|
// width: w * .10,
|
||
|
// sortable: true,
|
||
|
// align: 'left'
|
||
|
// },
|
||
|
// {
|
||
|
// display: 'Sub Classification',
|
||
|
// name: 'sub_classification',
|
||
|
// width: w * .10,
|
||
|
// sortable: true,
|
||
|
// align: 'left'
|
||
|
// },
|
||
|
// {
|
||
|
// display: 'Composition',
|
||
|
// name: 'composition',
|
||
|
// width: w * .10,
|
||
|
// sortable: true,
|
||
|
// align: 'left'
|
||
|
// },
|
||
|
// {
|
||
|
// display: 'Indication',
|
||
|
// name: 'indication',
|
||
|
// width: w * .10,
|
||
|
// sortable: true,
|
||
|
// align: 'left'
|
||
|
// },
|
||
|
// {
|
||
|
// display: 'Contra Indication',
|
||
|
// name: 'contra_indication',
|
||
|
// width: w * .10,
|
||
|
// sortable: true,
|
||
|
// align: 'left'
|
||
|
// },
|
||
|
// {
|
||
|
// display: 'Side Effects',
|
||
|
// name: 'side_effect',
|
||
|
// width: w * .10,
|
||
|
// sortable: true,
|
||
|
// align: 'left'
|
||
|
// },
|
||
|
// {
|
||
|
// display: 'Interaction',
|
||
|
// name: 'interaction',
|
||
|
// width: w * .10,
|
||
|
// sortable: true,
|
||
|
// align: 'left'
|
||
|
// },
|
||
|
// {
|
||
|
// display: 'Item Precaution',
|
||
|
// name: 'item_precaution',
|
||
|
// width: w * .10,
|
||
|
// sortable: true,
|
||
|
// align: 'left'
|
||
|
// },
|
||
|
{
|
||
|
display: 'Alternate Item',
|
||
|
name: 'alternate_medicine',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
|
||
|
{
|
||
|
display: 'Min Indent Level',
|
||
|
name: 'min_indent_level',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
|
||
|
{
|
||
|
display: 'Max Indent Level',
|
||
|
name: 'max_indent_level',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Status',
|
||
|
name: 'status',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Require Prescription?',
|
||
|
name: 'is_prescription',
|
||
|
width: w * .10,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Reorder Qty',
|
||
|
name: 'reorder_store_level',
|
||
|
width: w * .07,
|
||
|
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: 'Item name',
|
||
|
name: 'item_name',
|
||
|
isdefault: true
|
||
|
},
|
||
|
{
|
||
|
display: 'Item Code',
|
||
|
name: 'item_code',
|
||
|
isdefault: true
|
||
|
},
|
||
|
// {
|
||
|
// display: 'Ailment Systems',
|
||
|
// name: 'ailment_sys_name',
|
||
|
// isdefault: true
|
||
|
// },
|
||
|
// {
|
||
|
// display: 'Item Form ',
|
||
|
// name: 'item_form',
|
||
|
// isdefault: true
|
||
|
// },
|
||
|
// {
|
||
|
// display: 'Category ',
|
||
|
// name: 'cat_name',
|
||
|
// isdefault: true
|
||
|
// }, {
|
||
|
// display: 'Usage Category',
|
||
|
// name: 'medicine_usage_cat_name',
|
||
|
// isdefault: true
|
||
|
// },
|
||
|
|
||
|
|
||
|
|
||
|
],
|
||
|
sortname: "item_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 pdf() {
|
||
|
window.open('ajax_pdf.php', 'Medical Item Stock');
|
||
|
}
|
||
|
|
||
|
function excel() {
|
||
|
window.open('ajax_excel.php', 'Medical Item Stock');
|
||
|
}
|
||
|
|
||
|
function add() {
|
||
|
$(".save_button").show();
|
||
|
|
||
|
$("#cat_id").val("");
|
||
|
$("#item_name").val("");
|
||
|
$("#item_code").val("");
|
||
|
$("#item_id").val("");
|
||
|
$("#remarks").val("");
|
||
|
$("#item_code").val("");
|
||
|
|
||
|
|
||
|
$("#medicine_form").val("");
|
||
|
$("#ailment_system").val("");
|
||
|
$("#reorder_store_level").val("");
|
||
|
$("#indent_percent_reorderlevel").val("");
|
||
|
|
||
|
$("#reorder_dispensary_level").val("");
|
||
|
$("#medicine_usage_cat").val("");
|
||
|
$("#salt").val("");
|
||
|
|
||
|
|
||
|
$("#unit").val("");
|
||
|
$("#ailment_system").trigger("chosen:updated");
|
||
|
$("#medicine_form").trigger("chosen:updated");
|
||
|
$("#medicine_usage_cat").trigger("chosen:updated");
|
||
|
//$("#ingredients").trigger("chosen:updated");
|
||
|
|
||
|
$("#cat_id").trigger("chosen:updated");
|
||
|
$('#modal-add-item').modal("show");
|
||
|
}
|
||
|
|
||
|
function delete_item(itemId) {
|
||
|
$("#flex_item_id").val(itemId);
|
||
|
|
||
|
BootstrapDialog.confirm('Are you sure to delete the Item?', function(result) {
|
||
|
if (result) {
|
||
|
$.ajax({
|
||
|
url: 'delete_item.php',
|
||
|
type: "POST",
|
||
|
data: $("#flex_form_item").serialize(),
|
||
|
success: function(data) {
|
||
|
if (data.indexOf("SUCCESS") != -1) {
|
||
|
BootstrapDialog.alert('Item Deleted Successfully.');
|
||
|
$("#flex1").flexReload();
|
||
|
|
||
|
} else {
|
||
|
BootstrapDialog.alert('Error Deleting Item');
|
||
|
}
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Deleting Item');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
function save_item() {
|
||
|
var sub_item_id;
|
||
|
$.ajax({
|
||
|
url: 'save_item.php',
|
||
|
type: 'POST',
|
||
|
data: $("#item_form").serialize(),
|
||
|
success: function(data) {
|
||
|
BootstrapDialog.alert('Item Saved Successfully');
|
||
|
$("#flex1").flexReload();
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Saving Item');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
$('.close').click();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
function open_item(itemId, action) {
|
||
|
$("#cat_id").val("");
|
||
|
$("#item_name").val("");
|
||
|
$("#item_id").val("");
|
||
|
$("#remarks").val("");
|
||
|
$("#status").val("");
|
||
|
//$("#unit_id").val("");
|
||
|
//$("#manufacturer").val("");
|
||
|
$("#medicine_form").val("");
|
||
|
//$("#ingredients").val("");
|
||
|
$("#ailment_system").val("");
|
||
|
$("#reorder_store_level").val("");
|
||
|
$("#indent_percent_reorderlevel").val("");
|
||
|
|
||
|
$("#reorder_dispensary_level").val("");
|
||
|
$("#medicine_usage_cat").val("");
|
||
|
$("#min_store_level").val("");
|
||
|
$("#max_indent_level").val("");
|
||
|
$("#min_indent_level").val("");
|
||
|
|
||
|
$("#min_dispensary_level").val("");
|
||
|
$("#cat").val("");
|
||
|
$("#current_rate").val("");
|
||
|
$("#salt").val("");
|
||
|
$("#unit").val("");
|
||
|
var id = "";
|
||
|
if (action == "V") {
|
||
|
$(".save_button").hide();
|
||
|
|
||
|
} else {
|
||
|
$(".save_button").show();
|
||
|
}
|
||
|
$.ajax({
|
||
|
url: 'select_item.php?item_id=' + itemId + ' ',
|
||
|
type: 'POST',
|
||
|
|
||
|
success: function(data) {
|
||
|
|
||
|
data = $.parseJSON(data);
|
||
|
$("#item_id").val(data.item_id);
|
||
|
$("#item_code").val(data.item_code);
|
||
|
$("#cat_id").val(data.cat);
|
||
|
$("#medicine_form").val(data.item_form_id);
|
||
|
$("#item_name").val(data.item_name);
|
||
|
$("#ailment_system").val('');
|
||
|
$("#ingredients").val('');
|
||
|
//$("#manufacturer").val(data.manufacturer_id);
|
||
|
$("#reorder_store_level").val(data.reorder_store_level);
|
||
|
$("#indent_percent_reorderlevel").val(data.indent_percent_reorderlevel);
|
||
|
|
||
|
$("#medicine_usage_cat").val(data.medicine_usage_cat_id);
|
||
|
$("#reorder_dispensary_level").val(data.reorder_dispensary_level);
|
||
|
$("#min_store_level").val(data.min_store_level);
|
||
|
$("#max_indent_level").val(data.max_indent_level);
|
||
|
$("#min_indent_level").val(data.min_indent_level);
|
||
|
$("#min_dispensary_level").val(data.min_dispensary_level);
|
||
|
$("#is_prescription").val((data.is_prescription == '') ? "0" : data.is_prescription);
|
||
|
$("#unit").val(data.unit_id);
|
||
|
$("#remarks").val(data.remarks);
|
||
|
$("#status").val(data.status);
|
||
|
|
||
|
if (data.active_ingredients != null) {
|
||
|
var active_ingredients = data.active_ingredients
|
||
|
dataarray = active_ingredients.split(",");
|
||
|
$("#ingredients").val(dataarray);
|
||
|
}
|
||
|
|
||
|
if (data.ailments != null) {
|
||
|
var ailment_system = data.ailments;
|
||
|
dataarray = ailment_system.split(",");
|
||
|
$("#ailment_system").val(dataarray);
|
||
|
}
|
||
|
$("#salt").val(data.salt);
|
||
|
|
||
|
$("#salt").trigger("chosen:updated");
|
||
|
$("#ailment_system").trigger("chosen:updated");
|
||
|
//$("#ingredients").trigger("chosen:updated");
|
||
|
$("#cat_id").trigger("chosen:updated");
|
||
|
//$("#manufacturer").trigger("chosen:updated");
|
||
|
$("#status").trigger("chosen:updated");
|
||
|
$("#medicine_form").trigger("chosen:updated");
|
||
|
$("#medicine_usage_cat").trigger("chosen:updated");
|
||
|
$("#unit").trigger("chosen:updated");
|
||
|
resizeChosen();
|
||
|
jQuery(window).on('resize', resizeChosen);
|
||
|
$('#modal-add-item').modal("show");
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Populating Medicine Details');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function view_item(itemId, action) {
|
||
|
$("#cat_id").val("");
|
||
|
$("#item_name").val("");
|
||
|
$("#item_id").val("");
|
||
|
$("#remarks").val("");
|
||
|
$("#status").val("");
|
||
|
//$("#unit_id").val("");
|
||
|
//$("#manufacturer").val("");
|
||
|
$("#medicine_form").val("");
|
||
|
$("#medicine_usage_cat").val("");
|
||
|
//$("#ingredients").val("");
|
||
|
$("#ailment_system").val("");
|
||
|
$("#reorder_store_level").val("");
|
||
|
$("#indent_percent_reorderlevel").val("");
|
||
|
$("#reorder_dispensary_level").val("");
|
||
|
$("#min_store_level").val("");
|
||
|
$("#max_indent_level").val("");
|
||
|
$("#min_indent_level").val("");
|
||
|
$("#min_dispensary_level").val("");
|
||
|
$("#cat").val("");
|
||
|
$("#salt").val("");
|
||
|
$("#current_rate").val("");
|
||
|
$("#unit").val("");
|
||
|
var id = "";
|
||
|
if (action == "V") {
|
||
|
$(".save_button").hide();
|
||
|
|
||
|
} else {
|
||
|
$(".save_button").show();
|
||
|
}
|
||
|
$.ajax({
|
||
|
url: 'select_item.php?item_id=' + itemId + ' ',
|
||
|
type: 'POST',
|
||
|
|
||
|
success: function(data) {
|
||
|
$('#modal-view-item').modal("show");
|
||
|
data = $.parseJSON(data);
|
||
|
$("#item_id").val(data.item_id);
|
||
|
$("#item_code_div").html(data.item_code);
|
||
|
$("#cat_id_div").html(data.cat_name);
|
||
|
$("#medicine_form_div").html(data.form_name);
|
||
|
$("#medicine_usage_cat_div").html(data.medicine_usage_cat_name);
|
||
|
$("#item_name_div").html(data.item_name);
|
||
|
$("#ailments_div").html(data.ailments);
|
||
|
$("#ingredients").val('');
|
||
|
//$("#manufacturer").val(data.manufacturer_id);
|
||
|
$("#reorder_store_level_div").html(data.reorder_store_level);
|
||
|
$("#indent_percent_reorderlevel_div").html(data.indent_percent_reorderlevel);
|
||
|
|
||
|
$("#reorder_dispensary_level_div").html(data.reorder_dispensary_level);
|
||
|
$("#min_store_level_div").html(data.min_store_level);
|
||
|
$("#min_indent_level_div").html(data.min_indent_level);
|
||
|
$("#max_indent_level_div").html(data.max_indent_level);
|
||
|
$("#min_dispensary_level_div").html(data.min_dispensary_level);
|
||
|
|
||
|
$("#unit_div").html(data.unit_name);
|
||
|
$("#remarks_div").html(data.remarks);
|
||
|
if (data.status == 1) {
|
||
|
$("#status_div").html("Active");
|
||
|
} else {
|
||
|
$("#status_div").html("Inactive");
|
||
|
}
|
||
|
if (data.status_div == 1) {
|
||
|
$("#is_prescription_div").html("Yes");
|
||
|
} else {
|
||
|
$("#is_prescription_div").html("No");
|
||
|
}
|
||
|
|
||
|
getAilymentSystem(data.ailments);
|
||
|
|
||
|
if (data.active_ingredients != null) {
|
||
|
var active_ingredients = data.active_ingredients
|
||
|
dataarray = active_ingredients.split(",");
|
||
|
$("#ingredients").val(dataarray);
|
||
|
}
|
||
|
|
||
|
/*if(data.ailments!=null){
|
||
|
var ailment_system = data.ailments;
|
||
|
dataarray=ailment_system.split(",");
|
||
|
$("#ailment_system").val(dataarray);
|
||
|
}*/
|
||
|
//$("#ailment_system").trigger("chosen:updated");
|
||
|
//$("#ingredients").trigger("chosen:updated");
|
||
|
$("#cat_id").trigger("chosen:updated");
|
||
|
//$("#manufacturer").trigger("chosen:updated");
|
||
|
$("#status").trigger("chosen:updated");
|
||
|
$("#medicine_form").trigger("chosen:updated");
|
||
|
$("#medicine_usage_cat").trigger("chosen:updated");
|
||
|
$("#unit").trigger("chosen:updated");
|
||
|
resizeChosen();
|
||
|
jQuery(window).on('resize', resizeChosen);
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Populating Medicine Details');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function check_existing_item(key_name) {
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'select_item_name.php',
|
||
|
type: 'POST',
|
||
|
data: {
|
||
|
key: key_name,
|
||
|
|
||
|
},
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
BootstrapDialog.alert('Item Names Already Exists');
|
||
|
return;
|
||
|
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert(" Error Updated Aadhar Details ");
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function getAilymentSystem(ailment_sys_id) {
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'getAilymentSystem.php',
|
||
|
type: 'POST',
|
||
|
data: {
|
||
|
ailment_sys_id: ailment_sys_id
|
||
|
},
|
||
|
async: 'false',
|
||
|
success: function(data) {
|
||
|
data = $.parseJSON(data);
|
||
|
var ailment_sys_name = "";
|
||
|
if (data.length > 0) {
|
||
|
for (var i = 0; i < data.length; i++) {
|
||
|
|
||
|
if (i + 1 == data.length) {
|
||
|
ailment_sys_name = ailment_sys_name + data[i].ailment_sys_name
|
||
|
} else {
|
||
|
ailment_sys_name = ailment_sys_name + data[i].ailment_sys_name + ","
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
$("#ailments_div").html(ailment_sys_name);
|
||
|
}
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Saving Active Ingredient');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
function save_ingredient() {
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'save_active_ingredient.php',
|
||
|
type: 'POST',
|
||
|
data: $("#ingredient_form").serialize(),
|
||
|
success: function(data) {
|
||
|
BootstrapDialog.alert('Active Ingredient Saved Successfully');
|
||
|
$("#flex1").flexReload();
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Saving Active Ingredient');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
$('.close').click();
|
||
|
}
|
||
|
|
||
|
function getIngredients(selectId) {
|
||
|
|
||
|
$.ajax({
|
||
|
url: 'select_options.php?table_name=tbl_items&idcol=item_id&namecol=item_name',
|
||
|
type: 'POST',
|
||
|
success: function(data) {
|
||
|
data = $.parseJSON(data);
|
||
|
$("#item_id").val(data.item_id);
|
||
|
},
|
||
|
error: function(data) {
|
||
|
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
</script>
|
||
|
<?php include('techsyn_footer.php'); ?>
|
||
|
<?php include('form/add_item.php');?>
|
||
|
<?php include('form/view_item.php');?>
|