285 lines
7.3 KiB
PHP
285 lines
7.3 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="active">Masters</li>
|
||
|
<li class="active">Questionnaire</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<!-- End of breadcrumb -->
|
||
|
<div class="page-content">
|
||
|
<div id="flexigridDiv" class="table-responsive">
|
||
|
<div id="flexigridDiv" class="well-sm table-responsive" style="margin-right: 5px;margin-left: 5px;height:auto; width:100%">
|
||
|
|
||
|
<form name="f1" method="post" id="flex_form_question" action="">
|
||
|
<div id="flex1" style="width: 100%"></div>
|
||
|
<input type="hidden" name="flex_question_id" id="flex_question_id" />
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</div>
|
||
|
<!-- /.page-content -->
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- /.main-content -->
|
||
|
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
//alert("screen.height:"+screen.height+",navbar.heigh:"+$("#navbar").height()+",breadcrumbs.height:"+$(".breadcrumbs").height());
|
||
|
$(function() {
|
||
|
|
||
|
var w = screen.width * .90;
|
||
|
|
||
|
var h = 0;
|
||
|
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
|
||
|
//alert(h);
|
||
|
|
||
|
$("#flex1").flexigrid({
|
||
|
url: 'questionnaire_script.php',
|
||
|
dataType: 'json',
|
||
|
colModel: [{
|
||
|
display: 'Sr',
|
||
|
name: 'count',
|
||
|
width: w * .05,
|
||
|
sortable: false,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Question',
|
||
|
name: 'question_name',
|
||
|
width: w * .30,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Question Type',
|
||
|
name: 'question_type ',
|
||
|
width: w * .14,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: 'Question Categories',
|
||
|
name: 'question_section_id',
|
||
|
width: w * .14,
|
||
|
sortable: true,
|
||
|
align: 'left'
|
||
|
},
|
||
|
{
|
||
|
display: '',
|
||
|
name: '',
|
||
|
width: w * .15,
|
||
|
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: 'Question',
|
||
|
name: 'question_name',
|
||
|
isdefault: true
|
||
|
},
|
||
|
{
|
||
|
display: 'Question Type',
|
||
|
name: 'question_type'
|
||
|
},
|
||
|
{
|
||
|
display: 'Question Categories',
|
||
|
name: 'question_categories'
|
||
|
},
|
||
|
|
||
|
|
||
|
],
|
||
|
sortname: "question_id",
|
||
|
sortorder: "asc",
|
||
|
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 pdf() {
|
||
|
window.open('pdf_hygiene_list.php');
|
||
|
}
|
||
|
|
||
|
function excel() {
|
||
|
window.location = 'excel_hygiene_list.php';
|
||
|
}
|
||
|
|
||
|
function add() {
|
||
|
|
||
|
$(".save_button").show();
|
||
|
$("#question_id").val("");
|
||
|
$("#question_name").val("");
|
||
|
$("#question_type").val("");
|
||
|
$("#question_category").val("");
|
||
|
|
||
|
|
||
|
$('#modal-add-questionnaire').modal("show");
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
function delete_questionnaire(questionId) {
|
||
|
$("#flex_question_id").val(questionId);
|
||
|
|
||
|
BootstrapDialog.confirm('Are you sure to delete the Hygiene?', function(result) {
|
||
|
if (result) {
|
||
|
$.ajax({
|
||
|
url: 'delete_question.php',
|
||
|
type: "POST",
|
||
|
data: $("#flex_form_question").serialize(),
|
||
|
success: function(data) {
|
||
|
if (data.indexOf("SUCCESS") != -1) {
|
||
|
BootstrapDialog.alert('Question Deleted Successfully.');
|
||
|
$("#flex1").flexReload();
|
||
|
|
||
|
} else {
|
||
|
BootstrapDialog.alert('Error Deleting Question');
|
||
|
}
|
||
|
return;
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Deleting Question');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
var questionId = "";
|
||
|
|
||
|
function open_questionnaire(questionId, action) {
|
||
|
var id = "";
|
||
|
if (action == "V") {
|
||
|
$(".save_button").hide();
|
||
|
|
||
|
} else {
|
||
|
$(".save_button").show();
|
||
|
}
|
||
|
$.ajax({
|
||
|
url: 'select_questionnaire.php?questionId=' + questionId + ' ',
|
||
|
type: 'POST',
|
||
|
|
||
|
success: function(data) {
|
||
|
//alert(data);
|
||
|
data = $.parseJSON(data);
|
||
|
//alert(data);
|
||
|
|
||
|
|
||
|
|
||
|
$("#question_id").val(data.question_id);
|
||
|
$("#question_name").val(data.question_name);
|
||
|
$("#question_type").val(data.question_type);
|
||
|
$("#question_category").val(data.question_section_id);
|
||
|
$("#parentQue").val(data.parent_id);
|
||
|
$("#requiredDetails").val('');
|
||
|
alert(data.requiredDetailsIds);
|
||
|
if (data.requiredDetailsIds != null) {
|
||
|
var requiredDetailsIds = data.requiredDetailsIds;
|
||
|
dataarray = requiredDetailsIds.split(",");
|
||
|
$("#requiredDetails").val(dataarray);
|
||
|
}
|
||
|
$("#requiredDetails").trigger("chosen:updated");
|
||
|
|
||
|
$('#modal-add-questionnaire').modal("show");
|
||
|
},
|
||
|
error: function(data) {
|
||
|
BootstrapDialog.alert('Error Populating Questionnaire');
|
||
|
return;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
</script>
|
||
|
<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('techsyn_footer.php'); ?>
|
||
|
<?php include('form/add_questionnaire.php'); ?>
|