ESH/techsyn_footer.php
2024-10-23 18:28:06 +05:30

1462 lines
49 KiB
PHP

<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> <i
class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>
</div>
<!-- /.main-container -->
<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" />
<link rel="stylesheet" href="adminlte/bower_components/bootstrap/less/type.less" />
<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>
<script src="includes/css-js/functions.js"></script>
<div id="ajaxSpinnerContainer" style="display:none">
<img src="ajax-loading-icon-18.jpg" style="width: 100px; height:100px;" id="ajaxSpinnerImage" title="loading..."
class="loader" />
</div>
</body>
<script type="text/javascript">
function SerachManuLink(link) {
window.location = link;
}
var employeeOptions = "";
jQuery(function($) {
<?php $margin = 0; ?>
searchOptions = "<?php echo getsearchOptionsSpe($_SESSION["RoleId"]) ?>";
navs_seach = '';
navs_seach += "<div class=\"nav-search input-group\" style=\"width:250px; left: 30%;\"> ";
navs_seach +=
" <span class=\"input-group-addon\" style=\"border:1px;!important\"><i class=\"fa fa-search\"></i></span><select class=\"select2 form-control\" name=\"menu_seracher\" data-placeholder=\"Navigate To...\" onchange=\"SerachManuLink(this.value)\" title=\" Go to a Page \" >";
navs_seach += " <option></option>";
navs_seach += searchOptions;
navs_seach +=
" </select>";
navs_seach += "</div>";
$(".breadcrumbs").append(navs_seach);
var navs = "";
navs += "<form id=\"flex_form_opd\">";
navs += " <input type=\"hidden\" name=\"flex_opd_id\"id=\"flex_opd_id\">";
<?php
$opd_menu_id=getTableFieldValue('menu_master','menu_id','menu_url','"appointment_list.php"');
if (isAccessible($_SESSION['RoleId'], $opd_menu_id, 'W')) {
?>
navs += `<div class="input-group nav-search"> <div class="input-group" style=\" float:right\""><span class=\"input-group-addon\">
<i class=\"fa fa-search\"></i></span>
<input type="text" class=\" form-control\" name=\"emp_list_header\"id=\"emp_list_header\" placeholder=\" Search \" title=\"Search Existing Patient by Emp Code\" >
<span class=\"input-group-addon\" style=\"border:1px;!important\" title=\" New Consultation\" onclick=\"add_new_patient(this.value)\"><i class=\"ace-icon fa fa-plus\" style=\"cursor:pointer;\"></i></span>
</div><div id=\"emp_list_tableDiv\" class=\"dropdown-content\">
<table id=\"emp_list_table\" class=\"table table-bordered table-hover\">
<tbody>
</tbody>
</table>
</div> </div>`;
<?php
$margin += 150;
}
// if (isAccessible($_SESSION['RoleId'], '38', 'W')) {
?>
// navs += "<div class=\"nav-search\" style=\"width:150px; margin-right: <?php echo $margin ?>px;\">";
// navs +=
// " <select class=\"chosen-select form-control\" name=\"emp_list\" data-placeholder=\"Injury\" onchange=\"injury_form(this.value)\">";
// navs += " <option></option>";
// navs += employeeOptions;
// navs += " </select>";
// navs += "</div>";
// if (isAccessible($_SESSION['RoleId'], '9', 'W')) {
// ?>
// navs += "<div class=\"nav-search\" style=\"width:150px; margin-right: <?php echo $margin ?>px; \">";
// navs +=
// " <select class=\"chosen-select form-control\" name=\"emp_list_header\" data-placeholder=\"Employee Sickness\" onchange=\"sickness_form(this.value)\">";
// navs += " <option></option>";
// navs += employeeOptions;
// navs += " </select>";
// navs += "</div>";
// <?php
// $margin += 150;
// }
// if (isAccessible($_SESSION['RoleId'], '9', 'W') || isAccessible($_SESSION['RoleId'], '25', 'W') || isAccessible($_SESSION['RoleId'], '38', 'W')) {
// ?>
// navs += "<div class=\"nav-search\" style=\"width:5px; margin-right:-10px;\">";
// navs +=
// "<i class=\"glyphicon glyphicon-plus\" onclick=\"add_new_patient(this.value)\" style=\"cursor:pointer;\"></i>";
// navs += "</div>";
// <?php
// $margin += 150;
// } ?>
navs += "</form>";
$("#breadcrumbs").append(navs);
$('#id-disable-check').on('click', function() {
var inp = $('#form-input-readonly').get(0);
if (inp.hasAttribute('disabled')) {
inp.setAttribute('readonly', 'true');
inp.removeAttribute('disabled');
inp.value = "This text field is readonly!";
} else {
inp.setAttribute('disabled', 'disabled');
inp.removeAttribute('readonly');
inp.value = "This text field is disabled!";
}
});
if (!ace.vars['touch']) {
$('.chosen-select').chosen({
allow_single_deselect: true
});
//resize the chosen on window resize
$(window)
.off('resize.chosen')
.on('resize.chosen', function() {
$('.chosen-select').each(function() {
var $this = $(this);
$this.next().css({
'width': $this.parent().width()
});
})
}).trigger('resize.chosen');
//resize chosen on sidebar collapse/expand
$(document).on('settings.ace.chosen', function(e, event_name, event_val) {
if (event_name != 'sidebar_collapsed') return;
$('.chosen-select').each(function() {
var $this = $(this);
$this.next().css({
'width': $this.parent().width()
});
})
});
$('#chosen-multiple-style .btn').on('click', function(e) {
var target = $(this).find('input[type=radio]');
var which = parseInt(target.val());
if (which == 2) $('#form-field-select-4').addClass('tag-input-style');
else $('#form-field-select-4').removeClass('tag-input-style');
});
}
autosize($('textarea[class*=autosize]'));
$('textarea.limited').inputlimiter({
remText: '%n character%s remaining...',
limitText: 'max allowed : %n.'
});
//datepicker plugin
//link
$('.date-picker').datepicker({
autoclose: true,
todayHighlight: true
})
//show datepicker when clicking on the icon
.next().on(ace.click_event, function() {
$(this).prev().focus();
});
//or change it into a date range picker
$('.input-daterange').datepicker({
autoclose: true
});
//to translate the daterange picker, please copy the "examples/daterange-fr.js" contents here before initialization
$('input[name=date-range-picker]').daterangepicker({
'applyClass': 'btn-sm btn-success',
'cancelClass': 'btn-sm btn-default',
locale: {
applyLabel: 'Apply',
cancelLabel: 'Cancel',
}
})
.prev().on(ace.click_event, function() {
$(this).next().focus();
});
$('#timepicker1').timepicker({
minuteStep: 1,
showSeconds: true,
showMeridian: false,
disableFocus: true,
icons: {
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down'
}
}).on('focus', function() {
$('#timepicker1').timepicker('showWidget');
}).next().on(ace.click_event, function() {
$(this).prev().focus();
});
if (!ace.vars['old_ie']) $('#appointment_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();
});
$('#colorpicker1').colorpicker();
//$('.colorpicker').last().css('z-index', 2000);//if colorpicker is inside a modal, its z-index should be higher than modal'safe
$('#simple-colorpicker-1').ace_colorpicker();
//$('#simple-colorpicker-1').ace_colorpicker('pick', 2);//select 2nd color
//$('#simple-colorpicker-1').ace_colorpicker('pick', '#fbe983');//select #fbe983 color
//var picker = $('#simple-colorpicker-1').data('ace_colorpicker')
//picker.pick('red', true);//insert the color if it doesn't exist
$(".knob").knob();
var tag_input = $('#form-field-tags');
try {
tag_input.tag({
placeholder: tag_input.attr('placeholder'),
//enable typeahead by specifying the source array
source: ailments, //defined in ace.js >> ace.enable_search_ahead
/**
//or fetch data from database, fetch those that match "query"
source: function(query, process) {
$.ajax({url: 'remote_source.php?q='+encodeURIComponent(query)})
.done(function(result_items){
process(result_items);
});
}
*/
})
//programmatically add/remove a tag
var $tag_obj = $('#form-field-tags').data('tag');
$tag_obj.add('Programmatically Added');
var index = $tag_obj.inValues('some tag');
$tag_obj.remove(index);
} catch (e) {
//display a textarea for old IE, because it doesn't support this plugin or another one I tried!
tag_input.after('<textarea id="' + tag_input.attr('id') + '" name="' + tag_input.attr('name') +
'" rows="3">' + tag_input.val() + '</textarea>').remove();
//autosize($('#form-field-tags'));
}
/////////
$('#modal-form input[type=file]').ace_file_input({
style: 'well',
btn_choose: 'Drop files here or click to choose',
btn_change: null,
no_icon: 'ace-icon fa fa-cloud-upload',
droppable: true,
thumbnail: 'large'
})
//chosen plugin inside a modal will have a zero width because the select element is originally hidden
//and its width cannot be determined.
//so we set the width after modal is show
$('#modal-form').on('shown.bs.modal', function() {
if (!ace.vars['touch']) {
$(this).find('.chosen-container').each(function() {
$(this).find('a:first-child').css('width', '210px');
$(this).find('.chosen-drop').css('width', '210px');
$(this).find('.chosen-search input').css('width', '200px');
});
}
})
/**
//or you can activate the chosen plugin after modal is shown
//this way select element becomes visible with dimensions and chosen works as expected
$('#modal-form').on('shown', function () {
$(this).find('.modal-chosen').chosen();
})
*/
$(document).one('ajaxloadstart.page', function(e) {
autosize.destroy('textarea[class*=autosize]')
$('.limiterBox,.autosizejs').remove();
$('.daterangepicker.dropdown-menu,.colorpicker.dropdown-menu,.bootstrap-datetimepicker-widget.dropdown-menu')
.remove();
});
});
</script>
<script type="text/javascript">
if ('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>" +
"<" + "/script>");
</script>
<!-- basic scripts -->
<!--[if !IE]> -->
<!-- <![endif]-->
<!--[if IE]>
<script src="assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
<script type="text/javascript">
jQuery(function($) {
//flot chart resize plugin, somehow manipulates default browser resize event to optimize it!
//but sometimes it brings up errors with normal resize event handlers
$.resize.throttleWindow = false;
//pie chart tooltip example
var $tooltip = $("<div class='tooltip top in'><div class='tooltip-inner'></div></div>").hide().appendTo(
'body');
var previousPoint = null;
/////////////////////////////////////
$(document).one('ajaxloadstart.page', function(e) {
$tooltip.remove();
});
var d1 = [];
for (var i = 0; i < Math.PI * 2; i += 0.5) {
d1.push([i, Math.sin(i)]);
}
var d2 = [];
for (var i = 0; i < Math.PI * 2; i += 0.5) {
d2.push([i, Math.cos(i)]);
}
var d3 = [];
for (var i = 0; i < Math.PI * 2; i += 0.2) {
d3.push([i, Math.tan(i)]);
}
$('#recent-box [data-rel="tooltip"]').tooltip({
placement: tooltip_placement
});
function tooltip_placement(context, source) {
var $source = $(source);
var $parent = $source.closest('.tab-content')
var off1 = $parent.offset();
var w1 = $parent.width();
var off2 = $source.offset();
//var w2 = $source.width();
if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) return 'right';
return 'left';
}
$('.dialogs,.comments').ace_scroll({
size: 300
});
//Android's default browser somehow is confused when tapping on label which will lead to dragging the task
//so disable dragging when clicking on label
var agent = navigator.userAgent.toLowerCase();
if (ace.vars['touch'] && ace.vars['android']) {
$('#tasks').on('touchstart', function(e) {
var li = $(e.target).closest('#tasks li');
if (li.length == 0) return;
var label = li.find('label.inline').get(0);
if (label == e.target || $.contains(label, e.target)) e.stopImmediatePropagation();
});
}
var curr_url = "<?php echo $_SESSION['menu_current_page'] ?>";
$("a[href='" + curr_url + "']").parent("li").addClass("active");
$("a[href='" + curr_url + "']").parent("li").parents("li").addClass("active open");
})
$(document).ready(function() {
resizeChosen();
jQuery(window).on('resize', resizeChosen);
$('.select2').select2()
var emp_list_src = 'select_patient_list.php';
$("#emp_list_header").autocomplete({
source: function(request, response) {
$.ajax({
url: emp_list_src,
dataType: "json",
data: {
"searchParam": request.term,
// "strict_search": "N",
// "search_only_col": ""
},
success: function(data) {
$("#emp_list_table tbody tr").remove();
var table = $("#emp_list_table");
if (data.length != 0) {
for (var i = 0; i < data.length; i++) {
item = data[i];
table.append("<tr style='cursor: pointer;' onClick=\"setEmpList(" + item.id + ",'" +
item.patient_name + "(" + item.emp_code +
")')\"><td>" + item.patient_name + " (" + item
.emp_code + ")</td></tr>");
}
}
$("#emp_list_table").show();
$("#emp_list_tableDiv").show();
}
});
},
minLength: 1,
delay: 300,
select: function(event, ui) {
log(ui.item ?
"Selected: " + ui.item.label :
"Nothing selected, input was " + this.value);
},
open: function() {
$(this).removeClass("ui-corner-all").addClass("ui-corner-top");
},
close: function() {
$(this).removeClass("ui-corner-top").addClass("ui-corner-all");
}
});
});
function resizeChosen() {
$(".chosen-container").each(function() {
$(this).attr('style', 'width: 100%');
});
$(".select2").each(function() {
$(this).attr('style', 'width: 100%');
});
}
window.onload = function() {
$("#flex1 th").each(function() {
$(this).attr("width", $(this).width());
});
//make all inputs in capital to save in db
// $(document).ready(function() {
// $("input[type=text]").keyup(function() {
// $(this).val($(this).val().toUpperCase());
// });
// $("textarea").keyup(function() {
// $(this).val($(this).val().toUpperCase());
// });
// });
}
function replaceInputFieldsWithDiv() {
$('input').replaceWith(function() {
return $('<div>' + $(this).val() + '</div>');
});
$('textarea').replaceWith(function() {
return $('<div>' + $(this).val() + '</div>');
});
$('select').replaceWith(function() {
return $('<div>' + $(this).find('option:selected').text() + '</div>');
});
$(".input-group-addon").hide();
}
var refreshTime = 600000; // every 10 minutes in milliseconds
window.setInterval(function() {
$.ajax({
cache: false,
type: "GET",
url: "session_refresh.php",
success: function(data) {}
});
}, refreshTime);
function sickness_form(id) {
var action = "sickness.php"
var newForm = jQuery('<form>', {
'action': action,
'method': 'POST'
}).append(jQuery('<input>', {
'name': 'flex_opd_id',
'id': 'flex_opd_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'flex_sickness_id',
'id': 'flex_sickness_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'emp_id',
'id': 'emp_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'returnPage',
'id': 'returnPage',
'value': '<?php echo getTableFieldValue('role_master','role_home_page','role_id',$_SESSION['RoleId']) ?>',
'type': 'hidden'
}));
newForm.appendTo('body').submit().remove();
}
function opd_form(id,today_ticket) {
if(today_ticket!='' && today_ticket!=null){
BootstrapDialog.confirm({
title: 'Confirmation',
message:'This patient has an existing OPD appointment recorded for the same day with appointment ticket '+today_ticket+' .Do you want to add new OPD ?',
closable: false, // <-- Default value is false
draggable: false, // <-- Default value is false
btnCancelLabel: 'No', // <-- Default value is 'Cancel',
btnOKLabel: 'Yes', // <-- Default value is 'OK',
callback: function(result) {
// result will be true if button was click, while it will be false if users close the dialog directly.
if (result) {
var action = "edit_opd.php"
var newForm = jQuery('<form>', {
'action': action,
'method': 'POST'
}).append(jQuery('<input>', {
'name': 'flex_opd_id',
'id': 'flex_opd_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'emp_id',
'id': 'emp_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'appointment_type',
'value': 'O',
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'returnPage',
'id': 'returnPage',
'value': '<?php echo getTableFieldValue('role_master','role_home_page','role_id',$_SESSION['RoleId']) ?>',
'type': 'hidden'
}));
newForm.appendTo('body').submit().remove();
}}
});
}
else{
var action = "edit_opd.php"
var newForm = jQuery('<form>', {
'action': action,
'method': 'POST'
}).append(jQuery('<input>', {
'name': 'flex_opd_id',
'id': 'flex_opd_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'emp_id',
'id': 'emp_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'appointment_type',
'value': 'O',
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'returnPage',
'id': 'returnPage',
'value': '<?php echo getTableFieldValue('role_master','role_home_page','role_id',$_SESSION['RoleId']) ?>',
'type': 'hidden'
}));
newForm.appendTo('body').submit().remove();
}
}
function injury_form(id,today_ticket) {
if(today_ticket!='' && today_ticket!=null){
BootstrapDialog.confirm({
title: 'Confirmation',
message:'This patient has an existing Injury appointment recorded for the same day with appointment ticket '+today_ticket+' .Do you want to add new Injury ?',
closable: false, // <-- Default value is false
draggable: false, // <-- Default value is false
btnCancelLabel: 'No', // <-- Default value is 'Cancel',
btnOKLabel: 'Yes', // <-- Default value is 'OK',
callback: function(result) {
// result will be true if button was click, while it will be false if users close the dialog directly.
if (result) {
var action = "edit_injury.php"
var newForm = jQuery('<form>', {
'action': action,
'method': 'POST'
}).append(jQuery('<input>', {
'name': 'flex_opd_id',
'id': 'flex_opd_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'returnPage',
'id': 'returnPage',
'value': '<?php echo getTableFieldValue('role_master','role_home_page','role_id',$_SESSION['RoleId']) ?>',
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'emp_id',
'id': 'emp_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'appointment_type',
'value': 'I',
'type': 'hidden'
}));
newForm.appendTo('body').submit().remove();
}
}
});
}else{
var action = "edit_injury.php"
var newForm = jQuery('<form>', {
'action': action,
'method': 'POST'
}).append(jQuery('<input>', {
'name': 'flex_opd_id',
'id': 'flex_opd_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'returnPage',
'id': 'returnPage',
'value': '<?php echo getTableFieldValue('role_master','role_home_page','role_id',$_SESSION['RoleId']) ?>',
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'emp_id',
'id': 'emp_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'appointment_type',
'value': 'I',
'type': 'hidden'
}));
newForm.appendTo('body').submit().remove();
}
}
function checkup_selector(emp_id) {
$('.close').click();
$("#emp_id_checkup").val(emp_id);
$('#modal-add-checkup').modal('show');
}
function checkup_form(id, checkup_id) {
var action = "checkup.php"
var newForm = jQuery('<form>', {
'action': action,
'method': 'POST'
}).append(jQuery('<input>', {
'name': 'flex_opd_id',
'id': 'flex_opd_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'returnPage',
'id': 'returnPage',
'value': '<?php echo getTableFieldValue('role_master','role_home_page','role_id',$_SESSION['RoleId']) ?>',
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'patient_id',
'id': 'patient_id',
'value': id,
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'checkup_type_id',
'id': 'checkup_type_id',
'value': checkup_id,
'type': 'hidden'
}));
newForm.appendTo('body').submit().remove();
}
function add_new_patient(id) {
var action = "add_select_patient.php"
var newForm = jQuery('<form>', {
'action': action,
'method': 'POST'
}).append(jQuery('<input>', {
'name': 'task',
'id': 'task',
'value': 'DIRECT_ENTRY',
'type': 'hidden'
}));
newForm.appendTo('body').submit().remove();
}
function direct_test(id) {
<?php if ($_SESSION['RoleCode'] == 'LAB') { ?>
checkup_selector(id);
<?php } else { ?>
// var action = "emp_dashboard.php"
// var newForm = jQuery('<form>', {
// 'action': action,
// 'method': 'POST'
// }).append(jQuery('<input>', {
// 'name': 'task',
// 'id': 'task',
// 'value': 'DIRECT_ENTRY',
// 'type': 'hidden'
// })).append(jQuery('<input>', {
// 'name': 'flex_opd_id',
// 'id': 'flex_opd_id',
// 'value': id,
// 'type': 'hidden'
// }));
// newForm.appendTo('body').submit().remove();
direct_test_form(id);
<?php } ?>
}
function direct_test_form(id) {
$.ajax({
url: 'get_emp_recent_entries.php',
data: {
id: id
},
type: 'POST',
dataType: 'json',
success: function(data) {
var patient_det = '';
patient_det += '<a target="_blank" href="emp_dashboard.php?flex_patient_id=' + id +
'"><i style="font-size: 17px;" class="glyphicon glyphicon-user"></i></a>&nbsp;&nbsp;&nbsp;' +
data[
'emp_name'] +
'&nbsp;&nbsp;&nbsp;<a target="_blank" href="edit_employee_details.php?emp_id=' + id +
'"><i style="font-size: 17px;" class="ace-icon fa fa-edit"></i></a>';
$('#emp_name').html(patient_det);
var opd_followup = data['opd_followup'];
var inj_followup = data['inj_followup'];
// alert(opd_followup.length);
$tbl_opd = '';
$tbl_opd +=
"<table style='max=height:250px' width='100%'><thead onclick='$(`#opd_data`).toggle()' ><tr><td colspan=3 style='text-align: center;border: groove;' align='center'><b align='center' >Recent Illness</b> </td></tr></thead><tbody id='opd_data' >";
if (data['opd']['ticket_no'] != '' && data['opd']['ticket_no'] != null && data['opd'][
'ticket_no'
] != undefined) {
$tbl_opd +=
"<tr><td>Ticket No.</td><td colspan=2 align='left'>" +
data['opd']['ticket_no'] +
"&nbsp;&nbsp;&nbsp;";
<?php if (isAccessible($_SESSION['RoleId'], '38', 'W')) {?>
$tbl_opd +=
"<a href=\"#\" class=\"blue\" onclick=\"open_employee_appointment_task('" + data['opd'][
'id'
] +
"','" + data['opd']['case_type'] +
"','" + id +
"','E','');\"><i class=\"ace-icon fa fa-edit\" style=\"font-size: 15px;\"></i></a>";
<?php }?>
$tbl_opd += "</td></tr><tr><td>Date</td><td colspan=2 align='left'>" +
data['opd']['date'] +
"</td></tr><tr><td>Complains</td><td colspan=2 align='left'>" + data['opd'][
'complaints'
] +
"</td></tr><tr><td>Treatment</td><td colspan=2 align='left'>" + data['opd'][
'Treatment'
] +
"</td></tr>"
for (var o = 0; o < opd_followup.length; o++) {
var fol = opd_followup[o].split(',');
var flo_tick = fol[0];
var flo_id = fol[1];
var flo_app_id = fol[2];
$tbl_opd += "<tr><td>";
if (o == 0) {
$tbl_opd += 'Follow-ups'
}
$tbl_opd += "</td><td colspan=2 align='left'>" + flo_tick + "&nbsp;&nbsp;&nbsp;";
<?php if (isAccessible($_SESSION['RoleId'], '38', 'W')) {?>
$tbl_opd +=
"<a href=\"#\" class=\"blue\" onclick=\"open_employee_appointment_task('" +
flo_app_id +
"','" + data['opd']['case_type'] +
"','" + id +
"','F'," + flo_id +
");\"><i class=\"ace-icon fa fa-edit\" style=\"font-size: 15px;\"></i></a>";
<?php }?>
"</td></tr>";
}
$tbl_opd +=
"<tr><td><button type='button' class='btn btn-success btn-sm save_button' style='width:80%' onclick=\"opd_form(" +
id + ",'";
var app_date = data['opd']['app_date'];
if (app_date=='true') {
$tbl_opd += data['opd']['ticket_no'];
} else {
$tbl_opd += '';
}
$tbl_opd +=
"')\">New Illness</button></td><td colspan='2' > <button type='button' class='btn btn-info btn-sm save_button' onclick=\"open_employee_appointment_task('" +
data['opd'][
'id'
] +
"','" + data['opd']['case_type'] +
"','" + id +
"','F','');\"><i class='ace-icon fa fa-plus'></i>Add Followup </button> </td></tr>"
$tbl_opd += "</tbody></table>";
} else {
$tbl_opd +=
"<tr><td style='text-align: center;' colspan=2>No OPD Done Yet</td></tr>";
$tbl_opd +=
"<tr><td style='text-align: center;'><button type='button' class='btn btn-success btn-sm save_button' style='width:50%' onclick=\"opd_form(" +
id +
")\">New OPD</button></td></tr>"
$tbl_opd += "</tbody></table>";
}
// ----injutys -------
$tbl_inj = '';
$tbl_inj +=
"<table style='max=height:250px' width='100%'><thead onclick='$(`#inj_data`).toggle()' ><tr><td colspan=3 style='text-align: center;border: groove;' align='center'><b align='center' >Recent Injury</b> </td></tr></thead><tbody id='inj_data' >";
if (data['inj']['ticket_no'] != '' && data['inj']['ticket_no'] != null && data['inj'][
'ticket_no'
] != undefined) {
$tbl_inj +=
"<tr><td>Ticket No.</td><td colspan=2 align='left'>" +
data['inj']['ticket_no'] +
"&nbsp;&nbsp;&nbsp;";
<?php if (isAccessible($_SESSION['RoleId'], '38', 'W')) {?>
$tbl_inj +=
"<a href=\"#\" class=\"blue\" onclick=\"open_employee_appointment_task('" + data['inj'][
'id'
] +
"','" + data['inj']['case_type'] +
"','" + id +
"','E','');\"><i class=\"ace-icon fa fa-edit\" style=\"font-size: 15px;\"></i></a>";
<?php }?>
$tbl_inj += "</td></tr><tr><td>Date</td><td colspan=2 align='left'>" +
data['inj']['date'] +
"</td></tr><tr><td>Complains</td><td colspan=2 align='left'>" + data['inj'][
'complaints'
] +
"</td></tr><tr><td>Treatment</td><td colspan=2 align='left'>" + data['inj'][
'Treatment'
] +
"</td></tr>";
for (var n = 0; n < inj_followup.length; n++) {
var fol = inj_followup[n].split(',');
var flo_tick = fol[0];
var flo_id = fol[1];
var flo_app_id = fol[2];
$tbl_inj += "<tr><td>";
if (n == 0) {
$tbl_inj += 'Follow-ups'
}
$tbl_inj += "</td><td colspan=2 align='left'>" + flo_tick + "&nbsp;&nbsp;&nbsp;";
<?php if (isAccessible($_SESSION['RoleId'], '38', 'W')) {?>
$tbl_inj +=
"<a href=\"#\" class=\"blue\" onclick=\"open_employee_appointment_task('" +
flo_app_id +
"','" + data['inj']['case_type'] +
"','" + id +
"','F'," + flo_id +
");\"><i class=\"ace-icon fa fa-edit\" style=\"font-size: 15px;\"></i></a>";
<?php }?>
"</td></tr>";
}
$tbl_inj +=
"<tr><td><button type='button' class='btn btn-success btn-sm save_button' style='width:80%' onclick=\"injury_form(" +
id + ",'";
var app_date_inj = data['inj']['app_date'];
if (app_date_inj=='true') {
$tbl_inj += data['inj']['ticket_no'];
} else {
$tbl_inj += '';
}
$tbl_inj +=
"')\">New INJ</button></td><td colspan='2' > <button type='button' class='btn btn-info btn-sm save_button' onclick=\"open_employee_appointment_task('" +
data['inj'][
'id'
] +
"','" + data['inj']['case_type'] +
"','" + id +
"','F','');\"><i class='ace-icon fa fa-plus'></i>Add Followup </button> </td></tr>"
$tbl_inj += "</tbody></table>";
} else {
$tbl_inj +=
"<tr><td style='text-align: center;' colspan=2>No Injury Done Yet</td></tr>";
$tbl_inj +=
"<tr><td style='text-align: center;'><button type='button' class='btn btn-success btn-sm save_button' style='width:50%' onclick=\"injury_form(" +
id +
")\">New INJ</button></td></tr>"
$tbl_inj += "</tbody></table>";
}
$('#opd_div').html($tbl_opd);
$('#inj_div').html($tbl_inj);
// ----------medical-----
$tbl_medical = '';
$tbl_medical +=
"<table style='max=height:250px' width='100%'><thead onclick='$(`#medical_data`).toggle()' ><tr><td colspan=3 style='text-align: center;border: groove;' align='center'><b align='center' >Recent Medical Examination</b> </td></tr></thead><tbody id='medical_data' >";
if (data['medical']['ticket_no'] != '' && data['medical']['ticket_no'] != null && data[
'medical'][
'ticket_no'
] != undefined) {
// $tbl_medical +=
// "<tr><td colspan='3' > <button type='button' class='btn btn-info btn-sm save_button ' onclick=\'open_direct_checkup(`" +
// data['medical'][
// 'id'
// ] + "`,`" + id + "`,`F`,`" + data['medical']['checkup_type_id'] +
// "`)'><i class='ace-icon fa fa-plus'></i>Add Followup </button> </td></tr>"
$tbl_medical +=
"<tr><td>Ticket No.</td><td colspan=2 align='left'>" +
data['medical']['ticket_no'] +
"&nbsp;&nbsp;&nbsp;";
<?php if (isAccessible($_SESSION['RoleId'], '25', 'W')) {?>
$tbl_medical +=
"<a href=\"#\" class=\"blue\" onclick=\'open_direct_checkup(`" + data['medical'][
'id'
] + "`,`" + id + "`,`E`,`" + data['medical']['checkup_type_id'] +
"`)'><i class=\"ace-icon fa fa-edit bigger-130\" style=\"font-size:17px\"></i></a>";
<?php }?>
$tbl_medical += "</td></tr><tr><td>Date</td><td colspan=2 align='left'>" +
data['medical']['date'] +
"</td></tr><tr><td>Examination Type</td><td colspan=2 align='left'>" + data['medical'][
'type'
] +
"</td></tr><tr><td style='height:150px'>Test Categeries</td><td style='height:150px' colspan=2 align='left'>" +
data['medical'][
'tests'
] +
"</td></tr>";
$tbl_medical +=
"<tr><td style='text-align: center;'><button type='button' class='btn btn-success btn-sm save_button' style='width:90%' onclick=\"checkup_selector(" +
id +
")\">New Medical</button></td></tr>";
$tbl_medical += "</tbody></table>";
} else {
$tbl_medical +=
"<tr><td style='text-align: center;' colspan=2>No Medical Examination Done Yet</td></tr>";
$tbl_medical +=
"<tr><td style='text-align: center;'><button type='button' class='btn btn-success btn-sm save_button' style='width:50%' onclick=\"checkup_selector(" +
id +
")\">New Medical</button></td></tr>"
$tbl_medical += "</tbody></table>";
}
$('#medical_div').html($tbl_medical);
// ------sickness---
// $tbl_sickness = '';
// $tbl_sickness +=
// "<table style='max=height:250px' width='100%'><thead onclick='$(`#sickness_data`).toggle()' ><tr><td colspan=3 style='text-align: center;border: groove;' align='center'><b align='center' >Recent Sickness/Fitness</b> </td></tr></thead><tbody id='sickness_data' >";
// if (data['sickness']['ticket_no'] != '' && data['sickness']['ticket_no'] != null && data[
// 'sickness']['ticket_no'] != undefined) {
// $tbl_sickness +=
// "<tr><td colspan='3' > <button type='button' class='btn btn-info btn-sm save_button ' onclick=\"window.location='fitness.php?followup_to_opd=" +
// data[
// 'sickness'][
// 'id'
// ] +
// "'\"><i class='ace-icon fa fa-plus'></i>Add Followup </button> </td></tr>"
// $tbl_sickness +=
// "<tr><td>Ticket No.</td><td colspan=2 align='left'>" +
// data['sickness']['ticket_no'];
// $tbl_sickness += "</td></tr><tr><td>Follow To Opd</td><td colspan=2 align='left'>" +
// data['sickness']['opd_ticket'] + "&nbsp;&nbsp;&nbsp;";
// <?php if (isAccessible($_SESSION['RoleId'],$opd_menu_id, 'W')) {?>
// $tbl_sickness +=
// "<a href=\"#\" class=\"blue\" onclick=\"open_employee_appointment_task('" + data[
// 'sickness'][
// 'opd_id'
// ] +
// "','" + data['sickness']['opd_case_type'] +
// "','" + id +
// "','E','');\"><i class=\"ace-icon fa fa-edit\" style=\"font-size: 15px;\"></i></a>";
// <?php }?>
// $tbl_sickness += "</td></tr><tr><td>Date</td><td colspan=2 align='left'>" +
// data['sickness']['date'] +
// "</td></tr><tr><td>Absence </td><td colspan=2 align='left'>" + data['sickness'][
// 'absence'
// ] +
// "</td></tr><tr><td>Ailment System</td><td colspan=2 align='left'>" + data['sickness'][
// 'ailment'
// ] +
// "</td></tr>";
// $tbl_sickness +=
// "<tr><td style='text-align: center;'><button type='button' class='btn btn-success btn-sm save_button' style='width:90%' onclick=\"sickness_form(" +
// id +
// ")\">New Sickness</button></td></tr>"
// $tbl_sickness += "</tbody></table>";
// } else {
// $tbl_sickness +=
// "<tr><td style='text-align: center;' colspan=2>No sickness Done Yet </td></tr>"
// $tbl_sickness +=
// "<tr><td style='text-align: center;'><button type='button' class='btn btn-success btn-sm save_button' style='width:50%' onclick=\"sickness_form(" +
// id +
// ")\">New Sickness</button></td></tr>"
// "</tbody></table>"
// }
// $('#sickness_div').html($tbl_sickness);
},
error: function(data) {
BootstrapDialog.alert('Error: Vaccination Details Not Deleted!');
return;
}
});
$('#modal-add-task').modal("show");
}
function open_employee_appointment_task(appointmentId, appointment_type, emp_id, action, follow_up) {
if (appointment_type == "O") {
if (action == 'V') {
document.forms['task_form'].action = "view_opd.php";
} else if (action == 'E' || action == 'F') {
document.forms["task_form"].action = "edit_opd.php";
}
} else if (appointment_type == "I") {
if (action == 'V') {
document.forms['task_form'].action = "view_injury.php";
} else if (action == 'E' || action == 'F') {
document.forms['task_form'].action = "edit_injury.php";
}
}
$("#task_form").method = "post";
if (action == 'F') {
$("#task_form").append(jQuery('<input>', {
'name': 'followup_to_opd',
'id': 'followup_to_opd',
'value': appointmentId,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'followup_id',
'id': 'followup_id',
'value': follow_up,
'type': 'hidden'
}));
} else {
$("#task_form").append(jQuery('<input>', {
'name': 'appointmentId',
'id': 'appointmentId',
'value': appointmentId,
'type': 'hidden'
}));
}
$("#task_form").append(jQuery('<input>', {
'name': 'emp_id',
'id': 'emp_id',
'value': emp_id,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'flex_opd_id',
'id': 'flex_opd_id',
'value': emp_id,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'returnPage',
'id': 'returnPage',
'value': "appointment_list.php",
'type': 'hidden'
}));
$("#task_form").submit();
}
function open_direct_checkup(checkupId, empId, action, checkup_type_id) {
//window.location = 'checkup.php?checkup_id='+checkupId+'';
console.log(checkupId + ':' + empId + ' ; ' + action + ' : ' + checkup_type_id);
if (checkupId != null && checkupId != '') {
oFormObject = document.forms['task_form'];
$("#task_form").append(jQuery('<input>', {
'name': 'flex_checkup_id',
'id': 'flex_checkup_id',
'value': checkupId,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'checkup_type_id_db',
'id': 'checkup_type_id_db',
'value': checkup_type_id,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'emp_id_history',
'id': 'emp_id_history',
'value': empId,
'type': 'hidden'
}));
$("#task_form").append(jQuery('<input>', {
'name': 'toPage',
'id': 'toPage',
'value': action,
'type': 'hidden'
}));
$("#task_form").attr('method', 'POST');
$("#task_form").attr('action', 'checkup_from_before.php');
$("#task_form").submit();
}
}
function setEmpList(emp_id, emp_code) {
$("#emp_list_table").hide();
$("#emp_list_tableDiv").hide();
//$("#emp_list_header").val('');
direct_test(emp_id);
//$("#emp_mgr_name").val(emp_code);
//$("#manager_emp_id").val(mgr_emp_id);
}
$('#ajaxSpinnerContainer').hide();
jQuery.ajaxSetup({
ajaxStart: function() {
$('#ajaxSpinnerContainer').show();
$('#ajaxSpinnerContainer').style.display = 'block';
},
ajaxStop: function() {
$('#ajaxSpinnerContainer').hide();
},
complete: function() {
$('#ajaxSpinnerContainer').hide();
},
success: function() {
$('#ajaxSpinnerContainer').hide();
},
error: function() {
$('#ajaxSpinnerContainer').hide();
}
});
$('#ajaxSpinnerContainer').bind('ajaxStart', function() {
$(this).show();
}).bind('ajaxStop', function() {
$(this).hide();
});
</script>
<style>
.btn-group,
.btn-group-vertical {
position: relative;
display: inline-block;
vertical-align: middle;
}
.btn {
border-radius: 3px;
-webkit-box-shadow: none;
box-shadow: none;
border: 1px solid transparent;
}
.btn-box-tool {
padding: 5px;
font-size: 12px;
background: transparent;
color: #97a0b3;
}
.loader {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto
}
</style>
<style>
#settings {
display: block;
text-align: center
}
#paint {
border: 1px solid black;
background: #fff;
margin-left: auto;
margin-right: auto;
display: block;
}
.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: 20px;
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);
}
input {
width: 100px;
}
th {
font-size: 11px;
font-weight: 600;
}
@media (min-width : 768px) {
.col-sm-12 {
width: 100%;
}
}
input,
input::-webkit-input-placeholder {
font-size: 10px;
}
select {
padding: unset;
}
* {
text-transform: none !important;
font-family: Arial, Helvetica, sans-serif;
}
.dropdown {
position: relative;
width: 100%;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
margin-top: -12px;
overflow: auto;
border: 1px solid #ddd;
z-index: 1;
}
#emp_list_tableDiv {
overflow: scroll;
display: none;
position: absolute;
background-color: #fff;
margin-top: 30px;
max-height: 100px;
overflow: auto;
border: 1px solid #ddd;
z-index: 111;
}
#menu_seracher,
#emp_list_header {
border: 1px solid #ccc;
box-shadow: inset 0 1px 3px #ddd;
border-radius: 1 !important;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
height: 30px;
padding: 2px;
}
/* .btn-primary{
margin-bottom:10px !important;
} */
.btn{
margin-bottom:0px !important;
}
</style>