diff --git a/resources/views/form/rapport-team4/1786942589-f94add7e-0b47-4fae-8ce1-c3abceecd87b.blade.php b/resources/views/form/rapport-team4/1786942589-f94add7e-0b47-4fae-8ce1-c3abceecd87b.blade.php
index 44ac4cd5..b139e2e2 100644
--- a/resources/views/form/rapport-team4/1786942589-f94add7e-0b47-4fae-8ce1-c3abceecd87b.blade.php
+++ b/resources/views/form/rapport-team4/1786942589-f94add7e-0b47-4fae-8ce1-c3abceecd87b.blade.php
@@ -88,9 +88,16 @@
$submissions = Formhelper::getMultiformData( $form->partition, $form_id, $form->user_id);
$submissions = $submissions->data->submissions;
+ /* echo "
";
+ print_r($submissions);
+ echo "
"; */
+
+ $existingCount = count($submissions);
+ $targetLimit = 20; // नवीन लिमिट २०
@endphp
- @if(count($submissions)===0 || $id)
+
+ @if($existingCount<20 || $id)
@elseif(!$id)
- You have already submitted the Chemist & Dr Tagging.
+ You have already submitted the 20 Chemist & Dr Tagging.
@endif
@@ -608,8 +615,25 @@ $(document).on(
preventDuplicateDoctors();
});
+ var existingCount = {{ $existingCount ?? 0 }};
+ var targetLimit = 20;
+
+ var maxAllowedToAdd = targetLimit - existingCount;
+
+ if(maxAllowedToAdd===1){
+ $('#adddoctor-btn').hide();
+ }
+ // सुरुवातीला स्क्रीनवर 1 फॉर्म असतो
+ var currentFormsOnScreen = 1;
+ var doctor_count = 0;
+
+ console.log("Existing Count:", existingCount);
+ console.log("Max Allowed to Add:", maxAllowedToAdd);
+
+
+
var doctor_count = 0
let numberOfSubmission=1;
@@ -617,7 +641,7 @@ $(document).on(
$('#adddoctor-btn').click(function() {
let doctorName=$('#field-contact_id').html();
- console.log("Doctor Name : ",doctorName);
+ /* console.log("Doctor Name : ",doctorName); */
doctor_count++;
numberOfSubmission=numberOfSubmission+1;
console.log("Number of Submission : ",numberOfSubmission);
@@ -692,7 +716,20 @@ $(document).on(
width: '100%'
});
-
+ let length=$('.doctor-wrapper').length;
+ console.log("length : ",length);
+ let lengthToBeAdded= maxAllowedToAdd;
+ let lengthUserWillAdd=maxAllowedToAdd-1;
+ console.log("Wrappers user can add",lengthToBeAdded);
+
+ if ($('.doctor-wrapper').length > lengthUserWillAdd) {
+ $('#adddoctor-btn').hide();
+ } else {
+ $('#adddoctor-btn').show();
+ }
+
+
+
setTimeout(() => {
@@ -703,12 +740,9 @@ $(document).on(
}, 500);
-
- if ($('.doctor-wrapper').length >= 20) {
- $('#adddoctor-btn').hide();
- } else {
- $('#adddoctor-btn').show();
- }
+
+
+
$('.btn-remove').unbind();
$('.btn-remove').click(function() {
@@ -728,6 +762,9 @@ $(document).on(
console.log("Number of doctors : ", doctor_count);
$('#adddoctor-btn').show();
+
+
+
});
@@ -773,7 +810,7 @@ $(document).on(
$('#report-form').on('submit', function(event) {
event.preventDefault();
- if (numberOfSubmission != 20) {
+ if (numberOfSubmission