<?php $__env->startSection('content'); ?>
<div class="container">
	<section class="content">
	    <div class="row">
	    	<div class="col-md-12">
	        	<div class="box box-primary">
	            	<div class="box-header">
	                	<h3 class="box-title">SKU Information From <i><?php echo e($startDate); ?></i> To <i><?php echo e($endDate); ?></i></h3>
	            	</div>
	            	<div class="box-body">
	                    <div class="table-responsive"> 
	                        <table id="example" class="table table-bordered table-striped">
	                            <thead>
	                                <tr>
			                            <th>ID</th>
			                            <th>Product Name</th>
                                        <th>Qty</th>
                                        <th>Unit</th>
                                        <th>dbAssigned</th>
		                            </tr>
	                            </thead>
	                            <tbody>
	                            <?php
	                                $i = 0;
	                            ?>
	                            <?php foreach($tickets as $ticket): ?>
	                            	<?php
                                        $productDecode = json_decode($ticket->product_detail);
                                    ?>
                                    <?php if(json_last_error() == JSON_ERROR_NONE): ?>
                                        <?php if(isset($productDecode)): ?>     
			                                <?php foreach($productDecode as $value): ?>
	                                        <tr>
	                                            <td><?php echo e($ticket->id); ?></td>
	                                            <td><?php echo e($value->Name); ?></td>
	                                            <td><?php echo e($value->Qty); ?></td>
	                                            <?php if(isset($value->Unit)): ?>
	                                                <td><?php echo e($value->Unit); ?></td>
	                                            <?php else: ?>
	                                                <td></td>
	                                            <?php endif; ?>
	                                            <?php if(isset($ticket->dbAssigned)): ?>
	                                                <td><?php echo e($ticket->dbAssigned->name); ?></td>
	                                            <?php else: ?>
	                                                <td></td>
	                                            <?php endif; ?>
	                                        </tr>
	                                        <?php endforeach; ?>
                                        <?php endif; ?>

	                                <?php endif; ?>
	                            <?php endforeach; ?>
	                            </tbody>
	                        </table>
	                    </div>
	            	</div>
	      		</div>
	    	</div>
	  	</div>
	</section>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('style'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('assets/css/dataTables.bootstrap.min.css')); ?>">

    <link rel="stylesheet" href="<?php echo e(asset('https://cdn.datatables.net/buttons/1.6.0/css/buttons.dataTables.min.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <script src="<?php echo e(asset('assets/js/jquery.dataTables.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/dataTables.bootstrap.min.js')); ?>"></script>

    <script src="<?php echo e(asset('https://cdn.datatables.net/buttons/1.6.0/js/dataTables.buttons.min.js')); ?>"></script>
    <script src="<?php echo e(asset('https://cdn.datatables.net/buttons/1.6.0/js/buttons.flash.min.js')); ?>"></script>
    <script src="<?php echo e(asset('https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js')); ?>"></script>
    <script src="<?php echo e(asset('https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js')); ?>"></script>
    <script src="<?php echo e(asset('https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js')); ?>"></script>
    <script src="<?php echo e(asset('https://cdn.datatables.net/buttons/1.6.0/js/buttons.html5.min.js')); ?>"></script>
    <script src="<?php echo e(asset('https://cdn.datatables.net/buttons/1.6.0/js/buttons.print.min.js')); ?>"></script>
    
    <script type="text/javascript">
        // $(document).ready(function() {
        //     $('#example').DataTable();
        // } );
        $(document).ready(function() {
		    $('#example').DataTable( {
		        dom: 'Bfrtip',
		        buttons: [
		            'copy', 'csv', 'excel', 'pdf', 'print'
		        ]
		        // buttons: [
		        //     'excel'
		        // ]
		    } );
		} );
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>