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

	$cod=$_GET['id'];
	$selectDados=mysql_query("SELECT * FROM adm_artigos WHERE id=$cod");
	while($linhaArtigo = mysql_fetch_array($selectDados)){
	?>
	<table border="0" class="tabela-conteudo" cellspacing="10">
		<tbody>
			<tr>
				<td valign="top"><strong>T&iacute;tulo:</strong></td>
				<td><? echo utf8_encode($linhaArtigo['titulo']);?></td>
			</tr>
			<tr>
				<td valign="top"><strong>Texto:</strong></td>
				<td><? echo utf8_encode($linhaArtigo['texto']);?></td>
			</tr>
			<tr>
				<td valign="top"><strong>Capa:</strong></td>
				<td><img src="../../imagens-site/capas/artigos/thumbs/<? echo $linhaArtigo['capa'];?>"></td>
			</tr>
			<tr>
				<?php
					$cont = 1;
					$selectGallery = mysql_query("SELECT * FROM adm_gallery WHERE id_artigo = '".$cod."'");
					while ($resultGallery = mysql_fetch_array($selectGallery)) {
						
						$idImagemGallery = $resultGallery['idGallery'];
						$nomeImagemGallery = $resultGallery['arquivo'];
				?>
						<td class="editarFotoGallery">
							<img src="../../imagens-site/galerias/thumbs/<?php echo($nomeImagemGallery); ?>">
							
						</td>
				<?php
						if ($cont % 2 == 0) {
							
							echo "</tr>";
						}

						$cont++;
					}
				?>
		</tbody>
	</table>
	<?
	}
?>