<?php $__env->startSection('content'); ?>
    <div class="container-fluid px-4">

        <div class="card mt-4">

            <div class="card-header">
                <?php if(session('status')): ?>
                    <div class="alert alert-success"><?php echo e(session('status')); ?></div>
                <?php endif; ?>
                <div class="row">
                    <div class="col">
                        <h4><?php echo e(__('viewData')); ?></h4>
                    </div>
                    <div class="col-auto">
                        <a href="<?php echo e(url('admin/download-medicines')); ?>"class="btn btn-sm btn-success">
                            <i class="fas fa-download mr-2"></i><?php echo e(__('downloadCSV')); ?>

                        </a>
                    </div>



                </div>

            </div>
            <div class="card-body">


                <table id="myDataTables" class="table" width="100%" cellspacing="0">

                    <thead>
                        <tr>
                            <th><?php echo e(__('productID')); ?></th>
                            <th><?php echo e(__('image')); ?></th>
                            <th><?php echo e(__('medicineTitle')); ?></th>
                            <th><?php echo e(__('medicineType')); ?></th>
                            <th><?php echo e(__('days')); ?></th>
                            <th><?php echo e(__('timeInDay')); ?></th>
                            <th><?php echo e(__('numberPieses')); ?></th>
                            <th><?php echo e(__('timing')); ?></th>
                            
                            <th><?php echo e(__('price')); ?></th>
                            <th><?php echo e(__('action')); ?></th>

                        </tr>
                    </thead>

                    <tbody class="table-border-bottom-0">
                        <?php $__currentLoopData = $medicineListModel; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e($item->product_id); ?></td>
                                <td>
                                    <img src="<?php echo e(asset('uploads/shop_' . $a_user_id->id . '/medicines/' . $item->image)); ?>"
                                        width="50px" height="50px" alt="Img">
                                </td>
                                <td><?php echo e($item->title); ?></td>
                                <td><?php echo e($item->type); ?></td>
                                <td><?php echo e($item->days); ?></td>
                                <td><?php echo e($item->daily_dose); ?></td>
                                <td><?php echo e($item->piese_per_dose); ?></td>
                                

                                <td>
                                    <?php if($item->instruction == 1): ?>
                                        <span class="badge bg-label-primary me-1"><?php echo e(__('before')); ?></span>
                                    <?php elseif($item->instruction == 2): ?>
                                        <span class="badge bg-label-warning me-1"><?php echo e(__('any')); ?></span>
                                    <?php else: ?>
                                        <span class="badge bg-label-info me-1"><?php echo e(__('after')); ?></span>
                                    <?php endif; ?>
                                </td>

                                
                                <td><?php echo e($item->price); ?></td>

                                



                                <td>
                                    
                                    <a href="<?php echo e(url('admin/delete-medicine/' . $item->id)); ?>"
                                        class="btn btn-danger"><?php echo e(__('delete')); ?></a>
                                </td>

                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>


                </table>

            </div>
        </div>



    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script>
        $(document).ready(function() {
            console.log("Document ready!"); // Check if this message is printed in the console
            $('#myDataTable').DataTable({
                order: [
                    [0, 'desc']
                ],
                orderMulti: false,
                initComplete: function(settings, json) {
                    $('#myDataTable').show();
                }
            });
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/xorgeekc/public_html/medishop/resources/views/admin/medicine/viewmedicinecsv.blade.php ENDPATH**/ ?>