Titans : Novel Invite made all form fileds hidden in HO View 5
Specific Folder FTP Upload / ftp-deploy (push) Successful in 37s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 37s
Details
This commit is contained in:
parent
6eb6c34b91
commit
0d6d2a8727
|
|
@ -1,4 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
@include('layouts.shared/title-meta', ['title' => "Form"])
|
@include('layouts.shared/title-meta', ['title' => "Form"])
|
||||||
|
|
@ -12,60 +13,54 @@
|
||||||
</div>
|
</div>
|
||||||
@php
|
@php
|
||||||
|
|
||||||
$history = Formhelper::getMultiformData(
|
$history = Formhelper::getMultiformData($form->partition,$form_id,$form->user_id);
|
||||||
$form->partition,
|
|
||||||
$form_id,
|
|
||||||
$form->user_id
|
|
||||||
);
|
|
||||||
|
|
||||||
$historyData = [];
|
$historyData = [];
|
||||||
|
|
||||||
if(isset($history->data->submissions) && is_iterable($history->data->submissions)){
|
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;
|
$formdata = $sub->formdata ?? null;
|
||||||
|
|
||||||
if(!$formdata){
|
if(!$formdata){
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
// Doctor Name
|
|
||||||
$doctorName = '';
|
|
||||||
|
|
||||||
if(!empty($formdata->doctor_name)){
|
|
||||||
if(is_array($formdata->doctor_name) || $formdata->doctor_name instanceof \Traversable){
|
|
||||||
$doctorName = trim((string)(array_values((array)$formdata->doctor_name)[0] ?? ''));
|
|
||||||
}else{
|
|
||||||
$doctorName = trim((string)$formdata->doctor_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Date
|
|
||||||
$recordDate = '';
|
|
||||||
|
|
||||||
if(!empty($formdata->record_date)){
|
|
||||||
if(is_array($formdata->record_date) || $formdata->record_date instanceof \Traversable){
|
|
||||||
$recordDate = trim((string)(array_values((array)$formdata->record_date)[0] ?? ''));
|
|
||||||
}else{
|
|
||||||
$recordDate = trim((string)$formdata->record_date);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$historyData[] = [
|
|
||||||
'submission_id' => $sub->id,
|
|
||||||
'date' => $recordDate,
|
|
||||||
'doctor' => $doctorName,
|
|
||||||
'status' => ucfirst($sub->workflow_status ?? ''),
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
// Doctor Name
|
||||||
|
$doctorName = '';
|
||||||
|
|
||||||
|
if(!empty($formdata->doctor_name)){
|
||||||
|
if(is_array($formdata->doctor_name) || $formdata->doctor_name instanceof \Traversable){
|
||||||
|
$doctorName = trim((string)(array_values((array)$formdata->doctor_name)[0] ?? ''));
|
||||||
|
}else{
|
||||||
|
$doctorName = trim((string)$formdata->doctor_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Date
|
||||||
|
$recordDate = '';
|
||||||
|
|
||||||
|
if(!empty($formdata->record_date)){
|
||||||
|
if(is_array($formdata->record_date) || $formdata->record_date instanceof \Traversable){
|
||||||
|
$recordDate = trim((string)(array_values((array)$formdata->record_date)[0] ?? ''));
|
||||||
|
}else{
|
||||||
|
$recordDate = trim((string)$formdata->record_date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$historyData[] = [
|
||||||
|
'submission_id' => $sub->id,
|
||||||
|
'date' => $recordDate,
|
||||||
|
'doctor' => $doctorName,
|
||||||
|
'status' => ucfirst($sub->workflow_status ?? ''),
|
||||||
|
'submission' => $sub,
|
||||||
|
|
||||||
|
];}}
|
||||||
|
|
||||||
|
@endphp{{-- <pre>{{ print_r($history->data->submissions[0], true) }}</pre> --}}
|
||||||
|
|
||||||
@endphp
|
|
||||||
{{-- <pre>
|
|
||||||
{{ print_r($history->data->submissions[0], true) }}
|
|
||||||
</pre> --}}
|
|
||||||
<body class="loading">
|
<body class="loading">
|
||||||
<div class="account-pages">
|
<div class="account-pages">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
@ -74,199 +69,209 @@ if(isset($history->data->submissions) && is_iterable($history->data->submissions
|
||||||
<div class="card bg-pattern">
|
<div class="card bg-pattern">
|
||||||
<div class="card-body p-3 row">
|
<div class="card-body p-3 row">
|
||||||
|
|
||||||
@if(Session::has('error'))<div class="alert alert-danger">{{Session::get('error')}}</div>
|
@if(Session::has('error'))<div class="alert alert-danger">{{Session::get('error')}}</div>
|
||||||
<br>@endif
|
<br>@endif
|
||||||
@if(session('success'))<div class=" alert alert-success">{{ session('success') }}
|
@if(session('success'))<div class=" alert alert-success">{{ session('success') }}
|
||||||
|
</div>
|
||||||
|
<br>@endif
|
||||||
|
<div class="col-8">
|
||||||
|
<h4 class="page-title">{{$form->title}}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 mb-3">
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-primary"
|
||||||
|
id="btnNewInvite">
|
||||||
|
|
||||||
|
+ Novel Meeting Invite
|
||||||
|
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="template-wrapper" class="row">
|
||||||
|
<h5>Select any one of the templates</h5>
|
||||||
|
@foreach($personalizations as $pers)
|
||||||
|
<div class="col-6 col-md-4 mt-3">
|
||||||
|
<img src="{{$pers->icon}}" class="img-fluid" persdata='{!! json_encode($pers) !!}'><br />
|
||||||
|
<span>{{$pers->title}}</span>
|
||||||
</div>
|
</div>
|
||||||
<br>@endif
|
@endforeach
|
||||||
<div class="col-8">
|
</div>
|
||||||
<h4 class="page-title">{{$form->title}}</h4>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 mb-3">
|
|
||||||
|
|
||||||
<button
|
<div id="form-wrapper">
|
||||||
type="button"
|
<form method="POST" action="/form/submitpersonalized" id="report-form" enctype="multipart/form-data">
|
||||||
class="btn btn-primary"
|
<input type="hidden" name="form_id" value="{{$form_id}}">
|
||||||
id="btnNewInvite">
|
<input type="hidden" name="form_info" id="form_info" value="">
|
||||||
|
<input type="hidden" name="submission_id" id="submission_id">
|
||||||
+ Novel Meeting Invite
|
@csrf
|
||||||
|
<div class="row">
|
||||||
</button>
|
<div class="col-7">
|
||||||
|
<label for="field-template_id" class="form-label"> Selected Template </label>
|
||||||
</div>
|
</div>
|
||||||
<div id="template-wrapper" class="row">
|
<div class="col-4 mb-2" id="wrapper-template_id">
|
||||||
<h5>Select any one of the templates</h5>
|
<img src="" class="img-thumbnail" style="max-height:150px">
|
||||||
@foreach($personalizations as $pers)
|
</div>
|
||||||
<div class="col-6 col-md-4 mt-3">
|
<br class="clearfix" />
|
||||||
<img src="{{$pers->icon}}" class="img-fluid" persdata='{!! json_encode($pers) !!}'><br />
|
@foreach($questions as $question)
|
||||||
<span>{{$pers->title}}</span>
|
<div class="col-md-12 mb-2 question-wrapper" id="wrapper-{{$question->id}}">
|
||||||
</div>
|
<label for="field-{{$question->code}}" class="form-label">{{$question->question}} <span class="req-star text-danger" style="display:none" aria-hidden="true">*</span> </label>
|
||||||
@endforeach
|
@switch($question->type)
|
||||||
</div>
|
@case('hidden')
|
||||||
|
<input type="{{$question->type}}" id="field-{{$question->code}}" name="{{$question->code}}" value="{{isset($question->value)?$question->value:''}}">
|
||||||
<div id="form-wrapper">
|
|
||||||
<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="">
|
|
||||||
@csrf
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-7">
|
|
||||||
<label for="field-template_id" class="form-label"> Selected Template </label>
|
|
||||||
</div>
|
|
||||||
<div class="col-4 mb-2" id="wrapper-template_id">
|
|
||||||
<img src="" class="img-thumbnail" style="max-height:150px">
|
|
||||||
</div>
|
|
||||||
<br class="clearfix" />
|
|
||||||
@foreach($questions as $question)
|
|
||||||
<div class="col-md-12 mb-2 question-wrapper" id="wrapper-{{$question->id}}">
|
|
||||||
<label for="field-{{$question->code}}" class="form-label">{{$question->question}} <span class="req-star text-danger" style="display:none" aria-hidden="true">*</span> </label>
|
|
||||||
@switch($question->type)
|
|
||||||
@case('hidden')
|
|
||||||
<input type="{{$question->type}}" id="field-{{$question->code}}" name="{{$question->code}}" value="{{isset($question->value)?$question->value:''}}">
|
|
||||||
@break
|
|
||||||
@case('text')
|
|
||||||
@case('email')
|
|
||||||
@case('tel')
|
|
||||||
@case('date')
|
|
||||||
<input type="{{$question->type}}" id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" value="{{isset($question->value)?$question->value:''}}">
|
|
||||||
@break
|
|
||||||
@case('number')
|
|
||||||
<input type="{{$question->type}}" min="0" max="9999999999" step="1" id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" value="{{isset($question->value)?$question->value:0}}">
|
|
||||||
@break
|
|
||||||
@case('textarea')
|
|
||||||
<textarea id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" >{{isset($question->value)?$question->value:''}}</textarea>
|
|
||||||
@break
|
|
||||||
@case('dropdown')
|
|
||||||
<select class="form-control" id="field-{{$question->code}}" name="{{$question->code}}" >
|
|
||||||
<option value=""> -- Select -- </option>
|
|
||||||
@foreach($question->options as $option)
|
|
||||||
<option value="{{$option->value}}" {{isset($question->value) && $question->value == $option->value ? 'selected':''}}>{{$option->display}}</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
@break
|
|
||||||
@case('checkbox')
|
|
||||||
@foreach($question->options as $option)
|
|
||||||
<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, $question->value) ? 'checked':''}}>
|
|
||||||
<label class="form-check-label" for="field-{{$question->code}}-{{$option->value}}">{{$option->display}}</label>
|
|
||||||
</div>
|
|
||||||
@endforeach
|
|
||||||
@break
|
|
||||||
@case('file')
|
|
||||||
<input type="file" name="{{$question->code}}" class="dropify"
|
|
||||||
data-allowed-file-extensions="png jpg jpeg" />
|
|
||||||
<p class="text-muted text-center mt-2 mb-0">500MB Max File size</p>
|
|
||||||
@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="text" id="field-{{$option->value}}" name="{{$option->value}}" class="form-control" value="{{isset($option->val)?$option->val:''}}">
|
|
||||||
</div>
|
|
||||||
@endforeach
|
|
||||||
</div>
|
|
||||||
@break
|
@break
|
||||||
@endswitch
|
@case('text')
|
||||||
|
@case('email')
|
||||||
|
@case('tel')
|
||||||
|
@case('date')
|
||||||
|
<input type="{{$question->type}}" id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" value="{{isset($question->value)?$question->value:''}}">
|
||||||
|
@break
|
||||||
|
@case('number')
|
||||||
|
<input type="{{$question->type}}" min="0" max="9999999999" step="1" id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" value="{{isset($question->value)?$question->value:0}}">
|
||||||
|
@break
|
||||||
|
@case('textarea')
|
||||||
|
<textarea id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" >{{isset($question->value)?$question->value:''}}</textarea>
|
||||||
|
@break
|
||||||
|
@case('dropdown')
|
||||||
|
<select class="form-control" id="field-{{$question->code}}" name="{{$question->code}}" >
|
||||||
|
<option value=""> -- Select -- </option>
|
||||||
|
@foreach($question->options as $option)
|
||||||
|
<option value="{{$option->value}}" {{isset($question->value) && $question->value == $option->value ? 'selected':''}}>{{$option->display}}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
@break
|
||||||
|
@case('checkbox')
|
||||||
|
@foreach($question->options as $option)
|
||||||
|
<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, $question->value) ? 'checked':''}}>
|
||||||
|
<label class="form-check-label" for="field-{{$question->code}}-{{$option->value}}">{{$option->display}}</label>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@break
|
||||||
|
@case('file')
|
||||||
|
<input type="file" name="{{$question->code}}" class="dropify"
|
||||||
|
data-allowed-file-extensions="png jpg jpeg" />
|
||||||
|
<p class="text-muted text-center mt-2 mb-0">500MB Max File size</p>
|
||||||
|
@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="text" id="field-{{$option->value}}" name="{{$option->value}}" class="form-control" value="{{isset($option->val)?$option->val:''}}">
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@break
|
||||||
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
|
@endswitch
|
||||||
<div class="text-center d-grid mt-3">
|
|
||||||
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit </button>
|
|
||||||
</div>
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
|
||||||
|
<div class="text-center d-grid mt-3">
|
||||||
|
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit </button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="cropper-wrapper">
|
||||||
|
<form method="POST" action="/form/submitpersonalizedimages" id="image-form" enctype="multipart/form-data">
|
||||||
|
<input type="hidden" name="form_id" value="{{$form_id}}">
|
||||||
|
@csrf
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 img-container">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-12 mt-1">
|
||||||
|
{{-- <button class="btn btn-primary" id="cropandgo">Use Image and download</button> --}}
|
||||||
|
<button class="btn btn-primary" id="cropandgo">Use Image</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="history-wrapper">
|
||||||
|
@if(count($historyData))
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h5 class="mt-4">History</h5>
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-striped">
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Doctor Name</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Action</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{{-- <pre>
|
||||||
|
{{ print_r($historyData, true) }}
|
||||||
|
</pre> --}}
|
||||||
|
|
||||||
|
@foreach($historyData as $row)
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td>{{ $row['date'] }}</td>
|
||||||
|
|
||||||
|
<td>{{ $row['doctor'] }}</td>
|
||||||
|
|
||||||
|
<td>{{ ucfirst($row['status']) }}</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
|
||||||
|
@if(strtolower($row['status']) == 'approved')
|
||||||
|
|
||||||
|
<a href="/form/downloadpersonalization?id={{ $row['submission_id'] }}"
|
||||||
|
class="btn btn-success btn-sm">
|
||||||
|
Download
|
||||||
|
</a>
|
||||||
|
|
||||||
|
@elseif(strtolower($row['status']) == 'rejected')
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="btn btn-warning btn-sm edit-btn"
|
||||||
|
data-submission='@json($row["submission"])'>
|
||||||
|
Edit
|
||||||
|
</button>
|
||||||
|
|
||||||
@endif
|
@endif
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="cropper-wrapper">
|
|
||||||
<form method="POST" action="/form/submitpersonalizedimages" id="image-form" enctype="multipart/form-data">
|
|
||||||
<input type="hidden" name="form_id" value="{{$form_id}}">
|
|
||||||
@csrf
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-12 img-container">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="col-12 mt-1">
|
|
||||||
{{-- <button class="btn btn-primary" id="cropandgo">Use Image and download</button> --}}
|
|
||||||
<button class="btn btn-primary" id="cropandgo">Use Image</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="history-wrapper">
|
|
||||||
@if(count($historyData))
|
|
||||||
|
|
||||||
<hr>
|
</td>
|
||||||
|
|
||||||
<h5 class="mt-4">History</h5>
|
</tr>
|
||||||
|
|
||||||
<div class="table-responsive">
|
@endforeach
|
||||||
<table class="table table-bordered table-striped">
|
|
||||||
|
|
||||||
<thead>
|
</tbody>
|
||||||
<tr>
|
|
||||||
<th>Date</th>
|
|
||||||
<th>Doctor Name</th>
|
|
||||||
<th>Status</th>
|
|
||||||
<th>Action</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
</table>
|
||||||
{{-- <pre>
|
</div>
|
||||||
{{ print_r($historyData, true) }}
|
|
||||||
</pre> --}}
|
|
||||||
|
|
||||||
@foreach($historyData as $row)
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
<tr>
|
</div> <!-- end card-body -->
|
||||||
|
</div>
|
||||||
|
<!-- end card -->
|
||||||
|
|
||||||
<td>{{ $row['date'] }}</td>
|
<!-- end row -->
|
||||||
|
|
||||||
<td>{{ $row['doctor'] }}</td>
|
</div> <!-- end col -->
|
||||||
|
|
||||||
<td>{{ ucfirst($row['status']) }}</td>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
|
|
||||||
@if(strtolower($row['status']) == 'approved')
|
|
||||||
|
|
||||||
<a href="/form/downloadpersonalization?id={{ $row['submission_id'] }}"
|
|
||||||
class="btn btn-success btn-sm">
|
|
||||||
Download
|
|
||||||
</a>
|
|
||||||
|
|
||||||
@endif
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
@endforeach
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div> <!-- end card-body -->
|
|
||||||
</div>
|
|
||||||
<!-- end card -->
|
|
||||||
|
|
||||||
<!-- end row -->
|
|
||||||
|
|
||||||
</div> <!-- end col -->
|
|
||||||
</div>
|
|
||||||
<!-- end row -->
|
|
||||||
</div>
|
</div>
|
||||||
<!-- end container -->
|
<!-- end row -->
|
||||||
</div>
|
</div>
|
||||||
<!-- end page -->
|
<!-- 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 );
|
||||||
|
|
@ -285,10 +290,15 @@ if(isset($history->data->submissions) && is_iterable($history->data->submissions
|
||||||
top: 50%;
|
top: 50%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@include('layouts.shared/footer-script')
|
@include('layouts.shared/footer-script')
|
||||||
|
|
||||||
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
||||||
|
|
||||||
<script src="{{asset('assets/libs/cropper/cropper.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 src="{{ URL::asset('assets/libs/dropify/dropify.min.js') }}"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function($){
|
jQuery(document).ready(function($){
|
||||||
$('#history-wrapper').show();
|
$('#history-wrapper').show();
|
||||||
|
|
@ -361,6 +371,13 @@ if(isset($history->data->submissions) && is_iterable($history->data->submissions
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event){
|
$('#report-form').on('submit', function(event){
|
||||||
event.preventDefault();
|
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();
|
$("#pageloader").fadeIn();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
|
@ -430,6 +447,75 @@ if(isset($history->data->submissions) && is_iterable($history->data->submissions
|
||||||
// },
|
// },
|
||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
|
$(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){
|
$('#image-form').on('submit', function(event){
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
@ -491,6 +577,7 @@ if(isset($history->data->submissions) && is_iterable($history->data->submissions
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in New Issue