<?php $__env->startSection('title',trans('front.damages')); ?>
<?php $__env->startSection('content'); ?>
	<!-- Content Header (Page header) -->
	<section class="content-header">
		<h1>
			<?php echo app('translator')->getFromJson('front.damages'); ?>
			<a class="btn btn-success pull-right" href="<?php echo e(route('damages.create')); ?>" ><i class="fa fa-plus"></i> <?php echo app('translator')->getFromJson('front.Add'); ?></a>
		</h1>
	</section>

	<!-- Main content -->
	<section class="content">
        <?php echo $__env->make('layouts.partial.filter', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
		<div class="row">
			<div class="col-xs-12">
				<div class="box">
				
				<!-- /.box-header -->
					<div class="box-body">

                        <table id="dataList" class="table table-responsive table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th><?php echo app('translator')->getFromJson('front.date'); ?></th>
                                <th>المسئول</th>
                                <th>السبب</th>
                                <th>ملحوظة</th>
                                <th><?php echo app('translator')->getFromJson('front.product'); ?></th>
                                <th><?php echo app('translator')->getFromJson('front.store'); ?></th>
                                <th><?php echo app('translator')->getFromJson('front.quantity'); ?></th>
                                <th><?php echo app('translator')->getFromJson('front.unit'); ?></th>
                                <td></td>
                            </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $damages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td><?php echo e($loop->iteration); ?></td>
                                            <td><?php echo e($item->created_at->format('Y-m-d')); ?></td>
                                            <td><?php echo e(optional($item->creator)->name); ?></td>
                                            <td><?php echo e(optional($item->damageoption)->name); ?></td>
                                            <td><?php echo e($item->note); ?></td>
                                            <td><?php echo e(optional($item->product)->name); ?></td>
                                            <td><?php echo e(optional($item->store)->name); ?></td>
                                            <td><?php echo e($item->qty); ?></td>
                                            <td><?php echo e(optional($item->unit)->name); ?></td>
                                            <td>
                                                <a href="<?php echo e(route('damages.edit',$item)); ?>" class="btn btn-primary btn-xs">
                                                    <i class="fa fa-pencil fa-fw" aria-hidden="true"></i>
                                                </a>
                                                <a class="btn btn-xs btn-danger remove-record" data-url="<?php echo e(route('damages.destroy',$item)); ?>" data-id="<?php echo e($item->id); ?>">
                                                    <i class="fa fa-trash"></i>
                                                </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">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title"></h4>
				</div>
				<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(); ?>