- Timestamp:
- 06/04/12 16:59:18 (12 years ago)
- Location:
- trunk/workflow/inc/report/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workflow/inc/report/includes/classes/Listagem.class.php
r5307 r6413 22 22 23 23 class Listagem { 24 24 25 25 /** 26 26 * Identificador da Listagem. 27 27 */ 28 28 private $idlistagem; 29 29 30 30 /** 31 31 * Tï¿œtulo da Listagem 32 32 */ 33 33 private $titulo; 34 34 35 35 /** 36 36 * Array de Colunas. 37 37 */ 38 38 private $colunas = array(); 39 39 40 40 /** 41 41 * Array de Linhas de Detalhamento. 42 42 */ 43 43 private $linhasdetalhamento = array(); 44 44 45 45 /** 46 46 * Array de Linhas Agrupadas 47 47 */ 48 48 private $linhasagrupamento = array(); 49 49 50 50 /** 51 51 * Array de Dados. 52 52 */ 53 53 private $dados = array(); 54 54 55 55 /** 56 56 * Exibe Header das Tables. (Tï¿œtulos das Colunas). 57 57 */ 58 58 private $showthead = true; 59 59 60 60 /** 61 61 * Array de Totalizadores. 62 62 */ 63 63 private $totalizadores = array(); 64 64 65 65 /** 66 66 * Alterado para Protegido nï¿œo serï¿œ instanciado na classe. 67 67 */ 68 68 //protected $form = Formulario; 69 69 70 70 /** 71 71 * Formulï¿œrio de Pesquisa. 72 72 */ 73 73 //protected $formpesquisa = Formulario; 74 74 75 75 /** 76 76 * Agrupar Resultados Alfabeticamente (True ou False) … … 82 82 */ 83 83 private $arrindicadores = array(); 84 84 85 85 /** 86 86 * Array de Parï¿œmetros 87 87 */ 88 88 private $arrparametros = array(); 89 89 90 90 /** 91 91 * Array de Agrupamentos 92 92 */ 93 93 private $arragrupamentos = array(); 94 94 95 95 /** 96 96 * SubListagem. 97 97 */ 98 98 public $subListagem; 99 99 100 100 /** 101 101 * Indica se este objeto ï¿œ uma SubListagem. 102 102 */ 103 103 private $issublist = false; 104 104 105 105 /** 106 106 * Conexao com o Banco de Dados. 107 107 */ 108 108 private $conexao; 109 109 110 110 /** 111 111 * SQL da Listagem. 112 112 */ 113 113 private $sql; 114 114 115 115 /** 116 116 * Exibir SubTotalizadores 117 117 */ 118 118 private $exibesubtotais = false; 119 119 120 120 private $exibedivcolunas = true; 121 121 122 122 /** 123 123 * Exibir Totalizadores 124 124 */ 125 125 private $_exibetotalizadores = true; 126 126 127 127 /** 128 128 * Exibir Quantidade de Registros Encontrados 129 129 */ 130 130 private $_exibeqtdregistros = true; 131 131 132 132 /** 133 133 * Modo DEBUG 134 134 */ 135 135 private $_debug = true; 136 136 137 137 /** 138 138 * Array de Erros 139 139 */ 140 140 private $_errors = array(); 141 141 142 142 /** 143 143 * Indica se a Listagem Possui algum checkbox 144 144 */ 145 145 private $temcheck = false; 146 147 /** 148 * Repetir Tï¿œtulo do Agrupamento. 146 147 /** 148 * Repetir Tï¿œtulo do Agrupamento. 149 149 */ 150 150 private $_repetirtituloagrupamento = true; 151 151 152 152 /** 153 153 * Quantidade de Registros da Listagem Principal (Usada somente quando a listagem ï¿œ uma sublistagem.) 154 154 */ 155 155 private $_qtdregistroslistagemprincipal = 0; 156 156 157 157 /** 158 158 * Gerar Arquivo CSV. 159 159 */ 160 160 private $_temarquivocsv = false; 161 162 161 162 163 163 /** 164 164 * Exibir Resultados na tela. (Usado quando somente serï¿œ exibido os resultados em CSV). 165 165 */ 166 166 private $_exiberesultados = true; 167 167 168 168 /** 169 169 * Gerar Automaticamente Arquivo CSV. 170 170 */ 171 171 private $_exibearquivocsv = false; 172 172 173 173 /** 174 174 * Colunas Arquivo CSV. 175 175 */ 176 176 private $_colunasarquivo = array(); 177 177 178 178 /** 179 179 * Texto do Arquivo CSV. 180 180 */ 181 181 private $_txtarquivocsv = ""; 182 183 182 183 184 184 /** 185 185 * Array de Totalizadores. 186 186 */ 187 187 private $arrtotais = array(); 188 188 189 189 /** 190 190 * Array de SubTotalizadores 191 191 */ 192 192 private $arrsubtotais = array(); 193 194 193 194 195 195 /** 196 196 * Mesagem: Nenhum Resultado Encontrado. 197 197 */ 198 198 public $msgnenhumresultado = "Nenhum resultado encontrado."; 199 199 200 200 /** 201 201 * Mensagem: registro(s) encontrado(s) 202 202 */ 203 203 public $msgregistros = "registro(s) encontrado(s)."; 204 204 205 205 /** 206 206 * Mensagem: TOTAL: 207 207 */ 208 208 public $msgtotalizador = "TOTAL:"; 209 209 210 210 /** 211 211 * Mensagem: SUB-TOTAL; 212 212 */ 213 213 public $msgsubtotalizador = "SUB-TOTAL:"; 214 214 215 215 private $_mostraLegendaTopo = true; 216 216 217 217 private $_mostraLegendaRodape = false; 218 218 219 219 private $_exibelinhasvazias = true; 220 220 221 221 private $_colunascsv; 222 222 223 223 private $_isarray = false; 224 224 225 225 private $_totalizadorprecisao = 2; 226 226 227 227 /* 228 228 * ID da Listagem. que foi carregado. 229 229 */ 230 230 private $_lstoid = ""; 231 231 232 232 private $_url_base_path; 233 233 234 234 private $_tmp_file_path = "/tmp/"; 235 236 235 236 237 237 /** 238 238 * Construᅵᅵo da Classe. 239 * 239 * 240 240 * @idlistagem Identificador da Listagem. 241 241 * @titulo Tï¿œtulo da Listagem. … … 250 250 $this->subListagem = new Listagem($novoidlistagem,"",$conexao,true); 251 251 $this->subListagem->setMostrarQuantidadeRegistros(false); 252 $this->subListagem->setIdListagem($novoidlistagem); 252 $this->subListagem->setIdListagem($novoidlistagem); 253 253 } 254 254 $this->setSubListagem($subListagem); 255 255 $this->setConexao($conexao); 256 256 } 257 257 258 258 /** 259 259 * Indica se a Listagem ï¿œ uma SubListagem. 260 * 260 * 261 261 * @param $value (true,false) 262 262 */ … … 264 264 $this->issublist = $value; 265 265 } 266 266 267 267 public function setTotalizadorPrecisao($value) { 268 268 $this->_totalizadorprecisao = $value; 269 269 } 270 270 271 271 /** 272 272 * Identificador da Listagem. 273 * 273 * 274 274 * @param $value (true,false) 275 275 */ … … 277 277 $this->idlistagem = $value; 278 278 } 279 279 280 280 public function setExibirOpcoesDeColunas($value) { 281 281 $this->exibedivcolunas = $value; 282 282 } 283 283 284 284 /** 285 285 * Retorna o Identificador da Listagem. … … 288 288 return $this->idlistagem; 289 289 } 290 290 291 291 public function setUrlBasePath($base_path) { 292 292 $this->_url_base_path = $base_path; … … 295 295 /** 296 296 * Funᅵᅵo Interna para Alterar a Varï¿œavel de Conexï¿œo com o Banco de Dados. 297 * 297 * 298 298 * @param $conexao 299 299 * @return unknown_type 300 300 */ 301 301 protected function setConexao($conexao) { $this->conexao = $conexao; } 302 302 303 303 /** 304 304 * Funᅵᅵo Interna para Alterar O SQL que serï¿œ executado na listagem. 305 * 305 * 306 306 * @param $sql 307 307 * @return unknown_type 308 308 */ 309 309 protected function setSQL($sql) { $this->sql = $sql; } 310 310 311 311 /** 312 312 * Funᅵᅵo Interna para Recuperar o SQL que serï¿œ executado na listagem. 313 * 313 * 314 314 * @return unknown_type 315 315 */ 316 316 public function getSQL() { return $this->sql; } 317 317 318 318 /** 319 319 * Funᅵᅵo para Alterar o Tï¿œtulo da Listagem. 320 * 320 * 321 321 * @param $titulo 322 322 * @return unknown_type 323 323 */ 324 324 public function setTitulo($titulo) { $this->titulo = $titulo; } 325 325 326 326 /** 327 327 * Funᅵᅵo para Alterar a forma de Exibiᅵᅵo da Listagem 328 * 328 * 329 329 * @param $exiberesultados 330 330 * @return unknown_type 331 331 */ 332 332 public function setExibirResultadosTela($exiberesultados) { $this->_exiberesultados = $exiberesultados; } 333 333 334 334 /** 335 335 * Funᅵᅵo para Alterar a exibiᅵᅵo de linhas que nï¿œo exibem nenhum resultado, (linhas vazias) 336 * 336 * 337 337 * @param $exiberesultados 338 338 * @return unknown_type … … 342 342 /** 343 343 * Funᅵᅵo para Alterar o Resultado da SQL executada. 344 * 344 * 345 345 * @param $dados 346 346 * @return unknown_type 347 347 */ 348 348 public function setDados($dados) { 349 $this->dados = &$dados; 349 $this->dados = &$dados; 350 350 if (is_resource($this->dados)) { 351 351 $this->_isarray = false; … … 354 354 } 355 355 } 356 357 356 357 358 358 /** 359 359 * Funᅵᅵo utilizada para Executar o SQL e Carregar os dados a serem listados. … … 364 364 $parser = new SqlParser($sql); 365 365 $ret_parser = $parser->verificaSql(); 366 366 367 367 if ($ret_parser === false) { 368 368 $msg = $parser->getErro(); 369 369 $this->adicionarErro($msg,true); 370 370 } 371 371 372 372 $ret_parser = $parser->verificaCondicoes(); 373 373 if ($ret_parser === false) { … … 376 376 } 377 377 $sql = $parser->getSql(); 378 378 379 379 try { 380 380 $this->setSQL($sql); … … 384 384 if (!$resu) { throw new Exception($this->sql); } 385 385 $this->setDados($resu); 386 386 387 387 return $resu; 388 388 389 389 } catch (exception $e) { 390 390 $msg = $e->getMessage(); 391 391 $this->adicionarErro("Erro ao Executar a consulta: $msg",true); 392 392 } 393 394 } 395 393 394 } 395 396 396 /** 397 397 * Funᅵᅵo utilizada para Executar o SQL e Carregar os dados a serem listados. … … 401 401 public function carregarIDListagem($idlistagem,$previsualizacao = false) { 402 402 403 $sql = "select 403 $sql = "select 404 404 lstoid, 405 405 lstversao, … … 427 427 lstexclusao, 428 428 lstexibe_resultados 429 from 430 listagem.listagem 429 from 430 listagem.listagem 431 431 where lstidlistagem = '$idlistagem'"; 432 432 $resu = pg_query($this->conexao,$sql); 433 433 434 434 $this->setIdListagem($idlistagem); 435 435 436 436 $arquivo = $_SERVER['PHP_SELF']; 437 437 438 438 if (stristr($arquivo,"cad_listagem.php")) { 439 439 $arquivo = "null"; … … 442 442 if (pg_num_rows($resu)) { 443 443 $dados = pg_fetch_object($resu); 444 444 445 445 $lstexclusao = $dados->lstexclusao; 446 446 447 447 if (($lstexclusao) && ($arquivo != "null")) { 448 448 $this->_debug = true; 449 449 $this->adicionarErro("Esta Consulta estï¿œ inativada, contate o suporte tï¿œcnico de sistemas.",true); 450 450 } 451 451 452 452 $lstoid = $dados->lstoid; 453 453 $this->_lstoid = $lstoid; 454 455 454 455 456 456 /* if ($arquivo != "null") { 457 457 $sql = "select lsdoid from listagem_dependencia where lsdlstoid = '$lstoid' and lsdarquivo ilike '%$arquivo%'"; 458 458 $res_dependencia = pg_query($this->conexao,$sql); 459 459 $qtd_dependencia = pg_num_rows($res_dependencia); 460 461 460 461 462 462 if ($qtd_dependencia == 0) { 463 463 $sql = "insert into listagem_dependencia (lsdlstoid,lsdarquivo,lsdacesso) values ($lstoid,'$arquivo',now())"; … … 471 471 } 472 472 */ 473 474 473 474 475 475 $sql = html_entity_decode( $dados->lstsql, ENT_QUOTES); 476 476 477 477 $this->sql = $sql; 478 478 479 479 // if ($previsualizacao) { $addsql = " limit 20"; } 480 480 481 $sql_par = "select 481 $sql_par = "select 482 482 lspoid, 483 483 lsplstoid, … … 485 485 lsptipo, 486 486 lspvalor_padrao, 487 lspobrigatorio 488 from 489 listagem.listagem_parametro 490 where 487 lspobrigatorio 488 from 489 listagem.listagem_parametro 490 where 491 491 lsplstoid = $lstoid "; 492 492 $resu_par = pg_query($this->conexao,$sql_par); 493 493 494 494 while ($parametro = pg_fetch_object($resu_par)) { 495 495 $idparametro = $parametro->lspidparametro; … … 499 499 $obrigatorio = $parametro->lspobrigatorio; 500 500 $valor_padrao = $parametro->lspvalor_padrao; 501 501 502 502 $this->adicionarParametro($idparametro,$tipo,$obrigatorio,$valor,$valor_padrao); 503 503 504 504 if ($previsualizacao) { 505 505 $this->setParametro($idparametro,$valor_padrao); 506 506 } 507 507 } 508 509 $sql_par = "select 508 509 $sql_par = "select 510 510 lsioid, 511 511 lsilstoid, … … 515 515 lsilegenda, 516 516 lsilegenda_csv, 517 lsicondicao 518 from 519 listagem.listagem_indicador 517 lsicondicao 518 from 519 listagem.listagem_indicador 520 520 where lsilstoid = $lstoid "; 521 521 $resu_par = pg_query($this->conexao,$sql_par); 522 522 523 523 while ($indicador = pg_fetch_object($resu_par)) { 524 524 $idindicador = $indicador->lsiidindicador; … … 528 528 $legenda_csv = html_entity_decode($indicador->lsilegenda_csv, ENT_QUOTES); 529 529 $legenda = html_entity_decode($indicador->lsilegenda, ENT_QUOTES); 530 531 532 if ($legenda_csv == "") { 530 531 532 if ($legenda_csv == "") { 533 533 $legenda_csv = $legenda; 534 534 } 535 535 $this->adicionarIndicador($idindicador,$condicao,$tipo,$imagem,$legenda,$legenda_csv); 536 536 } 537 538 539 $this->setTitulo($dados->lsttitulo); 537 538 539 $this->setTitulo($dados->lsttitulo); 540 540 $this->setMensagemTotalizador($dados->lstmsg_totalizador); 541 $this->setMensagemRegistrosEncontrados($dados->lstmsg_registrosencontrados); 541 $this->setMensagemRegistrosEncontrados($dados->lstmsg_registrosencontrados); 542 542 $this->setMensagemSubTotalizador($dados->lstmsg_subtotalizador); 543 543 $this->setMensagemNenhumResultado($dados->lstmsg_nenhumresultado); 544 544 545 545 if ($dados->lstagrupamento_campo != "") { 546 546 if ($dados->lstagrupamento_titulo == "") { … … 554 554 $lstexibe_titagrupamento = false; 555 555 } 556 557 556 557 558 558 if ($dados->lstexibe_agrupamento_alfabetico == "t") { 559 559 $lstexibe_agrupamento_alfabetico = true; … … 564 564 $this->setAgruparAlfabeticamente($lstexibe_agrupamento_alfabetico); 565 565 } 566 566 567 567 if ($dados->lstexibe_csv == "f") { 568 568 $lstexibe_csv = false; … … 585 585 $lstexibe_subtotais = true; 586 586 } 587 if ($dados->lstexibe_header == "f") { 587 if ($dados->lstexibe_header == "f") { 588 588 $showthead = false; 589 589 } else { … … 618 618 $this->_exibetotalizadores = $lstexibe_totalizadores; 619 619 $this->_exiberesultados = $lstexibe_resultados; 620 621 622 623 $sql_colunas = "select 620 621 622 623 $sql_colunas = "select 624 624 lslcoid, 625 625 lslclstoid, … … 642 642 lslcsubtotalizador_condicao, 643 643 lslccheckbox_condicao 644 from 645 listagem.listagem_coluna 646 where 647 lslclstoid = $lstoid 644 from 645 listagem.listagem_coluna 646 where 647 lslclstoid = $lstoid 648 648 order by lslcordem"; 649 649 $resu_colunas = pg_query($this->conexao,$sql_colunas); 650 650 651 651 while ($coluna = pg_fetch_object($resu_colunas)) { 652 652 // print_r($coluna); … … 661 661 $link = $coluna->lslclink; 662 662 $link_condicao = $coluna->lslclink_condicao; 663 663 664 664 $idcoluna = html_entity_decode($idcoluna, ENT_QUOTES); 665 665 $titulo = html_entity_decode($titulo, ENT_QUOTES); … … 667 667 $link = html_entity_decode($link, ENT_QUOTES); 668 668 $link_condicao = html_entity_decode($link_condicao, ENT_QUOTES); 669 669 670 670 if ($coluna->lslccalculada == "t") { 671 671 $lslccalculada = true; … … 693 693 $lslclink_blank = false; 694 694 } 695 695 696 696 if ($coluna->lslcexibe_csv == "t") { 697 697 $lslcexibe_csv = true; … … 699 699 $lslcexibe_csv = false; 700 700 } 701 701 702 702 if ($lslcexibe_csv) { 703 $this->_colunascsv .= "$idcoluna,"; 704 } 705 706 703 $this->_colunascsv .= "$idcoluna,"; 704 } 705 706 707 707 if (($tipo == "text") || ($tipo == "data") || ($tipo == "hora") || ($tipo == "int") || ($tipo == "moeda")) { 708 708 709 709 if (($tipo == "int") && ($lslccheckbox)) { 710 710 if ($lstexibe_checkbox) { … … 713 713 } else { 714 714 //echo "idcoluna: $idcoluna -> $lslcnowrap"; 715 $this->adicionarColuna($idcoluna,$titulo,$html,$tipo,$align,$width,$lslcnowrap,$lslcvisivel); 715 $this->adicionarColuna($idcoluna,$titulo,$html,$tipo,$align,$width,$lslcnowrap,$lslcvisivel); 716 716 } 717 717 718 718 if ($link != "") { 719 719 $this->adicionarLink($idcoluna,$link,$link_condicao,$lslclink_blank); 720 720 } 721 721 722 722 if ($lslccalculada) { 723 723 $this->adicionarTotalizador($idcoluna,$condicao_totalizador,$condicao_subtotalizador); … … 725 725 } 726 726 } 727 727 728 728 } else { 729 729 $this->_debug = true; 730 730 $this->adicionarErro("Listagem nï¿œo encontrada."); 731 731 } 732 732 733 733 734 734 } … … 745 745 } 746 746 // if ($this->issublist) { 747 if (is_object($this->subListagem)) { 747 if (is_object($this->subListagem)) { 748 748 $ret = $ret + $this->subListagem->getQuantidadeRegistros(); 749 749 } … … 754 754 /** 755 755 * Funᅵᅵo para Alterar a Mensagem de Registros Encontrados. 756 * 756 * 757 757 * @param $msg 758 758 */ 759 759 public function setMensagemRegistrosEncontrados($msg) { $this->msgregistros = $msg; } 760 760 761 761 /** 762 762 * Funᅵᅵo para Alterar a Mensagem de Total de Registros Encontrados. 763 * 763 * 764 764 * @param $msg 765 765 */ 766 766 public function setMensagemTotalizador($msg) { $this->msgtotalizador = $msg; } 767 767 768 768 /** 769 769 * Funᅵᅵo para Alterar a Mensagem de Sub-Total de Registros Encontrados 770 * 770 * 771 771 * @param $msg 772 772 */ 773 773 public function setMensagemSubTotalizador($msg) { $this->msgsubtotalizador = $msg; } 774 774 775 775 /** 776 776 * Funᅵᅵo para Alterar a Mensagem de "Nenhum Resultado Encontrado". 777 * 777 * 778 778 * @param $msg 779 779 */ … … 782 782 /** 783 783 * Funᅵᅵo que Indica se a Listagem ï¿œ Agrupada Alfabeticamente 784 * 784 * 785 785 * @param value (true ou false) 786 786 */ … … 788 788 $this->agruparAlfabeticamente = $value; 789 789 } 790 790 791 791 /** 792 792 * Funᅵᅵo para Alterar a Opᅵᅵo de Exibir os Sub-Totais de uma Listagem. 793 * 793 * 794 794 * @param $value (true ou false) 795 795 */ … … 797 797 $this->exibesubtotais = $value; 798 798 } 799 799 800 800 public function setMostrarTotal($value) { 801 801 $this->_exibetotalizadores = $value; 802 802 } 803 803 804 804 public function setMostrarLegendaTopo($value) { 805 805 $this->_mostraLegendaTopo = $value; 806 806 } 807 807 808 808 public function setMostrarLegendaRodape($value) { 809 809 $this->_mostraLegendaRodape = $value; 810 810 } 811 812 811 812 813 813 /** 814 814 * Funᅵᅵo para Alterar a Opᅵᅵo de Exibir a Quantidade de Registros Retornados da Listagem. 815 * 815 * 816 816 * @param $exibir (true ou false) 817 817 */ … … 822 822 /** 823 823 * Funᅵᅵo para adicionar uma Coluna na Listagem. 824 * 824 * 825 825 * @param $idcoluna 826 826 * @param $tipo … … 846 846 } 847 847 } 848 848 849 849 function adicionarColunaCalculada($idcoluna,$tipo,$html,$condicao_total = "1",$condicao_subtotal = "1") { 850 850 $erro = false; … … 858 858 } 859 859 } 860 860 861 861 function adicionarLinhaDetalhamento($idlinha,$tipo,$html,$align = "left") { 862 862 $width = ""; … … 866 866 array_push($this->linhasdetalhamento,$coluna); 867 867 } 868 868 869 869 /** 870 870 * Funᅵᅵo para Adicionar uma Coluna com CheckBoxes. 871 * 871 * 872 872 * @param $idcoluna 873 873 * @param $titulo … … 887 887 array_push($this->colunas,$coluna); 888 888 } 889 889 890 890 /** 891 891 * Funᅵᅵo utilizada Internamente para verificar se o idcoluna passado jï¿œ foi adicionado a listagem. 892 * 892 * 893 893 * @param $idcoluna 894 894 * @return unknown_type … … 903 903 return $ret; 904 904 } 905 905 906 906 /** 907 907 * Adiciona um Link para uma ou mais Colunas. 908 * 908 * 909 909 * @param $idcolunas (Ids das colunas separados por vï¿œrgula) 910 910 * @param $link Link para ser redirecionado. … … 929 929 } 930 930 } 931 931 932 932 public function RemoverColuna($idcolunas){ 933 933 $colunas = explode(",",$idcolunas); … … 947 947 } 948 948 } 949 950 949 950 951 951 public function adicionarCor($idcolunas,$cor,$condicao = "1") { 952 952 $colunas = explode(",",$idcolunas); … … 967 967 } 968 968 } 969 969 970 970 /** 971 971 * Funᅵᅵo para Adicionar um Indicador (Legenda). 972 * 972 * 973 973 * @param $idindicador Cï¿œdigo Interno de Identificaᅵᅵo do Identificador 974 974 * @param $condicao Condiᅵᅵo em PHP para Exibir o Indicador. 975 975 * @param $tipo R,Q,T (REDONDO,QUADRADO,TRIANGULO) 976 * @param $codigoimagem (1 a 19). 976 * @param $codigoimagem (1 a 19). 977 977 * @param $legenda Legenda 978 978 * @return unknown_type … … 984 984 array_push($this->arrindicadores[$idindicador],$Indicador); 985 985 } 986 986 987 987 /** 988 988 * Funᅵᅵo para Desenhar a Listagem. 989 * 989 * 990 990 * @return HTML 991 991 */ … … 998 998 $sql = html_entity_decode($sql, ENT_QUOTES); 999 999 $this->carregar($sql); 1000 1001 } 1002 1000 1001 } 1002 1003 1003 if ($this->_exibearquivocsv) { 1004 1004 $this->gerarArquivoXLS($this->_colunascsv); … … 1009 1009 $this->escreveFechaList(); 1010 1010 } 1011 1011 1012 1012 function incluiCssJavascript($addpath = "") { 1013 1013 echo "\n\n<script language=\"Javascript\" type=\"text/javascript\" src=\"$addpath/includes/js/mascaras.js\"></script>\n … … 1018 1018 <link rel=\"stylesheet\" href=\"$addpath/includes/css/base_form.css\" media=\"screen\"></link>\n 1019 1019 <link rel=\"stylesheet\" href=\"$addpath/includes/css/calendar.css\" media=\"screen\"></link>\n\n"; 1020 1021 } 1022 1020 1021 } 1022 1023 1023 protected function escreveLegenda() { 1024 1024 if ($this->_exiberesultados) { 1025 1025 if (count($this->arrindicadores)) { 1026 1026 $colspan=0; 1027 1027 1028 1028 echo "\n\t<table width='100%' class='TableMoldura''> 1029 1029 \n\t\t<tr class='tableSubTitulo'> … … 1055 1055 } 1056 1056 } 1057 1057 1058 1058 /** 1059 1059 * Funᅵᅵo que desenha o cabeï¿œalho da Listagem. 1060 * 1060 * 1061 1061 * @return HTML 1062 1062 */ 1063 1063 protected function escreveAbreList() { 1064 1064 $colspan = count($this->colunas); 1065 1065 1066 1066 $htmldivs = ""; 1067 1067 $html_icone = ""; 1068 1068 1069 1069 if (!$this->issublist) { 1070 1070 if ($this->_mostraLegendaTopo) { … … 1074 1074 1075 1075 if ($this->_exiberesultados) { 1076 1076 1077 1077 if ($this->exibedivcolunas) { 1078 1078 $html_icone = '<b>[<img id="'. $this->idlistagem . '_img_visivel" src="' . $this->_url_base_path . '/images/icones/maisTransparente.gif" OnClick="ListagemShowHide(event,\''. $this->idlistagem . '\',\''. $this->idlistagem . '_img_visivel\');" OnMouseOver="this.style.cursor=\'pointer\';" OnMouseOut="this.style.cursor=\'default\';">]</b>'; … … 1080 1080 1081 1081 // $html_icone .= ' <b>[<img id="'. $this->idlistagem . '_img_grafico_visivel" src="images/icones/t1/fileGrafico.jpg" OnClick="ListagemShowHide(event,\''. $this->idlistagem . '\',\''. $this->idlistagem . '_img_grafico_visivel\');" OnMouseOver="this.style.cursor=\'pointer\';" OnMouseOut="this.style.cursor=\'default\';">]</b>'; 1082 1082 1083 1083 $cnt = 0; 1084 1084 $htmlchecks = ""; 1085 1085 1086 1086 foreach ($this->colunas as $coluna) { 1087 1087 $titulo = $coluna->getNome(); … … 1091 1091 $addvisivel = ""; 1092 1092 if ($visivel) { $addvisivel = "checked"; } 1093 1093 1094 1094 $adddisabled = ""; 1095 1095 if ($cnt == 0) { $adddisabled = " disabled"; $cnt = $cnt + 1; } 1096 1096 1097 1097 $htmlchecks .= '<input type="checkbox" class="checkbox" name="' . $idlistagem . '_ck_visivel_' . $idcoluna . '" id="' . $idlistagem . '_ck_visivel_' . $idcoluna . '" OnClick=" document.getElementById(\'' . $idlistagem . '_div_visivel\').style.display = \'none\'; document.getElementById(\'' . $idlistagem . '_div_visivel_load\').style.display = \'\'; alinhaDivDir(\'' .$idlistagem. '_div_visivel_load\'); setTimeout(\'ListagemExibeOcultaColuna(\\\'' . $idlistagem. '\\\',\\\'' .$idcoluna . '\\\');\')" value="' .$idcoluna . '" ' . $addvisivel .$adddisabled . '> ' . $titulo . '<br>'; 1098 1099 } 1100 1101 1102 $htmldivs = '<div id="' . $idlistagem. '_div_visivel" class="div_visivel" style="display:none;"> 1103 <table width="100%"> 1098 1099 } 1100 1101 1102 $htmldivs = '<div id="' . $idlistagem. '_div_visivel" class="div_visivel" style="display:none;"> 1103 <table width="100%"> 1104 1104 <tr> 1105 1105 <td align="right">' .$html_icone_2. '</td> … … 1107 1107 <tr> 1108 1108 <td style="padding-left:5px;">' 1109 .$htmlchecks . 1109 .$htmlchecks . 1110 1110 ' 1111 1111 … … 1123 1123 </table> 1124 1124 </div>'; 1125 1125 1126 1126 } 1127 1127 } 1128 1129 1130 } 1131 1128 1129 1130 } 1131 1132 1132 echo "\n\t$htmldivs<table id='Listagem_" . $this->getIdListagem() . "' width='100%'$addclass> 1133 1133 \n\t\t<tr class='tableSubTitulo'> … … 1135 1135 \n\t\t</tr>"; 1136 1136 } 1137 1137 1138 1138 /** 1139 1139 * Funᅵᅵo que desenha o HTML que fecha a listagem. 1140 * 1140 * 1141 1141 * @return HTML 1142 1142 */ 1143 1143 protected function escreveFechaList() { 1144 1144 echo "\n\t</table>"; 1145 1145 1146 1146 if (!$this->issublist) { 1147 1147 if ($this->_mostraLegendaRodape) { … … 1150 1150 } 1151 1151 } 1152 1152 1153 1153 public function setAgrupamento($idagrupamento,$titulo = "",$repetirtitulo = false) { 1154 1154 $width = ""; … … 1157 1157 //$html = "{" . $idagrupamento . "}"; 1158 1158 $html = $idagrupamento; 1159 if ($titulo == "") { 1159 if ($titulo == "") { 1160 1160 $titulo = "{" . $idagrupamento . "}"; 1161 1161 $repetirtitulo = true; … … 1167 1167 array_push($this->linhasagrupamento,$coluna); 1168 1168 } 1169 1169 1170 1170 public function setParametro($idparametro,$valor) { 1171 1171 foreach ($this->arrparametros as $k => $parametro) { … … 1175 1175 } 1176 1176 } 1177 1177 1178 1178 public function adicionarParametro($idparametro,$tipo,$obrigatorio = false,$valor = "",$valortestes = "") { 1179 1179 $parametros = array(); … … 1183 1183 $parametros["obrigatorio"] = $obrigatorio; 1184 1184 $parametros["valor_testes"] = $valortestes; 1185 1185 1186 1186 if ($this->_debug) { 1187 1187 if (($tipo != "text") && ($tipo != "int") && ($tipo != "data")) { … … 1190 1190 } 1191 1191 } 1192 1192 1193 1193 if (!$this->isParametro($idparametro)) { 1194 1194 array_push($this->arrparametros,$parametros); … … 1199 1199 } 1200 1200 } 1201 1201 1202 1202 public function getSQLParametros() { 1203 1203 $sql = $this->sql; … … 1213 1213 return $sqlparametros; 1214 1214 } 1215 1215 1216 1216 protected function formataSQLParametros() { 1217 1217 $sql = $this->sql; 1218 1218 1219 1219 $parametrosconsulta = $this->getSQLParametros(); 1220 1220 1221 1221 foreach ($parametrosconsulta as $parametro_consulta) { 1222 1222 $achou = false; … … 1240 1240 } 1241 1241 } 1242 1243 1242 1243 1244 1244 foreach ($this->arrparametros as $parametro) { 1245 1245 $idparametro = $parametro["idparametro"]; 1246 1246 $valor = $parametro["valor"]; 1247 1247 $obrigatorio = $parametro["obrigatorio"]; 1248 if (($obrigatorio == "t") && ($valor == "")) { 1248 if (($obrigatorio == "t") && ($valor == "")) { 1249 1249 $this->_debug=true; 1250 1250 $this->adicionarErro("Parï¿œmetro '$idparametro ' ï¿œ obrigatï¿œrio.",true); … … 1260 1260 $this->sql = $sql; 1261 1261 } 1262 1262 1263 1263 protected function isParametro($idparametro) { 1264 1264 $ret = false; … … 1270 1270 return $ret; 1271 1271 } 1272 1272 1273 1273 protected function isTotalizador($idcoluna) { 1274 1274 $ret = false; … … 1280 1280 return $ret; 1281 1281 } 1282 1282 1283 1283 function adicionarTotalizador($idcolunas,$condicaototal = "1",$condicaosubtotal = "1") { 1284 1284 1285 1285 $colunas = explode(",",$idcolunas); 1286 1286 foreach ($colunas as $idcoluna) { … … 1291 1291 } 1292 1292 if (!$erro) { 1293 1293 1294 1294 $totalizador = array(); 1295 1295 $totalizador["idcoluna"] = $idcoluna; … … 1297 1297 $totalizador["condicaosubtotal"] = $condicaosubtotal; 1298 1298 $this->totalizadores[$idcoluna] = $totalizador; 1299 1300 } 1301 } 1302 1303 } 1304 1299 1300 } 1301 } 1302 1303 } 1304 1305 1305 protected function escreveArquivo($arquivo) { 1306 1306 if ($this->_temarquivocsv) { … … 1309 1309 } 1310 1310 } 1311 1312 1311 1312 1313 1313 /** 1314 1314 * Funᅵᅵo para desenhar as Linhas da Listagem. 1315 * 1315 * 1316 1316 * @return HTML 1317 1317 */ … … 1322 1322 $handle = ""; 1323 1323 //$nomeform = $this->formpesquisa->getNome(); 1324 1324 1325 1325 if ($this->_temarquivocsv) { 1326 1326 if (!$this->issublist) { … … 1329 1329 } 1330 1330 } 1331 1331 1332 1332 if ($this->showthead) { 1333 1333 if ($this->_exiberesultados) { … … 1355 1355 $this->_txtarquivo .= "\n"; 1356 1356 $this->escreveArquivo($handle); 1357 1357 1358 1358 } 1359 1359 } … … 1382 1382 } 1383 1383 $class= ""; 1384 1384 1385 1385 $qtdlinhas = 0; 1386 1386 1387 1387 $qtd_registros = $this->getQuantidadeRegistros(); 1388 1388 1389 1389 1390 1390 for ($qtd_reg = 1;$qtd_reg <= $qtd_registros; $qtd_reg++) { 1391 1391 1392 1392 if ($this->_isarray) { 1393 1393 if ($qtd_reg == 1) { 1394 reset($this->dados); 1394 reset($this->dados); 1395 1395 $linha = current($this->dados); 1396 1396 } else { … … 1400 1400 $linha = pg_fetch_array($this->dados); 1401 1401 } 1402 1402 1403 1403 $cnt = $cnt + 1; 1404 1404 1405 1405 $qtdlinhas = $qtdlinhas + 1; 1406 1406 1407 1407 $class = ( $class == "tdc" ) ? "tde" : "tdc"; 1408 1408 … … 1420 1420 $tituloagrupamento = $coluna->replaceValorLinha($coluna->getNome(),$linha); 1421 1421 } 1422 1422 1423 1423 if ($this->agruparAlfabeticamente) { 1424 1424 $tituloagrupamento = strtoupper(substr($tituloagrupamento,0,1)); … … 1428 1428 $newagrupamento = strtoupper($htmlcoluna); 1429 1429 } 1430 1431 1432 1430 1431 1432 1433 1433 //AGRUPAMENTO 1434 1434 $cntcheckspan = 0; 1435 1435 if ($newagrupamento != $lastagrupamento) { 1436 1436 $cntagrupamentos = $cntagrupamentos + 1; 1437 1437 1438 1438 $arragrupamentos[$cntagrupamentos] = $newagrupamento; 1439 1439 1440 1440 //TOTALIZADOR SUB-TOTAL DO AGRUPAMENTO. 1441 1441 if ($this->exibesubtotais) { … … 1449 1449 $idcol = $coluna->getIdColuna(); 1450 1450 if ($this->isTotalizador($coluna->getIdColuna())) { 1451 if (!$mostroutotal) { 1452 $addtexto = "<h3>" . $this->msgsubtotalizador . "</h3>"; 1453 $txtarquivotexto = $this->msgsubtotalizador ; 1454 $mostroutotal = true; 1451 if (!$mostroutotal) { 1452 $addtexto = "<h3>" . $this->msgsubtotalizador . "</h3>"; 1453 $txtarquivotexto = $this->msgsubtotalizador ; 1454 $mostroutotal = true; 1455 1455 } else { 1456 1456 $addtexto = ""; 1457 1457 } 1458 if ($cntcheckspan) { 1459 /* for ($j=1; $j< $cntcheckspan; $j++) { 1460 echo "<td id='subtotal_" . $idcol . "_$cntagrupamentos' align='right'> </td>"; 1461 }*/ 1462 1463 // echo "<td id='subtotal_" . $idcol . "_" . $cntagrupamentos . "' align='right'> </td>"; 1458 if ($cntcheckspan) { 1464 1459 if ($this->_temarquivocsv) { 1465 1460 for ($j=1; $j<= $cntcheckspan; $j++) { … … 1469 1464 $this->_txtarquivo .= ";"; 1470 1465 } 1471 } 1472 } 1466 } 1467 } 1473 1468 $cntcheckspan = 0; 1474 1469 $addvisivel = ""; … … 1486 1481 } 1487 1482 if ($this->_exiberesultados) { 1488 echo "<td id='subtotal_" . $idcol . "_$cntagrupamentos' align='right'$addvisivel>$addtexto<h3>" . $subtotal_valor . "</h3> </td>";1483 echo "<td id='subtotal_" . $idcol . "_$cntagrupamentos' align='right'$addvisivel>$addtexto<h3>" . $subtotal_valor . "</h3></td>"; 1489 1484 } 1490 1485 $this->_txtarquivo .= $subtotal_valor . ";"; … … 1497 1492 } 1498 1493 if ($this->_exiberesultados) { 1499 echo "<td id='subtotal_$idcol" . "_" . $cntagrupamentos . "' $addvisivel> </td>";1494 echo "<td id='subtotal_$idcol" . "_" . $cntagrupamentos . "' $addvisivel></td>"; 1500 1495 } 1501 1496 } … … 1512 1507 } 1513 1508 } 1514 1515 1516 1509 1510 1511 1517 1512 if (($this->_repetirtituloagrupamento) || (!$mostroutituloagrupamento)) { 1518 1513 if ($this->_exiberesultados) { … … 1527 1522 $mostroutituloagrupamento = true; 1528 1523 } 1529 1524 1530 1525 } 1531 1526 1532 1527 } 1533 1534 } 1535 1536 1528 1529 } 1530 1531 1537 1532 if (count($this->colunas)) { 1538 1533 1539 1534 $addvisivellinha = ""; 1540 1535 if ($this->_exibelinhasvazias == false) { … … 1549 1544 } 1550 1545 } 1551 1546 1552 1547 //if ($exibe_linha) { 1553 1548 if ($this->_exiberesultados) { … … 1561 1556 $align = $coluna->getAlign(); 1562 1557 if ($coluna->getNowrap()) { $addnowrap = " nowrap"; } 1563 1558 1564 1559 if ($this->issublist) { 1565 1560 $idtd = $cnt -2; … … 1568 1563 } 1569 1564 $htmlcoluna = $coluna->getHtml($linha,$this->arrindicadores,$class,$idtd); 1570 1565 1571 1566 if (($coluna->getTipo() == "check") && ($htmlcoluna != "")) { $temcheck = true; $this->temcheck = true; } 1572 1567 } 1573 if ($this->isTotalizador($coluna->getIdColuna())) { 1568 if ($this->isTotalizador($coluna->getIdColuna())) { 1574 1569 $condicaototal = $this->totalizadores[$coluna->getIdColuna()]["condicaototal"]; 1575 1570 $condicaosubtotal = $this->totalizadores[$coluna->getIdColuna()]["condicaosubtotal"]; 1576 1571 $htmlvalorcoluna = $coluna->getValorHTML($linha); 1577 if ($condicaototal != "1") { 1572 if ($condicaototal != "1") { 1578 1573 $ret_total = $coluna->validaCondicao($condicaototal,$linha,false); 1579 1574 } else { 1580 1575 $ret_total = true; 1581 1576 } 1582 1577 1583 1578 if ($ret_total) { 1584 1579 $tipo_coluna = $coluna->getTipo(); … … 1601 1596 } 1602 1597 } 1603 if ($condicaosubtotal != "1") { 1598 if ($condicaosubtotal != "1") { 1604 1599 $ret_subtotal = $coluna->validaCondicao($condicaosubtotal,$linha,false); 1605 1600 } else { … … 1640 1635 $addvisivel = " style='display: none;' "; 1641 1636 } 1642 1637 1643 1638 if ($this->_exiberesultados) { 1644 1639 echo "\n\t\t\t<td id='td_" . $coluna->getIdColuna() . "_" . $idtd . "' " . $falign . $fwidth . " align='$align'" . $addnowrap . $addvisivel . ">" . nl2br($htmlcoluna) . "</td>"; 1645 1640 } 1646 1641 } 1647 1648 1649 1642 1643 1644 1650 1645 //ARQUIVO CSV 1651 1646 if ($this->_temarquivocsv) { … … 1666 1661 $this->adicionarErro("Nenhuma coluna foi adicionada.",true); 1667 1662 } 1668 1669 1663 1664 1670 1665 if ($this->_temarquivocsv) { 1671 1666 $this->_txtarquivo .= "\n"; 1672 1667 $this->escreveArquivo($handle); 1673 1668 } 1674 1669 1675 1670 //LINHA ADICIONAL DE OBSERVAᅵᅵES, (DETALHAMENTO) 1676 1671 if (count($this->linhasdetalhamento)) { … … 1683 1678 $htmlcoluna = ""; 1684 1679 $htmlcoluna = $coluna->getHtml($linha,$this->arrindicadores,$class,$qtdlinhas - 1); 1685 1680 1686 1681 if ($this->_exiberesultados) { 1687 1682 if ($htmlcoluna == "") { … … 1691 1686 echo "\n\t\t\t<td id='td_" . $coluna->getIdColuna() . "_" . $idtd . "' " . $falign . $fwidth . $addnowrap . " align='$align' colspan='" . count($this->colunas) . "'>" . $htmlcoluna . "</td>"; 1692 1687 echo "\n\t\t</tr>"; 1693 1688 1694 1689 } 1695 1690 if ($this->_temarquivocsv) { … … 1700 1695 } 1701 1696 } 1702 1703 } 1704 1697 1698 } 1699 1705 1700 $lastagrupamento = $newagrupamento; 1706 1701 //$lastval = ""; 1707 1702 } 1708 1703 } 1709 1704 1710 1705 $this->escreveArquivo($handle); 1711 1706 1712 if (count($this->totalizadores)) { 1707 if (count($this->totalizadores)) { 1713 1708 if ($this->exibesubtotais) { 1714 1709 if ($this->_exiberesultados) { … … 1723 1718 $idcol = $coluna->getIdColuna(); 1724 1719 if ($this->isTotalizador($coluna->getIdColuna())) { 1725 1726 if (!$mostrousubtotal) { 1727 $addtexto = "<h3>" . $this->msgsubtotalizador . "</h3>"; 1728 $mostrousubtotal = true; 1720 1721 if (!$mostrousubtotal) { 1722 $addtexto = "<h3>" . $this->msgsubtotalizador . "</h3>"; 1723 $mostrousubtotal = true; 1729 1724 $txtarquivotexto = $this->msgsubtotalizador; 1730 1725 } else { 1731 1726 $addtexto = ""; 1732 1727 } 1733 if ($cntcheckspan) { 1734 1735 /* for ($j=1; $j< $cntcheckspan; $j++) { 1736 echo "<td id='subtotal_$idcol' align='right'> </td>"; 1737 } 1738 1739 echo "<td id='subtotal_titulo_$idcol' align='right'> $addtexto</td>";*/ 1728 if ($cntcheckspan) { 1729 1740 1730 if ($this->_temarquivocsv) { 1741 1731 for ($j=1; $j<= $cntcheckspan; $j++) { … … 1745 1735 $this->_txtarquivo .= ";"; 1746 1736 } 1747 } 1748 } 1737 } 1738 } 1749 1739 $cntcheckspan = 0; 1750 1740 $addvisivel = ""; … … 1762 1752 } 1763 1753 if ($this->_exiberesultados) { 1764 echo "<td id='subtotal_$idcol" . "_" . $cntagrupamentos . "' align='right'$addvisivel>$addtexto <h3>" . $subtotal_valor . "</h3> </td>";1754 echo "<td id='subtotal_$idcol" . "_" . $cntagrupamentos . "' align='right'$addvisivel>$addtexto <h3>" . $subtotal_valor . "</h3></td>"; 1765 1755 } 1766 1756 if (in_array($idcol,$this->_colunasarquivo)) { … … 1773 1763 } 1774 1764 if ($this->_exiberesultados) { 1775 echo "<td id='subtotal_$idcol" . "_" . $cntagrupamentos . "' $addvisivel> </td>";1765 echo "<td id='subtotal_$idcol" . "_" . $cntagrupamentos . "' $addvisivel></td>"; 1776 1766 } 1777 1767 if ($this->_temarquivocsv) { … … 1789 1779 } 1790 1780 } 1791 1792 1793 1781 1782 1783 1794 1784 if ($this->_exibetotalizadores) { 1795 1785 if ($this->_exiberesultados) { … … 1799 1789 $cntcheckspan = 0; 1800 1790 foreach ($this->colunas as $coluna) { 1801 1791 1802 1792 1803 1793 $idcol = $coluna->getIdColuna(); 1804 1794 if ($this->isTotalizador($coluna->getIdColuna())) { 1805 if (!$mostroutotal) { 1806 $addtexto = "<h3>" . $this->msgtotalizador . "</h3>"; 1807 $mostroutotal = true; 1795 if (!$mostroutotal) { 1796 $addtexto = "<h3>" . $this->msgtotalizador . "</h3>"; 1797 $mostroutotal = true; 1808 1798 $txtarquivotexto = $this->msgtotalizador; 1809 1799 } else { 1810 1800 $addtexto = ""; 1811 1801 } 1812 1813 if ($cntcheckspan) { 1802 1803 if ($cntcheckspan) { 1814 1804 if ($this->_temarquivocsv) { 1815 1805 for ($j=1; $j<= $cntcheckspan; $j++) { … … 1819 1809 $this->_txtarquivo .= ";"; 1820 1810 } 1821 } 1822 } 1811 } 1812 } 1823 1813 $cntcheckspan = 0; 1824 1814 $addvisivel = ""; … … 1855 1845 $this->_txtarquivo .= ";"; 1856 1846 } 1857 } 1847 } 1858 1848 } 1859 1849 } … … 1863 1853 if ($this->_temarquivocsv) { 1864 1854 $this->_txtarquivo .= "\n"; 1865 } 1866 } 1867 } 1868 1855 } 1856 } 1857 } 1858 1869 1859 $this->escreveArquivo($handle); 1870 1871 1860 1861 1872 1862 if (!$this->issublist) { 1873 1863 if (is_object($this->subListagem)) { 1874 1864 if ($this->subListagem->getQuantidadeRegistros()) { 1875 $this->subListagem->gerarArquivoXLS(); 1865 $this->subListagem->gerarArquivoXLS(); 1876 1866 ob_start(); 1877 1867 $this->subListagem->desenhar(); … … 1883 1873 if ($this->_exiberesultados) { 1884 1874 echo "<tr><td colspan='$colspan'>"; 1885 echo $htmllist; 1875 echo $htmllist; 1886 1876 echo "</td></tr>"; 1887 1877 } … … 1893 1883 } 1894 1884 } 1895 1885 1896 1886 $this->escreveArquivo($handle); 1897 1898 1899 /* 1900 EXIBIR OS BOTï¿œES DE + E - PARA QUANDO POSSUIR COLUNAS COM CHECKBOXES. COMENTADO POR QUE Nï¿œO FUNCIONA SE TIVER MAIS DE UM FORMULï¿œRIO NA MESMA JANELA. */ 1887 1888 1889 /* 1890 EXIBIR OS BOTï¿œES DE + E - PARA QUANDO POSSUIR COLUNAS COM CHECKBOXES. COMENTADO POR QUE Nï¿œO FUNCIONA SE TIVER MAIS DE UM FORMULï¿œRIO NA MESMA JANELA. */ 1901 1891 if (!$this->issublist) { 1902 1892 if ($temcheck) { … … 1923 1913 } 1924 1914 } 1925 1926 1915 1916 1927 1917 1928 1918 if ($this->_exibeqtdregistros) { … … 1946 1936 echo "</td>\n\t\t</tr>"; 1947 1937 } 1948 1949 } 1950 1938 1939 } 1940 1951 1941 $this->escreveArquivo($handle); 1952 1942 1953 1943 1954 1944 if ($this->_temarquivocsv) { 1955 1945 if (!$this->issublist) { 1956 1957 1946 1947 1958 1948 fclose($handle); 1959 1949 1960 1950 $link=$tmpfname; 1961 1951 1962 1952 if ($cnt != 0) { 1963 1953 echo "\n\t\t<tr class='tableRodapeModelo3'>\n\t\t\t<td colspan='$colspan' align=center>"; … … 1977 1967 $this->form->addCampoAcao("btn_arquivo","onclick","window.open('gera_csv_to_excel.php?arquivocsv=" . $link . "');"); 1978 1968 $this->form->addQuadro("quadro_arquivo"); 1979 $this->form->addQuadroButton("quadro_arquivo","btn_arquivo"); 1969 $this->form->addQuadroButton("quadro_arquivo","btn_arquivo"); 1980 1970 */ 1981 1971 } 1982 1983 /* 1984 FORMULï¿œRIO 1972 1973 /* 1974 FORMULï¿œRIO 1985 1975 if (!$this->issublist) { 1986 1976 if ($cnt != 0) { … … 1991 1981 $this->form->displayErros(); 1992 1982 $htmlform = ob_get_contents(); 1993 1983 1994 1984 ob_end_clean(); 1995 1985 echo $htmlform; … … 2000 1990 $this->form->fechaForm(); 2001 1991 $htmlform = ob_get_contents(); 2002 ob_end_clean(); 1992 ob_end_clean(); 2003 1993 } */ 2004 1994 //echo $htmlform; 2005 1995 2006 1996 $this->arrtotais = $arrtotais; 2007 1997 $this->arrsubtotais = $arrsubtotais_todos; 2008 1998 $this->arragrupamentos = $arragrupamentos; 2009 2010 2011 } 2012 1999 2000 2001 } 2002 2013 2003 public function setDebug($value) { 2014 2004 $this->_debug = $value; 2015 2005 } 2016 2006 2017 2007 /** 2018 2008 * Funᅵᅵo usada internamente para adicionar um erro ao formulï¿œrio. … … 2025 2015 $erro = array("msgerro" => $msgerro,"fatal" => $fatal); 2026 2016 array_push($this->_errors,$erro); 2027 2017 2028 2018 if ($fatal) { 2029 2019 $this->escreveErros(); 2030 2020 exit; 2031 2021 } 2032 2022 2033 2023 } 2034 2024 … … 2063 2053 } 2064 2054 } 2065 2055 2066 2056 public function gerarArquivoXLS($colunasarquivo = "") { 2067 2057 if ($colunasarquivo == "") { … … 2070 2060 if ($coluna->getVisibilidade()) { 2071 2061 $colunasarquivo .= $coluna->getIdColuna() . ","; 2072 } 2062 } 2073 2063 } 2074 2064 $colunasarquivo = substr($colunasarquivo,0,strlen($colunasarquivo)-1); … … 2077 2067 $txtarquivo = ""; 2078 2068 $this->_colunasarquivo = $arcolunas; 2079 $this->_temarquivocsv = true; 2080 } 2081 2069 $this->_temarquivocsv = true; 2070 } 2071 2082 2072 /* 2083 2073 * Funᅵᅵo utilizada pra somar intervalos de Horas */ 2084 2074 public function somaIntervaloHoras($arrValores){ 2085 2075 2086 2076 // Somando separadamente os valores 2087 2077 foreach($arrValores as $valor){ 2088 2078 2089 2079 $arrTmp = explode(':',$valor); 2090 2080 2091 2081 $seg += $arrTmp[2]; 2092 2082 $min += $arrTmp[1]; 2093 $hor += $arrTmp[0]; 2094 } 2095 2083 $hor += $arrTmp[0]; 2084 } 2085 2096 2086 // Tratando os segundos 2097 2087 if( $seg >= 60){ 2098 2088 2099 2089 $min += floor($seg / 60) ; 2100 2090 2101 2091 while($seg >= 60){ 2102 2092 2103 2093 $seg = $seg - 60; 2104 2094 } 2105 2095 2106 2096 } 2107 2097 // Tratando os minutos 2108 2098 if( $min >= 60){ 2109 2099 2110 2100 $hor += floor($min / 60) ; 2111 2101 2112 2102 while($min >= 60){ 2113 2103 2114 2104 $min = $min - 60; 2115 2105 } 2116 2117 } 2118 2106 2107 } 2108 2119 2109 return str_pad($hor,2,'0',STR_PAD_LEFT).':'.str_pad($min,2,'0',STR_PAD_LEFT).':'.str_pad($seg,2,'0',STR_PAD_LEFT); 2120 2110 } 2121 2111 2122 2112 /** 2123 2113 * Funᅵᅵo que Retorna se a listagem Possui um checkBox adicionado. … … 2126 2116 return $this->temcheck; 2127 2117 } 2128 2129 /** 2130 * Funᅵᅵo que retorna o array com os Totalizadores. 2118 2119 /** 2120 * Funᅵᅵo que retorna o array com os Totalizadores. 2131 2121 */ 2132 2122 public function getTotais() { 2133 2123 return $this->arrtotais; 2134 2124 } 2135 2125 2136 2126 /** 2137 2127 * Funᅵᅵo que Retorna o array com os Sub-Totalizadores. … … 2140 2130 return $this->arrsubtotais; 2141 2131 } 2142 2132 2143 2133 /** 2144 2134 * Funᅵᅵo que Retorna o array com os Sub-Totalizadores. … … 2147 2137 return $this->arragrupamentos; 2148 2138 } 2149 2139 2150 2140 /** 2151 2141 * Funᅵᅵo Interna Utilizada quando a Listagem possui uma sublistagem para guardar quantos registros a listagem principal tem. 2152 2142 */ 2153 2143 protected function setQuantidadeRegistrosListagemPrincipal($value) { 2154 $this->_qtdregistroslistagemprincipal = $value; 2155 } 2156 2144 $this->_qtdregistroslistagemprincipal = $value; 2145 } 2146 2157 2147 /** 2158 2148 * Funᅵᅵo Interna Utilizada quando a Listagem possui uma sublistagem para retornar quantos registros a listagem principal tem. … … 2161 2151 return $this->_qtdregistroslistagemprincipal; 2162 2152 } 2163 2153 2164 2154 protected function getTextoArquivoCSV() { 2165 2155 return $this->_txtarquivo; 2166 2156 } 2167 2157 2168 2158 public function autoAdicionarColunas() { 2169 2159 $i = pg_num_fields($this->dados); … … 2171 2161 $fieldname = pg_field_name($this->dados, $j); 2172 2162 $tipo = pg_field_type($this->dados, $j); 2173 $this->adicionarColuna("coluna_" .$j,"$fieldname","{" . $fieldname . "}","text","left"); 2163 $this->adicionarColuna("coluna_" .$j,"$fieldname","{" . $fieldname . "}","text","left"); 2174 2164 } 2175 2165 } -
trunk/workflow/inc/report/includes/css/base_form.css
r5307 r6413 14 14 font-size: 100%; 15 15 font-family: inherit; 16 16 17 17 } 18 18 :focus { outline: 0;} 19 19 a, a:link, a:visited, a:hover, a:active{text-decoration:none} 20 table { border-collapse: separate; border-spacing: 0;}21 th, td { font-weight: normal; }20 table { border-collapse: separate; border-spacing: 0; padding: 1; margin: 1;} 21 th, td { font-weight: normal; padding: 1; margin: 1;} 22 22 img, iframe {border: none; text-decoration:none;} 23 /*ol, ul {list-style: none;}*/24 23 input, textarea, select, button {font-size: 100%;font-family: inherit;} 25 24 select {margin: inherit;} … … 27 26 /* ------------------------------------------------------------------------------------------------------------------- */ 28 27 29 30 31 32 33 34 35 36 28 body { 37 29 margin: 0px 0px 0px 0px; … … 48 40 color: #3B5CA1; 49 41 text-decoration: none; 50 font-family: Verdana, Arial, Helvetica, sans-serif; 42 font-family: Verdana, Arial, Helvetica, sans-serif; 51 43 font-size: 11px; 52 44 } … … 54 46 a:hover { 55 47 text-decoration: underline; 56 font-family: Verdana, Arial, Helvetica, sans-serif; 48 font-family: Verdana, Arial, Helvetica, sans-serif; 57 49 font-size: 11px; 58 50 } … … 84 76 font-family: Verdana, Arial, Helvetica, sans-serif; 85 77 font-size: 10px; 86 color: #000000; /*#164C7A;*/78 color: #000000; 87 79 font-weight : bold; 88 80 text-align: left; … … 98 90 margin-left: 8px; 99 91 margin-right: 8px; 100 /* white-space: nowrap; */ 101 } 102 103 104 105 106 107 92 } 108 93 109 94 /********* TABELAS E RESULTADOS *********/ … … 113 98 border: 1px solid #94ADC2; 114 99 width:98%; 115 padding: 0px 0px 0px 0px;116 margin: 0px 0px 10px 0px;117 100 clear: left; 118 101 background-color:#FFFFFF; … … 122 105 height: 16px; 123 106 background-image: url("../../images/fundo.gif"); 124 margin-right:3px; 125 height: 20px; 126 107 height: 20px; 108 127 109 } 128 110 … … 134 116 .tableSubTitulo{ 135 117 height: 14px; 136 /*border: 0px solid #FFFFFF;*/137 118 background-color: #E6EAEE; 138 margin-right: 3px;139 119 height: 20px; 140 120 } 141 121 142 .tableTituloColunas{ 122 .tableTituloColunas{ 143 123 height: 14px; 144 145 124 background-color: #BAD0E5; 146 125 height: 20px; 147 margin: 0px 0px 0px 0px; 148 margin-right:3px; 149 } 150 151 .tableTituloColunas td{ 152 margin: 4px 0px 4px 0px; 126 } 127 128 .tableTituloColunas td{ 153 129 border-right: solid 1px #FFFFFF; 154 130 border-bottom : 1px solid #FFFFFF; 155 131 } 156 132 157 158 133 .tableRodapeModelo1{ 159 134 background-color: #BAD0E5; 160 margin: 4px 0px 4px 0px;161 135 border-bottom: solid 1px #FFFFFF; border-right: solid 1px #FFFFFF; border-left: solid 1px #FFFFFF; 162 136 height: 20px; … … 165 139 .tableRodapeModelo2{ 166 140 background-color: #B1CBDE; 167 margin: 4px 0px 4px 0px;168 141 border-bottom: solid 1px #FFFFFF; border-right: solid 1px #FFFFFF; border-left: solid 1px #FFFFFF; 169 142 height: 20px; … … 172 145 .tableRodapeModelo3{ 173 146 background-color: #AABFD2; 174 margin: 4px 0px 4px 0px;175 147 border-bottom: solid 1px #FFFFFF; border-right: solid 1px #FFFFFF; border-left: solid 1px #FFFFFF; 176 148 height: 20px; 177 149 } 178 150 179 .tableRodapeModelo1 td { 180 margin: 4px 0px 4px 0px; 181 border-bottom: solid 1px #FFFFFF; 182 border-right: solid 1px #FFFFFF; 183 border-left: solid 1px #FFFFFF; 184 } 185 186 .tableRodapeModelo2 td { 187 margin: 4px 0px 4px 0px; 188 border-bottom: solid 1px #FFFFFF; 189 border-right: solid 1px #FFFFFF; 190 border-left: solid 1px #FFFFFF; 191 } 192 193 .tableRodapeModelo3 td { 194 margin: 4px 0px 4px 0px; 195 border-bottom: solid 1px #FFFFFF; 196 border-right: solid 1px #FFFFFF; 197 border-left: solid 1px #FFFFFF; 198 } 199 200 table { 201 border-collapse: separate; 202 border-spacing: 0px; 203 margin: 0px 0px 0px 0px; 204 padding: 0px 0px 0px 0px; 205 empty-cells: show !important; 151 .tableRodapeModelo1 td { 152 border-bottom: solid 1px #FFFFFF; 153 border-right: solid 1px #FFFFFF; 154 border-left: solid 1px #FFFFFF; 155 } 156 157 .tableRodapeModelo2 td { 158 border-bottom: solid 1px #FFFFFF; 159 border-right: solid 1px #FFFFFF; 160 border-left: solid 1px #FFFFFF; 161 } 162 163 .tableRodapeModelo3 td { 164 border-bottom: solid 1px #FFFFFF; 165 border-right: solid 1px #FFFFFF; 166 border-left: solid 1px #FFFFFF; 206 167 } 207 168 208 169 table { 170 border-collapse: separate; 171 border-spacing: 0px; 172 empty-cells: show !important; 209 173 max-width: 100%; 210 * border-collapse:collapse !important; 211 * border-spacing:1px 1px !important; 212 _ border-collapse:collapse !important; 213 _ border-spacing:1px 1px !important; 214 outline: 0; 215 padding: 0; 216 margin: 0; 217 border: 0; 174 * border-collapse:collapse !important; 175 * border-spacing:1px 1px !important; 176 _ border-collapse:collapse !important; 177 _ border-spacing:1px 1px !important; 178 outline: 0; 179 border: 0; 218 180 } 219 181 … … 221 183 border-spacing: 0 !important; 222 184 } 223 224 tr {225 226 margin: 0px 0px 0px 0px;227 padding: 0px 0px 0px 0px;228 }229 185 230 186 td{ … … 260 216 background-color: #F9E5A9 /* #FDF3D9 */; 261 217 border: 0px solid #FFFFFF; 262 218 263 219 } 264 220 … … 270 226 background-color: #F9E5A9; 271 227 border: 0px solid #FFFFFF; 272 273 } 274 275 .tdc td { 276 border-right: solid 1px #FFFFFF; 277 border- bottom: solid 1px #FFFFFF;278 padding: 0px 3px 0px 3px ! important;279 } 280 281 .tde td { 282 border-right: solid 1px #FFFFFF; 283 border-bottom: solid 1px #FFFFFF; 284 padding: 0px 3px 0px 3px ! important;228 229 } 230 231 .tdc td { 232 border-right: solid 1px #FFFFFF; 233 border-left: solid 1px #FFFFFF; 234 border-bottom: solid 1px #FFFFFF; 235 } 236 237 .tde td { 238 border-right: solid 1px #FFFFFF; 239 border-left: solid 1px #FFFFFF; 240 border-bottom: solid 1px #FFFFFF; 285 241 } 286 242 287 243 .tdcOver td { 288 border-right: solid 1px #FFFFFF; 289 border-bottom: solid 1px #FFFFFF; 290 padding: 0px 3px 0px 3px ! important;244 border-right: solid 1px #FFFFFF; 245 border-left: solid 1px #FFFFFF; 246 border-bottom: solid 1px #FFFFFF; 291 247 } 292 248 293 249 .tdeOver td { 294 border-right: solid 1px #FFFFFF; 295 border-bottom: solid 1px #FFFFFF; 296 padding: 0px 3px 0px 3px ! important;250 border-right: solid 1px #FFFFFF; 251 border-left: solid 1px #FFFFFF; 252 border-bottom: solid 1px #FFFFFF; 297 253 } 298 254 … … 300 256 font-size:18px; 301 257 } 302 303 304 305 306 258 307 259 .msg { … … 317 269 318 270 display:inline; 319 font-size:11px; 320 color:#643E41; 271 font-size:11px; 272 color:#643E41; 321 273 } 322 274 … … 330 282 margin: 3px 3px 3px 3px; 331 283 padding: 2px 10px 2px 10px; 332 284 333 285 } 334 286 .statusAF { … … 336 288 background-repeat: no-repeat; 337 289 margin: 3px 3px 3px 3px; 338 padding: 2px 10px 2px 10px; 290 padding: 2px 10px 2px 10px; 339 291 } 340 292 .statusN { 341 293 342 294 background-image: url("../../images/indicadores/redondos/ap/ap04.jpg"); 343 295 background-repeat: no-repeat; 344 296 margin: 3px 3px 3px 3px; 345 padding: 2px 10px 2px 10px; 346 297 padding: 2px 10px 2px 10px; 298 347 299 } 348 300 .statusNF { 349 301 350 302 background-image: url("../../images/indicadores/redondos/apf/ap04.jpg"); 351 303 background-repeat: no-repeat; … … 353 305 padding: 2px 10px 2px 10px; 354 306 355 307 356 308 } 357 309 .statusP { 358 310 359 311 background-image: url("../../images/indicadores/redondos/ap/ap03.jpg"); 360 312 background-repeat: no-repeat; 361 313 margin: 3px 3px 3px 3px; 362 314 padding: 2px 10px 2px 10px; 363 315 364 316 } 365 317 .statusPF { 366 318 367 319 background-image: url("../../images/indicadores/redondos/apf/ap03.jpg"); 368 320 background-repeat: no-repeat; 369 321 margin: 3px 3px 3px 3px; 370 322 padding: 2px 10px 2px 10px; 371 323 372 324 } 373 325 .statusM { 374 326 375 327 background-image: url("../../images/indicadores/redondos/ap/ap02.jpg"); 376 328 background-repeat: no-repeat; 377 329 margin: 3px 3px 3px 3px; 378 330 padding: 2px 10px 2px 10px; 379 331 380 332 } 381 333 .statusMF { … … 400 352 /********* FORMULARIOS *********/ 401 353 402 .botao { 403 font-family: Verdana, Arial, Helvetica, sans-serif; 354 .botao { 355 font-family: Verdana, Arial, Helvetica, sans-serif; 404 356 background-image: URL("../../images/fd_tr_principal.gif"); 405 357 vertical-align: middle; 406 font-size: 9pt; 358 font-size: 9pt; 407 359 text-align:center ; 408 border-color: #000000; 409 border-style:outset; 410 border: 1px solid #999999; 360 border-color: #000000; 361 border-style:outset; 362 border: 1px solid #999999; 411 363 padding: 0px 0px 0px 0px; 412 364 font-size: 8pt; … … 414 366 height: 20px; 415 367 } 416 .files { 417 font-family: Verdana, Arial, Helvetica, sans-serif; 368 .files { 369 font-family: Verdana, Arial, Helvetica, sans-serif; 418 370 background-image: URL("../../images/fd_tr_principal.gif"); 419 371 vertical-align: middle; 420 font-size: 9pt; 421 border-color: #000000; 422 border-style:outset; 423 border: 1px solid #999999; 372 font-size: 9pt; 373 border-color: #000000; 374 border-style:outset; 375 border: 1px solid #999999; 424 376 padding: 0px 0px 0px 0px; 425 377 font-size: 8pt; … … 483 435 484 436 485 486 487 488 489 437 /* Abas */ 490 438 … … 492 440 border-bottom: 1px solid #94ADC2; 493 441 } 494 442 495 443 496 444 #tabnav { 497 445 498 446 margin: 0; 499 447 position: relative; 500 margin: 0; 448 margin: 0; 501 449 padding: 0; 502 450 padding-top: 10px; 503 451 504 452 } 505 453 506 454 #tabnav a:link { 507 455 float: left; … … 511 459 margin-right: 3px; 512 460 border: 1px solid #ccc; 513 border-bottom: 1px solid #FFFFFF !important; 461 border-bottom: 1px solid #FFFFFF !important; 514 462 text-decoration: none; 515 background-image: url("../../images/fundo.gif"); 463 background-image: url("../../images/fundo.gif"); 516 464 font-weight: normal; 517 465 white-space: nowrap; 518 519 } 520 521 466 467 } 468 469 522 470 #tabnav a:link.active, #tabnav a:visited.active { 523 524 border: 1px solid #94ADC2 !important; 525 border-bottom: 1px solid #FFFFFF !important; 471 472 border: 1px solid #94ADC2 !important; 473 border-bottom: 1px solid #FFFFFF !important; 526 474 background-image: url("../../images/fundo_over3.jpg"); 527 475 color: #000000; … … 532 480 #tabnav a:hover { 533 481 background-image: url("../../images/fundo_over2.jpg"); 534 border-bottom: 1px solid #FFFFFF !important; 482 border-bottom: 1px solid #FFFFFF !important; 535 483 background-repeat: repeat-x; 536 484 color: #000000; … … 538 486 white-space: nowrap 539 487 } 540 488 541 489 .aba_disabled { 542 490 float: left; … … 546 494 margin-right: 3px; 547 495 border: 1px solid #ccc; 548 border-bottom: 1px solid #FFFFFF !important; 496 border-bottom: 1px solid #FFFFFF !important; 549 497 text-decoration: none; 550 background-image: url("../../images/fundo.gif"); 498 background-image: url("../../images/fundo.gif"); 551 499 font-weight: normal; 552 500 color: #C5CACD; … … 556 504 /*USADO NA CLASSE DE LISTAGEM*/ 557 505 .div_visivel{ 558 506 559 507 position: absolute; 560 top:2px; 561 width:250px; 508 top:2px; 509 width:250px; 562 510 background-color: #F0F0F0; 563 511 border: 1px solid #000000; 564 512 padding: 5px; 565 513 566 514 } 567 515 … … 592 540 padding-left:5px; 593 541 background-color: #DFEAF3; 594 /*border-bottom: 1px solid #E0E0E0; */595 542 color: black; 596 543 font-family:arial;
Note: See TracChangeset
for help on using the changeset viewer.