<?php

require('../conexion.php');
$resultado=query("SELECT A.id 'ID', A.pro_clave 'CLAVE', A.pro_nombre 'NOMBRE', A.pro_precio_venta 'PRECIO_VENTA', A.pro_clasificaciones 'CLASIFICACION', A.pro_estatus 'ESTATUS', A.pro_costo_receta 'COSTO_RECETA', A.pro_redondenado 'REDONDEADO', A.pro_observaciones 'OBSERVACIONES', A.pro_id_receta 'ID_RECETA' FROM productos A WHERE A.pro_clasificaciones = 'BAR' ORDER BY A.pro_nombre");
if ($resultado->num_rows > 0) {
?>
<div class="table-responsive">
  <table class="table" id="pro_tabla">
    <thead style="background: #D5D8DC;">
      <tr>
        <th class="align-middle text-center" scope="col">Nombre</th>
        <th class="align-middle text-center" scope="col">Precio venta</th>
        <th class="align-middle text-center" scope="col">Clasificacion</th>
        <th class="align-middle text-center" scope="col">Estatus</th>
        <th class="align-middle text-center" scope="col">Costo Receta</th>
        <th class="align-middle text-center" scope="col">Redondeado</th>
        <th class="align-middle text-center" scope="col">Observaciones</th>
    </thead>
    
    <tbody id="pro_tbody " class="tabla_prod_body">
      <?php
        $cont=0;
        while($fila = mysqli_fetch_assoc($resultado)){
          $cont=$cont+1;
      ?>
      <tr>
        <td class="align-middle text-center"><input type="text" class="sizet-prod form-control input-nombre" name="edts_prod_nombre_<?php echo $cont?>" id="edts_prod_nombre_<?php echo $cont?>" value="<?php echo $fila['NOMBRE']?>"></td>
        <td class="align-middle text-center"><input type="text" class="form-control input-precio" name="edts_prod_precio_v_<?php echo $cont?>" id="edts_prod_precio_v_<?php echo $cont?>" value="<?php echo $fila['PRECIO_VENTA']?>"></td>
        <td class="align-middle text-center "><input type="text" class="form-control input-clasificacion" name="edts_prod_clasificacion_<?php echo $cont?>" id="edts_prod_clasificacion_<?php echo $cont?>" value="<?php echo $fila['CLASIFICACION']?>"></td>
        <td class="align-middle text-center "><input type="text" class="form-control input-estatus" name="edts_prod_estatus_<?php echo $cont?>" id="edts_prod_estatus_<?php echo $cont?>" value="<?php echo $fila['ESTATUS']?>"></td>
        <td class="align-middle text-center "><input type="text" class="form-control input-costo-rec" name="edts_prod_costo_rec_<?php echo $cont?>" id="edts_prod_costo_rec_<?php echo $cont?>" value="<?php echo $fila['COSTO_RECETA']?>"></td>
        <td class="align-middle text-center "><input type="text" class="form-control input-redondeado" name="edts_prod_redondeado_<?php echo $cont?>" id="edts_prod_redondeado_<?php echo $cont?>" value="<?php echo $fila['REDONDEADO']?>"></td>
        <td class="align-middle text-center "><input type="text" class="form-control input-observaciones" name="edts_prod_observaciones_<?php echo $cont?>" id="edts_prod_observaciones_<?php echo $cont?>" value="<?php echo $fila['OBSERVACIONES']?>"></td>
        <td class="align-middle text-center "><input type="hidden" class="form-control input-id" name="edts_prod_id_<?php echo $cont?>" id="edts_prod_id_<?php echo $cont?>" value="<?php echo $fila['ID']?>"></td>
        
      </tr>
      <?php }?>
    </tbody>
  </table>
</div>
<?php
}?>