<?php
require('includes/config.php');
require('includes/error_handler.php');
require('includes/auxiliares.php');
require('includes/conn.php');
require('includes/sessions.php');
?>
<!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=iso-8859-1" />
<title>emeg&eacute; men&uacute;</title>
<link href="_estilos.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="includes/jquery.js"></script>
<script type="text/javascript" language="javascript" src="includes/scripts.js"></script>
<!-- Meta Pixel Code -->
<script>!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init', '1083735016768273');fbq('track', 'PageView');</script>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1083735016768273&ev=PageView&noscript=1"/></noscript>
<!-- End Meta Pixel Code -->
</head>

<body>
<?php require('_header.php');?>
<table width="960" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td width="245" valign="top">
			<?php $seccion=1; require('_naveg.php');?>
			<?php require('_contacto.php'); ?>
		</td>
		<td width="50">&nbsp;</td>
		<td width="620" valign="top" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="30">&nbsp;</td>
			</tr>
			<tr>
				<td align="center"><img src="images/img_home.png" width="618" height="228" /></td>
			</tr>
			<tr>
				<td height="35"></td>
			</tr>
			<tr>
				<td align="left"><img src="images/tit_productos_destacados.gif" width="177" height="11" /></td>
			</tr>
			<tr>
				<td height="30" align="left" valign="middle"><img src="images/1x1.gif" width="100%" height="3" style="background-image:url(images/bg_linea_gris.gif);background-position:top left;background-repeat:repeat-x;" /></td>
			</tr>
			<tr>
				<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<?php 
						$rDestacados = dbquery( $conn, "select codigo, nombre, precio, imagen_1 from productos where activo = 1 and destacado = 1 order by rand() limit 3" );
						$i=0;
						foreach($rDestacados as $rsDestacados){
							++$i;?>
						<td width="180" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td colspan="3" height="135" align="center" valign="middle" class="thumb"><a href="productos_detalle.php?codigo=<?=$rsDestacados['codigo'];?>"><img src="<?=DIR_UPLOADS_FRONT.str_replace('.jpg','_mid.jpg',$rsDestacados['imagen_1']);?>" /></a></td>
							</tr>
							<tr>
								<td align="left" valign="top" class="texto_gris">
									<br /><strong><?=htmlentities($rsDestacados['nombre']);?></strong><br />
									<span class="texto_destacado_naranja">$<?=number_format($rsDestacados['precio'],2,',','.');?></span>
								</td>
								<td width="15">&nbsp;</td>
								<td valign="top" width="30"><a href="productos_detalle.php?codigo=<?=$rsDestacados['codigo'];?>"><img src="images/bt_mas.gif" class="hover" width="30" height="42" /></a></td>
							</tr>
						</table></td>
						<?=$i!=3 ? '<td>&nbsp;</td>' : '';?>
						<?php } ?>
					</tr>
				</table></td>
			</tr>
			<tr>
				<td height="45"></td>
			</tr>
			<tr>
				<td align="left"><img src="images/tit_ultimos_productos.gif" width="148" height="13" /></td>
			</tr>
			<tr>
				<td height="15" valign="bottom"><img src="images/1x1.gif" width="100%" height="3" style="background-image:url(images/bg_linea_gris.gif);background-position:top left;background-repeat:repeat-x;" /></td>
			</tr>
			<tr>
				<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<?php 
						$rDestacados = dbquery( $conn, "select codigo, nombre, precio from productos where activo = 1 order by rand() limit 3" );
						$i=0;
						foreach($rDestacados as $rsDestacados){
							++$i;?>
						<td width="180" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td align="left" valign="top" class="texto_gris">
									<br /><strong><?=htmlentities($rsDestacados['nombre']);?></strong><br />
									<span class="texto_destacado_naranja">$<?=number_format($rsDestacados['precio'],2,',','.');?></span>
								</td>
								<td width="15">&nbsp;</td>
								<td valign="top" width="30"><a href="productos_detalle.php?codigo=<?=$rsDestacados['codigo'];?>"><img src="images/bt_mas.gif" class="hover" width="30" height="42" /></a></td>
							</tr>
						</table></td>
						<?=$i!=3 ? '<td>&nbsp;</td>' : '';?>
						<?php } ?>
					</tr>
				</table></td>
			</tr>
		</table></td>
		<td>&nbsp;</td>
	</tr>
</table>
<?php require('_footer.php'); ?>
</body>
</html>