CrestRoad/laravel/resources/views/casper_plus/feedbackform.blade.php

210 lines
13 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
@include('layouts.shared/title-meta', ['title' => "Form"])
@include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? ''])
<link href="{{asset('assets/libs/sweetalert2/sweetalert2.min.css')}}" rel="stylesheet" type="text/css" />
</head>
<div id="pageloader">
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
</div>
<body class="loading authentication-bg authentication-bg-pattern">
<div class="account-pages mt-5 mb-5">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card bg-pattern">
<div class="card-body p-3 row">
<div class="text-center w-75 m-auto">
<div class="auth-logo">
<a href="/road/register" class="logo logo-dark text-center">
<span class="logo-lg">
<img src="{{asset($logo)}}" alt="" height="100">
</span>
</a>
<a href="/road/register" class="logo logo-light text-center">
<span class="logo-lg">
<img src="{{asset($logo)}}" alt="" height="100">
</span>
</a>
</div>
<h4>{{$title}}</h4>
<h5>{{$session->number}}</h5>
@foreach($session->dates->date as $i => $date)
<h5>{{date("d M, Y", strtotime($date) )}} <small>{{date("h:iA", strtotime($session->dates->start[$i]) )}}-{{date("h:iA", strtotime($session->dates->end[$i]) )}}</small></h5>
@endforeach
</div>
@if(Session::has('error'))<div class="alert alert-danger">{{Session::get('error')}}</div>
<br>@endif
@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>
<form method="POST" id="report-form" enctype="multipart/form-data">
<input type="hidden" name="form_id" value="{{$form_id}}">
<input type="hidden" name="session_code" value="{{$session->code}}">
<input type="hidden" name="recipient" value="{{$recipient}}">
@csrf
@foreach($questions as $question)
<div class="col-md-12 mb-2">
@if($question->code == 'cases_on_could_it_be_asthma_bronchiolitis')
<p>Kindly spare a few minutes and give us your feedback. It will be invaluable to us and will help us improve our programme</p>
<p class="text-danger">On a scale of 1 to 10 (where 1 is the lowest and 10 is the highest) how satisfied were you with the following:-<br />
SCIENTIFIC CONTENT:<p>
<p><strong>Cases on Could it be Asthma?</strong></p>
@endif
@if($question->code == 'uncontrolled_asthma_with_allergic_rhinitis')
<p><strong>Cases on The Broad Spectrum of Asthma</strong></p>
@endif
@if($question->code == 'lung_oscillometry_recorded_talk_by_dr_sundeep_salvi_on_lung_oscillometry')
<p><strong>Lung Oscillometry</strong></p>
@endif
@if($question->code == 'suggestions')
<p class="text-danger"><strong>Most important take away and </strong>any suggestions for improvement of the programme are welcome. Please take a few minutes to pen down the same</p>
@endif
@if($question->type != 'label')
<label for="field-{{$question->code}}" class="form-label">{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!} </label>
@endif
@switch($question->type)
@case('label')
<h5>{{$question->question}}</h5>
@break
@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" {{$question->required == 'yes'?'required':'' }} 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" {{$question->required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:0}}">
@break
@case('textarea')
<textarea id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" {{$question->required == 'yes'?'required':'' }}>{{isset($question->value)?$question->value:''}}</textarea>
@break
@case('dropdown')
<select class="form-control" id="field-{{$question->code}}" name="{{$question->code}}" {{$question->required == 'yes'?'required':'' }}>
<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('radio')
<div class="row ps-2">
@foreach($question->options as $i => $option)
<div class="form-check col-auto form-check-blue mb-2">
<input class="form-check-input" type="radio" name="{{$question->code}}" value="{{$option->value}}" id="field-{{$question->code}}-{{$option->value}}" {{($question->required == 'yes' && $i == 0 )?'required':'' }}>
<label class="form-check-label" for="field-{{$question->code}}-{{$option->value}}">{{$option->display}}</label>
</div>
@endforeach
</div>
@break
@case('file')
<input type="file" id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" value="" accept="image/jpg, image/jpeg, image/png" required>
@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="{{isset($option->val)?$option->val:0}}">
</div>
@endforeach
</div>
@break
@endswitch
</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
</form>
</div> <!-- end card-body -->
</div>
<!-- end card -->
<!-- end row -->
</div> <!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end page -->
<style type="text/css">
#pageloader {
background: rgba( 255, 255, 255, 0.8 );
display: none;
height: 100%;
position: fixed;
width: 100%;
z-index: 9999;
}
#pageloader img {
left: 50%;
margin-left: -32px;
margin-top: -32px;
position: absolute;
top: 50%;
}
</style>
@include('layouts.shared/footer-script')
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
// $('#report-form').on('submit', function(event){
// event.preventDefault();
// $("#pageloader").fadeIn();
// $.ajax({
// type: "POST",
// url: '/srvey/ajaxsubmit',
// data: new FormData($('#report-form')[0]),
// processData: false,
// contentType: false,
// success: function( data ) {
// $("#pageloader").fadeOut();
// if(data.status == 'success') {
// Swal.fire({
// title: 'Great!',
// text: 'Your data is successfully submitted!',
// icon: 'success'
// })
// $('#report-form').trigger("reset");
// } else {
// Swal.fire({
// icon: 'error',
// title: 'Data not submitted',
// text: 'Something went wrong, please try again after some time!'
// })
// }
// },
// });
// });
});
</script>
</body>
</html>