128 lines
8.0 KiB
PHP
128 lines
8.0 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
@include('layouts.shared/title-meta', ['title' => "History"])
|
|
@include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? ''])
|
|
</head>
|
|
|
|
<body class="loading">
|
|
<div class="account-pages">
|
|
<div class="container">
|
|
|
|
<!-- start page title -->
|
|
<div class="row">
|
|
<div class="col-8 p-2">
|
|
<h4 class="page-title">{{$formname}}</h4>
|
|
</div>
|
|
<div class="col-4 p-2">
|
|
<a href="/form/show" class="float-end pt-1">New Submission</a>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
@if(session()->has('message'))
|
|
<div class="alert alert-success">
|
|
{{ session()->get('message') }}
|
|
</div>
|
|
@endif
|
|
@if(session()->has('error'))
|
|
<div class="alert alert-danger">
|
|
{{ session()->get('error') }}
|
|
</div>
|
|
@endif
|
|
<div class="row">
|
|
<div class="col-12 p-0">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="responsive-table-plugin">
|
|
<div class="table-rep-plugin">
|
|
<div class="table-responsive" data-pattern="priority-columns">
|
|
<table id="tech-companies-1" class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th data-priority="1">Submission Date</th>
|
|
@foreach($questions as $code => $question)
|
|
@if($question->type == 'hidden')
|
|
@continue;
|
|
@endif
|
|
<th data-priority="1">{{$question->label}}</th>
|
|
@endforeach
|
|
<th data-priority="1">Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($submissions as $submission)
|
|
<tr>
|
|
<th>{{date("d M Y", strtotime($submission->updatedAt))}}</th>
|
|
@foreach($questions as $code => $question)
|
|
@if($question->type == 'hidden')
|
|
@continue;
|
|
@endif
|
|
@if($question->type == 'file')
|
|
<td><a target="_blank" href="{{ isset($submission->formdata->{$code}) ? is_array($submission->formdata->{$code})? implode(', ', $submission->formdata->{$code}) :(is_string($submission->formdata->{$code}) ? $submission->formdata->{$code} : '' ) : $code }}" download="{{ isset($submission->formdata->{$code}) ? is_array($submission->formdata->{$code})? implode(', ', $submission->formdata->{$code}) : (is_string($submission->formdata->{$code}) ? $submission->formdata->{$code} : '' ) : $code }}" class="btn btn-dark btn-xs"><i class="mdi mdi-cloud-download me-1"></i> Download</a></td>
|
|
|
|
@elseif($question->type == 'multitextbox' && isset($submission->formdata->{$code}) && is_object($submission->formdata->{$code}))
|
|
<td>
|
|
{{ collect((array)$submission->formdata->{$code})->map(function($val, $key){ return "$key: $val"; })->implode(', ') }}
|
|
</td>
|
|
|
|
@elseif(count((array)$question->options) > 0 && 1==2 )
|
|
<td>{{ $question->options->{ $submission->formdata->{$code} } }}</td>
|
|
@else
|
|
<td>{{ isset($submission->formdata->{$code}) ? is_array($submission->formdata->{$code})? implode(', ', $submission->formdata->{$code}) :$submission->formdata->{$code} : $code }}</td>
|
|
@endif
|
|
@endforeach
|
|
<th>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a href="/form/show?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}" class="btn btn-primary btn-xs">Edit</a>
|
|
|
|
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
|
<a href="/form/delete?form_id={{ $submission->formdata->form_id }}&id={{ $submission->id }}"
|
|
onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');"
|
|
class="btn btn-danger btn-xs mt-1">Delete</a>
|
|
@endif
|
|
|
|
|
|
|
|
|
|
{{-- @if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
|
@if($submission->workflow == 'yes' && $submission->workflow_status == 'approved' )
|
|
<p>Approved</p>
|
|
@else
|
|
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button>
|
|
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
|
|
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
|
|
@endif
|
|
@endif
|
|
@endif --}}
|
|
@if(!empty($can_delete_submission))
|
|
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</a>
|
|
@endif
|
|
|
|
</th>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div> <!-- end .table-responsive -->
|
|
|
|
</div> <!-- end .table-rep-plugin-->
|
|
</div> <!-- end .responsive-table-plugin-->
|
|
|
|
</div> <!-- end card body-->
|
|
</div> <!-- end card -->
|
|
</div><!-- end col-->
|
|
</div>
|
|
<!-- end row-->
|
|
</div> <!-- container -->
|
|
|
|
</div>
|
|
<!-- end page -->
|
|
@include('layouts.shared/footer-script')
|
|
</body>
|
|
</html> |