Vitalis (Ek Nayi Shuruwat)
This commit is contained in:
parent
dd2a2cbf79
commit
fb536a7020
|
|
@ -39,13 +39,6 @@
|
||||||
<h6>Submitted By: {{$form->user_info->name}}</h6>
|
<h6>Submitted By: {{$form->user_info->name}}</h6>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@php
|
|
||||||
$submissions = Formhelper::getMultiformData($form->partition, $form_id, $form->user_id);
|
|
||||||
$submissions = isset($submissions->data->submissions) ? $submissions->data->submissions : [];
|
|
||||||
@endphp
|
|
||||||
|
|
||||||
|
|
||||||
<form method="POST" action="/form/submit" id="report-form" enctype="multipart/form-data">
|
<form method="POST" action="/form/submit" id="report-form" enctype="multipart/form-data">
|
||||||
<input type="hidden" name="form_id" value="{{$form_id}}">
|
<input type="hidden" name="form_id" value="{{$form_id}}">
|
||||||
<input type="hidden" name="user_id" value="{{$form->user_id}}">
|
<input type="hidden" name="user_id" value="{{$form->user_id}}">
|
||||||
|
|
@ -54,6 +47,19 @@
|
||||||
@if($id)
|
@if($id)
|
||||||
<input type="hidden" name="id" value="{{$id}}">
|
<input type="hidden" name="id" value="{{$id}}">
|
||||||
@endif
|
@endif
|
||||||
|
@if(isset($form->manager_can_submit) && $form->manager_can_submit == true)
|
||||||
|
<div class="col-md-12 mb-2">
|
||||||
|
<label for="field-user_id" class="form-label"> Select User / Territory <span class="text-danger">*</span> </label>
|
||||||
|
<select class="form-control" id="field-user_id" name="manager_id" required>
|
||||||
|
<option value=""> -- Select -- </option>
|
||||||
|
@foreach($form->users as $option)
|
||||||
|
<option value="{{$option->value}}" hierarchy="{{$option->hierarchy_id}}" {{isset($question->value) && $question->value == $option->value ? 'selected':''}}>{{$option->display}}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<input type="hidden" id="field-hierarchy_id" name="hierarchy_id" value="">
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
@foreach($questions as $question)
|
@foreach($questions as $question)
|
||||||
<div class="col-md-12 mb-2">
|
<div class="col-md-12 mb-2">
|
||||||
|
|
@ -75,31 +81,38 @@
|
||||||
<textarea id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" {{$question->required == 'yes'?'required':'' }}>{{isset($question->value)?$question->value:''}}</textarea>
|
<textarea id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" {{$question->required == 'yes'?'required':'' }}>{{isset($question->value)?$question->value:''}}</textarea>
|
||||||
@break
|
@break
|
||||||
@case('dropdown')
|
@case('dropdown')
|
||||||
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" data-preselected="{{ isset($question->value) ? (string)$question->value : '' }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
<select class="form-control" {!!($question->code
|
||||||
|
== 'contact_id')?'data-toggle="select2"':'' !!} id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
||||||
<option value=""> -- Select -- </option>
|
<option value=""> -- Select -- </option>
|
||||||
@foreach ($question->options as $option)
|
@foreach ($question->options as $option)
|
||||||
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'doctor' )
|
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'doctor' )
|
||||||
<option value="{{ $option->value }}"
|
<option value="{{ $option->value }}"
|
||||||
@if(isset($question->value) && $question->value == $option->value) selected @endif
|
@if(isset($question->value) && $question->value == $option->value) selected @endif
|
||||||
@if($question->code == 'contact_id')
|
@if($question->code == 'contact_id')
|
||||||
msl_code="{{ (isset($option->contact->legacy_code) ? $option->contact->legacy_code : '') }}"
|
msl_code="{{ (isset($option->contact->msl_code) ? $option->contact->msl_code : '') }}"
|
||||||
speciality="{{ (isset($option->contact->speciality) ? $option->contact->speciality : '') }}"
|
speciality="{{ (isset($option->contact->speciality) ? $option->contact->speciality : '') }}"
|
||||||
@endif
|
@endif
|
||||||
>
|
>
|
||||||
{{ $option->display }}
|
{{ $option->display }}
|
||||||
</option>
|
</option>
|
||||||
@elseif($question->code != 'contact_id')
|
@elseif($question->code != 'contact_id')
|
||||||
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
|
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'pcode= ' . (isset($option->contact->pcode)?$option->contact->pcode:'') . ' ' : '' }} {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'speciality= ' . (isset($option->contact->speciality) ? $option->contact->speciality :'') . ' ' : '' }} >
|
||||||
{{ $option->display }}
|
{{ $option->display }}
|
||||||
</option>
|
</option>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@if($question->code=='contact_id')
|
||||||
|
<option value="others" {{ isset($question->value) && $question->value == 'others' ? 'selected' : '' }}>Others</option>
|
||||||
|
@endif
|
||||||
</select>
|
</select>
|
||||||
@break
|
@break
|
||||||
@case('checkbox')
|
@case('checkbox')
|
||||||
@foreach($question->options as $option)
|
@foreach($question->options as $option)
|
||||||
<div class="form-check mb-2 form-check-primary">
|
<div class="form-check mb-2 form-check-primary">
|
||||||
<input class="form-check-input" type="checkbox" id="field-{{$question->code}}-{{$option->value}}" name="{{$question->code}}[]" value="{{$option->value}}" {{isset($question->value) && $question->value != '' && in_array($option->value, (array)$question->value) ? 'checked':''}}>
|
<input class="form-check-input" type="checkbox" id="field-{{$question->code}}-{{$option->value}}" name="{{$question->code}}[]" value="{{$option->value}}" {{isset($question->value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked':''}}>
|
||||||
<label class="form-check-label" for="field-{{$question->code}}-{{$option->value}}">{{$option->display}}</label>
|
<label class="form-check-label" for="field-{{$question->code}}-{{$option->value}}">{{$option->display}}</label>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
@ -110,6 +123,7 @@
|
||||||
@elseif(isset($question->value))
|
@elseif(isset($question->value))
|
||||||
<img src="{{$question->value}}" class="img-fluid">
|
<img src="{{$question->value}}" class="img-fluid">
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@break
|
@break
|
||||||
@case('multitextbox')
|
@case('multitextbox')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
@ -120,7 +134,8 @@
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
@break
|
@break
|
||||||
|
|
||||||
@case('time')
|
@case('time')
|
||||||
<input type="time"
|
<input type="time"
|
||||||
id="field-{{$question->code}}"
|
id="field-{{$question->code}}"
|
||||||
|
|
@ -128,7 +143,8 @@
|
||||||
class="form-control"
|
class="form-control"
|
||||||
{{$question->required == 'yes' ? 'required' : ''}}
|
{{$question->required == 'yes' ? 'required' : ''}}
|
||||||
value="{{isset($question->value) ? $question->value : ''}}">
|
value="{{isset($question->value) ? $question->value : ''}}">
|
||||||
@break
|
@break
|
||||||
|
|
||||||
@endswitch
|
@endswitch
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
@ -139,13 +155,19 @@
|
||||||
@endif
|
@endif
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div> <!-- end card-body -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- end card -->
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<!-- end row -->
|
||||||
|
|
||||||
|
</div> <!-- end col -->
|
||||||
|
</div>
|
||||||
|
<!-- end row -->
|
||||||
|
</div>
|
||||||
|
<!-- end container -->
|
||||||
|
</div>
|
||||||
|
<!-- end page -->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#pageloader {
|
#pageloader {
|
||||||
background: rgba( 255, 255, 255, 0.8 );
|
background: rgba( 255, 255, 255, 0.8 );
|
||||||
|
|
@ -155,6 +177,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pageloader img {
|
#pageloader img {
|
||||||
left: 50%;
|
left: 50%;
|
||||||
margin-left: -32px;
|
margin-left: -32px;
|
||||||
|
|
@ -169,182 +192,120 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function($){
|
jQuery(document).ready(function($){
|
||||||
$('[data-toggle="select2"]').select2();
|
$('[data-toggle="select2"]').select2();
|
||||||
var hierarcies = [];
|
$('#field-user_id').change(function(){
|
||||||
var contacts = [];
|
let hierarchy = $('option:selected', this).attr('hierarchy');
|
||||||
|
$('#field-hierarchy_id').val(hierarchy)
|
||||||
|
event.preventDefault();
|
||||||
|
$("#pageloader").fadeIn();
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy='+hierarchy,
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
success: function( data ) {
|
||||||
|
$("#pageloader").fadeOut();
|
||||||
|
$('#field-contact_id').html('')
|
||||||
|
$('#field-contact_id').append($("<option></option>").attr("value",'').text('-- Select --'));
|
||||||
|
for (let itm of data) {
|
||||||
|
$('#field-contact_id').append($("<option></option>").attr("value",itm.value).text(itm.display).attr("msl_code", itm.contact.msl_code).attr('speciality',itm.contact.speciality));
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#field-contact_id').change(function() {
|
||||||
|
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#field-contact_id').change(function() {
|
||||||
|
$('#field-speciality').val($('option:selected', this).attr('speciality'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(hierarchy)
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#field-contact_id').change(function() {
|
||||||
|
$('#field-speciality').val($('option:selected', this).attr('speciality'))
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#field-contact_id').change(function() {
|
||||||
|
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#field-msl_code,#field-speciality').attr('readonly',true);
|
||||||
|
|
||||||
|
|
||||||
var allSubmissions = @json($submissions ?? []);
|
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":false});
|
||||||
var currentEditId = '{{ $id ?? '' }}';
|
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().hide();
|
||||||
var submittedDoctors = [];
|
|
||||||
|
|
||||||
if (Array.isArray(allSubmissions)) {
|
|
||||||
allSubmissions.forEach(function(sub) {
|
$('#field-contact_id').on('change',function(){
|
||||||
if (currentEditId && sub.id && String(sub.id) === String(currentEditId)) {
|
let dropDown=$('#field-contact_id').val();
|
||||||
|
if(dropDown==='others'){
|
||||||
|
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().show();
|
||||||
|
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":true});
|
||||||
|
$('#field-speciality,#field-msl_code').parent().hide();
|
||||||
|
$('#field-speciality,#field-msl_code').prop({"required":false});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().hide();
|
||||||
|
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":false});
|
||||||
|
$('#field-speciality,#field-msl_code').parent().show();
|
||||||
|
$('#field-speciality,#field-msl_code').prop({"required":true});
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// $('#field-contact_id').append('<option value="others">Others</option>');
|
||||||
|
|
||||||
|
$('#field-sitazit_d_rx,#field-sitazit_dm_rx,#field-ziten_m_rx').on('input', function() {
|
||||||
|
var total=(
|
||||||
|
(parseInt($('#execution-sitazit_d_rx').val())*15 ||0)+
|
||||||
|
(parseInt($('#execution-sitazit_dm_rx').val())*25 ||0)+
|
||||||
|
(parseInt($('#execution-ziten_m_rx').val())*35 ||0)
|
||||||
|
);
|
||||||
|
|
||||||
|
$('#execution-total_camp_rx').val(total)
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#field-file_upload').on('change', function () {
|
||||||
|
let file = this.files[0];
|
||||||
|
|
||||||
|
if (file) {
|
||||||
|
let allowedTypes = ['image/png', 'image/jpg', 'image/jpeg'];
|
||||||
|
let maxSize = 10 * 1024 * 1024; // 10 MB
|
||||||
|
|
||||||
|
// Type validation
|
||||||
|
if (!allowedTypes.includes(file.type)) {
|
||||||
|
alert('Only PNG, JPG, and JPEG files are allowed.');
|
||||||
|
$(this).val('');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (sub && sub.formdata) {
|
|
||||||
if (sub.formdata.contact_id) {
|
// Size validation
|
||||||
submittedDoctors.push(String(sub.formdata.contact_id).trim().toLowerCase());
|
if (file.size > maxSize) {
|
||||||
}
|
alert('File size should not exceed 10 MB.');
|
||||||
if (sub.formdata.cont_id) {
|
$(this).val('');
|
||||||
submittedDoctors.push(String(sub.formdata.cont_id).trim().toLowerCase());
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
@if(isset($form->manager_can_submit) && $form->manager_can_submit == true)
|
$(document).ready(function () {
|
||||||
@foreach($form->users as $option)
|
$('#field-contact_id').trigger('change');
|
||||||
hierarcies.push('{{$option->hierarchy_id}}');
|
});
|
||||||
@endforeach
|
|
||||||
$("#pageloader").fadeIn();
|
|
||||||
Promise.all(
|
|
||||||
hierarcies.map(hierarchy => {
|
|
||||||
return $.ajax({
|
|
||||||
type: "GET",
|
|
||||||
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy=' + hierarchy,
|
|
||||||
processData: false,
|
|
||||||
contentType: false
|
|
||||||
}).then(data => {
|
|
||||||
contacts = contacts.concat(data);
|
|
||||||
}).catch(function(err) {
|
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
).then(function() {
|
|
||||||
contacts = contacts.filter(function(itm) { return itm && itm.value !== 'sample'; });
|
|
||||||
|
|
||||||
function applySelect2ToDoctorDropdowns() {
|
$('#field-city,#field-state,#field-departmental_head_name').on('input', function () {
|
||||||
$("[id^='field-contact_id']").each(function () {
|
this.value = this.value.replace(/[^a-zA-Z\s]/g, '');
|
||||||
var select = $(this);
|
});
|
||||||
if (select.data("select2")) return;
|
|
||||||
select.select2({
|
|
||||||
width: "100%",
|
|
||||||
placeholder: "-- Select --",
|
|
||||||
allowClear: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function enforceUniqueDoctorSelections() {
|
|
||||||
var selectedValues = [];
|
|
||||||
|
|
||||||
$("[id^='field-contact_id']").each(function () {
|
|
||||||
var v = $(this).val();
|
|
||||||
if (v) selectedValues.push(String(v));
|
|
||||||
});
|
|
||||||
|
|
||||||
$("[id^='field-contact_id']").each(function () {
|
|
||||||
var currentSelect = $(this);
|
|
||||||
var currentVal = currentSelect.val() ? String(currentSelect.val()) : "";
|
|
||||||
|
|
||||||
currentSelect.find("option").each(function () {
|
|
||||||
var opt = $(this);
|
|
||||||
var optVal = String(opt.val() || '');
|
|
||||||
var optText = opt.text();
|
|
||||||
|
|
||||||
if (optText.indexOf("Already Added") !== -1) {
|
|
||||||
opt.prop("disabled", true);
|
|
||||||
} else if (optVal && selectedValues.includes(optVal) && optVal !== currentVal) {
|
|
||||||
opt.prop("disabled", true);
|
|
||||||
} else {
|
|
||||||
opt.prop("disabled", false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (currentSelect.data("select2")) {
|
|
||||||
currentSelect.trigger("change.select2");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$("[id^='field-contact_id']").each(function() {
|
|
||||||
var select = $(this);
|
|
||||||
var existingVal = select.attr('data-preselected') !== undefined && select.attr('data-preselected') !== ''
|
|
||||||
? String(select.attr('data-preselected'))
|
|
||||||
: (select.val() ? String(select.val()) : '');
|
|
||||||
|
|
||||||
select.empty();
|
|
||||||
select.append($("<option></option>").attr("value", '').text('-- Select --'));
|
|
||||||
|
|
||||||
contacts.forEach(function(itm) {
|
|
||||||
var itmVal = String(itm.value);
|
|
||||||
var itmText = String(itm.display);
|
|
||||||
|
|
||||||
var valCheck = itmVal.trim().toLowerCase();
|
|
||||||
var textCheck = itmText.trim().toLowerCase();
|
|
||||||
|
|
||||||
var isAlreadySubmitted = submittedDoctors.includes(valCheck) || submittedDoctors.includes(textCheck);
|
|
||||||
var isCurrentSelected = (existingVal !== '' && (existingVal.toLowerCase() === valCheck || existingVal.toLowerCase() === textCheck));
|
|
||||||
|
|
||||||
var displayText = itmText;
|
|
||||||
var isDisabled = false;
|
|
||||||
|
|
||||||
if (isAlreadySubmitted && !isCurrentSelected) {
|
|
||||||
displayText += " - Already Added";
|
|
||||||
isDisabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var option = $("<option></option>")
|
|
||||||
.attr("value", itm.value)
|
|
||||||
.text(displayText)
|
|
||||||
.prop("disabled", isDisabled);
|
|
||||||
|
|
||||||
if (itm.contact && itm.contact.msl_code) {
|
|
||||||
option.attr("msl_code", itm.contact.msl_code);
|
|
||||||
}
|
|
||||||
if (itm.contact && itm.contact.speciality) {
|
|
||||||
option.attr("speciality", itm.contact.speciality);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isCurrentSelected) {
|
|
||||||
option.prop('selected', true);
|
|
||||||
}
|
|
||||||
|
|
||||||
select.append(option);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (existingVal) {
|
|
||||||
select.val(existingVal);
|
|
||||||
}
|
|
||||||
|
|
||||||
select.off('change').on('change', function () {
|
|
||||||
var selected = $(this).find(':selected');
|
|
||||||
var selectId = $(this).attr('id');
|
|
||||||
var match = selectId.match(/^field-contact_id(_\d+)?$/);
|
|
||||||
var suffix = match && match[1] ? match[1] : '';
|
|
||||||
|
|
||||||
var mslCodeField = $('#field-msl_code' + suffix);
|
|
||||||
var specialityField = $('#field-speciality' + suffix);
|
|
||||||
|
|
||||||
if (mslCodeField.length) {
|
|
||||||
mslCodeField.val(selected.attr('msl_code') || '');
|
|
||||||
}
|
|
||||||
if (specialityField.length) {
|
|
||||||
specialityField.val(selected.attr('speciality') || '');
|
|
||||||
}
|
|
||||||
|
|
||||||
enforceUniqueDoctorSelections();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
applySelect2ToDoctorDropdowns();
|
|
||||||
|
|
||||||
$("[id^='field-contact_id']").each(function() {
|
|
||||||
var select = $(this);
|
|
||||||
var preVal = select.attr('data-preselected');
|
|
||||||
if (preVal) {
|
|
||||||
select.val(String(preVal)).trigger('change');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
enforceUniqueDoctorSelections();
|
|
||||||
$("#pageloader").fadeOut();
|
|
||||||
});
|
|
||||||
@endif
|
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event){
|
$('#report-form').on('submit', function(event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
const formData = new FormData($('#report-form')[0]);
|
||||||
|
// Log form data to console
|
||||||
|
for (let [key, value] of formData.entries()) {
|
||||||
|
console.log(key, value);
|
||||||
|
}
|
||||||
$("#pageloader").fadeIn();
|
$("#pageloader").fadeIn();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
|
@ -360,40 +321,31 @@
|
||||||
text: 'Your data is successfully submitted!',
|
text: 'Your data is successfully submitted!',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
location.reload();
|
location.reload(); // 🔥 page refresh here
|
||||||
});
|
});
|
||||||
$('#report-form').trigger("reset");
|
$('#report-form').trigger("reset");
|
||||||
} else {
|
} else {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
title: 'Data not submitted',
|
title: 'Data not submitted',
|
||||||
text: 'Something went wrong, please try again after some time!'
|
text: 'Something went wrong, please try again after some time!'
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function() {
|
|
||||||
$("#pageloader").fadeOut();
|
|
||||||
Swal.fire({
|
|
||||||
icon: 'error',
|
|
||||||
title: 'Server Error',
|
|
||||||
text: 'An unexpected error occurred. Please try again.'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
var dd = String(today.getDate()).padStart(2, '0');
|
var dd = String(today.getDate()).padStart(2, '0');
|
||||||
var mm = String(today.getMonth() + 1).padStart(2, '0');
|
var mm = String(today.getMonth() + 1).padStart(2, '0');
|
||||||
var yyyy = today.getFullYear();
|
var yyyy = today.getFullYear();
|
||||||
today = yyyy + '-' + mm + '-' + dd;
|
today = yyyy + '-' + mm + '-' + dd;
|
||||||
|
|
||||||
|
var plandateField = document.getElementById('field-record_date');
|
||||||
|
|
||||||
var plandateField = document.getElementById('field-record_date');
|
|
||||||
if(plandateField) {
|
|
||||||
plandateField.setAttribute('min', "2026-11-01");
|
|
||||||
plandateField.setAttribute('max', today);
|
plandateField.setAttribute('max', today);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in New Issue