Team 4 (Preview)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 42s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 42s
Details
This commit is contained in:
parent
078983878f
commit
426a525f7a
|
|
@ -342,14 +342,18 @@ foreach ($brands as $brand) {
|
||||||
title: 'Great!',
|
title: 'Great!',
|
||||||
text: 'Your data is successfully submitted!',
|
text: 'Your data is successfully submitted!',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
})
|
}).then(() => {
|
||||||
$('#report-form').trigger("reset");
|
location.reload(); // page reload
|
||||||
|
});
|
||||||
|
//$('#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!'
|
||||||
})
|
}).then(() => {
|
||||||
|
location.reload(); // page reload
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,24 @@
|
||||||
<h6>Submitted By: {{$form->user_info->name}}</h6>
|
<h6>Submitted By: {{$form->user_info->name}}</h6>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@php
|
||||||
|
/* echo "<pre>";
|
||||||
|
print_r($submitted_formdata);
|
||||||
|
echo "</pre>"; */
|
||||||
|
$skuData = [];
|
||||||
|
|
||||||
|
foreach($questions as $q){
|
||||||
|
if($q->code === 'sku'){
|
||||||
|
foreach($q->options as $opt){
|
||||||
|
$skuData[$opt->value] = $opt->submitted_value ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@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}}">
|
||||||
|
|
@ -61,6 +79,9 @@
|
||||||
|
|
||||||
|
|
||||||
@foreach($questions as $question)
|
@foreach($questions as $question)
|
||||||
|
@if (in_array($question->code, ['execution_date','executed_as_per_plan' ,'revised_start_time','patient_screened','patients_diagnosed','rxn_of_montair_lc_adult','rxn_of_montair_lc_kid_tab','rxn_of_montair_lc_kid_syrup','rxn_of_furamist','rxn_of_furamist_az','total_rxns']))
|
||||||
|
@continue
|
||||||
|
@endif
|
||||||
<div class="col-md-12 mb-2">
|
<div class="col-md-12 mb-2">
|
||||||
<label for="field-{{$question->code}}" class="form-label">{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!} </label>
|
<label for="field-{{$question->code}}" class="form-label">{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!} </label>
|
||||||
@switch($question->type)
|
@switch($question->type)
|
||||||
|
|
@ -82,19 +103,33 @@
|
||||||
@case('dropdown')
|
@case('dropdown')
|
||||||
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
||||||
<option value=""> -- Select -- </option>
|
<option value=""> -- Select -- </option>
|
||||||
|
@if ($question->code == 'contact_id')
|
||||||
|
@foreach ($question->options as $option)
|
||||||
|
|
||||||
|
<option value="{{ $option->value }}" legacy_code="{{isset($option->contact->legacy_code)?$option->contact->legacy_code:''}}" speciality="{{isset($option->contact->speciality)?$option->contact->speciality:''}}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
|
||||||
|
{{ $option->display }}
|
||||||
|
</option>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
<option value="others" {{ isset($question->value) && $question->value == 'others' ? 'selected':'' }}>
|
||||||
|
Others
|
||||||
|
</option>
|
||||||
|
@elseif($question->code=='contact_id_2')
|
||||||
@foreach ($question->options as $option)
|
@foreach ($question->options as $option)
|
||||||
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type != 'chemist' )
|
|
||||||
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'msl_code= ' . (isset($option->contact->msl_code)?$option->contact->msl_code:'') . ' ' : '' }} {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }} {{ $question->code == 'contact_id' ? 'speciality= ' . (isset($option->contact->speciality) ? $option->contact->speciality :'') . ' ' : '' }} >
|
<option value="{{ $option->value }}" legacy_code="{{isset($option->contact->legacy_code)?$option->contact->legacy_code:''}}" speciality="{{isset($option->contact->speciality)?$option->contact->speciality:''}}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
|
||||||
{{ $option->display }}
|
{{ $option->display }}
|
||||||
</option>
|
</option>
|
||||||
@elseif($question->code != 'contact_id')
|
|
||||||
<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 :'') . ' ' : '' }} >
|
@endforeach
|
||||||
{{ $option->display }}
|
|
||||||
</option>
|
@else
|
||||||
|
@foreach ($question->options as $option)
|
||||||
|
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
|
||||||
|
{{ $option->display }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
@endforeach
|
|
||||||
</select>
|
</select>
|
||||||
@break
|
@break
|
||||||
@case('checkbox')
|
@case('checkbox')
|
||||||
|
|
@ -113,7 +148,7 @@
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@break
|
@break
|
||||||
@case('multitextbox')
|
{{-- @case('multitextbox')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@foreach($question->options as $option)
|
@foreach($question->options as $option)
|
||||||
<div class="col-6">{{$option->display}}</div>
|
<div class="col-6">{{$option->display}}</div>
|
||||||
|
|
@ -122,17 +157,23 @@
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
@break
|
@break --}}
|
||||||
|
|
||||||
@case('time')
|
@case('multitextbox')
|
||||||
<input type="time"
|
<div class="row">
|
||||||
id="field-{{$question->code}}"
|
@foreach($question->options as $option)
|
||||||
name="{{$question->code}}"
|
<div class="col-6">{{ $option->display }}</div>
|
||||||
class="form-control"
|
<div class="col-6 mb-1">
|
||||||
{{$question->required == 'yes' ? 'required' : ''}}
|
<input type="number"
|
||||||
value="{{isset($question->value) ? $question->value : ''}}">
|
id="field-{{ $option->value }}"
|
||||||
@break
|
name="{{ $option->value }}"
|
||||||
|
class="form-control"
|
||||||
|
required
|
||||||
|
value="{{ $submitted_formdata->{$option->value} ?? 0 }}">
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@break
|
||||||
@endswitch
|
@endswitch
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
@ -182,7 +223,6 @@
|
||||||
let hierarchy = $('option:selected', this).attr('hierarchy');
|
let hierarchy = $('option:selected', this).attr('hierarchy');
|
||||||
$('#field-hierarchy_id').val(hierarchy)
|
$('#field-hierarchy_id').val(hierarchy)
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$("#pageloader").fadeIn();
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy='+hierarchy,
|
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy='+hierarchy,
|
||||||
|
|
@ -193,16 +233,12 @@
|
||||||
$('#field-contact_id').html('')
|
$('#field-contact_id').html('')
|
||||||
$('#field-contact_id').append($("<option></option>").attr("value",'').text('-- Select --'));
|
$('#field-contact_id').append($("<option></option>").attr("value",'').text('-- Select --'));
|
||||||
for (let itm of data) {
|
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').append($("<option></option>").attr("value",itm.value).text(itm.display).attr("msl_code", itm.contact.msl_code));
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#field-contact_id').change(function() {
|
$('#field-contact_id').change(function() {
|
||||||
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#field-contact_id').change(function() {
|
|
||||||
$('#field-speciality').val($('option:selected', this).attr('speciality'))
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -217,52 +253,29 @@
|
||||||
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#field-msl_code,#field-speciality').attr('readonly',true);
|
|
||||||
|
|
||||||
|
|
||||||
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":false});
|
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').prop({"required":false});
|
||||||
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().hide();
|
$('#field-other_doctor_name,#field-other_speciality,#field-other_msl_code').parent().hide();
|
||||||
|
|
||||||
|
|
||||||
$('#field-contact_id').on('change',function(){
|
|
||||||
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)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event){
|
$('#report-form').on('submit', function(event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
const formData = new FormData($('#report-form')[0]);
|
const formData = new FormData($('#report-form')[0]);
|
||||||
|
|
||||||
// Log form data to console
|
// Log form data to console
|
||||||
for (let [key, value] of formData.entries()) {
|
for (let [key, value] of formData.entries()) {
|
||||||
console.log(key, value);
|
console.log(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$("#pageloader").fadeIn();
|
$("#pageloader").fadeIn();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
|
@ -277,9 +290,7 @@
|
||||||
title: 'Great!',
|
title: 'Great!',
|
||||||
text: 'Your data is successfully submitted!',
|
text: 'Your data is successfully submitted!',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
}).then(() => {
|
})
|
||||||
location.reload(); // 🔥 page refresh here
|
|
||||||
});
|
|
||||||
$('#report-form').trigger("reset");
|
$('#report-form').trigger("reset");
|
||||||
} else {
|
} else {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue