"; //echo "off->" .$offset ." lim-> ".$limit; if ($offset>1) { // bypass PREV link if offset is 0 $prevoffset=$offset-$limit; print "<<   \n"; } // calculate number of pages needing links $pages=intval($numrows/$limit); // $pages now contains int of pages needed unless there is a remainder from division if ($numrows%$limit) { // has remainder so add one page $pages++; } for ($i=1;$i<=$pages;$i++) { // loop thru $newoffset=$limit*($i-1); print "$i | \n"; } // check to see if last page if (!(($offset/$limit)==$pages) && $pages!=1) { // not last page so give NEXT link $newoffset=$offset+$limit; print ">>\n"; } print "

"; } function MuestraRegistro($reg,$el_i) { global $select; if (($el_i % 2 ) == '0') $colorfila = "#eeeeee"; else $colorfila = "#ffffff"; FilaInicio($colorfila); DatoEnlaceGenera($reg["distr_nombre"],"ContactoActualiza.php3?distr_ID=".$reg["distr_ID"]); DatoGenera($reg["distr_tel"]); DatoGenera($reg["distr_cel"]); DatoEnlaceGenera($reg["distr_email"], "mailto:".$reg["distr_email"]); FilaFinal(); } //------------------ // CUERPO PRINCIPAL //------------------ if (isset($borrar) ) while (list($key, $value) = each ($HTTP_POST_VARS["aSeleccion"]) ) Borrarlead($value); if (isset($mover) ) while (list($key, $value) = each ($HTTP_POST_VARS["aSeleccion"]) ) Moverlead($value); if (!isset($orden) ) $orden = "distr_nombre"; $where = " distr_ID > '0' "; $sql = "select distribuidores.* , distr_zonas.* from distribuidores,distr_zonas where distribuidores.distr_ID = distr_zonas.distr_ID and distr_zonas.zona_ID = '".$Zona."'"; //-- Preparo informacion - recorset segun condiciones recibidas -- $rs = mysql_query($sql); $limit = 100; $numresults=mysql_query($sql); $numrows=mysql_num_rows($numresults); // next determine if offset has been passed to script, if not use 0 if (empty($offset)) { $offset=0; } $sql .= " order by ".$orden ." limit $offset,$limit "; $rs = mysql_query($sql); $titulo = "Dónde consultar para adquirir nuestros productos ?"; include('distribuidores/inicio.inc'); //echo "

$titulo

"; FormInicio($PHP_SELF,"query","post"); TablaInicio('','','Query'); OpcionesQuery(); TablaFinal(); FormFinal(); echo "
Seleccione Provincia y Zona de su interés
"; // echo "zona : $Zona"; if ((!(empty($Zona))) & (ProvinciadelaZona($Zona) == $Provincia)) { FormInicio($PHP_SELF,"consulta","post"); $cantrepr= @mysql_num_rows($rs); if ( $cantrepr > 0) { while ($reg=mysql_fetch_array($rs)) { if (empty($reg['distr_imagen'])) { echo ""; echo ""; echo "
".$reg['distr_nombre']."
Representante Zonal
"; // echo "

".$reg['distr_nombre']."


Representante Zonal
"; echo "Tel.: ".$reg["distr_tel"]."
"; echo "Cel.: ".$reg["distr_cel"]."
"; // echo "E-mail: ".$reg["distr_email"]."
"; echo "
"; } else { echo ""; echo "
"; echo "
".$reg['distr_nombre']."
Representante Zonal
"; echo "
Tel.: ".$reg["distr_tel"]."
"; echo "Cel.: ".$reg["distr_cel"]."
"; // echo "E-mail: ".$reg["distr_email"]."
"; echo "
"; echo "
"; } } } else echo "
Zona sin representante asignado
"; //Paginar() ; FormFinal(); } ?>