@extends('layouts.app')
@section('title')
User Feedback
@parent
@stop
@section('content')

  <main>
    
    <section>
      <div class="container">
        <div class="row">
                 
                  <div class="col-12">          
					 <h2 class="h4">Website Feedback</h2>
		 
		 <hr>
		 
					
					<div class="card bigbox-hvr-slow">
<div class="card-body">
				  
				  
<div class="col-md-12 fieldset-border">		
@if(isset($message))
			<hr>
		<div class="alert alert-success">
		
		  <strong>Thank You </strong> 
			<br>
			We appreciate you taking the time to fill out the Feedback form.<br> 
			Your submission has been emailed to the concerned department.<br>
			If your request requires a reply, we will be in contact with you shortly. In the meantime, please continue to browse the site.<br> 
			Use the links above to get to where you want to go!
		  
		</div>
		@endif	
			
{{ Form::open(array('url' => 'feedback/')) }}
    @csrf
		
		 <p>We would like to receive your valuable feedback! Please use this form to give us your feedback/suggestions/comments regarding our website. We will take your feedback as a precious source of improvement in our services to serve you in the best possible way.</p>
		 
		<hr>
		
		@php 
			$name_value = '';
			$email_name_value = '';
			$site_comment_name_value = '';
			$other_comment_name_value = '';
		@endphp
   
		<div class="form-row">
			<div class="form-group col-md-6">
				<label class="control-label">Name: *</label>
				
				@if(request('name'))
					@php $name_value = request('name'); @endphp
				@elseif($detail['name'])
					@php $name_value = $detail['name']; @endphp
				@endif
				@if(isset($message))
					@php $name_value = ''; @endphp
				@endif
				
			<input type="text" maxlength="50" name="name" size="60" value="{{$name_value}}" class="form-control @if ($errors->has('email')) border-danger @endif">
			
				@if ($errors->has('name')) 
					<label class="text-danger">The name field is required.</label>
				@endif
			</div>

			<div class="form-group  col-md-6">
				<label class="control-label">Email: *</label>
				@if(request('email'))
					@php ($email_name_value = request('email')) @endphp
				@elseif($detail['email'])
					@php ($email_name_value = $detail['email']) @endphp
				@endif
				@if(isset($message))
					@php $email_name_value = ''; @endphp
				@endif
				<input type="text" maxlength="50" name="email" id="" size="60" value="{{$email_name_value}}" class="form-control @if ($errors->has('email')) border-danger @endif">
				@if ($errors->has('email')) 
					<label class="text-danger">The email must be a valid email address.</label>
				@endif
				
			</div>
			
			<div class="form-group col-md-6 mt-md-4">
				<label class="control-label">Do you have any comments for improving the site?</label>
				@if(request('site_comment'))
					@php ($site_comment_name_value = request('site_comment')) @endphp
				@elseif($detail['site_comment'])
					@php ($site_comment_name_value = $detail['site_comment']) @endphp
				@endif
				@if(isset($message))
					@php $site_comment_name_value = ''; @endphp
				@endif
				<textarea cols="60" rows="3" name="site_comment" class="form-control" >{{$site_comment_name_value}}</textarea>
			</div>
			
			<div class="form-group col-md-6 mt-md-4">
				<label class="control-label">Other general comments?</label>
				@if(request('other_comment'))
					@php ($other_comment_name_value = request('other_comment')) @endphp
				@elseif($detail['other_comment'])
					@php ($other_comment_name_value = $detail['other_comment']) @endphp
				@endif
				@if(isset($message))
					@php $other_comment_name_value = ''; @endphp
				@endif
				<textarea cols="60" rows="3" name="other_comment" class="form-control">{{$other_comment_name_value}}</textarea>
				
			</div>
			
			<div class="form-group col-md-12">
			<div class="g-recaptcha" data-sitekey="{{env('SETTINGS_GOOGLE_RECAPTCHA_SITE_KEY')}}"></div>
			  @if ($errors->has('g-recaptcha-response'))
				  <span class="text-danger" style="display: block;">
					  <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
				  </span>
			  @endif
			</div>
			
			<div class="form-group col-md-12 text-center">
				<input class="btn btn-primary" name="submit_feedback" type="submit" value="Submit Your Feedback">
			</div>
			
		</div>
		
		
		
		
		   
   
		{{ Form::close() }}		

	  </div>
	  
	</div>
				
        </div>
					
	  </div>
         
      
      </div>
         
     </div>
    </section>
    
  </main>
  
  <!----Main Section Ends----> 

@endsection
