<ul class="list-group">
<?php
if(!empty($productos)) {
	?>
	<li class="list-group-item">
		<div>
			<table class="table table-bordered" width="100%">
				<thead>
					<tr>
						<th>Producto</th>
						<th>Activo</th>
						<th>Valor</th>
						<?php
							foreach ($categorias as $k => $n) {
								echo '<th>' . $n . '</th>';
							}
						?>
					</tr>
				</thead>
				<tbody>
					<?php
						foreach ($productos as $p) {
							echo '<tr>';
							echo '<td>'.$p['name'].'</td>';
							echo '<td>'.$p['active'].'</td>';
							echo '<td>'.clp($p['price']).'</td>';
							foreach ($categorias as $k => $n) {
								$checked = (isset($p['categories'][$k]) ? 'checked="checked"' : '');
								?>
								<td>
									<input id="cp-<?php echo $p['id'].'-'.$k; ?>" class="cat-prod cp-<?php echo $p['id']; ?>" type="radio" name="cp_<?php echo $p['id']; ?>" data-product="<?php echo $p['id']; ?>" value="<?php echo $k; ?>" <?php echo $checked; ?>>
									<label for="cp-<?php echo $p['id'].'-'.$k; ?>"><?php echo $n; ?></label> 
									<?php /* <label for="cp-<?php echo $p['id'].'-'.$k; ?>"><?php echo clp(round(intval($p['price']) * (100 - intval(str_replace('%','',$n))) / 100)); ?></label> */ ?>
								</td>
								<?php
							}
							echo '</tr>';
						}
					?>
				</tbody>
			</table>
		</div>
	</li>
	<?php
}
else {
	?>
	<li>A&uacute;n no hay productos</li>
	<?php
}
echo '</ul>';
?>

<?php /*
<script src="<?php echo js('productos.js'); ?>"></script>
<script src="<?php echo base_url(); ?>js/productos.js"></script>
*/ ?>
