コード例 #1
0
 public static function generateIDH_componente($block_componente)
 {
     if (TextBuilder_ES::$print) {
         $block_componente->setData("quebra", "<div style='page-break-after: always'></div>");
     } else {
         $block_componente->setData("quebra", "");
     }
     $block_componente->setData("fonte", TextBuilder_ES::$fontePerfil);
     $block_componente->setData("titulo", "IDHM");
     //@Translate
     $block_componente->setData("subtitulo", "Componentes");
     //@Translate
     $block_componente->setData("canvasContent", getChartDesenvolvimentoHumano(TextBuilder_ES::$idMunicipio, TextBuilder_ES::$lang));
     $block_componente->setData("info", "");
     $idhm = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "IDHM");
     //IDHM
     $idhm_r = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "IDHM_R");
     //IDHM_R
     $idhm_l = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "IDHM_L");
     //IDHM_L
     $idhm_e = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "IDHM_E");
     //IDHM_E
     //@Translate
     $str = "El Índice de Desarrollo Humano Municipal (IDHM) de [municipio] es de [idh] para [2010].\n            El municipio tiene un nivel de desarrollo humano [Faixa_DH].            \n            Entre el 2000 y 2010, el factor que más se incrementó en términos absolutos fue [Dimensao2000a2010].                        \n            Entre 1991 y el 2000, el factor que más se incrementó en términos absolutos fue [Dimensao1991a2000].\n            ";
     $texto = new Texto($str);
     $texto->replaceTags("2010", Formulas::getLabelAno2010($idhm));
     $texto->replaceTags("municipio", TextBuilder_ES::$nomeMunicipio);
     $texto->replaceTags("idh", Formulas::getIDH2010($idhm));
     $texto->replaceTags("Faixa_DH", Formulas::getSituacaoIDH($idhm, TextBuilder_ES::$lang));
     $texto->replaceTags("Dimensao2000a2010", Formulas::getDimensao(TextBuilder_ES::$lang, $idhm_r, $idhm_l, $idhm_e, array("faixa0010" => true, "faixa9100" => false)));
     $texto->replaceTags("Dimensao1991a2000", Formulas::getDimensao(TextBuilder_ES::$lang, $idhm_r, $idhm_l, $idhm_e, array("faixa0010" => false, "faixa9100" => true)));
     $block_componente->setData("text", $texto->getTexto());
 }
コード例 #2
0
 public static function generateIDH_componente($block_componente)
 {
     if (TextBuilder_EN::$print) {
         $block_componente->setData("quebra", "<div style='page-break-after: always'></div>");
     } else {
         $block_componente->setData("quebra", "");
     }
     $block_componente->setData("fonte", TextBuilder_EN::$fontePerfil);
     $block_componente->setTi("titulo", "MHDI");
     //@Translate
     $block_componente->setData("subtitulo", "Components");
     //@Translate
     $block_componente->setData("canvasContent", getChartDesenvolvimentoHumano(TextBuilder_EN::$idMunicipio, TextBuilder_EN::$lang));
     $block_componente->setData("info", "");
     $idhm = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "IDHM");
     //IDHM
     $idhm_r = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "IDHM_R");
     //IDHM_R
     $idhm_l = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "IDHM_L");
     //IDHM_L
     $idhm_e = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "IDHM_E");
     //IDHM_E
     //@Translate
     $str = "The Municipal Human Development Index (MHDI) of [municipio] is [idh] in [2010].\n            The municipality is located in category [Faixa_DH] Human Development.            \n            Between 2000 and 2010, the dimension that grew the most in absolute terms was [Dimensao2000a2010].                        \n            Between 1991 and 2000, the dimension that grew the most in absolute terms was [Dimensao1991a2000].\n            ";
     $texto = new Texto($str);
     $texto->replaceTags("2010", Formulas::getLabelAno2010($idhm));
     $texto->replaceTags("municipio", TextBuilder_EN::$nomeMunicipio);
     $texto->replaceTags("idh", Formulas::getIDH2010($idhm));
     $texto->replaceTags("Faixa_DH", Formulas::getSituacaoIDH($idhm, TextBuilder_EN::$lang));
     $texto->replaceTags("Dimensao2000a2010", Formulas::getDimensao(TextBuilder_EN::$lang, $idhm_r, $idhm_l, $idhm_e, array("faixa0010" => true, "faixa9100" => false)));
     $texto->replaceTags("Dimensao1991a2000", Formulas::getDimensao(TextBuilder_EN::$lang, $idhm_r, $idhm_l, $idhm_e, array("faixa0010" => false, "faixa9100" => true)));
     $block_componente->setData("text", $texto->getTexto());
 }
コード例 #3
0
 public static function generateIDH_componente($block_componente)
 {
     if (TextBuilder::$print) {
         $block_componente->setData("quebra", "<div style='page-break-after: always;'></div>");
     } else {
         $block_componente->setData("quebra", "");
     }
     $block_componente->setData("fonte", TextBuilder::$fontePerfil);
     $block_componente->setData("titulo", TextBuilder::$aba->getTitulo());
     //@Translate
     $block_componente->setData("subtitulo", TextBuilder::$aba->getSubTitulo());
     //@Translate
     $block_componente->setData("canvasContent", TextBuilder::$aba->getChartDesenvolvimentoHumano(TextBuilder::$idMunicipio));
     $block_componente->setData("info", "");
     $idhm = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "IDHM");
     //IDHM
     $idhm_r = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "IDHM_R");
     //IDHM_R
     $idhm_l = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "IDHM_L");
     //IDHM_L
     $idhm_e = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "IDHM_E");
     //IDHM_E
     //@Translate
     $str = TextBuilder::$aba->getTexto();
     $texto = new Texto($str);
     $texto->replaceTags("2010", Formulas::getLabelAno2010($idhm));
     $texto->replaceTags("municipio", TextBuilder::$nomeMunicipio);
     $mDaUdh = TextBuilder::getMUN_udh(TextBuilder::$idMunicipio);
     if (isset($mDaUdh[0]) && count($mDaUdh[0]) > 0) {
         $mDaUdh_nome = $mDaUdh[0]["nome"];
     } else {
         $mDaUdh_nome = '';
     }
     $texto->replaceTags("municipio_udh", $mDaUdh_nome);
     $rmDaUdh = TextBuilder::getRM_udh(TextBuilder::$idMunicipio);
     if (empty($rmDaUdh[0]["nome"])) {
         $texto->replaceTags("rm", $mDaUdh_nome);
     } else {
         $texto->replaceTags("rm", $rmDaUdh[0]["nome"]);
     }
     $texto->replaceTags("idh", Formulas::getIDH2010($idhm));
     $texto->replaceTags("Faixa_DH", Formulas::getSituacaoIDH($idhm, TextBuilder::$lang));
     $texto->replaceTags("Dimensao2010", Formulas::getDimensao2010(TextBuilder::$lang, $idhm_r, $idhm_l, $idhm_e));
     //$texto->replaceTags("Dimensao2000a2010", Formulas::getDimensao(TextBuilder::$lang, $idhm_r, $idhm_l, $idhm_e, array("faixa0010" => true, "faixa9100" => false)));
     //$texto->replaceTags("Dimensao1991a2000", Formulas::getDimensao(TextBuilder::$lang, $idhm_r, $idhm_l, $idhm_e, array("faixa0010" => false, "faixa9100" => true)));
     //Novo trecho criado para apresentação inicial de RMs e UDHs ---------------------
     if (TextBuilder::$type == "perfil_rm" || TextBuilder::$type == "perfil_udh") {
         $strShow = TextBuilder::$aba->getTextoShow();
         $textoShow = new Texto($strShow);
         if (TextBuilder::$type == "perfil_udh") {
             $rmDaUdh = TextBuilder::getRM_udh(TextBuilder::$idMunicipio);
             $textoShow->replaceTags("nome_rm", $rmDaUdh[0]["nome"]);
             $municipios = TextBuilder::getMunicipios_rm($rmDaUdh[0]["id"]);
         } else {
             $municipios = TextBuilder::getMunicipios_rm(TextBuilder::$idMunicipio);
         }
         //URL - Busca ------------
         $server = $_SERVER['SERVER_NAME'];
         $endereco = $_SERVER['REQUEST_URI'];
         $pieces = explode("/", $endereco);
         $urlAtual = "http://" . $server . "/" . $pieces[1] . "/" . TextBuilder::$lang . "/perfil_m/";
         //-----------------------------
         $textMunicipios = "";
         foreach ($municipios as &$value) {
             // if ($value["id"] == TextBuilder::$idMunicipio)
             $textMunicipios .= "<a href='" . $urlAtual . $value["id"] . "' target='blank'>" . $value["nome"] . " (" . $value["uf"] . ")" . "</a>, ";
         }
         $textoShow->replaceTags("municipios", $textMunicipios);
         $textoShow->replaceTags("esp_count", sizeof($municipios));
         $textoShow->replaceTags("esp", TextBuilder::$nomeMunicipio);
         $block_componente->setData("text_show", $textoShow->getTexto());
     } else {
         $block_componente->setData("text_show", "");
     }
     //----------------------------------------------------------------
     $block_componente->setData("text", $texto->getTexto());
 }