		<div class="listing">
			<hr>
			@if($article_list)
					@foreach ($article_list as $val)
			  			@php
			      			$param=encrypt(array('readpdf',$val->article_id,config('constants.admin.token'),$val->content_download_type));

			  			@endphp

						<div class="card bigbox-hvr-slow">
						  <div class="card-body">
						  <span class="badge badge-pill badge-info mb-2">{{ $val->article_type_name }}</span>

						@if($val->access_base_text !="")

						<span class="badge badge-pill badge-danger float-right">{{$val->access_base_text}}</span>
						@endif

							<h4 class="card-title"><a href ="{{url('article')}}/{{ $val->article_id}}">{!! $val->title !!}</a></h4>
							<p>
								Volume: {{$val->volume_name}}@if($val->issue!="" && $journal->IsIssue != 0), Issue: {{$val->issue}} @endif

								<br />

								@php
									$continues_publication_journal = array("AIA","COVID","CBC","CCR","CDR","CDDT","CTM","CWHR","IDDT","NANOASIA","RACSC","ENG","NPJ","CST","CJAI","IJGHD","PHOTOCAT","CNT","CENG","CCCS","CCCHEM","CNTP","CMAM","VAT","FLME","COSCI","NAEMI","EMSE","CAM","PROBIOT","CFF","CFS","NEMJ","CCHG","CIS");
								@endphp

								@if(in_array($journal->subtitle, $continues_publication_journal) && !empty($val->elocator))
										 Article ID: {{ $val->elocator}}
								@else
									 Pp: {{ $val->first_page}}-{{ $val->last_page}}
								@endif

								<br>

								Author: {!! $val->authors !!} <br>
								<span class="row"><span class="col-md-6">DOI:  <a href="http://dx.doi.org/{{ $val->doi }}">{{ $val->doi }}</a></span></span>
								@if($val->issue_type!=2 && !empty($val->publish_on) && $val->year >= 2021)
								<br>Published on: @php echo strftime('%d %B, %Y',$val->publish_on) @endphp
								@endif

							</p>
							<?php echo DisplaySocialNetworkLink($val->title,'http://'.$_SERVER['HTTP_HOST'].'/article/'.$val->article_id.'')?>
							<p>
							</p>

							@if(!empty($val->graph_abs_sm_filename) )

				                @php
				                $graph_abstract=public_path()."/images/graphical-abstract/".strtolower($journal->subtitle)."/".$val->volume_name."/".$val->issue."/".$val->graph_abs_sm_filename;

				                @endphp

				                @if(file_exists($graph_abstract))
								<p align="center"><a href="javascript:void(0);">
									<img src="{{ url('/') }}/images/graphical-abstract/{{strtolower($journal->subtitle)}}/{{$val->volume_name}}/{{ $val->issue }}/{{ $val->graph_abs_sm_filename }}"
									data-high-res-src="{{ url('/') }}/images/graphical-abstract/{{strtolower($journal->subtitle)}}/{{$val->volume_name}}/{{ $val->issue }}/{{ $val->graph_abs_lg_filename }}"
									alt="" class="gallery-items img-thumbnail">
								</a></p>
								@endif
							@endif
						  </div>
						  <div class="card-footer text-muted">
						  	@if($val->is_epub != 4)

									@if(isset($val->download_access) && $val->download_access > 0)

										@if($val->terms_popup) {{-- Trail Access Show Popup --}}

							                  @php $checklicense = 'javascript:return CheckLicense(this.id)'; @endphp

										@else {{-- Single/Multiple Token Access Show Login Popup --}}

							                  @php
							                      $checklicense ='';
												  $D_key = false;

													if (isset($val->type) && ($val->type == 444 || $val->type == 555))
													{
														$D_key = true;

													}

								                  if($val->access_base_text==='Token Based Access' && $D_key == true){
								                    $checklicense ="javascript:return LoginToDownload('download_hide_".$val->article_id."')";
								                  }
							                  @endphp

										@endif

									 {{ Form::open(array('class' =>'mb-0','method' => 'POST','route' => 'download_article','id' => 'download-form-'.$val->article_id)) }}

											<!-- LibLynx Integrating tracking script	 -->
											@if($val->access_base_text !="" && $val->access_base_text =="open access plus")
											  <input type="hidden" name="access_base_text" id="access_base_text" value="{{$val->access_base_text}}">
											@endif
											<!--End LibLynx Integrating tracking script	 -->

										<input type="hidden" value="{{csrf_token()}}" name="_token">
									  <input type="hidden" name="agree-flag" id="agree-flag" value="1">
							      <input type="hidden" name="param" value="{{Crypt::encrypt($val->article_id.'||'.'pdf'.'||'.$val->content_download_type.'||'.$val->restricted_user_access_key.'||'.$val->user_access_id )}}">

									<!-- if User Access Info View Option is zero than allow to download-->
								        @if($val->view_option==0)
											<button type="submit" id="{{$val->article_id}}" name="download{{$val->article_id}}" class="card-link text-dark " onclick="{{$checklicense}}" >Download PDF File</button>
								        @elseif($val->view_option==1)
											<a type="button" id="readpdf_{{$val->article_id}}" name="download{{$val->article_id}}" class="card-link text-dark " href="{{route('article', ['article_id' => $val->article_id,'param' => $param])}}" onclick="{{$checklicense}}" >Read Article</a>
										@endif
									 {{ Form::close() }}

									<!-- Model Window Start -->
									{{ Form::open(array('method' => 'POST','route' => 'download_article','id' => 'download-form-pdf')) }}

										<!-- LibLynx Integrating tracking script	 -->
										@if($val->access_base_text !="" && $val->access_base_text =="open access plus")
										  <input type="hidden" name="access_base_text" id="access_base_text" value="{{$val->access_base_text}}">
										@endif
										<!--End LibLynx Integrating tracking script	 -->

									  <input type="hidden" name="agree-flag" id="agree-flag" value="1">
									  <input type="hidden" name="param" value="{{Crypt::encrypt($val->article_id.'||'.'pdf'.'||'.$val->content_download_type.'||'.$val->restricted_user_access_key.'||'.$val->user_access_id )}}">
									  <div class="modal fade" id='download_hide_{{$val->article_id}}' tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
									    <div class="modal-dialog">
									      <div class="modal-content">
									        <div class='modal-header bg-primary'>
									          <h4 class="modal-title text-white" id="modalLabelprimary">Restricted Access Panel</h4>
									          <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>
									        </div>
									        <div class='modal-body'>
									          <label class="control-label">Content Access Key</label>
									          <input type="text" name="user_name" class="form-control" >
									          <label class="control-label">Password</label>
									          <input type="password" name="password" class="form-control">
									        </div> <!-- /.modal-body -->
									        <div class="modal-footer">
									           <button type="submit" class="btn btn-primary" onclick="javascript: $('#download_hide_{{$val->article_id}}').modal('hide');" ><span class="glyphicon glyphicon-remove-circle"></span> Login to Download</button>
									          <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove-circle"></span> Close</button>

									        </div>
									      </div>
									    </div>
									  </div>
									{{ Form::close() }}
									<!-- Model Window End -->

									@else
										@if(empty($bundle_content) || $bundle_content->article==0)
											<!--button href="#" class="card-link text-dark">Add to Wish List</button-->
											@if($val->checkIfMarked)
									          {{ Form::open([ 'class' => 'mb-0','method'  => 'delete', 'route' => [ 'marklist.destroy', $val->nid] ]) }}
									            <input type="hidden" name="param" value="{{Crypt::encrypt($val->nid)}}">
									            <button type="submit" id="unmarkitembtn" class="card-link text-dark ">Unwish</button>
									          {{ Form::close() }}
									    @else
									          {{ Form::open(array('class' => 'mb-0','method' => 'POST','route' => 'marklist.store')) }}
									            <input type="hidden" name="param" value="{{Crypt::encrypt($val->nid)}}">
									            <input type="hidden" name="itemtype" value="1">
									            <button type="submit" id="markitembtn" class="card-link text-dark ">Add to Wish List</button>
									          {{ Form::close() }}
									    @endif
												{{ Form::open(array('id'=>"addtocartForm",'class' => 'mb-0','method' => 'POST','route' => 'cart.store')) }}
									              <input type="hidden" name="param" value="{{Crypt::encrypt($val->nid)}}">
									                  <button type="submit" id="addcartbtn" class="card-link text-dark">Purchase PDF</button>
									            {{ Form::close() }}
									  @else
										 {{ Form::open(array('class' =>'mb-0','method' => 'POST','route' => 'download_bundle_file','id' => 'download-form-'.$val->article_id)) }}
											<input type="hidden" value="{{csrf_token()}}" name="_token">
										    <input type="hidden" name="agree-flag" id="agree-flag" value="1">
									      	<input type="hidden" name="bundle_offer_order_id" id="bundle_offer_order_id" value="{{$bundle_content->bundle_offer_order_id}}">
								            <input type="hidden" name="param" value="{{Crypt::encrypt($val->article_id.'||'.'pdf'.'||'.$bundle_content->content_download_type.'||'.$val->restricted_user_access_key.'||'.$val->user_access_id )}}">
											<button type="submit" id="{{$val->article_id}}" name="download{{$val->article_id}}" class="card-link text-dark" >Download PDF File</button>
										 {{ Form::close() }}
									    @endif


									@endif
								@else
								<a class="card-link text-dark d-block" href ="{{url('full-text-inquiry')}}/{{ $val->article_id}}">Full Text Inquiry</a>
								@endif
						  </div>
						</div>

				<!-- --------------Trial Trial Terms Condition------------------------- -->
				  @if (isset($val->type) && $val->type == 111)
						    <a id="license{{$val->article_id}}" href="{{route('termstrial', ['access_type' => $val->type,'content_id' => $val->article_id,'param' => $param])}}"  ></a>
				  @else
						    <a id="license{{$val->article_id}}" href="{{route('terms', ['content_id' => $val->article_id,'param' => $param])}}"  ></a>
				  @endif


			@endforeach
  <div style="text-align:left;" class="modal fade" id="TnCModal" tabindex="-1" role="dialog" aria-labelledby="TnCModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
      </div> <!-- /.modal-content -->
    </div> <!-- /.modal-dialog -->
  </div>

			      <input type="hidden" name="license_downloadid" id="license_downloadid" value="0">

		<div class="col-md-12 d-inline-flex list-pagination">
			{{ $article_list->appends(request()->input())->links() }}
<!-- 			{{ $article_list->appends(request()->input())->fragment('article-list')->links() }}
 -->
		</div>

		@else

			<div id="EmptyDiv" class="cardbox text-center alert alert-danger">No Record Found</div>
		@endif
		</div>

<link href="{{ asset('css/imageviewer.css') }}"  rel="stylesheet" type="text/css" />
<script src="{{ asset('js/imageviewer.js') }}"></script>

<script type="text/javascript" src="{{ asset('js/jquery.min.js') }}"></script>
<script>
$(function () {
  var viewer = ImageViewer();
  $('.gallery-items').click(function () {
    var imgSrc = this.src,
      highResolutionImage = $(this).data('high-res-src');

    viewer.show(imgSrc, highResolutionImage);
  });

   $('.alert[data-auto-dismiss]').each(function (index, element) {
        var $element = $(element),
            timeout  = $element.data('auto-dismiss') || 5000;

        setTimeout(function () {
            $element.alert('close');
        }, timeout);
    });

});

function CheckLicense(id) {
  $('#license_downloadid').val(id);

  var array = id.split('_');
  var file_type = '';
  if(array[0] != "readpdf")
  {
  	id=id;
  }
  else
  {
  	id=array[1];
  	file_type="readpdf";
  }
  if($("#agree-flag").val() == "" || $("#agree-flag").val() != "Y"){

    var target = $("#license"+id).attr("href");
    $("#TnCModal .modal-content").load(target+'/article/'+file_type, function() {
      $("#TnCModal").modal("show");
    });
      return false;
    }

}

function LoginToDownload(id) {

   $("#"+id).modal("show");
   return false;
}

</script>
