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!',
|
||||
text: 'Your data is successfully submitted!',
|
||||
icon: 'success'
|
||||
})
|
||||
$('#report-form').trigger("reset");
|
||||
}).then(() => {
|
||||
location.reload(); // page reload
|
||||
});
|
||||
//$('#report-form').trigger("reset");
|
||||
} else {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Data not submitted',
|
||||
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>
|
||||
</div>
|
||||
@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">
|
||||
<input type="hidden" name="form_id" value="{{$form_id}}">
|
||||
<input type="hidden" name="user_id" value="{{$form->user_id}}">
|
||||
|
|
@ -61,6 +79,9 @@
|
|||
|
||||
|
||||
@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">
|
||||
<label for="field-{{$question->code}}" class="form-label">{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!} </label>
|
||||
@switch($question->type)
|
||||
|
|
@ -82,19 +103,33 @@
|
|||
@case('dropdown')
|
||||
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
||||
<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)
|
||||
@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->display }}
|
||||
</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 :'') . ' ' : '' }} >
|
||||
{{ $option->display }}
|
||||
</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
|
||||
|
||||
@else
|
||||
@foreach ($question->options as $option)
|
||||
<option value="{{ $option->value }}" {{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}>
|
||||
{{ $option->display }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@case('checkbox')
|
||||
|
|
@ -113,7 +148,7 @@
|
|||
@endif
|
||||
|
||||
@break
|
||||
@case('multitextbox')
|
||||
{{-- @case('multitextbox')
|
||||
<div class="row">
|
||||
@foreach($question->options as $option)
|
||||
<div class="col-6">{{$option->display}}</div>
|
||||
|
|
@ -122,17 +157,23 @@
|
|||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@break
|
||||
|
||||
@case('time')
|
||||
<input type="time"
|
||||
id="field-{{$question->code}}"
|
||||
name="{{$question->code}}"
|
||||
class="form-control"
|
||||
{{$question->required == 'yes' ? 'required' : ''}}
|
||||
value="{{isset($question->value) ? $question->value : ''}}">
|
||||
@break
|
||||
|
||||
@break --}}
|
||||
|
||||
@case('multitextbox')
|
||||
<div class="row">
|
||||
@foreach($question->options as $option)
|
||||
<div class="col-6">{{ $option->display }}</div>
|
||||
<div class="col-6 mb-1">
|
||||
<input type="number"
|
||||
id="field-{{ $option->value }}"
|
||||
name="{{ $option->value }}"
|
||||
class="form-control"
|
||||
required
|
||||
value="{{ $submitted_formdata->{$option->value} ?? 0 }}">
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@break
|
||||
@endswitch
|
||||
</div>
|
||||
@endforeach
|
||||
|
|
@ -182,7 +223,6 @@
|
|||
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,
|
||||
|
|
@ -193,16 +233,12 @@
|
|||
$('#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').append($("<option></option>").attr("value",itm.value).text(itm.display).attr("msl_code", itm.contact.msl_code));
|
||||
}
|
||||
|
||||
$('#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'))
|
||||
})
|
||||
})
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -217,52 +253,29 @@
|
|||
$('#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').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){
|
||||
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();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
|
|
@ -277,9 +290,7 @@
|
|||
title: 'Great!',
|
||||
text: 'Your data is successfully submitted!',
|
||||
icon: 'success'
|
||||
}).then(() => {
|
||||
location.reload(); // 🔥 page refresh here
|
||||
});
|
||||
})
|
||||
$('#report-form').trigger("reset");
|
||||
} else {
|
||||
Swal.fire({
|
||||
|
|
|
|||
Loading…
Reference in New Issue