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

        @stop
@section('content')
<main id="ebook-listing">

   <section id="listing-search" class="pt-4">
    <div class="container">
      
      <div class="row">
        <div class="col-md-12 text-white">
          @if(isset($pharmacy_collection_title))
            <h1 class="h3">Bentham Pharmacy Area: {{$pharmacy_collection_title[0]->title}}</h1>
          @elseif(isset($subject_title))
            <h1 class="h3">Subject Area: {{$subject_title[0]->title}}</h1>
          @else
            <h1 class="h3">Books</h1>
          @endif  
            <hr>
        </div>
      </div>

 <!--    <div class="row">
        <div class="col-12">
              
            <div class="card  text-white bigbox-hvr-slow">

  <div class="card-body">
    <h5 class="card-title text-dark text-center">Find Books, Volumes, Chapters</h5> 
      <div class="row">
        <div class="col-md-8">

</div>
        
<div class="col-md-2 my-2 my-md-0">
    <a class="btn btn-dark bg-siteblue d-flex h-100 align-items-center justify-content-center"><i class="fas fa-sort-alpha-up mr-2"></i> Search By Title</a>
      </div>
<div class="col-md-2">
    <a class="btn btn-dark bg-siteblue d-flex h-100 align-items-center justify-content-center"><i class="fas fa-sort-numeric-up mr-2"></i> Search By Year</a>
</div>
        
      </div>

  </div>
</div>

            </div>
          </div> -->

      <div class="row">
        <div class="col-md-12">
            <div class="btn-group d-flex alpha-page text-white" role="group" aria-label="First group">
                  <a href="{{ URL::to('bybook/') }}" class="btn col">All</a>
				   @foreach(range('A', 'Z') as $rows)
					<a class="btn col" href="{{ URL::to('bybook/'.$rows) }}">
						{{$rows}}
					</a>
					@endforeach

                  
                  
                  </div>
                  <hr>
        </div>
      </div>  
   

    </div>
  </section>

<section class="pt-5">
    <div class="container">

<div class="row list">

<div class="col-md-8 col-xl-9">
    <div class="row">


@if (isset($ebook_volume) && count($ebook_volume) > 0)
  @php $subscribe=''; 

    if(session()->has('myebooksubscribption'))  {
        $subscribe ='subscribe';
    }else{
        $subscribe ='';
    }    
  @endphp  
	@foreach($ebook_volume as $key => $value)

	@if(isset($sample_types[$value->ebook_volume_id]) && $sample_types[$value->ebook_volume_id] === 888 && ($value->sample_file_name == '' || $value->sample_file_name == null)) <!-- User Access Sample Type -->
		
	@php continue; @endphp
  @endif
  <div class="col-md-4 col-lg-4 m-auto px-4">
    <div class="card item bigbox-hvr-slow"> 	
	<a href="{{ route('ebook_volume',['id'=> $value->ebook_volume_id,'page_name'=> $subscribe]) }}">
		@if($value->image_file_name != "")
			<img class="card-img-top" src="{{'/images/bentham/'.$value->image_file_name}}" width="247" height="319" />
		@else
			<img alt="Journal" src="https://via.placeholder.com/247x319">
		@endif
	</a>
	
      <div class="card-body">
        <h3 class="card-title"><small>By</small> {!!$value->authors!!}</h3>
        <div class="row mt-3">
		
		@if($value->content_type_access_id == 1)
			<div class="col-md-12"><span class="discount">Promotion: Free Download</span></div>
		@elseif($value->content_type_access_id == 2)
			<div class="col-md-12"><span class="discount">Open Access Plus</span></div>
		@else
			<div class="col-md-6">
			
			</div>
			
        @if(Route::currentRouteName()!='browseebooksubscribe')
			<div class="col-md-6 text-right"><h4><sup>$</sup>{{$value->ebook_price}}</h4></div>
            @endif
		@endif
		
        </div>
      </div>
      <div class="card-footer d-flex"><a href="{{ route('ebook_volume',['id'=> $value->ebook_volume_id,'page_name'=>$subscribe]) }}" class="btn btn-link col">View Details</a> </div>
    </div>
	
  </div>
  
	@endforeach
@else
  <div class="col-md-12 text-center">No Record Found</div>
@endif

@if (!empty($ebook_volume))
<div class="col-md-12 d-inline-flex list-pagination">{{ $ebook_volume->appends(request()->input())->links() }}</div>
@endif

</div>
</div>


<div class="col-md-4 col-xl-3">
    <div class="card text-white book-search-box">
        <div class="card-header">
            <h5 class="m-0">Find Books, Chapters</h5> 
        </div>
        <div class="card-body">
            <form action="{{ route($searchFormRoute) }}" enctype="multipart/form-data" method="post">

            <input type="hidden"  name="_token" value="{{ csrf_token() }}">
            
            <input type="text" class="form-control mb-3" name="search_value" placeholder="Book name or issn or eissn" @if (Request('search_value')) value="{{Request('search_value')}}" @endif>

        @csrf

            
            <div class="custom-control custom-radio border-bottom py-2 border-white">
            <input type="radio" id="search_by2" name="search_by" class="custom-control-input" value="book_title">
            <label class="custom-control-label" for="search_by2">By Book Title</label>
            </div>
            <div class="custom-control custom-radio border-bottom py-2 border-white">
            <input type="radio" id="search_by3" name="search_by" class="custom-control-input" value="chapter_title">
            <label class="custom-control-label" for="search_by3">By Chapter Title</label>
            </div>
            <div class="custom-control custom-radio border-bottom py-2 border-white">
            <input type="radio" id="search_by4" name="search_by" class="custom-control-input" value="by_isbn">
            <label class="custom-control-label" for="search_by4">By ISBN/EISBN</label>
            </div>
            <div class="custom-control custom-radio border-bottom py-2 border-white">
            <input type="radio" id="search_by6" name="search_by" class="custom-control-input" value="by_doi">
            <label class="custom-control-label" for="search_by6">By DOI</label>
            </div>        
          
            <button name="search_ebook" type="submit" class="btn btn-info w-100 mt-3" value="true"><i class="fas fa-search mr-2"></i> Search</button>
      
    </form>


        </div>
    </div>

    <div class="card mt-3 book-search-box text-white">
        <div class="card-header bg-transparent">
            <h5 class="m-0">Books By Year</h5>
        </div>
        <div class="card-body">            
            <div class="row"> 
              @for($a=2000; $a<=date('Y')+1; $a++)           
                <a class="col-sm-4 col-xl-3 text-center p-2 text-white" href="/bybook/{{$a}}">{{$a}}</a>
              @endfor  
            </div>
        </div>
    </div>
</div>


</div>

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

<!----Main Section Starts----> 

@endsection