
 
<?php $__env->startSection('content'); ?>

 <style>
     input[type="file"] {
    background-color:transparent;
    padding:0px;
}

 </style>


<!-- Begin Page Content -->
<div class="container-fluid">
 

  <!-- DataTales Example -->
  <div class="card shadow mb-4">
    <div class="card-header py-3">
      <h6 class="m-0 font-weight-bold text-primary">Products</h6>
      <?php if(count($errors) > 0): ?>
                  <?php if($errors->any()): ?>
                    <div class="alert alert-primary" role="alert">
                      <?php echo e($errors->first()); ?>

                      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">×</span>
                      </button>
                    </div>
                  <?php endif; ?>
              <?php endif; ?>
   <div class="panel-body"> 
       <?php echo Form::open(array('route' => 'import-csv-excel','method'=>'POST','files'=>'true')); ?>

        <div class="row">
           <div class="col-xs-12 col-sm-12 col-md-12" align="center">
                <div class="form-group">
                    <?php echo Form::label('sample_file','Bulk Upload:',['class'=>'col-md-3 colst']); ?><br>
                    <a href="https://i.imgur.com/iVCqeYz.png">click here</a> to know the right format of excel file.
                    <div class="col-md-4">
                    <?php echo Form::file('sample_file', array('class' => 'form-control')); ?>

                    <?php echo $errors->first('sample_file', '<p class="alert alert-danger">:message</p>'); ?>

                    </div>
                </div>
            </div>
            <div class="col-xs-12 col-sm-12 col-md-12 text-center">
            <?php echo Form::submit('Upload',['class'=>'btn btn-primary']); ?>

            <hr>
            </div>
        </div>
       <?php echo Form::close(); ?>

 </div> 
        <a class="btn btn-success m-auto" style="float: right;" href="<?php echo e(route('add-product')); ?>">Add single product</a>
    </div>
    <div class="card-body">
      <div class="table-responsive">
        <table class="table table-bordered" id="example8" width="100%" cellspacing="0">
          <thead>
            <tr>
            <th>S.No</th>
            <th>product Name</th>
            <th>product Image</th>
            <th>BuyOnce Price</th>
            <th>Subscription Price</th>
            <th>Product quantity</th>
            <th>product stock</th>
            <th>product Description</th>
            <th>Action</th>
            </tr>
          </thead>
    
          <tbody>
          <?php if(count($product)>0): ?>
                          <?php $i=1; ?>
                          <?php $__currentLoopData = $product; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $products): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><?php echo e($i); ?></td>
                            <td><?php echo e($products->product_name); ?></td>
                           
                            <td align="center"><img src="<?php echo e(url($products->product_image)); ?>" style="width: 21px;"></td>
                             <td><?php echo e($products->price); ?></td>
                             <td><?php echo e($products->subscription_price); ?></td>
                             <td><?php echo e($products->qty); ?> &nbsp;<?php echo e($products->unit); ?></td>
                             <td><?php echo e($products->stock); ?></td>
                            <td><?php echo e($products->description); ?></td>
                            <td>
                               <a href="<?php echo e(route('edit-product',$products->product_id)); ?>" style="width: 28px; padding-left: 6px;" class="btn btn-info"  style="width: 10px;padding-left: 9px;" style="color: #fff;"><i class="fa fa-edit" style="width: 10px;"></i></a>
							<button type="button" style="width: 28px; padding-left: 6px;" class="btn btn-danger" data-toggle="modal" data-target="#exampleModal<?php echo e($products->product_id); ?>"><i class="fa fa-trash"></i></button>
							</td>

                        </tr>
                        <?php $i++; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                      <?php else: ?>
                        <tr>
                          <td>No data found</td>
                        </tr>
                      <?php endif; ?>
                       
          </tbody>
        </table>
      </div>
    </div>
  </div>

</div>
<!-- /.container-fluid -->
</div>
</div>
<?php $__currentLoopData = $product; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $products): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<!-- Modal -->
<div class="modal fade" id="exampleModal<?php echo e($products->product_id); ?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="exampleModalLabel">Delete product</h5>
					<button type="button" class="close" data-dismiss="modal" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
			</div>
			<div class="modal-body">
				Are you want to delete product.
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
				<a href="<?php echo e(route('delete-product', $products->product_id)); ?>" class="btn btn-primary">Delete</a>
			</div>
		</div>
	</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>   
<?php $__env->stopSection(); ?>
<?php echo $__env->make('cityadmin.layout.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>