<?php $__env->startSection('title',trans('front.expenses')); ?>
<?php $__env->startSection('content'); ?>
	<!-- Content Header (Page header) -->
	<section class="content-header">
		<h1>
			<?php echo app('translator')->getFromJson('front.expenses'); ?>
			<a data-toggle="modal" data-target="#myModal" class="btn btn-success pull-right" href="<?php echo e(route('expenses.create')); ?>" ><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">
                <?php echo $__env->make('layouts.partial.filter', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
				
				<!-- /.box-header -->
					<div class="box-body">
						<table class="table table-bordered">
							<thead>
							<tr>
								<th><?php echo app('translator')->getFromJson('front.Expense Type'); ?></th>
								<th><?php echo app('translator')->getFromJson('front.total'); ?></th>
							</tr>
							</thead>
							<tbody>
							<?php
								$grand = 0;
							?>
							<?php $__currentLoopData = $expenses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $exp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
								<?php
									$grand += $exp->total;
								?>
							<tr>
								<td><?php echo e($exp->name); ?></td>
								<td><a href="<?php echo e(route('expenses.index',['type'=>$exp->id])); ?>" class=""><?php echo e($exp->total); ?></a></td>
							</tr>
							<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
							</tbody>
							<tfoot>
							<tr>
								<td><?php echo app('translator')->getFromJson('front.Total Of Expenses'); ?></td>
								<td><a href="<?php echo e(route('expenses.index',['type'=>'all'])); ?>" class="btn btn-primary btn-block"><?php echo e($grand); ?></a></td>
							</tr>
							</tfoot>
						</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(); ?>