<?
	$painel = "frontend";
	include("admin/brain.php");

	$id=$_GET["id"];
	#Faz a sele&ccedil;&atilde;o no banco para a listagem de TODO o conte&uacute;do
	$query = "SELECT * FROM fotos WHERE categoria='$id';";
	$resultado = mysql_query($query);
	$monta_select = mysql_fetch_array($resultado);
	
	#Faz a sele&ccedil;&atilde;o no banco para a listagem de TODO o conte&uacute;do
	$query_galeria = "SELECT * FROM categorias WHERE id='$id';";
	$resultado_galeria = mysql_query($query_galeria);
	$monta_select_galeria = mysql_fetch_array($resultado_galeria);
	$galeria=$monta_select_galeria["nome"];
	$descricao=$monta_select_galeria["descricao"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><? echo $galeria; ?> - Transportadora Tempo</title>
<style type="text/css">
body {
	margin:0px;
	background:#333;
	font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
	font-size:12px;
}
.descricao {
	color:#CCC;
}
p {
	margin:3px 20px;
	padding:0px;
}
h1 {
	font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
	font-size:18px;
	letter-spacing:1px;
	color:#B0190B;
	font-weight:bold;
	padding:0px;
	margin:5px 10px;
}
ul, li {
	list-style:none;
	float:left;
	display:inline;
}
li {
	margin:10px;
	padding:0px;
	height:126px;
	width:168px;
	text-align:center;
	line-height:126px;
	vertical-align:middle;
}
img {
	border:2px solid #666;	
}
</style>
<link media="screen" rel="stylesheet" href="colorbox.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="<? echo $endereco_site; ?>/Scripts/jquery.colorbox-min.js"></script>
<script>
$(document).ready(function(){
	//Examples of how to assign the ColorBox event to elements
	$("a[rel='fotos']").colorbox({transition:"fade", width:"90%", height:"90%"});
});
</script>
</head>
<body>
<h1><? echo $galeria; ?></h1>
<p class="descricao"><? echo $descricao; ?></p>
<ul>
<? 
do {
	$foto=$monta_select["foto"];
	$nome_foto=utf8_encode($monta_select["nome"]);
	echo "<li><a href=\"fotos/$id/$foto\" rel=\"fotos\" title=\"$nome_foto\"><img src=\"fotos/$id/thumbs/$foto\" border=\"0\" alt=\"$nome_foto\"></a>";
} while ($monta_select = mysql_fetch_array($resultado));
?>
</ul>
</body>
</html>