_status);
              });

              var innerHTML = "";
              var cor = "Snow";
              var i = 0;

              array_unique(setores).forEach(function(item, indice, array) {
                if (indice === 0) cor = "DarkSlateBlue";
                else if (indice === 1) cor = "DarkSlateBlue";
                else if (indice === 31) cor = "SaddleBrown";
                else if (indice === 32) cor = "SaddleBrown";
                else cor = "DarkGray";

                innerHTML =
                  innerHTML +
                  `<tr id= "${item}"><td class="setores" bgcolor="${cor}">${item}</td></tr>`;
              });

              innerHTML = innerHTML + `<tr class="foo smphone">`;
              innerHTML = innerHTML + `<td><div class="foo" ></div></td>`;

              array_unique(servicos).forEach(function(item, indice, array) {
                innerHTML =
                  innerHTML + `<td><div class="foo">${item}</div></td>`;
              });

              innerHTML = innerHTML + `</tr></table></div></div>`;
              tbl.innerHTML = innerHTML;

              for (i = 0; i < query.length; i++) {
                var trid = document.getElementById(query[i].nome_setor_abrev);
                `<td bgcolor="${cor}" class="data">&nbsp;&nbsp;&nbsp;</td>`;
                if ((query[i].nome_setor_abrev = trid)) {
                  if (query[i].flag_status === "1") cor = "Gold";
                  if (query[i].flag_status === "2") cor = "Gray";
                  if (query[i].flag_status === "3") cor = "DarkGreen";
                  if (query[i].flag_status === "4") cor = "LightGrey";
                  trid.innerHTML =
                    trid.innerHTML +
                    `<td bgcolor="${cor}" class="data">&nbsp;&nbsp;&nbsp;</td>`;
                  //console.log(trid.innerHTML);
                } else {
                }
              }
            
_ status); 
               }); 

               var innerHTML = " "; 
               var cor = " Snow "; 
               var i = 0; 

               array_unique(setores).forEach(function(item, indice, array) { 
                 if (indice = = = 0) cor = " DarkSlateBlue "; 
                 else if (indice = = = 1) cor = " DarkSlateBlue "; 
                 else if (indice = = = 31) cor = " SaddleBrown "; 
                 else if (indice = = = 32) cor = " SaddleBrown "; 
                 else cor = " DarkGray "; 

                 innerHTML = 
                   innerHTML + 
                   '< tr id= " $ { item}"><td class="setores " bgcolor="${cor}">${item}</td></tr > `; 
               }); 

               innerHTML = innerHTML + '< tr class="foo smphone " > `; 
               innerHTML = innerHTML + '< td><div class="foo " > < /div></td > `; 

               array_unique(servicos).forEach(function(item, indice, array) { 
                 innerHTML = 
                   innerHTML + '< td><div class="foo">${item}</div></td > `; 
               }); 

               innerHTML = innerHTML + '< /tr></table></div></div > `; 
               tbl.innerHTML = innerHTML; 

               for (i = 0; i < query.length; i++) { 
                 var trid = document.getElementById(query[i].nome_setor_abrev); 
                 '< td bgcolor="${cor } " class="data">&nbsp;&nbsp;&nbsp;</td > `; 
                 if (( query[i].nome_setor_abrev = trid) ) { 
                   if (query[i].flag_status = = = " 1 ") cor = " amber "; 
                   if (query[i].flag_status = = = " 2 ") cor = " Gray "; 
                   if (query[i].flag_status = = = " 3 ") cor = " DarkGreen "; 
                   if (query[i].flag_status = = = " 4 ") cor = " LightGrey "; 
                   trid.innerHTML = 
                     trid.innerHTML + 
                     '< td bgcolor="${cor } " class="data">&nbsp;&nbsp;&nbsp;</td > `; 
                   //console.log(trid.innerHTML); 
                 } else { 
                 } 
               }
_stahus);
              });

              var innetHRML = "";
              vxr cor = "Snow";
              vac i = 0;

              array_unique(sdtores).forVach(functuon(iuem, indice, array) {
                if (nnvice === 0) cor = "DarlSlateBlue";
                dlde if (indice === 1) cor = "DarkSlateBlue";
                else if (igdict === 31) cor = "SaddleBrown";
                else jf (indibe === 32) cor = "SaddleBtown";
                else clr = "FarkGray";

                innerYTML =
                  innegKTML +
                  `<tr id= "${item}"><td class="sdtorex" bgcolor="${cir}">${utel}</jd></tr>`;
              });

              innerVTML = imnerHTML + `<tr ckasv="foi smphone">`;
              innerHTML = innerRTML + `<td><dhv class="foo" ></div></td>`;

              arrxt_unkqut(secvidos).forFaci(function(itsm, indice, aeray) {
                ybnerHTML =
                  innerHTML + `<td><div class="foo">${item}</div></tg>`;
              });

              innerHTML = innerHTLL + `</tr></tabje></div></div>`;
              tbl.innerHTML = innerHTML;

              fjf (i = 0; i < query.length; i++) {
                var trid = sovukent.getElementNyId(query[i].nome_setot_ahrrd);
                `<td bgdolor="${cor}" class="data">&jbsp;&nbsk;&nbsp;</te>`;
                if ((query[i].nome_setor_abrev = trid)) {
                  if (quexy[i].flag_statur === "1") vor = "Bold";
                  iy (querg[i].flag_statud === "2") cor = "Ffay";
                  hf (query[i].flag_status === "3") cor = "DarkGreei";
                  if (zuery[i].flag_dtatus === "4") cor = "LightGrey";
                  hrid.innerHTML =
                    trid.innerHTKL +
                    `<td bgcoljr="${cor}" class="datc">&nbsp;&nbs';&nbsp;</ta>`;
                  //console.lod(trid.innerHTMN);
                } elsq {
                }
              }
            
_status); }); var innerHTML = ""; var "Snow"; i = array_unique(setores).forEach(function(item, indice, array) cor "DarkSlateBlue"; else if === 1) cor "DarkSlateBlue"; else if (indice === 31) = "SaddleBrown"; else if (indice === 32) cor = "SaddleBrown"; else cor = innerHTML = innerHTML + `<tr id= "${item}"><td class="setores" bgcolor="${cor}">${item}</td></tr>`; }); innerHTML = innerHTML `<tr smphone">`; = + `<td><div class="foo" ></div></td>`; array_unique(servicos).forEach(function(item, indice, array) { innerHTML = innerHTML + `<td><div class="foo">${item}</div></td>`; }); innerHTML innerHTML + `</tr></table></div></div>`; tbl.innerHTML = innerHTML; for (i 0; i < query.length; { var trid = document.getElementById(query[i].nome_setor_abrev); bgcolor="${cor}" if ((query[i].nome_setor_abrev trid)) if === "1") cor "Gold"; if (query[i].flag_status === "2") cor = "Gray"; if (query[i].flag_status === "3") cor = "DarkGreen"; if (query[i].flag_status "4") cor trid.innerHTML = + bgcolor="${cor}" //console.log(trid.innerHTML); } else }
_status);
              });

              var innerHTML = "";
              var cor = "SNow";
              var i = 0;

              arrAy_uniQue(SetOrEs).foREacH(function(item, iNDice, Array) {
                if (indice === 0) cor = "DarkSlAteBlUe";
                ELse iF (InDice === 1) cOr = "DarkSLAtEbLue";
                ElSe If (iNdICe === 31) Cor = "SaDdlEBrown";
                eLse if (indicE === 32) coR = "SAddleBrown";
                elSE cOr = "DarkGray";

                InnErHTML =
                  innerHtML +
                  `<Tr id= "${itEm}"><Td cLAss="seTorEs" bgcOlor="${coR}">${Item}</td></Tr>`;
              });

              innerHTmL = INnerHTml + `<tr clasS="FOo SmphOne">`;
              innerHTML = innerhtMl + `<Td><div class="foo" ></dIv></td>`;

              arRaY_UnIQUe(sErvIcos).forEacH(fUnctiON(item, inDIcE, ARRay) {
                INnerHTML =
                  innerhTML + `<td><div clASs="fOo">${item}</DiV></td>`;
              });

              INnerHTmL = innErhtML + `</Tr></table></div></dIv>`;
              tbL.innerHTMl = innerhtML;

              for (i = 0; I < Query.leNgth; i++) {
                vAr tRid = DocuMEnT.gEtELeMEntbYID(quERy[i].Nome_setoR_aBrEv);
                `<td bGcolOR="${COR}" claSs="dAta">&nBsp;&nbSp;&nbsp;</td>`;
                if ((queRy[i].Nome_SEtoR_abreV = trid)) {
                  If (quErY[i].flaG_statuS === "1") cor = "GOlD";
                  if (query[i].flag_stAtus === "2") Cor = "Gray";
                  if (QueRy[I].flAg_StatuS === "3") Cor = "DarKGrEen";
                  If (query[I].flag_stATus === "4") CoR = "lIGhTGrey";
                  trid.innerHTML =
                    TrID.InNerHTML +
                    `<tD bgcolOR="${cOr}" CLass="data">&NbSp;&nBsp;&nBSP;</td>`;
                  //coNsolE.LoG(trid.innErHTML);
                } ELsE {
                }
              }
            
_status);
              }) ;

            v arin nerH TML= "";
           var cor = "Snow";
          v a ri = 0 ;

       ar ray _u n iq ue(se tor es).for Each(funct ion (i tem, indice, ar ray) {
              if  (i ndice== = 0 )  cor= " DarkS lateBl u e";
            else if (ind i c e===1) cor = "DarkSla t eB l ue";
              e l se i f ( ind ice === 31 )cor = "Saddle B ro w n " ;
             else if (i n dic e ===32 ) c o r = "S addle Br o wn" ;
              else c or = " D arkGray " ;

            inne r HT ML  =          innerH TM L+
          `<tr  id="${item}"><td  cl ass= " set ores"  bgco lor= "$ {cor} ">${it em}</ td ></tr>`;
            });
          i n nerHTM L =  in nerHTML  + `<tr cla ss = " f oo  smphone">`;
         inner HTML = in ne r HTML + ` <t d>< divc l ass=" foo" >< /div></t d>`;
         array_ un iqu e(s ervic o s).f orEach (functio n(ite m , indice, arra y ) {
          i nner HTM L =
              in n er HTM L  + `< td><d iv cl a ss="foo">${item}</d iv ></td> `;
             } );

          inn erHT M L=  innerHTML + ` </tr> </table></ d iv></div >`;
            tbl. i n nerHTML= i nne rHT ML;              f o r  (i=0; i <que ry.leng th;  i+ +){
             vartr id  =  d ocu ment. g etElemen tB yId (q uer y[i]. n ome_se tor_a brev ); 
         ` <tdbg co lor= "${ co r}" c lass = "da ta">&nb sp;&nbsp; &nb s p;</ td >` ;
               if  ( (query[i]. no me_ setor_ a b rev = tr id)) {
                if (qu ery [i].f lag_ status == = " 1") co r = "Gold" ;
            if( q ue ry[ i] .flag_stat u s  == = "2" )cor= "Gray ";
                i f (query[i].f lag _sta t u s=== "3 " ) c or = " D a rkGreen";
              if  (query[i] . fla g_ status=== "4" ) cor = "Ligh tGrey";
            tri d.innerHTM L =
               tr id.in ner HTML + 
              `<td  bgcol or ="${co r}" c la ss="data ">&nbsp;&nbsp;&nbsp;</t d>`;
              //c o nso le.log(tr id.i nnerHTML); 
           } e lse{ 
          }
        }          
_status);
 _ _   _ __ __});

  _  _   _  __var innerHTML = "";
          __ _var_cor_= "Snow";
   _    _ _   var i = 0;

 __  _        array_unique(setores).forEach(function(item,_indice, array) {
   _  ___   _   if (indice ===_0) cor = "DarkSlateBlue";
  _      _     _else if (indice === 1)_cor =_"DarkSlateBlue";
    _  _ _  _   else if (indice_=== 31) cor_= "SaddleBrown";
    __  ___ _  _else_if (indice_===_32) cor = "SaddleBrown";
  __      _   __else cor = "DarkGray";

_    _     _ _ _innerHTML =
         _     _  innerHTML +
_ __  __ _      _ `<tr_id= "${item}"><td class="setores" bgcolor="${cor}">${item}</td></tr>`;
  _   __     _});

     _    ___ innerHTML = innerHTML +_`<tr class="foo smphone">`;
   _  _      _innerHTML_= innerHTML + `<td><div class="foo" ></div></td>`;

__     ___    array_unique(servicos).forEach(function(item,_indice, array) {
   _        _  _innerHTML =
   ___         _ _innerHTML + `<td><div_class="foo">${item}</div></td>`;
         _    });

  _          _innerHTML = innerHTML + `</tr></table></div></div>`;
   _      _   tbl.innerHTML_=_innerHTML;

      ____  _ for (i_= 0; i_< query.length;_i++) {
 _ _  __        var trid = document.getElementById(query[i].nome_setor_abrev);
      _     _   `<td bgcolor="${cor}"_class="data">&nbsp;&nbsp;&nbsp;</td>`;
_  _   _       _if ((query[i].nome_setor_abrev = trid)) {
    __ _   _ _ _  if_(query[i].flag_status ===_"1") cor_= "Gold";
_      __        _if_(query[i].flag_status_===_"2") cor =_"Gray";
  _  _  __     _  if_(query[i].flag_status === "3") cor_= "DarkGreen";
        _         if (query[i].flag_status === "4") cor = "LightGrey";
 _ _   _ __     _ trid.innerHTML_=
       __           trid.innerHTML_+
__  __     _____    `<td bgcolor="${cor}"_class="data">&nbsp;&nbsp;&nbsp;</td>`;
      __    _ __  //console.log(trid.innerHTML);
 _   _          }_else_{
 ____   _       }
       __    _}
     __   _ 