<?php 
$mysqli = new mysqli("localhost", "dmcentra_dmsc", "uGlG?gXfMhA1", "dmcentra_sc");
header("Content-Type: application/vnd.ms-excel");

header("Content-Disposition: attachment; filename=seleccionados.xls");
?>
<table class="table table-striped table-sm">
          <thead>
            <tr>
              <th>No.</th>
              <th>SKU</th>
              <th>Manufacturer Part</th>
              <th>Descripcion</th>
              <th>Price</th>
              <th>Stock</th>
            </tr>
          </thead>
          <tbody>
            <?php 
           
              $result_pro = $mysqli->query("SELECT id, SKU, MFRPartNumber, ProductDescription1, precio, segmentado,disponibilidad FROM pricefile WHERE selected = 1");
           
           
           
            $i = 1;
            while ($row = $result_pro->fetch_assoc()) {
            ?>
            <tr>
              <td><?php echo $i; ?></td>
              <td><?php echo $i; ?></td>
              <td><?php echo $row["SKU"]; ?></td>
              <td><?php echo $row["MFRPartNumber"]; ?></td>
              <td><?php echo utf8_encode($row["ProductDescription1"]); ?></td>
              <td><?php echo $row["precio"]; ?></td>
              <td><?php echo $row["disponibilidad"]; ?></td>
              <td><?php echo $row["segmentado"]; ?></td>
            </tr>
            <?php $i++;} ?>
          </tbody>
        </table>
