Updated Arise history blade file
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
5c44ec5791
commit
46109e6212
|
|
@ -0,0 +1,188 @@
|
|||
<!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 == 'radiometrix' && 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>
|
||||
|
||||
@if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
|
||||
|
||||
@if($submission->workflow == 'yes' && $submission->workflow_status == 'approved')
|
||||
|
||||
<p>Approved</p>
|
||||
|
||||
@else
|
||||
|
||||
{{-- EDIT BUTTON COMMENTED --}}
|
||||
{{--
|
||||
<a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}"
|
||||
class="btn btn-primary btn-xs">
|
||||
Edit
|
||||
</a>
|
||||
--}}
|
||||
|
||||
@if(true)
|
||||
|
||||
<!-- <a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}"
|
||||
class="btn btn-danger btn-xs mt-1">
|
||||
|
||||
Delete
|
||||
|
||||
</a> -->
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-danger btn-xs mt-1 delete-submission"
|
||||
data-id="{{$submission->id}}"
|
||||
data-form="{{$submission->formdata->form_id}}">
|
||||
|
||||
Delete
|
||||
|
||||
</button>
|
||||
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
@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')
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
$(document).on(
|
||||
'click',
|
||||
'.delete-submission',
|
||||
function(){
|
||||
|
||||
let formId =
|
||||
$(this).data('form');
|
||||
|
||||
let submissionId =
|
||||
$(this).data('id');
|
||||
|
||||
$.ajax({
|
||||
|
||||
url:
|
||||
'/form/delete?form_id='
|
||||
+ formId
|
||||
+ '&id='
|
||||
+ submissionId,
|
||||
|
||||
type: 'GET',
|
||||
|
||||
success: function(response){
|
||||
|
||||
// reopen form page
|
||||
window.location.href =
|
||||
'/form/show?form_id='
|
||||
+ formId;
|
||||
alert('Deleted successfully');
|
||||
},
|
||||
|
||||
error: function(){
|
||||
|
||||
alert('Delete failed');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue