<div>
  <?php if(session()->has('message')): ?>
    <div class="alert" id="alert">
      <div class="alert alert-success" style="width: 23%; margin-left:77%">
          <?php echo e(session()->get('message')); ?>

      </div>
    </div>
  <?php endif; ?>
  <div class="request_titlenav">
    <div class="row request align-items-center" style="height: 39px;">
        <div class="col-md-12">
          <span class="ubication"><strong>Inicio</strong> | Pedidos</span>
        </div>
      </div>
    </div>
    <div class="container">
      <div class="row">
        <p style="margin-top:3%; font-size:25px; ">ESTADO DE PEDIDOS</p>
        <table class="table">
          <thead style="background:#C1282D;color:#FFFFFF;text-align:center;">
            <tr>
              <th scope="col">Número de pedido</th>
              <th scope="col">Fecha de pedido</th>
              <th scope="col">Estado del pedido</th>
              <th scope="col">Total</th>
              <th scope="col">Acciones</th>
            </tr>
          </thead>
          <tbody style="text-align:center;">
          <!--status= Inicio, fabricacion, entrega -->
          <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
              <th scope="row">#<?php echo e(Str::padLeft($order->id, 5, '0')); ?></th>
              <td><?php echo e(date('d/m/Y', strtotime($order->created_at))); ?></td>
              <td class="orders__stadpedido"><?php echo e($order->status); ?></td>
              <td>$<?php echo e($order->total); ?></td>
              <td>
                <button wire:click="recomprar(<?php echo e($order->id); ?>)" class="btn_purchase_history_1" type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#staticBackdrop">RECOMPRAR</button>
                <button wire:click.prevent="details(<?php echo e($order->id); ?>)" class="btn_purchase_history " type="button" class="btn btn-primary">VER DETALLE <i class="far fa-eye"></i></button>
              </td>

            </tr>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
          </tbody>
        </table>
      </div>
      <div class="row">
      <table class="table">
            <thead>
              <tr class="orders__stadpedido">
                <th scope="col-6 col-md-4">Producto</th>
                <th scope="col">Cantidad</th>
                <th scope="col">Precio</th>
                <th scope="col">Total </th>
                <!--<th scope="col">Pendiente</th>-->
              </tr>
            </thead>
            <tbody>
              <?php $__empty_1 = true; $__currentLoopData = $orderDetails; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $detail): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
              <tr>
                <th scope="row"><?php echo e($detail->product->name); ?></th>
                <td><?php echo e($detail->quantity); ?></td>
                <td>$<?php echo e($detail->price); ?></td>
                <td>$<?php echo e($detail->quantity * $detail->price); ?></td>
              </tr>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
              <tr><td colspan="4">Sin datos</td></tr>
              <?php endif; ?>
            </tbody>
          </table>
      </div>
    </div>
  </div>
  <!-- Modal -->
  <div class="modal fade bd-example-modal-lg show" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header"style="background: #C1282D; color:#FFFFFF ">
          <h5 class="modal-title" id="staticBackdropLabel">Pedido Nº</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">
          <table class="table">
            <thead>
              <tr class="orders__stadpedido">
                <th scope="col-6 col-md-4">Producto</th>
                <th scope="col">Cantidad</th>
                <th scope="col">Precio</th>
                <th scope="col">Total </th>
                <!--<th scope="col">Pendiente</th>-->
              </tr>
            </thead>
            <tbody>
              <?php $__empty_1 = true; $__currentLoopData = $orderDetails; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $detail): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
              <tr>
                <th scope="row"><?php echo e($detail->producto_id); ?></th>
                <td><?php echo e($detail->quantity); ?></td>
                <td>$<?php echo e($detail->price); ?></td>
                <td>$<?php echo e($detail->quantity * $detail->price); ?></td>
              </tr>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
              <tr><td colspan="4">Sin datos</td></tr>
              <?php endif; ?>
            </tbody>
          </table>
        </div>
        <div class="modal-footer" style="border: none">
          <button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button>
        </div>
      </div>
    </div>
  </div>
</div>
<?php $__env->startPush('js'); ?>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

<script type="text/javascript">
    $(document).ready(function() {        
        setTimeout(function() {
          $("#alerts").hide(6000);
          }, 3000);
        });
</script>

<?php $__env->stopPush(); ?>
  <?php /**PATH C:\laragon\www\sueiro\resources\views/livewire/orders.blade.php ENDPATH**/ ?>