<div class="wrapper wrapper-content animated fadeInUp">
	<?php echo view('Views\view_header'); ?>

	<div class="row">
		<div class="col-lg-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<h5>
						Listagem
					</h5>
				</div>

				<div class="ibox-content">
					<div class="table-responsive">
						<table class="table table-striped table-hover dataTables">
							<thead>
								<tr>
									<th>Título</th>
									<th width="75"><center>Ativo</center></th>
									<th width="250"><center>Ações</center></th>
								</tr>
							</thead>

							<tbody>
								<?php foreach($cms_usuario_categorias as $valor) { ?>
									<tr>
										<td>
											<?php echo $valor->titulo; ?>
										</td>

										<td>
											<center>
												<?php 
												if($valor->ativo == '1') { 
													echo "<div class='d-block w-100 rounded-0 label label-success py-2 text-2 font-normal'> Ativo </span>"; 
												} 
												else { 
													echo "<div class='d-block w-100 rounded-0 label label-danger py-2 text-2 font-normal'> Inativo </span>"; 
												} 
												?>
											</center>
										</td>

										<td>
											<center>
												<?php if( (isset($MyModulo->editar) AND $MyModulo->editar == 1) OR ($MyUser->id == 1) ) { ?>
													<a href="<?php echo BASECMSURL . $MyMod . "/alterando-cadastro/" . $valor->id; ?>" title="Editar" class="with-tip loading">
														<button type="button" class="btn btn-primary text-uppercase" title="Editar">
															Editar
														</button>
													</a>
												<?php } ?>

												<?php if( (isset($MyModulo->excluir) AND $MyModulo->excluir == 1) OR ($MyUser->id == 1) ) { ?>
													<?php if($valor->id > 2) { ?>
														<a href="<?php echo BASECMSURL . $MyMod . "/deletando-cadastro/" . $valor->id; ?>" title="Deletar" class="with-tip btn-excluir">
															<button type="button" class="btn btn-danger" title="Deletar">
																<i class="fa-light fa-trash"></i>
															</button>
														</a>
													<?php } else { ?>
														<button type="button" class="btn btn-danger" title="Deletar" disabled>
															<i class="fa-light fa-xmark"></i>
														</button>
													<?php } ?>
												<?php } ?>
											</center>
										</td>
									</tr>
								<?php } ?>
							</tbody>

							<tfoot>
								<tr>
									<th>Título</th>
									<th><center>Ativo</center></th>
									<th><center>Ações</center></th>
								</tr>
							</tfoot>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<?php echo view('Views/view_footer'); ?>