@if(Session::get('promo_discount'))
@php
$discount = Session::get('promo_discount');
@endphp
@endif
<h2 class="h4">Issue Order Preview</h2>

<div class="card bigbox-hvr-slow">
<div class="card-body">
	  
<div class="col-md-12 fieldset-border">

@if (!empty($status) && $status == 'C')

<div class="alert alert-success">
	  <strong>Success: </strong> {{$message}}
</div>	

@else
@if(!empty($message))

	<div class="alert alert-danger">
	  <strong>Failed! </strong> {{$message}}
	</div>	

@endif
@endif

{{ Form::open(array('url' => 'purchase_full_issue/'.$issue->issue_id)) }}

<div class="row">
<div class="col-md-6"> 

<h5>Journal Details:</h5>
<hr>

	<div class="form-group row m-0  border-right">
		<label class="control-label col-md-4 bg-light p-2 border-bottom"><strong>Journal:</strong></label>
		<label class="control-label col-md-8 bg-light p-2 border-bottom">{{$journal->title}}</label><br>
		<label class="control-label col-md-4 p-2 border-bottom"><strong>Volume:</strong></label>
		<label class="control-label col-md-8 p-2 border-bottom">{{$volume->volume_name}}</label><br>
		<label class="control-label col-md-4 bg-light p-2 border-bottom"><strong>Issue:</strong></label>
		<label class="control-label col-md-8 bg-light p-2 border-bottom">{{$issue->title}}</label><br>
		<label class="control-label col-md-4 p-2 border-bottom"><strong>Year:</strong></label>
		<label class="control-label col-md-8 p-2 border-bottom">{{$volume->year}}</label><br>
		<label class="control-label col-md-4 bg-light p-2 border-bottom"><strong>Price:</strong></label>
		<label class="control-label col-md-8 bg-light p-2 border-bottom">${{$issue->price}}</label><br>				@isset($discount)		@php		$discountedPrice = round($issue->price - ($issue->price * ($discount / 100)));		@endphp		<label class="control-label col-md-4 bg-light p-2 border-bottom"><strong>Discount Percentage:</strong></label>		<label class="control-label col-md-8 bg-light p-2 border-bottom">{{$discount}}%</label><br>		<label class="control-label col-md-4 p-2 border-bottom"><strong>Discount Price:</strong></label>		<label class="control-label col-md-8 p-2 border-bottom">${{ $discountedPrice }}</label><br>		<input name="discount_amount"  value="{{$discountedPrice}}" hidden>		@endisset
	</div>		

</div>		

<div class="col-md-6"> 

<h5>Contact Details:</h5>
<hr>

	<div class="form-group row m-0  border-right">
		<label class="control-label col-md-4 bg-light p-2 border-bottom"><strong>First Name:</strong></label>
		<label class="control-label col-md-8 bg-light p-2 border-bottom">{{$detail['first_name']}}</label><br>
		<label class="control-label col-md-4 p-2 border-bottom"><strong>Last Name:</strong></label>
		<label class="control-label col-md-8 p-2 border-bottom">{{$detail['last_name']}}</label><br>
		<label class="control-label col-md-4 bg-light p-2 border-bottom"><strong>Email:</strong></label>
		<label class="control-label col-md-8 bg-light p-2 border-bottom">{{$detail['email']}}</label><br>
		
		<div class="col-md-12 bg-light p-2">
		@if(!empty($message))

		@else
			<a class="btn btn-outline-dark" href="/purchase_full_issue/{{$issue->issue_id}}">Back</a>
			<input class="btn btn-primary" name="issue_purchase_form" type="submit" value="Submit">
		@endif
		</div>
		
		
		

		
		

		
		
		
	</div>		
	
	 <input name="first_name" type="hidden" value="{{$detail['first_name']}}">
	 <input name="last_name" type="hidden" value="{{$detail['last_name']}}">
	 <input name="email" type="hidden" value="{{$detail['email']}}">
	
</div>	




	
</div>	
 
<hr>


{{ Form::close() }}		




</div>

</div>
	
</div>
