@extends('layouts.content')
@section('title')
	Result search page
@stop
@section('content')
	<div class="content contentHome">
		<div class="container">
			<div class="row">
				<h2 style="text-align:center;margin:30px 0;">Search result  with name: "<?= $name ?>"</h2>
				<div class="col-sm-12">
						<?php if (!empty($search->toArray() && $name != null)) { 
							foreach($search as $item):?>
							<div class="item_larger animated single-left col-sm-4" data-id="">
								<div class="item" id="<?= $item->id ?>">
									<input type="hidden" name="_token" value="{{ csrf_token() }}">
									<a href="<?= route('downloadpage', $item->id) ?>" class="head_item">
										<img src="{{ config('view.filepath') }}thumb/<?= $item->name ?>">
									</a>
									<a class="content_item" href="<?= route('downloadpage', $item->id) ?>">
										<h3><?= strtoupper($item->title) ?></h3>
										<span class="the-date"><?= date("F j, Y", strtotime($item->created_at)) ?></span>
									</a>
									<div class="item_info">
										<a href="javascript:void(0);" class="buttonlike" align="right" image-id="<?= $item->id ?>"><img src="{{ config('view.rootpath') }}img/icon_like.png"> <b id="id<?= $item->id ?>"><?= $item->count_like ?></b></a>
										<a href="<?= route('downloadpage', $item->id) ?>" class="download" align="right"><img src="{{ config('view.rootpath') }}img/icon_download.png"> <?= $item->count_download ?></a>
									</div>
								</div>
							</div>
						<?php endforeach;
						}else{
							echo "<p style='text-align:center;font-size: 18px;color: #159;'>Don't exist Media with this name</p>";
						} ?>
					<!-- <div class="divloadmore" id="showloadmore"><button id="loadMore" class="load_more btn btn-danger btn-lg btn-block"><i class="fa fa-plus-circle"></i> Load More</button></div>
					<div class="divloadmore" id="loading"><button id="loadMore" class="btn btn-danger btn-lg btn-block"><i class="fa fa-circle-o-notch fa-spin"></i> Loading</button></div> -->
				</div>
			</div>
		</div>
	</div>
	
@stop

	
