<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 datatables-with-filter" data-col="0">
							<thead>
								<tr>
									<th class="d-none"><center>Método</center></th>
									<th><center>ID</center></th>
									<th><center>#</center></th>
									<th>Descrição</th>
									<th>Data de cadastro</th>
								</tr>
							</thead>

							<tbody>
								<?php foreach($cms_auditoria as $valor) {?>

									<?php
									if($valor->metodo == "Create") { 
										$background = "#20c997";
										$icon 			= '<i class="fa-light fa-plus"></i>';
									}

									if($valor->metodo == "Insert") { 
										$background = "#28a745";
										$icon 			= '<i class="fa-light fa-check"></i>';
									}

									if($valor->metodo == "Read") { 
										$background = "#17a2b8";
										$icon 			= '<i class="fa-light fa-pencil"></i>';
									}

									if($valor->metodo == "Update") { 
										$background = "#fd7e14";
										$icon 			= '<i class="fa-light fa-arrows-rotate"></i>';
									}

									if($valor->metodo == "Delete") { 
										$background = "#dc3545";
										$icon 			= '<i class="fa-light fa-trash"></i>';
									}

									if($valor->metodo == "Access") { 
										$background = "#6c757d";
										$icon 			= '<i class="fa-light fa-person-to-door"></i>';
									}

									if($valor->metodo == "Login") { 
										$background = "#6610f2";
										$icon 			= '<i class="fa-light fa-arrow-right-to-bracket"></i>';
									}

									if($valor->metodo == "Logout") { 
										$background = "#6f42c1";
										$icon 			= '<i class="fa-light fa-arrow-right-from-bracket"></i>';
									}

									if($valor->metodo == "Export") { 
										$background = "#ffc107";
										$icon 			= '<i class="fa-light fa-file-export"></i>';
									}

									if($valor->metodo == "Import") { 
										$background = "#ffc107";
										$icon 			= '<i class="fa-light fa-file-import"></i>';
									}

									if($valor->metodo == "Ajax") { 
										$background = "#007bff";
										$icon 			= '<i class="fa-light fa-arrow-down-arrow-up"></i>';
									}

									if($valor->metodo == "Upload") { 
										$background = "#fd7e14";
										$icon 			= '<i class="fa-light fa-upload"></i>';
									}

									if($valor->metodo == "Batch Delete") { 
										$background = "#dc3545";
										$icon 			= '<i class="fa-light fa-trash-list"></i>';
									}

									if($valor->metodo == "Visualize") { 
										$background = "#17a2b8";
										$icon 			= '<i class="fa-light fa-eye"></i>';
									}

									if($valor->metodo == "Print") { 
										$background = "#ffc107";
										$icon 			= '<i class="fa-light fa-print"></i>';
									}

									if($valor->metodo == "API") { 
										$background = "#000";
										$icon 			= '<i class="fa-light fa-plug"></i>';
									}
									?>

									<tr style="color: #fff; background-color: <?php echo $background; ?>">
										<td class="d-none">
											<?php echo $valor->metodo; ?>
										</td>

										<td>
											<center>
												<?php echo sprintf("%04d", $valor->id); ?>
											</center>
										</td>

										<td>
											<center>
												<?php echo $icon; ?>
											</center>
										</td>

										<td>
											<?php echo $valor->descricao; ?>
										</td>

										<td>
											<?php echo $valor->data_cadastro; ?>
										</td>
									</tr>

								<?php } ?>
							</tbody>

							<tfoot>
								<tr>
									<th class="d-none"><center>Método</center></th>
									<th><center>ID</center></th>
									<th><center>#</center></th>
									<th>Descrição</th>
									<th>Data de cadastro</th>
								</tr>
							</tfoot>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

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