<script type="text/javascript">
	$(document).ready(function(){
	    $(".detalhes").colorbox({iframe:true, width:"45%", height:"58%"});
	});
</script>


<?php
	
	require('../../connect/db.php');
	db_connect() or die ("Houve erro ao acessar estes dados!");

	if($_GET['busca'] != ''){
		$criterio = "WHERE titulo like '%".mysql_escape_string($_GET['busca'])."%' or link like '%".mysql_escape_string($_GET['busca'])."%' or capa like '%".mysql_escape_string($_GET['busca'])."%'";
	}
	if($_GET['busca'] == ''){
		$criterio = "";
	}


	$selectBusca = mysql_query("SELECT * FROM adm_slides $criterio");
?>

<table border="0" cellspacing="10" class="tabela-conteudo">
	<tbody>
		<tr class="linha-topo">
			<td>ID</td>
			<td>T&iacute;tulo</td>
			<td>Ver</td>
			<td>Editar</td>
			<td>Deletar</td>
		</tr>
		<?php
			$aux = 1;
			while ($linhaBusca = mysql_fetch_array($selectBusca)) {
			?>
			<tr <?php if($aux % 2 == 0){ echo"bgcolor='f2eaea'"; }else{ echo"bgcolor='edeaea'"; } ?>>
				<td class="idTabelaExibir"><?php echo($linhaBusca['id']); ?></td>
				<td class="nomeTabelaExibir"><? echo utf8_encode($linhaBusca['titulo']);?></td>
				<td class="icons-categorias"><a href='paineis/slide/detalhes-slide.php?id=<? echo $linhaBusca['id']; ?>' class="detalhes"><img src="images/lupa2.png" width="20px" height="20px" alt="" border='0'></a></td>
				<td class="icons-categorias"><a href='miolo.php?miolo=slides&acao=alterar&id=<? echo $linhaBusca['id'];?>'><img src="images/editar.png" width="20px" height="20px" alt="" border='0'></a></td>
				<td class="icons-categorias"><a href='miolo.php?miolo=slides&acao=excluir&id=<? echo $linhaBusca['id'];?>'><img src="images/lixo.png" width="20px" height="20px" alt="" border='0'></a></td>
			</tr>
			<?
			}
			$aux += 1;
		?>	
	</tbody>
</table>