Titans : Novel Invite made all form fileds hidden in HO View 4
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m52s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m52s
Details
This commit is contained in:
parent
fe339e78b5
commit
6eb6c34b91
|
|
@ -1,5 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
@include('layouts.shared/title-meta', ['title' => "Form"])
|
||||
|
|
@ -13,13 +12,17 @@
|
|||
</div>
|
||||
@php
|
||||
|
||||
$history = Formhelper::getMultiformData($form->partition,$form_id,$form->user_id);
|
||||
$history = Formhelper::getMultiformData(
|
||||
$form->partition,
|
||||
$form_id,
|
||||
$form->user_id
|
||||
);
|
||||
|
||||
$historyData = [];
|
||||
|
||||
if(isset($history->data->submissions) && is_iterable($history->data->submissions)){
|
||||
|
||||
foreach($history->data->submissions as $sub){
|
||||
foreach($history->data->submissions as $sub){
|
||||
|
||||
$formdata = $sub->formdata ?? null;
|
||||
|
||||
|
|
@ -49,18 +52,20 @@ foreach($history->data->submissions as $sub){
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$historyData[] = [
|
||||
'submission_id' => $sub->id,
|
||||
'date' => $recordDate,
|
||||
'doctor' => $doctorName,
|
||||
'status' => ucfirst($sub->workflow_status ?? ''),
|
||||
'submission' => $sub,
|
||||
'submission_id' => $sub->id,
|
||||
'date' => $recordDate,
|
||||
'doctor' => $doctorName,
|
||||
'status' => ucfirst($sub->workflow_status ?? ''),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
];}}
|
||||
|
||||
@endphp{{-- <pre>{{ print_r($history->data->submissions[0], true) }}</pre> --}}
|
||||
|
||||
@endphp
|
||||
{{-- <pre>
|
||||
{{ print_r($history->data->submissions[0], true) }}
|
||||
</pre> --}}
|
||||
<body class="loading">
|
||||
<div class="account-pages">
|
||||
<div class="container">
|
||||
|
|
@ -103,7 +108,6 @@ foreach($history->data->submissions as $sub){
|
|||
<form method="POST" action="/form/submitpersonalized" id="report-form" enctype="multipart/form-data">
|
||||
<input type="hidden" name="form_id" value="{{$form_id}}">
|
||||
<input type="hidden" name="form_info" id="form_info" value="">
|
||||
<input type="hidden" name="submission_id" id="submission_id">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-7">
|
||||
|
|
@ -234,14 +238,6 @@ foreach($history->data->submissions as $sub){
|
|||
Download
|
||||
</a>
|
||||
|
||||
@elseif(strtolower($row['status']) == 'rejected')
|
||||
|
||||
<button
|
||||
class="btn btn-warning btn-sm edit-btn"
|
||||
data-submission='@json($row["submission"])'>
|
||||
Edit
|
||||
</button>
|
||||
|
||||
@endif
|
||||
|
||||
</td>
|
||||
|
|
@ -269,9 +265,8 @@ foreach($history->data->submissions as $sub){
|
|||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end container -->
|
||||
</div>
|
||||
<!-- end page -->
|
||||
|
||||
</div>
|
||||
<!-- end page -->
|
||||
<style type="text/css">
|
||||
#pageloader {
|
||||
background: rgba( 255, 255, 255, 0.8 );
|
||||
|
|
@ -290,15 +285,10 @@ foreach($history->data->submissions as $sub){
|
|||
top: 50%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@include('layouts.shared/footer-script')
|
||||
|
||||
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
||||
|
||||
<script src="{{asset('assets/libs/cropper/cropper.min.js')}}"></script>
|
||||
|
||||
<script src="{{ URL::asset('assets/libs/dropify/dropify.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function($){
|
||||
$('#history-wrapper').show();
|
||||
|
|
@ -371,13 +361,6 @@ foreach($history->data->submissions as $sub){
|
|||
|
||||
$('#report-form').on('submit', function(event){
|
||||
event.preventDefault();
|
||||
let formData = new FormData($('#report-form')[0]);
|
||||
console.log("===== Submitted Data =====");
|
||||
|
||||
for (let pair of formData.entries()) {
|
||||
console.log(pair[0] + " : ", pair[1]);
|
||||
}
|
||||
|
||||
$("#pageloader").fadeIn();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
|
|
@ -447,75 +430,6 @@ foreach($history->data->submissions as $sub){
|
|||
// },
|
||||
// });
|
||||
// });
|
||||
$(document).on('click', '.edit-btn', function (e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
let submission = JSON.parse($(this).attr('data-submission'));
|
||||
let data = submission.formdata;
|
||||
let personalize = data.form_info;
|
||||
|
||||
// Save submission id
|
||||
$('#submission_id').val(submission.id);
|
||||
|
||||
// Save form info
|
||||
$('#form_info').val(JSON.stringify(personalize));
|
||||
|
||||
// Hide/Show sections
|
||||
$('#btnNewInvite').hide();
|
||||
$('#history-wrapper').hide();
|
||||
$('#template-wrapper').hide();
|
||||
$('#form-wrapper').show();
|
||||
|
||||
// Show template
|
||||
$('#wrapper-template_id img').attr('src', personalize.icon);
|
||||
|
||||
// Hide all questions
|
||||
$('.question-wrapper').hide();
|
||||
|
||||
$('#report-form .question-wrapper').each(function () {
|
||||
$(this).find('.req-star').hide();
|
||||
$(this).find(':input').removeAttr('required');
|
||||
});
|
||||
|
||||
// Show only template questions
|
||||
for (let que of personalize.questions) {
|
||||
|
||||
let $w = $('#wrapper-' + que);
|
||||
|
||||
$w.show();
|
||||
|
||||
$w.find('.req-star').show();
|
||||
|
||||
$w.find('input:not([type="hidden"]):not([type="checkbox"]), textarea, select')
|
||||
.attr('required', 'required');
|
||||
}
|
||||
|
||||
// Fill values
|
||||
$.each(data, function (key, value) {
|
||||
|
||||
let $field = $('#field-' + key);
|
||||
|
||||
if ($field.length) {
|
||||
|
||||
if ($field.is(':checkbox')) {
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach(function (v) {
|
||||
$('#field-' + key + '-' + v).prop('checked', true);
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$field.val(value);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
$('#image-form').on('submit', function(event){
|
||||
|
||||
event.preventDefault();
|
||||
|
|
@ -577,7 +491,6 @@ foreach($history->data->submissions as $sub){
|
|||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
Reference in New Issue