<?php $__env->startSection('title',trans('front.productsList')); ?>
<?php $__env->startSection('content'); ?>
	<!-- Content Header (Page header) -->
	<section class="content-header">
		<h1>
			<?php echo app('translator')->getFromJson('front.productsList'); ?> - <?php echo e($category->name); ?>

			<a data-toggle="modal" data-target="#myModal" class="btn btn-success pull-right" href="<?php echo e(route('products.create',['is_raw'=>$is_raw])); ?>" ><i class="fa fa-plus"></i> <?php echo app('translator')->getFromJson('front.Add'); ?></a>
		</h1>
	</section>

	<!-- Main content -->
	<section class="content">
		<div class="row">
			<div class="col-xs-12">
				<div class="box">
				
				<!-- /.box-header -->
					<div class="box-body">
						<table id="dataList" class="table table-bordered table-striped">
							<thead>
							<tr>
								<th>#</th>
								<th><?php echo app('translator')->getFromJson('front.product'); ?></th>
								<th><?php echo app('translator')->getFromJson('front.Category'); ?></th>
								<th><?php echo app('translator')->getFromJson('front.cost'); ?></th>
								<th><?php echo app('translator')->getFromJson('front.price'); ?></th>
								<th><?php echo app('translator')->getFromJson('front.quantity'); ?></th>
								<th class="no-sort"></th>
							</tr>
							</thead>
							<tbody>
							<?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
								<tr>
									<td><?php echo e($loop->iteration); ?></td>
									<td><?php echo e($product->name); ?></td>
									<td><?php echo e(optional($product->category)->name); ?>  <?php echo e(optional($product->subcategory)->name); ?></td>
									<td>
										<?php echo $product->getCost(); ?>

									</td>
									<td>
										<?php echo $product->getSalePrice(); ?>

									</td>
									<td>
										<?php echo $product->getTotalQuantity(); ?>

									</td>
									<td class="actions">
										<a href="<?php echo e(route('products.edit',$product)); ?>?pcat=<?php echo e($product->main_category_id); ?>&page=<?php echo e(ceil($loop->iteration/25)); ?>" class="btn btn-primary btn-xs">
											<i class="fa fa-pencil fa-fw" aria-hidden="true"></i>
											<?php echo app('translator')->getFromJson('front.edit'); ?>
										</a>
										<a class="btn btn-xs btn-danger remove-record" data-url="<?php echo e(route('products.destroy',$product)); ?>" data-id="<?php echo e($product->id); ?>">
											<i class="fa fa-trash"></i>
											<?php echo app('translator')->getFromJson('front.delete'); ?>
										</a>
										<a data-toggle="modal" data-target="#myModalFullScreen" href="<?php echo e(route('products.show',$product)); ?>" class="btn btn-xs btn-warning">
											<i class="fa fa-eye"></i>
											<?php echo app('translator')->getFromJson('front.show'); ?>
										</a>
										<a data-toggle="modal" data-target="#myModal" href="<?php echo e(route('products.barcode',$product)); ?>" class="btn btn-primary btn-xs">
											<i class="fa fa-barcode" aria-hidden="true"></i>
                                            <?php echo app('translator')->getFromJson('front.barcode'); ?>
										</a>

									</td>
								</tr>
							<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
							</tbody>
						</table>
					</div>
					<!-- /.box-body -->
				</div>
				<!-- /.box -->
			</div>
			<!-- /.col -->
		</div>
		<!-- /.row -->
	</section>
	<!-- /.content -->

	<div id="myModal" class="modal fade" style="overflow:hidden;" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-body">
					<p class="text-center"><div class="fa-3x text-center"><i class="fa fa-cog fa-spin"></i>                    <?php echo app('translator')->getFromJson('front.Loading ....'); ?>                </div>                </p>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-outline pull-left" data-dismiss="modal">إغلاق</button>
				</div>
			</div>
		</div>
	</div>
	<div id="myModalFullScreen" class="modal fade modal-fullscreen" style="overflow:hidden;" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-body">
					<p class="text-center"><div class="fa-3x text-center"><i class="fa fa-cog fa-spin"></i>                    <?php echo app('translator')->getFromJson('front.Loading ....'); ?>                </div>                </p>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-outline pull-left" data-dismiss="modal">إغلاق</button>
				</div>
			</div>
		</div>
	</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>