

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

<?php $__env->startPush('css'); ?>
<style>
button#btn {
    margin-top: 24px;
}
</style>
<link rel="stylesheet" href="<?php echo e(asset('backend/plugins/select2.min.css')); ?>">
<?php $__env->stopPush(); ?>
<?php $__env->startSection('content'); ?>
<div class="right_col" role="main">
	<div class="">
		<?php if(Session::has('success')): ?>
			<div class="alert alert-success">
				<?php echo e(Session::get('success')); ?>

			</div>
		<?php endif; ?>
		<?php if(Session::has('error')): ?>
			<div class="alert alert-danger">
				<?php echo e(Session::get('error')); ?>

			</div>
		<?php endif; ?>
		<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 class="form-group">
										<label for="form-field-1"> Warehouse</label>
										<select class="form-control input-sm select2" name="warehouse" id="warehouse">
											<option value="All"> All </option>

										</select>
									</div>
								</div> -->
								<!-- <div class="col-sm-3">
									<div class="form-group">
										<label for="form-field-1"> Category Name</label>
										<select class="form-control input-sm select2" name="category" id="category">
											<option value="All"> All </option>
											<?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<option value="<?php echo e($cat->id); ?>"><?php echo e($cat->name); ?></option>
											<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
										</select>
									</div>
								</div> -->
								<!-- <div class="col-sm-3">
									<div class="form-group">
										<label for="form-field-1"> Brand Name</label>
										<select class="form-control input-sm select2" name="brand" id="brand">
											<option value="All"> All </option>

										</select>
									</div>
								</div> -->
								<!-- <div class="col-sm-3">
									<div class="form-group">
										<label for="form-field-1">Product/Code No</label>
										<select class="form-control input-sm select2" name="model_no" id="product">
											<option value="All"> All </option>
										</select>
									</div>
								</div> -->
								<div class="col-sm-12">
									<div class="input-group">
										<label for="form-field-1">Search By</label>
										<input type="text" id="myInput" class="form-control" placeholder="Search">
										<span class="input-group-btn">
											<button type="button" id="btn" class="btn btn-primary">
												<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
											</button>
										</span>
									</div>
								</div>
							</form>
						</div>
						<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 />
								Stock Report
							</div>
							<br />
							<table id="product_list" class="table table-bordered table-condensed" role="grid" aria-describedby="dynamic-table_info">
								<thead class="bg-primary">
									<tr>
										<th>SL</th>
										<th>Product</th>
										<th>Code No</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 ? 'red' : ''); ?> ">
										<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>
											<a  href="<?php echo e(route('stock.stockStatus',$pro->id)); ?>" title="Change Stock Status"><i class="fa fa-exchange bigger-130"></i></a>
										</td>
									</tr>
									<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
								</tbody>
								<tfoot>
									<tr>
										<td colspan="4"></td>
										<td>Total =</td>
										<td id="total_stock"><?php echo e($total_stock); ?></td>
										<td></td>
									</tr>
								</tfoot>
							</table>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>
<script src="<?php echo e(asset('backend/plugins/select2.min.js')); ?>"></script>
<script>
$(document).ready(function() {
    // select2 section
    $('.select2').select2();
    /*-------search section------------*/
    // $("#myInput").on("keyup", function() {
    //     var value = $(this).val().toLowerCase();
    //     $("tbody tr").filter(function() {
    //         $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
    //     });
    // });
    /*-----------warehouse wise stock list------------*/
    
    /***-------------category wise product stock search------------------*/
   
    /*--------brand wise product list------------*/
   
    /*--------brand wise product list------------*/
    
})
/*---------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(); ?>