@extends('layouts.app')
@section('title')
Payment Checkout
@parent
@stop
{{-- Page content --}}
@section('content')
<!----Banner Section Starts----> 
<main id="cart">
  

  <section>
    <div class="container">
	<!--
    <div class="alert alert-primary alert-dismissible fade show mt-4" role="alert">
 <b>Attention!</b> YOU ARE NOW BEING DIRECTED TO THE SECURE TRANSACTION PAGE OF THE BANK
  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
    <span aria-hidden="true">&times;</span>
  </button>
</div>
 -->
Your order is almost complete. Please review the details below and click 'Pay Via Card' if all the information is correct. You may use the 'Back' button to make changes to your order if necessary.
      <div class="row">
        
        <div class="col-md-8 shopitems">
          <h2 class="h4 p-3 bg-dark text-white">Cart contents </h2>
<?php
  $subtotal=0;
  $origional_subtotal=0;
?>        
@foreach($orderlist as $row)     
<div class="card bigbox-hvr-slow mt-4">
  <div class="card-body">   
    @if($row->discount!='N')
    <span class="badge badge-pill badge-info mb-2">Discounted Item</span>
    @endif
    @if($row->item_type=='article')
    <h6 class="card-title"><a href="/node/{{$row->nid}}">Article: {{$row->item_title}}</a></h6>  
    <p>Journal: {{$row->journal_ebook_title}}</p>
    <div class="row">
      <div class="col-md-3"><p>Volume: {{$row->volume}}</p></div>
      <div class="col-md-3"><p>Issue: {{$row->issue}}</p></div>      
      <div class="col-md-3"> <p>Qty: {{$row->qty}}</p></div>
    </div>  
    <span class="pricetag">$ {{$row->item_price*$row->qty}}.00</span>
    <?php
        $subtotal = round(($row->item_price*$row->qty)+$subtotal);
        $origional_subtotal = round(($row->item_cost*$row->qty)+$origional_subtotal);
    ?>
    @endif
    @if($row->item_type=='chapter')
    <h6 class="card-title"><a href="/node/{{$row->nid}}">Chapter: {{$row->item_title}}</a></h6>  
    <p>Book: {{$row->journal_ebook_title}}</p>
    <div class="row">
      <div class="col-md-3"><p>Volume: {{$row->volume}}</p></div>       
      <div class="col-md-3"> <p>Qty: {{$row->qty}}</p></div>
    </div>  
    <span class="pricetag">$ {{$row->item_price*$row->qty}}.00</span>
    <?php
        $subtotal = round(($row->item_price*$row->qty)+$subtotal);
        $origional_subtotal = round(($row->item_cost*$row->qty)+$origional_subtotal);
    ?>
    @endif
    @if($row->item_type=='ebook_volume')
    <h6 class="card-title"><a href="/node/{{$row->nid}}">Complete Book: {{$row->journal_ebook_title}}</a></h6>      
    <div class="row">
      <div class="col-md-3"><p>Volume: {{$row->volume}}</p></div>       
      <div class="col-md-3"> <p>Qty: {{$row->qty}}</p></div>
    </div>  
    <span class="pricetag">
      @if($row->discount!='N' && session()->has('original_price'))
      <del class="text-red"><?php
            $original_price = session()->get('original_price');
      ?>
        $ {{$original_price}}.00
      </del> 
      @endif
      $ {{$row->item_price*$row->qty}}.00</span>
    <?php
        $subtotal = round(($row->item_price*$row->qty)+$subtotal);
        $origional_subtotal = round(($row->item_cost*$row->qty)+$origional_subtotal);
    ?>
    @endif
  </div>
</div>

@endforeach

        </div>
        <div class="col-md-4">
<!--           
          <h4>Customer Information</h4>            
            <hr> 
          <div class="card bg-spring-green bigbox-hvr-slow">
              
              <ul class="list-group list-group-flush">
                <li class="list-group-item lead">User Name: {{ Auth::user()->name }}</li>
                <li class="list-group-item lead p-2">E-mail: {{ Auth::user()->email }}</li>
  
              </ul>
          </div>
 -->

          <h4 class="mt-5">Payment Information</h4>
            
            <hr> 
          
          <div class="card bg-spring-green bigbox-hvr-slow">
              
              <ul class="list-group list-group-flush">                
  <li class="list-group-item lead py-4">Subtotal <span class="badge badge-dark float-right mt-1">$ {{$origional_subtotal}}.00</span></li>  
@if($promodiscount && !(session()->has('original_price')))
  <li class="list-group-item lead py-4">Promotion Discount <span class="badge badge-dark float-right mt-1">{{$promodiscount}}% 
  @endif
<?php $total = $subtotal;
      $origional_total = $origional_subtotal;
?>

  <li class="list-group-item lead py-4"><strong>Total <span class="float-right mt-1">$ {{$total}}.00</span></strong></li>
</ul>
          </div>

          {{ Form::open(array('id'=>"addtocartForm",'url'=>'/cart/proceed','method' => 'POST')) }}
          <input type="hidden" name="param" value="{{Crypt::encrypt($order_id)}}">
          <button type="submit" name="back" value="back" class="btn btn-outline-dark btn-block mt-4 btn-lg"><i class="fas fa-angle-left"></i> Back </button>
          <button type="submit" name="paypal" value="paypal" class="btn btn-dark btn-block btn-lg">Payment Via PayPal <i class="fab fa-cc-paypal"></i></button>          <? /*
          <button type="submit" name="migs" value="migs" class="btn btn-dark btn-block btn-lg">Pay Via Card <i class="fas fa-credit-card"></i></button>          {{ Form::close() }} */ ?>
        </div>
      </div>
      <br><br>
<span class=" text-danger">In case of any problems in card payments please pay via PayPal. If you still have any problems please contact us at <a href="mailto:support@benthamscience.net">support@benthamscience.net</a>.</span>

       



    </div>
  </section>
  
</main>

<!----Main Section Starts----> 
@endsection