ESH/questionaire_master.php

583 lines
24 KiB
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<?php include('techsyn_header.php');
mysqli_query($conn,'SET character_set_results=utf8'); ?>
<!-- Main Content Container for side bar and body-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<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">QUESTIONAIRE MASTER</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 enctype="multipart/form-data" id="task_form" method="post">
<!-- box-body-->
<div class="box-body">
<div class="row">
<div class="col-sm-6">
<table id="myTable center" class="table table-bordered order-list"
style="width:100%; padding:50px; ">
<thead>
<tr>
<th
style="padding-right: 100px; margin: 2px 0px 50px 5px; width: 60%; ">
QUESTIONS</th>
<th
style="padding-right: 100px; margin: 2px 0px 50px 5px; width: 60%; ">
QUESTIONS IN LOCAL LANGUAGE</th>
<th style="padding-right:100px; margin: 2px 0px 50px 5px; width: 60%; ">
TYPE</th>
<th style="padding-right:100px; margin: 2px 0px 50px 5px; width: 60%; ">
SEQUENCE</th>
<th style="padding-right:100px; margin: 2px 0px 50px 5px; width: 60%; ">
SECTION NAME</th>
<th style="padding-right:100px; margin: 2px 0px 50px 5px; width: 60%; ">
SUB SECTION AVAILABLE?</th>
<th style="padding-right:100px; margin: 2px 0px 50px 5px; width: 60%; ">
SUB SECTION order</th>
</tr>
</thead>
<?php
$row=null;
if(isset($_REQUEST['flex_id'])){
$sql="select * from questionaire_master_questions where question_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:40%">
<input type="hidden" name="question_id" id="question_id"
value="<?php echo $row['question_id']?>" />
<input type="text" style="width:100%" name="question"
value="<?php echo $row['question']?>" id="question"
maxlength="255" class="form-control" />
</td>
<td style="width:40%">
<input type="text" style="width:100%" name="question_local_lang"
value="<?php echo $row['question_local_lang']?>"
id="question_local_lang" maxlength="255" class="form-control" />
</td>
<td style="width:20%">
<select id="question_type" name="question_type"
class="form-control">
<option value="" selected disabled>Choose Type?</option>
<option value="covid">COVID</option>
<option value="wah">WORK AT HEIGHT</option>
<option value="ffi">FREE FROM INFACTION FORM</option>
<option value="khs">KITCHEN HYGIENE SURVEILLANCE</option>
<option value="chs">CANTEEN HYGIENE SURVEILLANCE</option>
<option value="fhi">FOOD HANDLER FREE FORM INFACTION</option>
<option value="dlf">DRIVING LICENSE MEDICAL EXAMINATION FORM
</option>
<option value="checklist">CHECKLIST COMMENTS
</option>
</select>
</td>
<td style="width:10%">
<input type="number" style="width:100%" name="question_sequence"
value="<?php echo $row['question_sequence']?>"
id="question_sequence" maxlength="255" class="form-control" />
</td>
<td style="width:40%">
<input type="text" style="width:100%" name="section_name"
value="<?php echo $row['section_name']?>" id="section_name"
maxlength="255" class="form-control" />
</td>
<td style="width:20%">
<select id="sub_section_available" name="sub_section_available"
class="form-control">
<option value="" selected disabled>sub secton available?
</option>
<option value="Y">YES</option>
<option value="N">NO</option>
</select>
</td>
<td style="width:10%">
<input type="number" style="width:100%" name="sub_section_order"
value="<?php echo $row['sub_section_order']?>"
id="sub_section_order" maxlength="255" 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>
<!--breadcrumb-->
<div class="main-content">
<div class="main-content-inner">
<!-- End of breadcrumb -->
<div class="page-content" style="margin-top: -47px">
<div id="flexigridDiv" class="table-responsive">
<form name="f1" method="post" id="flex_appointment_form"
action="bio_medical_waste_generation_excel.php">
<div id="flex1" style="width:100%">
<input type="hidden" name="flex_ambulance_id" id="flex_ambulance_id" />
</div>
</form>
<form name="export_form" method="post" id="export_form" action="">
<input type="hidden" name="pdf_actions" id="pdf_actions"
value="bio_medical_waste_generation_pdf.php" />
<input type="hidden" name="excel_actions" id="excel_actions"
value="bio_medical_waste_generation_excel.php" />
<input type="hidden" name="pdf_action" id="pdf_action"
value="biowaste_pdf.php" />
<input type="hidden" name="excel_action" id="excel_action"
value="excel_ambulance.php" />
</form>
</div>
</div>
</div><!-- /.page-content -->
</div>
</div><!-- /.main-content -->
<script type="text/javascript">
$(function() {
var w = screen.width * .90;
var h = 0;
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
$("#flex1").flexigrid({
url: 'questionaire_master_script.php',
dataType: 'json',
colModel: [{
display: 'Sr',
name: 'count',
width: w * .03,
sortable: false,
align: 'left'
},
{
display: 'Question',
name: 'question',
width: w * .40,
sortable: true,
align: 'left'
},
{
display: 'Question in LOCAL LANGUAGE',
name: 'question_local_lang',
width: w * .40,
sortable: true,
align: 'left'
},
{
display: 'TYPE',
name: 'question_type',
width: w * .11,
sortable: true,
align: 'left'
},
{
display: 'SEQUENCE',
name: 'question_sequence',
width: w * .11,
sortable: true,
align: 'left'
},
{
display: 'SECTION NAME',
name: 'section_name',
width: w * .11,
sortable: true,
align: 'left'
},
{
display: 'SUB SECTION AVILABLE',
name: 'sub_section_available',
width: w * .11,
sortable: true,
align: 'left'
},
{
display: 'SUB SECTION ORDER',
name: 'sub_section_order ',
width: w * .11,
sortable: true,
align: 'left'
},
{
display: '',
name: 'link',
width: w * .1,
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 : pdf},
// {separator: true},
{
name: 'Excel',
bclass: 'print_excel',
onpress: excel
},
{
separator: true
}
],
searchitems: [
//{display: 'Appointment Id', name : 'appointment_id',isdefault: true},
{
display: 'Question',
name: 'question'
},
],
sortname: "question_id",
// sortorder: "type_description",
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 delete_question(question_id) {
$.ajax({
url: 'questionaire_master_delete.php',
data: {
question_id: question_id
},
type: 'POST',
dataType: 'json',
success: function(data) {
if (data == 'SUCCESS') {
BootstrapDialog.alert('Questions Deleted Successfully!');
$("#flex1").flexReload();
return;
}
},
error: function(data) {
BootstrapDialog.alert('Error: Questions Not Deleted!');
return;
}
});
}
function show_save_button() {
$("#save_button").show()
$("#question_id").val("");
}
function open_question(question_id, access) {
if (access == 'V') {
$("#save_button").hide()
} else if (access == 'E')
$("#save_button").show()
$.ajax({
url: 'questionaire_master_select.php',
data: {
question_id: question_id
},
type: 'POST',
dataType: 'json',
success: function(data) {
$("#question_id").val(data.question_id);
$("#question").val(data.question);
$("#question_local_lang").val(data.question_local_lang);
$("#question_type").val(data.question_type);
$("#question_sequence").val(data.question_sequence);
$("#section_name").val(data.section_name);
$("#sub_section_available").val(data.sub_section_available);
$("#sub_section_order").val(data.sub_section_order);
// $('#modal-add-ambulance-form').modal("show");
},
error: function(data) {
BootstrapDialog.alert('Error Populating Question Details');
return;
}
});
}
function pdf() {
window.open('questionaire_master_pdf.php', 'QUESTIONS List');
}
function excel() {
window.open('questionaire_master_excel.php', 'questions List');
}
$("#new_button").on("click", function() {
$("question_id").val("");
});
</script>
<?php include('techsyn_footer.php'); ?>
</div>
<!-- End of page-content -->
</div>
</div>
</div>
<script>
function validate() {
var question = $('#question').val();
var question_type = $('#question_type').val();
var sub_section_available = $('#sub_section_available').val();
if (question == '') {
BootstrapDialog.alert('Please Enter Question.!!!');
return false;
}
if (question_type == '') {
BootstrapDialog.alert('Please Enter Question type.!!!');
return false;
}
if (sub_section_available == '') {
BootstrapDialog.alert('Please Enter Question Sub Section Available or Not.!!!');
return false;
}
save();
}
</script>
<style>
#modal-add-vaccine {
overflow-y: scroll;
}
</style>
<?php include('techsyn_footer.php'); ?>
<script type="text/javascript">
function save() {
$.ajax({
url: 'questionaire_master_save.php ',
type: "POST",
data: $("#task_form").serialize(),
success: function(data) {
// alert(data);
BootstrapDialog.alert('Question Saved Successfully.');
$("#flex1").flexReload();
return;
},
error: function(data) {
BootstrapDialog.alert('Error Saving Questions');
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>