<?php
class pdfreport_wastetransactions_grid
{
   var $Ini;
   var $Erro;
   var $Pdf;
   var $Db;
   var $rs_grid;
   var $nm_grid_sem_reg;
   var $SC_seq_register;
   var $nm_location;
   var $nm_data;
   var $nm_cod_barra;
   var $sc_proc_grid; 
   var $nmgp_botoes = array();
   var $Campos_Mens_erro;
   var $NM_raiz_img; 
   var $Font_ttf; 
   var $email = array();
   var $envregistrationno = array();
   var $fdestaddress = array();
   var $fdestaepo = array();
   var $fdestphone = array();
   var $fdestrespone = array();
   var $fdestresponseemail = array();
   var $phone = array();
   var $produceraepo = array();
   var $producerb_address = array();
   var $responsename = array();
   var $wttransporterresponse = array();
   var $wtid = array();
   var $wtprofilid = array();
   var $intnumber = array();
   var $wtrequestdate = array();
   var $wtproducerbranchid = array();
   var $wtproducerperiferia = array();
   var $wtproducerewc = array();
   var $ewc1 = array();
   var $wtproduceracceptweigth = array();
   var $wtproducerqty = array();
   var $wtprducerm3 = array();
   var $wtproducerremarks = array();
   var $wtproducervalidate = array();
   var $wttransportdate = array();
   var $wttransporterid = array();
   var $wttransporterperiferiaid = array();
   var $wttransporterewc = array();
   var $wttransportervechicle = array();
   var $wttransportervalidate = array();
   var $wttransportervalidateip = array();
   var $wttransporternumberid = array();
   var $wtfdestdate = array();
   var $wtfdestid = array();
   var $wtfdestperiferia = array();
   var $wtfdestewc = array();
   var $ewc2 = array();
   var $wtfdestrd = array();
   var $wtfdestqty = array();
   var $wtfdestm3 = array();
   var $wtfdestvlidated = array();
   var $wtfdestvalidateip = array();
   var $wtproducersign = array();
   var $wttransportersign = array();
   var $wtfdestsign = array();
   var $look_wtproduceracceptweigth = array();
//--- 
 function monta_grid($linhas = 0)
 {

   clearstatcache();
   $this->inicializa();
   $this->grid();
 }
//--- 
 function inicializa()
 {
   global $nm_saida, 
   $rec, $nmgp_chave, $nmgp_opcao, $nmgp_ordem, $nmgp_chave_det, 
   $nmgp_quant_linhas, $nmgp_quant_colunas, $nmgp_url_saida, $nmgp_parms;
//
   $this->nm_data = new nm_data("el");
   include_once("../_lib/lib/php/nm_font_tcpdf.php");
   $this->default_font = '';
   $this->default_font_sr  = '';
   $this->default_style    = '';
   $this->default_style_sr = 'B';
   $Tp_papel = "A4";
   $old_dir = getcwd();
   $File_font_ttf     = "";
   $temp_font_ttf     = "";
   $this->Font_ttf    = false;
   $this->Font_ttf_sr = false;
   if (empty($this->default_font) && isset($arr_font_tcpdf[$this->Ini->str_lang]))
   {
       $this->default_font = $arr_font_tcpdf[$this->Ini->str_lang];
   }
   elseif (empty($this->default_font))
   {
       $this->default_font = "Times";
   }
   if (empty($this->default_font_sr) && isset($arr_font_tcpdf[$this->Ini->str_lang]))
   {
       $this->default_font_sr = $arr_font_tcpdf[$this->Ini->str_lang];
   }
   elseif (empty($this->default_font_sr))
   {
       $this->default_font_sr = "Times";
   }
   $_SESSION['scriptcase']['pdfreport_wastetransactions']['default_font'] = $this->default_font;
   chdir($this->Ini->path_third . "/tcpdf/");
   include_once("tcpdf.php");
   chdir($old_dir);
   $this->Pdf = new TCPDF('P', 'mm', $Tp_papel, true, 'UTF-8', false);
   $this->Pdf->setPrintHeader(false);
   $this->Pdf->setPrintFooter(false);
   if (!empty($File_font_ttf))
   {
       $this->Pdf->addTTFfont($File_font_ttf, "", "", 32, $_SESSION['scriptcase']['dir_temp'] . "/");
   }
   $this->Pdf->SetDisplayMode('real');
   $this->aba_iframe = false;
   if (isset($_SESSION['scriptcase']['sc_aba_iframe']))
   {
       foreach ($_SESSION['scriptcase']['sc_aba_iframe'] as $aba => $apls_aba)
       {
           if (in_array("pdfreport_wastetransactions", $apls_aba))
           {
               $this->aba_iframe = true;
               break;
           }
       }
   }
   if ($_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['iframe_menu'] && (!isset($_SESSION['scriptcase']['menu_mobile']) || empty($_SESSION['scriptcase']['menu_mobile'])))
   {
       $this->aba_iframe = true;
   }
   $this->nmgp_botoes['exit'] = "on";
   $this->sc_proc_grid = false; 
   $this->NM_raiz_img = $this->Ini->root;
   $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; 
   $this->nm_where_dinamico = "";
   $this->nm_grid_colunas = 0;
   if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['campos_busca']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['campos_busca']))
   { 
       $Busca_temp = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['campos_busca'];
       if ($_SESSION['scriptcase']['charset'] != "UTF-8")
       {
           $Busca_temp = NM_conv_charset($Busca_temp, $_SESSION['scriptcase']['charset'], "UTF-8");
       }
       $this->wtid[0] = $Busca_temp['wtid']; 
       $tmp_pos = strpos($this->wtid[0], "##@@");
       if ($tmp_pos !== false)
       {
           $this->wtid[0] = substr($this->wtid[0], 0, $tmp_pos);
       }
       $wtid_2 = $Busca_temp['wtid_input_2']; 
       $this->wtid_2 = $Busca_temp['wtid_input_2']; 
       $this->wtprofilid[0] = $Busca_temp['wtprofilid']; 
       $tmp_pos = strpos($this->wtprofilid[0], "##@@");
       if ($tmp_pos !== false)
       {
           $this->wtprofilid[0] = substr($this->wtprofilid[0], 0, $tmp_pos);
       }
       $wtprofilid_2 = $Busca_temp['wtprofilid_input_2']; 
       $this->wtprofilid_2 = $Busca_temp['wtprofilid_input_2']; 
       $this->intnumber[0] = $Busca_temp['intnumber']; 
       $tmp_pos = strpos($this->intnumber[0], "##@@");
       if ($tmp_pos !== false)
       {
           $this->intnumber[0] = substr($this->intnumber[0], 0, $tmp_pos);
       }
       $intnumber_2 = $Busca_temp['intnumber_input_2']; 
       $this->intnumber_2 = $Busca_temp['intnumber_input_2']; 
       $this->wtrequestdate[0] = $Busca_temp['wtrequestdate']; 
       $tmp_pos = strpos($this->wtrequestdate[0], "##@@");
       if ($tmp_pos !== false)
       {
           $this->wtrequestdate[0] = substr($this->wtrequestdate[0], 0, $tmp_pos);
       }
       $wtrequestdate_2 = $Busca_temp['wtrequestdate_input_2']; 
       $this->wtrequestdate_2 = $Busca_temp['wtrequestdate_input_2']; 
       $this->wtfdestrd[0] = $Busca_temp['wtfdestrd']; 
       $tmp_pos = strpos($this->wtfdestrd[0], "##@@");
       if ($tmp_pos !== false)
       {
           $this->wtfdestrd[0] = substr($this->wtfdestrd[0], 0, $tmp_pos);
       }
   } 
   else 
   { 
       $this->wtrequestdate_2 = ""; 
   } 
   $this->nm_field_dinamico = array();
   $this->nm_order_dinamico = array();
   $this->sc_where_orig   = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_orig'];
   $this->sc_where_atual  = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq'];
   $this->sc_where_filtro = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq_filtro'];
   $dir_raiz          = strrpos($_SERVER['PHP_SELF'],"/") ;  
   $dir_raiz          = substr($_SERVER['PHP_SELF'], 0, $dir_raiz + 1) ;  
   $this->nm_location = $this->Ini->sc_protocolo . $this->Ini->server . $dir_raiz; 
   $_SESSION['scriptcase']['contr_link_emb'] = $this->nm_location;
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['qt_col_grid'] = 1 ;  
   if (isset($_SESSION['scriptcase']['sc_apl_conf']['pdfreport_wastetransactions']['cols']) && !empty($_SESSION['scriptcase']['sc_apl_conf']['pdfreport_wastetransactions']['cols']))
   {
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['qt_col_grid'] = $_SESSION['scriptcase']['sc_apl_conf']['pdfreport_wastetransactions']['cols'];  
       unset($_SESSION['scriptcase']['sc_apl_conf']['pdfreport_wastetransactions']['cols']);
   }
   if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_select']))  
   { 
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_select'] = array(); 
   } 
   if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_quebra']))  
   { 
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_grid'] = "" ; 
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_ant']  = ""; 
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_desc'] = "" ; 
   }   
   if (!empty($nmgp_parms) && $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['opcao'] != "pdf")   
   { 
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['opcao'] = "igual";
       $rec = "ini";
   }
   if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_orig']) || $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['prim_cons'] || !empty($nmgp_parms))  
   { 
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['prim_cons'] = false;  
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_orig'] = " where wastetransactions.wtid = " . $_SESSION['wtidlink'] . "";  
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq']        = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_orig'];  
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq_ant']    = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_orig'];  
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['cond_pesq']         = ""; 
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq_filtro'] = "";
   }   
   if  (!empty($this->nm_where_dinamico)) 
   {   
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq'] .= $this->nm_where_dinamico;
   }   
   $this->sc_where_orig   = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_orig'];
   $this->sc_where_atual  = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq'];
   $this->sc_where_filtro = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq_filtro'];
//
   if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['tot_geral'][1])) 
   { 
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['sc_total'] = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['tot_geral'][1] ;  
   }
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq_ant'] = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq'];  
//----- 
   if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql))
   { 
       $nmgp_select = "SELECT wtid, wtProfilID, INTNUMBER, wtRequestDate, wtProducerBranchID, wtProducerPeriferia, wtProducerEwc, wtProducerEwc as ewc1, wtProducerAcceptWeigth, wtProducerQty, wtPrducerm3, wtProducerRemarks, wtProducerValidate, wtTransportDate, wtTransporterID, wtTransporterPeriferiaID, wtTransporterEWC, wtTransporterVechicle, wtTransporterValidate, wtTransporterValidateIP, wtTransporterNumberID, wtFdestDate, wtFDestID, wtFDestPeriferia, wtFDestEWC, wtFDestEWC as ewc2, wtFDestRD, wtFDestQty, wtFDestM3, wtFDestVlidated, wtFDestValidateIP, wtProducerSign, wtTransporterSign, wtFDestSign from " . $this->Ini->nm_tabela; 
   } 
   else 
   { 
       $nmgp_select = "SELECT wtid, wtProfilID, INTNUMBER, wtRequestDate, wtProducerBranchID, wtProducerPeriferia, wtProducerEwc, wtProducerEwc as ewc1, wtProducerAcceptWeigth, wtProducerQty, wtPrducerm3, wtProducerRemarks, wtProducerValidate, wtTransportDate, wtTransporterID, wtTransporterPeriferiaID, wtTransporterEWC, wtTransporterVechicle, wtTransporterValidate, wtTransporterValidateIP, wtTransporterNumberID, wtFdestDate, wtFDestID, wtFDestPeriferia, wtFDestEWC, wtFDestEWC as ewc2, wtFDestRD, wtFDestQty, wtFDestM3, wtFDestVlidated, wtFDestValidateIP, wtProducerSign, wtTransporterSign, wtFDestSign from " . $this->Ini->nm_tabela; 
   } 
   $nmgp_select .= " " . $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq']; 
   $nmgp_order_by = ""; 
   $campos_order_select = "";
   foreach($_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_select'] as $campo => $ordem) 
   {
        if ($campo != $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_grid']) 
        {
           if (!empty($campos_order_select)) 
           {
               $campos_order_select .= ", ";
           }
           $campos_order_select .= $campo . " " . $ordem;
        }
   }
   if (!empty($_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_grid'])) 
   { 
       $nmgp_order_by = " order by " . $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_grid'] . $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['ordem_desc']; 
   } 
   if (!empty($campos_order_select)) 
   { 
       if (!empty($nmgp_order_by)) 
       { 
          $nmgp_order_by .= ", " . $campos_order_select; 
       } 
       else 
       { 
          $nmgp_order_by = " order by $campos_order_select"; 
       } 
   } 
   $nmgp_select .= $nmgp_order_by; 
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['order_grid'] = $nmgp_order_by;
   $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nmgp_select; 
   $this->rs_grid = $this->Db->Execute($nmgp_select) ; 
   if ($this->rs_grid === false && !$this->rs_grid->EOF && $GLOBALS["NM_ERRO_IBASE"] != 1) 
   { 
       $this->Erro->mensagem(__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); 
       exit ; 
   }  
   if ($this->rs_grid->EOF || ($this->rs_grid === false && $GLOBALS["NM_ERRO_IBASE"] == 1)) 
   { 
       $this->nm_grid_sem_reg = $this->Ini->Nm_lang['lang_errm_empt']; 
   }  
// 
 }  
// 
 function Pdf_init()
 {
     if ($_SESSION['scriptcase']['reg_conf']['css_dir'] == "RTL")
     {
         $this->Pdf->setRTL(true);
     }
     $this->Pdf->setHeaderMargin(0);
     $this->Pdf->setFooterMargin(0);
     $this->Pdf->setCellMargins($left = 0, $top = 0, $right = 0, $bottom = 0);
     $this->Pdf->SetAutoPageBreak(true, 0);
     if ($this->Font_ttf)
     {
         $this->Pdf->SetFont($this->default_font, $this->default_style, 12, $this->def_TTF);
     }
     else
     {
         $this->Pdf->SetFont($this->default_font, $this->default_style, 12);
     }
     $this->Pdf->SetTextColor(0, 0, 0);
 }
// 
 function Pdf_image()
 {
   if ($_SESSION['scriptcase']['reg_conf']['css_dir'] == "RTL")
   {
       $this->Pdf->setRTL(false);
   }
   $SV_margin = $this->Pdf->getBreakMargin();
   $SV_auto_page_break = $this->Pdf->getAutoPageBreak();
   $this->Pdf->SetAutoPageBreak(false, 0);
   $this->Pdf->Image($this->NM_raiz_img . $this->Ini->path_img_global . "/grp__NM__bg__NM__formewc.jpg", 1, 1, 210, 297, '', '', '', false, 300, '', false, false, 0);
   $this->Pdf->SetAutoPageBreak($SV_auto_page_break, $SV_margin);
   $this->Pdf->setPageMark();
   if ($_SESSION['scriptcase']['reg_conf']['css_dir'] == "RTL")
   {
       $this->Pdf->setRTL(true);
   }
 }
// 
//----- 
 function grid($linhas = 0)
 {
    global 
           $nm_saida, $nm_url_saida;
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtid'] = "Wtid";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtprofilid'] = "Wt Profil ID";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['intnumber'] = "INTNUMBER";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtrequestdate'] = "Wt Request Date";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtproducerbranchid'] = "Wt Producer Branch ID";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtproducerperiferia'] = "Wt Producer Periferia";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtproducerewc'] = "Wt Producer Ewc";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['ewc1'] = "Ewc 1";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtproduceracceptweigth'] = "Wt Producer Accept Weigth";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtproducerqty'] = "Wt Producer Qty";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtprducerm3'] = "Wt Prducerm 3";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtproducerremarks'] = "Wt Producer Remarks";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtproducervalidate'] = "Wt Producer Validate";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wttransportdate'] = "Wt Transport Date";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wttransporterid'] = "Wt Transporter ID";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wttransporterperiferiaid'] = "Wt Transporter Periferia ID";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wttransporterewc'] = "Wt Transporter EWC";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wttransportervechicle'] = "Wt Transporter Vechicle";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wttransportervalidate'] = "Wt Transporter Validate";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wttransportervalidateip'] = "Wt Transporter Validate IP";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wttransporternumberid'] = "Wt Transporter Number ID";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtfdestdate'] = "Wt Fdest Date";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtfdestid'] = "Wt F Dest ID";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtfdestperiferia'] = "Wt F Dest Periferia";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtfdestewc'] = "Wt F Dest EWC";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['ewc2'] = "Ewc 2";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtfdestrd'] = "Wt F Dest RD";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtfdestqty'] = "Wt F Dest Qty";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtfdestm3'] = "Wt F Dest M3";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtfdestvlidated'] = "Wt F Dest Vlidated";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtfdestvalidateip'] = "Wt F Dest Validate IP";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtproducersign'] = "wtproducersign";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wttransportersign'] = "Wt Transporter Sign";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wtfdestsign'] = "Wt F Dest Sign";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['email'] = "Email";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['envregistrationno'] = "EnvRegistrationNo";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['fdestaddress'] = "FDestAddress";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['fdestaepo'] = "FDestAepo";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['fdestphone'] = "FDestPhone";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['fdestrespone'] = "FDestRespone";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['fdestresponseemail'] = "FDestResponseEmail";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['phone'] = "Phone";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['produceraepo'] = "ProducerAEPO";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['producerb_address'] = "ProducerB_Address";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['responsename'] = "ResponseName";
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['labels']['wttransporterresponse'] = "wtTransporterResponse";
   $HTTP_REFERER = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : ""; 
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['seq_dir'] = 0; 
   $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['sub_dir'] = array(); 
   $this->sc_where_orig   = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_orig'];
   $this->sc_where_atual  = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq'];
   $this->sc_where_filtro = $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['where_pesq_filtro'];
   if (isset($_SESSION['scriptcase']['sc_apl_conf']['pdfreport_wastetransactions']['lig_edit']) && $_SESSION['scriptcase']['sc_apl_conf']['pdfreport_wastetransactions']['lig_edit'] != '')
   {
       $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['mostra_edit'] = $_SESSION['scriptcase']['sc_apl_conf']['pdfreport_wastetransactions']['lig_edit'];
   }
   if (!empty($this->nm_grid_sem_reg))
   {
       $this->Pdf_init();
       $this->Pdf->AddPage();
       if ($this->Font_ttf_sr)
       {
           $this->Pdf->SetFont($this->default_font_sr, 'B', 12, $this->def_TTF);
       }
       else
       {
           $this->Pdf->SetFont($this->default_font_sr, 'B', 12);
       }
       $this->Pdf->SetTextColor(0, 0, 0);
       $this->Pdf->Text(10, 10, html_entity_decode($this->nm_grid_sem_reg, ENT_COMPAT, $_SESSION['scriptcase']['charset']));
       $this->Pdf->Output($this->Ini->root . $this->Ini->nm_path_pdf, 'F');
       return;
   }
// 
   $Init_Pdf = true;
   $this->SC_seq_register = 0; 
   while (!$this->rs_grid->EOF) 
   {  
      $this->nm_grid_colunas = 0; 
      $nm_quant_linhas = 0;
      $this->Pdf->setImageScale(1.33);
      $this->Pdf->AddPage();
      $this->Pdf_init();
      $this->Pdf_image();
      while (!$this->rs_grid->EOF && $nm_quant_linhas < $_SESSION['sc_session'][$this->Ini->sc_page]['pdfreport_wastetransactions']['qt_col_grid']) 
      {  
          $this->sc_proc_grid = true;
          $this->SC_seq_register++; 
          $this->wtid[$this->nm_grid_colunas] = $this->rs_grid->fields[0] ;  
          $this->wtid[$this->nm_grid_colunas] = (string)$this->wtid[$this->nm_grid_colunas];
          $this->wtprofilid[$this->nm_grid_colunas] = $this->rs_grid->fields[1] ;  
          $this->wtprofilid[$this->nm_grid_colunas] = (string)$this->wtprofilid[$this->nm_grid_colunas];
          $this->intnumber[$this->nm_grid_colunas] = $this->rs_grid->fields[2] ;  
          $this->intnumber[$this->nm_grid_colunas] = (string)$this->intnumber[$this->nm_grid_colunas];
          $this->wtrequestdate[$this->nm_grid_colunas] = $this->rs_grid->fields[3] ;  
          $this->wtproducerbranchid[$this->nm_grid_colunas] = $this->rs_grid->fields[4] ;  
          $this->wtproducerbranchid[$this->nm_grid_colunas] = (string)$this->wtproducerbranchid[$this->nm_grid_colunas];
          $this->wtproducerperiferia[$this->nm_grid_colunas] = $this->rs_grid->fields[5] ;  
          $this->wtproducerperiferia[$this->nm_grid_colunas] = (string)$this->wtproducerperiferia[$this->nm_grid_colunas];
          $this->wtproducerewc[$this->nm_grid_colunas] = $this->rs_grid->fields[6] ;  
          $this->ewc1[$this->nm_grid_colunas] = $this->rs_grid->fields[7] ;  
          $this->wtproduceracceptweigth[$this->nm_grid_colunas] = $this->rs_grid->fields[8] ;  
          $this->wtproduceracceptweigth[$this->nm_grid_colunas] = (string)$this->wtproduceracceptweigth[$this->nm_grid_colunas];
          $this->wtproducerqty[$this->nm_grid_colunas] = $this->rs_grid->fields[9] ;  
          $this->wtproducerqty[$this->nm_grid_colunas] = (string)$this->wtproducerqty[$this->nm_grid_colunas];
          $this->wtprducerm3[$this->nm_grid_colunas] = $this->rs_grid->fields[10] ;  
          $this->wtprducerm3[$this->nm_grid_colunas] = (string)$this->wtprducerm3[$this->nm_grid_colunas];
          $this->wtproducerremarks[$this->nm_grid_colunas] = $this->rs_grid->fields[11] ;  
          $this->wtproducervalidate[$this->nm_grid_colunas] = $this->rs_grid->fields[12] ;  
          $this->wttransportdate[$this->nm_grid_colunas] = $this->rs_grid->fields[13] ;  
          $this->wttransporterid[$this->nm_grid_colunas] = $this->rs_grid->fields[14] ;  
          $this->wttransporterid[$this->nm_grid_colunas] = (string)$this->wttransporterid[$this->nm_grid_colunas];
          $this->wttransporterperiferiaid[$this->nm_grid_colunas] = $this->rs_grid->fields[15] ;  
          $this->wttransporterperiferiaid[$this->nm_grid_colunas] = (string)$this->wttransporterperiferiaid[$this->nm_grid_colunas];
          $this->wttransporterewc[$this->nm_grid_colunas] = $this->rs_grid->fields[16] ;  
          $this->wttransportervechicle[$this->nm_grid_colunas] = $this->rs_grid->fields[17] ;  
          $this->wttransportervalidate[$this->nm_grid_colunas] = $this->rs_grid->fields[18] ;  
          $this->wttransportervalidate[$this->nm_grid_colunas] = (string)$this->wttransportervalidate[$this->nm_grid_colunas];
          $this->wttransportervalidateip[$this->nm_grid_colunas] = $this->rs_grid->fields[19] ;  
          $this->wttransporternumberid[$this->nm_grid_colunas] = $this->rs_grid->fields[20] ;  
          $this->wtfdestdate[$this->nm_grid_colunas] = $this->rs_grid->fields[21] ;  
          $this->wtfdestid[$this->nm_grid_colunas] = $this->rs_grid->fields[22] ;  
          $this->wtfdestid[$this->nm_grid_colunas] = (string)$this->wtfdestid[$this->nm_grid_colunas];
          $this->wtfdestperiferia[$this->nm_grid_colunas] = $this->rs_grid->fields[23] ;  
          $this->wtfdestperiferia[$this->nm_grid_colunas] = (string)$this->wtfdestperiferia[$this->nm_grid_colunas];
          $this->wtfdestewc[$this->nm_grid_colunas] = $this->rs_grid->fields[24] ;  
          $this->ewc2[$this->nm_grid_colunas] = $this->rs_grid->fields[25] ;  
          $this->wtfdestrd[$this->nm_grid_colunas] = $this->rs_grid->fields[26] ;  
          $this->wtfdestqty[$this->nm_grid_colunas] = $this->rs_grid->fields[27] ;  
          $this->wtfdestqty[$this->nm_grid_colunas] = (string)$this->wtfdestqty[$this->nm_grid_colunas];
          $this->wtfdestm3[$this->nm_grid_colunas] = $this->rs_grid->fields[28] ;  
          $this->wtfdestm3[$this->nm_grid_colunas] = (string)$this->wtfdestm3[$this->nm_grid_colunas];
          $this->wtfdestvlidated[$this->nm_grid_colunas] = $this->rs_grid->fields[29] ;  
          $this->wtfdestvlidated[$this->nm_grid_colunas] = (string)$this->wtfdestvlidated[$this->nm_grid_colunas];
          $this->wtfdestvalidateip[$this->nm_grid_colunas] = $this->rs_grid->fields[30] ;  
          $this->wtproducersign[$this->nm_grid_colunas] = $this->rs_grid->fields[31] ;  
          $this->wttransportersign[$this->nm_grid_colunas] = $this->rs_grid->fields[32] ;  
          $this->wtfdestsign[$this->nm_grid_colunas] = $this->rs_grid->fields[33] ;  
          $this->look_wtproduceracceptweigth[$this->nm_grid_colunas] = $this->wtproduceracceptweigth[$this->nm_grid_colunas]; 
   $this->Lookup->lookup_wtproduceracceptweigth($this->look_wtproduceracceptweigth[$this->nm_grid_colunas]); 
          $this->email[$this->nm_grid_colunas] = "";
          $this->envregistrationno[$this->nm_grid_colunas] = "";
          $this->fdestaddress[$this->nm_grid_colunas] = "";
          $this->fdestaepo[$this->nm_grid_colunas] = "";
          $this->fdestphone[$this->nm_grid_colunas] = "";
          $this->fdestrespone[$this->nm_grid_colunas] = "";
          $this->fdestresponseemail[$this->nm_grid_colunas] = "";
          $this->phone[$this->nm_grid_colunas] = "";
          $this->produceraepo[$this->nm_grid_colunas] = "";
          $this->producerb_address[$this->nm_grid_colunas] = "";
          $this->responsename[$this->nm_grid_colunas] = "";
          $this->wttransporterresponse[$this->nm_grid_colunas] = "";
          $_SESSION['scriptcase']['pdfreport_wastetransactions']['contr_erro'] = 'on';
  $this->loadDetails();
$_SESSION['scriptcase']['pdfreport_wastetransactions']['contr_erro'] = 'off';
          $this->wtid[$this->nm_grid_colunas] = $this->wtid[$this->nm_grid_colunas];
          if ($this->wtid[$this->nm_grid_colunas] === "") 
          { 
              $this->wtid[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->wtid[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_num'], $_SESSION['scriptcase']['reg_conf']['dec_num'], "0", "S", "2", "", "N:" . $_SESSION['scriptcase']['reg_conf']['neg_num'] , $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['num_group_digit']) ; 
          } 
          $this->wtid[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtid[$this->nm_grid_colunas]);
          $this->Lookup->lookup_wtprofilid($this->wtprofilid[$this->nm_grid_colunas] , $this->wtprofilid[$this->nm_grid_colunas]) ; 
          $this->wtprofilid[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtprofilid[$this->nm_grid_colunas]);
          $this->intnumber[$this->nm_grid_colunas] = $this->intnumber[$this->nm_grid_colunas];
          if ($this->intnumber[$this->nm_grid_colunas] === "") 
          { 
              $this->intnumber[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->intnumber[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_num'], $_SESSION['scriptcase']['reg_conf']['dec_num'], "0", "S", "2", "", "N:" . $_SESSION['scriptcase']['reg_conf']['neg_num'] , $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['num_group_digit']) ; 
          } 
          $this->intnumber[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->intnumber[$this->nm_grid_colunas]);
          $this->wtrequestdate[$this->nm_grid_colunas] = $this->wtrequestdate[$this->nm_grid_colunas];
          if ($this->wtrequestdate[$this->nm_grid_colunas] === "") 
          { 
              $this->wtrequestdate[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
               $wtrequestdate_x =  $this->wtrequestdate[$this->nm_grid_colunas];
               nm_conv_limpa_dado($wtrequestdate_x, "YYYY-MM-DD");
               if (is_numeric($wtrequestdate_x) && $wtrequestdate_x > 0) 
               { 
                   $this->nm_data->SetaData($this->wtrequestdate[$this->nm_grid_colunas], "YYYY-MM-DD");
                   $this->wtrequestdate[$this->nm_grid_colunas] = html_entity_decode($this->nm_data->FormataSaida($this->nm_data->FormatRegion("DT", "ddmmaaaa")), ENT_COMPAT, $_SESSION['scriptcase']['charset']);
               } 
          } 
          $this->wtrequestdate[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtrequestdate[$this->nm_grid_colunas]);
          $this->Lookup->lookup_wtproducerbranchid($this->wtproducerbranchid[$this->nm_grid_colunas] , $this->wtproducerbranchid[$this->nm_grid_colunas]) ; 
          $this->wtproducerbranchid[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtproducerbranchid[$this->nm_grid_colunas]);
          $this->wtproducerperiferia[$this->nm_grid_colunas] = $this->wtproducerperiferia[$this->nm_grid_colunas];
          if ($this->wtproducerperiferia[$this->nm_grid_colunas] === "") 
          { 
              $this->wtproducerperiferia[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->wtproducerperiferia[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_num'], $_SESSION['scriptcase']['reg_conf']['dec_num'], "0", "S", "2", "", "N:" . $_SESSION['scriptcase']['reg_conf']['neg_num'] , $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['num_group_digit']) ; 
          } 
          $this->wtproducerperiferia[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtproducerperiferia[$this->nm_grid_colunas]);
          $this->Lookup->lookup_wtproducerewc($this->wtproducerewc[$this->nm_grid_colunas] , $this->wtproducerewc[$this->nm_grid_colunas]) ; 
          $this->wtproducerewc[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtproducerewc[$this->nm_grid_colunas]);
          $this->ewc1[$this->nm_grid_colunas] = $this->ewc1[$this->nm_grid_colunas];
          if ($this->ewc1[$this->nm_grid_colunas] === "") 
          { 
              $this->ewc1[$this->nm_grid_colunas] = "" ;  
          } 
          $this->ewc1[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->ewc1[$this->nm_grid_colunas]);
          $this->wtproduceracceptweigth[$this->nm_grid_colunas] = trim($this->look_wtproduceracceptweigth[$this->nm_grid_colunas]); 
          if ($this->wtproduceracceptweigth[$this->nm_grid_colunas] === "") 
          { 
              $this->wtproduceracceptweigth[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wtproduceracceptweigth[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtproduceracceptweigth[$this->nm_grid_colunas]);
          $this->wtproducerqty[$this->nm_grid_colunas] = $this->wtproducerqty[$this->nm_grid_colunas];
          if ($this->wtproducerqty[$this->nm_grid_colunas] === "") 
          { 
              $this->wtproducerqty[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->wtproducerqty[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_num'], $_SESSION['scriptcase']['reg_conf']['dec_num'], "3", "S", "2", "", "N:" . $_SESSION['scriptcase']['reg_conf']['neg_num'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['num_group_digit']) ; 
          } 
          $this->wtproducerqty[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtproducerqty[$this->nm_grid_colunas]);
          $this->wtprducerm3[$this->nm_grid_colunas] = $this->wtprducerm3[$this->nm_grid_colunas];
          if ($this->wtprducerm3[$this->nm_grid_colunas] === "") 
          { 
              $this->wtprducerm3[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->wtprducerm3[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_num'], $_SESSION['scriptcase']['reg_conf']['dec_num'], "0", "S", "2", "", "N:" . $_SESSION['scriptcase']['reg_conf']['neg_num'] , $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['num_group_digit']) ; 
          } 
          $this->wtprducerm3[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtprducerm3[$this->nm_grid_colunas]);
          $this->wtproducerremarks[$this->nm_grid_colunas] = $this->wtproducerremarks[$this->nm_grid_colunas];
          if ($this->wtproducerremarks[$this->nm_grid_colunas] === "") 
          { 
              $this->wtproducerremarks[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wtproducerremarks[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtproducerremarks[$this->nm_grid_colunas]);
          $this->wtproducervalidate[$this->nm_grid_colunas] = $this->wtproducervalidate[$this->nm_grid_colunas];
          if ($this->wtproducervalidate[$this->nm_grid_colunas] === "") 
          { 
              $this->wtproducervalidate[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wtproducervalidate[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtproducervalidate[$this->nm_grid_colunas]);
          $this->wttransportdate[$this->nm_grid_colunas] = $this->wttransportdate[$this->nm_grid_colunas];
          if ($this->wttransportdate[$this->nm_grid_colunas] === "") 
          { 
              $this->wttransportdate[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
               $wttransportdate_x =  $this->wttransportdate[$this->nm_grid_colunas];
               nm_conv_limpa_dado($wttransportdate_x, "YYYY-MM-DD");
               if (is_numeric($wttransportdate_x) && $wttransportdate_x > 0) 
               { 
                   $this->nm_data->SetaData($this->wttransportdate[$this->nm_grid_colunas], "YYYY-MM-DD");
                   $this->wttransportdate[$this->nm_grid_colunas] = html_entity_decode($this->nm_data->FormataSaida($this->nm_data->FormatRegion("DT", "ddmmaaaa")), ENT_COMPAT, $_SESSION['scriptcase']['charset']);
               } 
          } 
          $this->wttransportdate[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wttransportdate[$this->nm_grid_colunas]);
          $this->wttransporterid[$this->nm_grid_colunas] = $this->wttransporterid[$this->nm_grid_colunas];
          if ($this->wttransporterid[$this->nm_grid_colunas] === "") 
          { 
              $this->wttransporterid[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->wttransporterid[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_num'], $_SESSION['scriptcase']['reg_conf']['dec_num'], "0", "S", "2", "", "N:" . $_SESSION['scriptcase']['reg_conf']['neg_num'] , $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['num_group_digit']) ; 
          } 
          $this->wttransporterid[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wttransporterid[$this->nm_grid_colunas]);
          $this->wttransporterperiferiaid[$this->nm_grid_colunas] = $this->wttransporterperiferiaid[$this->nm_grid_colunas];
          if ($this->wttransporterperiferiaid[$this->nm_grid_colunas] === "") 
          { 
              $this->wttransporterperiferiaid[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->wttransporterperiferiaid[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_num'], $_SESSION['scriptcase']['reg_conf']['dec_num'], "0", "S", "2", "", "N:" . $_SESSION['scriptcase']['reg_conf']['neg_num'] , $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['num_group_digit']) ; 
          } 
          $this->wttransporterperiferiaid[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wttransporterperiferiaid[$this->nm_grid_colunas]);
          $this->wttransporterewc[$this->nm_grid_colunas] = $this->wttransporterewc[$this->nm_grid_colunas];
          if ($this->wttransporterewc[$this->nm_grid_colunas] === "") 
          { 
              $this->wttransporterewc[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wttransporterewc[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wttransporterewc[$this->nm_grid_colunas]);
          $this->wttransportervechicle[$this->nm_grid_colunas] = $this->wttransportervechicle[$this->nm_grid_colunas];
          if ($this->wttransportervechicle[$this->nm_grid_colunas] === "") 
          { 
              $this->wttransportervechicle[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wttransportervechicle[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wttransportervechicle[$this->nm_grid_colunas]);
          $this->wttransportervalidate[$this->nm_grid_colunas] = $this->wttransportervalidate[$this->nm_grid_colunas];
          if ($this->wttransportervalidate[$this->nm_grid_colunas] === "") 
          { 
              $this->wttransportervalidate[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wttransportervalidate[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wttransportervalidate[$this->nm_grid_colunas]);
          $this->wttransportervalidateip[$this->nm_grid_colunas] = $this->wttransportervalidateip[$this->nm_grid_colunas];
          if ($this->wttransportervalidateip[$this->nm_grid_colunas] === "") 
          { 
              $this->wttransportervalidateip[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wttransportervalidateip[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wttransportervalidateip[$this->nm_grid_colunas]);
          $this->wttransporternumberid[$this->nm_grid_colunas] = $this->wttransporternumberid[$this->nm_grid_colunas];
          if ($this->wttransporternumberid[$this->nm_grid_colunas] === "") 
          { 
              $this->wttransporternumberid[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wttransporternumberid[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wttransporternumberid[$this->nm_grid_colunas]);
          $this->wtfdestdate[$this->nm_grid_colunas] = $this->wtfdestdate[$this->nm_grid_colunas];
          if ($this->wtfdestdate[$this->nm_grid_colunas] === "") 
          { 
              $this->wtfdestdate[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
               $wtfdestdate_x =  $this->wtfdestdate[$this->nm_grid_colunas];
               nm_conv_limpa_dado($wtfdestdate_x, "YYYY-MM-DD");
               if (is_numeric($wtfdestdate_x) && $wtfdestdate_x > 0) 
               { 
                   $this->nm_data->SetaData($this->wtfdestdate[$this->nm_grid_colunas], "YYYY-MM-DD");
                   $this->wtfdestdate[$this->nm_grid_colunas] = html_entity_decode($this->nm_data->FormataSaida($this->nm_data->FormatRegion("DT", "ddmmaaaa")), ENT_COMPAT, $_SESSION['scriptcase']['charset']);
               } 
          } 
          $this->wtfdestdate[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtfdestdate[$this->nm_grid_colunas]);
          $this->Lookup->lookup_wtfdestid($this->wtfdestid[$this->nm_grid_colunas] , $this->wtfdestid[$this->nm_grid_colunas]) ; 
          $this->wtfdestid[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtfdestid[$this->nm_grid_colunas]);
          $this->wtfdestperiferia[$this->nm_grid_colunas] = $this->wtfdestperiferia[$this->nm_grid_colunas];
          if ($this->wtfdestperiferia[$this->nm_grid_colunas] === "") 
          { 
              $this->wtfdestperiferia[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->wtfdestperiferia[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_num'], $_SESSION['scriptcase']['reg_conf']['dec_num'], "0", "S", "2", "", "N:" . $_SESSION['scriptcase']['reg_conf']['neg_num'] , $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['num_group_digit']) ; 
          } 
          $this->wtfdestperiferia[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtfdestperiferia[$this->nm_grid_colunas]);
          $this->wtfdestewc[$this->nm_grid_colunas] = $this->wtfdestewc[$this->nm_grid_colunas];
          if ($this->wtfdestewc[$this->nm_grid_colunas] === "") 
          { 
              $this->wtfdestewc[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wtfdestewc[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtfdestewc[$this->nm_grid_colunas]);
          $this->Lookup->lookup_ewc2($this->ewc2[$this->nm_grid_colunas] , $this->ewc2[$this->nm_grid_colunas]) ; 
          $this->ewc2[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->ewc2[$this->nm_grid_colunas]);
          $this->wtfdestrd[$this->nm_grid_colunas] = $this->wtfdestrd[$this->nm_grid_colunas];
          if ($this->wtfdestrd[$this->nm_grid_colunas] === "") 
          { 
              $this->wtfdestrd[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wtfdestrd[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtfdestrd[$this->nm_grid_colunas]);
          $this->wtfdestqty[$this->nm_grid_colunas] = $this->wtfdestqty[$this->nm_grid_colunas];
          if ($this->wtfdestqty[$this->nm_grid_colunas] === "") 
          { 
              $this->wtfdestqty[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->wtfdestqty[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_num'], $_SESSION['scriptcase']['reg_conf']['dec_num'], "3", "S", "2", "", "N:" . $_SESSION['scriptcase']['reg_conf']['neg_num'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['num_group_digit']) ; 
          } 
          $this->wtfdestqty[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtfdestqty[$this->nm_grid_colunas]);
          $this->wtfdestm3[$this->nm_grid_colunas] = $this->wtfdestm3[$this->nm_grid_colunas];
          if ($this->wtfdestm3[$this->nm_grid_colunas] === "") 
          { 
              $this->wtfdestm3[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->wtfdestm3[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_num'], $_SESSION['scriptcase']['reg_conf']['dec_num'], "0", "S", "2", "", "N:" . $_SESSION['scriptcase']['reg_conf']['neg_num'] , $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['num_group_digit']) ; 
          } 
          $this->wtfdestm3[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtfdestm3[$this->nm_grid_colunas]);
          $this->wtfdestvlidated[$this->nm_grid_colunas] = $this->wtfdestvlidated[$this->nm_grid_colunas];
          if ($this->wtfdestvlidated[$this->nm_grid_colunas] === "") 
          { 
              $this->wtfdestvlidated[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wtfdestvlidated[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtfdestvlidated[$this->nm_grid_colunas]);
          $this->wtfdestvalidateip[$this->nm_grid_colunas] = $this->wtfdestvalidateip[$this->nm_grid_colunas];
          if ($this->wtfdestvalidateip[$this->nm_grid_colunas] === "") 
          { 
              $this->wtfdestvalidateip[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wtfdestvalidateip[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wtfdestvalidateip[$this->nm_grid_colunas]);
          $this->wtproducersign[$this->nm_grid_colunas] = $this->wtproducersign[$this->nm_grid_colunas]; 
          if (empty($this->wtproducersign[$this->nm_grid_colunas]) || $this->wtproducersign[$this->nm_grid_colunas] == "none" || $this->wtproducersign[$this->nm_grid_colunas] == "*nm*") 
          { 
              $this->wtproducersign[$this->nm_grid_colunas] = "" ;  
              $out_wtproducersign = "" ; 
          } 
          elseif ($this->Ini->Gd_missing)
          { 
              $this->wtproducersign[$this->nm_grid_colunas] = "<span class=\"scErrorLine\">" . $this->Ini->Nm_lang['lang_errm_gd'] . "</span>";
          } 
          else   
          { 
              $out_wtproducersign = $this->Ini->path_imag_temp . "/sc_wtproducersign_" . $_SESSION['scriptcase']['sc_num_img'] . session_id() . ".jpg";   
              $arq_wtproducersign = fopen($this->Ini->root . $out_wtproducersign, "w") ;  
              $_SESSION['scriptcase']['sc_num_img']++ ; 
              if (substr($this->wtproducersign[$this->nm_grid_colunas], 0, 4) == "*nm*") 
              { 
                  $this->wtproducersign[$this->nm_grid_colunas] = substr($this->wtproducersign[$this->nm_grid_colunas], 4) ; 
                  $this->wtproducersign[$this->nm_grid_colunas] = base64_decode($this->wtproducersign[$this->nm_grid_colunas]) ; 
              } 
              $img_pos_bm = strpos($this->wtproducersign[$this->nm_grid_colunas], "BM") ; 
              if (!$img_pos_bm === FALSE && $img_pos_bm == 78) 
              { 
                  $this->wtproducersign[$this->nm_grid_colunas] = substr($this->wtproducersign[$this->nm_grid_colunas], $img_pos_bm) ; 
              } 
              fwrite($arq_wtproducersign, $this->wtproducersign[$this->nm_grid_colunas]) ;  
              fclose($arq_wtproducersign) ;  
              $SC_tp_img = $this->SC_type_img($this->Ini->root . $out_wtproducersign);
              if ($SC_tp_img != ".jpg") 
              { 
                  $out_wtproducersign = $this->Ini->path_imag_temp . "/sc_wtproducersign_" . $_SESSION['scriptcase']['sc_num_img'] . session_id() . $SC_tp_img ;   
                  $arq_wtproducersign = fopen($this->Ini->root . $out_wtproducersign, "w") ;  
                  fwrite($arq_wtproducersign, $this->wtproducersign[$this->nm_grid_colunas]) ;  
                  fclose($arq_wtproducersign) ;  
              }
              $out1_wtproducersign = $out_wtproducersign; 
              $out_wtproducersign = $this->Ini->path_imag_temp . "/" . "wtproducersign_" . $_SESSION['scriptcase']['sc_num_img'] . session_id() . ".jpg" ; 
              $_SESSION['scriptcase']['sc_num_img']++ ; 
              $sc_obj_img = new nm_trata_img($this->Ini->root . $out1_wtproducersign);
              $sc_obj_img->setWidth(85);
              $sc_obj_img->setHeight(28);
              $sc_obj_img->createImg($this->Ini->root . $out_wtproducersign);
              $this->wtproducersign[$this->nm_grid_colunas] = $this->NM_raiz_img . $out_wtproducersign; 
          } 
          $this->wttransportersign[$this->nm_grid_colunas] = $this->wttransportersign[$this->nm_grid_colunas]; 
          if (empty($this->wttransportersign[$this->nm_grid_colunas]) || $this->wttransportersign[$this->nm_grid_colunas] == "none" || $this->wttransportersign[$this->nm_grid_colunas] == "*nm*") 
          { 
              $this->wttransportersign[$this->nm_grid_colunas] = "" ;  
              $out_wttransportersign = "" ; 
          } 
          elseif ($this->Ini->Gd_missing)
          { 
              $this->wttransportersign[$this->nm_grid_colunas] = "<span class=\"scErrorLine\">" . $this->Ini->Nm_lang['lang_errm_gd'] . "</span>";
          } 
          else   
          { 
              $out_wttransportersign = $this->Ini->path_imag_temp . "/sc_wttransportersign_" . $_SESSION['scriptcase']['sc_num_img'] . session_id() . ".jpg";   
              $arq_wttransportersign = fopen($this->Ini->root . $out_wttransportersign, "w") ;  
              $_SESSION['scriptcase']['sc_num_img']++ ; 
              if (substr($this->wttransportersign[$this->nm_grid_colunas], 0, 4) == "*nm*") 
              { 
                  $this->wttransportersign[$this->nm_grid_colunas] = substr($this->wttransportersign[$this->nm_grid_colunas], 4) ; 
                  $this->wttransportersign[$this->nm_grid_colunas] = base64_decode($this->wttransportersign[$this->nm_grid_colunas]) ; 
              } 
              $img_pos_bm = strpos($this->wttransportersign[$this->nm_grid_colunas], "BM") ; 
              if (!$img_pos_bm === FALSE && $img_pos_bm == 78) 
              { 
                  $this->wttransportersign[$this->nm_grid_colunas] = substr($this->wttransportersign[$this->nm_grid_colunas], $img_pos_bm) ; 
              } 
              fwrite($arq_wttransportersign, $this->wttransportersign[$this->nm_grid_colunas]) ;  
              fclose($arq_wttransportersign) ;  
              $SC_tp_img = $this->SC_type_img($this->Ini->root . $out_wttransportersign);
              if ($SC_tp_img != ".jpg") 
              { 
                  $out_wttransportersign = $this->Ini->path_imag_temp . "/sc_wttransportersign_" . $_SESSION['scriptcase']['sc_num_img'] . session_id() . $SC_tp_img ;   
                  $arq_wttransportersign = fopen($this->Ini->root . $out_wttransportersign, "w") ;  
                  fwrite($arq_wttransportersign, $this->wttransportersign[$this->nm_grid_colunas]) ;  
                  fclose($arq_wttransportersign) ;  
              }
              $out1_wttransportersign = $out_wttransportersign; 
              $out_wttransportersign = $this->Ini->path_imag_temp . "/" . "wttransportersign_" . $_SESSION['scriptcase']['sc_num_img'] . session_id() . ".jpg" ; 
              $_SESSION['scriptcase']['sc_num_img']++ ; 
              $sc_obj_img = new nm_trata_img($this->Ini->root . $out1_wttransportersign);
              $sc_obj_img->setWidth(75);
              $sc_obj_img->setHeight(25);
              $sc_obj_img->createImg($this->Ini->root . $out_wttransportersign);
              $this->wttransportersign[$this->nm_grid_colunas] = $this->NM_raiz_img . $out_wttransportersign; 
          } 
          $this->wtfdestsign[$this->nm_grid_colunas] = $this->wtfdestsign[$this->nm_grid_colunas]; 
          if (empty($this->wtfdestsign[$this->nm_grid_colunas]) || $this->wtfdestsign[$this->nm_grid_colunas] == "none" || $this->wtfdestsign[$this->nm_grid_colunas] == "*nm*") 
          { 
              $this->wtfdestsign[$this->nm_grid_colunas] = "" ;  
              $out_wtfdestsign = "" ; 
          } 
          elseif ($this->Ini->Gd_missing)
          { 
              $this->wtfdestsign[$this->nm_grid_colunas] = "<span class=\"scErrorLine\">" . $this->Ini->Nm_lang['lang_errm_gd'] . "</span>";
          } 
          else   
          { 
              $out_wtfdestsign = $this->Ini->path_imag_temp . "/sc_wtfdestsign_" . $_SESSION['scriptcase']['sc_num_img'] . session_id() . ".jpg";   
              $arq_wtfdestsign = fopen($this->Ini->root . $out_wtfdestsign, "w") ;  
              $_SESSION['scriptcase']['sc_num_img']++ ; 
              if (substr($this->wtfdestsign[$this->nm_grid_colunas], 0, 4) == "*nm*") 
              { 
                  $this->wtfdestsign[$this->nm_grid_colunas] = substr($this->wtfdestsign[$this->nm_grid_colunas], 4) ; 
                  $this->wtfdestsign[$this->nm_grid_colunas] = base64_decode($this->wtfdestsign[$this->nm_grid_colunas]) ; 
              } 
              $img_pos_bm = strpos($this->wtfdestsign[$this->nm_grid_colunas], "BM") ; 
              if (!$img_pos_bm === FALSE && $img_pos_bm == 78) 
              { 
                  $this->wtfdestsign[$this->nm_grid_colunas] = substr($this->wtfdestsign[$this->nm_grid_colunas], $img_pos_bm) ; 
              } 
              fwrite($arq_wtfdestsign, $this->wtfdestsign[$this->nm_grid_colunas]) ;  
              fclose($arq_wtfdestsign) ;  
              $SC_tp_img = $this->SC_type_img($this->Ini->root . $out_wtfdestsign);
              if ($SC_tp_img != ".jpg") 
              { 
                  $out_wtfdestsign = $this->Ini->path_imag_temp . "/sc_wtfdestsign_" . $_SESSION['scriptcase']['sc_num_img'] . session_id() . $SC_tp_img ;   
                  $arq_wtfdestsign = fopen($this->Ini->root . $out_wtfdestsign, "w") ;  
                  fwrite($arq_wtfdestsign, $this->wtfdestsign[$this->nm_grid_colunas]) ;  
                  fclose($arq_wtfdestsign) ;  
              }
              $out1_wtfdestsign = $out_wtfdestsign; 
              $out_wtfdestsign = $this->Ini->path_imag_temp . "/" . "wtfdestsign_" . $_SESSION['scriptcase']['sc_num_img'] . session_id() . ".jpg" ; 
              $_SESSION['scriptcase']['sc_num_img']++ ; 
              $sc_obj_img = new nm_trata_img($this->Ini->root . $out1_wtfdestsign);
              $sc_obj_img->setWidth(75);
              $sc_obj_img->setHeight(25);
              $sc_obj_img->createImg($this->Ini->root . $out_wtfdestsign);
              $this->wtfdestsign[$this->nm_grid_colunas] = $this->NM_raiz_img . $out_wtfdestsign; 
          } 
          if ($this->email[$this->nm_grid_colunas] === "") 
          { 
              $this->email[$this->nm_grid_colunas] = "" ;  
          } 
          $this->email[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->email[$this->nm_grid_colunas]);
          if ($this->envregistrationno[$this->nm_grid_colunas] === "") 
          { 
              $this->envregistrationno[$this->nm_grid_colunas] = "" ;  
          } 
          $this->envregistrationno[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->envregistrationno[$this->nm_grid_colunas]);
          if ($this->fdestaddress[$this->nm_grid_colunas] === "") 
          { 
              $this->fdestaddress[$this->nm_grid_colunas] = "" ;  
          } 
          $this->fdestaddress[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->fdestaddress[$this->nm_grid_colunas]);
          if ($this->fdestaepo[$this->nm_grid_colunas] === "") 
          { 
              $this->fdestaepo[$this->nm_grid_colunas] = "" ;  
          } 
          $this->fdestaepo[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->fdestaepo[$this->nm_grid_colunas]);
          if ($this->fdestphone[$this->nm_grid_colunas] === "") 
          { 
              $this->fdestphone[$this->nm_grid_colunas] = "" ;  
          } 
          $this->fdestphone[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->fdestphone[$this->nm_grid_colunas]);
          if ($this->fdestrespone[$this->nm_grid_colunas] === "") 
          { 
              $this->fdestrespone[$this->nm_grid_colunas] = "" ;  
          } 
          $this->fdestrespone[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->fdestrespone[$this->nm_grid_colunas]);
          if ($this->fdestresponseemail[$this->nm_grid_colunas] === "") 
          { 
              $this->fdestresponseemail[$this->nm_grid_colunas] = "" ;  
          } 
          $this->fdestresponseemail[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->fdestresponseemail[$this->nm_grid_colunas]);
          if ($this->phone[$this->nm_grid_colunas] === "") 
          { 
              $this->phone[$this->nm_grid_colunas] = "" ;  
          } 
          $this->phone[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->phone[$this->nm_grid_colunas]);
          if ($this->produceraepo[$this->nm_grid_colunas] === "") 
          { 
              $this->produceraepo[$this->nm_grid_colunas] = "" ;  
          } 
          $this->produceraepo[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->produceraepo[$this->nm_grid_colunas]);
          if ($this->producerb_address[$this->nm_grid_colunas] === "") 
          { 
              $this->producerb_address[$this->nm_grid_colunas] = "" ;  
          } 
          $this->producerb_address[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->producerb_address[$this->nm_grid_colunas]);
          if ($this->responsename[$this->nm_grid_colunas] === "") 
          { 
              $this->responsename[$this->nm_grid_colunas] = "" ;  
          } 
          $this->responsename[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->responsename[$this->nm_grid_colunas]);
          if ($this->wttransporterresponse[$this->nm_grid_colunas] === "") 
          { 
              $this->wttransporterresponse[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wttransporterresponse[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wttransporterresponse[$this->nm_grid_colunas]);
            $cell_ProfilName = array('posx' => 20, 'posy' => 10, 'data' => $this->wtprofilid[$this->nm_grid_colunas], 'width'      => 90, 'align'      => 'C', 'font_type'  => $this->default_font, 'font_size'  => 12, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => BI);
            $cell_wtRequestDate = array('posx' => 162, 'posy' => 74, 'data' => $this->wtrequestdate[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtProducerBranchID = array('posx' => 38, 'posy' => 48, 'data' => $this->wtproducerbranchid[$this->nm_grid_colunas], 'width'      => 60, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 8, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtProducerEwc = array('posx' => 110, 'posy' => 55, 'data' => $this->wtproducerewc[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtProducerAcceptWeigth = array('posx' => 118, 'posy' => 110, 'data' => $this->wtproduceracceptweigth[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 8, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtProducerQty = array('posx' => 80, 'posy' => 99, 'data' => $this->wtproducerqty[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 12, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtPrducerm3 = array('posx' => 82, 'posy' => 106, 'data' => $this->wtprducerm3[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 12, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtTransportDate = array('posx' => 160, 'posy' => 136, 'data' => $this->wttransportdate[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtTransporterVechicle = array('posx' => 160, 'posy' => 127, 'data' => $this->wttransportervechicle[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtFdestDate = array('posx' => 75, 'posy' => 239, 'data' => $this->wtfdestdate[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtFDestID = array('posx' => 35, 'posy' => 174, 'data' => $this->wtfdestid[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 8, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtFDestEWC = array('posx' => 142, 'posy' => 200, 'data' => $this->wtfdestewc[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 12, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtFDestRD = array('posx' => 178, 'posy' => 209, 'data' => $this->wtfdestrd[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtFDestQty = array('posx' => 82, 'posy' => 250, 'data' => $this->wtfdestqty[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 12, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtFDestM3 = array('posx' => 90, 'posy' => 257, 'data' => $this->wtfdestm3[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 12, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_INTNUMBER = array('posx' => 180, 'posy' => 27, 'data' => $this->intnumber[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 12, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => B);
            $cell_ewc1 = array('posx' => 175, 'posy' => 63, 'data' => $this->ewc1[$this->nm_grid_colunas], 'width'      => 6, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 12, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_ewc2 = array('posx' => 110, 'posy' => 177, 'data' => $this->ewc2[$this->nm_grid_colunas], 'width'      => 50, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 8, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtProducerSign = array('posx' => 110, 'posy' => 82, 'data' => $this->wtproducersign[$this->nm_grid_colunas], 'width'      => 85, 'align'      => 'C', 'font_type'  => $this->default_font, 'font_size'  => 12, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_wtTransporterResponse = array('posx' => 39, 'posy' => 143, 'data' => $this->wttransporterresponse[$this->nm_grid_colunas], 'width'      => 25, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_ProducerB_Address = array('posx' => 34, 'posy' => 55, 'data' => $this->producerb_address[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_ProducerAEPO = array('posx' => 46, 'posy' => 63, 'data' => $this->produceraepo[$this->nm_grid_colunas], 'width'      => 25, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_ResponseName = array('posx' => 39, 'posy' => 77, 'data' => $this->responsename[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_Phone = array('posx' => 31, 'posy' => 85, 'data' => $this->phone[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_Email = array('posx' => 33, 'posy' => 92, 'data' => $this->email[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_FDestAddress = array('posx' => 33, 'posy' => 181, 'data' => $this->fdestaddress[$this->nm_grid_colunas], 'width'      => 25, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_FDestAepo = array('posx' => 45, 'posy' => 190, 'data' => $this->fdestaepo[$this->nm_grid_colunas], 'width'      => 25, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_EnvRegistrationNo = array('posx' => 80, 'posy' => 205, 'data' => $this->envregistrationno[$this->nm_grid_colunas], 'width'      => 10, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 12, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_FDestRespone = array('posx' => 41, 'posy' => 214, 'data' => $this->fdestrespone[$this->nm_grid_colunas], 'width'      => 25, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_FDestPhone = array('posx' => 31, 'posy' => 222, 'data' => $this->fdestphone[$this->nm_grid_colunas], 'width'      => 15, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_FDestResponseEmail = array('posx' => 35, 'posy' => 230, 'data' => $this->fdestresponseemail[$this->nm_grid_colunas], 'width'      => 15, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 9, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);
            $cell_TransporterNumberID = array('posx' => 180, 'posy' => 116, 'data' => $this->wttransporternumberid[$this->nm_grid_colunas], 'width'      => 0, 'align'      => 'L', 'font_type'  => $this->default_font, 'font_size'  => 18, 'color_r'    => '0', 'color_g'    => '0', 'color_b'    => '0', 'font_style' => $this->default_style);


            $this->Pdf->SetFont($cell_ProfilName['font_type'], $cell_ProfilName['font_style'], $cell_ProfilName['font_size']);
            $this->pdf_text_color($cell_ProfilName['data'], $cell_ProfilName['color_r'], $cell_ProfilName['color_g'], $cell_ProfilName['color_b']);
            if (!empty($cell_ProfilName['posx']) && !empty($cell_ProfilName['posy']))
            {
                $this->Pdf->SetXY($cell_ProfilName['posx'], $cell_ProfilName['posy']);
            }
            elseif (!empty($cell_ProfilName['posx']))
            {
                $this->Pdf->SetX($cell_ProfilName['posx']);
            }
            elseif (!empty($cell_ProfilName['posy']))
            {
                $this->Pdf->SetY($cell_ProfilName['posy']);
            }
            $this->Pdf->Cell($cell_ProfilName['width'], 0, $cell_ProfilName['data'], 0, 0, $cell_ProfilName['align']);

            $this->Pdf->SetFont($cell_wtRequestDate['font_type'], $cell_wtRequestDate['font_style'], $cell_wtRequestDate['font_size']);
            $this->pdf_text_color($cell_wtRequestDate['data'], $cell_wtRequestDate['color_r'], $cell_wtRequestDate['color_g'], $cell_wtRequestDate['color_b']);
            if (!empty($cell_wtRequestDate['posx']) && !empty($cell_wtRequestDate['posy']))
            {
                $this->Pdf->SetXY($cell_wtRequestDate['posx'], $cell_wtRequestDate['posy']);
            }
            elseif (!empty($cell_wtRequestDate['posx']))
            {
                $this->Pdf->SetX($cell_wtRequestDate['posx']);
            }
            elseif (!empty($cell_wtRequestDate['posy']))
            {
                $this->Pdf->SetY($cell_wtRequestDate['posy']);
            }
            $this->Pdf->Cell($cell_wtRequestDate['width'], 0, $cell_wtRequestDate['data'], 0, 0, $cell_wtRequestDate['align']);

            $this->Pdf->SetFont($cell_wtProducerBranchID['font_type'], $cell_wtProducerBranchID['font_style'], $cell_wtProducerBranchID['font_size']);
            $this->pdf_text_color($cell_wtProducerBranchID['data'], $cell_wtProducerBranchID['color_r'], $cell_wtProducerBranchID['color_g'], $cell_wtProducerBranchID['color_b']);
            if (!empty($cell_wtProducerBranchID['posx']) && !empty($cell_wtProducerBranchID['posy']))
            {
                $this->Pdf->SetXY($cell_wtProducerBranchID['posx'], $cell_wtProducerBranchID['posy']);
            }
            elseif (!empty($cell_wtProducerBranchID['posx']))
            {
                $this->Pdf->SetX($cell_wtProducerBranchID['posx']);
            }
            elseif (!empty($cell_wtProducerBranchID['posy']))
            {
                $this->Pdf->SetY($cell_wtProducerBranchID['posy']);
            }
            $this->Pdf->Cell($cell_wtProducerBranchID['width'], 0, $cell_wtProducerBranchID['data'], 0, 0, $cell_wtProducerBranchID['align']);

            $this->Pdf->SetFont($cell_wtProducerEwc['font_type'], $cell_wtProducerEwc['font_style'], $cell_wtProducerEwc['font_size']);
            $this->pdf_text_color($cell_wtProducerEwc['data'], $cell_wtProducerEwc['color_r'], $cell_wtProducerEwc['color_g'], $cell_wtProducerEwc['color_b']);
            if (!empty($cell_wtProducerEwc['posx']) && !empty($cell_wtProducerEwc['posy']))
            {
                $this->Pdf->SetXY($cell_wtProducerEwc['posx'], $cell_wtProducerEwc['posy']);
            }
            elseif (!empty($cell_wtProducerEwc['posx']))
            {
                $this->Pdf->SetX($cell_wtProducerEwc['posx']);
            }
            elseif (!empty($cell_wtProducerEwc['posy']))
            {
                $this->Pdf->SetY($cell_wtProducerEwc['posy']);
            }
            $this->Pdf->Cell($cell_wtProducerEwc['width'], 0, $cell_wtProducerEwc['data'], 0, 0, $cell_wtProducerEwc['align']);

            $this->Pdf->SetFont($cell_wtProducerAcceptWeigth['font_type'], $cell_wtProducerAcceptWeigth['font_style'], $cell_wtProducerAcceptWeigth['font_size']);
            $this->pdf_text_color($cell_wtProducerAcceptWeigth['data'], $cell_wtProducerAcceptWeigth['color_r'], $cell_wtProducerAcceptWeigth['color_g'], $cell_wtProducerAcceptWeigth['color_b']);
            if (!empty($cell_wtProducerAcceptWeigth['posx']) && !empty($cell_wtProducerAcceptWeigth['posy']))
            {
                $this->Pdf->SetXY($cell_wtProducerAcceptWeigth['posx'], $cell_wtProducerAcceptWeigth['posy']);
            }
            elseif (!empty($cell_wtProducerAcceptWeigth['posx']))
            {
                $this->Pdf->SetX($cell_wtProducerAcceptWeigth['posx']);
            }
            elseif (!empty($cell_wtProducerAcceptWeigth['posy']))
            {
                $this->Pdf->SetY($cell_wtProducerAcceptWeigth['posy']);
            }
            $this->Pdf->Cell($cell_wtProducerAcceptWeigth['width'], 0, $cell_wtProducerAcceptWeigth['data'], 0, 0, $cell_wtProducerAcceptWeigth['align']);

            $this->Pdf->SetFont($cell_wtProducerQty['font_type'], $cell_wtProducerQty['font_style'], $cell_wtProducerQty['font_size']);
            $this->pdf_text_color($cell_wtProducerQty['data'], $cell_wtProducerQty['color_r'], $cell_wtProducerQty['color_g'], $cell_wtProducerQty['color_b']);
            if (!empty($cell_wtProducerQty['posx']) && !empty($cell_wtProducerQty['posy']))
            {
                $this->Pdf->SetXY($cell_wtProducerQty['posx'], $cell_wtProducerQty['posy']);
            }
            elseif (!empty($cell_wtProducerQty['posx']))
            {
                $this->Pdf->SetX($cell_wtProducerQty['posx']);
            }
            elseif (!empty($cell_wtProducerQty['posy']))
            {
                $this->Pdf->SetY($cell_wtProducerQty['posy']);
            }
            $this->Pdf->Cell($cell_wtProducerQty['width'], 0, $cell_wtProducerQty['data'], 0, 0, $cell_wtProducerQty['align']);

            $this->Pdf->SetFont($cell_wtPrducerm3['font_type'], $cell_wtPrducerm3['font_style'], $cell_wtPrducerm3['font_size']);
            $this->pdf_text_color($cell_wtPrducerm3['data'], $cell_wtPrducerm3['color_r'], $cell_wtPrducerm3['color_g'], $cell_wtPrducerm3['color_b']);
            if (!empty($cell_wtPrducerm3['posx']) && !empty($cell_wtPrducerm3['posy']))
            {
                $this->Pdf->SetXY($cell_wtPrducerm3['posx'], $cell_wtPrducerm3['posy']);
            }
            elseif (!empty($cell_wtPrducerm3['posx']))
            {
                $this->Pdf->SetX($cell_wtPrducerm3['posx']);
            }
            elseif (!empty($cell_wtPrducerm3['posy']))
            {
                $this->Pdf->SetY($cell_wtPrducerm3['posy']);
            }
            $this->Pdf->Cell($cell_wtPrducerm3['width'], 0, $cell_wtPrducerm3['data'], 0, 0, $cell_wtPrducerm3['align']);

            $this->Pdf->SetFont($cell_wtTransportDate['font_type'], $cell_wtTransportDate['font_style'], $cell_wtTransportDate['font_size']);
            $this->pdf_text_color($cell_wtTransportDate['data'], $cell_wtTransportDate['color_r'], $cell_wtTransportDate['color_g'], $cell_wtTransportDate['color_b']);
            if (!empty($cell_wtTransportDate['posx']) && !empty($cell_wtTransportDate['posy']))
            {
                $this->Pdf->SetXY($cell_wtTransportDate['posx'], $cell_wtTransportDate['posy']);
            }
            elseif (!empty($cell_wtTransportDate['posx']))
            {
                $this->Pdf->SetX($cell_wtTransportDate['posx']);
            }
            elseif (!empty($cell_wtTransportDate['posy']))
            {
                $this->Pdf->SetY($cell_wtTransportDate['posy']);
            }
            $this->Pdf->Cell($cell_wtTransportDate['width'], 0, $cell_wtTransportDate['data'], 0, 0, $cell_wtTransportDate['align']);

            $this->Pdf->SetFont($cell_wtTransporterVechicle['font_type'], $cell_wtTransporterVechicle['font_style'], $cell_wtTransporterVechicle['font_size']);
            $this->pdf_text_color($cell_wtTransporterVechicle['data'], $cell_wtTransporterVechicle['color_r'], $cell_wtTransporterVechicle['color_g'], $cell_wtTransporterVechicle['color_b']);
            if (!empty($cell_wtTransporterVechicle['posx']) && !empty($cell_wtTransporterVechicle['posy']))
            {
                $this->Pdf->SetXY($cell_wtTransporterVechicle['posx'], $cell_wtTransporterVechicle['posy']);
            }
            elseif (!empty($cell_wtTransporterVechicle['posx']))
            {
                $this->Pdf->SetX($cell_wtTransporterVechicle['posx']);
            }
            elseif (!empty($cell_wtTransporterVechicle['posy']))
            {
                $this->Pdf->SetY($cell_wtTransporterVechicle['posy']);
            }
            $this->Pdf->Cell($cell_wtTransporterVechicle['width'], 0, $cell_wtTransporterVechicle['data'], 0, 0, $cell_wtTransporterVechicle['align']);

            $this->Pdf->SetFont($cell_wtFdestDate['font_type'], $cell_wtFdestDate['font_style'], $cell_wtFdestDate['font_size']);
            $this->pdf_text_color($cell_wtFdestDate['data'], $cell_wtFdestDate['color_r'], $cell_wtFdestDate['color_g'], $cell_wtFdestDate['color_b']);
            if (!empty($cell_wtFdestDate['posx']) && !empty($cell_wtFdestDate['posy']))
            {
                $this->Pdf->SetXY($cell_wtFdestDate['posx'], $cell_wtFdestDate['posy']);
            }
            elseif (!empty($cell_wtFdestDate['posx']))
            {
                $this->Pdf->SetX($cell_wtFdestDate['posx']);
            }
            elseif (!empty($cell_wtFdestDate['posy']))
            {
                $this->Pdf->SetY($cell_wtFdestDate['posy']);
            }
            $this->Pdf->Cell($cell_wtFdestDate['width'], 0, $cell_wtFdestDate['data'], 0, 0, $cell_wtFdestDate['align']);

            $this->Pdf->SetFont($cell_wtFDestID['font_type'], $cell_wtFDestID['font_style'], $cell_wtFDestID['font_size']);
            $this->pdf_text_color($cell_wtFDestID['data'], $cell_wtFDestID['color_r'], $cell_wtFDestID['color_g'], $cell_wtFDestID['color_b']);
            if (!empty($cell_wtFDestID['posx']) && !empty($cell_wtFDestID['posy']))
            {
                $this->Pdf->SetXY($cell_wtFDestID['posx'], $cell_wtFDestID['posy']);
            }
            elseif (!empty($cell_wtFDestID['posx']))
            {
                $this->Pdf->SetX($cell_wtFDestID['posx']);
            }
            elseif (!empty($cell_wtFDestID['posy']))
            {
                $this->Pdf->SetY($cell_wtFDestID['posy']);
            }
            $this->Pdf->Cell($cell_wtFDestID['width'], 0, $cell_wtFDestID['data'], 0, 0, $cell_wtFDestID['align']);

            $this->Pdf->SetFont($cell_wtFDestEWC['font_type'], $cell_wtFDestEWC['font_style'], $cell_wtFDestEWC['font_size']);
            $this->pdf_text_color($cell_wtFDestEWC['data'], $cell_wtFDestEWC['color_r'], $cell_wtFDestEWC['color_g'], $cell_wtFDestEWC['color_b']);
            if (!empty($cell_wtFDestEWC['posx']) && !empty($cell_wtFDestEWC['posy']))
            {
                $this->Pdf->SetXY($cell_wtFDestEWC['posx'], $cell_wtFDestEWC['posy']);
            }
            elseif (!empty($cell_wtFDestEWC['posx']))
            {
                $this->Pdf->SetX($cell_wtFDestEWC['posx']);
            }
            elseif (!empty($cell_wtFDestEWC['posy']))
            {
                $this->Pdf->SetY($cell_wtFDestEWC['posy']);
            }
            $this->Pdf->Cell($cell_wtFDestEWC['width'], 0, $cell_wtFDestEWC['data'], 0, 0, $cell_wtFDestEWC['align']);

            $this->Pdf->SetFont($cell_wtFDestRD['font_type'], $cell_wtFDestRD['font_style'], $cell_wtFDestRD['font_size']);
            $this->pdf_text_color($cell_wtFDestRD['data'], $cell_wtFDestRD['color_r'], $cell_wtFDestRD['color_g'], $cell_wtFDestRD['color_b']);
            if (!empty($cell_wtFDestRD['posx']) && !empty($cell_wtFDestRD['posy']))
            {
                $this->Pdf->SetXY($cell_wtFDestRD['posx'], $cell_wtFDestRD['posy']);
            }
            elseif (!empty($cell_wtFDestRD['posx']))
            {
                $this->Pdf->SetX($cell_wtFDestRD['posx']);
            }
            elseif (!empty($cell_wtFDestRD['posy']))
            {
                $this->Pdf->SetY($cell_wtFDestRD['posy']);
            }
            $this->Pdf->Cell($cell_wtFDestRD['width'], 0, $cell_wtFDestRD['data'], 0, 0, $cell_wtFDestRD['align']);

            $this->Pdf->SetFont($cell_wtFDestQty['font_type'], $cell_wtFDestQty['font_style'], $cell_wtFDestQty['font_size']);
            $this->pdf_text_color($cell_wtFDestQty['data'], $cell_wtFDestQty['color_r'], $cell_wtFDestQty['color_g'], $cell_wtFDestQty['color_b']);
            if (!empty($cell_wtFDestQty['posx']) && !empty($cell_wtFDestQty['posy']))
            {
                $this->Pdf->SetXY($cell_wtFDestQty['posx'], $cell_wtFDestQty['posy']);
            }
            elseif (!empty($cell_wtFDestQty['posx']))
            {
                $this->Pdf->SetX($cell_wtFDestQty['posx']);
            }
            elseif (!empty($cell_wtFDestQty['posy']))
            {
                $this->Pdf->SetY($cell_wtFDestQty['posy']);
            }
            $this->Pdf->Cell($cell_wtFDestQty['width'], 0, $cell_wtFDestQty['data'], 0, 0, $cell_wtFDestQty['align']);

            $this->Pdf->SetFont($cell_wtFDestM3['font_type'], $cell_wtFDestM3['font_style'], $cell_wtFDestM3['font_size']);
            $this->pdf_text_color($cell_wtFDestM3['data'], $cell_wtFDestM3['color_r'], $cell_wtFDestM3['color_g'], $cell_wtFDestM3['color_b']);
            if (!empty($cell_wtFDestM3['posx']) && !empty($cell_wtFDestM3['posy']))
            {
                $this->Pdf->SetXY($cell_wtFDestM3['posx'], $cell_wtFDestM3['posy']);
            }
            elseif (!empty($cell_wtFDestM3['posx']))
            {
                $this->Pdf->SetX($cell_wtFDestM3['posx']);
            }
            elseif (!empty($cell_wtFDestM3['posy']))
            {
                $this->Pdf->SetY($cell_wtFDestM3['posy']);
            }
            $this->Pdf->Cell($cell_wtFDestM3['width'], 0, $cell_wtFDestM3['data'], 0, 0, $cell_wtFDestM3['align']);

            $this->Pdf->SetFont($cell_INTNUMBER['font_type'], $cell_INTNUMBER['font_style'], $cell_INTNUMBER['font_size']);
            $this->pdf_text_color($cell_INTNUMBER['data'], $cell_INTNUMBER['color_r'], $cell_INTNUMBER['color_g'], $cell_INTNUMBER['color_b']);
            if (!empty($cell_INTNUMBER['posx']) && !empty($cell_INTNUMBER['posy']))
            {
                $this->Pdf->SetXY($cell_INTNUMBER['posx'], $cell_INTNUMBER['posy']);
            }
            elseif (!empty($cell_INTNUMBER['posx']))
            {
                $this->Pdf->SetX($cell_INTNUMBER['posx']);
            }
            elseif (!empty($cell_INTNUMBER['posy']))
            {
                $this->Pdf->SetY($cell_INTNUMBER['posy']);
            }
            $this->Pdf->Cell($cell_INTNUMBER['width'], 0, $cell_INTNUMBER['data'], 0, 0, $cell_INTNUMBER['align']);

            $this->Pdf->SetFont($cell_ewc1['font_type'], $cell_ewc1['font_style'], $cell_ewc1['font_size']);
            $this->pdf_text_color($cell_ewc1['data'], $cell_ewc1['color_r'], $cell_ewc1['color_g'], $cell_ewc1['color_b']);
            if (!empty($cell_ewc1['posx']) && !empty($cell_ewc1['posy']))
            {
                $this->Pdf->SetXY($cell_ewc1['posx'], $cell_ewc1['posy']);
            }
            elseif (!empty($cell_ewc1['posx']))
            {
                $this->Pdf->SetX($cell_ewc1['posx']);
            }
            elseif (!empty($cell_ewc1['posy']))
            {
                $this->Pdf->SetY($cell_ewc1['posy']);
            }
            $this->Pdf->Cell($cell_ewc1['width'], 0, $cell_ewc1['data'], 0, 0, $cell_ewc1['align']);

            $this->Pdf->SetFont($cell_ewc2['font_type'], $cell_ewc2['font_style'], $cell_ewc2['font_size']);
            $this->pdf_text_color($cell_ewc2['data'], $cell_ewc2['color_r'], $cell_ewc2['color_g'], $cell_ewc2['color_b']);
            if (!empty($cell_ewc2['posx']) && !empty($cell_ewc2['posy']))
            {
                $this->Pdf->SetXY($cell_ewc2['posx'], $cell_ewc2['posy']);
            }
            elseif (!empty($cell_ewc2['posx']))
            {
                $this->Pdf->SetX($cell_ewc2['posx']);
            }
            elseif (!empty($cell_ewc2['posy']))
            {
                $this->Pdf->SetY($cell_ewc2['posy']);
            }
            $this->Pdf->Cell($cell_ewc2['width'], 0, $cell_ewc2['data'], 0, 0, $cell_ewc2['align']);

            if (isset($cell_wtProducerSign['data']) && !empty($cell_wtProducerSign['data']) && is_file($cell_wtProducerSign['data']))
            {
                $this->Pdf->Image($cell_wtProducerSign['data'], $cell_wtProducerSign['posx'], $cell_wtProducerSign['posy'], 85, 28);
            }

            $this->Pdf->SetFont($cell_wtTransporterResponse['font_type'], $cell_wtTransporterResponse['font_style'], $cell_wtTransporterResponse['font_size']);
            $this->pdf_text_color($cell_wtTransporterResponse['data'], $cell_wtTransporterResponse['color_r'], $cell_wtTransporterResponse['color_g'], $cell_wtTransporterResponse['color_b']);
            if (!empty($cell_wtTransporterResponse['posx']) && !empty($cell_wtTransporterResponse['posy']))
            {
                $this->Pdf->SetXY($cell_wtTransporterResponse['posx'], $cell_wtTransporterResponse['posy']);
            }
            elseif (!empty($cell_wtTransporterResponse['posx']))
            {
                $this->Pdf->SetX($cell_wtTransporterResponse['posx']);
            }
            elseif (!empty($cell_wtTransporterResponse['posy']))
            {
                $this->Pdf->SetY($cell_wtTransporterResponse['posy']);
            }
            $this->Pdf->Cell($cell_wtTransporterResponse['width'], 0, $cell_wtTransporterResponse['data'], 0, 0, $cell_wtTransporterResponse['align']);

            $this->Pdf->SetFont($cell_ProducerB_Address['font_type'], $cell_ProducerB_Address['font_style'], $cell_ProducerB_Address['font_size']);
            $this->pdf_text_color($cell_ProducerB_Address['data'], $cell_ProducerB_Address['color_r'], $cell_ProducerB_Address['color_g'], $cell_ProducerB_Address['color_b']);
            if (!empty($cell_ProducerB_Address['posx']) && !empty($cell_ProducerB_Address['posy']))
            {
                $this->Pdf->SetXY($cell_ProducerB_Address['posx'], $cell_ProducerB_Address['posy']);
            }
            elseif (!empty($cell_ProducerB_Address['posx']))
            {
                $this->Pdf->SetX($cell_ProducerB_Address['posx']);
            }
            elseif (!empty($cell_ProducerB_Address['posy']))
            {
                $this->Pdf->SetY($cell_ProducerB_Address['posy']);
            }
            $this->Pdf->Cell($cell_ProducerB_Address['width'], 0, $cell_ProducerB_Address['data'], 0, 0, $cell_ProducerB_Address['align']);

            $this->Pdf->SetFont($cell_ProducerAEPO['font_type'], $cell_ProducerAEPO['font_style'], $cell_ProducerAEPO['font_size']);
            $this->pdf_text_color($cell_ProducerAEPO['data'], $cell_ProducerAEPO['color_r'], $cell_ProducerAEPO['color_g'], $cell_ProducerAEPO['color_b']);
            if (!empty($cell_ProducerAEPO['posx']) && !empty($cell_ProducerAEPO['posy']))
            {
                $this->Pdf->SetXY($cell_ProducerAEPO['posx'], $cell_ProducerAEPO['posy']);
            }
            elseif (!empty($cell_ProducerAEPO['posx']))
            {
                $this->Pdf->SetX($cell_ProducerAEPO['posx']);
            }
            elseif (!empty($cell_ProducerAEPO['posy']))
            {
                $this->Pdf->SetY($cell_ProducerAEPO['posy']);
            }
            $this->Pdf->Cell($cell_ProducerAEPO['width'], 0, $cell_ProducerAEPO['data'], 0, 0, $cell_ProducerAEPO['align']);

            $this->Pdf->SetFont($cell_ResponseName['font_type'], $cell_ResponseName['font_style'], $cell_ResponseName['font_size']);
            $this->pdf_text_color($cell_ResponseName['data'], $cell_ResponseName['color_r'], $cell_ResponseName['color_g'], $cell_ResponseName['color_b']);
            if (!empty($cell_ResponseName['posx']) && !empty($cell_ResponseName['posy']))
            {
                $this->Pdf->SetXY($cell_ResponseName['posx'], $cell_ResponseName['posy']);
            }
            elseif (!empty($cell_ResponseName['posx']))
            {
                $this->Pdf->SetX($cell_ResponseName['posx']);
            }
            elseif (!empty($cell_ResponseName['posy']))
            {
                $this->Pdf->SetY($cell_ResponseName['posy']);
            }
            $this->Pdf->Cell($cell_ResponseName['width'], 0, $cell_ResponseName['data'], 0, 0, $cell_ResponseName['align']);

            $this->Pdf->SetFont($cell_Phone['font_type'], $cell_Phone['font_style'], $cell_Phone['font_size']);
            $this->pdf_text_color($cell_Phone['data'], $cell_Phone['color_r'], $cell_Phone['color_g'], $cell_Phone['color_b']);
            if (!empty($cell_Phone['posx']) && !empty($cell_Phone['posy']))
            {
                $this->Pdf->SetXY($cell_Phone['posx'], $cell_Phone['posy']);
            }
            elseif (!empty($cell_Phone['posx']))
            {
                $this->Pdf->SetX($cell_Phone['posx']);
            }
            elseif (!empty($cell_Phone['posy']))
            {
                $this->Pdf->SetY($cell_Phone['posy']);
            }
            $this->Pdf->Cell($cell_Phone['width'], 0, $cell_Phone['data'], 0, 0, $cell_Phone['align']);

            $this->Pdf->SetFont($cell_Email['font_type'], $cell_Email['font_style'], $cell_Email['font_size']);
            $this->pdf_text_color($cell_Email['data'], $cell_Email['color_r'], $cell_Email['color_g'], $cell_Email['color_b']);
            if (!empty($cell_Email['posx']) && !empty($cell_Email['posy']))
            {
                $this->Pdf->SetXY($cell_Email['posx'], $cell_Email['posy']);
            }
            elseif (!empty($cell_Email['posx']))
            {
                $this->Pdf->SetX($cell_Email['posx']);
            }
            elseif (!empty($cell_Email['posy']))
            {
                $this->Pdf->SetY($cell_Email['posy']);
            }
            $this->Pdf->Cell($cell_Email['width'], 0, $cell_Email['data'], 0, 0, $cell_Email['align']);

            $this->Pdf->SetFont($cell_FDestAddress['font_type'], $cell_FDestAddress['font_style'], $cell_FDestAddress['font_size']);
            $this->pdf_text_color($cell_FDestAddress['data'], $cell_FDestAddress['color_r'], $cell_FDestAddress['color_g'], $cell_FDestAddress['color_b']);
            if (!empty($cell_FDestAddress['posx']) && !empty($cell_FDestAddress['posy']))
            {
                $this->Pdf->SetXY($cell_FDestAddress['posx'], $cell_FDestAddress['posy']);
            }
            elseif (!empty($cell_FDestAddress['posx']))
            {
                $this->Pdf->SetX($cell_FDestAddress['posx']);
            }
            elseif (!empty($cell_FDestAddress['posy']))
            {
                $this->Pdf->SetY($cell_FDestAddress['posy']);
            }
            $this->Pdf->Cell($cell_FDestAddress['width'], 0, $cell_FDestAddress['data'], 0, 0, $cell_FDestAddress['align']);

            $this->Pdf->SetFont($cell_FDestAepo['font_type'], $cell_FDestAepo['font_style'], $cell_FDestAepo['font_size']);
            $this->pdf_text_color($cell_FDestAepo['data'], $cell_FDestAepo['color_r'], $cell_FDestAepo['color_g'], $cell_FDestAepo['color_b']);
            if (!empty($cell_FDestAepo['posx']) && !empty($cell_FDestAepo['posy']))
            {
                $this->Pdf->SetXY($cell_FDestAepo['posx'], $cell_FDestAepo['posy']);
            }
            elseif (!empty($cell_FDestAepo['posx']))
            {
                $this->Pdf->SetX($cell_FDestAepo['posx']);
            }
            elseif (!empty($cell_FDestAepo['posy']))
            {
                $this->Pdf->SetY($cell_FDestAepo['posy']);
            }
            $this->Pdf->Cell($cell_FDestAepo['width'], 0, $cell_FDestAepo['data'], 0, 0, $cell_FDestAepo['align']);

            $this->Pdf->SetFont($cell_EnvRegistrationNo['font_type'], $cell_EnvRegistrationNo['font_style'], $cell_EnvRegistrationNo['font_size']);
            $this->pdf_text_color($cell_EnvRegistrationNo['data'], $cell_EnvRegistrationNo['color_r'], $cell_EnvRegistrationNo['color_g'], $cell_EnvRegistrationNo['color_b']);
            if (!empty($cell_EnvRegistrationNo['posx']) && !empty($cell_EnvRegistrationNo['posy']))
            {
                $this->Pdf->SetXY($cell_EnvRegistrationNo['posx'], $cell_EnvRegistrationNo['posy']);
            }
            elseif (!empty($cell_EnvRegistrationNo['posx']))
            {
                $this->Pdf->SetX($cell_EnvRegistrationNo['posx']);
            }
            elseif (!empty($cell_EnvRegistrationNo['posy']))
            {
                $this->Pdf->SetY($cell_EnvRegistrationNo['posy']);
            }
            $this->Pdf->Cell($cell_EnvRegistrationNo['width'], 0, $cell_EnvRegistrationNo['data'], 0, 0, $cell_EnvRegistrationNo['align']);

            $this->Pdf->SetFont($cell_FDestRespone['font_type'], $cell_FDestRespone['font_style'], $cell_FDestRespone['font_size']);
            $this->pdf_text_color($cell_FDestRespone['data'], $cell_FDestRespone['color_r'], $cell_FDestRespone['color_g'], $cell_FDestRespone['color_b']);
            if (!empty($cell_FDestRespone['posx']) && !empty($cell_FDestRespone['posy']))
            {
                $this->Pdf->SetXY($cell_FDestRespone['posx'], $cell_FDestRespone['posy']);
            }
            elseif (!empty($cell_FDestRespone['posx']))
            {
                $this->Pdf->SetX($cell_FDestRespone['posx']);
            }
            elseif (!empty($cell_FDestRespone['posy']))
            {
                $this->Pdf->SetY($cell_FDestRespone['posy']);
            }
            $this->Pdf->Cell($cell_FDestRespone['width'], 0, $cell_FDestRespone['data'], 0, 0, $cell_FDestRespone['align']);

            $this->Pdf->SetFont($cell_FDestPhone['font_type'], $cell_FDestPhone['font_style'], $cell_FDestPhone['font_size']);
            $this->pdf_text_color($cell_FDestPhone['data'], $cell_FDestPhone['color_r'], $cell_FDestPhone['color_g'], $cell_FDestPhone['color_b']);
            if (!empty($cell_FDestPhone['posx']) && !empty($cell_FDestPhone['posy']))
            {
                $this->Pdf->SetXY($cell_FDestPhone['posx'], $cell_FDestPhone['posy']);
            }
            elseif (!empty($cell_FDestPhone['posx']))
            {
                $this->Pdf->SetX($cell_FDestPhone['posx']);
            }
            elseif (!empty($cell_FDestPhone['posy']))
            {
                $this->Pdf->SetY($cell_FDestPhone['posy']);
            }
            $this->Pdf->Cell($cell_FDestPhone['width'], 0, $cell_FDestPhone['data'], 0, 0, $cell_FDestPhone['align']);

            $this->Pdf->SetFont($cell_FDestResponseEmail['font_type'], $cell_FDestResponseEmail['font_style'], $cell_FDestResponseEmail['font_size']);
            $this->pdf_text_color($cell_FDestResponseEmail['data'], $cell_FDestResponseEmail['color_r'], $cell_FDestResponseEmail['color_g'], $cell_FDestResponseEmail['color_b']);
            if (!empty($cell_FDestResponseEmail['posx']) && !empty($cell_FDestResponseEmail['posy']))
            {
                $this->Pdf->SetXY($cell_FDestResponseEmail['posx'], $cell_FDestResponseEmail['posy']);
            }
            elseif (!empty($cell_FDestResponseEmail['posx']))
            {
                $this->Pdf->SetX($cell_FDestResponseEmail['posx']);
            }
            elseif (!empty($cell_FDestResponseEmail['posy']))
            {
                $this->Pdf->SetY($cell_FDestResponseEmail['posy']);
            }
            $this->Pdf->Cell($cell_FDestResponseEmail['width'], 0, $cell_FDestResponseEmail['data'], 0, 0, $cell_FDestResponseEmail['align']);

            $this->Pdf->SetFont($cell_TransporterNumberID['font_type'], $cell_TransporterNumberID['font_style'], $cell_TransporterNumberID['font_size']);
            $this->pdf_text_color($cell_TransporterNumberID['data'], $cell_TransporterNumberID['color_r'], $cell_TransporterNumberID['color_g'], $cell_TransporterNumberID['color_b']);
            if (!empty($cell_TransporterNumberID['posx']) && !empty($cell_TransporterNumberID['posy']))
            {
                $this->Pdf->SetXY($cell_TransporterNumberID['posx'], $cell_TransporterNumberID['posy']);
            }
            elseif (!empty($cell_TransporterNumberID['posx']))
            {
                $this->Pdf->SetX($cell_TransporterNumberID['posx']);
            }
            elseif (!empty($cell_TransporterNumberID['posy']))
            {
                $this->Pdf->SetY($cell_TransporterNumberID['posy']);
            }
            $this->Pdf->Cell($cell_TransporterNumberID['width'], 0, $cell_TransporterNumberID['data'], 0, 0, $cell_TransporterNumberID['align']);

          $max_Y = 0;
          $this->rs_grid->MoveNext();
          $this->sc_proc_grid = false;
          $nm_quant_linhas++ ;
      }  
   }  
   $this->rs_grid->Close();
   $this->Pdf->Output($this->Ini->root . $this->Ini->nm_path_pdf, 'F');
 }
 function pdf_text_color(&$val, $r, $g, $b)
 {
     $pos = strpos($val, "@SCNEG#");
     if ($pos !== false)
     {
         $cor = trim(substr($val, $pos + 7));
         $val = substr($val, 0, $pos);
         $cor = (substr($cor, 0, 1) == "#") ? substr($cor, 1) : $cor;
         if (strlen($cor) == 6)
         {
             $r = hexdec(substr($cor, 0, 2));
             $g = hexdec(substr($cor, 2, 2));
             $b = hexdec(substr($cor, 4, 2));
         }
     }
     $this->Pdf->SetTextColor($r, $g, $b);
 }
 function SC_conv_utf8($input)
 {
     if ($_SESSION['scriptcase']['charset'] != "UTF-8" && !NM_is_utf8($input))
     {
         $input = sc_convert_encoding($input, "UTF-8", $_SESSION['scriptcase']['charset']);
     }
     return $input;
 }
   function nm_conv_data_db($dt_in, $form_in, $form_out)
   {
       $dt_out = $dt_in;
       if (strtoupper($form_in) == "DB_FORMAT")
       {
           if ($dt_out == "null" || $dt_out == "")
           {
               $dt_out = "";
               return $dt_out;
           }
           $form_in = "AAAA-MM-DD";
       }
       if (strtoupper($form_out) == "DB_FORMAT")
       {
           if (empty($dt_out))
           {
               $dt_out = "null";
               return $dt_out;
           }
           $form_out = "AAAA-MM-DD";
       }
       nm_conv_form_data($dt_out, $form_in, $form_out);
       return $dt_out;
   }
    function SC_type_img($img_file)
    {
        $type_img = getimagesize($img_file);
        if (!$type_img)
        {
            return (".jpg");
        }
        switch ($type_img[2])
        {
           case 1:  return ".gif";   break;
           case 2:  return ".jpg";   break;
           case 3:  return ".png";   break;
           case 4:  return ".swf";   break;
           case 5:  return ".psd";   break;
           case 6:  return ".bmp";   break;
           case 7:  return ".tiff";  break;
           case 8:  return ".tiff";  break;
           case 9:  return ".jpc";   break;
           case 10: return ".jp2";   break;
           case 11: return ".jpx";   break;
           case 12: return ".jb2";   break;
           case 13: return ".swc";   break;
           case 14: return ".ief";   break;
           case 15: return ".wbmp";  break;
           case 16: return ".xbm";   break;
           default: return ".jpg";   break;
        }
    }

   function nm_gera_mask(&$nm_campo, $nm_mask)
   { 
      $trab_campo = $nm_campo;
      $trab_mask  = $nm_mask;
      $tam_campo  = strlen($nm_campo);
      $trab_saida = "";
      $mask_num = false;
      for ($x=0; $x < strlen($trab_mask); $x++)
      {
          if (substr($trab_mask, $x, 1) == "#")
          {
              $mask_num = true;
              break;
          }
      }
      if ($mask_num )
      {
          $ver_duas = explode(";", $trab_mask);
          if (isset($ver_duas[1]) && !empty($ver_duas[1]))
          {
              $cont1 = count(explode("#", $ver_duas[0])) - 1;
              $cont2 = count(explode("#", $ver_duas[1])) - 1;
              if ($cont2 >= $tam_campo)
              {
                  $trab_mask = $ver_duas[1];
              }
              else
              {
                  $trab_mask = $ver_duas[0];
              }
          }
          $tam_mask = strlen($trab_mask);
          $xdados = 0;
          for ($x=0; $x < $tam_mask; $x++)
          {
              if (substr($trab_mask, $x, 1) == "#" && $xdados < $tam_campo)
              {
                  $trab_saida .= substr($trab_campo, $xdados, 1);
                  $xdados++;
              }
              elseif ($xdados < $tam_campo)
              {
                  $trab_saida .= substr($trab_mask, $x, 1);
              }
          }
          if ($xdados < $tam_campo)
          {
              $trab_saida .= substr($trab_campo, $xdados);
          }
          $nm_campo = $trab_saida;
          return;
      }
      for ($ix = strlen($trab_mask); $ix > 0; $ix--)
      {
           $char_mask = substr($trab_mask, $ix - 1, 1);
           if ($char_mask != "x" && $char_mask != "z")
           {
               $trab_saida = $char_mask . $trab_saida;
           }
           else
           {
               if ($tam_campo != 0)
               {
                   $trab_saida = substr($trab_campo, $tam_campo - 1, 1) . $trab_saida;
                   $tam_campo--;
               }
               else
               {
                   $trab_saida = "0" . $trab_saida;
               }
           }
      }
      if ($tam_campo != 0)
      {
          $trab_saida = substr($trab_campo, 0, $tam_campo) . $trab_saida;
          $trab_mask  = str_repeat("z", $tam_campo) . $trab_mask;
      }
   
      $iz = 0; 
      for ($ix = 0; $ix < strlen($trab_mask); $ix++)
      {
           $char_mask = substr($trab_mask, $ix, 1);
           if ($char_mask != "x" && $char_mask != "z")
           {
               if ($char_mask == "." || $char_mask == ",")
               {
                   $trab_saida = substr($trab_saida, 0, $iz) . substr($trab_saida, $iz + 1);
               }
               else
               {
                   $iz++;
               }
           }
           elseif ($char_mask == "x" || substr($trab_saida, $iz, 1) != "0")
           {
               $ix = strlen($trab_mask) + 1;
           }
           else
           {
               $trab_saida = substr($trab_saida, 0, $iz) . substr($trab_saida, $iz + 1);
           }
      }
      $nm_campo = $trab_saida;
   } 
function loadDetails()
{
$_SESSION['scriptcase']['pdfreport_wastetransactions']['contr_erro'] = 'on';
   



$check_sql = "SELECT Response,ResponsePhone,email,ENV_RegNo,ResponseFax "
  . " FROM transporter"
 . " WHERE TransporterID = '" . $this->wttransporterid[$this->nm_grid_colunas]  . "'";
 
      $nm_select = $check_sql; 
      $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select; 
      $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; 
      $this->rs[$this->nm_grid_colunas] = array();
      if ($rx = $this->Db->Execute($nm_select)) 
      { 
          $y = 0; 
          $nm_count = $rx->FieldCount();
          while (!$rx->EOF)
          { 
                 for ($x = 0; $x < $nm_count; $x++)
                 { 
                        $this->rs[$this->nm_grid_colunas][$y] [$x] = $rx->fields[$x];
                 }
                 $y++; 
                 $rx->MoveNext();
          } 
          $rx->Close();
      } 
      elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)  
      { 
          $this->rs[$this->nm_grid_colunas] = false;
          $this->rs_erro[$this->nm_grid_colunas] = $this->Db->ErrorMsg();
      } 
;

if (isset($this->rs[$this->nm_grid_colunas][0][0]))     
{
  $this->wttransporterresponse[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][0];




}
		else     
{
	$transporterresponse  = '';




}


$check_sql = "SELECT Address, ResponseName,Phone,email,Periferia,AEPO "
  . " FROM producerbranch"
 . " WHERE PrBID = '" . $this->wtproducerbranchid[$this->nm_grid_colunas]  . "'";
 
      $nm_select = $check_sql; 
      $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select; 
      $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; 
      $this->rs[$this->nm_grid_colunas] = array();
      if ($rx = $this->Db->Execute($nm_select)) 
      { 
          $y = 0; 
          $nm_count = $rx->FieldCount();
          while (!$rx->EOF)
          { 
                 for ($x = 0; $x < $nm_count; $x++)
                 { 
                        $this->rs[$this->nm_grid_colunas][$y] [$x] = $rx->fields[$x];
                 }
                 $y++; 
                 $rx->MoveNext();
          } 
          $rx->Close();
      } 
      elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)  
      { 
          $this->rs[$this->nm_grid_colunas] = false;
          $this->rs_erro[$this->nm_grid_colunas] = $this->Db->ErrorMsg();
      } 
;

if (isset($this->rs[$this->nm_grid_colunas][0][0]))     
{
  $this->producerb_address[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][0];
  $this->responsename[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][1];
$this->phone[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][2];
$this->email[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][3];
$this->produceraepo[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][5];
}
		else     
{
	$this->producerb_address[$this->nm_grid_colunas]  = '......';
   $this->responsename[$this->nm_grid_colunas]  = '';
	$this->phone[$this->nm_grid_colunas]  = '';
	$this->email[$this->nm_grid_colunas]  = '';
	$this->produceraepo[$this->nm_grid_colunas]  = '';
}




$check_sql = "SELECT Address, ResponseName,Phone,email,Periferia,AEPO,EnvRegistrationNo "
   . " FROM fdestbranch "
   . " WHERE PrBID = '" . $this->wtfdestid[$this->nm_grid_colunas]  . "'";
 
      $nm_select = $check_sql; 
      $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select; 
      $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; 
      $this->rs[$this->nm_grid_colunas] = array();
      if ($rx = $this->Db->Execute($nm_select)) 
      { 
          $y = 0; 
          $nm_count = $rx->FieldCount();
          while (!$rx->EOF)
          { 
                 for ($x = 0; $x < $nm_count; $x++)
                 { 
                        $this->rs[$this->nm_grid_colunas][$y] [$x] = $rx->fields[$x];
                 }
                 $y++; 
                 $rx->MoveNext();
          } 
          $rx->Close();
      } 
      elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)  
      { 
          $this->rs[$this->nm_grid_colunas] = false;
          $this->rs_erro[$this->nm_grid_colunas] = $this->Db->ErrorMsg();
      } 
;

if (isset($this->rs[$this->nm_grid_colunas][0][0]))     
{
   $this->fdestaddress[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][0];
  $this->fdestrespone[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][1];
   $this->fdestphone[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][2];
	$this->fdestresponseemail[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][3];
	$this->fdestaepo[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][5];
	$this->envregistrationno[$this->nm_grid_colunas]  = $this->rs[$this->nm_grid_colunas][0][6];
}
		else     
{
$this->fdestaddress[$this->nm_grid_colunas]  = '';
$this->fdestrespone[$this->nm_grid_colunas]  = '';
$this->fdestphone[$this->nm_grid_colunas]  = '';
$this->fdestresponseemail[$this->nm_grid_colunas]  = '';
$this->fdestaepo[$this->nm_grid_colunas]   = '';
$this->envregistrationno[$this->nm_grid_colunas] ='';
}
$_SESSION['scriptcase']['pdfreport_wastetransactions']['contr_erro'] = 'off';
}
}
?>
