<?php
class dye_dyeorder_pdf_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 $sc_field_0 = array();
   var $sc_field_10 = array();
   var $sc_field_11 = array();
   var $sc_field_12 = array();
   var $sc_field_13 = array();
   var $sc_field_14 = array();
   var $sc_field_15 = array();
   var $sc_field_16 = array();
   var $sc_field_17 = array();
   var $sc_field_18 = array();
   var $p_o_number = array();
   var $dye_order = array();
   var $date = array();
   var $dyer = array();
   var $color = array();
   var $color_numb = array();
   var $finish = array();
   var $finish_no = array();
   var $frame = array();
   var $fwidth = array();
   var $panels = array();
   var $cpi = array();
   var $wpi = array();
   var $gs = array();
   var $fs = array();
   var $greige_wi = array();
   var $req_fin_wt = array();
   var $req_gr_yld = array();
   var $put_up = array();
   var $spec1 = array();
   var $spec2 = array();
   var $spec3 = array();
   var $sld = array();
   var $she = array();
   var $ld1 = array();
   var $ld2 = array();
   var $he1 = array();
   var $he2 = array();
   var $knitter = array();
   var $desc1 = array();
   var $desc2 = array();
   var $ggd = array();
   var $price_lb_d = array();
   var $cost_lb_d = array();
   var $dye_cost = array();
   var $gr_lbs_o = array();
   var $gr_lbs_d = array();
   var $gr_lbs_op = array();
   var $fin_lbs = array();
   var $work_loss = array();
   var $cost_lb_g = array();
   var $est_yards = array();
   var $yards_recd = array();
   var $cost_lb_t = array();
   var $gr_yield = array();
   var $cost_yd_t = array();
   var $gr_value = array();
   var $status = array();
   var $fin_no = 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("en_us");
   $this->default_font = 'Times';
   $this->default_font_sr  = 'Arial';
   $this->default_style    = '';
   $this->default_style_sr = 'B';
   $Tp_papel = "Letter";
   $old_dir = getcwd();
   $File_font_ttf = "";
   $this->Font_ttf = false;
   if (in_array(trim($this->Ini->str_lang), $this->Ini->nm_font_ttf) && is_dir($this->Ini->path_third . "/tfpdf/"))
   {
       if (in_array(trim($this->Ini->str_lang), $this->Ini->nm_ttf_arab))
       {
           $this->default_font    = "Simplified Arabic";
           $this->default_font_sr = "Simplified Arabic";
           $File_font_ttf         = "simpo.ttf";
       }
       if (in_array(trim($this->Ini->str_lang), $this->Ini->nm_ttf_jap))
       {
           $this->default_font    = "IPAGothic";
           $this->default_font_sr = "IPAGothic";
           $File_font_ttf         = "ipag.ttf";
       }
       if (in_array(trim($this->Ini->str_lang), $this->Ini->nm_ttf_rus))
       {
           $this->default_font    = "Gentium";
           $this->default_font_sr = "Gentium";
           $File_font_ttf         = "GenR102.TTF";
       }
       if (in_array(trim($this->Ini->str_lang), $this->Ini->nm_ttf_chi))
       {
           $this->default_font    = "HanWangMingMedium";
           $this->default_font_sr = "HanWangMingMedium";
           $File_font_ttf         = "wt002.ttf";
       }
       if (in_array(trim($this->Ini->str_lang), $this->Ini->nm_ttf_thai))
       {
           $this->default_font    = "Courpro";
           $this->default_font_sr = "Courpro";
           $File_font_ttf         = "courpro.ttf";
       }
       $this->default_style    = '';
       $this->default_style_sr = '';
       chdir($this->Ini->path_third . "/tfpdf/");
   }
   else
   {
       chdir($this->Ini->path_third . "/fpdf/");
   }
   include_once("visibility.php");
   chdir($old_dir);
   $this->Pdf = new PDF_Visibility('P', 'mm', $Tp_papel);
   if (!empty($File_font_ttf))
   {
       $this->Font_ttf = true;
       $this->Pdf->AddFont($this->default_font, '', $File_font_ttf, true);
   }
   $_SESSION['dye_dyeorder_pdf']['Font_ttf'] = $this->Font_ttf;
   $this->Pdf->SetDisplayMode('real');
   $this->Pdf->AliasNbPages();
   $this->aba_iframe = false;
   if (isset($_SESSION['scriptcase']['sc_aba_iframe']))
   {
       foreach ($_SESSION['scriptcase']['sc_aba_iframe'] as $aba => $apls_aba)
       {
           if (in_array("dye_dyeorder_pdf", $apls_aba))
           {
               $this->aba_iframe = true;
               break;
           }
       }
   }
   if ($_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['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]['dye_dyeorder_pdf']['campos_busca']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['campos_busca']))
   { 
       $this->p_o_number[0] = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['campos_busca']['p_o_number']; 
       $tmp_pos = strpos($this->p_o_number[0], "##@@");
       if ($tmp_pos !== false)
       {
           $this->p_o_number[0] = substr($this->p_o_number[0], 0, $tmp_pos);
       }
       $this->dye_order[0] = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['campos_busca']['dye_order']; 
       $tmp_pos = strpos($this->dye_order[0], "##@@");
       if ($tmp_pos !== false)
       {
           $this->dye_order[0] = substr($this->dye_order[0], 0, $tmp_pos);
       }
       $this->date[0] = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['campos_busca']['date']; 
       $tmp_pos = strpos($this->date[0], "##@@");
       if ($tmp_pos !== false)
       {
           $this->date[0] = substr($this->date[0], 0, $tmp_pos);
       }
       $this->dyer[0] = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['campos_busca']['dyer']; 
       $tmp_pos = strpos($this->dyer[0], "##@@");
       if ($tmp_pos !== false)
       {
           $this->dyer[0] = substr($this->dyer[0], 0, $tmp_pos);
       }
       $this->fin_no[0] = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['campos_busca']['fin_no']; 
       $tmp_pos = strpos($this->fin_no[0], "##@@");
       if ($tmp_pos !== false)
       {
           $this->fin_no[0] = substr($this->fin_no[0], 0, $tmp_pos);
       }
   } 
   $this->nm_field_dinamico = array();
   $this->nm_order_dinamico = array();
   $this->sc_where_orig   = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_orig'];
   $this->sc_where_atual  = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq'];
   $this->sc_where_filtro = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['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]['dye_dyeorder_pdf']['qt_col_grid'] = 1 ;  
   if (isset($_SESSION['scriptcase']['sc_apl_conf']['dye_dyeorder_pdf']['cols']) && !empty($_SESSION['scriptcase']['sc_apl_conf']['dye_dyeorder_pdf']['cols']))
   {
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['qt_col_grid'] = $_SESSION['scriptcase']['sc_apl_conf']['dye_dyeorder_pdf']['cols'];  
       unset($_SESSION['scriptcase']['sc_apl_conf']['dye_dyeorder_pdf']['cols']);
   }
   if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['ordem_select']))  
   { 
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['ordem_select'] = array(); 
   } 
   if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['ordem_quebra']))  
   { 
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['ordem_grid'] = "" ; 
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['ordem_ant']  = ""; 
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['ordem_desc'] = "" ; 
   }   
   if (!empty($nmgp_parms) && $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['opcao'] != "pdf")   
   { 
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['opcao'] = "igual";
       $rec = "ini";
   }
   if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_orig']) || $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['prim_cons'] || !empty($nmgp_parms))  
   { 
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['prim_cons'] = false;  
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_orig'] = " where p_o_number='" . $_SESSION['var_dyeorder'] . "'";  
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq']        = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_orig'];  
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq_ant']    = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_orig'];  
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['cond_pesq']         = ""; 
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq_filtro'] = "";
   }   
   if  (!empty($this->nm_where_dinamico)) 
   {   
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq'] .= $this->nm_where_dinamico;
   }   
   $this->sc_where_orig   = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_orig'];
   $this->sc_where_atual  = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq'];
   $this->sc_where_filtro = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq_filtro'];
//
   if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['tot_geral'][1])) 
   { 
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['total'] = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['tot_geral'][1] ;  
   }
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq_ant'] = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq'];  
//----- 
   if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_sybase))
   { 
       $nmgp_select = "SELECT P_O_NUMBER, DYE_ORDER, str_replace (convert(char(10),`DATE`,102), '.', '-') + ' ' + convert(char(8),`DATE`,20) as sc_def_col_1, DYER, COLOR, COLOR_NUMB, FINISH, FINISH_NO, FRAME, FWIDTH, PANELS, CPI, WPI, GS, FS, GREIGE_WI, REQ_FIN_WT, REQ_GR_YLD, PUT_UP, SPEC1, SPEC2, SPEC3, SLD, SHE, LD1, LD2, HE1, HE2, KNITTER, DESC1, DESC2, str_replace (convert(char(10),GGD,102), '.', '-') + ' ' + convert(char(8),GGD,20), PRICE_LB_D, COST_LB_D, DYE_COST, GR_LBS_O, GR_LBS_D, GR_LBS_OP, FIN_LBS, WORK_LOSS, COST_LB_G, EST_YARDS, YARDS_RECD, COST_LB_T, GR_YIELD, COST_YD_T, GR_VALUE, STATUS, FIN_NO from " . $this->Ini->nm_tabela; 
   } 
   elseif (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql))
   { 
       $nmgp_select = "SELECT P_O_NUMBER, DYE_ORDER, `DATE` as sc_def_col_1, DYER, COLOR, COLOR_NUMB, FINISH, FINISH_NO, FRAME, FWIDTH, PANELS, CPI, WPI, GS, FS, GREIGE_WI, REQ_FIN_WT, REQ_GR_YLD, PUT_UP, SPEC1, SPEC2, SPEC3, SLD, SHE, LD1, LD2, HE1, HE2, KNITTER, DESC1, DESC2, GGD, PRICE_LB_D, COST_LB_D, DYE_COST, GR_LBS_O, GR_LBS_D, GR_LBS_OP, FIN_LBS, WORK_LOSS, COST_LB_G, EST_YARDS, YARDS_RECD, COST_LB_T, GR_YIELD, COST_YD_T, GR_VALUE, STATUS, FIN_NO from " . $this->Ini->nm_tabela; 
   } 
   elseif (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mssql))
   { 
       $nmgp_select = "SELECT P_O_NUMBER, DYE_ORDER, convert(char(23),`DATE`,121) as sc_def_col_1, DYER, COLOR, COLOR_NUMB, FINISH, FINISH_NO, FRAME, FWIDTH, PANELS, CPI, WPI, GS, FS, GREIGE_WI, REQ_FIN_WT, REQ_GR_YLD, PUT_UP, SPEC1, SPEC2, SPEC3, SLD, SHE, LD1, LD2, HE1, HE2, KNITTER, DESC1, DESC2, convert(char(23),GGD,121), PRICE_LB_D, COST_LB_D, DYE_COST, GR_LBS_O, GR_LBS_D, GR_LBS_OP, FIN_LBS, WORK_LOSS, COST_LB_G, EST_YARDS, YARDS_RECD, COST_LB_T, GR_YIELD, COST_YD_T, GR_VALUE, STATUS, FIN_NO from " . $this->Ini->nm_tabela; 
   } 
   elseif (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_oracle))
   { 
       $nmgp_select = "SELECT P_O_NUMBER, DYE_ORDER, `DATE` as sc_def_col_1, DYER, COLOR, COLOR_NUMB, FINISH, FINISH_NO, FRAME, FWIDTH, PANELS, CPI, WPI, GS, FS, GREIGE_WI, REQ_FIN_WT, REQ_GR_YLD, PUT_UP, SPEC1, SPEC2, SPEC3, SLD, SHE, LD1, LD2, HE1, HE2, KNITTER, DESC1, DESC2, GGD, PRICE_LB_D, COST_LB_D, DYE_COST, GR_LBS_O, GR_LBS_D, GR_LBS_OP, FIN_LBS, WORK_LOSS, COST_LB_G, EST_YARDS, YARDS_RECD, COST_LB_T, GR_YIELD, COST_YD_T, GR_VALUE, STATUS, FIN_NO from " . $this->Ini->nm_tabela; 
   } 
   elseif (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_informix))
   { 
       $nmgp_select = "SELECT P_O_NUMBER, DYE_ORDER, EXTEND(`DATE`, YEAR TO DAY) as sc_def_col_1, DYER, COLOR, COLOR_NUMB, FINISH, FINISH_NO, FRAME, FWIDTH, PANELS, CPI, WPI, GS, FS, GREIGE_WI, REQ_FIN_WT, REQ_GR_YLD, PUT_UP, SPEC1, SPEC2, SPEC3, SLD, SHE, LD1, LD2, HE1, HE2, KNITTER, DESC1, DESC2, EXTEND(GGD, YEAR TO DAY), PRICE_LB_D, COST_LB_D, DYE_COST, GR_LBS_O, GR_LBS_D, GR_LBS_OP, FIN_LBS, WORK_LOSS, COST_LB_G, EST_YARDS, YARDS_RECD, COST_LB_T, GR_YIELD, COST_YD_T, GR_VALUE, STATUS, FIN_NO from " . $this->Ini->nm_tabela; 
   } 
   else 
   { 
       $nmgp_select = "SELECT P_O_NUMBER, DYE_ORDER, `DATE` as sc_def_col_1, DYER, COLOR, COLOR_NUMB, FINISH, FINISH_NO, FRAME, FWIDTH, PANELS, CPI, WPI, GS, FS, GREIGE_WI, REQ_FIN_WT, REQ_GR_YLD, PUT_UP, SPEC1, SPEC2, SPEC3, SLD, SHE, LD1, LD2, HE1, HE2, KNITTER, DESC1, DESC2, GGD, PRICE_LB_D, COST_LB_D, DYE_COST, GR_LBS_O, GR_LBS_D, GR_LBS_OP, FIN_LBS, WORK_LOSS, COST_LB_G, EST_YARDS, YARDS_RECD, COST_LB_T, GR_YIELD, COST_YD_T, GR_VALUE, STATUS, FIN_NO from " . $this->Ini->nm_tabela; 
   } 
   $nmgp_select .= " " . $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq']; 
   $nmgp_order_by = ""; 
   $campos_order_select = "";
   foreach($_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['ordem_select'] as $campo => $ordem) 
   {
        if ($campo != $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['ordem_grid']) 
        {
           if (!empty($campos_order_select)) 
           {
               $campos_order_select .= ", ";
           }
           $campos_order_select .= $campo . " " . $ordem;
        }
   }
   if (!empty($_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['ordem_grid'])) 
   { 
       $nmgp_order_by = " order by " . $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['ordem_grid'] . $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['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]['dye_dyeorder_pdf']['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()
 {
   $this->Pdf->SetFont($this->default_font, $this->default_style, 12);
   $this->Pdf->SetTextColor(0, 0, 0);
 }
// 
//----- 
 function grid($linhas = 0)
 {
    global 
           $nm_saida, $nm_url_saida;
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['p_o_number'] = "P O NUMBER";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['dye_order'] = "DYE ORDER";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['date'] = "DATE";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['dyer'] = "DYER";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['color'] = "COLOR";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['color_numb'] = "COLOR NUMB";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['finish'] = "FINISH";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['finish_no'] = "FINISH NO";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['frame'] = "FRAME";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['fwidth'] = "FWIDTH";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['panels'] = "PANELS";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['cpi'] = "CPI";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['wpi'] = "WPI";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['gs'] = "GS";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['fs'] = "FS";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['greige_wi'] = "GREIGE WI";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['req_fin_wt'] = "REQ FIN WT";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['req_gr_yld'] = "REQ GR YLD";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['put_up'] = "PUT UP";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['spec1'] = "SPEC1";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['spec2'] = "SPEC2";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['spec3'] = "SPEC3";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sld'] = "SLD";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['she'] = "SHE";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['ld1'] = "LD1";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['ld2'] = "LD2";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['he1'] = "HE1";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['he2'] = "HE2";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['knitter'] = "KNITTER";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['desc1'] = "DESC1";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['desc2'] = "DESC2";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['ggd'] = "GGD";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['price_lb_d'] = "PRICE LB D";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['cost_lb_d'] = "COST LB D";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['dye_cost'] = "DYE COST";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['gr_lbs_o'] = "GR LBS O";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['gr_lbs_d'] = "GR LBS D";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['gr_lbs_op'] = "GR LBS OP";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['fin_lbs'] = "FIN LBS";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['work_loss'] = "WORK LOSS";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['cost_lb_g'] = "COST LB G";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['est_yards'] = "EST YARDS";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['yards_recd'] = "YARDS RECD";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['cost_lb_t'] = "COST LB T";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['gr_yield'] = "GR YIELD";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['cost_yd_t'] = "COST YD T";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['gr_value'] = "GR VALUE";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['status'] = "STATUS";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['fin_no'] = "FIN NO";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sc_field_0'] = "Greige Pieces";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sc_field_10'] = "P O NUMBER";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sc_field_11'] = "CASE";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sc_field_12'] = "PIECE";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sc_field_13'] = "RACKS";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sc_field_14'] = "LBS RECD";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sc_field_15'] = "DYE ORDER";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sc_field_16'] = "SDATE";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sc_field_17'] = "DEFECTS";
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['labels']['sc_field_18'] = "RPD";
   $HTTP_REFERER = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : ""; 
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['seq_dir'] = 0; 
   $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['sub_dir'] = array(); 
   $this->sc_where_orig   = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_orig'];
   $this->sc_where_atual  = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq'];
   $this->sc_where_filtro = $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['where_pesq_filtro'];
   if (isset($_SESSION['scriptcase']['sc_apl_conf']['dye_dyeorder_pdf']['lig_edit']) && $_SESSION['scriptcase']['sc_apl_conf']['dye_dyeorder_pdf']['lig_edit'] != '')
   {
       $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['mostra_edit'] = $_SESSION['scriptcase']['sc_apl_conf']['dye_dyeorder_pdf']['lig_edit'];
   }
   if (!empty($this->nm_grid_sem_reg))
   {
       $this->Pdf_init();
       $this->Pdf->AddPage();
       $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));
       $this->Pdf->Output($this->Ini->root . $this->Ini->nm_path_pdf);
       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->AddPage();
      $this->Pdf_init();
      while (!$this->rs_grid->EOF && $nm_quant_linhas < $_SESSION['sc_session'][$this->Ini->sc_page]['dye_dyeorder_pdf']['qt_col_grid']) 
      {  
          $this->sc_proc_grid = true;
          $this->SC_seq_register++; 
          $this->p_o_number[$this->nm_grid_colunas] = $this->rs_grid->fields[0] ;  
          $this->dye_order[$this->nm_grid_colunas] = $this->rs_grid->fields[1] ;  
          $this->date[$this->nm_grid_colunas] = $this->rs_grid->fields[2] ;  
          $this->dyer[$this->nm_grid_colunas] = $this->rs_grid->fields[3] ;  
          $this->color[$this->nm_grid_colunas] = $this->rs_grid->fields[4] ;  
          $this->color_numb[$this->nm_grid_colunas] = $this->rs_grid->fields[5] ;  
          $this->finish[$this->nm_grid_colunas] = $this->rs_grid->fields[6] ;  
          $this->finish_no[$this->nm_grid_colunas] = $this->rs_grid->fields[7] ;  
          $this->frame[$this->nm_grid_colunas] = $this->rs_grid->fields[8] ;  
          $this->fwidth[$this->nm_grid_colunas] = $this->rs_grid->fields[9] ;  
          $this->fwidth[$this->nm_grid_colunas] = (string)$this->fwidth[$this->nm_grid_colunas];
          $this->panels[$this->nm_grid_colunas] = $this->rs_grid->fields[10] ;  
          $this->panels[$this->nm_grid_colunas] = (string)$this->panels[$this->nm_grid_colunas];
          $this->cpi[$this->nm_grid_colunas] = $this->rs_grid->fields[11] ;  
          $this->wpi[$this->nm_grid_colunas] = $this->rs_grid->fields[12] ;  
          $this->gs[$this->nm_grid_colunas] = $this->rs_grid->fields[13] ;  
          $this->fs[$this->nm_grid_colunas] = $this->rs_grid->fields[14] ;  
          $this->greige_wi[$this->nm_grid_colunas] = $this->rs_grid->fields[15] ;  
          $this->req_fin_wt[$this->nm_grid_colunas] = $this->rs_grid->fields[16] ;  
          $this->req_gr_yld[$this->nm_grid_colunas] = $this->rs_grid->fields[17] ;  
          $this->put_up[$this->nm_grid_colunas] = $this->rs_grid->fields[18] ;  
          $this->spec1[$this->nm_grid_colunas] = $this->rs_grid->fields[19] ;  
          $this->spec2[$this->nm_grid_colunas] = $this->rs_grid->fields[20] ;  
          $this->spec3[$this->nm_grid_colunas] = $this->rs_grid->fields[21] ;  
          $this->sld[$this->nm_grid_colunas] = $this->rs_grid->fields[22] ;  
          $this->she[$this->nm_grid_colunas] = $this->rs_grid->fields[23] ;  
          $this->ld1[$this->nm_grid_colunas] = $this->rs_grid->fields[24] ;  
          $this->ld2[$this->nm_grid_colunas] = $this->rs_grid->fields[25] ;  
          $this->he1[$this->nm_grid_colunas] = $this->rs_grid->fields[26] ;  
          $this->he2[$this->nm_grid_colunas] = $this->rs_grid->fields[27] ;  
          $this->knitter[$this->nm_grid_colunas] = $this->rs_grid->fields[28] ;  
          $this->desc1[$this->nm_grid_colunas] = $this->rs_grid->fields[29] ;  
          $this->desc2[$this->nm_grid_colunas] = $this->rs_grid->fields[30] ;  
          $this->ggd[$this->nm_grid_colunas] = $this->rs_grid->fields[31] ;  
          $this->price_lb_d[$this->nm_grid_colunas] = $this->rs_grid->fields[32] ;  
          $this->price_lb_d[$this->nm_grid_colunas] = (strpos(strtolower($this->price_lb_d[$this->nm_grid_colunas]), "e")) ? (float)$this->price_lb_d[$this->nm_grid_colunas] : $this->price_lb_d[$this->nm_grid_colunas]; 
          $this->price_lb_d[$this->nm_grid_colunas] = (string)$this->price_lb_d[$this->nm_grid_colunas];
          $this->cost_lb_d[$this->nm_grid_colunas] = $this->rs_grid->fields[33] ;  
          $this->cost_lb_d[$this->nm_grid_colunas] = (strpos(strtolower($this->cost_lb_d[$this->nm_grid_colunas]), "e")) ? (float)$this->cost_lb_d[$this->nm_grid_colunas] : $this->cost_lb_d[$this->nm_grid_colunas]; 
          $this->cost_lb_d[$this->nm_grid_colunas] = (string)$this->cost_lb_d[$this->nm_grid_colunas];
          $this->dye_cost[$this->nm_grid_colunas] = $this->rs_grid->fields[34] ;  
          $this->dye_cost[$this->nm_grid_colunas] =  str_replace(",", ".", $this->dye_cost[$this->nm_grid_colunas]);
          $this->dye_cost[$this->nm_grid_colunas] = (strpos(strtolower($this->dye_cost[$this->nm_grid_colunas]), "e")) ? (float)$this->dye_cost[$this->nm_grid_colunas] : $this->dye_cost[$this->nm_grid_colunas]; 
          $this->dye_cost[$this->nm_grid_colunas] = (string)$this->dye_cost[$this->nm_grid_colunas];
          $this->gr_lbs_o[$this->nm_grid_colunas] = $this->rs_grid->fields[35] ;  
          $this->gr_lbs_o[$this->nm_grid_colunas] =  str_replace(",", ".", $this->gr_lbs_o[$this->nm_grid_colunas]);
          $this->gr_lbs_o[$this->nm_grid_colunas] = (strpos(strtolower($this->gr_lbs_o[$this->nm_grid_colunas]), "e")) ? (float)$this->gr_lbs_o[$this->nm_grid_colunas] : $this->gr_lbs_o[$this->nm_grid_colunas]; 
          $this->gr_lbs_o[$this->nm_grid_colunas] = (string)$this->gr_lbs_o[$this->nm_grid_colunas];
          $this->gr_lbs_d[$this->nm_grid_colunas] = $this->rs_grid->fields[36] ;  
          $this->gr_lbs_d[$this->nm_grid_colunas] =  str_replace(",", ".", $this->gr_lbs_d[$this->nm_grid_colunas]);
          $this->gr_lbs_d[$this->nm_grid_colunas] = (strpos(strtolower($this->gr_lbs_d[$this->nm_grid_colunas]), "e")) ? (float)$this->gr_lbs_d[$this->nm_grid_colunas] : $this->gr_lbs_d[$this->nm_grid_colunas]; 
          $this->gr_lbs_d[$this->nm_grid_colunas] = (string)$this->gr_lbs_d[$this->nm_grid_colunas];
          $this->gr_lbs_op[$this->nm_grid_colunas] = $this->rs_grid->fields[37] ;  
          $this->gr_lbs_op[$this->nm_grid_colunas] =  str_replace(",", ".", $this->gr_lbs_op[$this->nm_grid_colunas]);
          $this->gr_lbs_op[$this->nm_grid_colunas] = (strpos(strtolower($this->gr_lbs_op[$this->nm_grid_colunas]), "e")) ? (float)$this->gr_lbs_op[$this->nm_grid_colunas] : $this->gr_lbs_op[$this->nm_grid_colunas]; 
          $this->gr_lbs_op[$this->nm_grid_colunas] = (string)$this->gr_lbs_op[$this->nm_grid_colunas];
          $this->fin_lbs[$this->nm_grid_colunas] = $this->rs_grid->fields[38] ;  
          $this->fin_lbs[$this->nm_grid_colunas] =  str_replace(",", ".", $this->fin_lbs[$this->nm_grid_colunas]);
          $this->fin_lbs[$this->nm_grid_colunas] = (strpos(strtolower($this->fin_lbs[$this->nm_grid_colunas]), "e")) ? (float)$this->fin_lbs[$this->nm_grid_colunas] : $this->fin_lbs[$this->nm_grid_colunas]; 
          $this->fin_lbs[$this->nm_grid_colunas] = (string)$this->fin_lbs[$this->nm_grid_colunas];
          $this->work_loss[$this->nm_grid_colunas] = $this->rs_grid->fields[39] ;  
          $this->work_loss[$this->nm_grid_colunas] =  str_replace(",", ".", $this->work_loss[$this->nm_grid_colunas]);
          $this->work_loss[$this->nm_grid_colunas] = (strpos(strtolower($this->work_loss[$this->nm_grid_colunas]), "e")) ? (float)$this->work_loss[$this->nm_grid_colunas] : $this->work_loss[$this->nm_grid_colunas]; 
          $this->work_loss[$this->nm_grid_colunas] = (string)$this->work_loss[$this->nm_grid_colunas];
          $this->cost_lb_g[$this->nm_grid_colunas] = $this->rs_grid->fields[40] ;  
          $this->cost_lb_g[$this->nm_grid_colunas] =  str_replace(",", ".", $this->cost_lb_g[$this->nm_grid_colunas]);
          $this->cost_lb_g[$this->nm_grid_colunas] = (strpos(strtolower($this->cost_lb_g[$this->nm_grid_colunas]), "e")) ? (float)$this->cost_lb_g[$this->nm_grid_colunas] : $this->cost_lb_g[$this->nm_grid_colunas]; 
          $this->cost_lb_g[$this->nm_grid_colunas] = (string)$this->cost_lb_g[$this->nm_grid_colunas];
          $this->est_yards[$this->nm_grid_colunas] = $this->rs_grid->fields[41] ;  
          $this->est_yards[$this->nm_grid_colunas] = (string)$this->est_yards[$this->nm_grid_colunas];
          $this->yards_recd[$this->nm_grid_colunas] = $this->rs_grid->fields[42] ;  
          $this->yards_recd[$this->nm_grid_colunas] = (strpos(strtolower($this->yards_recd[$this->nm_grid_colunas]), "e")) ? (float)$this->yards_recd[$this->nm_grid_colunas] : $this->yards_recd[$this->nm_grid_colunas]; 
          $this->yards_recd[$this->nm_grid_colunas] = (string)$this->yards_recd[$this->nm_grid_colunas];
          $this->cost_lb_t[$this->nm_grid_colunas] = $this->rs_grid->fields[43] ;  
          $this->cost_lb_t[$this->nm_grid_colunas] =  str_replace(",", ".", $this->cost_lb_t[$this->nm_grid_colunas]);
          $this->cost_lb_t[$this->nm_grid_colunas] = (strpos(strtolower($this->cost_lb_t[$this->nm_grid_colunas]), "e")) ? (float)$this->cost_lb_t[$this->nm_grid_colunas] : $this->cost_lb_t[$this->nm_grid_colunas]; 
          $this->cost_lb_t[$this->nm_grid_colunas] = (string)$this->cost_lb_t[$this->nm_grid_colunas];
          $this->gr_yield[$this->nm_grid_colunas] = $this->rs_grid->fields[44] ;  
          $this->gr_yield[$this->nm_grid_colunas] = (strpos(strtolower($this->gr_yield[$this->nm_grid_colunas]), "e")) ? (float)$this->gr_yield[$this->nm_grid_colunas] : $this->gr_yield[$this->nm_grid_colunas]; 
          $this->gr_yield[$this->nm_grid_colunas] = (string)$this->gr_yield[$this->nm_grid_colunas];
          $this->cost_yd_t[$this->nm_grid_colunas] = $this->rs_grid->fields[45] ;  
          $this->cost_yd_t[$this->nm_grid_colunas] =  str_replace(",", ".", $this->cost_yd_t[$this->nm_grid_colunas]);
          $this->cost_yd_t[$this->nm_grid_colunas] = (strpos(strtolower($this->cost_yd_t[$this->nm_grid_colunas]), "e")) ? (float)$this->cost_yd_t[$this->nm_grid_colunas] : $this->cost_yd_t[$this->nm_grid_colunas]; 
          $this->cost_yd_t[$this->nm_grid_colunas] = (string)$this->cost_yd_t[$this->nm_grid_colunas];
          $this->gr_value[$this->nm_grid_colunas] = $this->rs_grid->fields[46] ;  
          $this->gr_value[$this->nm_grid_colunas] =  str_replace(",", ".", $this->gr_value[$this->nm_grid_colunas]);
          $this->gr_value[$this->nm_grid_colunas] = (strpos(strtolower($this->gr_value[$this->nm_grid_colunas]), "e")) ? (float)$this->gr_value[$this->nm_grid_colunas] : $this->gr_value[$this->nm_grid_colunas]; 
          $this->gr_value[$this->nm_grid_colunas] = (string)$this->gr_value[$this->nm_grid_colunas];
          $this->status[$this->nm_grid_colunas] = $this->rs_grid->fields[47] ;  
          $this->fin_no[$this->nm_grid_colunas] = $this->rs_grid->fields[48] ;  
          $this->sc_field_10[$this->nm_grid_colunas] = array();
          $this->sc_field_11[$this->nm_grid_colunas] = array();
          $this->sc_field_12[$this->nm_grid_colunas] = array();
          $this->sc_field_13[$this->nm_grid_colunas] = array();
          $this->sc_field_14[$this->nm_grid_colunas] = array();
          $this->sc_field_15[$this->nm_grid_colunas] = array();
          $this->sc_field_16[$this->nm_grid_colunas] = array();
          $this->sc_field_17[$this->nm_grid_colunas] = array();
          $this->sc_field_18[$this->nm_grid_colunas] = array();
          $this->Lookup->lookup_sc_field_0($this->sc_field_0[$this->nm_grid_colunas], $array_sc_field_0); 
          $NM_ind = 0;
          $this->sc_field_0 = array();
          foreach ($array_sc_field_0 as $cada_subselect) 
          {
              $this->sc_field_0[$this->nm_grid_colunas][$NM_ind] = "";
              $this->sc_field_10[$this->nm_grid_colunas][$NM_ind] = $cada_subselect[0];
              $this->sc_field_11[$this->nm_grid_colunas][$NM_ind] = $cada_subselect[1];
              $this->sc_field_12[$this->nm_grid_colunas][$NM_ind] = $cada_subselect[2];
              $this->sc_field_13[$this->nm_grid_colunas][$NM_ind] = $cada_subselect[3];
              $this->sc_field_14[$this->nm_grid_colunas][$NM_ind] = $cada_subselect[4];
              $this->sc_field_15[$this->nm_grid_colunas][$NM_ind] = $cada_subselect[5];
              $this->sc_field_16[$this->nm_grid_colunas][$NM_ind] = $cada_subselect[6];
              $this->sc_field_17[$this->nm_grid_colunas][$NM_ind] = $cada_subselect[7];
              $this->sc_field_18[$this->nm_grid_colunas][$NM_ind] = $cada_subselect[8];
              $NM_ind++;
          }
          $this->p_o_number[$this->nm_grid_colunas] = $this->p_o_number[$this->nm_grid_colunas];
          if ($this->p_o_number[$this->nm_grid_colunas] === "") 
          { 
              $this->p_o_number[$this->nm_grid_colunas] = "" ;  
          } 
          $this->p_o_number[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->p_o_number[$this->nm_grid_colunas]);
          $this->dye_order[$this->nm_grid_colunas] = $this->dye_order[$this->nm_grid_colunas];
          if ($this->dye_order[$this->nm_grid_colunas] === "") 
          { 
              $this->dye_order[$this->nm_grid_colunas] = "" ;  
          } 
          $this->dye_order[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->dye_order[$this->nm_grid_colunas]);
          $this->date[$this->nm_grid_colunas] = $this->date[$this->nm_grid_colunas];
          if ($this->date[$this->nm_grid_colunas] === "") 
          { 
              $this->date[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
               $date_x =  $this->date[$this->nm_grid_colunas];
               nm_conv_limpa_dado($date_x, "YYYY-MM-DD");
               if (is_numeric($date_x) && $date_x > 0) 
               { 
                   $this->nm_data->SetaData($this->date[$this->nm_grid_colunas], "YYYY-MM-DD");
                   $this->date[$this->nm_grid_colunas] = html_entity_decode($this->nm_data->FormataSaida($this->Nm_date_format("DT", "ddmmaaaa")));
               } 
          } 
          $this->date[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->date[$this->nm_grid_colunas]);
          $this->dyer[$this->nm_grid_colunas] = $this->dyer[$this->nm_grid_colunas];
          if ($this->dyer[$this->nm_grid_colunas] === "") 
          { 
              $this->dyer[$this->nm_grid_colunas] = "" ;  
          } 
          $this->dyer[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->dyer[$this->nm_grid_colunas]);
          $this->color[$this->nm_grid_colunas] = $this->color[$this->nm_grid_colunas];
          if ($this->color[$this->nm_grid_colunas] === "") 
          { 
              $this->color[$this->nm_grid_colunas] = "" ;  
          } 
          $this->color[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->color[$this->nm_grid_colunas]);
          $this->color_numb[$this->nm_grid_colunas] = $this->color_numb[$this->nm_grid_colunas];
          if ($this->color_numb[$this->nm_grid_colunas] === "") 
          { 
              $this->color_numb[$this->nm_grid_colunas] = "" ;  
          } 
          $this->color_numb[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->color_numb[$this->nm_grid_colunas]);
          $this->finish[$this->nm_grid_colunas] = $this->finish[$this->nm_grid_colunas];
          if ($this->finish[$this->nm_grid_colunas] === "") 
          { 
              $this->finish[$this->nm_grid_colunas] = "" ;  
          } 
          $this->finish[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->finish[$this->nm_grid_colunas]);
          $this->finish_no[$this->nm_grid_colunas] = $this->finish_no[$this->nm_grid_colunas];
          if ($this->finish_no[$this->nm_grid_colunas] === "") 
          { 
              $this->finish_no[$this->nm_grid_colunas] = "" ;  
          } 
          $this->finish_no[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->finish_no[$this->nm_grid_colunas]);
          $this->frame[$this->nm_grid_colunas] = $this->frame[$this->nm_grid_colunas];
          if ($this->frame[$this->nm_grid_colunas] === "") 
          { 
              $this->frame[$this->nm_grid_colunas] = "" ;  
          } 
          $this->frame[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->frame[$this->nm_grid_colunas]);
          $this->fwidth[$this->nm_grid_colunas] = $this->fwidth[$this->nm_grid_colunas];
          if ($this->fwidth[$this->nm_grid_colunas] === "") 
          { 
              $this->fwidth[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->fwidth[$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->fwidth[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->fwidth[$this->nm_grid_colunas]);
          $this->panels[$this->nm_grid_colunas] = $this->panels[$this->nm_grid_colunas];
          if ($this->panels[$this->nm_grid_colunas] === "") 
          { 
              $this->panels[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->panels[$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->panels[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->panels[$this->nm_grid_colunas]);
          $this->cpi[$this->nm_grid_colunas] = $this->cpi[$this->nm_grid_colunas];
          if ($this->cpi[$this->nm_grid_colunas] === "") 
          { 
              $this->cpi[$this->nm_grid_colunas] = "" ;  
          } 
          $this->cpi[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->cpi[$this->nm_grid_colunas]);
          $this->wpi[$this->nm_grid_colunas] = $this->wpi[$this->nm_grid_colunas];
          if ($this->wpi[$this->nm_grid_colunas] === "") 
          { 
              $this->wpi[$this->nm_grid_colunas] = "" ;  
          } 
          $this->wpi[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->wpi[$this->nm_grid_colunas]);
          $this->gs[$this->nm_grid_colunas] = $this->gs[$this->nm_grid_colunas];
          if ($this->gs[$this->nm_grid_colunas] === "") 
          { 
              $this->gs[$this->nm_grid_colunas] = "" ;  
          } 
          $this->gs[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->gs[$this->nm_grid_colunas]);
          $this->fs[$this->nm_grid_colunas] = $this->fs[$this->nm_grid_colunas];
          if ($this->fs[$this->nm_grid_colunas] === "") 
          { 
              $this->fs[$this->nm_grid_colunas] = "" ;  
          } 
          $this->fs[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->fs[$this->nm_grid_colunas]);
          $this->greige_wi[$this->nm_grid_colunas] = $this->greige_wi[$this->nm_grid_colunas];
          if ($this->greige_wi[$this->nm_grid_colunas] === "") 
          { 
              $this->greige_wi[$this->nm_grid_colunas] = "" ;  
          } 
          $this->greige_wi[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->greige_wi[$this->nm_grid_colunas]);
          $this->req_fin_wt[$this->nm_grid_colunas] = $this->req_fin_wt[$this->nm_grid_colunas];
          if ($this->req_fin_wt[$this->nm_grid_colunas] === "") 
          { 
              $this->req_fin_wt[$this->nm_grid_colunas] = "" ;  
          } 
          $this->req_fin_wt[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->req_fin_wt[$this->nm_grid_colunas]);
          $this->req_gr_yld[$this->nm_grid_colunas] = $this->req_gr_yld[$this->nm_grid_colunas];
          if ($this->req_gr_yld[$this->nm_grid_colunas] === "") 
          { 
              $this->req_gr_yld[$this->nm_grid_colunas] = "" ;  
          } 
          $this->req_gr_yld[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->req_gr_yld[$this->nm_grid_colunas]);
          $this->put_up[$this->nm_grid_colunas] = $this->put_up[$this->nm_grid_colunas];
          if ($this->put_up[$this->nm_grid_colunas] === "") 
          { 
              $this->put_up[$this->nm_grid_colunas] = "" ;  
          } 
          $this->put_up[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->put_up[$this->nm_grid_colunas]);
          $this->spec1[$this->nm_grid_colunas] = $this->spec1[$this->nm_grid_colunas];
          if ($this->spec1[$this->nm_grid_colunas] === "") 
          { 
              $this->spec1[$this->nm_grid_colunas] = "" ;  
          } 
          $this->spec1[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->spec1[$this->nm_grid_colunas]);
          $this->spec2[$this->nm_grid_colunas] = $this->spec2[$this->nm_grid_colunas];
          if ($this->spec2[$this->nm_grid_colunas] === "") 
          { 
              $this->spec2[$this->nm_grid_colunas] = "" ;  
          } 
          $this->spec2[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->spec2[$this->nm_grid_colunas]);
          $this->spec3[$this->nm_grid_colunas] = $this->spec3[$this->nm_grid_colunas];
          if ($this->spec3[$this->nm_grid_colunas] === "") 
          { 
              $this->spec3[$this->nm_grid_colunas] = "" ;  
          } 
          $this->spec3[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->spec3[$this->nm_grid_colunas]);
          $this->sld[$this->nm_grid_colunas] = $this->sld[$this->nm_grid_colunas];
          if ($this->sld[$this->nm_grid_colunas] === "") 
          { 
              $this->sld[$this->nm_grid_colunas] = "" ;  
          } 
          $this->sld[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->sld[$this->nm_grid_colunas]);
          $this->she[$this->nm_grid_colunas] = $this->she[$this->nm_grid_colunas];
          if ($this->she[$this->nm_grid_colunas] === "") 
          { 
              $this->she[$this->nm_grid_colunas] = "" ;  
          } 
          $this->she[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->she[$this->nm_grid_colunas]);
          $this->ld1[$this->nm_grid_colunas] = $this->ld1[$this->nm_grid_colunas];
          if ($this->ld1[$this->nm_grid_colunas] === "") 
          { 
              $this->ld1[$this->nm_grid_colunas] = "" ;  
          } 
          $this->ld1[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->ld1[$this->nm_grid_colunas]);
          $this->ld2[$this->nm_grid_colunas] = $this->ld2[$this->nm_grid_colunas];
          if ($this->ld2[$this->nm_grid_colunas] === "") 
          { 
              $this->ld2[$this->nm_grid_colunas] = "" ;  
          } 
          $this->ld2[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->ld2[$this->nm_grid_colunas]);
          $this->he1[$this->nm_grid_colunas] = $this->he1[$this->nm_grid_colunas];
          if ($this->he1[$this->nm_grid_colunas] === "") 
          { 
              $this->he1[$this->nm_grid_colunas] = "" ;  
          } 
          $this->he1[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->he1[$this->nm_grid_colunas]);
          $this->he2[$this->nm_grid_colunas] = $this->he2[$this->nm_grid_colunas];
          if ($this->he2[$this->nm_grid_colunas] === "") 
          { 
              $this->he2[$this->nm_grid_colunas] = "" ;  
          } 
          $this->he2[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->he2[$this->nm_grid_colunas]);
          $this->knitter[$this->nm_grid_colunas] = $this->knitter[$this->nm_grid_colunas];
          if ($this->knitter[$this->nm_grid_colunas] === "") 
          { 
              $this->knitter[$this->nm_grid_colunas] = "" ;  
          } 
          $this->knitter[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->knitter[$this->nm_grid_colunas]);
          $this->desc1[$this->nm_grid_colunas] = $this->desc1[$this->nm_grid_colunas];
          if ($this->desc1[$this->nm_grid_colunas] === "") 
          { 
              $this->desc1[$this->nm_grid_colunas] = "" ;  
          } 
          $this->desc1[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->desc1[$this->nm_grid_colunas]);
          $this->desc2[$this->nm_grid_colunas] = $this->desc2[$this->nm_grid_colunas];
          if ($this->desc2[$this->nm_grid_colunas] === "") 
          { 
              $this->desc2[$this->nm_grid_colunas] = "" ;  
          } 
          $this->desc2[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->desc2[$this->nm_grid_colunas]);
          $this->ggd[$this->nm_grid_colunas] = $this->ggd[$this->nm_grid_colunas];
          if ($this->ggd[$this->nm_grid_colunas] === "") 
          { 
              $this->ggd[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
               $ggd_x =  $this->ggd[$this->nm_grid_colunas];
               nm_conv_limpa_dado($ggd_x, "YYYY-MM-DD");
               if (is_numeric($ggd_x) && $ggd_x > 0) 
               { 
                   $this->nm_data->SetaData($this->ggd[$this->nm_grid_colunas], "YYYY-MM-DD");
                   $this->ggd[$this->nm_grid_colunas] = html_entity_decode($this->nm_data->FormataSaida($this->Nm_date_format("DT", "ddmmaaaa")));
               } 
          } 
          $this->ggd[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->ggd[$this->nm_grid_colunas]);
          $this->price_lb_d[$this->nm_grid_colunas] = $this->price_lb_d[$this->nm_grid_colunas];
          if ($this->price_lb_d[$this->nm_grid_colunas] === "") 
          { 
              $this->price_lb_d[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->price_lb_d[$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->price_lb_d[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->price_lb_d[$this->nm_grid_colunas]);
          $this->cost_lb_d[$this->nm_grid_colunas] = $this->cost_lb_d[$this->nm_grid_colunas];
          if ($this->cost_lb_d[$this->nm_grid_colunas] === "") 
          { 
              $this->cost_lb_d[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->cost_lb_d[$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->cost_lb_d[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->cost_lb_d[$this->nm_grid_colunas]);
          $this->dye_cost[$this->nm_grid_colunas] = $this->dye_cost[$this->nm_grid_colunas];
          if ($this->dye_cost[$this->nm_grid_colunas] === "") 
          { 
              $this->dye_cost[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->dye_cost[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
          $this->dye_cost[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->dye_cost[$this->nm_grid_colunas]);
          $this->gr_lbs_o[$this->nm_grid_colunas] = $this->gr_lbs_o[$this->nm_grid_colunas];
          if ($this->gr_lbs_o[$this->nm_grid_colunas] === "") 
          { 
              $this->gr_lbs_o[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->gr_lbs_o[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
          $this->gr_lbs_o[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->gr_lbs_o[$this->nm_grid_colunas]);
          $this->gr_lbs_d[$this->nm_grid_colunas] = $this->gr_lbs_d[$this->nm_grid_colunas];
          if ($this->gr_lbs_d[$this->nm_grid_colunas] === "") 
          { 
              $this->gr_lbs_d[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->gr_lbs_d[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
          $this->gr_lbs_d[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->gr_lbs_d[$this->nm_grid_colunas]);
          $this->gr_lbs_op[$this->nm_grid_colunas] = $this->gr_lbs_op[$this->nm_grid_colunas];
          if ($this->gr_lbs_op[$this->nm_grid_colunas] === "") 
          { 
              $this->gr_lbs_op[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->gr_lbs_op[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
          $this->gr_lbs_op[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->gr_lbs_op[$this->nm_grid_colunas]);
          $this->fin_lbs[$this->nm_grid_colunas] = $this->fin_lbs[$this->nm_grid_colunas];
          if ($this->fin_lbs[$this->nm_grid_colunas] === "") 
          { 
              $this->fin_lbs[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->fin_lbs[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
          $this->fin_lbs[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->fin_lbs[$this->nm_grid_colunas]);
          $this->work_loss[$this->nm_grid_colunas] = $this->work_loss[$this->nm_grid_colunas];
          if ($this->work_loss[$this->nm_grid_colunas] === "") 
          { 
              $this->work_loss[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->work_loss[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
          $this->work_loss[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->work_loss[$this->nm_grid_colunas]);
          $this->cost_lb_g[$this->nm_grid_colunas] = $this->cost_lb_g[$this->nm_grid_colunas];
          if ($this->cost_lb_g[$this->nm_grid_colunas] === "") 
          { 
              $this->cost_lb_g[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->cost_lb_g[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
          $this->cost_lb_g[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->cost_lb_g[$this->nm_grid_colunas]);
          $this->est_yards[$this->nm_grid_colunas] = $this->est_yards[$this->nm_grid_colunas];
          if ($this->est_yards[$this->nm_grid_colunas] === "") 
          { 
              $this->est_yards[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->est_yards[$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->est_yards[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->est_yards[$this->nm_grid_colunas]);
          $this->yards_recd[$this->nm_grid_colunas] = $this->yards_recd[$this->nm_grid_colunas];
          if ($this->yards_recd[$this->nm_grid_colunas] === "") 
          { 
              $this->yards_recd[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->yards_recd[$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->yards_recd[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->yards_recd[$this->nm_grid_colunas]);
          $this->cost_lb_t[$this->nm_grid_colunas] = $this->cost_lb_t[$this->nm_grid_colunas];
          if ($this->cost_lb_t[$this->nm_grid_colunas] === "") 
          { 
              $this->cost_lb_t[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->cost_lb_t[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
          $this->cost_lb_t[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->cost_lb_t[$this->nm_grid_colunas]);
          $this->gr_yield[$this->nm_grid_colunas] = $this->gr_yield[$this->nm_grid_colunas];
          if ($this->gr_yield[$this->nm_grid_colunas] === "") 
          { 
              $this->gr_yield[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->gr_yield[$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->gr_yield[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->gr_yield[$this->nm_grid_colunas]);
          $this->cost_yd_t[$this->nm_grid_colunas] = $this->cost_yd_t[$this->nm_grid_colunas];
          if ($this->cost_yd_t[$this->nm_grid_colunas] === "") 
          { 
              $this->cost_yd_t[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->cost_yd_t[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
          $this->cost_yd_t[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->cost_yd_t[$this->nm_grid_colunas]);
          $this->gr_value[$this->nm_grid_colunas] = $this->gr_value[$this->nm_grid_colunas];
          if ($this->gr_value[$this->nm_grid_colunas] === "") 
          { 
              $this->gr_value[$this->nm_grid_colunas] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->gr_value[$this->nm_grid_colunas], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
          $this->gr_value[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->gr_value[$this->nm_grid_colunas]);
          $this->status[$this->nm_grid_colunas] = $this->status[$this->nm_grid_colunas];
          if ($this->status[$this->nm_grid_colunas] === "") 
          { 
              $this->status[$this->nm_grid_colunas] = "" ;  
          } 
          $this->status[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->status[$this->nm_grid_colunas]);
          $this->fin_no[$this->nm_grid_colunas] = $this->fin_no[$this->nm_grid_colunas];
          if ($this->fin_no[$this->nm_grid_colunas] === "") 
          { 
              $this->fin_no[$this->nm_grid_colunas] = "" ;  
          } 
          $this->fin_no[$this->nm_grid_colunas] = $this->SC_conv_utf8($this->fin_no[$this->nm_grid_colunas]);
          foreach ($this->sc_field_10[$this->nm_grid_colunas] as $NM_ind => $Dados) 
          {
          if ($this->sc_field_10[$this->nm_grid_colunas][$NM_ind] === "") 
          { 
              $this->sc_field_10[$this->nm_grid_colunas][$NM_ind] = "" ;  
          } 
              $this->sc_field_10[$this->nm_grid_colunas][$NM_ind] = $this->SC_conv_utf8($this->sc_field_10[$this->nm_grid_colunas][$NM_ind]);
          }
          foreach ($this->sc_field_11[$this->nm_grid_colunas] as $NM_ind => $Dados) 
          {
          if ($this->sc_field_11[$this->nm_grid_colunas][$NM_ind] === "") 
          { 
              $this->sc_field_11[$this->nm_grid_colunas][$NM_ind] = "" ;  
          } 
              $this->sc_field_11[$this->nm_grid_colunas][$NM_ind] = $this->SC_conv_utf8($this->sc_field_11[$this->nm_grid_colunas][$NM_ind]);
          }
          foreach ($this->sc_field_12[$this->nm_grid_colunas] as $NM_ind => $Dados) 
          {
          if ($this->sc_field_12[$this->nm_grid_colunas][$NM_ind] === "") 
          { 
              $this->sc_field_12[$this->nm_grid_colunas][$NM_ind] = "" ;  
          } 
              $this->sc_field_12[$this->nm_grid_colunas][$NM_ind] = $this->SC_conv_utf8($this->sc_field_12[$this->nm_grid_colunas][$NM_ind]);
          }
          foreach ($this->sc_field_13[$this->nm_grid_colunas] as $NM_ind => $Dados) 
          {
          if ($this->sc_field_13[$this->nm_grid_colunas][$NM_ind] === "") 
          { 
              $this->sc_field_13[$this->nm_grid_colunas][$NM_ind] = "" ;  
          } 
              $this->sc_field_13[$this->nm_grid_colunas][$NM_ind] = $this->SC_conv_utf8($this->sc_field_13[$this->nm_grid_colunas][$NM_ind]);
          }
          foreach ($this->sc_field_14[$this->nm_grid_colunas] as $NM_ind => $Dados) 
          {
          if ($this->sc_field_14[$this->nm_grid_colunas][$NM_ind] === "") 
          { 
              $this->sc_field_14[$this->nm_grid_colunas][$NM_ind] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->sc_field_14[$this->nm_grid_colunas][$NM_ind], $_SESSION['scriptcase']['reg_conf']['grup_val'], $_SESSION['scriptcase']['reg_conf']['dec_val'], "2", "S", "2", "", "V:" . $_SESSION['scriptcase']['reg_conf']['monet_f_pos'] . ":" . $_SESSION['scriptcase']['reg_conf']['monet_f_neg'], $_SESSION['scriptcase']['reg_conf']['simb_neg'], $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']) ; 
          } 
              $this->sc_field_14[$this->nm_grid_colunas][$NM_ind] = $this->SC_conv_utf8($this->sc_field_14[$this->nm_grid_colunas][$NM_ind]);
          }
          foreach ($this->sc_field_15[$this->nm_grid_colunas] as $NM_ind => $Dados) 
          {
          if ($this->sc_field_15[$this->nm_grid_colunas][$NM_ind] === "") 
          { 
              $this->sc_field_15[$this->nm_grid_colunas][$NM_ind] = "" ;  
          } 
              $this->sc_field_15[$this->nm_grid_colunas][$NM_ind] = $this->SC_conv_utf8($this->sc_field_15[$this->nm_grid_colunas][$NM_ind]);
          }
          foreach ($this->sc_field_16[$this->nm_grid_colunas] as $NM_ind => $Dados) 
          {
          if ($this->sc_field_16[$this->nm_grid_colunas][$NM_ind] === "") 
          { 
              $this->sc_field_16[$this->nm_grid_colunas][$NM_ind] = "" ;  
          } 
          else    
          { 
               $sc_field_16_x =  $this->sc_field_16[$this->nm_grid_colunas][$NM_ind];
               nm_conv_limpa_dado($sc_field_16_x, "YYYY-MM-DD");
               if (is_numeric($sc_field_16_x) && $sc_field_16_x > 0) 
               { 
                   $this->nm_data->SetaData($this->sc_field_16[$this->nm_grid_colunas][$NM_ind], "YYYY-MM-DD");
                   $this->sc_field_16[$this->nm_grid_colunas][$NM_ind] = html_entity_decode($this->nm_data->FormataSaida($this->Nm_date_format("DT", "ddmmaaaa")));
               } 
          } 
              $this->sc_field_16[$this->nm_grid_colunas][$NM_ind] = $this->SC_conv_utf8($this->sc_field_16[$this->nm_grid_colunas][$NM_ind]);
          }
          foreach ($this->sc_field_17[$this->nm_grid_colunas] as $NM_ind => $Dados) 
          {
          if ($this->sc_field_17[$this->nm_grid_colunas][$NM_ind] === "") 
          { 
              $this->sc_field_17[$this->nm_grid_colunas][$NM_ind] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->sc_field_17[$this->nm_grid_colunas][$NM_ind], $_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->sc_field_17[$this->nm_grid_colunas][$NM_ind] = $this->SC_conv_utf8($this->sc_field_17[$this->nm_grid_colunas][$NM_ind]);
          }
          foreach ($this->sc_field_18[$this->nm_grid_colunas] as $NM_ind => $Dados) 
          {
          if ($this->sc_field_18[$this->nm_grid_colunas][$NM_ind] === "") 
          { 
              $this->sc_field_18[$this->nm_grid_colunas][$NM_ind] = "" ;  
          } 
          else    
          { 
              nmgp_Form_Num_Val($this->sc_field_18[$this->nm_grid_colunas][$NM_ind], $_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->sc_field_18[$this->nm_grid_colunas][$NM_ind] = $this->SC_conv_utf8($this->sc_field_18[$this->nm_grid_colunas][$NM_ind]);
          }
            $cell_P_O_NUMBER = array('posx' => 10, 'posy' => 10, 'data' => $this->p_o_number[$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_DYE_ORDER = array('posx' => 10, 'posy' => 20, 'data' => $this->dye_order[$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_DATE = array('posx' => 10, 'posy' => 30, 'data' => $this->date[$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_DYER = array('posx' => 10, 'posy' => 40, 'data' => $this->dyer[$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_COLOR = array('posx' => 10, 'posy' => 50, 'data' => $this->color[$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_COLOR_NUMB = array('posx' => 10, 'posy' => 60, 'data' => $this->color_numb[$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_FINISH = array('posx' => 10, 'posy' => 70, 'data' => $this->finish[$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_FINISH_NO = array('posx' => 10, 'posy' => 80, 'data' => $this->finish_no[$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_FRAME = array('posx' => 10, 'posy' => 90, 'data' => $this->frame[$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_FWIDTH = array('posx' => 10, 'posy' => 100, 'data' => $this->fwidth[$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_PANELS = array('posx' => 10, 'posy' => 110, 'data' => $this->panels[$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_CPI = array('posx' => 10, 'posy' => 120, 'data' => $this->cpi[$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_WPI = array('posx' => 10, 'posy' => 130, 'data' => $this->wpi[$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_GS = array('posx' => 10, 'posy' => 140, 'data' => $this->gs[$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_FS = array('posx' => 10, 'posy' => 150, 'data' => $this->fs[$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_GREIGE_WI = array('posx' => 10, 'posy' => 160, 'data' => $this->greige_wi[$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_REQ_FIN_WT = array('posx' => 10, 'posy' => 170, 'data' => $this->req_fin_wt[$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_REQ_GR_YLD = array('posx' => 10, 'posy' => 180, 'data' => $this->req_gr_yld[$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_PUT_UP = array('posx' => 10, 'posy' => 190, 'data' => $this->put_up[$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_SPEC1 = array('posx' => 10, 'posy' => 200, 'data' => $this->spec1[$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_SPEC2 = array('posx' => 10, 'posy' => 210, 'data' => $this->spec2[$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_SPEC3 = array('posx' => 10, 'posy' => 220, 'data' => $this->spec3[$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_SLD = array('posx' => 10, 'posy' => 230, 'data' => $this->sld[$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_SHE = array('posx' => 10, 'posy' => 240, 'data' => $this->she[$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_LD1 = array('posx' => 10, 'posy' => 250, 'data' => $this->ld1[$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_LD2 = array('posx' => 10, 'posy' => 260, 'data' => $this->ld2[$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_HE1 = array('posx' => 10, 'posy' => 270, 'data' => $this->he1[$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_HE2 = array('posx' => 10, 'posy' => 280, 'data' => $this->he2[$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_KNITTER = array('posx' => 10, 'posy' => 290, 'data' => $this->knitter[$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_DESC1 = array('posx' => 10, 'posy' => 300, 'data' => $this->desc1[$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_DESC2 = array('posx' => 10, 'posy' => 310, 'data' => $this->desc2[$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_GGD = array('posx' => 10, 'posy' => 320, 'data' => $this->ggd[$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_PRICE_LB_D = array('posx' => 10, 'posy' => 330, 'data' => $this->price_lb_d[$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_COST_LB_D = array('posx' => 10, 'posy' => 340, 'data' => $this->cost_lb_d[$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_DYE_COST = array('posx' => 10, 'posy' => 350, 'data' => $this->dye_cost[$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_GR_LBS_O = array('posx' => 10, 'posy' => 360, 'data' => $this->gr_lbs_o[$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_GR_LBS_D = array('posx' => 10, 'posy' => 370, 'data' => $this->gr_lbs_d[$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_GR_LBS_OP = array('posx' => 10, 'posy' => 380, 'data' => $this->gr_lbs_op[$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_FIN_LBS = array('posx' => 10, 'posy' => 390, 'data' => $this->fin_lbs[$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_WORK_LOSS = array('posx' => 10, 'posy' => 400, 'data' => $this->work_loss[$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_COST_LB_G = array('posx' => 10, 'posy' => 410, 'data' => $this->cost_lb_g[$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_EST_YARDS = array('posx' => 10, 'posy' => 420, 'data' => $this->est_yards[$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_YARDS_RECD = array('posx' => 10, 'posy' => 430, 'data' => $this->yards_recd[$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_COST_LB_T = array('posx' => 10, 'posy' => 440, 'data' => $this->cost_lb_t[$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_GR_YIELD = array('posx' => 10, 'posy' => 450, 'data' => $this->gr_yield[$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_COST_YD_T = array('posx' => 10, 'posy' => 460, 'data' => $this->cost_yd_t[$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_GR_VALUE = array('posx' => 10, 'posy' => 470, 'data' => $this->gr_value[$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_STATUS = array('posx' => 10, 'posy' => 480, 'data' => $this->status[$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_FIN_NO = array('posx' => 10, 'posy' => 490, 'data' => $this->fin_no[$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_sc_field_10 = array('posx' => 0, 'posy' => 0, 'data' => $this->sc_field_10[$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_sc_field_11 = array('posx' => 0, 'posy' => 0, 'data' => $this->sc_field_11[$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_sc_field_12 = array('posx' => 0, 'posy' => 0, 'data' => $this->sc_field_12[$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_sc_field_13 = array('posx' => 0, 'posy' => 0, 'data' => $this->sc_field_13[$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_sc_field_14 = array('posx' => 0, 'posy' => 0, 'data' => $this->sc_field_14[$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_sc_field_15 = array('posx' => 0, 'posy' => 0, 'data' => $this->sc_field_15[$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_sc_field_16 = array('posx' => 0, 'posy' => 0, 'data' => $this->sc_field_16[$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_sc_field_17 = array('posx' => 0, 'posy' => 0, 'data' => $this->sc_field_17[$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_sc_field_18 = array('posx' => 0, 'posy' => 0, 'data' => $this->sc_field_18[$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);


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            foreach ($this->sc_field_0[$this->nm_grid_colunas] as $NM_ind => $Dados)
            {
                $this->Pdf->SetFont($cell_sc_field_10['font_type'], $cell_sc_field_10['font_style'], $cell_sc_field_10['font_size']);
                $this->Pdf->SetTextColor($cell_sc_field_10['color_r'], $cell_sc_field_10['color_g'], $cell_sc_field_10['color_b']);
                if (!empty($cell_sc_field_10['posx']))
                {
                    $this->Pdf->SetX($cell_sc_field_10['posx']);
                }
                $this->Pdf->Cell($cell_sc_field_10['width'], 0, $this->sc_field_10[$this->nm_grid_colunas][$NM_ind], 0, 0, $cell_sc_field_10['align']);
                $this->Pdf->SetFont($cell_sc_field_11['font_type'], $cell_sc_field_11['font_style'], $cell_sc_field_11['font_size']);
                $this->Pdf->SetTextColor($cell_sc_field_11['color_r'], $cell_sc_field_11['color_g'], $cell_sc_field_11['color_b']);
                if (!empty($cell_sc_field_11['posx']))
                {
                    $this->Pdf->SetX($cell_sc_field_11['posx']);
                }
                $this->Pdf->Cell($cell_sc_field_11['width'], 0, $this->sc_field_11[$this->nm_grid_colunas][$NM_ind], 0, 0, $cell_sc_field_11['align']);
                $this->Pdf->SetFont($cell_sc_field_12['font_type'], $cell_sc_field_12['font_style'], $cell_sc_field_12['font_size']);
                $this->Pdf->SetTextColor($cell_sc_field_12['color_r'], $cell_sc_field_12['color_g'], $cell_sc_field_12['color_b']);
                if (!empty($cell_sc_field_12['posx']))
                {
                    $this->Pdf->SetX($cell_sc_field_12['posx']);
                }
                $this->Pdf->Cell($cell_sc_field_12['width'], 0, $this->sc_field_12[$this->nm_grid_colunas][$NM_ind], 0, 0, $cell_sc_field_12['align']);
                $this->Pdf->SetFont($cell_sc_field_13['font_type'], $cell_sc_field_13['font_style'], $cell_sc_field_13['font_size']);
                $this->Pdf->SetTextColor($cell_sc_field_13['color_r'], $cell_sc_field_13['color_g'], $cell_sc_field_13['color_b']);
                if (!empty($cell_sc_field_13['posx']))
                {
                    $this->Pdf->SetX($cell_sc_field_13['posx']);
                }
                $this->Pdf->Cell($cell_sc_field_13['width'], 0, $this->sc_field_13[$this->nm_grid_colunas][$NM_ind], 0, 0, $cell_sc_field_13['align']);
                $this->Pdf->SetFont($cell_sc_field_14['font_type'], $cell_sc_field_14['font_style'], $cell_sc_field_14['font_size']);
                $this->Pdf->SetTextColor($cell_sc_field_14['color_r'], $cell_sc_field_14['color_g'], $cell_sc_field_14['color_b']);
                if (!empty($cell_sc_field_14['posx']))
                {
                    $this->Pdf->SetX($cell_sc_field_14['posx']);
                }
                $this->Pdf->Cell($cell_sc_field_14['width'], 0, $this->sc_field_14[$this->nm_grid_colunas][$NM_ind], 0, 0, $cell_sc_field_14['align']);
                $this->Pdf->SetFont($cell_sc_field_15['font_type'], $cell_sc_field_15['font_style'], $cell_sc_field_15['font_size']);
                $this->Pdf->SetTextColor($cell_sc_field_15['color_r'], $cell_sc_field_15['color_g'], $cell_sc_field_15['color_b']);
                if (!empty($cell_sc_field_15['posx']))
                {
                    $this->Pdf->SetX($cell_sc_field_15['posx']);
                }
                $this->Pdf->Cell($cell_sc_field_15['width'], 0, $this->sc_field_15[$this->nm_grid_colunas][$NM_ind], 0, 0, $cell_sc_field_15['align']);
                $this->Pdf->SetFont($cell_sc_field_16['font_type'], $cell_sc_field_16['font_style'], $cell_sc_field_16['font_size']);
                $this->Pdf->SetTextColor($cell_sc_field_16['color_r'], $cell_sc_field_16['color_g'], $cell_sc_field_16['color_b']);
                if (!empty($cell_sc_field_16['posx']))
                {
                    $this->Pdf->SetX($cell_sc_field_16['posx']);
                }
                $this->Pdf->Cell($cell_sc_field_16['width'], 0, $this->sc_field_16[$this->nm_grid_colunas][$NM_ind], 0, 0, $cell_sc_field_16['align']);
                $this->Pdf->SetFont($cell_sc_field_17['font_type'], $cell_sc_field_17['font_style'], $cell_sc_field_17['font_size']);
                $this->Pdf->SetTextColor($cell_sc_field_17['color_r'], $cell_sc_field_17['color_g'], $cell_sc_field_17['color_b']);
                if (!empty($cell_sc_field_17['posx']))
                {
                    $this->Pdf->SetX($cell_sc_field_17['posx']);
                }
                $this->Pdf->Cell($cell_sc_field_17['width'], 0, $this->sc_field_17[$this->nm_grid_colunas][$NM_ind], 0, 0, $cell_sc_field_17['align']);
                $this->Pdf->SetFont($cell_sc_field_18['font_type'], $cell_sc_field_18['font_style'], $cell_sc_field_18['font_size']);
                $this->Pdf->SetTextColor($cell_sc_field_18['color_r'], $cell_sc_field_18['color_g'], $cell_sc_field_18['color_b']);
                if (!empty($cell_sc_field_18['posx']))
                {
                    $this->Pdf->SetX($cell_sc_field_18['posx']);
                }
                $this->Pdf->Cell($cell_sc_field_18['width'], 0, $this->sc_field_18[$this->nm_grid_colunas][$NM_ind], 0, 0, $cell_sc_field_18['align']);
                if (!isset($max_Y) || empty($max_Y))
                {
                    $max_Y = $this->Pdf->GetY();
                }
                $max_Y += 20;
                $this->Pdf->SetY($max_Y);

            }
          $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);
 }
 function SC_conv_utf8($input)
 {
     if ($this->Font_ttf && !NM_is_utf8($input))
     {
         $input = mb_convert_encoding($input, "UTF-8", $_SESSION['scriptcase']['charset']);
     }
     elseif (!$this->Font_ttf && $_SESSION['scriptcase']['charset'] == "UTF-8" && NM_is_utf8($input))
     {
         $input = mb_convert_encoding($input, "ISO-8859-9", "UTF-8");
     }
     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 Nm_date_format($Type, $Format)
 {
     $Form_base = str_replace("/", "", $Format);
     $Form_base = str_replace("-", "", $Form_base);
     $Form_base = str_replace(":", "", $Form_base);
     $Form_base = str_replace(";", "", $Form_base);
     $Form_base = str_replace(" ", "", $Form_base);
     $Form_base = str_replace("a", "Y", $Form_base);
     $Form_base = str_replace("y", "Y", $Form_base);
     $Form_base = str_replace("h", "H", $Form_base);
     $date_format_show = "";
     if ($Type == "DT" || $Type == "DH")
     {
         $Str_date = str_replace("a", "y", strtolower($_SESSION['scriptcase']['reg_conf']['date_format']));
         $Str_date = str_replace("y", "Y", $Str_date);
         $Str_date = str_replace("h", "H", $Str_date);
         $Lim   = strlen($Str_date);
         $Ult   = "";
         $Arr_D = array();
         for ($I = 0; $I < $Lim; $I++)
         {
              $Char = substr($Str_date, $I, 1);
              if ($Char != $Ult)
              {
                  $Arr_D[] = $Char;
              }
              $Ult = $Char;
         }
         $Prim = true;
         foreach ($Arr_D as $Cada_d)
         {
             if (strpos($Form_base, $Cada_d) !== false)
             {
                 $date_format_show .= (!$Prim) ? $_SESSION['scriptcase']['reg_conf']['date_sep'] : "";
                 $date_format_show .= $Cada_d;
                 $Prim = false;
             }
         }
     }
     if ($Type == "DH" || $Type == "HH")
     {
         if ($Type == "DH")
         {
             $date_format_show .= " ";
         }
         $Str_time = strtolower($_SESSION['scriptcase']['reg_conf']['time_format']);
         $Str_time = str_replace("h", "H", $Str_time);
         $Lim   = strlen($Str_time);
         $Ult   = "";
         $Arr_T = array();
         for ($I = 0; $I < $Lim; $I++)
         {
              $Char = substr($Str_time, $I, 1);
              if ($Char != $Ult)
              {
                  $Arr_T[] = $Char;
              }
              $Ult = $Char;
         }
         $Prim = true;
         foreach ($Arr_T as $Cada_t)
         {
             if (strpos($Form_base, $Cada_t) !== false)
             {
                 $date_format_show .= (!$Prim) ? $_SESSION['scriptcase']['reg_conf']['time_sep'] : "";
                 $date_format_show .= $Cada_t;
                 $Prim = false;
             }
         }
     }
     return $date_format_show;
 }

   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;
   } 
}
?>
