
@extends('layouts.app')
@section('title')
Bundle Offer Order
@parent
@stop
@section('header_styles')
<!--page level css -->
<link href="{{ asset('assets/vendors/select2/css/select2.min.css') }}" type="text/css" rel="stylesheet">
<link href="{{ asset('assets/vendors/select2/css/select2-bootstrap.css') }}" rel="stylesheet">


<!--end of page level css-->
@stop

@section('content')


<!----Main Section Starts (where all content bodies exist)----> 
<main>
  <section>
    <div class="container">
      <div class="row">
	  
        <div class="col-md-12">

          <h2 class="h4">Bundle Offer Order Detail</h2>
          <hr>
			@if ($errors->any())
		
			<div class="alert alert-danger">
				<strong>Whoops!</strong> There were some problems with your input.<br>
				<ul>
					@foreach ($errors->all() as $error)
						<li>{{ $error }}</li>
					@endforeach
				</ul>
			</div>
		
			@endif
		</div>

		<div class="col-md-12">
          	 <div class="card card-body bigbox-hvr-slow ">
				 
		{{ Form::open(array('url' => 'bundle-offer-order/submit/'.$bundle->bundle_id)) }}
			<div class="form-group row border-bottom pb-2 mx-0">
				<label class="control-label col-xl-3 col-lg-6 align-top"><strong>Bundle Name:</strong></label>
				<label class="control-label col-xl-9 col-lg-6">{{$bundle->bundle_name}}</label>
			</div>
			<div class="form-group row border-bottom pb-2 mx-0">
				<label class="control-label col-xl-3 col-lg-6"><strong>Bundle Description:</strong></label>
				<label class="control-label col-xl-9 col-lg-6">{{$bundle->bundle_description}}</label>
			</div>
			<div class="form-group row border-bottom pb-2 mx-0">
				<label class="control-label col-xl-3 col-lg-6"><strong>Article Download Allow:</strong></label>
				<label class="control-label col-xl-9 col-lg-6">{{$bundle->article_download_allow}}</label>
			</div>
			<div class="form-group row border-bottom pb-2 mx-0">
				<label class="control-label col-xl-3 col-lg-6 align-top"><strong>Book Download Allow:</strong></label>
				<label class="control-label col-xl-9 col-lg-6">{{$bundle->ebook_download_allow}}</label>
			</div>
			<div class="form-group row border-bottom pb-2 mx-0">
				<label class="control-label col-xl-3 col-lg-6 align-top"><strong>Chapter Download Allow:</strong></label>
				<label class="control-label col-xl-9 col-lg-6">{{$bundle->chapter_download_allow}}</label>
			</div>
			<div class="form-group row border-bottom pb-2 mx-0">
				<label class="control-label col-xl-3 col-lg-6 align-top"><strong>Bundle Price:</strong></label>
				<label class="control-label col-xl-9 col-lg-6">${{$bundle->price}}</label>
			</div>
			<div class="form-group row border-bottom pb-2 mx-0">
				<label class="control-label col-xl-3 col-lg-6 align-top"><strong>Bundle Expiry:</strong></label>
				<label class="control-label col-xl-9 col-lg-6">{{$bundle->expiry}} Months</label>
			</div>

			<div class="form-group col-md-12">
	              <!--label for="password" class="col-md-4  col-form-label text-md-right">Captcha</label-->
	              
	                  <div class="g-recaptcha" data-sitekey="{{ env('SETTINGS_GOOGLE_RECAPTCHA_SITE_KEY') }}"></div>
	                  @if ($errors->has('g-recaptcha-response'))
	                      <span class="invalid-feedback text-center" style="display: block;">
	                          <strong>{{ $errors->first('g-recaptcha-response') }}</strong>
	                      </span>
	                  @endif
	              
	        </div>

				

				<input name="display_name" type="hidden" value="{{$detail['display_name']}}">			
				<input name="email" type="hidden" value="{{$detail['email']}}">
				<input name="country" type="hidden" value="{{$detail['country']}}">
				<input name="bundle_id" type="hidden" value="{{$bundle->bundle_id}}">
				<hr>
			<div class="text-center">
				<a class="btn btn-outline-dark" href="javascript:GoBack()">Back</a>
				<input class="btn btn-primary" name="submit" type="submit" value="Purchase">
			</div>
				{{ Form::close() }}		
		
	</div>
</div>
	      
    </div>
	</div>
  </section>
  
</main>
@section('footer_scripts')
<script src="{!! asset('assets/vendors/select2/js/select2.js') !!}"></script>    
<script src="{!! asset('js/filter.js') !!}"></script>
<script>
$(document).ready(function(){	

@if(Auth::user())	
    $('#display_name').attr('readonly', true);
    $('#email').attr('readonly', true);
   // $('#country option:not(:selected)').prop('disabled', true);
@endif


$("#country").select2({
	  theme:"bootstrap",
	  placeholder:"Select Country",
	  width: '100%',
	  height: '50px'
	});
});

 function GoBack() {
    var currentUrl = window.location.href;
  window.history.back();
  setTimeout(function(){
      // if location was not changed in 100 ms, then there is no history back
      if(currentUrl === window.location.href){
          // redirect to site root
          window.location.href = '/';
      }
  }, 100);
}


</script>
@stop
@endsection


