2118 lines
86 KiB
PHP
2118 lines
86 KiB
PHP
<script type="text/javascript">
|
|
function delete_opd_document(delete_id) {
|
|
$("#medical_doc_id").on("click", ".glyphicon-trash", function(event) {
|
|
$('#medical_doc_' + delete_id).remove();
|
|
});
|
|
$.ajax({
|
|
url: "delete_opd_document.php",
|
|
data: {
|
|
delete_id: delete_id
|
|
},
|
|
method: "POST",
|
|
|
|
success: function(data) {
|
|
BootstrapDialog.alert('Document deleted successfully ');
|
|
|
|
|
|
//getMedicalDocData();
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error deleting document');
|
|
}
|
|
});
|
|
}
|
|
var docAttendedNotDoc = false;
|
|
var appointment_id = '<?php echo $row['appointment_id']?>'
|
|
|
|
<?php if ($rolecode !='DOC' && $row['doctor_attended_flag']=='Y') { ?>
|
|
docAttendedNotDoc = true;
|
|
$('textarea').prop('readonly', true);
|
|
$('#followup_remarks').prop('readonly', false);
|
|
$("div .tag").children().prop('readonly', true);
|
|
$('#sbp').attr("readonly", "readonly");
|
|
$('#DBP').attr("readonly", "readonly");
|
|
$('#heart_rate').attr("readonly", "readonly");
|
|
$('#fbs').attr("readonly", "readonly");
|
|
$('#rbs').attr("readonly", "readonly");
|
|
$('#ppbs').attr("readonly", "readonly");
|
|
$('#temperature').attr("readonly", "readonly");
|
|
$('#spo2_percent').attr("readonly", "readonly");
|
|
$('#token_no').attr("readonly", "readonly");
|
|
$('#appointment_date').attr("readonly", "readonly");
|
|
$('#out_time').attr("readonly", "readonly");
|
|
$('#injury_type').prop('disabled', true);
|
|
$('#injury_part').prop('disabled', true);
|
|
$('#injury_class').prop('disabled', true);
|
|
$('#injury_sbu').prop('disabled', true);
|
|
$('#injury_firm').prop('disabled', true);
|
|
$('#injury_sub_section').prop('disabled', true);
|
|
$('#injury_section').prop('disabled', true);
|
|
$('#health_advice_name').prop('disabled', true);
|
|
$('#isEmergency').prop('disabled', true);
|
|
<?php } ?>
|
|
|
|
|
|
|
|
/**
|
|
* Get Medicine function to be used for populating the OPD/Injury Medicine Recommendation section.
|
|
*/
|
|
function getMedicine() {
|
|
if (!ace.vars['old_ie']) $('#appointment_date').datetimepicker({
|
|
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
|
|
defaultDate: new Date("<?php echo $row['appointment_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();
|
|
});
|
|
|
|
|
|
|
|
//$("#appointment_date").val(appointment_date_format);
|
|
|
|
appointment_id = '<?php echo $row['appointment_id']?>'
|
|
//alert(appointment_id);
|
|
$("#appointment_id").val(appointment_id);
|
|
var content = "";
|
|
content += "<thead>"
|
|
content += "<tr class=\"active success\" >"
|
|
content += "<th style=\"font-size:9px; text-align: center;\" >Medicine</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Frequency</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Timing</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Admin. Route</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Duration</th>"
|
|
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Dose Qty</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Total Qty</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Available Qty</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">Qty Issued</th>"
|
|
content += "<th style=\"font-size:9px; text-align: center;\">"
|
|
<?php
|
|
// if doctor consulted then only doctor should be allowed to add additional medicines
|
|
if ($row ['doctor_attended_flag'] != 'Y' || $rolecode == 'DOC') {
|
|
?>
|
|
|
|
content +=
|
|
"<a onclick=\"addRow('<?php echo $row['appointment_id']?>')\" id=\"addrow<?php echo $row_history['appointment_id']?>\">"
|
|
content += "<i class=\"ace-icon fa fa-plus-square\"></i></a>"
|
|
content +=
|
|
"<a onclick=\"addRowExternal('<?php echo $row['appointment_id']?>')\" id=\"addrowExternal<?php echo $row_history['appointment_id']?>\">"
|
|
content += "<i class=\"ace-icon fa fa-plus-square-o\"></i></a>"
|
|
<?php }?>
|
|
|
|
content += "</th></tr></thead>";
|
|
|
|
|
|
content += "<tbody>";
|
|
$("#treatmentTable").html(content);
|
|
<?php $row_treatment =null;?>
|
|
|
|
|
|
var count = 0;
|
|
<?php
|
|
|
|
if ($num_rows_treatment > 0) {
|
|
while ( $row_treatment = @mysqli_fetch_array ( $result_for_treatment ) ) {
|
|
$unit_id = getFieldFromTable ( "unit_id", "tbl_items", "item_id", $row_treatment ['item_id'] );
|
|
|
|
$current_stock= getStockQtyAtDispensaryLevel($row_treatment ['item_id'],$ohc_type_id);
|
|
|
|
?>
|
|
content = "";
|
|
content += "<tr style=\"width:70%\">"
|
|
content += "<td class=\"col-sm-2\" id=\"treatment_item_td_" + count + "\">";
|
|
//case when already reviewed by the doctor
|
|
<?php if ($rolecode != 'DOC' && $row['doctor_attended_flag']=='Y') { ?>
|
|
|
|
content += "<input id=\"treatment_item_" + count + "\" name=\"treatment_item" + count +
|
|
"\" value='<?php echo $row_treatment['item_id']?>' type=\"hidden\">"
|
|
content += "<?php echo getItemWithFormName($row_treatment['item_id']);?></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<input id=\"treatment_item_dosage" + '_' + count + "\" name=\"treatment_item_dosage" + count +
|
|
"\" value='<?php echo $row_treatment['frequency_id']?>'type=\"hidden\">"
|
|
content +=
|
|
"<?php echo getTableFieldValue("medicine_frequency", "medicine_frequency","frequency_id",$row_treatment['frequency_id']);?></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<input id=\"timings" + '_' + count + "\" name=\"timings" + count +
|
|
"\" value='<?php echo $row_treatment['timing_id']?>'type=\"hidden\">"
|
|
content +=
|
|
"<?php echo getTableFieldValue("medicine_timings", "medicine_timing","timing_id",$row_treatment['timing_id']);?></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<input id=\"treatment_item_dosage_category" + '_' + count + "\" name=\"treatment_item_dosage_category" +
|
|
count + "\" value='<?php echo $row_treatment['dosage_category_id']?>'type=\"hidden\">"
|
|
content +=
|
|
"<?php echo getTableFieldValue("dosage_category", "dosage_category","dosage_category_id",$row_treatment['dosage_category_id']);?></td>"
|
|
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['treatment_id']?>\"></td>"
|
|
content += "<td class=\"col-sm-1\" style='width:1%'>"
|
|
content += "<center><?php echo $row_treatment['for_days']?></center>"
|
|
content += "<input type=\"hidden\" name=\"treatment_item_days" + count + "\" id=\"treatment_item_days" + '_' +
|
|
count + "\" value='<?php echo $row_treatment['for_days']?>'/>"
|
|
|
|
//case when directly dispensary is handling
|
|
|
|
<?php }else if ($rolecode == 'DIS' && $row['doctor_discussed']!='Y') {?>
|
|
|
|
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"treatment_item" + '_' + count +
|
|
"\" name=\"treatment_item" + count + "\" onchange=\"getItemDetails(this.value,'current_stock" + "_" + count +
|
|
"','current_stock_div" + count + "','" + appointment_id + "', '" + count +
|
|
"');\" data-placeholder=\"Treatment...\">"
|
|
content +=
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(form_name,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' and is_prescription!='1' order by item_name",$row_treatment['item_id'],'item_id', 'item_name','',''); ?></select></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"treatment_item_dosage" + '_' + count +
|
|
"\" name=\"treatment_item_dosage" + count +
|
|
"\" data-placeholder=\"Dosages...\" onchange=\"getFrequenceyQty(this.value,'frequency_qty" + "_" + count +
|
|
"','dosage" + "_" + count + "','" + appointment_id + "', '" + count + "');\">"
|
|
content += "<option value=''>N/A</option>";
|
|
content +=
|
|
"<?php echo generateOption('medicine_frequency','medicine_frequency','frequency_id',$row_treatment['frequency_id'],''); ?>"
|
|
content += "</select></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"timings" + '_' + count +
|
|
"\" name=\"timings" + count + "\" data-placeholder=\"Timings...\">"
|
|
content += "<option value=''>N/A</option>";
|
|
content +=
|
|
"<?php echo generateOption('medicine_timings','medicine_timing','timing_id',$row_treatment['timing_id'],''); ?>"
|
|
content += "</select></td>"
|
|
|
|
|
|
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select id=\"treatment_item_dosage_category" + '_' + count +
|
|
"\" class=\"form-control select2\" name=\"treatment_item_dosage_category" + count +
|
|
"\" value='<?php echo $row_treatment['dosage_category_id']?>'>"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content +=
|
|
"<?php echo generateOption("dosage_category", "dosage_category","dosage_category_id",$row_treatment['dosage_category_id'],'');?></td>"
|
|
content += "</select>"
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['treatment_id']?>\"></td>"
|
|
content += "<td class=\"col-sm-1\"style='width:7%'>"
|
|
content +=
|
|
"<input type=\"number\" style=\"height:25px;font-size:11px\" class=\"form-control\" name=\"treatment_item_days" +
|
|
count + "\" id=\"treatment_item_days" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['for_days']?>\" onchange=\"updateTotalMedicineQtyNew('frequency_qty" +
|
|
"_" + count + "','treatment_item_days" + '_' + count + "'," + count + ");\"/>"
|
|
|
|
|
|
<?php }else{?>
|
|
//When its doctor
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"treatment_item" + '_' + count +
|
|
"\" name=\"treatment_item" + count + "\" onchange=\"getItemDetails(this.value,'current_stock" + "_" + count +
|
|
"','current_stock_div" + count + "','" + appointment_id + "', '" + count +
|
|
"');\" data-placeholder=\"Treatment...\">"
|
|
content +=
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(form_name,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' order by item_name",$row_treatment['item_id'],'item_id', 'item_name','',''); ?></select></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"treatment_item_dosage" + '_' + count +
|
|
"\" name=\"treatment_item_dosage" + count +
|
|
"\" data-placeholder=\"Dosages...\" onchange=\"getFrequenceyQty(this.value,'frequency_qty" + "_" + count +
|
|
"','dosage" + "_" + count + "','" + appointment_id + "', '" + count + "');\">"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content +=
|
|
"<?php echo generateOption('medicine_frequency','medicine_frequency','frequency_id',$row_treatment['frequency_id'],''); ?>"
|
|
content += "</select></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"timings" + '_' + count +
|
|
"\" name=\"timings" + count + "\" data-placeholder=\"Timings...\" >"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content +=
|
|
"<?php echo generateOption('medicine_timings','medicine_timing','timing_id',$row_treatment['timing_id'],''); ?>"
|
|
content += "</select></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select id=\"treatment_item_dosage_category" + '_' + count +
|
|
"\" style=\"width:100%\" class=\"select2 form-control\" name=\"treatment_item_dosage_category" + count +
|
|
"\" value='<?php echo $row_treatment['dosage_category_id']?>'>"
|
|
content += "<option value=''>N/A</option>";
|
|
content +=
|
|
"<?php echo generateOption("dosage_category", "dosage_category","dosage_category_id",$row_treatment['dosage_category_id'],'');?></td>"
|
|
content += "</select>"
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['treatment_id']?>\"></td>"
|
|
content += "<td class=\"col-sm-1\" style='width:7%'>"
|
|
content +=
|
|
"<input type=\"number\" style=\"height:25px;font-size:11px\" class=\"form-control\" name=\"treatment_item_days" +
|
|
count + "\" id=\"treatment_item_days" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['for_days']?>\" onchange=\"updateTotalMedicineQtyNew('frequency_qty" +
|
|
"_" + count + "','treatment_item_days" + '_' + count + "'," + count + ");\"/>"
|
|
<?php }?>
|
|
|
|
|
|
|
|
//content+="</td>"
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%;\">"
|
|
content +=
|
|
"<input type=\"hidden\" class=\"form-control\" style=\"height:25px;font-size:12px\" name=\"frequency_qty" +
|
|
count + "\" id=\"frequency_qty" + '_' + count +
|
|
"\" value=\"<?php echo getMedicineFrequencyQty($row_treatment['frequency_id'])?>\"/>"
|
|
content +=
|
|
"<input type=\"number\" class=\"form-control\" style=\"height:25px;font-size:12px\" onblur=\"updateTotalMedicineQtyNew('frequency_qty" +
|
|
"_" + count + "','treatment_item_days" + '_' + count + "'," + count + ");\" name=\"dose_qty" + count +
|
|
"\" id=\"dose_qty" + '_' + count + "\" value=\"<?php echo $row_treatment['item_qty']?>\"/>"
|
|
content += "<input type=\"hidden\" name=\"dosage" + count + "\" id=\"dosage" + '_' + count + "\" />"
|
|
content += "</td><td class=\"col-sm-1\" style=\"width:5%\"><span id=\"treatment_item_total_div" + count +
|
|
"\"><?php echo $row_treatment['item_qty']?></span> <input type=\"hidden\" name=\"treatment_item_total" +
|
|
count + "\" value=\"<?php echo $row_treatment['item_qty']?>\" id=\"treatment_item_total" + '_' + count +
|
|
"\" readonly />"
|
|
content += "</td>"
|
|
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%\">"
|
|
content += "<div style=\"text-align:right\" id=\"current_stock_div" + count + "\">"
|
|
content +=
|
|
"<center><?php echo $current_stock?> <?php echo isset($unitMap[$unit_id])? $unitMap[$unit_id]:''?></center>"
|
|
content += "</div>"
|
|
content += "<input type=\"hidden\" name=\"current_stock" + count +
|
|
"\" value=\"<?php echo $current_stock?>\"id=\"current_stock" + '_' + count + "\" />"
|
|
|
|
content += "</td>"
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%\" id=\"qty_td" + count + "\">"
|
|
if (jQuery.inArray("<?php echo $row_treatment['item_id']?>", groupItems) != -1) {
|
|
content += "<label id='group_" + count + "' onclick='openGroup(" + count +
|
|
")'><span class=\"ace-icon fa fa-medkit\"><span></label>"
|
|
content +=
|
|
"<input type=\"hidden\" style=\"height:25px;font-size:12px;width:30px\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
count + "\" id=\"treatment_item_qtygvn_hidden" + '_' + count + "\" value=\"1\" />"
|
|
content += "<input type='hidden' id='group_child_flag_" + count + "' name='group_child_flag_" + count +
|
|
"' value='0' ><div style='display:none' id=\"group_items" + '_' + count + "\"></div>"
|
|
|
|
} else {
|
|
content += "<div class='input-group' >"
|
|
<?php if ($rolecode == 'DIS'){?>
|
|
content +=
|
|
"<input type=\"number\" min='0' style=\"height:25px;font-size:12px;width:50px\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
count + "\" id=\"treatment_item_qtygvn" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty']?>\" onchange=\"checkQty()\"/>"
|
|
|
|
<?php }else if ($treatment_followup_picked){?>
|
|
content +=
|
|
"<input type=\"number\" min='0' style=\"height:25px;font-size:12px;width:50px\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
count + "\" id=\"treatment_item_qtygvn" + '_' + count + "\" readonly/>"
|
|
|
|
<?php }else {?>
|
|
content +=
|
|
"<input type=\"number\" min='0' style=\"height:25px;font-size:12px;width:50px\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
count + "\" id=\"treatment_item_qtygvn" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty']?>\" readonly/>"
|
|
|
|
<?php }?>
|
|
content +=
|
|
"<span class='input-group-addon' style='font-size:8px; margin:1px;padding:1px;'><?php echo isset($unitMap[$unit_id])? $unitMap[$unit_id]:''?></span>";
|
|
|
|
}
|
|
content += "</td>"
|
|
|
|
|
|
/// if(count>0)
|
|
content +=
|
|
'<td style=\"width:3%\"><?php if ($rolecode != 'DOC' && $row['doctor_attended_flag']=='Y') { }else{ ?><label><i class="ace-icon fa fa-trash-o bigger-130"></i></label><?php }?></td>';
|
|
// else
|
|
// content += '<td style=\"width:5%\"></td>';
|
|
content += "</tr>"
|
|
|
|
$("#treatmentTable").append(content);
|
|
$(".select2").select2();
|
|
|
|
// getItemDetails("<?php echo $row_treatment['item_id']?>","current_stock"+'_'+count,"current_stock_div"+count,appointment_id+"_"+count,count,'edit');
|
|
getFrequenceyQty($("#treatment_item_dosage" + '_' + count).val(), "frequency_qty" + '_' + count, "dosage" + '_' +
|
|
count, appointment_id, count);
|
|
updateTotalMedicineQtyNew("frequency_qty" + '_' + count, "treatment_item_days" + '_' + count, count);
|
|
|
|
|
|
|
|
count = count + 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
}
|
|
}
|
|
if ($num_rows_treatment_external > 0) {
|
|
// echo "inside external treatments";
|
|
while ( $row_treatment_external = @mysqli_fetch_array ( $result_for_treatment_external ) ) {
|
|
|
|
?>
|
|
content = "";
|
|
content += "<tr style=\"width:70%\">"
|
|
content += "<td class=\"col-sm-2\" style=\"width:15%\" id=\"treatment_item_td_" + count + "\">";
|
|
<?php if ($rolecode != 'DOC' && $row['doctor_attended_flag']=='Y') { ?>
|
|
|
|
content += "<input id=\"treatment_item_external" + count + "\" name=\"treatment_item_external" + count +
|
|
"\" value='<?php echo $row_treatment_external['item_name']?>' type=\"hidden\">"
|
|
content += "<?php echo $row_treatment_external['item_name'];?></td>"
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<input id=\"treatment_item_dosage" + '_' + count + "\" name=\"treatment_item_dosage" + count +
|
|
"\" value='<?php echo $row_treatment_external['dosage']?>'type=\"hidden\">"
|
|
content += "<?php echo $row_treatment_external['dosage'];?></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"timings" + '_' + count +
|
|
"\" name=\"timings" + count + "\" data-placeholder=\"Timings...\" >"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content +=
|
|
"<?php echo generateOption('medicine_timings','medicine_timing','timing_id',$row_treatment_external['timing'],''); ?>"
|
|
content += "</select></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select id=\"treatment_item_dosage_category" + '_' + count +
|
|
"\" style=\"width:100%\" class=\"select2 form-control\" name=\"treatment_item_dosage_category" + count +
|
|
"\" value='<?php echo $row_treatment_external['dosage_category_id']?>'>"
|
|
content += "<option value=''>N/A</option>";
|
|
content +=
|
|
"<?php echo generateOption("dosage_category", "dosage_category","dosage_category_id",$row_treatment_external['dosage_category_id'],'');?></td>"
|
|
content += "</select>"
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment_external['treatment_id']?>\"></td>"
|
|
|
|
content += "<td class=\"col-sm-1\" style='width:7%'>"
|
|
content += "<?php echo $row_treatment_external['for_days']?>"
|
|
content += "<input type=\"hidden\" name=\"treatment_item_days" + count + "\" id=\"treatment_item_days" + '_' +
|
|
count + "\" value='<?php echo $row_treatment_external['for_days']?>'/>"
|
|
|
|
|
|
<?php }else{?>
|
|
|
|
content += "<input id=\"treatment_item_external" + count + "\" name=\"treatment_item_external" + count +
|
|
"\" value='<?php echo $row_treatment_external['item_name']?>' class=\"form-control\" type=\"text\">"
|
|
content += "</td><td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<input id=\"treatment_item_dosage" + '_' + count + "\" name=\"treatment_item_dosage" + count +
|
|
"\" value='<?php echo $row_treatment_external['dosage']?>'class=\"form-control\" type=\"text\">"
|
|
content += "</td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select style=\"width:100%\" class=\"select2 form-control\" id=\"timings" + '_' + count +
|
|
"\" name=\"timings" + count + "\" data-placeholder=\"Timings...\" >"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content +=
|
|
"<?php echo generateOption('medicine_timings','medicine_timing','timing_id',$row_treatment_external['timing'],''); ?>"
|
|
content += "</select></td>"
|
|
|
|
content += "<td class=\"col-sm-2\" style=\"width:7%\">"
|
|
content += "<select id=\"treatment_item_dosage_category" + '_' + count +
|
|
"\" style=\"width:100%\" class=\"select2 form-control\" name=\"treatment_item_dosage_category" + count +
|
|
"\" value='<?php echo $row_treatment['dosage_category_id']?>'>"
|
|
content += "<option value=''>N/A</option>";
|
|
content +=
|
|
"<?php echo generateOption("dosage_category", "dosage_category","dosage_category_id",$row_treatment_external['dosage_category_id'],'');?></td>"
|
|
content += "</select>"
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment_external['treatment_id']?>\"></td>"
|
|
|
|
content += "<td class=\"col-sm-1\"style='width:7%' >"
|
|
content += "<input class=\"form-control\" type=\"text\" name=\"treatment_item_days" + count +
|
|
"\" id=\"treatment_item_days" + '_' + count + "\" value='<?php echo $row_treatment_external['for_days']?>'/>"
|
|
<?php }?>
|
|
|
|
|
|
|
|
content += "</td>"
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%;\">"
|
|
content += "<input type=\"hidden\" class=\"form-control\" name=\"frequency_qty" + count + "\" id=\"frequency_qty" +
|
|
'_' + count + "\" value=\"<?php echo getMedicineFrequencyQty($row_treatment_external['frequency_id'])?>\"/>"
|
|
content += "<input type=\"text\" class=\"form-control\" name=\"dose_qty" + count + "\" id=\"dose_qty" + '_' +
|
|
count + "\" value=\"<?php echo $row_treatment_external['item_qty']?>\" />"
|
|
content += "<input type=\"hidden\" name=\"dosage" + count + "\" id=\"dosage" + '_' + count + "\" />"
|
|
content += "</td><td class=\"col-sm-1\" style=\"width:5%\"><span id=\"treatment_item_total_div" + count +
|
|
"\"><?php echo $row_treatment_external['item_qty']?></span><input type=\"hidden\" name=\"treatment_item_total" +
|
|
count + "\" value=\"<?php echo $row_treatment_external['item_qty']?>\" id=\"treatment_item_total" + '_' +
|
|
count + "\" readonly/>"
|
|
content += "</td>"
|
|
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%\">"
|
|
content += "<div style=\"text-align:right\" id=\"current_stock_div" + count + "\">"
|
|
content += "</div>"
|
|
content += "<input type=\"hidden\" name=\"current_stock" + count + "\" id=\"current_stock" + '_' + count + "\" />"
|
|
|
|
content += "</td>"
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%\">"
|
|
content += "</td>"
|
|
|
|
|
|
// if(count>0)
|
|
content +=
|
|
'<td style=\"width:3%\"><?php if ($rolecode != 'DOC' && $row['doctor_attended_flag']=='Y') { }else{ ?><label><i class="ace-icon fa fa-trash-o bigger-130"></i></label><?php }?></td>';
|
|
// else
|
|
// content += '<td style=\"width:5%\"></td>';
|
|
content += "</tr>"
|
|
|
|
$("#treatmentTable").append(content);
|
|
|
|
|
|
getItemDetails("<?php echo $row_treatment['item_id']?>", "current_stock" + '_' + count, "current_stock_div" +
|
|
count, appointment_id + "_" + count, count, 'edit');
|
|
getFrequenceyQty($("#treatment_item_dosage" + '_' + count).val(), "frequency_qty" + '_' + count, "dosage" + '_' +
|
|
count, appointment_id, count);
|
|
updateTotalMedicineQtyNew("frequency_qty" + '_' + count, "treatment_item_days" + '_' + count, count);
|
|
|
|
count = count + 1;
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
}
|
|
}
|
|
if ($num_rows_treatment_external > 0 || $num_rows_treatment > 0) {
|
|
|
|
?>
|
|
var content = "";
|
|
|
|
content += "</tbody>"
|
|
content += "<tfoot>"
|
|
content += "<tr>"
|
|
content += "<input type=\"hidden\" name=\"count_treatment_item\" id=\"count_treatment_item\" value=\"" + count +
|
|
"\" />"
|
|
|
|
content += "<input type=\"hidden\" name=\"count_treatment_item_old\" id=\"count_treatment_item_old\" value=\"" +
|
|
count + "\" />"
|
|
|
|
content += "</tfoot>"
|
|
$("#treatmentTable").append(content);
|
|
// $("#count_treatment_item").val(count);
|
|
<?php if ($rolecode != 'DIS'){?>setFieldDisableOrEnable('<?php echo $row['medi_disbursement'];?>') <?php }?>
|
|
|
|
<?php
|
|
} else if ($num_rows_treatment_external == 0 && $num_rows_treatment == 0) {
|
|
|
|
?>
|
|
var content = "";
|
|
content += "</tbody>"
|
|
content += "<tfoot>"
|
|
content += "<tr>"
|
|
content += "<input type=\"hidden\" name=\"count_treatment_item\" id=\"count_treatment_item\" value=\"0\" />"
|
|
content +=
|
|
"<input type=\"hidden\" name=\"count_treatment_item_old\" id=\"count_treatment_item_old\" value=\"0\" />"
|
|
|
|
|
|
content += "</tr>"
|
|
content += "<tr>"
|
|
content += "</tr>"
|
|
content += "</tfoot>"
|
|
$("#treatmentTable").append(content);
|
|
$("#count_treatment_item").val(count);
|
|
$("#count_treatment_item_old").val(count);
|
|
addRow(appointment_id);
|
|
addRow(appointment_id);
|
|
addRow(appointment_id);
|
|
|
|
|
|
<?php
|
|
}
|
|
|
|
?>
|
|
}
|
|
|
|
function loadExistingAppointmentTreatment(referenceAppointmentId) {
|
|
|
|
if (referenceAppointmentId == null || referenceAppointmentId == 0 || referenceAppointmentId == undefined ||
|
|
referenceAppointmentId == "") {
|
|
return;
|
|
}
|
|
$("#treatmentTable > tbody").empty();
|
|
$("#count_treatment_item").val("0");
|
|
//first check for internal treatments
|
|
$.ajax({
|
|
url: 'ajax_2.php',
|
|
type: "POST",
|
|
dataType: 'json',
|
|
data: {
|
|
"request_type": "selectAllTableElementsByIdJSON",
|
|
"tableName": "treatment",
|
|
"idCol": "appointment_id",
|
|
"idColVal": referenceAppointmentId
|
|
},
|
|
success: function(data) {
|
|
if (data.length > 0) {
|
|
|
|
rowCntr = 0;
|
|
for (var i = 0; i < data.length; i++) {
|
|
rowCntr = addRow('<?php echo $row['appointment_id']?>');
|
|
//Set Field values after adding row
|
|
|
|
$("#treatment_item_dosage_" + rowCntr).val(data[i].frequency_id);
|
|
$("#timings_" + rowCntr).val(data[i].timing_id);
|
|
$("#treatment_item_dosage_category_" + rowCntr).val(data[i].dosage_category_id);
|
|
$("#treatment_item_days_" + rowCntr).val(data[i].for_days);
|
|
$("#frequency_qty" + rowCntr).val(data[i].treatment_id);
|
|
$("#treatment_item_total_" + rowCntr).val(data[i].item_qty);
|
|
//$("#treatment_item_qtygvn_hidden_"+rowCntr).val(1);
|
|
$("#treatment_id_" + rowCntr).val(data[i].treatment_id);
|
|
$("#treatment_item_" + rowCntr).val(data[i].item_id);
|
|
$("#treatment_item_qtygvn_" + rowCntr).val(data[i].issued_qty);
|
|
//var availableQty = getDispensaryItemAvailableQty('<?php echo $ohc_type_id?>',data[i].item_id);
|
|
//var qtydisplay= availableQty+" "+unitMap[data[i].unit_id];
|
|
//$("#current_stock_div"+rowCntr).html(qtydisplay);
|
|
|
|
}
|
|
$(".select2").select2();
|
|
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Treatment Details');
|
|
return;
|
|
}
|
|
});
|
|
//first check for internal treatments
|
|
$.ajax({
|
|
url: 'ajax_2.php',
|
|
type: "POST",
|
|
dataType: 'json',
|
|
data: {
|
|
"request_type": "selectAllTableElementsByIdJSON",
|
|
"tableName": "treatment_external",
|
|
"idCol": "appointment_id",
|
|
"idColVal": referenceAppointmentId
|
|
},
|
|
success: function(data) {
|
|
if (data.length > 0) {
|
|
rowCntr = 0;
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
rowCntr = addRowExternal('<?php echo $row['appointment_id']?>');
|
|
|
|
$("#treatment_item_dosage_external_" + rowCntr).val(data[i].frequency_id);
|
|
|
|
$("#frequency_qty_external_" + rowCntr).val(data[i].treatment_id);
|
|
$("#treatment_item_total_external_" + rowCntr).val(data[i].item_qty);
|
|
//$("#treatment_item_qtygvn_hidden_"+rowCntr).val(1);
|
|
//$("#treatment_id_"+rowCntr).val(data[i].treatment_id);
|
|
$("#treatment_item_external_" + rowCntr).val(data[i].item_name);
|
|
$("#treatment_item_dosage_category_external_" + rowCntr).val(data[i]
|
|
.dosage_category_id);
|
|
$("#treatment_item_days_external_" + rowCntr).val(data[i].for_days);
|
|
$("#timings_external_" + rowCntr).val(data[i].timing_id);
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Treatment Details');
|
|
return;
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function addRow(appointment_id) {
|
|
|
|
var itemOptions = "";
|
|
var counter = $("#count_treatment_item").val();
|
|
var doctorDiscussed = $('input[name=doctor_discussed]:checked').val();
|
|
if (rolecode != 'DOC' && doctorDiscussed != 'Y') {
|
|
itemOptions = itemOptionsDis;
|
|
} else {
|
|
itemOptions = itemOptionsDoc;
|
|
}
|
|
var itemDosages = "<?php echo generateOption('medicine_frequency','medicine_frequency','frequency_id','',''); ?>";
|
|
|
|
var timings = "<?php echo generateOption('medicine_timings','medicine_timing','timing_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 + "','" + appointment_id + "', '" + counter +
|
|
"');\" style=\"width:100%\" class=\"select2 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:7%\" class=\"col-sm-2\" id=\"treatment_item_td_' + counter + '\">' + select_treatment +
|
|
'</td>';
|
|
var select_dosage = "";
|
|
select_dosage += "<select onchange=\"getFrequenceyQty(this.value,'frequency_qty" + "_" + counter + "','dosage" +
|
|
"_" + counter + "','" + appointment_id + "', '" + counter +
|
|
"');\" style=\"width:100%\" class=\"select2 form-control\" ";
|
|
select_dosage += "id=\"treatment_item_dosage" + "_" + counter + "\"name=\"treatment_item_dosage" + counter +
|
|
"\"data-placeholder=\"Frequency\"";
|
|
//select_dosage+="style=\"display: none;\"";
|
|
select_dosage += ">";
|
|
|
|
select_dosage += "<option value=\"\">N/A</option>";
|
|
select_dosage += itemDosages
|
|
select_dosage += "</select>";
|
|
|
|
cols += '<td style=\"width:7%\"class=\"col-sm-2\" >' + select_dosage + '</td>';
|
|
|
|
var select_timing = "";
|
|
select_timing += "<select style=\"width:100%\" class=\"select2 form-control\" ";
|
|
select_timing += "id=\"timings" + "_" + counter + "\"name=\"timings" + counter +
|
|
"\" data-placeholder=\"Timings...\"";
|
|
select_timing += ">";
|
|
|
|
select_timing += "<option value=\"\">N/A</option>";
|
|
select_timing += timings;
|
|
select_timing += "</select>";
|
|
|
|
cols += '<td style=\"width:7%\" class=\"col-sm-2\" >' + select_timing + '</td>';
|
|
|
|
var select_dosage_cateogory = "";
|
|
select_dosage_cateogory += "<select style=\"width:100%\" class=\"select2 form-control\" ";
|
|
select_dosage_cateogory += "id=\"treatment_item_dosage_category" + "_" + counter +
|
|
"\"name=\"treatment_item_dosage_category" + counter + "\"data-placeholder=\"Route of Admin.\"";
|
|
//select_dosage+="style=\"display: none;\"";
|
|
select_dosage_cateogory += ">";
|
|
|
|
select_dosage_cateogory += "<option value=\"\">N/A</option>";
|
|
select_dosage_cateogory += itemDosage_categories
|
|
select_dosage_cateogory += "</select>";
|
|
|
|
cols += '<td style=\"width:7%\" class=\"col-sm-2\" >' + select_dosage_cateogory + '</td>';
|
|
cols += '<td style=\"width:5%\" class=\"col-sm-1\" ><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="updateTotalMedicineQtyNew(\'frequency_qty' + '_' + counter +
|
|
'\',\'treatment_item_days' + '_' + counter + '\', ' + counter + ')" name="treatment_item_days' + counter +
|
|
'"/></td>';
|
|
|
|
cols +=
|
|
'<td style=\"width:5%;\"class=\"col-sm-1\"><input type="hidden" class=\"form-control\" style=\"height:25px;font-size:12px\" name="frequency_qty' +
|
|
counter + '" id="frequency_qty' + '_' + counter +
|
|
'" /><input type="number" class=\"form-control\" style=\"height:25px;font-size:12px\" name="dose_qty' +
|
|
counter + '" id="dose_qty' + '_' + counter + '" onblur="updateTotalMedicineQtyNew(\'frequency_qty' + '_' +
|
|
counter + '\',\'treatment_item_days' + '_' + counter + '\', ' + counter +
|
|
')" /><input type="hidden" name="dosage' + counter + '" id="dosage' + appointment_id + '_' + counter +
|
|
'" /> </td>';
|
|
cols += '<td style=\"width:5%;\"class=\"col-sm-1\" ><span id=\"treatment_item_total_div' + counter +
|
|
'\"></span><input type="hidden" id="treatment_item_total_' + counter + '" name="treatment_item_total' +
|
|
counter + '" readonly/></td>'
|
|
cols += '<td style=\"width:5%\"><div style="text-align:right" id="current_stock_div' + counter +
|
|
'" ></div><input type="hidden" id="current_stock' + '_' + counter + '" name="current_stock' + counter +
|
|
'" /></td>';
|
|
cols += "<td class=\"col-sm-1\" style=\"width:7%\" id=\"qty_td" + counter + "\">"
|
|
if (jQuery.inArray("<?php echo $row_treatment['item_id']?>", groupItems) != -1) {
|
|
cols += "<label id='group_" + count + "' onclick='openGroup(" + counter +
|
|
")'><span class=\"ace-icon fa fa-medkit\"><span></label>"
|
|
cols +=
|
|
"<input type=\"hidden\" style=\"height:25px;font-size:12px;width:30px\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn_hidden" + '_' + counter + "\" value=\"1\" />"
|
|
cols += "<input type='hidden' id=' _" + counter + "' name='group_child_flag_" + counter +
|
|
"' value='0' ><div style='display:none' id=\"group_items" + '_' + counter + "\"></div>"
|
|
|
|
} else {
|
|
<?php if($rolecode=='DIS'){ ?>
|
|
cols +=
|
|
"<input type=\"number\" min='0' style=\"height:25px;font-size:12px;width:50px\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn" + '_' + counter +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty']?>\" onchange=\"checkQty()\"/>"
|
|
<?php } else {?>
|
|
cols +=
|
|
"<input type=\"number\" min='0' readonly style=\"height:25px;font-size:12px;width:30px\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn" + '_' + counter +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty']?>\" onchange=\"checkQty()\"/>"
|
|
<?php }?>
|
|
}
|
|
|
|
//if(counter>0)
|
|
cols += '<td style=\"width:3%\"><label><i class="ace-icon fa fa-trash-o bigger-130"></i></label></td>';
|
|
// else
|
|
// cols += '<td style=\"width:5%\"></td>';
|
|
|
|
newRow.append(cols);
|
|
$("#treatmentTable").append(newRow);
|
|
$(".select2").select2();
|
|
counter++;
|
|
$("#count_treatment_item").val(counter);
|
|
|
|
var valueChecked = $('input[name=medicine_disbursement]:checked').val();
|
|
|
|
setFieldDisableOrEnable(valueChecked)
|
|
$(".select2").each(function() {
|
|
$(this).attr('style', 'width: 100%');
|
|
});
|
|
return eval(counter - 1);
|
|
}
|
|
//end of addRow
|
|
|
|
|
|
|
|
$("#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 addRowExternal(appointment_id) {
|
|
var counter = $("#count_treatment_item").val();
|
|
var doctorDiscussed = $('input[name=doctor_discussed]:checked').val();
|
|
|
|
|
|
var newRow = $("<tr style=\"width:70%\">");
|
|
var cols = "";
|
|
|
|
var timings = "<?php echo generateOption('medicine_timings','medicine_timing','timing_id','',''); ?>";
|
|
|
|
|
|
cols += '<td style=\"width:15%\" id=\"treatment_item_td_' + counter +
|
|
'\"><input type="text" class="form-control" id=\"treatment_item_external_' + counter +
|
|
'\"name=\"treatment_item_external' + counter + '\"></td>';
|
|
|
|
var select_dosage = "";
|
|
select_dosage += "<input type='text' class='form-control'";
|
|
select_dosage += "id=\"treatment_item_dosage" + "_" + counter + "\"name=\"treatment_item_dosage" + counter +
|
|
"\"data-placeholder=\"Frequency\"";
|
|
select_dosage += ">";
|
|
|
|
|
|
cols += '<td style=\"width:7%\" >' + select_dosage + '</td>';
|
|
|
|
|
|
var select_timing = "";
|
|
select_timing += "<select style=\"width:100%\" class=\"select2 form-control\" ";
|
|
select_timing += "id=\"timings" + "_" + counter + "\"name=\"timings" + counter +
|
|
"\" data-placeholder=\"Timings...\"";
|
|
select_timing += ">";
|
|
|
|
select_timing += "<option value=\"\">N/A</option>";
|
|
select_timing += timings;
|
|
select_timing += "</select>";
|
|
|
|
|
|
cols += '<td style=\"width:7%\" class=\"col-sm-2\" >' + select_timing + '</td>';
|
|
|
|
var select_dosage_cateogory = "";
|
|
select_dosage_cateogory += "<select style='width:100%' class='form-control select2'";
|
|
select_dosage_cateogory += "id=\"treatment_item_dosage_category" + "_" + counter +
|
|
"\"name=\"treatment_item_dosage_category" + counter + "\"data-placeholder=\"Route of Admin.\"";
|
|
//select_dosage+="style=\"display: none;\"";
|
|
select_dosage_cateogory += ">";
|
|
|
|
select_dosage_cateogory += "<option value=\"\"> </option>";
|
|
select_dosage_cateogory += itemDosage_categories
|
|
select_dosage_cateogory += "</select>";
|
|
|
|
cols += '<td style=\"width:7%\" >' + select_dosage_cateogory + '</td>';
|
|
cols += '<td><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" name="treatment_item_days' + counter + '"/></td>';
|
|
|
|
cols +=
|
|
'<td style=\"width:5%;\"class=\"col-sm-1\"><input type="hidden" class=\"form-control\" style=\"height:25px;font-size:12px\" name="frequency_qty' +
|
|
counter + '" id="frequency_qty' + '_' + counter +
|
|
'" /><input type="number" class=\"form-control\" onblur="updateTotalMedicineQtyNew(\'frequency_qty' + '_' +
|
|
counter + '\',\'treatment_item_days' + '_' + counter + '\', ' + counter +
|
|
')" style=\"height:25px;font-size:12px\" name="dose_qty' + counter + '" id="dose_qty' + '_' + counter +
|
|
'" /><input type="hidden" name="dosage' + counter + '" id="dosage' + appointment_id + '_' + counter +
|
|
'" /> </td>';
|
|
cols += '<td style=\"width:5%;\"class=\"col-sm-1\"><span id=\"treatment_item_total_div' + counter +
|
|
'\"><?php echo $row_treatment['item_qty']?></span><input type="hidden" id="treatment_item_total_' + counter +
|
|
'" name="treatment_item_total' + counter + '" readonly/></td>'
|
|
cols += '<td style=\"width:5%\"><div style="text-align:center display:none" id="current_stock_div' + counter +
|
|
'" ></div><input type="hidden" id="current_stock' + '_' + counter + '" name="current_stock' + counter +
|
|
'" /></td>';
|
|
cols += "<td class=\"col-sm-1\" style=\"width:7%\" id=\"qty_td" + counter + "\">"
|
|
cols +=
|
|
"<input type=\"hidden\" style=\"height:25px;font-size:12px;width:30px\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn" + '_' + counter +
|
|
"\" value=\"<?php echo $row_treatment['issued_qty']?>\" onchange=\"checkQty()\"/>"
|
|
|
|
//if(counter>0)
|
|
cols += '<td style=\"width:3%\"><label><i class="ace-icon fa fa-trash-o bigger-130"></i></label></td>';
|
|
//else
|
|
// cols += '<td style=\"width:5%\"></td>';
|
|
|
|
newRow.append(cols);
|
|
$("#treatmentTable").append(newRow);
|
|
$('.select2').select2();
|
|
//$('#ailment_system').trigger('chosen:updated');
|
|
//$('#treatment_item_dosage'+"_"+counter).chosen({allow_single_deselect:true});
|
|
// $('#treatment_item_dosage'+"_"+counter).next().css({'width': $('#treatment_item_dosage'+counter).parent().width()});
|
|
|
|
//$('#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);
|
|
|
|
var valueChecked = $('input[name=medicine_disbursement]:checked').val();
|
|
|
|
setFieldDisableOrEnable(valueChecked)
|
|
return eval(counter - 1);
|
|
|
|
}
|
|
//End of AddRowExternal
|
|
|
|
|
|
$("#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 getFrequenceyQty(frequency_id, qty_value_field_id, dosage_desc_field_id, appointment_id, counter) {
|
|
|
|
$.ajax({
|
|
url: 'select_frequency.php?frequency_id=' + frequency_id,
|
|
type: "GET",
|
|
async: false,
|
|
success: function(data) {
|
|
var data = $.parseJSON(data);
|
|
if (data.qty != null) {
|
|
$("#" + qty_value_field_id).val(data.qty);
|
|
$("#" + dosage_desc_field_id).val(data.frequency_description);
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling frequency qty');
|
|
return;
|
|
}
|
|
|
|
});
|
|
updateTotalMedicineQtyNew('frequency_qty' + '_' + counter, 'treatment_item_days' + '_' + counter, counter)
|
|
|
|
}
|
|
|
|
function getItemDetails(item_id, current_stock_field, current_stock_field_div, appointment_id, counter, e) {
|
|
$.ajax({
|
|
url: 'select_item_dispensary.php?item_id=' + item_id,
|
|
type: "GET",
|
|
success: function(data) {
|
|
var data = $.parseJSON(data);
|
|
var content = "";
|
|
//current_val=$("treatment_item_qtygvn"+'_'+counter).val();
|
|
//alert(current_val);
|
|
if (jQuery.inArray(item_id, groupItems) != -1) {
|
|
|
|
content += "<label id='group_" + counter + "' onclick='openGroup(" + counter +
|
|
")'><span class=\"ace-icon fa fa-medkit\"><span></label>"
|
|
content +=
|
|
"<input type=\"hidden\" style=\"height:25px;font-size:12px;width:30px\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn_hidden" + '_' + counter +
|
|
"\" value=\"1\" />"
|
|
content += "<input type='hidden' id='group_child_flag_" + counter +
|
|
"' name='group_child_flag_" + counter +
|
|
"' value='0' ><div style='display:none' id=\"group_items" + '_' + counter + "\"></div>"
|
|
|
|
$("#qty_td" + counter).html(content);
|
|
//$("treatment_item_qtygvn"+'_'+counter).val($current_val);
|
|
document.getElementById(current_stock_field_div + "").innerText = 'N/A';
|
|
|
|
} else {
|
|
content +=
|
|
"<div class='input-group' ><input type=\"number\" min='0' style=\"height:25px;font-size:12px;width:50px\" class=\"form-control\" name=\"treatment_item_qtygvn" +
|
|
counter + "\" id=\"treatment_item_qtygvn" + '_' + counter + "\" value=\"0\"";
|
|
<?php if($rolecode!='DIS'){?> content += " readonly ";
|
|
<?php }?>
|
|
|
|
content +=
|
|
"onchange=\"checkQty()\"/><span class='input-group-addon' style='font-size:8px; margin:1px;padding:1px;'>" +
|
|
unitMap[data.unit_id] + "</span></div>";
|
|
$("#qty_td" + counter).html(content);
|
|
//$("treatment_item_qtygvn"+'_'+counter).val(current_val);
|
|
//alert(current_val);
|
|
|
|
if (e == 'edit') {
|
|
$("#" + current_stock_field).val(data.current_stock_level)
|
|
document.getElementById(current_stock_field_div + "").innerText = data
|
|
.current_stock_level + " " + unitMap[data.unit_id];
|
|
|
|
} else if (data.current_stock_level > 1) {
|
|
|
|
$("#" + current_stock_field).val(data.current_stock_level)
|
|
document.getElementById(current_stock_field_div + "").innerText = data
|
|
.current_stock_level + " " + unitMap[data.unit_id];
|
|
|
|
|
|
} else {
|
|
if (data.current_stock_level == null || data.current_stock_level == 'undefined' || data
|
|
.current_stock_level == undefined) {
|
|
document.getElementById(current_stock_field_div + "").innerText = '0.0';
|
|
|
|
} else {
|
|
document.getElementById(current_stock_field_div + "").innerText = data
|
|
.current_stock_level + " " + unitMap[data.unit_id];
|
|
|
|
|
|
|
|
if (flagReload == 1) {
|
|
BootstrapDialog.alert('This Item is not available in stock.');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Item Details');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
function itemLevelTotol(treatment_item_qtygvn_field, current_rate_field, treatment_item_total_amount_field,
|
|
treatment_item_total_amount_field_div) {
|
|
var appointment_id = '<?php echo $row['appointment_id']?>'
|
|
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);
|
|
}
|
|
|
|
function orderLevelTotal(count) {
|
|
var totalAmount = 0;
|
|
var appointment_id = '<?php echo $row['appointment_id']?>'
|
|
//totalAmount=totalAmount+parseInt(treatment_item_total_amount_field_value);
|
|
for (var i = 0; i < parseInt(count); i++) {
|
|
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 updateTotalMedicineQtyNew(frequency_qty_fieild, treatment_item_days_fieild, counter) {
|
|
|
|
treatment_item_id = $("#treatment_item_" + counter).val();
|
|
// alert(treatment_item_id);
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'get_form_name.php',
|
|
data: {
|
|
item_id: treatment_item_id,
|
|
appointment_id: appointment_id
|
|
},
|
|
success: function(data) {
|
|
let result_data = JSON.parse(data);
|
|
let is_qty_fixed = result_data['is_qty_fixed'];
|
|
|
|
if (is_qty_fixed != null && is_qty_fixed != '' && is_qty_fixed != undefined && is_qty_fixed ==
|
|
'YES') {
|
|
$("#treatment_item_total_" + counter).val(1);
|
|
$("#treatment_item_total_div" + counter).html(1);
|
|
} else {
|
|
frequency_qty = parseInt($("#" + frequency_qty_fieild).val());
|
|
treatment_item_days = parseInt($("#" + treatment_item_days_fieild).val());
|
|
if (treatment_item_days == null || treatment_item_days == '' || treatment_item_days == 0) {
|
|
treatment_item_days = 1;
|
|
}
|
|
var dose_qty = $("#dose_qty_" + counter).val();
|
|
$("#treatment_item_total_" + counter).val(treatment_item_days * frequency_qty * dose_qty);
|
|
$("#treatment_item_total_div" + counter).html(treatment_item_days * frequency_qty *
|
|
dose_qty);
|
|
|
|
}
|
|
},
|
|
error: function(data) {
|
|
|
|
}
|
|
})
|
|
}
|
|
|
|
|
|
|
|
|
|
var flagReload = 1;
|
|
|
|
|
|
|
|
var itemOptionsDis = "";
|
|
var itemOptionsDoc = "";
|
|
var itemDosage_categories = "";
|
|
var groupItems = <?php echo json_encode(getGroupItemsList()); ?>;
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
itemOptionsDis =
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(form_name,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' and is_prescription!='1' order by item_name",'','item_id', 'item_name','','') ?>";
|
|
itemOptionsDoc =
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(form_name,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' order by item_name",'','item_id', 'item_name','',''); ?>";
|
|
var appointment_id = "<?php echo $row['appointment_id']?>";
|
|
itemDosage_categories =
|
|
"<?php echo generateOption('dosage_category','dosage_category','dosage_category_id','',''); ?>";
|
|
|
|
getMedicine();
|
|
$('.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': '200px'});
|
|
})
|
|
}).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': '200px'});
|
|
})
|
|
});
|
|
});
|
|
|
|
function setDoctorDiscussed(discussedVal) {
|
|
var counterT = $("#count_treatment_item").val();
|
|
var doctorDiscussed = $('input[name=doctor_discussed]:checked').val();
|
|
var itemOptions = "";
|
|
|
|
for (var i = 0; i < counterT; i++) {
|
|
$('#treatment_item_td_' + i).html('')
|
|
if (rolecode != 'DOC' && doctorDiscussed != 'Y') {
|
|
itemOptions = itemOptionsDis;
|
|
} else {
|
|
itemOptions = itemOptionsDoc;
|
|
}
|
|
var select_treatment = "";
|
|
select_treatment += "<select onchange=\"getItemDetails(this.value,'current_stock" + "_" + i +
|
|
"','current_stock_div" + i + "','" + appointment_id + "', '" + i +
|
|
"');\" class='chosen-select form-control'";
|
|
select_treatment += "id=\"treatment_item" + "_" + i + "\"name=\"treatment_item" + i +
|
|
"\"data-placeholder=\"Treatment...\"";
|
|
//select_treatment+="style=\"display: none;\"";
|
|
select_treatment += ">";
|
|
|
|
select_treatment += "<option value=\"\"> </option>";
|
|
select_treatment += itemOptions
|
|
select_treatment += "</select>";
|
|
$('#treatment_item_td_' + i).html(select_treatment);
|
|
$('#treatment_item_' + i).chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
$('#treatment_item_' + i).next().css({
|
|
'width': '200px'
|
|
});
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function validate_update(formId, appointment_id) {
|
|
var appointment_date = $('#appointment_date' + appointment_id).val();
|
|
if (appointment_date == '') {
|
|
BootstrapDialog.alert('Please Enter Appointment Date.!!!');
|
|
return false;
|
|
}
|
|
var complaints = $('#complaints' + appointment_id).val();
|
|
if (complaints == '') {
|
|
BootstrapDialog.alert('Please Enter Complaints.!!!');
|
|
return false;
|
|
}
|
|
update_appointment(formId, appointment_id);
|
|
}
|
|
|
|
function update_appointment(formId, appointment_id) {
|
|
$("#save_button").hide();
|
|
|
|
$.ajax({
|
|
url: 'save_opd.php',
|
|
type: "POST",
|
|
data: $("#" + formId).serialize(),
|
|
success: function(data) {
|
|
|
|
//BootstrapDialog.alert('Details Updated Successfully.');
|
|
//window.location = 'employee_appointment_form.php?appointmentId='+appointmentId+' ';
|
|
//
|
|
BootstrapDialog.show({
|
|
message: 'Details Updated Successfully.',
|
|
buttons: [{
|
|
label: 'OK',
|
|
action: function(dialogItself) {
|
|
dialogItself.close();
|
|
//window.location.reload();
|
|
}
|
|
}]
|
|
});
|
|
|
|
|
|
|
|
|
|
//window.location.reload();
|
|
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Updating Details');
|
|
return;
|
|
}
|
|
});
|
|
//window.location.reload();
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
function checkQty() {
|
|
var total_item = $("#count_treatment_item").val();
|
|
// alert(total_item);
|
|
for (var i = 0; i < total_item; i++) {
|
|
var item_id = $("#treatment_item_" + i).val();
|
|
var issue_qty = $("#treatment_item_qtygvn_" + i).val();
|
|
if (issue_qty == null || issue_qty == '') {
|
|
issue_qty = 0;
|
|
}
|
|
if (item_id == undefined || issue_qty == undefined) continue;
|
|
|
|
if (issue_qty < 0) {
|
|
BootstrapDialog.alert("Negative values are not allowed!!!");
|
|
$("#treatment_item_qtygvn_" + i).val("");
|
|
return false;
|
|
}
|
|
var avl_qty = $("#current_stock_" + i).val();
|
|
// alert("avl qty "+avl_qty);
|
|
if (avl_qty == undefined || avl_qty == '' || avl_qty == null || isNaN(avl_qty)) {
|
|
avl_qty = parseInt($("#current_stock_div" + i).text().split(" ")[0]);
|
|
if (avl_qty == undefined || avl_qty == '' || avl_qty == null || isNaN(avl_qty)) {
|
|
avl_qty = 0;
|
|
}
|
|
}
|
|
// alert("avl qty "+avl_qty);
|
|
$.ajax({
|
|
type: 'post',
|
|
async: false,
|
|
url: 'get_prev_issue_qty.php',
|
|
data: {
|
|
item_id: item_id,
|
|
appointment_id: appointment_id
|
|
},
|
|
success: function(data) {
|
|
let pre_issue = JSON.parse(data);
|
|
if (pre_issue == null || pre_issue == '') pre_issue = 0;
|
|
if (eval(avl_qty) + eval(pre_issue) < issue_qty) {
|
|
// alert(eval(avl_qty)+eval(pre_issue));
|
|
BootstrapDialog.alert('Issue quantity can not be greater than available quantity.!!!');
|
|
$("#treatment_item_qtygvn_" + i).val("");
|
|
return false;
|
|
}
|
|
},
|
|
error: function(data) {
|
|
console.log("Something went wrong in fetching the previous itme qty for checking")
|
|
}
|
|
});
|
|
// }
|
|
}
|
|
}
|
|
|
|
function toCheckItemStock() {
|
|
|
|
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 validate_template(formId) {
|
|
$("#save_button").hide();
|
|
|
|
$.ajax({
|
|
url: 'save_opd_template.php',
|
|
type: "POST",
|
|
data: $("#opd_form").serialize(),
|
|
success: function(data) {
|
|
BootstrapDialog.show({
|
|
message: 'Details Updated Successfully.',
|
|
buttons: [{
|
|
label: 'OK',
|
|
action: function(dialogItself) {
|
|
dialogItself.close();
|
|
|
|
}
|
|
}]
|
|
});
|
|
|
|
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Templates Details');
|
|
return;
|
|
}
|
|
});
|
|
//window.location.reload();
|
|
}
|
|
|
|
// Save & Update
|
|
function validate() {
|
|
var appointment_date = $('#appointment_date').val();
|
|
if (appointment_date == '') {
|
|
BootstrapDialog.alert('Please Enter Appointment Name.!!!');
|
|
return false;
|
|
}
|
|
var complaints = $('#complaints').val();
|
|
if (complaints == '') {
|
|
BootstrapDialog.alert('Please Enter Complaints.!!!');
|
|
return false;
|
|
}
|
|
save_appointment();
|
|
}
|
|
|
|
function save_appointment() {
|
|
$.ajax({
|
|
url: 'save_opd.php',
|
|
type: "POST",
|
|
data: $("#opd_form").serialize(),
|
|
success: function(data) {
|
|
var data = $.parseJSON(data);
|
|
//alert(data);
|
|
if (data.appointment_id != null) {
|
|
$("#appointment_id").val(data.appointment_id);
|
|
$("#appointment_id_pdf").val(data.appointment_id);
|
|
}
|
|
|
|
BootstrapDialog.alert('Details Saved Successfully.');
|
|
//loadAppointmentHistory('<?php echo $_REQUEST['flex_opd_id']?>');
|
|
//return;
|
|
window.location.reload();
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Details');
|
|
//return;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Handle Free Entry Tag boxes for OPD and Injury forms
|
|
|
|
*/
|
|
//Entry is allowed only for Doctors and Dispensary if in case not already updated by Doctor
|
|
|
|
<?php if ($rolecode !='DOC' && $row['doctor_attended_flag']=='Y') { ?>
|
|
$('#ailment_system_new').val("<?php echo $row['ailment_systems_new']?>").prop('readonly', true);
|
|
|
|
<?php
|
|
$diagnosis_config = getFieldFromTable('value','config','key_name','diagnosis_tag_switch');
|
|
error_log("diagnosis tag switch in opd injury common code ".$diagnosis_config);
|
|
if(!strcmp(strtolower($diagnosis_config) ,"true")){
|
|
$ailment_names = explode(',', $row['ailments_new']);?>
|
|
$('#ailment_new').val(
|
|
"<?php foreach ($ailment_names as $ailment_name) { echo strtoupper(getTableFieldValue('ailment','ailment_name','ailment_id',$ailment_name)); }?>"
|
|
).prop('readonly', true);
|
|
<?php } ?>
|
|
|
|
<?php
|
|
$complaint_config = getFieldFromTable('value', 'config', 'key_name', 'complaint_tag_switch');
|
|
error_log("complaint_tag_switch tag switch in opd injury common code ".$complaint_config);
|
|
if(!strcmp(strtolower($complaint_config) ,"true")){
|
|
$complaints = explode(',', $row['complaints']);?>
|
|
$('#complaints').val(
|
|
"<?php foreach ($complaints as $complaint) { echo strtoupper( getTableFieldValue('complaints','complaint','complaint_id',$complaint)); }?>"
|
|
).prop('readonly', true);
|
|
<?php } ?>
|
|
|
|
<?php
|
|
$examination_remarks_config = getFieldFromTable('value','config','key_name','examination_tag_switch');
|
|
error_log("examination_tag_switch tag switch in opd injury common code ".$examination_remarks_config);
|
|
if(!strcmp(strtolower($examination_remarks_config) ,"true")){
|
|
$findings = explode(',', $row['examination_remarks']);?>
|
|
$('#examination_remarks').val(
|
|
"<?php foreach ($findings as $finding) { echo strtoupper(getTableFieldValue('examination_findings','examination_finding','id',$finding)); }?>"
|
|
).prop('readonly', true);
|
|
<?php } ?>
|
|
|
|
<?php $referrals = explode(',', $row['referral']);?>
|
|
$('#referral').val(
|
|
"<?php foreach ($referrals as $referral) { echo strtoupper(getTableFieldValue('referral_point','referral_point_name','referral_point_id',$referral)); }?>"
|
|
).prop('readonly', true);
|
|
$('#recommended_test_new').val("<?php echo $row['recommended_tests_new']?>").prop('readonly', true);
|
|
$('#injury_class_new').val("<?php echo $row['injury_classes_new']?>").prop('readonly', true);
|
|
$('#injury_type_new').val("<?php echo $row['injury_types_new']?>").prop('readonly', true);
|
|
<?php $injury_parts = explode(',', $row['injury_parts_new']);?>
|
|
$('#injury_part_new').val("<?php foreach ($injury_parts as $injury_part) { echo strtoupper($injury_part); }?>").prop(
|
|
'readonly', true);
|
|
$('#health_advice_name_new').val("<?php echo $row['health_advices_new']?>").prop('readonly', true);
|
|
<?php }else if($rolecode =='DOC' || $rolecode=='DIS'|| $rolecode=='RCP'){?>
|
|
|
|
<?php if(!strcmp(strtolower($diagnosis_config) ,"true")){?>
|
|
|
|
if ($('#ailment_new')) {
|
|
var ailments = new Array();
|
|
getAilments();
|
|
|
|
function getAilments() {
|
|
$.ajax({
|
|
url: 'select_ailments.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
ailments = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Ailments');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
<?php } ?>
|
|
/*if($("#ailment_system_new")){
|
|
var ailmentSystems= new Array();
|
|
getAilmentSystems();
|
|
function getAilmentSystems(){
|
|
$.ajax({
|
|
url : 'select_ailment_systems.php',
|
|
type : "GET",
|
|
success : function(data) {
|
|
ailmentSystems = $.parseJSON(data);
|
|
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error pulling Ailment Systems');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}*/
|
|
if ($('#health_advice_name_new')) {
|
|
|
|
var healthAdvices = new Array();
|
|
getHealthAdvices();
|
|
|
|
function getHealthAdvices() {
|
|
$.ajax({
|
|
url: 'select_health_advices.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
healthAdvices = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Health Advices');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
if ($('#injury_type_new')) {
|
|
|
|
var injuryTypes = new Array();
|
|
getInjuryTypes();
|
|
|
|
function getInjuryTypes() {
|
|
$.ajax({
|
|
url: 'select_injury_types.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
injuryTypes = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Injury Types');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
/*if($('#injury_class_new')){
|
|
|
|
var injuryClasses= new Array();
|
|
getInjuryClasses();
|
|
function getInjuryClasses(){
|
|
$.ajax({
|
|
url : 'select_injury_classes.php',
|
|
type : "GET",
|
|
success : function(data) {
|
|
injuryClasses = $.parseJSON(data);
|
|
|
|
},
|
|
error : function(data) {
|
|
BootstrapDialog.alert('Error pulling Injury Classes');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}*/
|
|
if ($('#injury_part_new')) {
|
|
|
|
var affectedBodyParts = new Array();
|
|
getAffectedBodyParts();
|
|
|
|
function getAffectedBodyParts() {
|
|
$.ajax({
|
|
url: 'select_injury_parts.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
affectedBodyParts = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Affected body parts');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
if ($('#recommended_test_new')) {
|
|
|
|
var recommendedTests = new Array();
|
|
getRecommendedTests();
|
|
|
|
function getRecommendedTests() {
|
|
$.ajax({
|
|
url: 'select_recommended_tests.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
recommendedTests = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Health Advices');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
<?php if(!strcmp(strtolower($complaint_config) ,"true")){?>
|
|
if ($('#complaints')) {
|
|
|
|
var complaints = new Array();
|
|
getComplaints();
|
|
|
|
function getComplaints() {
|
|
$.ajax({
|
|
url: 'select_complaints.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
complaints = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Complaints!!');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
<?php } ?>
|
|
|
|
<?php if(!strcmp(strtolower($examination_remarks_config) ,"true")){?>
|
|
if ($('#examination_remarks')) {
|
|
|
|
var findings = new Array();
|
|
getFindings();
|
|
|
|
function getFindings() {
|
|
$.ajax({
|
|
url: 'select_findings.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
findings = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling Examination findings!!');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
<?php } ?>
|
|
if ($('#referral')) {
|
|
|
|
var referrals = new Array();
|
|
getReferrals();
|
|
|
|
function getReferrals() {
|
|
$.ajax({
|
|
url: 'select_referrals.php',
|
|
type: "GET",
|
|
success: function(data) {
|
|
referrals = $.parseJSON(data);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error pulling referrals!!');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
// getMedicine();
|
|
|
|
/*if($("#ailment_system_new")){
|
|
|
|
var tag_input_ailment_systems = $('#ailment_system_new');
|
|
try{
|
|
tag_input_ailment_systems.tag(
|
|
{
|
|
placeholder:tag_input_ailment_systems.attr('placeholder'),
|
|
|
|
source:ailmentSystems
|
|
|
|
}
|
|
)
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#ailment_system_new').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingAilmentSystems = "<?php echo $row['ailment_systems_new']?>"
|
|
if(existingAilmentSystems!=undefined && existingAilmentSystems!=null && existingAilmentSystems!=''){
|
|
var existingAilmentSystemsArr =existingAilmentSystems.split(",");
|
|
jQuery.each( existingAilmentSystemsArr, function( i, val ) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//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_ailment_systems.after('<textarea id="'+tag_input_ailment_systems.attr('id')+'" name="'+tag_input_ailment_systems.attr('name')+'" rows="3">'+tag_input_ailment_systems.val()+'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}//end ailmentSystems */
|
|
|
|
<?php if(!strcmp(strtolower($diagnosis_config) ,"true")){?>
|
|
|
|
|
|
|
|
if ($('#ailment_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_ailments = $('#ailment_new');
|
|
try {
|
|
tag_input_ailments.tag({
|
|
placeholder: tag_input_ailments.attr('placeholder'),
|
|
|
|
source: ailments,
|
|
tagClass: 'bigTag',
|
|
trimValue: true,
|
|
allowDuplicates: false
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#ailment_new').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
//var existingAilments = "<?php echo $row['ailments_new']?>"
|
|
var existingAilments =
|
|
"<?php echo getCommaSeperatedValuesForInClause('select ailment_name from ailment','ailment_id',$row['ailments_new'])?>"
|
|
if (existingAilments != undefined && existingAilments != null && existingAilments !=
|
|
'') {
|
|
var existingAilmentsArr = existingAilments.split(",");
|
|
jQuery.each(existingAilmentsArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//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_ailments.after('<textarea id="' + tag_input_ailments.attr('id') + '" name="' +
|
|
tag_input_ailments.attr('name') + '" rows="3">' + tag_input_ailments.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
var y = $('#ailment_new').parents(".col-sm-3").width();
|
|
$('#ailment_new').siblings().css('width', y - 5);
|
|
|
|
|
|
}, 500);
|
|
} //end Ailments*/
|
|
|
|
<?php } ?>
|
|
|
|
if ($('#recommended_test_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_advices = $('#recommended_test_new');
|
|
try {
|
|
tag_input_advices.tag({
|
|
placeholder: tag_input_advices.attr('placeholder'),
|
|
|
|
source: recommendedTests,
|
|
tagClass: 'bigTag',
|
|
trimValue: true,
|
|
allowDuplicates: false,
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#recommended_test_new').data('tag');
|
|
var existingHealthAdvices = "<?php echo $row['recommended_tests_new']?>"
|
|
if (existingHealthAdvices != undefined && existingHealthAdvices != null &&
|
|
existingHealthAdvices != '') {
|
|
var existingHealthAdvicesArr = existingHealthAdvices.split(",");
|
|
jQuery.each(existingHealthAdvicesArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//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_advices.after('<textarea id="' + tag_input_advices.attr('id') + '" name="' +
|
|
tag_input_advices.attr('name') + '" rows="3">' + tag_input_advices.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}, 500);
|
|
} //end tests
|
|
|
|
<?php if(!strcmp(strtolower($complaint_config) ,"true")){?>
|
|
|
|
if ($('#complaints')) {
|
|
setTimeout(function() {
|
|
|
|
var tag_input_complaints = $('#complaints');
|
|
try {
|
|
tag_input_complaints.tag({
|
|
placeholder: tag_input_complaints.attr('placeholder'),
|
|
|
|
source: complaints,
|
|
tagClass: 'bigTag',
|
|
trimValue: true,
|
|
allowDuplicates: false
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#complaints').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingComplaints = "<?php $complaint_ids = explode(",",$row['complaints']);
|
|
foreach($complaint_ids as $complaint){
|
|
if(is_numeric($complaint)){
|
|
echo getCommaSeperatedValuesForInClause('select complaint from complaints','complaint_id',$row['complaints']);
|
|
break;
|
|
}else{
|
|
echo $row['complaints'];
|
|
break;
|
|
}
|
|
} ?>"
|
|
if (existingComplaints != undefined && existingComplaints != null &&
|
|
existingComplaints != '') {
|
|
var existingComplaintsArr = existingComplaints.split(",");
|
|
jQuery.each(existingComplaintsArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//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_complaints.after('<textarea id="' + tag_input_complaints.attr('id') +
|
|
'" name="' + tag_input_complaints.attr('name') + '" rows="3">' +
|
|
tag_input_complaints.val() + '</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
var y = $('#complaints').parents(".col-sm-3").width();
|
|
$('#complaints').siblings().css('width', y - 5);
|
|
}, 500);
|
|
}
|
|
<?php } ?>
|
|
<?php if(!strcmp(strtolower($examination_remarks_config) ,"true")){?>
|
|
if ($('#examination_remarks')) {
|
|
setTimeout(function() {
|
|
|
|
var tag_input_findings = $('#examination_remarks');
|
|
try {
|
|
tag_input_findings.tag({
|
|
placeholder: tag_input_findings.attr('placeholder'),
|
|
|
|
source: findings,
|
|
// tagClass: 'bigTag',
|
|
// trimValue: true,
|
|
// allowDuplicates: false
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#examination_remarks').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingFindings =
|
|
"<?php echo getCommaSeperatedValuesForInClause('select examination_finding from examination_findings','id',$row['examination_remarks'])?>"
|
|
if (existingFindings != undefined && existingFindings != null && existingFindings !=
|
|
'') {
|
|
var existingFindingsArr = existingFindings.split(",");
|
|
jQuery.each(existingFindingsArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//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_findings.after('<textarea id="' + tag_input_findings.attr('id') + '" name="' +
|
|
tag_input_findings.attr('name') + '" rows="3">' + tag_input_findings.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
|
|
var y = $('#examination_remarks').parents(".col-sm-3").width();
|
|
$('#examination_remarks').siblings().css('width', y - 5);
|
|
|
|
|
|
}, 500);
|
|
}
|
|
|
|
<?php } ?>
|
|
if ($('#referral')) {
|
|
setTimeout(function() {
|
|
|
|
var tag_input_referrals = $('#referral');
|
|
try {
|
|
tag_input_referrals.tag({
|
|
placeholder: tag_input_referrals.attr('placeholder'),
|
|
|
|
source: referrals
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#referral').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingReferrals =
|
|
"<?php echo getCommaSeperatedValuesForInClause('select referral_point_name from referral_point','referral_point_id',$row['referral'])?>"
|
|
if (existingReferrals != undefined && existingReferrals != null && existingReferrals !=
|
|
'') {
|
|
var existingReferralsArr = existingReferrals.split(",");
|
|
jQuery.each(existingReferralsArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//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_referrals.after('<textarea id="' + tag_input_referrals.attr('id') +
|
|
'" name="' + tag_input_referrals.attr('name') + '" rows="3">' +
|
|
tag_input_referrals.val() + '</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
|
|
var y = $('#referral').parents(".col-sm-4").width();
|
|
$('#referral').siblings().css('width', y - 5);
|
|
}, 500);
|
|
}
|
|
|
|
|
|
/*if($('#injury_class_new')){
|
|
var tag_input_classes = $('#injury_class_new');
|
|
try{
|
|
tag_input_classes.tag(
|
|
{
|
|
placeholder:tag_input_classes.attr('placeholder'),
|
|
|
|
source:injuryClasses
|
|
|
|
}
|
|
)
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#injury_class_new').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingClasses = "<?php echo $row['injury_classes_new']?>"
|
|
if(existingClasses!=undefined && existingClasses!=null && existingClasses!=''){
|
|
var existingClassesArr =existingClasses.split(",");
|
|
jQuery.each( existingClassesArr, function( i, val ) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//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_classes.after('<textarea id="'+tag_input_classes.attr('id')+'" name="'+tag_input_classes.attr('name')+'" rows="3">'+tag_input_classes.val()+'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}//end injury parts*/
|
|
|
|
|
|
/*if($('#injury_type_new')){
|
|
var tag_input_types = $('#injury_type_new');
|
|
try{
|
|
tag_input_types.tag(
|
|
{
|
|
placeholder:tag_input_types.attr('placeholder'),
|
|
|
|
source:injuryTypes
|
|
|
|
}
|
|
)
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#injury_type_new').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingTypes = "<?php echo $row['injury_types_new']?>"
|
|
if(existingTypes!=undefined && existingTypes!=null && existingTypes!=''){
|
|
var existingTypesArr =existingTypes.split(",");
|
|
jQuery.each( existingTypesArr, function( i, val ) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//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_types.after('<textarea id="'+tag_input_types.attr('id')+'" name="'+tag_input_types.attr('name')+'" rows="3">'+tag_input_types.val()+'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}//end injury Types*/
|
|
|
|
|
|
if ($('#injury_part_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_parts = $('#injury_part_new');
|
|
try {
|
|
tag_input_parts.tag({
|
|
placeholder: tag_input_parts.attr('placeholder'),
|
|
|
|
source: affectedBodyParts
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#injury_part_new').data('tag');
|
|
//$tag_obj.add('Programmatically Added');
|
|
var existingParts = "<?php echo $row['injury_parts_new']?>"
|
|
if (existingParts != undefined && existingParts != null && existingParts != '') {
|
|
var existingPartsArr = existingParts.split(",");
|
|
jQuery.each(existingPartsArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//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_parts.after('<textarea id="' + tag_input_parts.attr('id') + '" name="' +
|
|
tag_input_parts.attr('name') + '" rows="3">' + tag_input_parts.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}, 500);
|
|
} //end injury parts
|
|
if ($('#health_advice_name_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_advices = $('#health_advice_name_new');
|
|
try {
|
|
tag_input_advices.tag({
|
|
placeholder: tag_input_advices.attr('placeholder'),
|
|
|
|
source: healthAdvices,
|
|
tagClass: 'bigTag',
|
|
trimValue: true,
|
|
allowDuplicates: false,
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#health_advice_name_new').data('tag');
|
|
var existingHealthAdvices = "<?php echo $row['health_advices_new']?>"
|
|
if (existingHealthAdvices != undefined && existingHealthAdvices != null &&
|
|
existingHealthAdvices != '') {
|
|
var existingHealthAdvicesArr = existingHealthAdvices.split(",");
|
|
jQuery.each(existingHealthAdvicesArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
}
|
|
//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_advices.after('<textarea id="' + tag_input_advices.attr('id') + '" name="' +
|
|
tag_input_advices.attr('name') + '" rows="3">' + tag_input_advices.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}, 500);
|
|
} //end health advices
|
|
|
|
});
|
|
<?php }?>
|
|
|
|
function openGroup(item_id_counter) {
|
|
var content = "";
|
|
var footerContent = "";
|
|
item_id = $("#treatment_item_" + item_id_counter).val();
|
|
$.ajax({
|
|
url: 'select_group_item.php?item_id=' + item_id + ' ',
|
|
type: 'POST',
|
|
success: function(data) {
|
|
data = $.parseJSON(data);
|
|
for (var i = 0; i < data.length; i++) {
|
|
childItem = data[i];
|
|
$("#group_item_name").html(childItem.item_name);
|
|
content += "<div class='row'>";
|
|
content += "<div class='col-md-12'>";
|
|
|
|
content += "<div class='col-md-6'>";
|
|
content += childItem.child_item_name;
|
|
content += "</div>";
|
|
content += "<div class='col-md-6'>";
|
|
content += "<div class='input-group'>";
|
|
content += "<input type='hidden' class='form-control' id='child_item_" + item_id_counter +
|
|
"_" + i + "' name='child_item_" + item_id_counter + "_" + i + "' value='" + childItem
|
|
.item_id + "'>";
|
|
if ($("#child_item_qty_gvn" + item_id_counter + "_" + i) != undefined && $(
|
|
"#child_item_qty_gvn" + item_id_counter + "_" + i).val() != undefined) {
|
|
content += "<input type='number' class='form-control' id='child_item_qty_gvn" +
|
|
item_id_counter + "_" + i + "' name='child_item_qty_gvn" + item_id_counter + "_" +
|
|
i + "' value='" + $("#child_item_qty_gvn" + item_id_counter + "_" + i).val() + "'>";
|
|
} else {
|
|
content += "<input type='number' class='form-control' id='child_item_qty_gvn" +
|
|
item_id_counter + "_" + i + "' name='child_item_qty_gvn" + item_id_counter + "_" +
|
|
i + "' value='" + childItem.qty + "'>";
|
|
}
|
|
content +=
|
|
"<span class='input-group-addon' style='font-size:8px; margin:1px;padding:1px;'>" +
|
|
unitMap[childItem.unit_id] + "</span>";
|
|
content += "</div>";
|
|
content += "</div>";
|
|
content += "</div>";
|
|
content += "</div>";
|
|
}
|
|
if (data.length > 0) {
|
|
footerContent += " <div><button type=\"button\" onclick=\"saveGroupChanges(" +
|
|
item_id_counter + "," + data.length + ")\" "
|
|
footerContent += " class=\"btn btn-primary\">Save Changes</button>";
|
|
footerContent += " </div>";
|
|
|
|
|
|
}
|
|
$("#group_item_details").html(content);
|
|
$("#group_item_details").append(footerContent);
|
|
$('#modal_group_item_pop').modal("show");
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating Sickness');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
function saveGroupChanges(item_id_counter, childItemCount) {
|
|
$('#group_child_flag_' + item_id_counter).val("1");
|
|
var map = new Map();
|
|
for (var i = 0; i < childItemCount; i++) {
|
|
newVal = $("#child_item_" + item_id_counter + "_" + i).val();
|
|
map.set("#child_item_" + item_id_counter + "_" + i, newVal);
|
|
|
|
newVal = $("#child_item_qty_gvn" + item_id_counter + "_" + i).val();
|
|
map.set("#child_item_qty_gvn" + item_id_counter + "_" + i, newVal);
|
|
}
|
|
$('#modal_group_item_pop').modal("hide");
|
|
var newContent = "";
|
|
|
|
for (var i = 0; i < childItemCount; i++) {
|
|
newContent += "<input type='hidden' name=\"child_item_" + item_id_counter + "_" + i + "\" id=\"child_item_" +
|
|
item_id_counter + "_" + i + "\" value=\"" + map.get("#child_item_" + item_id_counter + "_" + i) + "\">";
|
|
newContent += "<input type='hidden' name=\"child_item_qty_gvn" + item_id_counter + "_" + i +
|
|
"\" id=\"child_item_qty_gvn" + item_id_counter + "_" + i + "\" value=\"" + map.get("#child_item_qty_gvn" +
|
|
item_id_counter + "_" + i) + "\">";
|
|
}
|
|
$('#group_items_' + item_id_counter).html(newContent);
|
|
|
|
}
|
|
$(document).ready(function() {
|
|
$("input[type=text]").keyup(function() {
|
|
$(this).val($(this).val().toUpperCase());
|
|
});
|
|
$("textarea").keyup(function() {
|
|
$(this).val($(this).val().toUpperCase());
|
|
});
|
|
|
|
});
|
|
var flagReload = 0;
|
|
</script>
|
|
|
|
<?php include('group_item_pop.php'); ?>
|
|
<?php include 'support_opd_document.php'?>
|
|
<?php include 'image_popup_opd.php'?>
|
|
<style>
|
|
.tags .tag {
|
|
font-size: 10px;
|
|
}
|
|
</style>
|