1354 lines
78 KiB
PHP
1354 lines
78 KiB
PHP
<?php
|
|
// include('includes/functions.php');
|
|
$enabledSections = array();
|
|
$allSectionids = array();
|
|
//SELECT * FROM checkup_form where emp_id='$id' AND is_test_completed='Y'AND DATE (checkup_date)<DATE(NOW()-INTERVAL 24 HOUR) order by checkup_id desc limit 1
|
|
//yogi changes
|
|
|
|
$Half_Yearly_Medical_Checkup_Id = getFieldFromTable('checkup_type_id','checkup_type','checkup_type_code','Half_Yearly_Medical_Checkup');
|
|
$checkup_type_id = Null;
|
|
|
|
$get_sm1_id_sql =
|
|
|
|
$query = "SELECT * FROM checkup_form where emp_id='$id' AND is_test_completed='Y'AND DATE (checkup_date)<DATE(NOW()-INTERVAL 24 HOUR) order by checkup_id desc limit 1";
|
|
error_log("#check :" . $query);
|
|
$result = @mysqli_query($conn, $query);
|
|
$row = mysqli_fetch_array($result);
|
|
// $checkup_id = '29';
|
|
// $row['checkup_id']=29;
|
|
// echo $query;
|
|
?>
|
|
<?php
|
|
|
|
|
|
$new_sqll = "SELECT checkup_section_ids, is_test_completed, checkup_id ,checkup_type_id FROM checkup_form WHERE emp_id = '" . (isset($id) ? $id : $_REQUEST['patient_id']) . "' AND checkup_id = '" . $row['checkup_id'] . "' ";
|
|
error_log("chekup_id " . $new_sqll);
|
|
$resultl = mysqli_query($conn, $new_sqll);
|
|
if (mysqli_num_rows($resultl) > 0) {
|
|
$rowl = @mysqli_fetch_array($resultl);
|
|
// print_r($rowl);
|
|
$param_present = (explode(',', $rowl['checkup_section_ids']));
|
|
$is_test_completed = $rowl['is_test_completed'];
|
|
$checkup_id = $rowl['checkup_id'];
|
|
$checkup_type_id = $row1['checkup_type_id'];
|
|
}
|
|
if ($checkup_type_id == Null) {
|
|
$checkup_type_id = $_REQUEST['checkup_type_id'];
|
|
}
|
|
|
|
$sql11 = "select * from checkup_type where checkup_type_id='" . $checkup_type_id . "'";
|
|
error_log("sql11" . $sql11);
|
|
$result11 = @mysqli_query($conn, $sql11);
|
|
$row11 = mysqli_fetch_array($result11);
|
|
$checkup_type_section_ids = $row11['checkup_form_section_ids'];
|
|
error_log("checkup_type_id" . $checkup_type_id);
|
|
?>
|
|
|
|
<style>
|
|
#profile_link {
|
|
cursor: pointer;
|
|
}
|
|
|
|
/*
|
|
#checkup_section_header {
|
|
display: none;
|
|
} */
|
|
|
|
.button span {
|
|
font-size: 10px !important;
|
|
}
|
|
|
|
.upbutton {
|
|
text-decoration: none !important;
|
|
font-size: 10px;
|
|
font-weight: 500;
|
|
padding: 15px;
|
|
/* margin-left: 1050px; */
|
|
width: 50px;
|
|
background: #ebeef1;
|
|
cursor: pointer;
|
|
border: none;
|
|
color: black;
|
|
border-radius: 50px;
|
|
box-shadow: 10px 10px 10px -1px rgba(10, 99, 169, 0.16),
|
|
-10px -10px 10px -1px rgba(255, 255, 255, 0.70);
|
|
|
|
}
|
|
|
|
.button {
|
|
text-decoration: none !important;
|
|
font-size: 10px;
|
|
font-weight: 500;
|
|
padding: 15px;
|
|
margin: 10px !important;
|
|
width: 50px;
|
|
background: #ebeef1;
|
|
cursor: pointer;
|
|
border: none;
|
|
color: black;
|
|
border-radius: 50px;
|
|
box-shadow: 10px 10px 10px -1px rgba(10, 99, 169, 0.16),
|
|
-10px -10px 10px -1px rgba(255, 255, 255, 0.70);
|
|
|
|
}
|
|
|
|
table {
|
|
box-shadow: 1px 1px lightblue;
|
|
transition: box-shadow 1s;
|
|
}
|
|
|
|
table:hover {
|
|
box-shadow: 10px 10px lightblue;
|
|
}
|
|
|
|
input {
|
|
width: 100px;
|
|
}
|
|
|
|
th {
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* @media (min-width : 768px) .col-sm-12 {
|
|
width:
|
|
|
|
|
|
|
|
|
|
103%;
|
|
} */
|
|
|
|
input,
|
|
input::-webkit-input-placeholder {
|
|
font-size: 10px;
|
|
}
|
|
|
|
#panel-title1>a,
|
|
#panel-title1>a:active {
|
|
display: block;
|
|
font-size: 12px;
|
|
font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial,
|
|
sans-serif;
|
|
color: #337ab7;
|
|
height: 17px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
/* #panel-heading1 a:before {
|
|
font-family: 'Glyphicons Halflings';
|
|
content: "\e114";
|
|
float: right;
|
|
transition: all 0.5s;
|
|
} */
|
|
|
|
#panel-heading1.active a:before {
|
|
-webkit-transform: rotate(180deg);
|
|
-moz-transform: rotate(180deg);
|
|
transform: rotate(180deg);
|
|
}
|
|
</style>
|
|
<script>
|
|
function load_checkup_header(checkup_type_id) {
|
|
document.checkup_form_employee.submit();
|
|
}
|
|
|
|
function showHeaderSection(section_id) {
|
|
// alert("hii");
|
|
if ($("#" + section_id).prop('checked')) {
|
|
$("#pannel_" + section_id).show();
|
|
} else {
|
|
$("#pannel_" + section_id).hide();
|
|
}
|
|
console.log(section_id);
|
|
//alert(section_id);
|
|
}
|
|
|
|
function add_multi_value(ids) {
|
|
val_arr = new Array();
|
|
let idv = ids.id;
|
|
let idh = "multi" + idv;
|
|
let va = document.getElementById(idh);
|
|
val_arr = va.value.split(",");
|
|
$("#" + ids.id).val(val_arr);
|
|
$("#" + ids.id).trigger("chosen:updated");
|
|
}
|
|
</script>
|
|
|
|
|
|
<form name="checkup_form_employee" id="checkup_form_employee" method="POST">
|
|
<input type="hidden" id="checkup_section_ids" name="checkup_section_ids[]">
|
|
<div class="mainPanel">
|
|
<div class="panel-group" id="accordion">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading" id="panel-heading1" style="padding: 5px 15px;">
|
|
<h5 class="widget-title" style="display: block; font-size: 15px; color: #337ab7; height: 17px; text-decoration: none; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;">
|
|
Patient - <?= $patient_name ?> <i style="margin-left:10px; font-size: 17px;" class="fa fa-user" target="_blank" id="profile_link" onclick="open_dashboard(<?= $patient_id ?>)"></i> </h5>
|
|
<div style="float:right; margin-top:-25px">
|
|
|
|
|
|
<a class="button" id="forwardButton" tabindex="0" aria-controls="dynamic-table" data-original-title="Send To Pharmacy" title="Save " style="width: 80px; "><span style="font-size:10px;"><i class="ace-icon fa fa-save"></i> SAVE </span></a>
|
|
|
|
<input type="hidden" name="attendedStatus" id="attendedStatus" value="<?= $__STATUS_RECEPTIONIST_ATTENDED ?>" />
|
|
<input type="hidden" name="rule_param_id_onc" id="rule_param_id_onc" />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<div class="panel-body">
|
|
<div class="row">
|
|
<?php
|
|
|
|
$emp_id = $_REQUEST['patient_id'] != '' ? $_REQUEST['patient_id'] : $_REQUEST['emp_id_history'];
|
|
$sql_employee = "select * from patient_master where id='$emp_id'";
|
|
$result = mysqli_query($conn, $sql_employee);
|
|
// $checkup_id = $_REQUEST['flex_checkup_id'];
|
|
$sql_checkup = "select * from checkup_form where checkup_id='$checkup_id'";
|
|
// echo $sql_checkup;
|
|
error_log("sql_checkup" . $sql_checkup);
|
|
$checkup_result = mysqli_query($conn, $sql_checkup);
|
|
$row_checkup = mysqli_fetch_assoc($checkup_result);
|
|
while ($row_employee = mysqli_fetch_assoc($result)) {
|
|
?>
|
|
<input type="hidden" id="checkup_emp_id" name="checkup_emp_id" value="<?php echo ($_REQUEST['patient_id'] != '' && $_REQUEST['patient_id'] != null) ? $_POST['patient_id'] : $_REQUEST['emp_id_history']; ?>">
|
|
<input type="hidden" name="checkup_type_id" id="checkup_type_id" value="<?php echo $checkup_type_id ?>">
|
|
|
|
<input type="hidden" style="height: 30px;" class="col-xs-4" id="hiddenHighlighter" name="hiddenHighlighter" />
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Ticket No</th>
|
|
<!-- <th>Patient ID</th> -->
|
|
|
|
<th>Employee Code</th>
|
|
<th>Employee Name</th>
|
|
<th>Date Of Birth</th>
|
|
<th>Age</th>
|
|
<th>Employee Designation</th>
|
|
<th>Employee Department</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<?php
|
|
if ($row_checkup['ticket_no'] == null || $row_checkup['ticket_no'] == '') {
|
|
$ticket_no = creatingCheckupTicketNo();
|
|
echo $ticket_no;
|
|
} else {
|
|
$ticket_no = $row_checkup['ticket_no'];
|
|
echo $ticket_no;
|
|
}
|
|
|
|
?>
|
|
<input id="ticket_no" type="hidden" style="height: 30px" class="form-control" name="ticket_no" value="<?php echo $ticket_no ?>" />
|
|
<input type="hidden" name="pat_age" id="pat_age" value="<?= $row_employee['dob'] ?>" />
|
|
<input type="hidden" name="pat_gender" id="pat_gender" value="<?= $row_employee['gender'] ?>" />
|
|
</td>
|
|
|
|
<!-- <td> <?= $_REQUEST['patient_id'] ?></td> -->
|
|
<td> <?= $row_employee['emp_code'] ?></td>
|
|
<td> <?php echo ($row_employee['patient_name']) ?></td>
|
|
<td> <?php if ($row_employee['dob'] != '' && $row_employee['dob'] != null && $row_employee['dob'] != 0000 - 00 - 00 && $row_employee['dob'] != '1970-01-01') {
|
|
echo date_format(date_create(getDateInDbFormat($row_employee['dob'])), "d-m-Y");
|
|
} else {
|
|
echo "Not Present";
|
|
} ?></td>
|
|
<td>
|
|
<?php
|
|
$dob = $row_employee['dob'];
|
|
|
|
$c = date('Y');
|
|
$y = date('Y', strtotime($dob));
|
|
echo $c - $y;
|
|
?>
|
|
</td>
|
|
<td><?php echo $employee_designation = getTableFieldValue('designation', 'designation_name', 'designation_id', $row_employee['designation_id']); ?>
|
|
</td>
|
|
<td><?php echo getTableFieldValue('department', 'dept_name', 'dept_id', $row_employee['dept_id']); ?>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-4">
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<th>Checkup Date</th>
|
|
</tr>
|
|
<tr>
|
|
<input type="hidden" name="checkup_id" id="checkup_id" value="<?php echo $checkup_id ?>">
|
|
<input type="hidden" name="isHiperTensed" id="isHiperTensed">
|
|
<input type="hidden" name="is_test_completed" id="is_test_completed" value="Y">
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="checkdown_date" name="checkdown_date" type="text" class="form-control date-timepicker" style="height: 30px" /> <span class="input-group-addon"> <i style="height: 5px" class="fa fa-calendar-o bigger-110"></i>
|
|
</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-4">
|
|
<div style="margin-left: 10px;">
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<th>Remarks</th>
|
|
</tr>
|
|
<tr>
|
|
<td><textarea class="form-control" rows="1" name="remarks" id="remarks"><?php echo $row['remarks']; ?></textarea></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<?php $ref_field_visible = getFieldFromTable('type_state', 'checkup_type', 'checkup_type_id', $checkup_type_id);
|
|
if (!strcmp($ref_field_visible, "Yes")) {
|
|
?>
|
|
<div class="col-sm-4">
|
|
<div style="margin-left: 10px;">
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<th>Referred By</th>
|
|
</tr>
|
|
<tr>
|
|
<td><select name="ref_by_doc" id="ref_by_doc" class="form-control chosen-select">
|
|
<option value="">Select Doc Name</option>
|
|
<?= generate_options("SELECT doctor_id,trim(concat(ifnull(doctor_name,''),' ',ifnull(doctor_desc,''))) doc_name FROM doctors_master", $row_checkup['referred_by'], 'doctor_id', 'doc_name', '', ''); ?>
|
|
</select></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
</div>
|
|
</div>
|
|
<?php
|
|
// if ($_SESSION['RoleCode'] != 'RCP'){
|
|
?>
|
|
<div class="row" id="checkup_section_header">
|
|
<div class="col-sm-12">
|
|
<div style="margin-left: 10px;">
|
|
<table class="table table-bordered">
|
|
<tr>
|
|
<th colspan="4">Checkup Section Header</th>
|
|
</tr>
|
|
<tr>
|
|
<?php
|
|
$sql_section = "select * from checkup_form_section where Status='Active' and section_id in ($checkup_type_section_ids) order by display_order asc";
|
|
error_log("sql_section=" . $sql_section);
|
|
// echo $sql_section;
|
|
$count = 1;
|
|
$result_section = mysqli_query($conn, $sql_section);
|
|
while ($row_section = mysqli_fetch_assoc($result_section)) {
|
|
if ($count == 4) {
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
<tr><?php
|
|
}
|
|
?>
|
|
<td>
|
|
<input type="checkbox" id="<?php echo $row_section['section_desc']; ?>" name="<?php echo $row_section['section_id']; ?>" onclick="showHeaderSection('<?php echo $row_section['section_desc']; ?>')" <?php
|
|
array_push($allSectionids, $row_section['section_desc']);
|
|
if (mysqli_num_rows($resultl) > 0) {
|
|
foreach ($param_present as $x => $val) {
|
|
if ($val == $row_section['section_id']) {
|
|
echo 'checked';
|
|
array_push($enabledSections, $row_section['section_desc']);
|
|
}
|
|
}
|
|
}
|
|
?>>
|
|
<?php
|
|
|
|
echo $row_section['section_name'];
|
|
?>
|
|
</td>
|
|
<?php
|
|
|
|
if ($count % 3 == 0) {
|
|
?>
|
|
</tr><?php
|
|
}
|
|
$count++;
|
|
}
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
// }
|
|
?>
|
|
|
|
</div>
|
|
<?php
|
|
//yogi changes sections
|
|
$sql_checkup_parameter_range = "select * from checkup_parameter where enabled='Y' and checkup_form_section_id in ('$checkup_type_section_ids')";
|
|
$result_checkup_parameter_range = mysqli_query($conn, $sql_checkup_parameter_range);
|
|
$i = 0;
|
|
$parameter_names = array();
|
|
$starting_ranges = array();
|
|
$ending_ranges = array();
|
|
$less_risks = array();
|
|
$more_risks = array();
|
|
$less_advices = array();
|
|
$more_advices = array();
|
|
$column_names = array();
|
|
while ($row_checkup_parameter_range = mysqli_fetch_assoc($result_checkup_parameter_range)) {
|
|
$parameter_names[$i] = $row_checkup_parameter_range['parameter_name'];
|
|
$column_names[$i] = $row_checkup_parameter_range['column_name'];
|
|
$starting_ranges[$i] = $row_checkup_parameter_range['starting_range'];
|
|
$ending_ranges[$i] = $row_checkup_parameter_range['ending_range'];
|
|
$less_advices[$i] = $row_checkup_parameter_range['less_advices'];
|
|
$more_advices[$i] = $row_checkup_parameter_range['more_advices'];
|
|
$less_risks[$i] = $row_checkup_parameter_range['less_risks'];
|
|
$more_risks[$i] = $row_checkup_parameter_range['more_risks'];
|
|
$i = $i + 1;
|
|
}
|
|
?>
|
|
<?php
|
|
//$checkup_type_id = $_REQUEST['checkup_type_id_db'] != '' ? $_REQUEST['checkup_type_id_db'] : $_REQUEST['checkup_type_id'];
|
|
$sql_checkup_parameter_section = "select * from checkup_form_section where section_id in ($checkup_type_section_ids) order by display_order asc";
|
|
//$sql_checkup_parameter_section = "select section_id,section_name,section_desc from checkup_parameter a inner join checkup_form_section b on a.checkup_form_section_id=b.section_id where b.Status='Active' group by checkup_form_section_id";
|
|
// echo $sql_checkup_parameter_section;
|
|
error_log("sql_checkup_parameter_section" . $sql_checkup_parameter_section);
|
|
?>
|
|
|
|
<?php
|
|
// echo $sql_checkup_parameter_section;
|
|
$i1 = 0;
|
|
$result_checkup_parameter_section = mysqli_query($conn, $sql_checkup_parameter_section);
|
|
while ($row_checkup_parameter_section = mysqli_fetch_assoc($result_checkup_parameter_section)) {
|
|
?>
|
|
<div class="panel panel-default" id="pannel_<?php echo $row_checkup_parameter_section['section_desc'] ?>" style="display: none;">
|
|
|
|
<div class="panel-heading" id="panel-heading1">
|
|
|
|
|
|
|
|
<h5 class="panel-title" id="panel-title1">
|
|
|
|
|
|
<a role="button" data-toggle="collapse" href="#collapseOne<?php echo $i1; ?>" aria-expanded="true" aria-controls="collapseOne" style="font-size: 15px;">
|
|
<?php echo $row_checkup_parameter_section['section_name'] ?>
|
|
</a>
|
|
|
|
|
|
</h5>
|
|
<!-- <div style="float: right; margin-top:-20px;">
|
|
<a class="upbutton" id="uploadButton" tabindex="0"
|
|
onclick="upload_section_doc('<?php echo $row_checkup_parameter_section['section_id'] ?>','<?php echo $row_checkup_parameter_section['section_name'] ?>')"
|
|
aria-controls="dynamic-table" data-original-title="Upload Doc" title="Upload " align='right'
|
|
style="width: 80px;"><span style="font-size:10px;"><i
|
|
class="ace-icon fa fa-upload"></i> </span></a>
|
|
</div> -->
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="collapseOne<?php echo $i1; ?>" class="panel-collapse collapse">
|
|
<div class="panel-body">
|
|
|
|
<div style="margin-bottom: 20px" class="panel panel-default">
|
|
<?php
|
|
$checkup_section_id = $row_checkup_parameter_section['section_id'];
|
|
// echo $checkup_section_id;
|
|
$sql_questionnaire_sections = "select * from checkup_form_section where Status='Active' and section_id = $checkup_section_id";
|
|
error_log("sql_questionnaire_sections" . $sql_questionnaire_sections);
|
|
// echo $sql_questionnaire_sections;
|
|
$result_questionnaire_sections = @mysqli_query($conn, $sql_questionnaire_sections);
|
|
$countSection = 0;
|
|
$count = 0;
|
|
$j = 0;
|
|
while ($row_questionnaire_sections = @mysqli_fetch_array($result_questionnaire_sections)) {
|
|
$section_id = $row_questionnaire_sections['section_id'];
|
|
$section_desc = $row_questionnaire_sections['section_desc'];
|
|
// echo $section_desc;
|
|
$sql_questionnaire = "select * from questionnaire where question_section_id='$section_id'";
|
|
error_log("#Quetinary :" . $sql_questionnaire);
|
|
$result_questionnaire = @mysqli_query($conn, $sql_questionnaire);
|
|
$no_of__question_rows = mysqli_num_rows($result_questionnaire);
|
|
$srNo = 0;
|
|
?>
|
|
<!-- ///UPLOADED DOC SEC WISE -->
|
|
<tr>
|
|
<td colspan="4">
|
|
<!-- <div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">Supporting Documents</h3>
|
|
<span class="pull-right clickable"><i
|
|
class="glyphicon glyphicon-chevron-up"></i></span>
|
|
</div>-->
|
|
|
|
<div class="panel-heading" id="panel-heading1">
|
|
<h5 class="panel-title" id="panel-title1">
|
|
<a role="button" data-toggle="collapse" href="#supportDoc<?php echo $section_desc; ?>" aria-expanded="true" aria-controls="supportDoc">
|
|
Supporting Documents</a>
|
|
</h5>
|
|
</div>
|
|
<div id="supportDoc<?php echo $section_desc; ?>" class="panel-collapse collapse">
|
|
|
|
|
|
<table class="table table-bordered" id="medical_doc_id" style="width: 50%">
|
|
<thead>
|
|
<tr>
|
|
|
|
<th>Document Name</th>
|
|
|
|
|
|
|
|
<th>Download</th>
|
|
<?php
|
|
$hasExecuteAccess = isAccessible($_SESSION['RoleId'], $menu_key, 'E'); ?>
|
|
<?php if ($hasExecuteAccess) { ?>
|
|
<th>Delete</th>
|
|
<?php } ?>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
|
|
|
|
|
|
// echo $checkup_section_id;
|
|
|
|
$emp_id = $_REQUEST['patient_id'] != '' ? $_REQUEST['patient_id'] : $_REQUEST['emp_id_history'];
|
|
$appointment_id = isset($_POST['appoint']) ? $_POST['appoint'] : $_POST['appointment_id'];
|
|
if ($appointment_id == null || $appointment_id == '') {
|
|
$maxId = "SELECT MAX(`checkup_id`) as 'id' FROM `checkup_form`";
|
|
$result_maxId = @mysqli_query($conn, $maxId);
|
|
while ($row_maxId = @mysqli_fetch_array($result_maxId)) {
|
|
$appointment_id = ($row_maxId['id'] + 1);
|
|
}
|
|
}
|
|
//echo "shu";
|
|
error_log('apoiny' . $appointment_id);
|
|
|
|
$sql_medical_doc = "select * from checkup_section_medical_document where emp_id='" . $emp_id . "' and section_id='" . $row_checkup_parameter_section['section_id'] . "' and checkup_id = '$appointment_id' ";
|
|
|
|
error_log("idddd" . $sql_medical_doc);
|
|
// echo $emp_id;
|
|
|
|
|
|
$result_medical_doc = @mysqli_query($conn, $sql_medical_doc);
|
|
while ($row_medical_doc = @mysqli_fetch_array($result_medical_doc)) { ?>
|
|
<tr id="medical_doc_<?php echo $row_medical_doc['id'] ?>">
|
|
<td><?php echo $row_medical_doc['medical_doc_desc']; ?></td>
|
|
|
|
|
|
<td>
|
|
<a href="data:<?= $row_medical_doc['medical_doc_type'] ?>;base64,<?= base64_encode($row_medical_doc['medical_doc']) ?>" download><img src='images/pdf.png' width='35' height='35'></a>
|
|
|
|
</td>
|
|
<?php $hasReadAccess = isAccessible($_SESSION['RoleId'], $menu_key, 'R');
|
|
$hasWriteAccess = isAccessible($_SESSION['RoleId'], $menu_key, 'W');
|
|
$hasExecuteAccess = isAccessible($_SESSION['RoleId'], $menu_key, 'E'); ?>
|
|
<?php if ($hasExecuteAccess) { ?>
|
|
<td align="center" style="width: 20%">
|
|
<a href="#" class="btn-lg" data-toggle="tooltip" id="deletebtn" onclick="delete_checkup_section_document('<?php echo $row_medical_doc['id'] ?>')" title="Delete"><span class="glyphicon glyphicon-trash"></span></a>
|
|
|
|
|
|
|
|
</td>
|
|
<?php } ?>
|
|
</tr>
|
|
|
|
<?php $count++;
|
|
}
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
</table>
|
|
<!-- </div> -->
|
|
</div>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- UPLOADED DOC -->
|
|
|
|
<div class="panel-heading" id="panel-heading1">
|
|
<h5 class="panel-title" id="panel-title1">
|
|
<a role="button" data-toggle="collapse" href="#collapseOne<?php echo $section_desc; ?>" aria-expanded="true" aria-controls="collapseOne">
|
|
Questionnaire </a>
|
|
</h5>
|
|
</div>
|
|
<div id="collapseOne<?php echo $section_desc; ?>" class="panel-collapse collapse">
|
|
<div class="panel-body">
|
|
<?php if ($no_of__question_rows > 0) { ?>
|
|
<table class="table table-condensed table-bordered" width="100%" border=1 id="familyMembersTable" class="table-hover">
|
|
<tbody>
|
|
<tr bgcolor="#d3d3d3">
|
|
<th>Sr</th>
|
|
<th>Question</th>
|
|
<th>Answer</th>
|
|
</tr>
|
|
<?php
|
|
if ($no_of__question_rows > 0) {
|
|
?>
|
|
<input type="hidden" name="querowCount" id="querowCount" value="<?php echo $no_of_all_question_rows; ?>" />
|
|
<?php } else { ?>
|
|
<input type="hidden" name="querowCount" id="querowCount" value="1" />
|
|
<?php
|
|
}
|
|
?>
|
|
<?php
|
|
if ($no_of__question_rows > 0) {
|
|
while ($row_questionnaire = @mysqli_fetch_array($result_questionnaire)) {
|
|
$ques_id = $row_questionnaire['question_id'];
|
|
$sql_ans = "select * from questionnaire_ans where que_id='$ques_id' and emp_id=$emp_id";
|
|
// echo $sql_ans;
|
|
$result_ans = @mysqli_query($conn, $sql_ans);
|
|
$row_ans = @mysqli_fetch_array($result_ans);
|
|
?>
|
|
<tr id="queTableRow<?= $count; ?>">
|
|
<td> <?= $srNo + 1; ?></td>
|
|
<td><?php echo $row_questionnaire['question_name'] ?> <input name="que_id<?= $count; ?>" value="<?= $row_questionnaire['question_id'] ?>" type="hidden">
|
|
</td>
|
|
<td align="center"><?php if ($row_ans['answer'] == null || $row_ans['answer'] == "") {
|
|
echo "Not answered";
|
|
} else {
|
|
echo $row_ans['answer'];
|
|
} ?></td>
|
|
</tr>
|
|
<?php
|
|
++$count;
|
|
++$srNo;
|
|
}
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
<?php } else { ?>
|
|
<center>No Questions Available</center>
|
|
<?php } ?>
|
|
</div>
|
|
<center>
|
|
<button class="btn-primary" onclick="goto_employee_questionnaire(<?php echo $emp_id ?>);">
|
|
Edit Questionnaire</button>
|
|
</center>
|
|
</div>
|
|
<?php $countSection++; ?>
|
|
</div>
|
|
|
|
<?php
|
|
//yogi changes
|
|
error_log("yogichanges");
|
|
$sql_group_by = "SELECT count(*) as total FROM checkup_parameter WHERE checkup_form_section_id = '" . $row_checkup_parameter_section['section_id'] . "' and enabled='Y' group by group_id order by column_order asc";
|
|
// echo $sql_group_by;
|
|
$result_group_by = mysqli_query($conn, $sql_group_by);
|
|
// $data_group_by=mysqli_fetch_assoc($result_group_by);
|
|
// $no_of_tables= $data_group_by['total'];
|
|
// echo "shu".$no_of_tables[0]['total'];
|
|
$rows_no_groups = array();
|
|
$h = 0;
|
|
while ($data_group_by = mysqli_fetch_array($result_group_by)) {
|
|
$rows_no_groups[$h] = $data_group_by['total'];
|
|
$h++;
|
|
}
|
|
if ($row_checkup != null && $row_checkup != '') {
|
|
$sql_checkup_parameter_col = "select * from (select * from checkup_parameter where enabled='Y') a inner join checkup_form_key_value b on b.checkup_form_key=a.column_name where checkup_form_section_id='" . $row_checkup_parameter_section['section_id'] . "' and b.checkup_form_id='" . $row_checkup['checkup_id'] . "' order by column_order asc";
|
|
} else {
|
|
$sql_checkup_parameter_col = "select * from checkup_parameter where checkup_form_section_id='" . $row_checkup_parameter_section['section_id'] . "' and enabled='Y' order by column_order asc";
|
|
}
|
|
// echo $sql_checkup_parameter_col;
|
|
error_log("sql_checkup_parameter_col" . $sql_checkup_parameter_col);
|
|
$result_checkup_parameter_col = mysqli_query($conn, $sql_checkup_parameter_col);
|
|
$no_of_rows = mysqli_num_rows($result_checkup_parameter_col);
|
|
if ($no_of_rows == 0) {
|
|
$sql_checkup_parameter_col = "select * from checkup_parameter where checkup_form_section_id='" . $row_checkup_parameter_section['section_id'] . "' and enabled='Y' order by column_order asc";
|
|
// echo $sql_checkup_parameter_col;
|
|
$result_checkup_parameter_col = mysqli_query($conn, $sql_checkup_parameter_col);
|
|
$no_of_rows = mysqli_num_rows($result_checkup_parameter_col);
|
|
// echo $no_of_rows;
|
|
}
|
|
// $no_of_rows=ceil($no_of_rows/9);
|
|
// $no_of_rows=ceil($no_of_rows/9);
|
|
// echo $no_of_rows;
|
|
$data = array();
|
|
$count = 0;
|
|
$flag_rows = 0;
|
|
while ($row_checkup_parameter_col = mysqli_fetch_assoc($result_checkup_parameter_col)) {
|
|
$data[] = $row_checkup_parameter_col;
|
|
if ($row_checkup_parameter_col['checkup_form_section_id'] == 1 && $flag_rows == 0) {
|
|
$no_of_rows = ($no_of_rows / 10);
|
|
// echo $no_of_rows;
|
|
$flag_rows = 1;
|
|
}
|
|
}
|
|
if ($flag_rows == 0) {
|
|
$no_of_rows = ceil(count($rows_no_groups) / 3);
|
|
}
|
|
$counter = 0;
|
|
$h = 0;
|
|
$k = 0;
|
|
for ($i = 0; $i < $no_of_rows; $i++) {
|
|
?>
|
|
<div class="row">
|
|
<?php
|
|
for ($k = 0; $k < 3; $k++) {
|
|
$flag = 0;
|
|
?><div class="col-sm-4">
|
|
<div class="table-responsive" style="margin-left: 10px;">
|
|
<table class="table table-bordered">
|
|
|
|
<?php
|
|
$grp = $h + 1;
|
|
$tital = getTableFieldValue('checkup_parameter_group', 'group_tital', 'group_section', $row_checkup_parameter_section['section_id'], 'group_no', $grp);
|
|
if ($tital != '' || $tital != null) { ?>
|
|
<tr>
|
|
<td colspan="<?= $rows_no_groups[$h] ?>">
|
|
<b style=" font-size: 11px; font-weight: 600;"><?= $tital ?></b>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
<tr>
|
|
<!-- -->
|
|
|
|
|
|
<?php
|
|
for ($j = 0; $j < $rows_no_groups[$h]; $j++) {
|
|
?>
|
|
<th><?php
|
|
echo $data[$count]['parameter_name']; ?>
|
|
<a href="#" data-toggle="tooltip" data-placement="top" title="<?= $data[$count]['ref_ranges'] ?>"><i class="fa fa-info-circle"></i></a>
|
|
<?php
|
|
$count++;
|
|
if ($count == count($data)) {
|
|
$flag = 1;
|
|
break;
|
|
}
|
|
?>
|
|
</th>
|
|
<?php
|
|
}
|
|
?>
|
|
</tr>
|
|
<tr>
|
|
<?php
|
|
for ($j = 0; $j < $rows_no_groups[$h]; $j++) {
|
|
$parameter_values = $data[$counter]['parameter_value'];
|
|
if ($parameter_values != "" || $parameter_values != null) {
|
|
$parameter_values_array = explode(",", $parameter_values);
|
|
$input_type = $data[$counter]['input_type'];
|
|
|
|
if ($input_type == 'select') {
|
|
|
|
?>
|
|
<td><select id="<?= $data[$counter]['column_name'] ?>" name="<?= $data[$counter]['column_name'] ?>" style="width: 51px;">
|
|
<?php
|
|
echo "<option value='' selected >select</option>";
|
|
for ($p = 0; $p < count($parameter_values_array); $p++) {
|
|
$parameter_name = getTableFieldValue('checkup_parameter_value', 'parameter_value_name', 'parameter_value_id', $parameter_values_array[$p]);
|
|
if ($data[$counter]['checkup_form_value'] == $parameter_values_array[$p]) {
|
|
echo "<option value='" . $parameter_values_array[$p] . "' selected >" . $parameter_name . "</option>";
|
|
} else {
|
|
echo "<option value='" . $parameter_values_array[$p] . "'>" . $parameter_name . "</option>";
|
|
}
|
|
}
|
|
?>
|
|
</select></td>
|
|
<?php
|
|
} else if ($input_type == 'multiselect') {
|
|
?>
|
|
<td>
|
|
<input type="hidden" name="multi<?= $data[$counter]['column_name'] ?>" id="multi<?= $data[$counter]['column_name'] ?>" value="<?= $data[$counter]['checkup_form_value'] ?>" />
|
|
<select class="form-control chosen-select" multiple name="<?= $data[$counter]['column_name'] ?>[]" id="<?= $data[$counter]['column_name'] ?>" style="width: 51px;">
|
|
<?php
|
|
for ($p = 0; $p < count($parameter_values_array); $p++) {
|
|
$parameter_name = getTableFieldValue('checkup_parameter_value', 'parameter_value_name', 'parameter_value_id', $parameter_values_array[$p]);
|
|
echo "<option value='" . $parameter_values_array[$p] . "'>" . $parameter_name . "</option>";
|
|
}
|
|
?>
|
|
</select>
|
|
</td>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
add_multi_value(<?= $data[$counter]['column_name'] ?>);
|
|
});
|
|
</script>
|
|
<?php
|
|
}
|
|
} else {
|
|
$input_type = $data[$counter]['input_type'];
|
|
$readonly_field = $data[$counter]['readonly_field'];
|
|
if ($input_type == 'number') {
|
|
if ($readonly_field == 'N') {
|
|
?>
|
|
<td>
|
|
<input type="hidden" id="read_<?= $data[$counter]['column_name'] ?>" name="read_<?= $data[$counter]['column_name'] ?>" value="<?= $data[$counter]['checkup_parameter_id'] ?>" />
|
|
<input id="<?= $data[$counter]['column_name'] ?>" class="
|
|
form-control" readonly name="<?= $data[$counter]['column_name'] ?>" type="number" min="<?php echo $data[$counter]['starting_range']; ?>" max="<?php echo $data[$counter]['ending_range']; ?>" placeholder="<?= $data[$counter]['place_holder_name'] ?>" onchange="calculateBMI();checkRange(this.value,this.min,this.max,this.id);rule_gen(<?= $data[$counter]['checkup_parameter_id'] ?>);">
|
|
</td>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<td>
|
|
|
|
<input id="<?= $data[$counter]['column_name'] ?>" class="
|
|
form-control" name="<?= $data[$counter]['column_name'] ?>" type="number" min="<?php echo $data[$counter]['starting_range']; ?>" max="<?php echo $data[$counter]['ending_range']; ?>" placeholder="<?= $data[$counter]['place_holder_name'] ?>" onchange="calculateBMI();checkRange(this.value,this.min,this.max,this.id);rule_gen(<?= $data[$counter]['checkup_parameter_id'] ?>);">
|
|
</td>
|
|
<?php
|
|
}
|
|
} else {
|
|
if ($input_type == 'textarea') {
|
|
?>
|
|
<td><textarea id="<?= $data[$counter]['column_name'] ?>" rows="4" class="form-control" name="<?= $data[$counter]['column_name'] ?>" onchange="rule_gen(<?= $data[$counter]['checkup_parameter_id'] ?>);" placeholder="<?= $data[$counter]['place_holder_name'] ?>"> </textarea>
|
|
</td>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<td><input id="<?= $data[$counter]['column_name'] ?>" class="form-control" name="<?= $data[$counter]['column_name'] ?>" value="<?= $data[$counter]['checkup_form_value'] ?>" type="text" placeholder="<?= $data[$counter]['place_holder_name'] ?>" onchange="calculateBMI();rule_gen(<?= $data[$counter]['checkup_parameter_id'] ?>);">
|
|
</td>
|
|
<?php
|
|
}
|
|
}
|
|
}
|
|
$counter++;
|
|
if ($counter == count($data)) {
|
|
// $flag1=1;
|
|
break;
|
|
}
|
|
}
|
|
$h++;
|
|
?>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div> <?php
|
|
if ($flag == 1)
|
|
break;
|
|
}
|
|
?>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php if ($row_checkup_parameter_section['section_desc'] == "general_physical_examination") { ?>
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading" id="panel-heading1">
|
|
<h5 class="panel-title" id="panel-title1">
|
|
<a role="button" data-toggle="collapse" href="#collapsethree<?php echo $i1; ?>" aria-expanded="true" aria-controls="collapseOne"> Charts </a>
|
|
</h5>
|
|
</div>
|
|
<div id="collapsethree<?php echo $i1; ?>" class="panel-collapse collapse">
|
|
<div class="panel-body">
|
|
<div class="row">
|
|
<div class="col-sm-6" style="padding-top: 30px">
|
|
<div class="widget-box transparent">
|
|
<h4 class="widget-title lighter">
|
|
<i class="ace-icon fa fa-star orange"></i> Blood Pressure
|
|
Tracker
|
|
</h4>
|
|
<div class="widget-body">
|
|
<div class="widget-main no-padding">
|
|
<div id="canvas-holder1" style="width: 100%;">
|
|
<div class="chartjs-size-monitor">
|
|
<div class="chartjs-size-monitor-expand">
|
|
<div class=""></div>
|
|
</div>
|
|
<div class="chartjs-size-monitor-shrink">
|
|
<div class=""></div>
|
|
</div>
|
|
</div>
|
|
<canvas id="chartBP" style="display: block; width: 1013px; height: 506px;" width="1013" height="506" class="chartjs-render-monitor"></canvas>
|
|
<div id="chartjs-tooltip" class="center" style="opacity: 0; left: 527.674px; top: 88.722px; font-family: & amp; amp; amp; quot; Helvetica Neue&amp; amp; amp; quot; , Helvetica , Arial, sans-serif; font-size: 12px; font-style: normal; padding: 6px;">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>April</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><span class="chartjs-tooltip-key" style="background: rgb(255, 61, 103); border-color: rgb(255, 61, 103); border-width: 2px"></span>My
|
|
First dataset: 93</td>
|
|
</tr>
|
|
<tr>
|
|
<td><span class="chartjs-tooltip-key" style="background: rgb(5, 155, 255); border-color: rgb(5, 155, 255); border-width: 2px"></span>My
|
|
Second dataset: 2</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.widget-main -->
|
|
</div>
|
|
<!-- /.widget-body -->
|
|
</div>
|
|
<!-- /.widget-box -->
|
|
</div>
|
|
<div class="col-sm-6" style="padding-top: 30px">
|
|
<div class="widget-box transparent">
|
|
<h4 class="widget-title lighter">
|
|
<i class="ace-icon fa fa-star orange"></i> Employee Weight
|
|
Tracker
|
|
</h4>
|
|
<div class="widget-body">
|
|
<div class="widget-main no-padding">
|
|
<div id="canvas-holder2" style="width: 100%;">
|
|
<div class="chartjs-size-monitor">
|
|
<div class="chartjs-size-monitor-expand">
|
|
<div class=""></div>
|
|
</div>
|
|
<div class="chartjs-size-monitor-shrink">
|
|
<div class=""></div>
|
|
</div>
|
|
</div>
|
|
<canvas id="chartWeight" style="display: block; width: 1013px; height: 506px;" width="1013" height="506" class="chartjs-render-monitor"></canvas>
|
|
</div>
|
|
<!-- /.widget-main -->
|
|
</div>
|
|
<!-- /.widget-body -->
|
|
</div>
|
|
<!-- /.widget-box -->
|
|
</div>
|
|
</div>
|
|
<!-- PAGE CONTENT ENDS -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<?php if ($row_checkup_parameter_section['section_desc'] == "vision_tests") { ?>
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading" id="panel-heading1">
|
|
<h5 class="panel-title" id="panel-title1">
|
|
<a role="button" data-toggle="collapse" href="#collapsethree<?php echo $i1; ?>" aria-expanded="true" aria-controls="collapseOne"> Charts </a>
|
|
</h5>
|
|
</div>
|
|
<div id="collapsethree<?php echo $i1; ?>" class="panel-collapse collapse">
|
|
<div class="panel-body">
|
|
<div class="row">
|
|
<div class="col-sm-6" style="padding-top: 30px">
|
|
<div class="widget-box transparent">
|
|
<h4 class="widget-title lighter">
|
|
<i class="ace-icon fa fa-star orange"></i> Vision Tracker
|
|
</h4>
|
|
<div class="widget-body">
|
|
<div class="widget-main no-padding">
|
|
<div id="canvas-holder3" style="width: 100%;">
|
|
<div class="chartjs-size-monitor">
|
|
<div class="chartjs-size-monitor-expand">
|
|
<div class=""></div>
|
|
</div>
|
|
<div class="chartjs-size-monitor-shrink">
|
|
<div class=""></div>
|
|
</div>
|
|
</div>
|
|
<canvas id="chartVision" style="display: block; width: 1013px; height: 506px;" width="1013" height="506" class="chartjs-render-monitor"></canvas>
|
|
</div>
|
|
<!-- /.widget-main -->
|
|
</div>
|
|
<!-- /.widget-body -->
|
|
</div>
|
|
<!-- /.widget-box -->
|
|
</div>
|
|
</div>
|
|
<!-- PAGE CONTENT ENDS -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
</div>
|
|
<!-- <div class="panel-footer">
|
|
<button type="submit" onclick="validation_checkup_form();" class="btn btn-xs btn-primary">
|
|
<span class="glyphicon glyphicon-floppy-save">Save</span>
|
|
</button>
|
|
</div> -->
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
$i1++;
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
<!-- <?php include 'support_checkup_document.php' ?> -->
|
|
<?php include 'image_popup_checkup.php' ?>
|
|
<?php include 'form/upload_checkup_sec_doc.php' ?>
|
|
<style>
|
|
.row {
|
|
margin-right: 0px;
|
|
}
|
|
|
|
.ace-icon {
|
|
margin-right: unset;
|
|
}
|
|
|
|
.widget-toolbar>.widget-menu>a[data-action]>.ace-icon,
|
|
.widget-toolbar>a[data-action]>.ace-icon {
|
|
margin-right: 12px;
|
|
}
|
|
</style>
|
|
<script>
|
|
// $("#new_category0").select2({
|
|
// tags: true
|
|
// });
|
|
function add_paramter() {
|
|
//$("#aligment-model").model("show");
|
|
$("#parameter_id").val("");
|
|
$("#parameter_name").val("");
|
|
$("#parameter_description").val("");
|
|
$("#parameter_code").val("");
|
|
|
|
$('#modal-add-parameter').modal({
|
|
show: 'true'
|
|
});
|
|
|
|
}
|
|
|
|
|
|
function addTest_rows() {
|
|
|
|
$('#addTest_rows0').show();
|
|
|
|
|
|
|
|
// <input type="checkbox" id="<?php echo $row_section['section_desc']; ?>" name="<?php echo $row_section['section_id']; ?>" onclick="showHeaderSection('<?php echo $row_section['section_desc']; ?>')"
|
|
// if (mysqli_num_rows($resultl) > 0) {
|
|
// foreach ($param_present as $x => $val) {
|
|
// if ($val == $row_section['section_id']) {
|
|
// echo 'checked';
|
|
// array_push($enabledSections, $row_section['section_desc']);
|
|
// }
|
|
// }}
|
|
|
|
|
|
}
|
|
|
|
|
|
jQuery(function($) {
|
|
|
|
console.log("rolecode:<?= $_SESSION['RoleCode'] ?>");
|
|
|
|
<?php
|
|
if ($_SESSION['RoleCode'] == $__ROLE_RECEPTIONIST) { ?>
|
|
$("#forwardButton").on("click", function() {
|
|
|
|
BootstrapDialog.show({
|
|
// type: BootstrapDialog.TYPE_DEFAULT,
|
|
title: 'Save & Forward',
|
|
|
|
message: '<select class="form-control" id="forward_status" style="width:90%" >' +
|
|
// '<option value="<?= $__STATUS_MEDICAL_PENDING ?>">Save & Forward To Medical Room</option>' +
|
|
// '<option value="<?= $__STATUS_LAB_PENDING ?>">Save & Forward To Lab Room</option>' +
|
|
// '<option value="<?= $__ROLE_DOCTOR ?>">Save & Forward To Doctor</option>' +
|
|
'<option value="<?= $__STATUS_DOCTOR_PENDING ?>">Save & Forward To Doctor</option>' +
|
|
// '<option value="<?= $__ROLE_RECEPTIONIST ?>">Save Draft</option>' +
|
|
|
|
|
|
'</select>',
|
|
|
|
buttons: [{
|
|
label: 'Save & Submit',
|
|
icon: 'fa fa-save',
|
|
cssClass: 'btn-info',
|
|
action: function() {
|
|
$("#attendedStatus").val($("#forward_status").val());
|
|
|
|
|
|
// validate($("#forward_status").val());
|
|
validation_checkup_form();
|
|
$(".close").click();
|
|
}
|
|
}]
|
|
});
|
|
});
|
|
<?php } else { ?>
|
|
validate($("#forward_status").val())
|
|
<?php } ?>
|
|
});
|
|
|
|
|
|
var checkup_section_name = [];
|
|
|
|
function get_section_id() {
|
|
<?php
|
|
$sql_section = "select * from checkup_form_section where Status='Active' and section_id in ($checkup_type_section_ids) order by display_order asc";
|
|
error_log("sql_section" . $sql_section);
|
|
$result_section = mysqli_query($conn, $sql_section);
|
|
$i = 0;
|
|
while ($row_section = mysqli_fetch_assoc($result_section)) {
|
|
?>
|
|
if (document.getElementById('<?php echo $row_section['section_desc'] ?>').checked) {
|
|
checkup_section_name.push(document.getElementById('<?php echo $row_section['section_desc'] ?>').name);
|
|
}
|
|
<?php
|
|
error_log("row_section loop $i" . $row_section['section_description']);
|
|
$i++;
|
|
} ?>
|
|
$("#checkup_section_ids").val(checkup_section_name);
|
|
//alert(checkup_section_name);
|
|
/* checkup_section_name.push(section_name);
|
|
$("#checkup_section_ids").val(checkup_section_name);
|
|
alert(checkup_section_name); */
|
|
}
|
|
|
|
function calculateBMI() {
|
|
|
|
|
|
|
|
var height = $("#height").val();
|
|
|
|
var weight = $("#weight").val();
|
|
|
|
|
|
|
|
if (height != null && height != '' && weight != null && weight != '') {
|
|
|
|
height = parseFloat(height);
|
|
|
|
weight = parseFloat(weight);
|
|
|
|
if (height != 0.0) {
|
|
|
|
var bmi = (weight / (height * height)) * 100 * 100;
|
|
}
|
|
|
|
|
|
$("#bmi").val(bmi.toFixed(1));
|
|
let read_id = $("#read_bmi").val();
|
|
rule_gen(read_id);
|
|
}
|
|
}
|
|
|
|
$("input").dblclick(function() {
|
|
dblClickcolorValidation(this);
|
|
// alert("hello there!"+this.name);
|
|
|
|
});
|
|
$("select").dblclick(function() {
|
|
dblClickcolorValidation(this);
|
|
// alert("hello there!"+this.name);
|
|
|
|
});
|
|
$("textarea").dblclick(function() {
|
|
dblClickcolorValidation(this);
|
|
// alert("hello there!"+this.name);
|
|
|
|
});
|
|
|
|
|
|
// creat new array to store values
|
|
ids_value = new Array();
|
|
hiddenHighlighter = document.getElementById('hiddenHighlighter');
|
|
|
|
// double click color validaton array
|
|
function dblClickcolorValidation(id) {
|
|
ids = id;
|
|
ids_value = hiddenHighlighter.value.split(",");
|
|
console.log("stored values:" + ids_value);
|
|
// get the hidden color validation input tag
|
|
hiddenHighlighter = document.getElementById('hiddenHighlighter');
|
|
if (ids.style.borderColor == 'tomato' || ids.style.color == 'tomato') {
|
|
ids.style.borderColor = 'lightgrey';
|
|
ids.style.color = 'black';
|
|
removeItemOnce(ids_value, ids.name);
|
|
hiddenHighlighter.value = ids_value.join();
|
|
console.log(hiddenHighlighter.value);
|
|
|
|
|
|
} else {
|
|
ids.style.borderColor = 'tomato';
|
|
ids.style.color = 'tomato';
|
|
ids_value.push(ids.name);
|
|
console.log(ids_value);
|
|
hiddenHighlighter.value = ids_value.join();
|
|
console.log(hiddenHighlighter.value);
|
|
}
|
|
console.log(ids_value);
|
|
}
|
|
|
|
function checkRange(parameter_val, minv, maxv, id) {
|
|
let pv = Number.parseFloat(parameter_val);
|
|
let min_val = Number.parseFloat(minv);
|
|
let max_val = Number.parseFloat(maxv);
|
|
|
|
let ids = document.getElementById(id);
|
|
|
|
if (min_val <= pv && pv <= max_val) {
|
|
let index = ids_value.indexOf(ids.name);
|
|
if (index > -1) {
|
|
dblClickcolorValidation(ids);
|
|
}
|
|
}
|
|
|
|
if (pv < min_val && min_val != 0) {
|
|
let index = ids_value.indexOf(ids.name);
|
|
if (index == -1) {
|
|
dblClickcolorValidation(ids);
|
|
}
|
|
}
|
|
|
|
if (pv > max_val && max_val != 0) {
|
|
let index = ids_value.indexOf(ids.name);
|
|
if (index == -1) {
|
|
dblClickcolorValidation(ids);
|
|
}
|
|
}
|
|
}
|
|
|
|
function removeItemOnce(arr, value) {
|
|
var index = arr.indexOf(value);
|
|
if (index > -1) {
|
|
arr.splice(index, 1);
|
|
}
|
|
return arr;
|
|
}
|
|
|
|
|
|
$(document).ready(function() {
|
|
//option A
|
|
$("#checkup_form_employee").submit(function(e) {
|
|
e.preventDefault();
|
|
});
|
|
});
|
|
|
|
function validation_checkup_form() {
|
|
save();
|
|
}
|
|
|
|
|
|
jQuery(function($) {
|
|
if (!ace.vars['old_ie']) $('#checkdown_date').datetimepicker({
|
|
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
|
|
defaultDate: new Date(),
|
|
maxDate: new Date(),
|
|
icons: {
|
|
time: 'fa fa-clock-o',
|
|
date: 'fa fa-calendar',
|
|
up: 'fa fa-chevron-up',
|
|
down: 'fa fa-chevron-down',
|
|
previous: 'fa fa-chevron-left',
|
|
next: 'fa fa-chevron-right',
|
|
today: 'fa fa-arrows ',
|
|
clear: 'fa fa-trash',
|
|
close: 'fa fa-times'
|
|
}
|
|
}).next().on(ace.click_event, function() {
|
|
$(this).prev().focus();
|
|
});
|
|
});
|
|
|
|
function goto_employee_questionnaire(empId) {
|
|
// window.location = 'edit_employee_details.php?emp_id='+empId+'&page="checkup"';
|
|
window.open('edit_employee_details.php?emp_id=' + empId + '&page="checkup"', '_blank');
|
|
}
|
|
</script>
|
|
<?php
|
|
$sql = "select health_risk_id form checkdown_form";
|
|
$result = mysqli_query($conn, $sql);
|
|
$rw = mysqli_fetch_array($result);
|
|
|
|
?>
|
|
<?php
|
|
$is_lab_test = getFieldFromTable('type_state', 'checkup_type', 'checkup_type_id', $checkup_type_id);
|
|
error_log("is lab test: " . $is_lab_test);
|
|
if (!strcmp($is_lab_test, "No")) {
|
|
?>
|
|
<script type="text/javascript">
|
|
var js_array_enabledSections = [<?php echo '"' . implode('","', $enabledSections) . '"' ?>];
|
|
js_array_enabledSections.forEach(showHeaderSection);
|
|
|
|
$(':checkbox').attr('checked', true);
|
|
|
|
setTimeout(() => {
|
|
var js_array_checkedSections = [<?php echo '"' . implode('","', $allSectionids) . '"' ?>];
|
|
for (let i = 0; i < js_array_checkedSections.length; i++) {
|
|
// alert(js_array_checkedSections[i]);
|
|
showHeaderSection(js_array_checkedSections[i]);
|
|
}
|
|
}, 1000);
|
|
</script>
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
|
|
<script>
|
|
function rule_gen(chkupid) {
|
|
// alert(chkupid);
|
|
$("#rule_param_id_onc").val(chkupid);
|
|
$.ajax({
|
|
url: 'rule_eval.php',
|
|
type: "POST",
|
|
data: $("#checkup_form_employee").serialize(),
|
|
dataType: "json",
|
|
success: function(data) {
|
|
if (data.rows != 'undefined' && data.rows != '' && data.rows != null) {
|
|
for (var i = 0; i < data.rows.length; i = i + 2) {
|
|
// alert(data.rows[i]);
|
|
$("#" + data.rows[i]).val(data.rows[i + 1]);
|
|
|
|
}
|
|
|
|
} else {
|
|
for (var i = 0; i < data.child.length; i++) {
|
|
$("#" + data.child[i]).val("");
|
|
|
|
}
|
|
}
|
|
},
|
|
error: function(data) {
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function upload_section_doc(secId, secName) {
|
|
// alert(secName);
|
|
$('#up_sec_id').val(secId);
|
|
$('#up_sec_name').val(secName);
|
|
$('#modal-add-section-document').modal("show");
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
});
|
|
</script>
|
|
|
|
<?php error_log("end of checkup_form"); ?>
|