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

<?php
	
	require('../../connect/db.php');
	db_connect() or die ("Houve erro ao acessar estes dados!");
	if($_GET['categoria'] != "NULL"){
		$criterio = "WHERE statusOrcamento = '".mysql_escape_string($_GET['categoria'])."'";
	}
	if($_GET['categoria'] == "NULL"){
		$criterio = "WHERE statusOrcamento > 1";
	}	
	$selectBusca = mysql_query("SELECT * FROM orcamentos_recebidos $criterio");
?>

<table border="0" cellspacing="10" class="tabela-conteudo">
	<tbody>
		<tr class="linha-topo">
			<th>ID</th>
			<th>Solicitante</th>
			<th>Ver</th>
			<th>Responder</th>
			<th>Finalizar</th>
		</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['idOrcamento']); ?></td>
				<td class="nomeTabelaExibir"><? echo utf8_encode($linhaBusca['solicitante']);?></td>
				<td class="icons-categorias"><a href='paineis/orcamentos/detalhes-orcamento.php?id=<? echo $linhaBusca['idOrcamento'];?>' 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=orcamentos&acao=responder&id=<? echo $linhaBusca['idOrcamento'];?>'><img src="images/editar.png" width="20px" height="20px" alt="" border='0'></a></td>
				<td class="icons-categorias"><a href='miolo.php?miolo=orcamentos&acao=finalizar&id=<? echo $linhaBusca['idOrcamento'];?>'><img src="images/lixo.png" width="20px" height="20px" alt="" border='0'></a></td>
			</tr>
			<?
			}
			$aux += 1;
		?>	
	</tbody>
</table>