<?php 
	$this->load->view('productos/producto_nav');
?>
<ul class="list-group">
	<li class="list-group-item">
		<h2><?php echo $producto['nombre']; ?></h2>
	</li>
	<li class="list-group-item">
		<div class="table-responsive">
			<h4>Suscritos</h4>
			<table class="table table-striped">
				<thead>
					<tr>
						<th>Fecha</th>
						<th>Nombre</th>
						<th>Email</th>
					</tr>
				</thead>
				<tbody>
					<?php
					if (!empty($suscritos)) {
						foreach($suscritos as $s) {
							?>
							<tr>
								<td><?php echo fecha($s['created']); ?></td>
								<td>
									<?php 
									$s['cliente'] = $s['firstname'] . ' ' . $s['lastname'];
									echo (!empty($s['id_cliente']) ? '<a target="_blank" href="/clientes/view/' . $s['id_cliente'] . '">' . $s['cliente'] . '</a>' : $s['cliente']);
									?>
								</td>
								<td><?php echo $s['mail']; ?></td>
							</tr>
						<?php
						}
					}
					else { ?>
						<tr>
							<td colspan="9" class="text-center">
								No se econtraron suscritos
							</td>
						</tr>
					<?php
					}
					?>
				</tbody>
			</table>
		</div>
		<div class="row paginacion">
			<div class="info col-12 col-md-6">
				<?php echo $paginacion['info']; ?>
			</div>
			<div class="col-12 col-md-6">
				<?php echo $paginacion['links']; ?>
			</div>
		</div>
	</li>
</ul>
