conectar(); // instanciar los 0bjetos $tabla_ruta=new Tabla_Ruta($dataBase->getEnlaceHost()); $tabla_museoruta=new Tabla_Museoruta($dataBase->getEnlaceHost()); $tabla_museo=new Tabla_Museo($dataBase->getEnlaceHost()); $tabla_foto=new Tabla_Foto($dataBase->getEnlaceHost()); $ruta=new Ruta(); // comprobar que existe if ($tabla_ruta -> existe($Nruta)) $ruta=$tabla_ruta->obtener($Nruta); else $ruta=$tabla_ruta->obtenerPrimero(); $plantillas = array("plantillas/rutas/ruta.htm","plantillas/cabecera.htm","plantillas/lateral_ruta.htm","plantillas/pie.htm"); $plantilla = plantillas($plantillas,"rutas"); // decodificar Estado $Nestado = $ruta->getNestado(); $txtNestado = "No"; if ($Nestado == 1) $txtNestado = "Sí"; // decodificar Activo $Nactivo = $ruta->getNactivo(); $txtNactivo = "No"; if ($Nactivo == 1) $txtNactivo = "Sí"; // decodificar Portada $Nportada = $ruta->getNportada(); $txtNportada = "No"; if ($Nportada == 1) $txtNportada = "Sí"; // decodificar Destacar $Ndestaca = $ruta->getNdestaca(); $txtNdestaca = "No"; if ($Ndestaca == 1) $txtNdestaca = "Sí"; // decodificar Extra13 $Nextra13 = $ruta->getNextra13(); $txtNextra13 = "No"; if ($Nextra13 == 1) $txtNextra13 = "Sí"; // decodificar Extra14 $Nextra14 = $ruta->getNextra14(); $txtNextra14 = "No"; if ($Nextra14 == 1) $txtNextra14 = "Sí"; // decodificar Extra15 $Nextra15 = $ruta->getNextra15(); $txtNextra15 = "No"; if ($Nextra15 == 1) $txtNextra15 = "Sí"; // decodificar Extra16 $Nextra16 = $ruta->getNextra16(); $txtNextra16 = "No"; if ($Nextra16 == 1) $txtNextra16 = "Sí"; // decodificar Extra17 $Nextra17 = $ruta->getNextra17(); $txtNextra17 = "No"; if ($Nextra17 == 1) $txtNextra17 = "Sí"; // decodificar Extra18 $Nextra18 = $ruta->getNextra18(); $txtNextra18 = "No"; if ($Nextra18 == 1) $txtNextra18 = "Sí"; $error=array('TAG_Nruta'=>array (1,$ruta->getNruta(),""), 'TAG_Ttit_es'=>array (1,$ruta->getTtit_es(),""), 'TAG_Ttit_eu'=>array (1,$ruta->getTtit_eu(),""), 'TAG_Ttit_en'=>array (1,$ruta->getTtit_en(),""), 'TAG_Ttit_fr'=>array (1,$ruta->getTtit_fr(),""), 'TAG_Mdes_es'=>array (1,$ruta->getMdes_es(),""), 'TAG_Mdes_eu'=>array (1,$ruta->getMdes_eu(),""), 'TAG_Mdes_en'=>array (1,$ruta->getMdes_en(),""), 'TAG_Mdes_fr'=>array (1,$ruta->getMdes_fr(),""), 'TAG_Tmap_es'=>array (1,$ruta->getTmap_es(),""), 'TAG_Tmap_eu'=>array (1,$ruta->getTmap_eu(),""), 'TAG_Tmap_en'=>array (1,$ruta->getTmap_en(),""), 'TAG_Tmap_fr'=>array (1,$ruta->getTmap_fr(),""), 'TAG_Nestado'=>array (1,$txtNestado,""), 'TAG_Nactivo'=>array (1,$txtNactivo,""), 'TAG_Nportada'=>array (1,$txtNportada,""), 'TAG_Ndestaca'=>array (1,$txtNdestaca,""), 'TAG_Norden'=>array (1,$ruta->getNorden(),""), 'TAG_Falta'=>array (1,$ruta->getFalta(),""), 'TAG_Fmodific'=>array (1,$ruta->getFmodific(),""), 'TAG_Textra01'=>array (1,$ruta->getTextra01(),""), 'TAG_Textra02'=>array (1,$ruta->getTextra02(),""), 'TAG_Textra03'=>array (1,$ruta->getTextra03(),""), 'TAG_Textra04'=>array (1,$ruta->getTextra04(),""), 'TAG_Textra05'=>array (1,$ruta->getTextra05(),""), 'TAG_Textra06'=>array (1,$ruta->getTextra06(),""), 'TAG_Textra07'=>array (1,$ruta->getTextra07(),""), 'TAG_Textra08'=>array (1,$ruta->getTextra08(),""), 'TAG_Textra09'=>array (1,$ruta->getTextra09(),""), 'TAG_Textra10'=>array (1,$ruta->getTextra10(),""), 'TAG_Textra11'=>array (1,$ruta->getTextra11(),""), 'TAG_Textra12'=>array (1,$ruta->getTextra12(),""), 'TAG_Nextra13'=>array (1,$txtNextra13,""), 'TAG_Nextra14'=>array (1,$txtNextra14,""), 'TAG_Nextra15'=>array (1,$txtNextra15,""), 'TAG_Nextra16'=>array (1,$txtNextra16,""), 'TAG_Nextra17'=>array (1,$txtNextra17,""), 'TAG_Nextra18'=>array (1,$txtNextra18,""), 'TAG_Mextra19'=>array (1,str_replace("\n","
",$ruta->getMextra19()),""), 'TAG_Mextra20'=>array (1,str_replace("\n","
",$ruta->getMextra20()),""), 'TAG_Mextra21'=>array (1,str_replace("\n","
",$ruta->getMextra21()),""), 'TAG_Mextra22'=>array (1,str_replace("\n","
",$ruta->getMextra22()),""), 'TAG_Mextra23'=>array (1,str_replace("\n","
",$ruta->getMextra23()),""), 'TAG_Mextra24'=>array (1,str_replace("\n","
",$ruta->getMextra24()),"") ); while (list($key,$value)=each($error)){ $plantilla=str_replace($key."_CHECKED".$value[1],"checked=\"checked\"",$plantilla); $plantilla=str_replace($key."_VALUE",$value[1],$plantilla); if (!$value[0]) $plantilla=str_replace($key,"error",$plantilla); else $plantilla=str_replace($key,"ok",$plantilla); } // no mostrar los campos opcionales vacíos // solo mostrar los ficheros opcionales si existen $Tmap_es = strtolower($ruta->getTmap_es()); if ($Tmap_es == "") $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); elseif ($Tmap_es == "jpg" || $Tmap_es == "gif") $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); else $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); $Tmap_eu = strtolower($ruta->getTmap_eu()); if ($Tmap_eu == "") $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); elseif ($Tmap_eu == "jpg" || $Tmap_eu == "gif") $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); else $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); $Tmap_en = strtolower($ruta->getTmap_en()); if ($Tmap_en == "") $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); elseif ($Tmap_en == "jpg" || $Tmap_en == "gif") $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); else $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); $Tmap_fr = strtolower($ruta->getTmap_fr()); if ($Tmap_fr == "") $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); elseif ($Tmap_fr == "jpg" || $Tmap_fr == "gif") $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); else $plantilla = preg_replace("/([\s\S]*)/","", $plantilla); //obtenemos los museos $plantillaFilaGenericaMuseo=leerFichero(RAIZ."/plantillas/fila_museo_comarca.htm"); //obtenemos los museos $arrayMuseoRuta=$tabla_museoruta->obtenerArray("",$ruta->getNruta()); $plantillaFilaCompletaMuseo=""; for($i=0;$iexiste($arrayMuseoRuta[$i]))$museo=$tabla_museo->obtener($arrayMuseoRuta[$i]); $plantillaFilaMuseo=str_replace(TAG_Nmuseo_VALUE,$museo->getNmuseo(),$plantillaFilaMuseo); $plantillaFilaMuseo=str_replace(TAG_Tmuse_es_VALUE,$museo->getTmuse_es(),$plantillaFilaMuseo); $plantillaFilaMuseo=str_replace(TAG_Tmuse_eu_VALUE,$museo->getTmuse_eu(),$plantillaFilaMuseo); $plantillaFilaMuseo=str_replace(TAG_Tmuse_en_VALUE,$museo->getTmuse_en(),$plantillaFilaMuseo); $plantillaFilaMuseo=str_replace(TAG_Tmuse_fr_VALUE,$museo->getTmuse_fr(),$plantillaFilaMuseo); $plantillaFilaMuseo=str_replace(TAG_Tlocalid_VALUE,$museo->getTlocalid(),$plantillaFilaMuseo); $plantillaFilaCompletaMuseo.=$plantillaFilaMuseo; } $plantilla = preg_replace("/([\s\S]*)/",$plantillaFilaCompletaMuseo, $plantilla); //para las fotos $plantillaFilaCompleta=""; $plantillaFilaGenerica=leerFichero(RAIZ."/plantillas/rutas/fila_foto.htm"); $lista_fotos=$tabla_foto->obtenerListaFotos("","","","",$Nruta); for($i=0;$i<$lista_fotos->getUltimo();$i++){ $plantillaFila=$plantillaFilaGenerica; $foto=$lista_fotos->siguiente(); $plantillaFila=str_replace("TAG_Tfoto_VALUE",$foto->getTfoto(),$plantillaFila); $plantillaFila=str_replace("TAG_Nfoto_VALUE",$foto->getNfoto(),$plantillaFila); $plantillaFila=str_replace("TAG_Tdes_es_VALUE",$foto->getTdes_es(),$plantillaFila); $plantillaFila=str_replace("TAG_Tdes_eu_VALUE",$foto->getTdes_eu(),$plantillaFila); $plantillaFila=str_replace("TAG_Tdes_en_VALUE",$foto->getTdes_en(),$plantillaFila); $plantillaFila=str_replace("TAG_Tdes_fr_VALUE",$foto->getTdes_fr(),$plantillaFila); $plantillaFilaCompleta.=$plantillaFila; } $plantilla = preg_replace("/([\s\S]*)/",$plantillaFilaCompleta,$plantilla); $plantilla = str_replace("TAG_DESDE",$desde, $plantilla); $plantilla = str_replace("TAG_ORDEN",$orden, $plantilla); $plantilla = str_replace("TAG_SENTIDO",$sentido, $plantilla); $plantilla = str_replace("TAG_MENSAJE","", $plantilla); $dataBase->desconectar(); echo($plantilla); ?>