<?php
session_start();
require_once ("../../config/Cado.php");
require_once ("../producto/cProducto.php");
$oProducto = new cProducto();
require_once ("../formatos/formato.php");
if(isset($_SESSION['pro_marid']))
{
	$num_rows=count($_SESSION['pro_marid']);
	if($num_rows==0)$num_rows="";
}
else
{
	$num_rows="";
}
?>


<div id="tabla_pago_detalle" class="table-responsive" >
	<table class="table table-bordered table-striped">
		<thead>
			<tr >
				<th>MARCA</th>
				<th>FEC. VENCIMIENTO</th>
				<th>P. COSTO</th>
				<th>P. VENTA</th>
				<th>COD BAR</th>
				<th>ID</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
			<?php
			if($num_rows>0){
			
			foreach($_SESSION['pro_marid'] as $indice=>$valor)
			{
			?>
			<tr>
				<td>
					<?php echo $_SESSION['pro_mar'][$indice]; ?>
				</td>
				<td>
					<strong> <?php echo mostrarFecha($_SESSION['pro_mar_fecven'][$indice]); ?> </strong>
				</td>
				<td>
					<strong> <?php echo formato_money($_SESSION['pro_mar_precos'][$indice]); ?> </strong>
				</td>
				<td>
					<strong> <?php echo formato_money($_SESSION['pro_mar_preven'][$indice]); ?> </strong>
				</td>
				<td>
					<strong> <?php echo $_SESSION['pro_mar_codbar'][$indice]; ?> </strong>
				</td>
				<td>
					<?php echo $_SESSION['pro_marid'][$indice]; ?>
				</td>
				<td>
				<button class="btn btn-xs btn-danger glyphicon glyphicon-remove" 
				onclick="eliminar_marca('<?php echo $indice; ?>')" ><i class="fas fa-trash"></i></button>
				</td>
			</tr>
			<?php						
			}
			}else{
			?>
			
			<tr>
			<td colspan="7">Sin registros </td>			
			</tr>
		
			<?php 
			}
			?>
		</tbody>
		
		
	</table>
</div>