1191 lines
50 KiB
PHP
1191 lines
50 KiB
PHP
<!-- 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>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function itemLevelTotol(treatment_item_qtygvn_field,current_rate_field,treatment_item_total_amount_field,treatment_item_total_amount_field_div){
|
|
var count= $("#count_treatment_item").val();
|
|
//alert(count);
|
|
var price=$("#"+current_rate_field).val();
|
|
var qty=$("#"+treatment_item_qtygvn_field).val();
|
|
var totalValue=price*qty;
|
|
///alert(totalValue);
|
|
$("#"+treatment_item_total_amount_field).val(totalValue);
|
|
document.getElementById(treatment_item_total_amount_field_div+"").innerText=totalValue;
|
|
|
|
orderLevelTotal(count);
|
|
}
|
|
|
|
$("#treatmentTable").on("click", ".fa-trash-o", function (event) {
|
|
$(this).closest("tr").remove();
|
|
var counter=$("#count_treatment_item").val();
|
|
counter -= 1
|
|
$("#count_treatment_item").val(counter);
|
|
});
|
|
|
|
function orderLevelTotal(count){
|
|
var totalAmount=0;
|
|
//totalAmount=totalAmount+parseInt(treatment_item_total_amount_field_value);
|
|
for(var i=0;i<count;i++){
|
|
if($("#treatment_item_total_amount_"+i).val()=="" || $("#treatment_item_total_amount_"+i).val()==null )
|
|
{
|
|
$("#treatment_item_total_amount_"+i).val(0);
|
|
}
|
|
totalAmount=totalAmount+parseInt($("#treatment_item_total_amount_"+i).val());
|
|
}
|
|
|
|
//alert(totalAmount);
|
|
$("#order_level_total").val(totalAmount);
|
|
|
|
document.getElementById("order_level_total_div").innerText=totalAmount;
|
|
|
|
|
|
|
|
}
|
|
function setFieldDisableOrEnable(value){
|
|
var count=$("#count_treatment_item").val();
|
|
if(value=='Y'){
|
|
// $("[name='field07']").prop("disabled", false);
|
|
for(var i=0;i<count;i++){
|
|
$("#treatment_item_qtygvn_"+i).prop("disabled", false);
|
|
}
|
|
}else if(value=='N'){
|
|
|
|
for(var i=0;i<count;i++){
|
|
$("#treatment_item_qtygvn_"+i).prop("disabled", true);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/*$(document).ready(function () {
|
|
var counter = 1;
|
|
var itemOptions="<?php echo generateOption('tbl_items','item_name','item_id','',''); ?>";
|
|
$("#addrow").on("click", function () {
|
|
var newRow = $("<tr>");
|
|
var cols = "";
|
|
var select_treatment="";
|
|
select_treatment+="<select ";
|
|
select_treatment+="id=\"treatment_item"+counter+"\"name=\"treatment_item"+counter+"\"data-placeholder=\"Choose a treatment...\"";
|
|
//select_treatment+="style=\"display: none;\"";
|
|
select_treatment+=">";
|
|
|
|
select_treatment+="<option value=\"\"> </option>";
|
|
select_treatment+=itemOptions
|
|
select_treatment+="</select>";
|
|
|
|
cols += '<td>'+select_treatment+'</td>';
|
|
cols += '<td><input type="number" class="col-xs-4" name="treatment_item_qty' + counter + '"/></td>';
|
|
cols += '<td><input type="text" class="form-control" name="treatment_item_remarks' + counter + '"/></td>';
|
|
|
|
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
|
|
newRow.append(cols);
|
|
$("table.order-list").append(newRow);
|
|
$('#treatment_item'+counter).chosen({allow_single_deselect:true});
|
|
$('#treatment_item'+counter).next().css({'width': $('#treatment_item'+counter).parent().width()});
|
|
counter++;
|
|
$("#count_treatment_item").val(counter);
|
|
});
|
|
|
|
|
|
|
|
$("table.order-list").on("click", ".ibtnDel", function (event) {
|
|
$(this).closest("tr").remove();
|
|
counter -= 1
|
|
});
|
|
|
|
|
|
});*/
|
|
jQuery(function($) {
|
|
$('#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');
|
|
});
|
|
}
|
|
|
|
|
|
$('[data-rel=tooltip]').tooltip({container:'body'});
|
|
$('[data-rel=popover]').popover({container:'body'});
|
|
|
|
autosize($('textarea[class*=autosize]'));
|
|
|
|
$('textarea.limited').inputlimiter({
|
|
remText: '%n character%s remaining...',
|
|
limitText: 'max allowed : %n.'
|
|
});
|
|
|
|
$.mask.definitions['~']='[+-]';
|
|
$('.input-mask-date').mask('99/99/9999');
|
|
$('.input-mask-phone').mask('(999) 999-9999');
|
|
$('.input-mask-eyescript').mask('~9.99 ~9.99 999');
|
|
$(".input-mask-product").mask("a*-999-a999",{placeholder:" ",completed:function(){alert("You typed the following: "+this.val());}});
|
|
|
|
|
|
|
|
$( "#input-size-slider" ).css('width','200px').slider({
|
|
value:1,
|
|
range: "min",
|
|
min: 1,
|
|
max: 8,
|
|
step: 1,
|
|
slide: function( event, ui ) {
|
|
var sizing = ['', 'input-sm', 'input-lg', 'input-mini', 'input-small', 'input-medium', 'input-large', 'input-xlarge', 'input-xxlarge'];
|
|
var val = parseInt(ui.value);
|
|
$('#form-field-4').attr('class', sizing[val]).attr('placeholder', '.'+sizing[val]);
|
|
}
|
|
});
|
|
|
|
$( "#input-span-slider" ).slider({
|
|
value:1,
|
|
range: "min",
|
|
min: 1,
|
|
max: 12,
|
|
step: 1,
|
|
slide: function( event, ui ) {
|
|
var val = parseInt(ui.value);
|
|
$('#form-field-5').attr('class', 'col-xs-'+val).val('.col-xs-'+val);
|
|
}
|
|
});
|
|
|
|
|
|
|
|
//"jQuery UI Slider"
|
|
//range slider tooltip example
|
|
$( "#slider-range" ).css('height','200px').slider({
|
|
orientation: "vertical",
|
|
range: true,
|
|
min: 0,
|
|
max: 100,
|
|
values: [ 17, 67 ],
|
|
slide: function( event, ui ) {
|
|
var val = ui.values[$(ui.handle).index()-1] + "";
|
|
|
|
if( !ui.handle.firstChild ) {
|
|
$("<div class='tooltip right in' style='display:none;left:16px;top:-6px;'><div class='tooltip-arrow'></div><div class='tooltip-inner'></div></div>")
|
|
.prependTo(ui.handle);
|
|
}
|
|
$(ui.handle.firstChild).show().children().eq(1).text(val);
|
|
}
|
|
}).find('span.ui-slider-handle').on('blur', function(){
|
|
$(this.firstChild).hide();
|
|
});
|
|
|
|
|
|
$( "#slider-range-max" ).slider({
|
|
range: "max",
|
|
min: 1,
|
|
max: 10,
|
|
value: 2
|
|
});
|
|
|
|
$( "#slider-eq > span" ).css({width:'90%', 'float':'left', margin:'15px'}).each(function() {
|
|
// read initial values from markup and remove that
|
|
var value = parseInt( $( this ).text(), 10 );
|
|
$( this ).empty().slider({
|
|
value: value,
|
|
range: "min",
|
|
animate: true
|
|
|
|
});
|
|
});
|
|
|
|
$("#slider-eq > span.ui-slider-purple").slider('disable');//disable third item
|
|
|
|
|
|
$('#id-input-file-1 , #id-input-file-2').ace_file_input({
|
|
no_file:'No File ...',
|
|
btn_choose:'Choose',
|
|
btn_change:'Change',
|
|
droppable:false,
|
|
onchange:null,
|
|
thumbnail:false //| true | large
|
|
//whitelist:'gif|png|jpg|jpeg'
|
|
//blacklist:'exe|php'
|
|
//onchange:''
|
|
//
|
|
});
|
|
//pre-show a file name, for example a previously selected file
|
|
//$('#id-input-file-1').ace_file_input('show_file_list', ['myfile.txt'])
|
|
|
|
|
|
$('#id-input-file-3').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: 'small'//large | fit
|
|
//,icon_remove:null//set null, to hide remove/reset button
|
|
/**,before_change:function(files, dropped) {
|
|
//Check an example below
|
|
//or examples/file-upload.html
|
|
return true;
|
|
}*/
|
|
/**,before_remove : function() {
|
|
return true;
|
|
}*/
|
|
,
|
|
preview_error : function(filename, error_code) {
|
|
//name of the file that failed
|
|
//error_code values
|
|
//1 = 'FILE_LOAD_FAILED',
|
|
//2 = 'IMAGE_LOAD_FAILED',
|
|
//3 = 'THUMBNAIL_FAILED'
|
|
//alert(error_code);
|
|
}
|
|
|
|
}).on('change', function(){
|
|
//console.log($(this).data('ace_input_files'));
|
|
//console.log($(this).data('ace_input_method'));
|
|
});
|
|
|
|
|
|
//$('#id-input-file-3')
|
|
//.ace_file_input('show_file_list', [
|
|
//{type: 'image', name: 'name of image', path: 'http://path/to/image/for/preview'},
|
|
//{type: 'file', name: 'hello.txt'}
|
|
//]);
|
|
|
|
|
|
|
|
|
|
//dynamically change allowed formats by changing allowExt && allowMime function
|
|
$('#id-file-format').removeAttr('checked').on('change', function() {
|
|
var whitelist_ext, whitelist_mime;
|
|
var btn_choose
|
|
var no_icon
|
|
if(this.checked) {
|
|
btn_choose = "Drop images here or click to choose";
|
|
no_icon = "ace-icon fa fa-picture-o";
|
|
|
|
whitelist_ext = ["jpeg", "jpg", "png", "gif" , "bmp"];
|
|
whitelist_mime = ["image/jpg", "image/jpeg", "image/png", "image/gif", "image/bmp"];
|
|
}
|
|
else {
|
|
btn_choose = "Drop files here or click to choose";
|
|
no_icon = "ace-icon fa fa-cloud-upload";
|
|
|
|
whitelist_ext = null;//all extensions are acceptable
|
|
whitelist_mime = null;//all mimes are acceptable
|
|
}
|
|
var file_input = $('#id-input-file-3');
|
|
file_input
|
|
.ace_file_input('update_settings',
|
|
{
|
|
'btn_choose': btn_choose,
|
|
'no_icon': no_icon,
|
|
'allowExt': whitelist_ext,
|
|
'allowMime': whitelist_mime
|
|
})
|
|
file_input.ace_file_input('reset_input');
|
|
|
|
file_input
|
|
.off('file.error.ace')
|
|
.on('file.error.ace', function(e, info) {
|
|
//console.log(info.file_count);//number of selected files
|
|
//console.log(info.invalid_count);//number of invalid files
|
|
//console.log(info.error_list);//a list of errors in the following format
|
|
|
|
//info.error_count['ext']
|
|
//info.error_count['mime']
|
|
//info.error_count['size']
|
|
|
|
//info.error_list['ext'] = [list of file names with invalid extension]
|
|
//info.error_list['mime'] = [list of file names with invalid mimetype]
|
|
//info.error_list['size'] = [list of file names with invalid size]
|
|
|
|
|
|
/**
|
|
if( !info.dropped ) {
|
|
//perhapse reset file field if files have been selected, and there are invalid files among them
|
|
//when files are dropped, only valid files will be added to our file array
|
|
e.preventDefault();//it will rest input
|
|
}
|
|
*/
|
|
|
|
|
|
//if files have been selected (not dropped), you can choose to reset input
|
|
//because browser keeps all selected files anyway and this cannot be changed
|
|
//we can only reset file field to become empty again
|
|
//on any case you still should check files with your server side script
|
|
//because any arbitrary file can be uploaded by user and it's not safe to rely on browser-side measures
|
|
});
|
|
|
|
|
|
/**
|
|
file_input
|
|
.off('file.preview.ace')
|
|
.on('file.preview.ace', function(e, info) {
|
|
console.log(info.file.width);
|
|
console.log(info.file.height);
|
|
e.preventDefault();//to prevent preview
|
|
});
|
|
*/
|
|
|
|
});
|
|
|
|
$('#spinner1').ace_spinner({value:0,min:0,max:200,step:10, btn_up_class:'btn-info' , btn_down_class:'btn-info'})
|
|
.closest('.ace-spinner')
|
|
.on('changed.fu.spinbox', function(){
|
|
//console.log($('#spinner1').val())
|
|
});
|
|
$('#spinner2').ace_spinner({value:0,min:0,max:10000,step:100, touch_spinner: true, icon_up:'ace-icon fa fa-caret-up bigger-110', icon_down:'ace-icon fa fa-caret-down bigger-110'});
|
|
$('#spinner3').ace_spinner({value:0,min:-100,max:100,step:10, on_sides: true, icon_up:'ace-icon fa fa-plus bigger-110', icon_down:'ace-icon fa fa-minus bigger-110', btn_up_class:'btn-success' , btn_down_class:'btn-danger'});
|
|
$('#spinner4').ace_spinner({value:0,min:-100,max:100,step:10, on_sides: true, icon_up:'ace-icon fa fa-plus', icon_down:'ace-icon fa fa-minus', btn_up_class:'btn-purple' , btn_down_class:'btn-purple'});
|
|
|
|
//$('#spinner1').ace_spinner('disable').ace_spinner('value', 11);
|
|
//or
|
|
//$('#spinner1').closest('.ace-spinner').spinner('disable').spinner('enable').spinner('value', 11);//disable, enable or change value
|
|
//$('#spinner1').closest('.ace-spinner').spinner('value', 0);//reset to 0
|
|
|
|
|
|
//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
|
|
$('#absence_date_range').datepicker({
|
|
autoclose:true, format: 'dd/mm/yyyy', startDate: '1d',todayHighlight: 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(),
|
|
//minDate: new Date()-10,
|
|
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();
|
|
})
|
|
if(!ace.vars['old_ie']) $('#injury_time').datetimepicker({
|
|
format: 'DD/MM/YYYY h:mm A',//use this option to display seconds
|
|
defaultDate: new Date(),
|
|
maxDate: new Date(),
|
|
//minDate: new Date()-10,
|
|
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>
|
|
|
|
|
|
<form id="opd_form" method="post">
|
|
<div class="widget-box box box-warning"style="border-top:3px solid #d2d6de; border-top-color: #d2d6de">
|
|
<div class="widget-header" data-action="fullscreen" >
|
|
<h5 class="widget-title">Injury</h5>
|
|
<div class="widget-toolbar" style="float:right">
|
|
<div class="clearfix">
|
|
<div class="pull-right tableTools-container">
|
|
<div class="dt-buttons btn-overlap btn-group">
|
|
|
|
<a class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold" onclick="validate();" tabindex="0" aria-controls="dynamic-table" data-original-title="" title=""><span><i class="fa fa-floppy-o bigger-110 green"></i> <span class="hidden">Save</span></span></a>
|
|
|
|
<a class="dt-button buttons-print btn btn-white btn-primary btn-bold" tabindex="0" aria-controls="dynamic-table" data-original-title="" title=""><span><i class="fa fa-print bigger-110 grey"></i> <span class="hidden">Print</span></span></a>
|
|
|
|
<a class="dt-button buttons-print btn btn-white btn-primary btn-bold" data-action="fullscreen" tabindex="0" aria-controls="dynamic-table" data-original-title="" title=""><span><i class="fa fa fa-expand bigger-110 grey"></i> <span class="hidden">Maximize</span></span></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="widget-body ">
|
|
<div class="widget-main">
|
|
<div class="row">
|
|
<div class="col-xs-9 table-responsive">
|
|
<div class="widget-box box box-warning">
|
|
|
|
<div class="widget-body">
|
|
<div class="widget-main">
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
<div class="row">
|
|
|
|
<div class="col-sm-3">
|
|
<label class="control-label" for="appointment_id"><strong
|
|
style="font-size: 11px">Ticket No:</strong></label>
|
|
<?php
|
|
|
|
|
|
$ticket_no = getTableFieldValue('guest_appointment','max(appointment_id)');
|
|
|
|
?>
|
|
TCKT-<?php echo $ticket_no+1;?>
|
|
|
|
|
|
<input id="ticket_no" type="hidden" style="height: 30px" class="form-control" name="ticket_no" value="<?php echo"TCKT-".($ticket_no+1);?>" />
|
|
<input id="appointment_id" type="hidden"
|
|
style="height: 30px" class="form-control"
|
|
name="appointment_id" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-sm-3">
|
|
<label class="control-label" for="appointment_date"><strong style="font-size:11px">Reporting Time at OHC</strong></label>
|
|
|
|
<div class="input-group">
|
|
<input id="guest_id" name="guest_id" type="hidden" value="<?php echo $_REQUEST['flex_opd_id']?>"/>
|
|
<input id="appointment_type" name="appointment_type" type="hidden" value="I"/>
|
|
<input id="appointment_date" type="text" class="form-control" style="height:30px" name="appointment_date"/>
|
|
<span class="input-group-addon">
|
|
<i style="height:5px" class="fa fa-clock-o bigger-110"></i>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<label class="control-label" for="injury_time"><strong style="font-size:11px">Injury Time</strong></label>
|
|
|
|
<div class="input-group">
|
|
<input id="injury_time" type="text" class="form-control" style="height:30px" name="injury_time"/>
|
|
<span class="input-group-addon">
|
|
<i class="fa fa-clock-o bigger-110" style="height:5px"></i>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<?php $roleId=$_SESSION['RoleId'];
|
|
//echo $roleId ;
|
|
if ($roleId == 6) {
|
|
?>
|
|
|
|
<input type="hidden" name="doctor_attended_flag" id="doctor_attended_flag" value="N">
|
|
<input type="hidden" name="medicine_disbursement" value="N">
|
|
|
|
<?php }else{?>
|
|
|
|
<input type="hidden" name="doctor_attended_flag" id="doctor_attended_flag" value="Y">
|
|
<?php }
|
|
|
|
?>
|
|
|
|
<div class="space-6" ></div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
<label class="control-label" for="form-field-8"><strong style="font-size:11px">Injury Description</strong></label>
|
|
|
|
<textarea autofocus="autofocus" rows="3" cols="10" class="autosize-transition form-control" style="overflow: hidden; overflow-wrap: break-word; " name="complaints" id="complaints" placeholder="Injury Description" maxlength="500"></textarea>
|
|
</div>
|
|
|
|
<?php
|
|
|
|
if($roleId!=6){?>
|
|
<div class="col-sm-6">
|
|
<label class="control-label" for="form-field-8"><strong style="font-size:11px">On Examination Findings</strong></label>
|
|
|
|
<textarea rows="3" cols="10" class="autosize-transition form-control" style="overflow: hidden; overflow-wrap: break-word; "id="examination_remarks" name="examination_remarks" placeholder="On Examination Symptoms" maxlength="500"></textarea>
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<label class="control-label" for="form-field-8"><strong style="font-size:11px">Incident Location</strong></label>
|
|
<table class="table table-bordered table-hover simple-table">
|
|
<thead>
|
|
<tr class="active">
|
|
|
|
<th><strong style="font-size:11px">Business Unit</strong></th>
|
|
<th><strong style="font-size:11px">Sub Unit</strong></th>
|
|
<th><strong style="font-size:11px">Section</strong></th>
|
|
<th><strong style="font-size:11px">Sub-Section</strong></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr>
|
|
<td class="col-sm-3">
|
|
<select class="chosen-select form-control" id="injury_firm" name="injury_firm" data-placeholder="Business Unit" style="display: none;">
|
|
<option value=""> </option>
|
|
<?php echo generateOption('tbl_firms','firm_name','firm_id',$row['bu_id'],''); ?>
|
|
</select>
|
|
</td>
|
|
<td class="col-sm-3">
|
|
<select class="chosen-select form-control" id="injury_sbu" name="injury_sbu" data-placeholder="Department" style="display: none;">
|
|
<option value=""> </option>
|
|
<?php echo generateOption('sub_business_unit','sbu_name','sbu_id',$row['sbu_id'],''); ?>
|
|
</select>
|
|
</td>
|
|
<td class="col-sm-3">
|
|
<select class="chosen-select form-control" id="injury_section" name="injury_section" data-placeholder="Section" style="display: none;">
|
|
<option value=""> </option>
|
|
<?php echo generateOption('section','section_name','section_id',$row['section_id'],''); ?>
|
|
</select>
|
|
</td>
|
|
<td class="col-sm-3">
|
|
<select class="chosen-select form-control" id="injury_sub_section" name="injury_sub_section" data-placeholder="Sub-Section" style="display: none;">
|
|
<option value=""> </option>
|
|
<?php echo generateOption('sub_section','sub_section_name','sub_section_id',$row['sub_section_id'],''); ?>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
if ($roleId != 6) {
|
|
?>
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<label class="control-label" for="form-field-8"><strong style="font-size:11px">Injury</strong></label>
|
|
<table class="table table-bordered table-hover simple-table">
|
|
<thead>
|
|
<tr class="active">
|
|
|
|
<th><strong style="font-size:11px">Type</strong></th>
|
|
<th><strong style="font-size:11px">Part</strong></th>
|
|
<th><strong style="font-size:11px">Classification</strong></th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr>
|
|
<td class="col-sm-4">
|
|
<select multiple="" class="chosen-select form-control" id="injury_type" name="injury_type[]" data-placeholder="Injury Type...">
|
|
<?php echo generateOption('injury_type','injury_type_name','injury_type_id',''); ?>
|
|
</select>
|
|
</td>
|
|
<td class="col-sm-4">
|
|
<select multiple="" class="chosen-select form-control" id="injury_part" name="injury_part[]" data-placeholder="Injury Part.." >
|
|
<?php echo generateOption('injury_part','inj_name','inj_id','',''); ?>
|
|
</select>
|
|
</td>
|
|
<td class="col-sm-4">
|
|
<select multiple="" class="chosen-select form-control" id="injury_class" name="injury_class[]" data-placeholder="Injury Classification..">
|
|
<?php echo generateOption('injury_class','inj_class_name','inj_class_id','',''); ?>
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
<div class="row" >
|
|
<div class="col-sm-6">
|
|
<label class="control-label" for="remarks"><strong style="font-size:11px">Procedure</strong></label>
|
|
<textarea id="remarks" name="remarks" placeholder="Procedure.." rows="3" cols="6" class="autosize-transition form-control" style="overflow: hidden; overflow-wrap: break-word; "></textarea>
|
|
|
|
</div>
|
|
</div>
|
|
<?php
|
|
|
|
|
|
|
|
if ($roleId != 6) {
|
|
?>
|
|
|
|
|
|
<div class="row" style="margin-top:40px">
|
|
<div class="col-sm-12 table-responsive">
|
|
<table id="treatmentTable<?php echo $row_history['appointment_id']?>" class="table table-striped table-bordered">
|
|
<thead>
|
|
<tr class="active" >
|
|
<th style="font-size:11px; text-align: center;" >Medicine</th>
|
|
<th style="font-size:11px; text-align: center;">Dosage</th>
|
|
<th style="font-size:11px; text-align: center;">For Days</th>
|
|
<th style="font-size:11px; text-align: center;">Qty</th>
|
|
<th style="font-size:11px; text-align: center;">Price Per Unit</th>
|
|
<th style="font-size:11px; text-align: center;">Stock</th>
|
|
<th style="font-size:11px; text-align: center;">Issued</th>
|
|
<th style="font-size:11px; text-align: center;">Total Price</th>
|
|
<th style="font-size:11px; text-align: center;">
|
|
<button type="button" onclick="addRow('<?php echo $row_history['appointment_id']?>')" class="btn btn-info btn-sm" id="addrow<?php echo $row_history['appointment_id']?>">
|
|
<span class="glyphicon glyphicon-plus"></span>
|
|
|
|
</button>
|
|
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr style="width:40%">
|
|
<td class="col-sm-2" style="width:15%">
|
|
<select class="chosen-select form-control" onchange="getItemDetails(this.value,'current_stock<?php echo $row_history['appointment_id']?>_0','current_stock<?php echo $row_history['appointment_id']?>0','current_rate<?php echo $row_history['appointment_id']?>_0','current_rate<?php echo $row_history['appointment_id']?>0','<?php echo $row_history['appointment_id']?>_0', '0');" id="treatment_item<?php echo $row_history['appointment_id']?>_0" name="treatment_item0" data-placeholder="Treatment...">
|
|
<option value=""> </option>
|
|
<?php echo generateMedicineOptions($row_history_treatment['item_id'],''); ?>
|
|
</select>
|
|
</td>
|
|
<td class="col-sm-2" style="width:15%">
|
|
<select class="chosen-select form-control" id="treatment_item_dosage<?php echo $row_history['appointment_id']?>_0"name="treatment_item_dosage0" data-placeholder="Dosages..." onchange="getFrequenceyQty(this.value,'frequency_qty<?php echo $row_history['appointment_id']?>_0','dosage<?php echo $row_history['appointment_id']?>_0','<?php echo $row_history['appointment_id']?>','0');">
|
|
<option value=""> </option>
|
|
<?php echo generateOption('medicine_frequency','medicine_frequency','frequency_id','',''); ?>
|
|
</select>
|
|
</td>
|
|
<td class="col-sm-1" style="width:8%">
|
|
<input type="number" style="height:25px;font-size:12px" class="form-control"name="treatment_item_days0" id="treatment_item_days<?php echo $row_history['appointment_id']?>_0" value="1" onblur="updateTotalMedicineQty('frequency_qty<?php echo $row_history['appointment_id']?>_0','treatment_item_days<?php echo $row_history['appointment_id']?>_0','treatment_item_total<?php echo $row_history['appointment_id']?>_0','treatment_item_total_div0')"/>
|
|
</td>
|
|
|
|
<td class="col-sm-1" style="width:5%">
|
|
<input type="hidden" name="frequency_qty0" id="frequency_qty<?php echo $row_history['appointment_id']?>_0" />
|
|
<input type="hidden" name="dosage0" id="dosage<?php echo $row_history['appointment_id']?>_0" />
|
|
|
|
|
|
<div style="text-align:center" id="treatment_item_total_div<?php echo $row_history['appointment_id']?>0">
|
|
</div>
|
|
<input type="hidden" style="height:25px;font-size:12px" class="form-control"name="treatment_item_total0" id="treatment_item_total<?php echo $row_history['appointment_id']?>_0" />
|
|
</td>
|
|
|
|
<td class="col-sm-1" style="width:5%">
|
|
<div style="text-align:center" id="current_rate<?php echo $row_history['appointment_id']?>0" >
|
|
</div>
|
|
|
|
<input type="hidden" style="height:25px;font-size:12px" class="form-control" name="current_rate0" id="current_rate<?php echo $row_history['appointment_id']?>_0" />
|
|
</td>
|
|
<td class="col-sm-1" style="width:5%">
|
|
<div style="text-align:center" id="current_stock<?php echo $row_history['appointment_id']?>0">
|
|
</div>
|
|
<input type="hidden" name="current_stock0" id="current_stock<?php echo $row_history['appointment_id']?>_0" />
|
|
<input type="hidden" name="treatment_id0" id="treatment_id_0"/>
|
|
|
|
</td>
|
|
|
|
<td class="col-sm-1" style="width:5%">
|
|
<input type="text" style="height:25px;font-size:12px" class="form-control"name="treatment_item_qtygvn0" disabled id="treatment_item_qtygvn<?php echo $row_history['appointment_id']?>_0" onchange="itemLevelTotol('treatment_item_qtygvn<?php echo $row_history['appointment_id']?>_0','current_rate<?php echo $row_history['appointment_id']?>_0','treatment_item_total_amount<?php echo $row_history['appointment_id']?>_0','treatment_item_total_amount<?php echo $row_history['appointment_id']?>0');checkQty(); "/>
|
|
</td>
|
|
|
|
<td class="col-sm-1" style="width:5%">
|
|
<div style="text-align:center" id="treatment_item_total_amount<?php echo $row_history['appointment_id']?>0"></div>
|
|
<input type="hidden" style="height:25px;font-size:12px" class="form-control"name="treatment_item_total_amount0" id="treatment_item_total_amount<?php echo $row_history['appointment_id']?>_0" />
|
|
<td class="col-sm-1" style="width:5%"><a class="deleteRow"></a>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<td colspan="7" style="text-align: right;">
|
|
<strong style="font-size:11px">
|
|
Total Amount :<strong></td>
|
|
<td colspan="2" >
|
|
<input type="hidden"
|
|
name="count_treatment_item_new" id="count_treatment_item_new"
|
|
value="1" />
|
|
<input type="hidden" name="count_treatment_item" id="count_treatment_item<?php echo $row_history['appointment_id']?>" value="1" />
|
|
<input type="hidden" style="height:25px;font-size:12px;width:60px;align:center" class="form-control" name="order_level_total" id="order_level_total" />
|
|
<div id="order_level_total_div" style="margin-left:30px"></div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-3">
|
|
<label class=" control-label " for="form-field-8"><strong
|
|
` style="font-size: 11px">Medicine Disbursment</strong>
|
|
</label>
|
|
</div>
|
|
<div class="col-sm-1">
|
|
<input type="radio" name="medicine_disbursement" value="Y" onchange="setFieldDisableOrEnable(this.value)">
|
|
Yes<br>
|
|
</div>
|
|
<div class="col-sm-1">
|
|
<input type="radio" name="medicine_disbursement" value="N" checked onchange="setFieldDisableOrEnable(this.value)">
|
|
No
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-sm-6">
|
|
<label class="control-label" for="referral"><strong style="font-size:11px">Referral</strong></label>
|
|
<textarea name="referral" rows="4" cols="8"id="referral" placeholder="Referral" class="autosize-transition form-control" style="overflow: hidden; overflow-wrap: break-word; "></textarea>
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
<label class="control-label" for="followup"><strong style="font-size:11px">Follow-up</strong></label>
|
|
<textarea id="followup" rows="4" cols="8"name="followup" placeholder="Follow Up" class="autosize-transition form-control" style="overflow: hidden; overflow-wrap: break-word; "></textarea>
|
|
</div>
|
|
|
|
</div>
|
|
<?php } ?>
|
|
|
|
</div><!-- /.col-xs-12 -->
|
|
</div><!--row end-->
|
|
|
|
</div><!--end of widget-main-->
|
|
</div><!--end of widget-body-->
|
|
</div><!--end of widget-box-->
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-3 table-responsive">
|
|
<div class="widget-box box box-danger">
|
|
|
|
<div class="widget-body">
|
|
<div class="widget-main">
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<label class="control-label" for="form-field-select-1"><strong style="font-size:11px">Emergency?</strong></label>
|
|
|
|
<select class="form-control" style="height:30px;" id="isEmergency" name="isEmergency">
|
|
<option value="0" selected>No</option>
|
|
<option value="1">Yes</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="space-6"></div>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div>
|
|
<input type="number" style="height:30px;" class="col-xs-4" placeholder="SBP" id="sbp" name="sbp">
|
|
<input type="number" style="height:30px;"class="col-xs-4" id="DBP" name="dbp" placeholder="DBP">
|
|
<input type="number" style="height:30px;" class="col-xs-4" id="heart_rate" name="heart_rate" placeholder="Heart Rate">
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="space-6"></div>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div>
|
|
<input type="number" style="height:30px;" class="col-xs-4" placeholder="FBS" id="fbs" name="fbs">
|
|
<input type="number" style="height:30px;" class="col-xs-4" id="rbs" name="rbs" placeholder="RBS">
|
|
<input type="number" style="height:30px;" class="col-xs-4" id="ppbs" name="ppbs" placeholder="PPBS">
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php $roleId=$_SESSION['RoleId'];
|
|
|
|
if($roleId!=6){?>
|
|
<div class="space-6"></div>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<label class="control-label" for="injury_part"><strong style="font-size:11px">Affected Body Parts</strong></label>
|
|
<select multiple="" class="chosen-select form-control" id="injury_part" name="injury_part[]" data-placeholder="Affected Body Parts..">
|
|
<?php echo generateOption('injury_part','inj_name','inj_id','',''); ?>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="space-6"></div>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<label class="control-label" for="health_advice_name"><strong style="font-size:11px">Health Advices</strong></label>
|
|
<select multiple="" class="chosen-select form-control" id="health_advice_name" name="health_advice_name[]" data-placeholder="Health Advices.." >
|
|
<?php echo generateOption('health_advice','health_advice_name','health_advice_id','',''); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="space-6"></div>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<label class="control-label" for="additional_advices"><strong style="font-size:11px">Recommended Tests For Checkup</strong></label>
|
|
<select multiple="" class="chosen-select form-control" id="recommended_test" name="recommended_test[]" data-placeholder="Doctor Recommended Tests.." >
|
|
<?php echo generateOptionForMultiple('checkup_form_section','section_name','section_id',$row['tests'],''); ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="space-6"></div>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<label class="control-label" for="additional_advices"><strong style="font-size:11px">Additional Precautions</strong></label>
|
|
<textarea name="remarks" placeholder="Additional Precautions.." rows="3" cols="8" id="remarks" class="autosize-transition form-control" style="overflow: hidden; overflow-wrap: break-word; "></textarea>
|
|
|
|
</div>
|
|
</div>
|
|
<?php }?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<script>
|
|
addRow('');
|
|
addRow('');
|
|
var flag=0;
|
|
function addRow(appointment_id){
|
|
var counter=$("#count_treatment_item").val();
|
|
var itemOptions="<?php echo generateOption('tbl_items','item_name','item_id','',''); ?>";
|
|
var itemDosages="<?php echo generateOption('medicine_frequency','medicine_frequency','frequency_id','',''); ?>";
|
|
|
|
var newRow = $("<tr style=\"width:70%\">");
|
|
var cols = "";
|
|
var select_treatment="";
|
|
select_treatment+="<select onchange=\"getItemDetails(this.value,'current_stock"+"_"+counter+"','current_stock_div"+counter+"','current_rate"+"_"+counter+"','current_rate_div"+counter+"','"+appointment_id+"', '"+counter+"');\" class='chosen-select form-control'";
|
|
select_treatment+="id=\"treatment_item"+"_"+counter+"\"name=\"treatment_item"+counter+"\"data-placeholder=\"Treatment...\"";
|
|
//select_treatment+="style=\"display: none;\"";
|
|
select_treatment+=">";
|
|
|
|
select_treatment+="<option value=\"\"> </option>";
|
|
select_treatment+=itemOptions
|
|
select_treatment+="</select>";
|
|
|
|
cols += '<td style=\"width:15%\">'+select_treatment+'</td>';
|
|
var select_dosage="";
|
|
select_dosage+="<select onchange=\"getFrequenceyQty(this.value,'frequency_qty"+"_"+counter+"','dosage"+"_"+counter+"','"+appointment_id+"', '"+counter+"');\" class='chosen-select form-control'";
|
|
select_dosage+="id=\"treatment_item_dosage"+"_"+counter+"\"name=\"treatment_item_dosage"+counter+"\"data-placeholder=\"Dosage...\"";
|
|
//select_dosage+="style=\"display: none;\"";
|
|
select_dosage+=">";
|
|
|
|
select_dosage+="<option value=\"\"> </option>";
|
|
select_dosage+=itemDosages
|
|
select_dosage+="</select>";
|
|
|
|
cols += '<td style=\"width:15%\" >'+select_dosage+'</td>';
|
|
cols += '<td style=\"width:10%\"><input type=\"hidden\" name=\"treatment_id'+counter+'" id=\"treatment_id'+'_'+counter+'" ><input type="number" style="height:25px;font-size:12px" class="form-control"id ="treatment_item_days'+'_'+counter+'" value="1" onblur="updateTotalMedicineQty(\'frequency_qty'+'_'+counter+'\',\'treatment_item_days'+'_'+counter+'\',\'treatment_item_total_'+counter+'\',\'treatment_item_total_div'+counter+'\')" name="treatment_item_days'+ counter + '"/></td>';
|
|
cols += '<td style=\"width:5%\" ><div style="text-align:center" id="treatment_item_total_div'+counter+'""></div><input type="hidden" style="height:25px;font-size:12px" class="form-control"id="treatment_item_total_'+counter+'" name="treatment_item_total'+appointment_id + counter + '" readonly/></td>';
|
|
cols += '<td style=\"width:5%\"><input type="hidden" name="frequency_qty'+counter+'" id="frequency_qty'+'_'+counter+'" /><input type="hidden" name="dosage'+counter+'" id="dosage'+appointment_id+'_'+counter+'" /> <div style="text-align:center" id="current_rate_div'+counter+'" "></div><input type="hidden" style="height:25px;font-size:12px" class="form-control" id="current_rate'+'_'+counter+'" name="current_rate' + counter + '" onblur="updatePrice(\'treatment_item_qtygvn'+'_'+counter+'\',\'treatment_item'+'_'+counter+'\',\'current_rate'+'_'+counter+'\',\'current_stock'+'_'+counter+'\',\'price'+'_'+counter+'\')" /></td>';
|
|
cols += '<td style=\"width:5%\"><div style="text-align:center" id="current_stock_div'+counter + '" ></div><input type="hidden" style="height:25px;font-size:12px" class="form-control" id="current_stock'+'_'+counter+'" name="current_stock' + counter + '" /></td>';
|
|
cols += '<td style=\"width:5%\"><input type="text" style="height:25px;font-size:12px" class="form-control" id="treatment_item_qtygvn'+'_'+counter+'" name="treatment_item_qtygvn' + counter + '" onchange="itemLevelTotol(\'treatment_item_qtygvn'+'_'+counter+'\',\'current_rate'+'_'+counter+'\',\'treatment_item_total_amount'+'_'+counter+'\',\'treatment_item_total_amount_div'+counter+'\');checkQty()" /></td>';
|
|
|
|
cols += '<td style=\"width:5%\"><div style="text-align:center" id="treatment_item_total_amount_div'+counter+'"></div><input type="hidden" style="height:25px;font-size:12px" class="form-control" id="treatment_item_total_amount'+'_'+counter+'" name="treatment_item_total_amount' + counter + '"/></td>';
|
|
if(counter>0)
|
|
cols += '<td style=\"width:5%\"><a href="#"><i class="ace-icon fa fa-trash-o bigger-130"></i></a></td>';
|
|
else
|
|
cols += '<td style=\"width:5%\"></td>';
|
|
|
|
newRow.append(cols);
|
|
$("#treatmentTable").append(newRow);
|
|
|
|
if(parseInt(counter)>2){
|
|
// $('.chosen-select').chosen({allow_single_deselect:true});
|
|
//$('.chosen-select').next().css({'width': $('#treatment_item'+counter).parent().width()});
|
|
$('#treatment_item_dosage'+"_"+counter).chosen({allow_single_deselect:true});
|
|
$('#treatment_item_dosage'+"_"+counter).next().css({'width': '100%'});
|
|
|
|
$('#treatment_item'+"_"+counter).chosen({allow_single_deselect:true});
|
|
$('#treatment_item'+"_"+counter).next().css({'width': '100%'});
|
|
|
|
}
|
|
if(parseInt($("#count_treatment_item_new").val())>parseInt($("#count_treatment_item").val()) ){
|
|
$('#treatment_item_dosage'+"_"+counter).chosen({allow_single_deselect:true});
|
|
$('#treatment_item_dosage'+"_"+counter).next().css({'width': '100%'});
|
|
|
|
$('#treatment_item'+"_"+counter).chosen({allow_single_deselect:true});
|
|
$('#treatment_item'+"_"+counter).next().css({'width': '100%'});
|
|
flag=1;
|
|
}else if(flag==1 && parseInt(counter)==2){
|
|
$('#treatment_item_dosage'+"_"+counter).chosen({allow_single_deselect:true});
|
|
$('#treatment_item_dosage'+"_"+counter).next().css({'width': '100%'});
|
|
|
|
$('#treatment_item'+"_"+counter).chosen({allow_single_deselect:true});
|
|
$('#treatment_item'+"_"+counter).next().css({'width': '100%'});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
counter++;
|
|
$("#count_treatment_item"+appointment_id).val(counter);
|
|
$("#count_treatment_item_new").val(counter);
|
|
|
|
|
|
//resizeChosen();
|
|
//jQuery(window).on('resize', resizeChosen);
|
|
|
|
$("#treatmentTable").on("click", ".fa-trash-o", function (event) {
|
|
$(this).closest("tr").remove();
|
|
counter -= 1
|
|
$("#count_treatment_item").val(counter);
|
|
});
|
|
|
|
var valueChecked= $('input[name=medicine_disbursement]:checked').val();
|
|
|
|
setFieldDisableOrEnable(valueChecked)
|
|
}
|
|
|
|
|
|
|
|
function checkQty(){
|
|
|
|
|
|
var counter=$("#count_treatment_item").val();
|
|
for(var i=0;i<counter;i++){
|
|
var treatment_qty=$("#treatment_item_total_"+i).val();
|
|
var issued_qty=$("#treatment_item_qtygvn_"+i).val();
|
|
if(issued_qty==null || issued_qty==''){
|
|
issued_qty=0;
|
|
}
|
|
if(issued_qty>treatment_qty){
|
|
BootstrapDialog.alert(' Issue Qty should be less than or equal to Treatment Qty .!!!');
|
|
|
|
return false;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
function setFieldDisableOrEnable(value){
|
|
var count=$("#count_treatment_item").val();
|
|
if(value=='Y'){
|
|
// $("[name='field07']").prop("disabled", false);
|
|
for(var i=0;i<count;i++){
|
|
$("#treatment_item_qtygvn_"+i).prop("disabled", false);
|
|
}
|
|
}else if(value=='N'){
|
|
|
|
for(var i=0;i<count;i++){
|
|
$("#treatment_item_qtygvn_"+i).prop("disabled", true);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
</script>
|