691 lines
24 KiB
PHP
691 lines
24 KiB
PHP
<?php include('techsyn_header.php'); ?>
|
|
<!-- Main Content Container for side bar and body-->
|
|
<?php
|
|
$rule_eq_id = $_REQUEST['flex_rule_equation_id'];
|
|
$action = $_REQUEST['toPage'];
|
|
error_log("action " . $action);
|
|
//$rule_eq_id=1;
|
|
error_log("rule_eq_id" . $rule_eq_id);
|
|
|
|
if ($rule_eq_id != Null || $rule_eq_id != "") {
|
|
|
|
$sqll1 = "select * from rule_equation where rule_eq_id='" . $rule_eq_id . "'";
|
|
|
|
error_log("sqll1" . $sqll1);
|
|
$resultl1 = mysqli_query($conn, $sqll1);
|
|
$rowl1 = mysqli_fetch_array($resultl1);
|
|
|
|
// $checkup_form_section_id = $rowl1['checkup_form_section_id'];
|
|
// error_log("checkup_form_section_id" . $checkup_form_section_id);
|
|
// $section_name = getTableFieldValue('checkup_form_section', 'section_name', 'section_id', $checkup_form_section_id);
|
|
// error_log("section_name" . $section_name);
|
|
}
|
|
|
|
?>
|
|
|
|
<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="#">Masters</li>
|
|
<li class="active">Rule Generation</li>
|
|
</ul>
|
|
</div>
|
|
<!-- End of breadcrumb -->
|
|
|
|
<div class="page-content">
|
|
<div class="box box-primary" style="padding: 10px; margin: 2px 0px 50px 5px; width: 99.5%; ">
|
|
|
|
<form name="rulegen" method="post" id="rulegen">
|
|
<!-- box-body-->
|
|
<div class="box-body" id="reload_rule">
|
|
<!-- <div class="row">
|
|
<div class="form-group col-sm-12">
|
|
<label for="firm_code"> Section Name</label>
|
|
<input type="text" name="checkup_section_id" id="checkup_section_id" disabled="" value="<?= $section_name ?>" style="width:100%" />
|
|
<input type="hidden" name="rule_eq_id" id="rule_eq_id" value="<?= $rule_eq_id ?>" />
|
|
</div>
|
|
</div> -->
|
|
<div class="row">
|
|
<input type="hidden" name="rule_eq_id" id="rule_eq_id" value="<?= $rule_eq_id ?>" />
|
|
<div class="col-sm-12">
|
|
<table id="myTable" class="table table-bordered order-list">
|
|
<thead>
|
|
<tr>
|
|
<th>Joiner</th>
|
|
<th>open bracket</th>
|
|
<th>checkup parameter</th>
|
|
<th>Condition</th>
|
|
<th>Value</th>
|
|
<th>close bracket</th>
|
|
<th>Add</th>
|
|
</tr>
|
|
</thead>
|
|
<?php $i = 0;
|
|
|
|
$sql2 = "select * from rule_save where equation_rule_id='" . $rule_eq_id . "'";
|
|
error_log("sql2" . $sql2);
|
|
$result2 = mysqli_query($conn, $sql2);
|
|
$row2 = mysqli_fetch_assoc($result2);
|
|
@extract($row2);
|
|
do {
|
|
?>
|
|
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<?php if ($i > 0) {
|
|
?>
|
|
<select id="rule_joiner_id<?= $i ?>" name="rule_joiner_id<?= $i ?>" value="<?= $row2['joiner_id']; ?>" class="form-control" style="width:100%;">
|
|
<option disabled selected>select the joiner</option>
|
|
<?php echo generateOption('rule_joiner', 'joiner_sy', 'rule_joiner_id', '', ''); ?>
|
|
</select>
|
|
<?php
|
|
}
|
|
?>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="op_br<?= $i ?>" id="op_br<?= $i ?>" value="<?= $row2['op_br']; ?>" style="width: 100%;" />
|
|
</td>
|
|
|
|
<td>
|
|
<select name="checkup_parameter_id<?= $i ?>" id="checkup_parameter_id<?= $i ?>" value="<?= $row2['checkup_parameter']; ?>" class="form-control" style="width: 100%;">
|
|
<option disabled selected>select paramter</option>
|
|
<?php echo generateOption('key_health_reportable_parameter_master', 'key_param_name', 'key_param_id', $row2['checkup_parameter'], '');
|
|
?>
|
|
|
|
</select>
|
|
</td>
|
|
|
|
<td><select id="rule_condition_id<?= $i ?>" name="rule_condition_id<?= $i ?>" value="<?= $row2['condition_id']; ?>" class="form-control" style="width:100%;">
|
|
<option disabled selected>select the condition</option> <?php echo generateOption('rule_condition', 'condition_sy', 'rule_condition_id', '', ''); ?>
|
|
</select></td>
|
|
<td><input type="text" step="any" name="value<?= $i ?>" id="value<?= $i ?>" value="<?= $row2['rule_s_val']; ?>" style="width:100%;"></td>
|
|
<td>
|
|
<input type="text" name="cl_br<?= $i ?>" id="cl_br<?= $i ?>" value="<?= $row2['cl_br']; ?>" style="width: 100%;" />
|
|
</td>
|
|
<td align="center">
|
|
<?php
|
|
if ($i == 0) { ?>
|
|
<input type="button" class="btn btn-sm btn-block " id="addrow" value="join Condition" />
|
|
<?php } else { ?>
|
|
<a href="#" class="btn-lg" data-toggle="tooltip" id="deletebtn" title="Delete"><span class="glyphicon glyphicon-trash"></span></a><?php
|
|
}
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
$i++;
|
|
} while ($row2 = mysqli_fetch_array($result2)) ?>
|
|
<input type="hidden" name="count_items" id="count_items" value="<?= $i ?>" />
|
|
|
|
</tbody>
|
|
|
|
|
|
<tfoot>
|
|
|
|
<!-- <td>RESULT PARAMETER</td> -->
|
|
<td>
|
|
<!-- <select name="result" id="result" class="form-control">
|
|
<option value="" disabled selected>select paramter</option>
|
|
<?php
|
|
$sqle = "select * from checkup_parameter where checkup_form_section_id='" . $checkup_form_section_id . "'";
|
|
error_log("sqle " . $sqle);
|
|
$resulte = mysqli_query($conn, $sqle);
|
|
while ($rowe = mysqli_fetch_array($resulte)) {
|
|
?><option value="<?php echo $rowe['checkup_parameter_id'] ?>"><?php echo $rowe['parameter_name'] ?></option><?php
|
|
} ?>
|
|
</select>-->
|
|
</td>
|
|
<td style="width:20%"><label>Age start</label><input type="number" name="rule_age_start" id="rule_age_start" value="<?= $rowl1['rule_age_start']; ?>" style="width: 100%;"></td>
|
|
<td style="width:20%"><label>Age end</label><input type="number" name="rule_age_end" id="rule_age_end" value="<?= $rowl1['rule_age_end']; ?>" style="width: 100%;"></td>
|
|
<td><label>Gender</label><select id="rule_gender" name="rule_gender" style="width: 100%" class="form-control" value="<?= $rowl1['rule_gender']; ?>">
|
|
<option disabled selected value="">Select Gender </option>
|
|
<option value="M">Male</option>
|
|
<option value="F">Female </option>
|
|
</select></td>
|
|
|
|
<td><label for="result">RESULT</label><input type="text" name="result_disp" id="result_disp" value="<?= $rowl1['result_disp']; ?>" style="width: 100%;" /></td>
|
|
<td>
|
|
<label for="abnormality">Abnormality</label>
|
|
<select name="abnormality" id="abnormality" class="form-control">
|
|
<option value="">select</option>
|
|
<?php echo generateOption('abnormality', 'abnormality_name', 'abnormality_id', $rowl1['abnormality'], '') ?>
|
|
</select>
|
|
</td>
|
|
<td width="20%">
|
|
<label for="result_param">Result Field</label>
|
|
<select name="result" id="result" class="form-control select2">
|
|
<optgroup label="With Result Field Value">
|
|
<option value="">Select</option>
|
|
<?php echo generate_options('select concat(c.parameter_name," SECTION ==> ",s.section_name) as name,c.checkup_parameter_id from checkup_parameter c left join checkup_form_section s on c.checkup_form_section_id=s.section_id where s.section_name != "" and c.input_type="number"', $rowl1['result'], 'checkup_parameter_id', 'name', '', '') ?>
|
|
</optgroup>
|
|
<optgroup label="With Result Field Value For opd-injury">
|
|
<?php echo generate_options("SELECT checkup_parameter_id,
|
|
CONCAT(IF(opd_param = 1, CONCAT('OPD => ', parameter_name,' '), ''),IF(inj_param = 1, CONCAT('INJURY => ', parameter_name,' '), ''))
|
|
AS names FROM checkup_parameter WHERE opd_param = 1 OR inj_param = 1;
|
|
", $rowl1['result'], 'checkup_parameter_id', 'names', '', ''); ?>
|
|
</optgroup>
|
|
</select>
|
|
</td>
|
|
|
|
|
|
<tr>
|
|
<td></td>
|
|
<td><label for="firm_code">Risk</label>
|
|
<select multiple="" class="select2 form-control" id="risk" name="risk[]" data-placeholder="">
|
|
<?php echo generateOption('health_risk', 'health_risk_name', 'health_risk_id', '', ''); ?>
|
|
</select>
|
|
</td>
|
|
<!-- <td>
|
|
<label for="firm_code">More Risk</label>
|
|
<select multiple="" class="select2 form-control" id="checkup_more_risk" name="checkup_more_risk[]" data-placeholder="">
|
|
<?php echo generateOption('health_risk', 'health_risk_name', 'health_risk_id', '', ''); ?>
|
|
</select>
|
|
</td> -->
|
|
<td>
|
|
<label class="control-label" for="health_advice_name">Advice</label>
|
|
<select multiple="" class="select2 form-control" id="advice" name="advice[]" data-placeholder="">
|
|
<?php echo generateOption('health_advice', 'health_advice_name', 'health_advice_id', '', ''); ?>
|
|
</select>
|
|
</td>
|
|
<!-- <td>
|
|
<label class="control-label" for="health_advice_name">More Advice</label>
|
|
<select multiple="" class="select2 form-control" id="checkup_more_advice" name="checkup_more_advice[]" data-placeholder="">
|
|
<?php echo generateOption('health_advice', 'health_advice_name', 'health_advice_id', '', ''); ?>
|
|
</select>
|
|
</td> -->
|
|
|
|
<td>
|
|
<label for="color">Choose Color</label>
|
|
<input type="color" name="color" id="color" class="form-control" value="<?= $rowl1['color'] ?>">
|
|
</td>
|
|
|
|
<td>
|
|
<label for="range-type">Range Type</label>
|
|
<select class="form-control" name="range_type" id="range_type" value="<?= $rowl1['range_type'] ?>">
|
|
<option value="" selected disabled>--select--</option>
|
|
<option value="high" <?php if (strcmp($rowl1['range_type'], 'high') == 0) {
|
|
echo "selected";
|
|
} ?>>High</option>
|
|
<option value="low" <?php if (strcmp($rowl1['range_type'], 'low') == 0) {
|
|
echo "selected";
|
|
} ?>>Low</option>
|
|
<option value="lb" <?php if (strcmp($rowl1['range_type'], 'lb') == 0) {
|
|
echo "selected";
|
|
} ?>>Lower Boundary</option>
|
|
<option value="ub" <?php if (strcmp($rowl1['range_type'], 'ub') == 0) {
|
|
echo "selected";
|
|
} ?>>Upper Boundary</option>
|
|
|
|
|
|
</select>
|
|
</td>
|
|
<td>
|
|
<label for="is_string_rule">Text Comparison Rule?</label>
|
|
<select name="is_string_rule" id="is_string_rule" class="form-control">
|
|
<option value="">--select--</option>
|
|
<option <?php if($rowl1['is_string_rule'] == 0){ echo "selected"; } ?> value="0">No</option>
|
|
<option value="1" <?php if($rowl1['is_string_rule'] == 1){ echo "selected"; } ?>>Yes</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<!-- End box-body-->
|
|
<!--box-footer-->
|
|
<?php
|
|
//change on module
|
|
//$hasWriteAccess = isAccessible($_SESSION['RoleId'], $menu_key, 'W');
|
|
// error_log("RoleId".$_SESSION['RoleId']);
|
|
$hasWriteAccess = 1;
|
|
?>
|
|
<?php if ($hasWriteAccess) { ?>
|
|
<div class="box-footer" style="text-align: center;">
|
|
<button class="btn btn-info save_button" type="button" id="save_button" onclick="validate();">
|
|
<i class="ace-icon fa fa-floppy-o bigger-110"></i>
|
|
Save
|
|
</button>
|
|
|
|
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<!--End box-footer-->
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- /.page-content -->
|
|
</div>
|
|
</div><!-- /.main-content -->
|
|
<style>
|
|
.select2-selection__choice {
|
|
white-space: break-spaces;
|
|
}
|
|
</style>
|
|
<link rel="stylesheet" href="css/select2.min.css">
|
|
<script src="js/select2.full.min.js"></script>
|
|
<script type="text/javascript">
|
|
jQuery(function($) {
|
|
$('.select2').select2()
|
|
$('#id-disable-check').on('click', function() {
|
|
var inp = $('#form-input-readonly').get(0);
|
|
if (inp.hasAttribute('disabled')) {
|
|
inp.setAttribute('readonly', 'true');
|
|
inp.removeAttribute('disabled');
|
|
inp.value = "This text field is readonly!";
|
|
} else {
|
|
inp.setAttribute('disabled', 'disabled');
|
|
inp.removeAttribute('readonly');
|
|
inp.value = "This text field is disabled!";
|
|
}
|
|
});
|
|
if (!ace.vars['touch']) {
|
|
$('.chosen-select').chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
$(window)
|
|
.off('resize.chosen')
|
|
.on('resize.chosen', function() {
|
|
$('.chosen-select').each(function() {
|
|
var $this = $(this);
|
|
$this.next().css({
|
|
'width': $this.parent().width()
|
|
});
|
|
})
|
|
}).trigger('resize.chosen');
|
|
//resize chosen on sidebar collapse/expand
|
|
$(document).on('settings.ace.chosen', function(e, event_name, event_val) {
|
|
if (event_name != 'sidebar_collapsed') return;
|
|
$('.chosen-select').each(function() {
|
|
var $this = $(this);
|
|
$this.next().css({
|
|
'width': $this.parent().width()
|
|
});
|
|
})
|
|
});
|
|
$('#chosen-multiple-style .btn').on('click', function(e) {
|
|
var target = $(this).find('input[type=radio]');
|
|
var which = parseInt(target.val());
|
|
if (which == 2) $('#form-field-select-4').addClass('tag-input-style');
|
|
else $('#form-field-select-4').removeClass('tag-input-style');
|
|
});
|
|
}
|
|
$('[data-rel=tooltip]').tooltip({
|
|
container: 'body'
|
|
});
|
|
$('[data-rel=popover]').popover({
|
|
container: 'body'
|
|
});
|
|
autosize($('textarea[class*=autosize]'));
|
|
$('textarea.limited').inputlimiter({
|
|
remText: '%n character%s remaining...',
|
|
limitText: 'max allowed : %n.'
|
|
});
|
|
//"jQuery UI Slider"
|
|
//range slider tooltip example
|
|
$("#slider-range").css('height', '200px').slider({
|
|
orientation: "vertical",
|
|
range: true,
|
|
min: 0,
|
|
max: 100,
|
|
values: [17, 67],
|
|
slide: function(event, ui) {
|
|
var val = ui.values[$(ui.handle).index() - 1] + "";
|
|
if (!ui.handle.firstChild) {
|
|
$("<div class='tooltip right in' style='display:none;left:16px;top:-6px;'><div class='tooltip-arrow'></div><div class='tooltip-inner'></div></div>")
|
|
.prependTo(ui.handle);
|
|
}
|
|
$(ui.handle.firstChild).show().children().eq(1).text(val);
|
|
}
|
|
}).find('span.ui-slider-handle').on('blur', function() {
|
|
$(this.firstChild).hide();
|
|
});
|
|
$("#slider-range-max").slider({
|
|
range: "max",
|
|
min: 1,
|
|
max: 10,
|
|
value: 2
|
|
});
|
|
$("#slider-eq > span").css({
|
|
width: '90%',
|
|
'float': 'left',
|
|
margin: '15px'
|
|
}).each(function() {
|
|
// read initial values from markup and remove that
|
|
var value = parseInt($(this).text(), 10);
|
|
$(this).empty().slider({
|
|
value: value,
|
|
range: "min",
|
|
animate: true
|
|
});
|
|
});
|
|
$("#slider-eq > span.ui-slider-purple").slider('disable'); //disable third item
|
|
$('#id-input-file-1 , #id-input-file-2').ace_file_input({
|
|
no_file: 'No File ...',
|
|
btn_choose: 'Choose',
|
|
btn_change: 'Change',
|
|
droppable: false,
|
|
onchange: null,
|
|
thumbnail: false //| true | large
|
|
//whitelist:'gif|png|jpg|jpeg'
|
|
//blacklist:'exe|php'
|
|
//onchange:''
|
|
//
|
|
});
|
|
//pre-show a file name, for example a previously selected file
|
|
//$('#id-input-file-1').ace_file_input('show_file_list', ['myfile.txt'])
|
|
//datepicker plugin
|
|
//link
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true
|
|
})
|
|
//show datepicker when clicking on the icon
|
|
.next().on(ace.click_event, function() {
|
|
$(this).prev().focus();
|
|
});
|
|
//chosen plugin inside a modal will have a zero width because the select element is originally hidden
|
|
//and its width cannot be determined.
|
|
//so we set the width after modal is show
|
|
$('#modal-form').on('shown.bs.modal', function() {
|
|
if (!ace.vars['touch']) {
|
|
$(this).find('.chosen-container').each(function() {
|
|
$(this).find('a:first-child').css('width', '210px');
|
|
$(this).find('.chosen-drop').css('width', '210px');
|
|
$(this).find('.chosen-search input').css('width', '200px');
|
|
});
|
|
}
|
|
})
|
|
/**
|
|
//or you can activate the chosen plugin after modal is shown
|
|
//this way select element becomes visible with dimensions and chosen works as expected
|
|
$('#modal-form').on('shown', function () {
|
|
$(this).find('.modal-chosen').chosen();
|
|
})
|
|
*/
|
|
$(document).one('ajaxloadstart.page', function(e) {
|
|
autosize.destroy('textarea[class*=autosize]')
|
|
$('.limiterBox,.autosizejs').remove();
|
|
$('.daterangepicker.dropdown-menu,.colorpicker.dropdown-menu,.bootstrap-datetimepicker-widget.dropdown-menu').remove();
|
|
});
|
|
});
|
|
|
|
|
|
if (<?= $rowl1['risks'] ?> != null && <?= $rowl1['risks'] ?> != '') {
|
|
var risks = '<?= $rowl1['risks'] ?>';
|
|
dataarray = risks.split(",");
|
|
$("#risk").val(dataarray);
|
|
$('#risk').trigger('chosen:updated');
|
|
}
|
|
|
|
if (<?= $rowl1['advices'] ?> != null && <?= $rowl1['advices'] ?> != '') {
|
|
var advice = '<?= $rowl1['advices'] ?>';
|
|
dataarray = advice.split(",");
|
|
$("#advice").val(dataarray);
|
|
$('#advice').trigger('chosen:updated');
|
|
}
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
var itemOptions1 = "<?php echo generateOption('rule_joiner', 'joiner_sy', 'rule_joiner_id', '', ''); ?>";
|
|
var itemOptions2 = "<?php echo generateOption('rule_condition', 'condition_sy', 'rule_condition_id', '', ''); ?>";
|
|
var rule_eq_id = "<?php echo $rule_eq_id ?>";
|
|
var action = "<?php echo $action ?>";
|
|
var cout = "<?php echo getTableFieldValue('rule_equation', 'cout', 'rule_eq_id', $rule_eq_id); ?>";
|
|
|
|
$(document).ready(function() {
|
|
var counter = $("#count_items").val();
|
|
open_user(rule_eq_id, action);
|
|
$("#addrow").on("click", function() {
|
|
// var checkup_section_id = "<?php echo $checkup_form_section_id; ?>";
|
|
// if (checkup_section_id == null || checkup_section_id == "") {
|
|
// BootstrapDialog.alert("Please select checkup section");
|
|
// } else {
|
|
selectpar1(counter);
|
|
var itemOptions = "";
|
|
var newRow = $("<tr>");
|
|
var cols = "";
|
|
cols += "<td><select ";
|
|
cols += "id=\"rule_joiner_id" + counter + "\"name=\"rule_joiner_id" + counter + "\" class=\"form-control select2\" style=\"width:100%;\"";
|
|
cols += ">";
|
|
cols += "<option disabled selected>select the joiner</option>";
|
|
cols += itemOptions1;
|
|
cols += "</select></td>";
|
|
cols += '<td><input type="text" name="op_br' + counter + '" id="op_br' + counter + '" pattern="[^(]+" style=\"width:100%;\" /></td>';
|
|
cols += "<td><select ";
|
|
cols += "id=\"checkup_parameter_id" + counter + "\"name=\"checkup_parameter_id" + counter + "\" class=\"form-control select2\" style=\"width:100%;\"";
|
|
cols += ">";
|
|
cols += itemOptions;
|
|
cols += "</select></td>";
|
|
cols += "<td><select ";
|
|
cols += "id=\"rule_condition_id" + counter + "\"name=\"rule_condition_id" + counter + "\" class=\"form-control select2\" style=\"width:100%;\"";
|
|
cols += ">";
|
|
cols += "<option disabled selected>select the condition</option>";
|
|
cols += itemOptions2;
|
|
cols += "</select></td>";
|
|
cols += '<td><input type="text" name="value' + counter + '" id="value' + counter + '" style="width:100%;"></td>';
|
|
cols += '<td><input type="text" name="cl_br' + counter + '" id="cl_br' + counter + '" pattern="[^(]+" style=\"width:100%;\" /></td>';
|
|
cols += '<td align="center"><a href="#" class="btn-lg" data-toggle="tooltip" id="deletebtn" title="Delete"><span class="glyphicon glyphicon-trash"></span></a></td>';
|
|
newRow.append(cols);
|
|
$("#myTable").append(newRow);
|
|
counter++;
|
|
$("#count_items").val(counter);
|
|
// }
|
|
});
|
|
$("#myTable").on("click", "#deletebtn", function(event) {
|
|
$(this).closest("tr").remove();
|
|
counter -= 1
|
|
$("#count_items").val(counter);
|
|
});
|
|
|
|
});
|
|
</script>
|
|
<script>
|
|
// function selectpar(checkup_section_id) {
|
|
// $("#checkup_section_id").val();
|
|
// $.ajax({
|
|
// type: "POST",
|
|
// url: "get_checkup_parameter.php",
|
|
// data: {
|
|
// 'checkup_section_id': checkup_section_id
|
|
// },
|
|
// success: function(data) {
|
|
// $("#checkup_parameter_id0").html(data);
|
|
|
|
// }
|
|
// });
|
|
// }
|
|
|
|
function selectpar1(sid) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "get_key_checkup_param_name.php",
|
|
data: {
|
|
sid: sid
|
|
},
|
|
success: function(data) {
|
|
// alert(data);
|
|
$("#checkup_parameter_id" + sid).html(data);
|
|
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
<script>
|
|
function validate() {
|
|
$.ajax({
|
|
url: 'save_rule_gen.php',
|
|
type: "POST",
|
|
data: $("#rulegen").serialize(),
|
|
success: function(data) {
|
|
BootstrapDialog.alert('Rule created sucesfully.');
|
|
$("checkup_section_id").val("");
|
|
$("checkup_parameter_id").val("");
|
|
$("rule_condition_id").val("");
|
|
$("rule_joiner_id").val("");
|
|
$("result").val("");
|
|
window.location = 'rule_generation.php';
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Rule Details');
|
|
return;
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
function refr() {
|
|
('#')
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
<script>
|
|
function open_user(rule_eq_id, action) {
|
|
if (action == "V") {
|
|
$(".save_button").hide();
|
|
|
|
} else {
|
|
$(".save_button").show();
|
|
}
|
|
|
|
|
|
$("#rule_condition_id0").val("");
|
|
|
|
$.ajax({
|
|
url: 'select_rules.php',
|
|
data: {
|
|
'rule_eq_id': rule_eq_id
|
|
},
|
|
type: 'POST',
|
|
success: function(data) {
|
|
//alert(data);
|
|
console.log(data);
|
|
var data = $.parseJSON(data);
|
|
|
|
if (cout > 1) {
|
|
// $("#checkup_parameter_id0").val(data.checkup_parameter);
|
|
// var checkup_parameter_id = data.checkup_parameter;
|
|
for (i = 0; i < cout; i++) {
|
|
$("#checkup_parameter_id" + (i)).val(data[i].checkup_parameter);
|
|
$("#rule_condition_id" + (i)).val(data[i].condition_id);
|
|
$("#rule_joiner_id" + (i)).val(data[i].joiner_id);
|
|
$("#result").val(data[i].result);
|
|
$("#rule_gender").val(data[i].rule_gender);
|
|
// $("#checkup_parameter_id1").val(data[1].checkup_parameter);
|
|
// $("#rule_condition_id1").val(data[1].condition_id);
|
|
// $("#checkup_section_id").val(data.checkup_form_section_id);
|
|
// var cfsid = data.checkup_form_section_id;
|
|
// var content = "<option value=" + data.staff_id + ">" + data.name + "</option>";
|
|
// onchange=selectpar(cfsid);
|
|
// $("#staff_id").val(data.staff_id).change();
|
|
}
|
|
} else {
|
|
$("#checkup_parameter_id0").val(data[0].checkup_parameter);
|
|
$("#rule_condition_id0").val(data[0].condition_id);
|
|
$("#result").val(data[0].result);
|
|
$("#rule_gender").val(data[0].rule_gender);
|
|
console.log(data[0].result);
|
|
$("#rule_joiner_id1").val(data[1].joiner_id);
|
|
|
|
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating User');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
// function findcheckup_parameter_id(checkup_parameter_id) {
|
|
// $("#checkup_parameter_id0").val();
|
|
// $.ajax({
|
|
// type:"POST",
|
|
// url:"get_checkup_parameter.php",
|
|
// data:{'checkup_parameter_id':checkup_parameter_id},
|
|
// success:function(data2){
|
|
// var data2 = $.parseJSON(data2);
|
|
// $("#checkup_parameter_id0").val(data2.parameter_name);
|
|
// console.log(data2.parameter_name);
|
|
// },
|
|
// error: function(data) {
|
|
// BootstrapDialog.alert('Error Populating User');
|
|
// return;
|
|
// }
|
|
// });
|
|
// }
|
|
</script>
|
|
|
|
|
|
|
|
<script src="assets/js/select2.min.js"></script>
|
|
|
|
<script>
|
|
(function(i, s, o, g, r, a, m) {
|
|
i['GoogleAnalyticsObject'] = r;
|
|
i[r] = i[r] || function() {
|
|
|
|
(i[r].q = i[r].q || []).push(arguments)
|
|
}, i[r].l = 1 * new Date();
|
|
a = s.createElement(o),
|
|
|
|
m = s.getElementsByTagName(o)[0];
|
|
a.async = 1;
|
|
a.src = g;
|
|
m.parentNode.insertBefore(a, m)
|
|
|
|
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
|
|
|
|
|
|
|
|
ga('create', 'UA-38894584-2', 'auto');
|
|
|
|
ga('send', 'pageview');
|
|
$('.select2').select2()
|
|
|
|
$(document).one('ajaxloadstart.page', function(e) {
|
|
|
|
//in ajax mode, remove remaining elements before leaving page
|
|
|
|
try {
|
|
|
|
$('.editable').editable('destroy');
|
|
|
|
} catch (e) {}
|
|
|
|
$('[class*=select2]').remove();
|
|
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|