conectar(); // instanciar los 0bjetos $tabla_pregunta=new Tabla_Pregunta($dataBase->getEnlaceHost()); $pregunta=new Pregunta(); $tabla_empresa=new Tabla_Empresa($dataBase->getEnlaceHost()); $empresa=new Empresa(); $tabla_usuario=new Tabla_Usuario($dataBase->getEnlaceHost()); $usuario=new Usuario(); $tabla_tecnologia=new Tabla_Tecnologia($dataBase->getEnlaceHost()); $tecnologia=new Tecnologia(); $tabla_subtecnologia=new Tabla_Subtecnologia($dataBase->getEnlaceHost()); $subtecnologia=new Subtecnologia(); $tabla_pregunta_tecnologia=new Tabla_Pregunta_tecnologia($dataBase->getEnlaceHost()); $pregunta_tecnologia=new Pregunta_tecnologia(); $tabla_sector=new Tabla_Sector($dataBase->getEnlaceHost()); $sector=new Sector(); $tabla_subsector=new Tabla_Subsector($dataBase->getEnlaceHost()); $subsector=new Subsector(); $tabla_pregunta_sector=new Tabla_Pregunta_sector($dataBase->getEnlaceHost()); $pregunta_sector=new Pregunta_sector(); $tabla_seccion=new Tabla_Seccion($dataBase->getEnlaceHost()); $seccion=new Seccion(); $tabla_subseccion=new Tabla_Subseccion($dataBase->getEnlaceHost()); $subseccion=new Subseccion(); // comprobar que existe if ($tabla_pregunta -> existe($pg)) $pregunta=$tabla_pregunta->obtener($pg); else $pregunta=$tabla_pregunta->obtenerPrimero(); // leer las plantillas que forman la pagina $plantillas = array("plantillas/preguntas/ver.htm","plantillas/cabecera.htm","plantillas/lateral.htm","plantillas/pie.htm"); $plantilla = plantillas($dataBase,$id,$plantillas,$se,$su); // empresa if ($tabla_empresa->existe($pregunta->getNempresa())) { $empresa = $tabla_empresa->obtener($pregunta->getNempresa()); $plantilla=str_replace(TAG_Nempresa_VALUE,$empresa->getTempresa(),$plantilla); } $plantilla=str_replace(TAG_Nempresa_VALUE,"",$plantilla); // usuario if ($tabla_usuario->existe($pregunta->getNusuario())) { $usuario = $tabla_usuario->obtener($pregunta->getNusuario()); $plantilla=str_replace(TAG_Nusuario_VALUE,$usuario->getTnombre(),$plantilla); } $plantilla=str_replace(TAG_Nusuario_VALUE,"",$plantilla); // experto if ($tabla_usuario->existe($pregunta->getNexperto())) { $usuario = $tabla_usuario->obtener($pregunta->getNexperto()); $plantilla=str_replace(TAG_txtNexperto_VALUE,$usuario->getTnombre()." ".$usuario->getTapellid(),$plantilla); } $plantilla=str_replace(TAG_txtNexperto_VALUE,"Izaro",$plantilla); /* // pregunta_tecnologias $lista_pregunta_tecnologias=$tabla_pregunta_tecnologia->obtenerListaPregunta($pregunta->getNpregunt()); $indice_tecnologias=0; $textoUsuario_tecnologia=""; $cuantos_tecnologias=$lista_pregunta_tecnologias->getUltimo(); while ($indice_tecnologias<$cuantos_tecnologias){ $pregunta_tecnologia=$lista_pregunta_tecnologias->siguiente(); // tecnologia if ($tabla_tecnologia->existe($pregunta_tecnologia->getNtecnolo())) { $tecnologia = $tabla_tecnologia->obtener($pregunta_tecnologia->getNtecnolo()); $textoUsuario_tecnologia .= $tecnologia->getTtecn_es(); } // subtecnologia if ($tabla_subtecnologia->existe($pregunta_tecnologia->getNsubtecn())) { $subtecnologia = $tabla_subtecnologia->obtener($pregunta_tecnologia->getNsubtecn()); $textoUsuario_tecnologia .= " - ".$subtecnologia->getTsubt_es(); } $textoUsuario_tecnologia .= "
"; $indice_tecnologias++; } $plantilla=str_replace(TAG_Ntecnolo_VALUE,$textoUsuario_tecnologia,$plantilla); // pregunta_sectores $lista_pregunta_sectores=$tabla_pregunta_sector->obtenerListaPregunta($pregunta->getNpregunt()); $indice_sectores=0; $textoUsuario_sector=""; $cuantos_sectores=$lista_pregunta_sectores->getUltimo(); while ($indice_sectores<$cuantos_sectores){ $pregunta_sector=$lista_pregunta_sectores->siguiente(); // sector if ($tabla_sector->existe($pregunta_sector->getNsector())) { $sector = $tabla_sector->obtener($pregunta_sector->getNsector()); $textoUsuario_sector .= $sector->getTsect_es(); } // subsector if ($tabla_subsector->existe($pregunta_sector->getNsubsect())) { $subsector = $tabla_subsector->obtener($pregunta_sector->getNsubsect()); $textoUsuario_sector .= " - ".$subsector->getTsubs_es(); } $textoUsuario_sector .= "
"; $indice_sectores++; } $plantilla=str_replace(TAG_Nsector_VALUE,$textoUsuario_sector,$plantilla); */ // decodificar Subsector $Nsubsect = $pregunta->getNsubsect(); $txtNsubsect = "No"; if ($Nsubsect == 1) $txtNsubsect = "Sí"; // decodificar Pregunta sector $Npresect = $pregunta->getNpresect(); $txtNpresect = "No"; if ($Npresect == 1) $txtNpresect = "Sí"; // decodificar Estado $Nestado = $pregunta->getNestado(); $txtNestado = "No"; if ($Nestado == 1) $txtNestado = "Sí"; // decodificar Publicar $Nactivo = $pregunta->getNactivo(); $txtNactivo = "No"; if ($Nactivo == 1) $txtNactivo = "Sí"; // decodificar Portada $Nportada = $pregunta->getNportada(); $txtNportada = "No"; if ($Nportada == 1) $txtNportada = "Sí"; // decodificar Extra21 $Nextra21 = $pregunta->getNextra21(); $txtNextra21 = "No"; if ($Nextra21 == 1) $txtNextra21 = "Sí"; // decodificar Extra22 $Nextra22 = $pregunta->getNextra22(); $txtNextra22 = "No"; if ($Nextra22 == 1) $txtNextra22 = "Sí"; // decodificar Extra23 $Nextra23 = $pregunta->getNextra23(); $txtNextra23 = "No"; if ($Nextra23 == 1) $txtNextra23 = "Sí"; // decodificar Extra24 $Nextra24 = $pregunta->getNextra24(); $txtNextra24 = "No"; if ($Nextra24 == 1) $txtNextra24 = "Sí"; // decodificar Extra25 $Nextra25 = $pregunta->getNextra25(); $txtNextra25 = "No"; if ($Nextra25 == 1) $txtNextra25 = "Sí"; // decodificar Extra26 $Nextra26 = $pregunta->getNextra26(); $txtNextra26 = "No"; if ($Nextra26 == 1) $txtNextra26 = "Sí"; // decodificar Extra27 $Nextra27 = $pregunta->getNextra27(); $txtNextra27 = "No"; if ($Nextra27 == 1) $txtNextra27 = "Sí"; // decodificar Extra28 $Nextra28 = $pregunta->getNextra28(); $txtNextra28 = "No"; if ($Nextra28 == 1) $txtNextra28 = "Sí"; // decodificar Extra29 $Nextra29 = $pregunta->getNextra29(); $txtNextra29 = "No"; if ($Nextra29 == 1) $txtNextra29 = "Sí"; // decodificar Extra30 $Nextra30 = $pregunta->getNextra30(); $txtNextra30 = "No"; if ($Nextra30 == 1) $txtNextra30 = "Sí"; $error=array('TAG_Npregunt'=>array (1,$pregunta->getNpregunt(),""), 'TAG_Nempresa'=>array (1,$pregunta->getNempresa(),""), 'TAG_Nusuario'=>array (1,$pregunta->getNusuario(),""), 'TAG_Mpreg_es'=>array (1,$pregunta->getMpreg_es(),""), 'TAG_Mpreg_eu'=>array (1,$pregunta->getMpreg_eu(),""), 'TAG_Mresp_es'=>array (1,$pregunta->getMresp_es(),""), 'TAG_Mresp_eu'=>array (1,$pregunta->getMresp_eu(),""), 'TAG_Ntecnolo'=>array (1,$pregunta->getNtecnolo(),""), 'TAG_Nsubtecn'=>array (1,$pregunta->getNsubtecn(),""), 'TAG_Npretecn'=>array (1,$pregunta->getNpretecn(),""), 'TAG_Nsector'=>array (1,$pregunta->getNsector(),""), 'TAG_Nsubsect'=>array (1,$txtNsubsect,""), 'TAG_Npresect'=>array (1,$txtNpresect,""), 'TAG_Nestado'=>array (1,$txtNestado,""), 'TAG_Nactivo'=>array (1,$txtNactivo,""), 'TAG_Nportada'=>array (1,$txtNportada,""), 'TAG_Ndestaca'=>array (1,$pregunta->getNdestaca(),""), 'TAG_Norden'=>array (1,$pregunta->getNorden(),""), 'TAG_Falta'=>array (1,$pregunta->getFalta(),""), 'TAG_Fmodific'=>array (1,formatearFecha($pregunta->getFmodific()),""), 'TAG_Nexperto'=>array (1,$pregunta->getNexperto(),""), 'TAG_Textra02'=>array (1,$pregunta->getTextra02(),""), 'TAG_Textra03'=>array (1,$pregunta->getTextra03(),""), 'TAG_Textra04'=>array (1,$pregunta->getTextra04(),""), 'TAG_Textra05'=>array (1,$pregunta->getTextra05(),""), 'TAG_Textra06'=>array (1,$pregunta->getTextra06(),""), 'TAG_Textra07'=>array (1,$pregunta->getTextra07(),""), 'TAG_Textra08'=>array (1,$pregunta->getTextra08(),""), 'TAG_Textra09'=>array (1,$pregunta->getTextra09(),""), 'TAG_Textra10'=>array (1,$pregunta->getTextra10(),""), 'TAG_Textra11'=>array (1,$pregunta->getTextra11(),""), 'TAG_Textra12'=>array (1,$pregunta->getTextra12(),""), 'TAG_Textra13'=>array (1,$pregunta->getTextra13(),""), 'TAG_Textra14'=>array (1,$pregunta->getTextra14(),""), 'TAG_Textra15'=>array (1,$pregunta->getTextra15(),""), 'TAG_Textra16'=>array (1,$pregunta->getTextra16(),""), 'TAG_Textra17'=>array (1,$pregunta->getTextra17(),""), 'TAG_Textra18'=>array (1,$pregunta->getTextra18(),""), 'TAG_Textra19'=>array (1,$pregunta->getTextra19(),""), 'TAG_Textra20'=>array (1,$pregunta->getTextra20(),""), 'TAG_Nextra21'=>array (1,$txtNextra21,""), 'TAG_Nextra22'=>array (1,$txtNextra22,""), 'TAG_Nextra23'=>array (1,$txtNextra23,""), 'TAG_Nextra24'=>array (1,$txtNextra24,""), 'TAG_Nextra25'=>array (1,$txtNextra25,""), 'TAG_Nextra26'=>array (1,$txtNextra26,""), 'TAG_Nextra27'=>array (1,$txtNextra27,""), 'TAG_Nextra28'=>array (1,$txtNextra28,""), 'TAG_Nextra29'=>array (1,$txtNextra29,""), 'TAG_Nextra30'=>array (1,$txtNextra30,""), 'TAG_Mextra31'=>array (1,str_replace("\n","
",$pregunta->getMextra31()),""), 'TAG_Mextra32'=>array (1,str_replace("\n","
",$pregunta->getMextra32()),""), 'TAG_Mextra33'=>array (1,str_replace("\n","
",$pregunta->getMextra33()),""), 'TAG_Mextra34'=>array (1,str_replace("\n","
",$pregunta->getMextra34()),""), 'TAG_Mextra35'=>array (1,str_replace("\n","
",$pregunta->getMextra35()),""), 'TAG_Mextra36'=>array (1,str_replace("\n","
",$pregunta->getMextra36()),""), 'TAG_Mextra37'=>array (1,str_replace("\n","
",$pregunta->getMextra37()),""), 'TAG_Mextra38'=>array (1,str_replace("\n","
",$pregunta->getMextra38()),""), 'TAG_Mextra39'=>array (1,str_replace("\n","
",$pregunta->getMextra39()),""), 'TAG_Mextra40'=>array (1,str_replace("\n","
",$pregunta->getMextra40()),"") ); 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); } // seccion if ($tabla_seccion->existe($se)) { $seccion = $tabla_seccion->obtener($se); $plantilla=str_replace(TAG_Nseccion_VALUE,$seccion->getNseccion(),$plantilla); $plantilla=str_replace(TAG_Tsecc_es_VALUE,$seccion->getTsecc_es(),$plantilla); $plantilla=str_replace(TAG_Tsecc_eu_VALUE,$seccion->getTsecc_eu(),$plantilla); } $plantilla=str_replace(TAG_Nseccion_VALUE,"",$plantilla); $plantilla=str_replace(TAG_Tsecc_es_VALUE,"",$plantilla); $plantilla=str_replace(TAG_Tsecc_eu_VALUE,"",$plantilla); // subseccion if ($tabla_subseccion->existe($su)) { $subseccion = $tabla_subseccion->obtener($su); $plantilla=str_replace(TAG_Nsubsecc_VALUE,$subseccion->getNsubsecc(),$plantilla); $plantilla=str_replace(TAG_Tsubs_es_VALUE,$subseccion->getTsubs_es(),$plantilla); $plantilla=str_replace(TAG_Tsubs_eu_VALUE,$subseccion->getTsubs_eu(),$plantilla); } $plantilla=str_replace(TAG_Nsubsecc_VALUE,"",$plantilla); $plantilla=str_replace(TAG_Tsubs_es_VALUE,"",$plantilla); $plantilla=str_replace(TAG_Tsubs_eu_VALUE,"",$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(mostrarPlantilla($plantilla)); ?>