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

<?php 
	if($_SESSION['nivel'] == 3){
?>
	<table border="0" cellspacing="10" class="tabela-conteudo">
		<tbody>
			<tr class="linha-topo">
				<th>ID</th>
				<th>Empresa</th>
				<th>Ver</th>
				<th>Gerenciar</th>
			</tr>
			<?php
				$selectBusca = mysql_query("SELECT * FROM crm_cliente WHERE id IN (SELECT id_cliente FROM crm_chamado WHERE id_usuario = '".$_SESSION['idUser']."')");
				$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['empresa']);?></td>
					<td class="icons-categorias"><a href='paineis/crm-chamados/detalhes-chamados.php?id=<? echo $linhaBusca['id'];?>&idUser=<?php echo $_SESSION['idUser']; ?>' 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=chamados&acao=gerenciar&cod=<? echo $linhaBusca['id'];?>'><img src="images/editar.png" width="20px" height="20px" alt="" border='0'></a></td>
				</tr>
				<?
				}
				$aux += 1;
			?>	
		</tbody>
	</table>
<?php 
}
?>