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

<main>
	<section>
		<div class="container">
			@if ($message = Session::get('error'))
			<div class="alert alert-danger alert-dismissable">
				<button type="button" class="close" data-dismiss="alert">×</button>
				<p>{{ $message }}</p>
			</div>
			@endif
			<div class="row">
				<div class="col-12">
					<h3 class="h1">Support</h3>
					<div class="card bigbox-hvr-slow">
						<div class="card-body">
							<div class="col-md-12 fieldset-border">
								<h5 class="border-bottom pb-2 mb-4">Please fill the below form</h5>
								<form method="POST" action="{{ url('home/support-inquiry') }}">
									@csrf
									<div class="form-row">
										<div class="form-group col-md-12">
											<label class="control-label">Name: *</label>
											<input class="form-control" type="text" name="name" value="{{Auth()->user()->display_name}}" readonly>
											<input class="form-control" type="text" name="username" value="{{Auth()->user()->name}}" hidden>
											<input class="form-control" type="text" name="user_id" value="{{Auth()->user()->id}}" hidden>
										</div>
										<div class="form-group col-md-12">
											<label class="control-label">Email: *</label>
											<input class="form-control" type="text" name="email" value="{{ old('email')}}" required>
										</div>
										<div class="form-group col-md-12">
											<label class="control-label">Subject: *</label>
											<input class="form-control" type="text" name="subject" value="{{ old('subject')}}" required>
										</div>
										<div class="form-group col-md-12">
											<label class="control-label">Inquiry: *</label>
											<textarea cols="100" rows="8" name="inquiry" class="form-control" required>{{ old('inquiry')}}</textarea>
										</div>
										<div class="col-md-12">
											<div class="d-flex justify-content-center">
												<div class="row col-md-3">
													<div class="col-auto mx-auto w-100 d-flex ">
														<div class="captcha m-1"><span>{!! captcha_img() !!}</span></div>
														<button type="button" class="btn btn-danger m-1" class="refresh-captcha" id="refresh-captcha">&#x21bb;</button>
													</div>
													<div class="col-auto mx-auto w-100 d-flex ">
														<input id="captcha" type="text" class="form-control" placeholder="Enter Captcha" name="captcha" required>
													</div>
													<div class="col-auto mx-auto w-100 d-flex ">
														@if ($errors->has('captcha'))
														<span class="invalid-feedback" style="display: block;"><strong>{{ $errors->first('captcha') }}</strong></span>
														@endif
													</div>
												</div>
											</div>
										</div>
										<div class="form-group text-center border-top mt-3 pt-3"><input class="btn btn-info col-md-2" type="submit" name="submit" /></div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>
</main>

<!----Main Section Ends---->

@endsection