192 lines
6.5 KiB
PHP
192 lines
6.5 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'); ?>
|
|
<?php
|
|
error_reporting ( E_ERROR | E_PARSE );
|
|
$id = ($_REQUEST ['flex_opd_id'] != '' && $_REQUEST ['flex_opd_id'] != null) ? $_POST ['flex_opd_id'] : $_REQUEST ['emp_id_history'];
|
|
// echo $id;
|
|
$query = "select * from patient_master where id = '" . $id . "' ";
|
|
error_log("topquery ".$id);
|
|
// echo $query;
|
|
if (! $result = @mysqli_query($conn, $query )) {
|
|
exit ( mysqli_error($conn) );
|
|
} else {
|
|
$row = @mysqli_fetch_array ( $result );
|
|
@extract ( $row );
|
|
}
|
|
|
|
?>
|
|
<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">Rules</li>
|
|
</ul>
|
|
</div>
|
|
<div class="row" id="sickness_form_id">
|
|
<div class="col-xs-12">
|
|
<div class="widget-box">
|
|
<div class="widget-body">
|
|
<div class="widget-main">
|
|
<div class="row">
|
|
<div style="margin: 5px;">
|
|
<div class="tabbable">
|
|
<ul class="nav nav-tabs" id="myTab">
|
|
<li class="active"><a data-toggle="tab" href="#appointment"
|
|
aria-expanded="false"> Check-up-Parameter Form <span
|
|
class="badge badge-success">+</span>
|
|
</a></li>
|
|
|
|
|
|
<?php if (isset($_REQUEST['returnPage'])) { ?>
|
|
<div class="dt-buttons btn-overlap btn-group"
|
|
style="margin-left: 608px; margin-top: 2px">
|
|
<a
|
|
href="<?= $_REQUEST['returnPage'] . '&backButon=back' ?>"
|
|
class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold save_button">Back</a>
|
|
<?php } ?>
|
|
</div>
|
|
</ul>
|
|
<div class="tab-content">
|
|
<div id="appointment" class="tab-pane fade in active ">
|
|
<?php
|
|
error_log("going into checkup_form");
|
|
include('rule_form.php'); ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--end tab table-->
|
|
</div>
|
|
<!--end of inner row-->
|
|
</div>
|
|
<!--end of widget-main -->
|
|
</div>
|
|
<!--end of inner widgetbody-->
|
|
</div>
|
|
<!--end of inner widgetbox-->
|
|
</div>
|
|
<!--end of xs-->
|
|
</div>
|
|
<!--end of inner widgetbody-->
|
|
</div>
|
|
</div>
|
|
<!--end of outer col-xs-12">-->
|
|
</div>
|
|
<!--end of outer row-->
|
|
</div>
|
|
<script>
|
|
<?php error_log("function start in checkup");?>
|
|
function save() {
|
|
//alert(" gfgdgdg");
|
|
get_section_id();
|
|
$.ajax({
|
|
url: 'save_checkup_form.php',
|
|
type: "POST",
|
|
data: $("#checkup_form_employee").serialize(),
|
|
success: function(data) {
|
|
if(data.indexOf("FAILURE")!=-1){
|
|
BootstrapDialog.alert('Error Saving Checkup Form :Select the checkup_section_ids.');
|
|
}
|
|
else
|
|
{
|
|
var checkId = JSON.parse(data);
|
|
if ($("#checkup_id").val() == "") {
|
|
var history_record = $("#history_record").text();
|
|
$('#history_record').text(parseInt(history_record) + 1);
|
|
}
|
|
$("#checkup_id").val(checkId);
|
|
console.log(JSON.stringify(checkId));
|
|
//$("#flex1").flexReload();
|
|
BootstrapDialog.alert('Checkup Form Saved Successfully.');
|
|
opens(checkId);
|
|
<?php if ($_SESSION['RoleCode'] == 'RCP') {
|
|
echo "location.replace('" . $_SESSION['role_home_page'] . "')";
|
|
}?>
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Checkup Form');
|
|
return;
|
|
}
|
|
});
|
|
// $('.close').click();
|
|
}
|
|
var flex_checkup_id = "<?php echo $_REQUEST['flex_checkup_id']; ?>"
|
|
if (flex_checkup_id != "" && flex_checkup_id != null)
|
|
opens(flex_checkup_id);
|
|
function opens(id) {
|
|
$.ajax({
|
|
url: 'select_checkup_form.php?id=' + id + '',
|
|
type: 'POST',
|
|
success: function(data) {
|
|
//alert(data);
|
|
if (data != null) {
|
|
var data = $.parseJSON(data);
|
|
//alert(data);
|
|
myDateFormaterTime(data.parent.checkup_date);
|
|
$("#checkup_id").val(data.parent.checkup_id);
|
|
//$("#checkdown_date").val(myDateFormater(data.parent.checkup_date));
|
|
var checkup_parameter_array = <?php echo json_encode($checkup_parameter_array) ?>;
|
|
$("#remarks").val(data.parent.remarks);
|
|
if (data.child != 'undefined' && data.child != '' && data.child != null)
|
|
for (var i = 0; i < data.child.length; i++) {
|
|
$("#" + data.child[i].checkup_form_key).val(data.child[i].checkup_form_value);
|
|
$("#" + data.child[i].checkup_form_key).trigger('chosen:updated');
|
|
}
|
|
|
|
$("#checkup_type_id").val(data.parent.checkup_type_id);
|
|
$('#checkup_type_id').trigger('chosen:updated');
|
|
var element = document.getElementById('health_risk_name');
|
|
var element1 = document.getElementById('health_advice_name');
|
|
if (data.parent.health_advice_id != null && data.parent.health_advice_id != '') {
|
|
var health_advice_name = data.parent.health_advice_id;
|
|
if (health_advice_name.length > 0) {
|
|
dataarray1 = health_advice_name.split(",");
|
|
for (var i = 0; i < element1.options.length; i++) {
|
|
element1.options[i].selected = dataarray1.indexOf(element1.options[i].value) >= 0;
|
|
}
|
|
$('#health_advice_name').trigger('chosen:updated');
|
|
}
|
|
}
|
|
//$("#health_risk_name").val(data.health_risk_id);
|
|
if (data.parent.health_risk_id != null && data.parent.health_risk_id != '') {
|
|
var health_risk_name = data.parent.health_risk_id;
|
|
if (health_risk_name.length > 0) {
|
|
dataarray = health_risk_name.split(",");
|
|
for (var i = 0; i < element.options.length; i++) {
|
|
element.options[i].selected = dataarray.indexOf(element.options[i].value) >= 0;
|
|
}
|
|
$('#health_risk_name').trigger('chosen:updated');
|
|
}
|
|
}
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating Checkup Form ');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
/* $('#checkdown_date').datepicker({
|
|
autoclose:true,
|
|
format: 'dd/mm/yyyy',
|
|
}).next().on(ace.click_event, function(){
|
|
$(this).prev().focus();
|
|
});*/
|
|
function myDateFormaterTime(myDate) {
|
|
$('#checkdown_date').datetimepicker({
|
|
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
|
|
defaultDate: new Date(myDate),
|
|
});
|
|
}
|
|
</script>
|
|
<?php include('techsyn_footer.php'); ?>
|