<?php $__env->startSection('body'); ?>

<table class="table table-striped table-bordered dataTable" cellspacing="0" width="100%">
	<thead>
		<tr>
			<th>Category</th>
			<th>Name</th>
			<th class="center">Image</th>
			<th class="center">Shop Name</th>
			<th class="center">Owner Name</th>
			<th class="center">Owner contact</th>
			<th class="center">Type</th>
			<th></th>
		</tr>
	</thead>
	<tbody>
		<?php foreach($list_products as $list_product): ?>
		<tr>
			<td><?php echo $list_product->category->name; ?></td>
			<td><?php echo $list_product->name; ?></td>
			<td class="center">	
				<img class="large-thumbnail" src="/img-product/<?php echo $list_product->imageThumbnail['name']; ?>" style="width:100px">
			</td>
			<td class="center"><?php echo $list_product->profile->shop_name; ?></td>
			<td class="center"><?php echo $list_product->profile->user->name; ?></td>
			<td class="center"><?php echo $list_product->profile->handphone; ?></td>
			<td class="center">
				<?php if($list_product->type == '0'): ?><?php echo 'New'; ?><?php endif; ?>
				<?php if($list_product->type == '1'): ?><?php echo 'Premium'; ?><?php endif; ?>
				<?php if($list_product->type == '2'): ?><?php echo 'Featured'; ?><?php endif; ?>
			</td>
			<td>
				<p><a href="/admin/premium/<?php echo $list_product->id; ?>" class="btn btn-xs btn-block <?php echo ($list_product->type=='1')?'btn-success':'btn-default'; ?>">Premium</a></p>
				<p><a href="/admin/featured/<?php echo $list_product->id; ?>" class="btn btn-xs btn-block <?php echo ($list_product->type=='2')?'btn-primary':'btn-default'; ?>">Featured</a></p>
				<p><a href="/admin/remove-product/<?php echo $list_product->id; ?>" onclick="return confirm('Product will be remove.')"class="btn btn-xs btn-block btn-danger">Remove</a></p>
			</td>
		</tr>
		<?php endforeach; ?>
	</tbody>
</table>


<?php $__env->stopSection(); ?>

<?php $__env->startSection('status-message'); ?>

<?php if(Session::has('status') && Session::get('status') === true): ?>
<div class="alert msg">
	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
	<strong>Action Success</strong>
</div>
<?php endif; ?>
<?php if(Session::has('status') && !Session::get('status') ): ?>
<div class="alert msg">
	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
	<strong>ERROR! Try again</strong>
</div>
<?php endif; ?>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin/template', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>