<?php
$p = $produk->listproduk();
?>
<div class="page-content">
	<div class="row">
		<div class="col-xs-12">
			<div class="row">
				<div class="col-xs-12">
					<h3 class="header smaller lighter blue">Data Produk</h3>
					<div class="clearfix">
						<a href="index.php?module=produk&act=tambah" role="button" class="blue" data-toggle="modal">
							<button class="btn btn-white btn-info btn-bold">
								<i class="ace-icon fa fa-plus bigger-120 blue"></i>
								Tambah
							</button>
						</a>
						<div class="pull-right tableTools-container"></div>
					</div>
					<div>
						<table id="dynamic-table" class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th>Nama Produk</th>
									<th>Kategori</th>
									<th>Brand</th>
									<th>Harga</th>
									<th>Stock</th>
									<th>Aksi</th>
									<th></th>
								</tr>
							</thead>
							<tbody>
								<?php
									while($i<count($p)){
								?>
										<tr>
											<td><?php echo"".$p[$i][nama].""; ?></td>
											<td><?php echo"".$p[$i][kategori].""; ?></td>
											<td><?php echo"".$p[$i][brand].""; ?></td>
											<td><?php echo"".$p[$i][harga].""; ?></td>
											<td><?php echo"".$p[$i][stock].""; ?></td>
											<td>
												<?php if($p[$i][aktif]=='Y'){ ?>
													<span class="label label-sm label-success">Aktif</span>
												<?php }else{ ?>
													<span class="label label-sm label-danger">Tidak Aktif</span>
												<?php } ?>
											</td>
											<td>
												<div class="hidden-sm hidden-xs action-buttons">
													<a class="green" href="index.php?module=produk&act=edit&id=<?php echo"".$p[$i][id].""; ?>">
														<i class="ace-icon fa fa-pencil bigger-130"></i>
													</a>
													<a class="red" href="index.php?module=produk&act=delete&id=<?php echo"".$p[$i][id].""; ?>">
														<i class="ace-icon fa fa-trash-o bigger-130"></i>
													</a>
												</div>
											</td>
										</tr>
								<?php
	                                   	$i++;
	                             	}
                                   	unset($i);
                             	?>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div><!-- /.col -->
	</div><!-- /.row -->
</div><!-- PAGE CONTENT ENDS -->