1'use strict'; 2 3/** 4 * @ngdoc function 5 * @name minovateApp.controller: categorizacaoCtrl 6 * @description 7 * # Chama seção de conteudos de serviço 8 * Controller of the portalgovApp 9 */ 10angular.module('portalgovApp') 11 .controller('categorizacaoCtrl', function ($scope, $modal, $http,$rootScope,MetaService, $sce) { 12 $scope.filteredTodos = [] 13 $scope.categorias=[]; 14 15 $http({method: 'POST', url: 'controllers/categorizacao/class_categoria.php', data: $.param({func:'10'}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }). 16 then(function(response) { 17 var r=response.data; 18 $scope.categorias = r; 19 20 $scope.$watch('categorias + data.currentPage + data.numPerPage', function() { 21 var begin = (($scope.data.currentPage - 1) * $scope.data.numPerPage), end = begin + $scope.data.numPerPage; 22 $scope.filteredTodos = $scope.categorias.slice(begin, end); 23 }); 24 25 $scope.data.totalItems = $scope.categorias.length; 26 }); 27 28 $scope.tipo="0"; 29 30 $scope.change_page = function(page){ 31 $scope.data.currentPage=page; 32 }; 33 34 $rootScope.metaservice = MetaService; 35 $rootScope.metaservice.set("Categorias ","",""); 36 37 $scope.data ={ 38 currentPage: 1, 39 numPerPage: 15, 40 maxSize: 5 41 }; 42 }) 43 .controller('categorizacao_buscaCtrl', function ($scope, $modal, $http,$rootScope,MetaService, $stateParams) { 44 var cat = $stateParams.categoria; 45 46 $scope.filteredTodos = [] 47 48 $http({method: 'POST', url: 'controllers/categorizacao/class_categoria.php', data: $.param({func:'9'}), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }). 49 then(function(response) { 50 var r=response.data; 51 $scope.tipos = r; 52 }); 53 54 $scope.conteudos=[]; 55 56 $http({method: 'POST', url: 'controllers/categorizacao/class_categoria.php', data: $.param({func:'8', param: 1, id: cat }), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }). 57 then(function(response) { 58 var r=response.data; 59 $scope.categoria_geral=r.cat; 60 $scope.categoria_geral_desc= r.desc; 61 if(r.list.length!=0){ 62 $scope.conteudos = r.list; 63 64 $scope.$watch('conteudos + data.currentPage + data.numPerPage', function() { 65 var begin = (($scope.data.currentPage - 1) * $scope.data.numPerPage), end = begin + $scope.data.numPerPage; 66 $scope.filteredTodos = $scope.conteudos.slice(begin, end); 67 }); 68 69 $scope.data.totalItems = $scope.conteudos.length; 70 } 71 else{ 72 bootbox.dialog({ 73 message: "Não foram encontrados resultados de acordo com esta busca!", 74 title: "Informação sobre a pesquisa", 75 buttons: { 76 main: { 77 label: "Ok", 78 className: "btn-primary", 79 } 80 } 81 }); 82 } 83 }); 84 85 $scope.change_page = function(page){ 86 $scope.data.currentPage=page; 87 }; 88 89 $scope.busca_conteudos = function(param){ 90 if(param==1){ 91 document.getElementById('form_pesquisa_conteudo').reset(); 92 93 document.getElementById('bt_lic_tudo').value="Buscando ..."; 94 document.getElementById('bt_lic_tudo').disabled=true; 95 $http({method: 'POST', url: 'controllers/categorizacao/class_categoria.php', data: $.param({func:'8', param: 1, id: cat }), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }). 96 then(function(response) { 97 var r=response.data; 98 99 if(param==1){ 100 document.getElementById('bt_lic_tudo').value="Mostrar todos"; 101 document.getElementById('bt_lic_tudo').disabled=false; 102 } 103 else{ 104 document.getElementById('bt_lic_filtro').value="Pesquisar"; 105 document.getElementById('bt_lic_filtro').disabled=false; 106 } 107 108 if(r.list.length!=0){ 109 $scope.conteudos = r.list; 110 111 $scope.$watch('conteudos + data.currentPage + data.numPerPage', function() { 112 var begin = (($scope.data.currentPage - 1) * $scope.data.numPerPage), end = begin + $scope.data.numPerPage; 113 $scope.filteredTodos = $scope.conteudos.slice(begin, end); 114 }); 115 116 $scope.data.totalItems = $scope.conteudos.length; 117 } 118 else{ 119 bootbox.dialog({ 120 message: "Não foram encontrados resultados de acordo com esta busca!", 121 title: "Informação sobre a pesquisa", 122 buttons: { 123 main: { 124 label: "Ok", 125 className: "btn-primary", 126 } 127 } 128 }); 129 } 130 131 }); 132 } 133 else{ 134 var tipo = document.getElementById('tipo').value; 135 136 if(tipo=="0" ){ 137 bootbox.dialog({ 138 message: "Preencha um filtro para efetuar a busca!", 139 title: "Informação sobre a pesquisa", 140 buttons: { 141 main: { 142 label: "Ok", 143 className: "btn-primary", 144 } 145 } 146 }); 147 } 148 else{ 149 document.getElementById('bt_lic_filtro').value="Buscando ..."; 150 document.getElementById('bt_lic_filtro').disabled=true; 151 152 $http({method: 'POST', url: 'controllers/categorizacao/class_categoria.php', data: $.param({func:'8', param: 2, id: cat, tipo: tipo }), headers: {'Content-Type': 'application/x-www-form-urlencoded'} }). 153 then(function(response) { 154 var r=response.data; 155 156 if(param==1){ 157 document.getElementById('bt_lic_tudo').value="Mostrar todos"; 158 document.getElementById('bt_lic_tudo').disabled=false; 159 } 160 else{ 161 document.getElementById('bt_lic_filtro').value="Pesquisar"; 162 document.getElementById('bt_lic_filtro').disabled=false; 163 } 164 165 if(r.list.length!=0){ 166 $scope.conteudos = r.list; 167 168 $scope.$watch('conteudos + data.currentPage + data.numPerPage', function() { 169 var begin = (($scope.data.currentPage - 1) * $scope.data.numPerPage), end = begin + $scope.data.numPerPage; 170 $scope.filteredTodos = $scope.conteudos.slice(begin, end); 171 }); 172 173 $scope.data.totalItems = $scope.conteudos.length; 174 } 175 else{ 176 bootbox.dialog({ 177 message: "Não foram encontrados resultados de acordo com esta busca!", 178 title: "Informação sobre a pesquisa", 179 buttons: { 180 main: { 181 label: "Ok", 182 className: "btn-primary", 183 } 184 } 185 }); 186 } 187 }); 188 } 189 } 190 }; 191 192 $scope.tipo="0"; 193 194 $rootScope.metaservice = MetaService; 195 $rootScope.metaservice.set("Conteúdos","",""); 196 197 $scope.data ={ 198 currentPage: 1, 199 numPerPage: 15, 200 maxSize: 5 201 }; 202 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.