591 lines
15 KiB
PHP
591 lines
15 KiB
PHP
<?php include('techsyn_header.php'); ?>
|
||
<!-- Main Content Container for side bar and body-->
|
||
<!-- <link rel="stylesheet" href="assets/css/select2.min.css" /> -->
|
||
<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 Chart Generator</li>
|
||
</ul>
|
||
</div>
|
||
<!-- End of breadcrumb -->
|
||
|
||
|
||
<!--Edit form start-->
|
||
|
||
<div class="page-content">
|
||
<div id="user-profile-2">
|
||
<form role="form" id="rule_chart_form" name="rule_chart_form" action="#" method="post" enctype=â€<C3A2>multipart/form-dataâ€<C3A2>>
|
||
<div class="box box-primary">
|
||
<div class="box-header with-border">
|
||
<h4 class="box-title">Rule Chart Form</h4>
|
||
</div>
|
||
<div class="box-body">
|
||
<div id="user-profile-1" class="user-profile row">
|
||
|
||
|
||
|
||
<!-- /.col -->
|
||
<div class="col-xs-12 col-sm-12 ">
|
||
|
||
<div class="row">
|
||
<div class="col-sm-6">
|
||
<div class="form-group">
|
||
|
||
<label for="role">Chart Name</label>
|
||
|
||
|
||
<select name="chart_name" id="chart_name" class="form-control chosen-select">
|
||
<option value="" disabled selected>Select the parameter name</option>
|
||
<?php echo generate_options('select checkup_parameter_id , trim(concat(parameter_name,"--SECTION NAME--",section_name))as name from checkup_parameter a left join checkup_form_section b on a.checkup_form_section_id = b.section_id', '', 'checkup_parameter_id', 'name', '', '');
|
||
?>
|
||
<!-- <?php echo generateOption('checkup_parameter', 'parameter_name', 'checkup_parameter_id', '', '');
|
||
?> -->
|
||
</select>
|
||
|
||
<input type="hidden" class="form-control" name="flex_chart_id" id="flex_chart_id" />
|
||
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-sm-6">
|
||
<div class="form-group">
|
||
<label for="ailment">Rule Equation ID'S</label>
|
||
|
||
<select name="rule_equation_ids[]" id="rule_equation_ids" placeholder="Enter Chart Name" class="form-control chosen-select" multiple="multiple">
|
||
|
||
<?php echo generateOption('rule_equation', 'result_disp', 'rule_eq_id', '', '');
|
||
?>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
<div class="row">
|
||
<div class="col-sm-6">
|
||
<div class="form-group">
|
||
<label for="role">Checkup Section</label>
|
||
<select name="checkup_section" id="checkup_section" class="form-control chosen-select">
|
||
<option value="" disabled selected>Select the checkup section</option>
|
||
<?php echo generateOption('checkup_form_section', 'section_name', 'section_id', '', '');
|
||
?>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="col-sm-6">
|
||
<div class="form-group">
|
||
<label for="role">Age Batch ID</label> <input type="text" autofocus="autofocus" class="form-control" name="age_batch_id" id="age_batch_id" onkeypress="return blockSpecialChar(event)" placeholder="Enter OHC Pin Code" maxlength="100" required />
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<!--<div class="col-sm-3" style="margin-left:4px;" >
|
||
<div class="form-group">
|
||
<label for="role">Fax</label>
|
||
<input type="text" autofocus="autofocus" class="form-control" name="fax"
|
||
id="fax" onkeypress="return blockSpecialChar(event)" placeholder="Enter OHC Fax" maxlength="100" required/>
|
||
</div>
|
||
</div> -->
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
<!-- /.row -->
|
||
|
||
<div class="space-4"></div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<!-- /.row -->
|
||
|
||
</div>
|
||
<!-- /.box-body -->
|
||
<div class="box-footer" style="text-align: center">
|
||
<button class="btn btn-primary" id="save_ohc_type_butt" type="button" onclick="validate();">
|
||
<i class="ace-icon fa fa-floppy-o bigger-160"></i> Save
|
||
</button>
|
||
|
||
|
||
<button class="btn btn-warning new_button" type="reset" id="new_button" onclick="add();">
|
||
<i class="ace-icon fa fa-undo bigger-110"></i>New
|
||
</button>
|
||
</div>
|
||
<div class="space-4"></div>
|
||
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<!-- end user profile2 -->
|
||
</div>
|
||
|
||
|
||
|
||
<!--Edit form end-->
|
||
|
||
<div class="page-content">
|
||
<div id="flexigridDiv" class="table-responsive">
|
||
|
||
<form name="f1" method="post" action="" id="flex_form_role">
|
||
<div id="flex1" style="width: 100%"></div>
|
||
<input type="hidden" name="flex_role_id" id="flex_role_id" />
|
||
</form>
|
||
<form name="export_form" method="post" id="export_form" action="">
|
||
<input type="hidden" name="flex_role_id" id="flex_role_id" /> <input type="hidden" name="pdf_action" id="pdf_action" value="pdf_ohc_type_list.php" /> <input type="hidden" name="excel_action" id="excel_action" value="excel_ohc_type_list.php" />
|
||
</form>
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
<!-- /.page-content -->
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</div>
|
||
<!-- /.main-content -->
|
||
|
||
|
||
|
||
|
||
<script type="text/javascript">
|
||
//for removing photo
|
||
$(document).on("click", "#reset_butt_ohc_form", function() {
|
||
$("#avatar").attr("src", "images/no_image.png");
|
||
});
|
||
$(document).on("click", ".ace-icon.fa.fa-search-plus.bigger-130", function() {
|
||
$("#save_ohc_type_butt").hide();
|
||
});
|
||
$(document).on("click", ".ace-icon.fa.fa-pencil.bigger-130", function() {
|
||
|
||
$("#save_ohc_type_butt").show();
|
||
});
|
||
|
||
$(function() {
|
||
var w = screen.width * .90;
|
||
|
||
var h = 0;
|
||
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
|
||
$("#flex1").flexigrid({
|
||
url: 'rule_chart_gen_script.php',
|
||
dataType: 'json',
|
||
colModel: [
|
||
|
||
{
|
||
display: 'Sr',
|
||
name: 'count',
|
||
width: w * .07,
|
||
sortable: false,
|
||
align: 'left'
|
||
},
|
||
|
||
{
|
||
display: '',
|
||
name: 'link',
|
||
width: w * .08,
|
||
sortable: false,
|
||
align: 'left'
|
||
},
|
||
|
||
{
|
||
display: 'Chart Name',
|
||
name: 'chart_name',
|
||
width: w * .2,
|
||
sortable: true,
|
||
align: 'left'
|
||
},
|
||
|
||
{
|
||
display: 'RULE EQUATION IDs',
|
||
name: 'rule_equation_ids',
|
||
width: w * .2,
|
||
sortable: true,
|
||
align: 'left'
|
||
},
|
||
{
|
||
display: 'CHECKUP PARAMETER ID',
|
||
name: 'parameter_id',
|
||
width: w * .2,
|
||
sortable: true,
|
||
align: 'left'
|
||
},
|
||
{
|
||
display: 'CHECKUP SECTION',
|
||
name: 'checkup_section',
|
||
width: w * .2,
|
||
sortable: true,
|
||
align: 'left'
|
||
},
|
||
{
|
||
display: 'AGE BATCH ID',
|
||
name: 'age_batch_id',
|
||
width: w * .2,
|
||
sortable: true,
|
||
align: 'left'
|
||
},
|
||
|
||
|
||
//{display: 'Added By', name: '', width: w*.2, sortable: true, align: 'left'},
|
||
//{display: '', name: '', width: w*.3, sortable: false, 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: 'Chart Name',
|
||
name: 'chart_name',
|
||
isdefault: true
|
||
},
|
||
{
|
||
display: 'RULE EQUATION IDs',
|
||
name: 'rule_equation_ids'
|
||
},
|
||
{
|
||
display: 'CHECKUP PARAMETER ID',
|
||
name: 'parameter_id'
|
||
},
|
||
{
|
||
display: 'CHECKUP SECTION',
|
||
name: 'checkup_section'
|
||
},
|
||
{
|
||
display: 'AGE BATCH ID',
|
||
name: 'age_batch_id'
|
||
},
|
||
|
||
],
|
||
sortname: "chart_name",
|
||
sortorder: "asc",
|
||
usepager: true, //pagination
|
||
|
||
useRp: true,
|
||
rp: 25, //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', "Ohc Type List");
|
||
}
|
||
|
||
function excel() {
|
||
window.open('ajax_excel.php', "Ohc Type List");
|
||
}
|
||
|
||
function add() {
|
||
$(".save_button").show();
|
||
$("#chart_name").val("");
|
||
$("#rule_equation_ids").val("");
|
||
$("#parameter_id").val("");
|
||
$("#age_batch_id").val("");
|
||
$("#checkup_section").val("");
|
||
$("#flex_chart_id").val("");
|
||
setChosenUpdatedMultiple("rule_equation_ids", "");
|
||
// $('#modal-add-ohc_type').modal("show");
|
||
}
|
||
|
||
|
||
function save_ohc_type() {
|
||
|
||
// var formData = new FormData($("#rule_chart_form")[0]);
|
||
$.ajax({
|
||
url: 'save_chart_type.php',
|
||
type: 'POST',
|
||
data: $("#rule_chart_form").serialize(),
|
||
success: function(data) {
|
||
BootstrapDialog.alert('OHC Type Saved Successfully.');
|
||
$("#flex1").flexReload();
|
||
return;
|
||
},
|
||
error: function(data) {
|
||
BootstrapDialog.alert('Error Saving In OHC Type ');
|
||
return;
|
||
}
|
||
|
||
});
|
||
|
||
// $.ajax({
|
||
// url : 'save_ohc_type.php',
|
||
// type : "POST",
|
||
// data : $("#rule_chart_form").serialize(),
|
||
// success : function(data) {
|
||
// BootstrapDialog.alert('OHC Type Saved Successfully.');
|
||
// $("#flex1").flexReload();
|
||
// return;
|
||
// },
|
||
// error : function(data) {
|
||
// BootstrapDialog.alert('Error Saving In OHC Type ');
|
||
// return;
|
||
// }
|
||
// });
|
||
|
||
$('.close').click();
|
||
}
|
||
|
||
|
||
|
||
function delete_rule_chart(chart_id) {
|
||
$("#flex_chart_id").val(chart_id);
|
||
|
||
BootstrapDialog.confirm('Are you sure to delete the Rule chart?', function(result) {
|
||
if (result) {
|
||
$.ajax({
|
||
url: 'delete_rulechart.php',
|
||
type: "POST",
|
||
data: $("#rule_chart_form").serialize(),
|
||
success: function(data) {
|
||
if (data.indexOf("SUCCESS") != -1) {
|
||
BootstrapDialog.alert('Rule chart Deleted Successfully.');
|
||
$("#flex1").flexReload();
|
||
|
||
} else {
|
||
BootstrapDialog.alert('Error Deleting Rule chart');
|
||
}
|
||
return;
|
||
},
|
||
error: function(data) {
|
||
BootstrapDialog.alert('Error Deleting Designation');
|
||
return;
|
||
}
|
||
});
|
||
}
|
||
});
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
var role_id = "";
|
||
|
||
function open_ohc_type(chart_id, action) {
|
||
// var ohc_type_id = "";
|
||
$("#flex_chart_id").val(chart_id);
|
||
if (action == "V") {
|
||
$(".save_button").hide();
|
||
|
||
} else {
|
||
$(".save_button").show();
|
||
}
|
||
$.ajax({
|
||
//select_designation.php?designationId='+designationId+'
|
||
url: 'select_rulechart_type.php?chart_id=' + chart_id + ' ',
|
||
type: 'POST',
|
||
// data:{'ohc_type_id':ohc_type_id},
|
||
dataType: "json",
|
||
success: function(data) {
|
||
// alert(data.parseJSON());
|
||
//alert("sucess");
|
||
// alert(data);
|
||
$("#flex_chart_id").val(data.chart_id);
|
||
$("#chart_name").val(data.checkup_parameter_id);
|
||
$("#chart_name").trigger('chosen:updated');
|
||
$("#rule_equation_ids").val(data.rule_equation_ids);
|
||
|
||
$("#parameter_id").val(data.parameter_id);
|
||
$("#checkup_section").val(data.checkup_section);
|
||
$("#checkup_section").trigger('chosen:updated');
|
||
$("#age_batch_id").val(data.age_batch_id);
|
||
setChosenUpdatedMultiple("rule_equation_ids", data.rule_equation_ids);
|
||
},
|
||
error: function(data) {
|
||
BootstrapDialog.alert('Error In Pulling Rule Type');
|
||
return;
|
||
}
|
||
});
|
||
}
|
||
</script>
|
||
<script>
|
||
var loadFile = function(event) {
|
||
var output = document.getElementById('avatar');
|
||
output.src = URL.createObjectURL(event.target.files[0]);
|
||
output.onload = function() {
|
||
URL.revokeObjectURL(output.src)
|
||
}
|
||
};
|
||
$("#primary_phone").change(function(e) {
|
||
e.preventDefault();
|
||
var keyObj = $("#primary_phone");
|
||
var maxLength = parseInt(keyObj.attr('data-max'));
|
||
if ((keyObj).val().length !== maxLength) {
|
||
BootstrapDialog.alert("Phone Number should be of 10 digits");
|
||
$(this).val('');
|
||
}
|
||
});
|
||
|
||
function validateEmail(email) {
|
||
const re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||
return re.test(email);
|
||
}
|
||
|
||
$("#primary_email").change(function(e) {
|
||
e.preventDefault();
|
||
const keyObj = $("#primary_email").val();
|
||
if (!validateEmail(keyObj)) {
|
||
BootstrapDialog.alert("Enter Valid Email ID");
|
||
$(this).val('');
|
||
}
|
||
|
||
});
|
||
|
||
function blockSpecialChar(e) {
|
||
var k;
|
||
document.all ? k = e.keyCode : k = e.which;
|
||
return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8 || k == 45 || k == 32 || (k >= 48 && k <= 57));
|
||
}
|
||
|
||
function validate() {
|
||
var ailment_name = $('#ohc_type_name').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter Ailment Name.!!!');
|
||
return false;
|
||
}
|
||
var ailment_name = $('#ohc_desc').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter Description.!!!');
|
||
return false;
|
||
}
|
||
var ailment_name = $('#ship_address').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter Shipping Address.!!!');
|
||
return false;
|
||
}
|
||
var ailment_name = $('#bill_address').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter Billing Address.!!!');
|
||
return false;
|
||
}
|
||
var ailment_name = $('#ohc_code').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter Ohc Code.!!!');
|
||
return false;
|
||
}
|
||
var ailment_name = $('#state').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter State.!!!');
|
||
return false;
|
||
}
|
||
var ailment_name = $('#pin_code').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter Pin Code.!!!');
|
||
return false;
|
||
}
|
||
//var ailment_name = $('#fax').val();
|
||
// if(ailment_name == ''){
|
||
// BootstrapDialog.alert('Please Enter Fax.!!!');
|
||
// return false;
|
||
// }
|
||
var ailment_name = $('#primary_phone').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter Phone.!!!');
|
||
return false;
|
||
}
|
||
var ailment_name = $('#primary_email').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter Email.!!!');
|
||
return false;
|
||
}
|
||
var ailment_name = $('#ohc_website').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter Website.!!!');
|
||
return false;
|
||
}
|
||
|
||
var ailment_name = $('#gstin').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Enter GSTIN NO.!!!');
|
||
return false;
|
||
}
|
||
|
||
var ailment_name = $('#width').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please Width.!!!');
|
||
return false;
|
||
}
|
||
|
||
var ailment_name = $('#height').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please height.!!!');
|
||
return false;
|
||
}
|
||
|
||
var ailment_name = $('#background-color').val();
|
||
if (ailment_name == '') {
|
||
BootstrapDialog.alert('Please background-color.!!!');
|
||
return false;
|
||
}
|
||
|
||
// var ailment_name = $('#icon_text').val();
|
||
// if(ailment_name == ''){
|
||
// BootstrapDialog.alert('Please Enter Icon Text.!!!');
|
||
// return false;
|
||
// }
|
||
// var ailment_name = $('#icon_color').val();
|
||
// if(ailment_name == ''){
|
||
// BootstrapDialog.alert('Please Enter Icon Color.!!!');
|
||
// return false;
|
||
// }
|
||
|
||
save_ohc_type();
|
||
}
|
||
</script>
|
||
|
||
|
||
|
||
<?php include('techsyn_footer.php'); ?>
|