

<?php $__env->startSection('title', 'Stock List'); ?>

<?php $__env->startPush('css'); ?>

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

<?php $__env->startSection('content'); ?>
	<div class="right_col" role="main">
        <div class="">
            <div class="clearfix"></div>
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <a href="<?php echo e(route('purchase.create')); ?>" calss="btn" ><h2><i class="fa fa-mail-reply"></i></h2></a>
                            <h2>Stock List</h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-" onclick="printDiv('printableArea')" ><i class="fa fa-print fa-2x"></i></a>
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a href="#">Settings 1</a>
                                        </li>
                                        <li><a href="#">Settings 2</a>
                                        </li>
                                    </ul>
                                </li>
                                <li><a class="close-link"><i class="fa fa-close"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content">
							<!--<div class="row search-section">
								<form action="<?php echo e(route('stock.stocks')); ?>" id="searchForm" method="Post">
									<?php echo e(csrf_field()); ?>

									<div class="col-sm-2">
									</div>
									<div class="col-sm-4">
										<div class="form-group">
											<label class="col-sm-4 control-label no-padding-right" for="form-field-1"> Search By</label>
											<div class="col-sm-8">
												<select class="form-control" name="search_by" id="show">
													<option value="product_name">Product Name</option>
													<option value="model_no">Code Number</option>
												</select>
											</div>
										</div>
									</div>
									<div class="col-sm-5">
										<div class="form-group">
											<label class="col-sm-4 control-label no-padding-right" for="form-field-1"> Search Value</label>
											<div class="col-sm-8">
												<div class="input-group">
													<input type="text" id="" name="search_value" class="form-control" placeholder="Search Value">
													<span class="input-group-btn">
														<button type="submit" class="btn btn-purple btn-sm">
														<span class="ace-icon fa fa-search icon-on-right bigger-110"></span></button>
													</span>
												</div>
											</div>
										</div>
									</div>
								</form>
							</div>-->
							<div class="">
									<div class="col-sm-12">
											<div class="input-group">
												<input type="text" id="myInput" class="form-control" placeholder="Search">
												<span class="input-group-btn">
													<button type="button" class="btn btn-primary">
													<span class="ace-icon fa fa-search icon-on-right bigger-110"></span></button>
												</span>
											</div>
									</div>
								</div><br/>
							<hr/>
							<div class="table-content" id="printableArea">
								<div class="text-center">
									<h5><?php echo e(about()->bangla_name); ?></h5>
									<?php echo e(about()->address); ?><br/>
								</div>
								<br/>
								<table id="" class="table table-bordered table-condensed" role="grid" aria-describedby="dynamic-table_info">
									<thead>
										<tr class="bg-primary">
											<th>SL</th>
											<th>Product</th>
											<th>Code</th>
											<th>Category</th>
											<th>Unit</th>
											<th>Stock</th>
											<!--<th>Action</th>-->
										</tr>
									</thead>
									<tbody>
										<?php 
											$total_stock = 0;
										 ?>
										<?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$pro): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<?php 
												$total_stock = $total_stock + $pro->product_stock;
											 ?>
											<tr class="<?php echo e($pro->product_stock < $pro->re_order_label ? 'bg-danger' : 'bg-info'); ?> ">
												<td><?php echo e($key + 1); ?></td>
												<td><?php echo e($pro->product_name); ?></td>
												<td><?php echo e($pro->code); ?></td>
												<td><?php echo e($pro->category_name); ?></td>
												<td><?php echo e($pro->unit_name); ?></td>
												<td><?php echo e($pro->product_stock); ?></td>
												<!--<td>
												<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('stock-list')): ?>
													<a  href="<?php echo e(route('admin.order.create')); ?>" title="Order the Product"><i class="ace-icon fa fa-shopping-cart bigger-130"></i></a>
												<?php endif; ?>
												</td>-->
											</tr>
										<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
											<tr>
												<td colspan="4"></td>
												<td>Total =</td>
												<td><?php echo e($total_stock); ?></td>
											</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		
	</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>
<script>
	$(document).ready(function(){
		// select2 section
		$('.select2').select2()	;
		/*-------search section------------*/

	})
	/*---------print section-------------*/
	function printDiv(divName) {
		 var printContents = document.getElementById(divName).innerHTML;
		 var originalContents = document.body.innerHTML;

		 document.body.innerHTML = printContents;

		 window.print();

		 document.body.innerHTML = originalContents;
		}
	</script>
<?php $__env->stopPush(); ?>									
<?php echo $__env->make('backend.layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>