<?php require_once('../Connections/tienda.php'); ?>
<?php require_once('../Connections/tienda.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];

$maxRows_tienda = 3;
$pageNum_tienda = 0;
if (isset($_GET['pageNum_tienda'])) {
  $pageNum_tienda = $_GET['pageNum_tienda'];
}
$startRow_tienda = $pageNum_tienda * $maxRows_tienda;

mysql_select_db($database_tienda, $tienda);
$query_tienda = "SELECT * FROM fotos_mias";
$query_limit_tienda = sprintf("%s LIMIT %d, %d", $query_tienda, $startRow_tienda, $maxRows_tienda);
$tienda = mysql_query($query_limit_tienda, $tienda) or die(mysql_error());
$row_tienda = mysql_fetch_assoc($tienda);

if (isset($_GET['totalRows_tienda'])) {
  $totalRows_tienda = $_GET['totalRows_tienda'];
} else {
  $all_tienda = mysql_query($query_tienda);
  $totalRows_tienda = mysql_num_rows($all_tienda);
}
$totalPages_tienda = ceil($totalRows_tienda/$maxRows_tienda)-1;

$queryString_tienda = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_tienda") == false && 
        stristr($param, "totalRows_tienda") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_tienda = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_tienda = sprintf("&totalRows_tienda=%d%s", $totalRows_tienda, $queryString_tienda);
?>




<!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"><!-- InstanceBegin template="/Templates/indexstore2.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Documento sin t&iacute;tulo</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.Estilo3 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('../imagenes/hiasna2.png','../imagenes/historia2.png','../imagenes/tienda2.png','../imagenes/Galeria2.png','../imagenes/gaceta2.png','../imagenes/foro2.png','../imagenes/contacto2.png','../herradero/herradero.gif')">

<div align="center">
    <table width="1094" height="50" border="0" cellpadding="0" cellspacing="0" background="../imagenes%20pagina/menu_link.jpg">
    <tbody>
      <tr>
        <td colspan="7"><img src="../imagenes/top2.png" width="1094" height="205" /></td>
      </tr>
      <tr>
        <td width="150" align="center"><a href="../index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('1','','../imagenes/hiasna2.png',1)"><img src="../imagenes/hiasna.png" name="1" width="150" height="50" border="0" id="1" /></a></td>
        <td width="150" align="center"><a href="../historia/index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('2','','../imagenes/historia2.png',1)"><img src="../imagenes/historia.png" name="2" width="150" height="50" border="0" id="2" /></a></td>
        <td width="150" align="center"><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('3','','../imagenes/tienda2.png',1)"><img src="../imagenes/tienda.png" name="3" width="150" height="50" border="0" id="3" /></a></td>
        <td width="150" align="center"><a href="../galeria/index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('4','','../imagenes/Galeria2.png',1)"><img src="../imagenes/Galeria.png" name="4" width="150" height="50" border="0" id="4" /></a></td>
        <td width="150" align="center"><a href="../GACETA.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('5','','../imagenes/gaceta2.png',1)"><img src="../imagenes/gaceta.png" name="5" width="150" height="50" border="0" id="5" /></a></td>
        <td width="150" align="center"><a href="../foro_web.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('6','','../imagenes/foro2.png',1)"><img src="../imagenes/foro.png" name="6" width="150" height="50" border="0" id="6" /></a></td>
        <td width="150" align="center"><a href="../COMMENTARIO.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('7','','../imagenes/contacto2.png',1)"><img src="../imagenes/contacto.png" name="7" width="150" height="50" border="0" id="7" /></a></td>
      </tr>
    </tbody>
  </table>
  <table width="1094" height="800" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td width="208" align="center" valign="top" background="../imagenes/Imagen2.png"><p>&nbsp;</p>
          <p><a href="../o/herradero.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('8','','../herradero/herradero.gif',1)"><img src="../herradero/banner1.gif" name="8" width="163" height="79" border="0" id="8" /></a></p>
          <p align="center"><br />
              <a href="../herradero.php"></a><br />
          </p></td>
        <td width="681" align="center" valign="top">&nbsp;
            <p>
              <!-- Start VideoLightBox.com BODY section -->
              <script type="text/javascript">

            </script>
              <script type="text/javascript"><div align="center">function onYouTubePlayerReady(playerId) { 
ytplayer = document.getElementById(&quot;video_overlay&quot;); 
ytplayer.setVolume(100); 
} 

</div></script>
              <!-- End VideoLightBox.com BODY section -->
              <br />
            </p>
          <!-- InstanceBeginEditable name="1" -->
            <p>
        <div align="right"><a href="carrito_compra.php">ver carrito </a> </div>
        <div align="left"><span class="Estilo1">Click en la imagen para ver 
          </span>
        </div>
        <div align="center">
          <table width="100%" border="0" cellpadding="0" cellspacing="0">       
           <?php 		
			$cuantos=0;
			do { 
			   if($cuantos==0){
			   ?>
                <tr>
                  <?
			      }
			      $cuantos ++;
			      ?>
                  <td bordercolor="#FFFFFF"><div align="center">
                     <p><a href="detalle.php?foto_id=<?php echo $row_tienda['foto_id']; ?>"><img src="../fotos/peques/<?php echo                       $row_tienda['nombre']; ?>" width="100" height="100" border="0" /></a><br />
                       <span class="Estilo2 Estilo6">$<?php echo $row_tienda['precio']; ?>.00</span></p>
                     <form id="form1" name="form1" method="post" action="carrito_compra.php">
                       <input name="cantidad" type="hidden" id="cantidad" value="1" />
                       <input name="precio" type="hidden" id="precio" value="<?php echo $row_tienda['precio']; ?>" />
                       <input name="lugar" type="hidden" id="lugar" value="<?php echo $row_tienda['lugar']; ?>" />
                       <input type="image" name="imageField" src="../imagenes/carrito.gif" />
                     </form>
                     <p><br />
                     </p>
                  </div></td>
				  
				  <?
				if(cuantos==3){
				$cuantos=0;
				?>
                </tr>                
                 <?
			  	 }
			  	 ?>                
                <?php } while ($row_tienda = mysql_fetch_assoc($tienda)); ?><p>
             </table>
             <table border="0" width="50%" align="center">
               <tr>
                 <td width="23%" align="center"><div align="center">
                   <?php if ($pageNum_tienda > 0) { // Show if not first page ?>
                     <span class="Estilo4 Estilo1"><a href="<?php printf("%s?pageNum_tienda=%d%s", $currentPage, 0, $queryString_tienda); ?>" class="Estilo2 Estilo4 Estilo5 Estilo9"><font face="Harrington">Primero</font></a>
                     <?php } // Show if not first page ?>
                 </span></div></td>
              <td width="31%" align="center"><div align="center">
                <?php if ($pageNum_tienda > 0) { // Show if not first page ?>
                  <span class="Estilo4 Estilo1"><a href="<?php printf("%s?pageNum_tienda=%d%s", $currentPage, max(0, $pageNum_tienda - 1), $queryString_tienda); ?>" class="Estilo2 Estilo4 Estilo7"><font face="Harrington">Anterior</font></a>
                  <?php } // Show if not first page ?>
                </span></div></td>
              <td width="23%" align="center"><div align="center">
                <?php if ($pageNum_tienda < $totalPages_tienda) { // Show if not last page ?>
                  <span class="Estilo4 Estilo1"><a href="<?php printf("%s?pageNum_tienda=%d%s", $currentPage, min($totalPages_tienda, $pageNum_tienda + 1), $queryString_tienda); ?>" class="Estilo2 Estilo4 Estilo5 Estilo7"><font face="Harrington">Siguiente</font></a>
                  <?php } // Show if not last page ?>
                </span></div></td>
              <td width="23%" align="center"><div align="center">
                <?php if ($pageNum_tienda < $totalPages_tienda) { // Show if not last page ?>
                  <span class="Estilo4 Estilo1"><a href="<?php printf("%s?pageNum_tienda=%d%s", $currentPage, $totalPages_tienda, $queryString_tienda); ?>" class="Estilo3"><font face="Harrington">&Uacute;ltimo</font></a>
                  <?php } // Show if not last page ?>
                </span></div></td>
            </tr>
             </table>
             </p>
           </div>
          <p align="center"><br />
          </p>
        </p>
            <!-- InstanceEndEditable --></td>
        <td width="205" valign="top" background="../imagenes/Imagen3.png"><p>
            <!-- SiteSearch Google -->
            <input type="hidden" name="ie" value="UTF-8" />
            <input type="hidden" name="oe" value="UTF-8" />
            </p>
            <form method="get" action="http://www.google.com/search">
              <table bgcolor="#FFFFFF">
                <tr>
                  <td><input type="text" name="q" size="31" maxlength="255" value="" />
                      <input type="submit" name="btnG" value="Buscar en Google" />
                      <font size="-1">
                      <input type="hidden" name="domains" value="Hiasna " />
                      <br />
                      <input type="radio" name="sitesearch" value="" />
                        Web
                        <input type="radio" name="sitesearch" value="Google" checked="checked" />
                        Hiasna<br />
                    </font></td>
                </tr>
              </table>
            </form>
          <!-- SiteSearch Google --></td>
      </tr>
    </tbody>
  </table>
  <table width="1094" border="0" cellspacing="0" cellpadding="0">
    <tbody>
      <tr>
        <td height="30" align="right" background="../imagenes/bottom.png">&nbsp;</td>
      </tr>
    </tbody>
  </table>
</div>
</body>
<!-- InstanceEnd --></html>
