diff --git a/resources/views/form/rapport-gennovadc/1777713876-e5a33d1a-8d00-4800-9b88-e78815ece1d4.blade.php b/resources/views/form/rapport-gennovadc/1777713876-e5a33d1a-8d00-4800-9b88-e78815ece1d4.blade.php
index f18fee2c..de79c334 100644
--- a/resources/views/form/rapport-gennovadc/1777713876-e5a33d1a-8d00-4800-9b88-e78815ece1d4.blade.php
+++ b/resources/views/form/rapport-gennovadc/1777713876-e5a33d1a-8d00-4800-9b88-e78815ece1d4.blade.php
@@ -584,7 +584,7 @@ $brandData2 = [
+ class="form-control form-control-large" value="{{ isset($formdata->{$brand['slug']}) ? $formdata->{$brand['slug']} : 0 }}" >
|
@@ -941,7 +941,9 @@ $brandData2 = [
}
}) */
- $('[id*="_transplant_"][id*="week"]').prop('readonly', true);
+ $('[id*="_transplant_"][id*="week"]').prop('readonly', true);
+
+
$('#execution-execution_week').on('change', function () {
@@ -964,12 +966,17 @@ $brandData2 = [
});
});
}
+
+ $('#execution-total_transplant').prop('readonly', true);
+
+ $('[id^="execution-total_transplant_"]').prop('readonly', true);
+
});
- $(document).on('input', '[id*="_transplant_"][id*="week"]', function () {
+ /* $(document).on('input', '[id*="_transplant_"][id*="week"]', function () {
const organs = ['kidney', 'liver', 'heart', 'cardio'];
const organsWeek = ['kidney', 'liver', 'heart']; // exclude cardio
@@ -1021,8 +1028,68 @@ $brandData2 = [
// -------------------------
$('#execution-total_transplant').val(totalTransplant);
+ }); */
+
+
+ $(document).on('input','[id*="_transplant_"]',function () {
+
+ const organs = ['kidney', 'liver', 'heart'];
+ const organsWeek = ['kidney', 'liver', 'heart'];
+ const types = ['gennova', 'switch', 'graftsol'];
+
+ // -------------------------
+ // 1. WEEK-WISE TOTALS
+ // -------------------------
+ for (let week = 1; week <= 4; week++) {
+
+ types.forEach(type => {
+
+ let total = 0;
+
+ organsWeek.forEach(organ => {
+
+ let id = `#execution-${organ}_transplant_${type}_week${week}`;
+
+ total += parseInt($(id).val()) || 0;
+
+ });
+
+ $(`#execution-total_transplant_${type}_week${week}`).val(total);
+
+ });
+
+ }
+
+ // -------------------------
+ // 2. FIRST COLUMN GRAND TOTAL
+ // -------------------------
+ let firstColumnTotal = 0;
+
+ organs.forEach(organ => {
+
+ firstColumnTotal += parseInt(
+ $(`#execution-${organ}_transplant`).val()
+ ) || 0;
+
+ });
+
+ $('#execution-total_transplant').val(firstColumnTotal);
+
});
-
+
+ $(document).on('input','#execution-kidney_transplant, #execution-liver_transplant, #execution-heart_transplant',function () {
+
+ let total =
+ (parseInt($('#execution-kidney_transplant').val()) || 0) +
+ (parseInt($('#execution-liver_transplant').val()) || 0) +
+ (parseInt($('#execution-heart_transplant').val()) || 0);
+
+ $('#execution-total_transplant').val(total);
+
+ }
+ );
+
+
})
@@ -1217,8 +1284,12 @@ $brandData2 = [
// });
$('.edit-btn').click(function() {
+ let today = new Date().toISOString().split('T')[0];
var executionexeField = document.getElementById('execution-execution_date');
- executionexeField.setAttribute('min', executionDateField.value);
+ console.log("Edit execution date");
+ //executionexeField.setAttribute('min', executionDateField.value);
+ executionexeField.setAttribute('max',today);
+
});
|