/home/suroeste/public_html/gorbus.transportessuroeste.com/suroeste/form_bancos
NameSizeModeActions
form_bancos.htm1250644editdlrm
form_bancos.php590644editdlrm
form_bancos_apl.php2720830644editdlrm
form_bancos_doc_name.php160970644editdlrm
form_bancos_empty.htm1940644editdlrm
form_bancos_erro.class.php16130644editdlrm
form_bancos_erro.php105990644editdlrm
form_bancos_fim.php111710644editdlrm
form_bancos_form0.php1314920644editdlrm
form_bancos_jquery.php255130644editdlrm
form_bancos_js0.php198330644editdlrm
form_bancos_json.php370280644editdlrm
form_bancos_ltr.css26790644editdlrm
form_bancos_mob.htm2690644editdlrm
form_bancos_mob.php1708370644editdlrm
form_bancos_mob_apl.php2737070644editdlrm
form_bancos_mob_doc_name.php160970644editdlrm
form_bancos_mob_empty.htm1980644editdlrm
form_bancos_mob_erro.class.php16210644editdlrm
form_bancos_mob_erro.php107030644editdlrm
form_bancos_mob_fim.php113710644editdlrm
form_bancos_mob_form0.php1384040644editdlrm
form_bancos_mob_jquery.php225950644editdlrm
form_bancos_mob_js0.php171250644editdlrm
form_bancos_mob_json.php370280644editdlrm
form_bancos_mob_ltr.css26790644editdlrm
form_bancos_mob_rtl.css00644editdlrm
form_bancos_mob_sajax.php178970644editdlrm
form_bancos_mob_sajax_js.php1458380644editdlrm
form_bancos_mob_session.php30650644editdlrm
form_bancos_mob_ul_save.php40960644editdlrm
form_bancos_rtl.css7050644editdlrm
form_bancos_sajax.php178970644editdlrm
form_bancos_sajax_js.php1454560644editdlrm
form_bancos_session.php30650644editdlrm
form_bancos_teste.php460644editdlrm
form_bancos_ul_save.php40800644editdlrm
index.php1672110644editdlrm
Edit: /home/suroeste/public_html/gorbus.transportessuroeste.com/suroeste/form_bancos/form_bancos_apl.php (272083B)
'', 'param' => array(), 'autoComp' => '', 'rsSize' => '', 'msgDisplay' => '', 'errList' => array(), 'fldList' => array(), 'varList' => array(), 'focus' => '', 'navStatus' => array(), 'navSummary' => array(), 'navPage' => array(), 'redir' => array(), 'blockDisplay' => array(), 'fieldDisplay' => array(), 'fieldLabel' => array(), 'readOnly' => array(), 'btnVars' => array(), 'ajaxAlert' => array(), 'ajaxMessage' => array(), 'ajaxJavascript' => array(), 'buttonDisplay' => array(), 'buttonDisplayVert' => array(), 'calendarReload' => false, 'quickSearchRes' => false, 'displayMsg' => false, 'displayMsgTxt' => '', 'dyn_search' => array(), 'empty_filter' => '', 'event_field' => '', 'fieldsWithErrors' => array(), ); var $NM_ajax_force_values = false; var $captcha_code; var $captcha_sent; var $Nav_permite_ava = true; var $Nav_permite_ret = true; var $Apl_com_erro = false; var $app_is_initializing = false; var $Ini; var $Erro; var $Db; var $idbanco; var $tipocuenta; var $tipocuenta_1; var $nombre; var $formapago; var $formapago_1; var $ctacontable; var $nrocuenta; var $saldoinicial; var $otrasentradas; var $otrassalidas; var $nit; var $idoficina; var $idoficina_1; var $perfil; var $perfil_1; var $taquilla; var $taquilla_1; var $nm_data; var $nmgp_opcao; var $nmgp_opc_ant; var $sc_evento; var $sc_insert_on; var $nmgp_clone; var $nmgp_return_img = array(); var $nmgp_dados_form = array(); var $nmgp_dados_select = array(); var $nm_location; var $nm_flag_iframe; var $nm_flag_saida_novo; var $nmgp_botoes = array(); var $nmgp_url_saida; var $nmgp_form_show; var $nmgp_form_empty; var $nmgp_cmp_readonly = array(); var $nmgp_cmp_hidden = array(); var $Field_no_validate = array(); var $form_paginacao = 'parcial'; var $lig_edit_lookup = false; var $lig_edit_lookup_call = false; var $lig_edit_lookup_cb = ''; var $lig_edit_lookup_row = ''; var $is_calendar_app = false; var $Embutida_call = false; var $Embutida_ronly = false; var $Embutida_proc = false; var $Embutida_form = false; var $Grid_editavel = false; var $url_webhelp = ''; var $nm_todas_criticas; var $Campos_Mens_erro; var $nm_new_label = array(); var $record_insert_ok = false; var $record_delete_ok = false; // //----- function ini_controle() { global $nm_url_saida, $teste_validade, $script_case_init, $glo_senha_protect, $nm_apl_dependente, $nm_form_submit, $sc_check_excl, $nm_opc_form_php, $nm_call_php, $nm_opc_lookup; if ($this->NM_ajax_flag) { if (isset($this->NM_ajax_info['param']['csrf_token'])) { $this->csrf_token = $this->NM_ajax_info['param']['csrf_token']; } if (isset($this->NM_ajax_info['param']['ctacontable'])) { $this->ctacontable = $this->NM_ajax_info['param']['ctacontable']; } if (isset($this->NM_ajax_info['param']['formapago'])) { $this->formapago = $this->NM_ajax_info['param']['formapago']; } if (isset($this->NM_ajax_info['param']['idbanco'])) { $this->idbanco = $this->NM_ajax_info['param']['idbanco']; } if (isset($this->NM_ajax_info['param']['idoficina'])) { $this->idoficina = $this->NM_ajax_info['param']['idoficina']; } if (isset($this->NM_ajax_info['param']['nit'])) { $this->nit = $this->NM_ajax_info['param']['nit']; } if (isset($this->NM_ajax_info['param']['nm_form_submit'])) { $this->nm_form_submit = $this->NM_ajax_info['param']['nm_form_submit']; } if (isset($this->NM_ajax_info['param']['nmgp_ancora'])) { $this->nmgp_ancora = $this->NM_ajax_info['param']['nmgp_ancora']; } if (isset($this->NM_ajax_info['param']['nmgp_arg_dyn_search'])) { $this->nmgp_arg_dyn_search = $this->NM_ajax_info['param']['nmgp_arg_dyn_search']; } if (isset($this->NM_ajax_info['param']['nmgp_arg_fast_search'])) { $this->nmgp_arg_fast_search = $this->NM_ajax_info['param']['nmgp_arg_fast_search']; } if (isset($this->NM_ajax_info['param']['nmgp_cond_fast_search'])) { $this->nmgp_cond_fast_search = $this->NM_ajax_info['param']['nmgp_cond_fast_search']; } if (isset($this->NM_ajax_info['param']['nmgp_fast_search'])) { $this->nmgp_fast_search = $this->NM_ajax_info['param']['nmgp_fast_search']; } if (isset($this->NM_ajax_info['param']['nmgp_num_form'])) { $this->nmgp_num_form = $this->NM_ajax_info['param']['nmgp_num_form']; } if (isset($this->NM_ajax_info['param']['nmgp_opcao'])) { $this->nmgp_opcao = $this->NM_ajax_info['param']['nmgp_opcao']; } if (isset($this->NM_ajax_info['param']['nmgp_ordem'])) { $this->nmgp_ordem = $this->NM_ajax_info['param']['nmgp_ordem']; } if (isset($this->NM_ajax_info['param']['nmgp_parms'])) { $this->nmgp_parms = $this->NM_ajax_info['param']['nmgp_parms']; } if (isset($this->NM_ajax_info['param']['nmgp_url_saida'])) { $this->nmgp_url_saida = $this->NM_ajax_info['param']['nmgp_url_saida']; } if (isset($this->NM_ajax_info['param']['nombre'])) { $this->nombre = $this->NM_ajax_info['param']['nombre']; } if (isset($this->NM_ajax_info['param']['nrocuenta'])) { $this->nrocuenta = $this->NM_ajax_info['param']['nrocuenta']; } if (isset($this->NM_ajax_info['param']['perfil'])) { $this->perfil = $this->NM_ajax_info['param']['perfil']; } if (isset($this->NM_ajax_info['param']['script_case_init'])) { $this->script_case_init = $this->NM_ajax_info['param']['script_case_init']; } if (isset($this->NM_ajax_info['param']['taquilla'])) { $this->taquilla = $this->NM_ajax_info['param']['taquilla']; } if (isset($this->NM_ajax_info['param']['tipocuenta'])) { $this->tipocuenta = $this->NM_ajax_info['param']['tipocuenta']; } if (isset($this->nmgp_refresh_fields)) { $this->nmgp_refresh_fields = explode('_#fld#_', $this->nmgp_refresh_fields); $this->nmgp_opcao = 'recarga'; } if (!isset($this->nmgp_refresh_row)) { $this->nmgp_refresh_row = ''; } } $this->scSajaxReservedWords = array('rs', 'rst', 'rsrnd', 'rsargs'); $this->sc_conv_var = array(); if (!empty($_FILES)) { foreach ($_FILES as $nmgp_campo => $nmgp_valores) { if (!in_array(strtolower($nmgp_campo), $this->scSajaxReservedWords)) { if (isset($this->sc_conv_var[$nmgp_campo])) { $nmgp_campo = $this->sc_conv_var[$nmgp_campo]; } elseif (isset($this->sc_conv_var[strtolower($nmgp_campo)])) { $nmgp_campo = $this->sc_conv_var[strtolower($nmgp_campo)]; } } $tmp_scfile_name = $nmgp_campo . "_scfile_name"; $tmp_scfile_type = $nmgp_campo . "_scfile_type"; $this->$nmgp_campo = is_array($nmgp_valores['tmp_name']) ? $nmgp_valores['tmp_name'][0] : $nmgp_valores['tmp_name']; $this->$tmp_scfile_type = is_array($nmgp_valores['type']) ? $nmgp_valores['type'][0] : $nmgp_valores['type']; $this->$tmp_scfile_name = is_array($nmgp_valores['name']) ? $nmgp_valores['name'][0] : $nmgp_valores['name']; } } $Sc_lig_md5 = false; if (!empty($_POST)) { foreach ($_POST as $nmgp_var => $nmgp_val) { if (substr($nmgp_var, 0, 11) == "SC_glo_par_") { $nmgp_var = substr($nmgp_var, 11); $nmgp_val = $_SESSION[$nmgp_val]; } if ($nmgp_var == "nmgp_parms" && substr($nmgp_val, 0, 8) == "@SC_par@") { $SC_Ind_Val = explode("@SC_par@", $nmgp_val); if (count($SC_Ind_Val) == 4 && isset($_SESSION['sc_session'][$SC_Ind_Val[1]][$SC_Ind_Val[2]]['Lig_Md5'][$SC_Ind_Val[3]])) { $nmgp_val = $_SESSION['sc_session'][$SC_Ind_Val[1]][$SC_Ind_Val[2]]['Lig_Md5'][$SC_Ind_Val[3]]; $Sc_lig_md5 = true; } else { $_SESSION['sc_session']['SC_parm_violation'] = true; } } if (!in_array(strtolower($nmgp_var), $this->scSajaxReservedWords)) { if (isset($this->sc_conv_var[$nmgp_var])) { $nmgp_var = $this->sc_conv_var[$nmgp_var]; } elseif (isset($this->sc_conv_var[strtolower($nmgp_var)])) { $nmgp_var = $this->sc_conv_var[strtolower($nmgp_var)]; } } $nmgp_val = NM_decode_input($nmgp_val); $this->$nmgp_var = $nmgp_val; } } if (!empty($_GET)) { foreach ($_GET as $nmgp_var => $nmgp_val) { if (substr($nmgp_var, 0, 11) == "SC_glo_par_") { $nmgp_var = substr($nmgp_var, 11); $nmgp_val = $_SESSION[$nmgp_val]; } if ($nmgp_var == "nmgp_parms" && substr($nmgp_val, 0, 8) == "@SC_par@") { $SC_Ind_Val = explode("@SC_par@", $nmgp_val); if (count($SC_Ind_Val) == 4 && isset($_SESSION['sc_session'][$SC_Ind_Val[1]][$SC_Ind_Val[2]]['Lig_Md5'][$SC_Ind_Val[3]])) { $nmgp_val = $_SESSION['sc_session'][$SC_Ind_Val[1]][$SC_Ind_Val[2]]['Lig_Md5'][$SC_Ind_Val[3]]; $Sc_lig_md5 = true; } else { $_SESSION['sc_session']['SC_parm_violation'] = true; } } if (!in_array(strtolower($nmgp_var), $this->scSajaxReservedWords)) { if (isset($this->sc_conv_var[$nmgp_var])) { $nmgp_var = $this->sc_conv_var[$nmgp_var]; } elseif (isset($this->sc_conv_var[strtolower($nmgp_var)])) { $nmgp_var = $this->sc_conv_var[strtolower($nmgp_var)]; } } $nmgp_val = NM_decode_input($nmgp_val); $this->$nmgp_var = $nmgp_val; } } if (isset($SC_lig_apl_orig) && !$Sc_lig_md5 && (!isset($nmgp_parms) || ($nmgp_parms != "SC_null" && substr($nmgp_parms, 0, 8) != "OrScLink"))) { $_SESSION['sc_session']['SC_parm_violation'] = true; } if (isset($nmgp_parms) && $nmgp_parms == "SC_null") { $nmgp_parms = ""; } if (isset($this->Refresh_aba_menu)) { $_SESSION['sc_session'][$script_case_init]['form_bancos']['Refresh_aba_menu'] = $this->Refresh_aba_menu; } if (isset($this->nmgp_opcao) && $this->nmgp_opcao == "reload_novo") { $_POST['nmgp_opcao'] = "novo"; $this->nmgp_opcao = "novo"; $_SESSION['sc_session'][$script_case_init]['form_bancos']['opcao'] = "novo"; $_SESSION['sc_session'][$script_case_init]['form_bancos']['opc_ant'] = "inicio"; } if (isset($_SESSION['sc_session'][$script_case_init]['form_bancos']['embutida_parms'])) { $this->nmgp_parms = $_SESSION['sc_session'][$script_case_init]['form_bancos']['embutida_parms']; unset($_SESSION['sc_session'][$script_case_init]['form_bancos']['embutida_parms']); } if (isset($this->nmgp_parms) && !empty($this->nmgp_parms)) { if (isset($_SESSION['nm_aba_bg_color'])) { unset($_SESSION['nm_aba_bg_color']); } $nmgp_parms = str_replace("@aspass@", "'", $this->nmgp_parms); $nmgp_parms = str_replace("*scout", "?@?", $nmgp_parms); $nmgp_parms = str_replace("*scin", "?#?", $nmgp_parms); $todox = str_replace("?#?@?@?", "?#?@ ?@?", $nmgp_parms); $todo = explode("?@?", $todox); $ix = 0; while (!empty($todo[$ix])) { $cadapar = explode("?#?", $todo[$ix]); if (1 < sizeof($cadapar)) { if (substr($cadapar[0], 0, 11) == "SC_glo_par_") { $cadapar[0] = substr($cadapar[0], 11); $cadapar[1] = $_SESSION[$cadapar[1]]; } if (isset($this->sc_conv_var[$cadapar[0]])) { $cadapar[0] = $this->sc_conv_var[$cadapar[0]]; } elseif (isset($this->sc_conv_var[strtolower($cadapar[0])])) { $cadapar[0] = $this->sc_conv_var[strtolower($cadapar[0])]; } nm_limpa_str_form_bancos($cadapar[1]); if ($cadapar[1] == "@ ") {$cadapar[1] = trim($cadapar[1]); } $Tmp_par = $cadapar[0]; $this->$Tmp_par = $cadapar[1]; } $ix++; } if (isset($this->NM_where_filter_form)) { $_SESSION['sc_session'][$script_case_init]['form_bancos']['where_filter_form'] = $this->NM_where_filter_form; unset($_SESSION['sc_session'][$script_case_init]['form_bancos']['total']); } if (isset($this->sc_redir_atualiz)) { $_SESSION['sc_session'][$script_case_init]['form_bancos']['sc_redir_atualiz'] = $this->sc_redir_atualiz; } if (isset($this->sc_redir_insert)) { $_SESSION['sc_session'][$script_case_init]['form_bancos']['sc_redir_insert'] = $this->sc_redir_insert; unset($_SESSION['sc_session'][$script_case_init]['form_bancos']['opc_ant']); } } elseif (isset($script_case_init) && !empty($script_case_init) && isset($_SESSION['sc_session'][$script_case_init]['form_bancos']['parms'])) { if ((!isset($this->nmgp_opcao) || ($this->nmgp_opcao != "incluir" && $this->nmgp_opcao != "alterar" && $this->nmgp_opcao != "excluir" && $this->nmgp_opcao != "novo" && $this->nmgp_opcao != "recarga" && $this->nmgp_opcao != "muda_form")) && (!isset($this->NM_ajax_opcao) || $this->NM_ajax_opcao == "")) { $todox = str_replace("?#?@?@?", "?#?@ ?@?", $_SESSION['sc_session'][$script_case_init]['form_bancos']['parms']); $todo = explode("?@?", $todox); $ix = 0; while (!empty($todo[$ix])) { $cadapar = explode("?#?", $todo[$ix]); if (substr($cadapar[0], 0, 11) == "SC_glo_par_") { $cadapar[0] = substr($cadapar[0], 11); $cadapar[1] = $_SESSION[$cadapar[1]]; } if ($cadapar[1] == "@ ") {$cadapar[1] = trim($cadapar[1]); } $Tmp_par = $cadapar[0]; $this->$Tmp_par = $cadapar[1]; $ix++; } } } if (isset($this->nm_run_menu) && $this->nm_run_menu == 1) { $_SESSION['sc_session'][$script_case_init]['form_bancos']['nm_run_menu'] = 1; } if (!$this->NM_ajax_flag && 'autocomp_' == substr($this->NM_ajax_opcao, 0, 9)) { $this->NM_ajax_flag = true; } $dir_raiz = strrpos($_SERVER['PHP_SELF'],"/") ; $dir_raiz = substr($_SERVER['PHP_SELF'], 0, $dir_raiz + 1) ; if (isset($this->nm_evt_ret_edit) && '' != $this->nm_evt_ret_edit) { $_SESSION['sc_session'][$script_case_init]['form_bancos']['lig_edit_lookup'] = true; $_SESSION['sc_session'][$script_case_init]['form_bancos']['lig_edit_lookup_cb'] = $this->nm_evt_ret_edit; $_SESSION['sc_session'][$script_case_init]['form_bancos']['lig_edit_lookup_row'] = isset($this->nm_evt_ret_row) ? $this->nm_evt_ret_row : ''; } if (isset($_SESSION['sc_session'][$script_case_init]['form_bancos']['lig_edit_lookup']) && $_SESSION['sc_session'][$script_case_init]['form_bancos']['lig_edit_lookup']) { $this->lig_edit_lookup = true; $this->lig_edit_lookup_cb = $_SESSION['sc_session'][$script_case_init]['form_bancos']['lig_edit_lookup_cb']; $this->lig_edit_lookup_row = $_SESSION['sc_session'][$script_case_init]['form_bancos']['lig_edit_lookup_row']; } if (!$this->Ini) { $this->Ini = new form_bancos_ini(); $this->Ini->init(); $this->nm_data = new nm_data("es"); $this->app_is_initializing = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['initialize']; } else { $this->nm_data = new nm_data("es"); } $_SESSION['sc_session'][$script_case_init]['form_bancos']['upload_field_info'] = array(); unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['masterValue']); $this->Change_Menu = false; $run_iframe = (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe']) && ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "F" || $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "R")) ? true : false; if (!$run_iframe && isset($_SESSION['scriptcase']['menu_atual']) && !$_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_call'] && (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['sc_outra_jan']) || !$_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['sc_outra_jan'])) { $this->sc_init_menu = "x"; if (isset($_SESSION['scriptcase'][$_SESSION['scriptcase']['menu_atual']]['sc_init']['form_bancos'])) { $this->sc_init_menu = $_SESSION['scriptcase'][$_SESSION['scriptcase']['menu_atual']]['sc_init']['form_bancos']; } elseif (isset($_SESSION['scriptcase']['menu_apls'][$_SESSION['scriptcase']['menu_atual']])) { foreach ($_SESSION['scriptcase']['menu_apls'][$_SESSION['scriptcase']['menu_atual']] as $init => $resto) { if ($this->Ini->sc_page == $init) { $this->sc_init_menu = $init; break; } } } if ($this->Ini->sc_page == $this->sc_init_menu && !isset($_SESSION['scriptcase']['menu_apls'][$_SESSION['scriptcase']['menu_atual']][$this->sc_init_menu]['form_bancos'])) { $_SESSION['scriptcase']['menu_apls'][$_SESSION['scriptcase']['menu_atual']][$this->sc_init_menu]['form_bancos']['link'] = $this->Ini->sc_protocolo . $this->Ini->server . $this->Ini->path_link . "" . SC_dir_app_name('form_bancos') . "/"; $_SESSION['scriptcase']['menu_apls'][$_SESSION['scriptcase']['menu_atual']][$this->sc_init_menu]['form_bancos']['label'] = "ACTUALIZA DATOS DE CAJA Y BANCOS"; $this->Change_Menu = true; } elseif ($this->Ini->sc_page == $this->sc_init_menu) { $achou = false; foreach ($_SESSION['scriptcase']['menu_apls'][$_SESSION['scriptcase']['menu_atual']][$this->sc_init_menu] as $apl => $parms) { if ($apl == "form_bancos") { $achou = true; } elseif ($achou) { unset($_SESSION['scriptcase']['menu_apls'][$_SESSION['scriptcase']['menu_atual']][$this->sc_init_menu][$apl]); $this->Change_Menu = true; } } } } if (!function_exists("nmButtonOutput")) { include_once($this->Ini->path_lib_php . "nm_gp_config_btn.php"); } include("../_lib/css/" . $this->Ini->str_schema_all . "_form.php"); $this->Ini->Str_btn_form = (isset($_SESSION['scriptcase']['str_button_all'])) ? $_SESSION['scriptcase']['str_button_all'] : "scriptcase9_Rhino"; $_SESSION['scriptcase']['str_button_all'] = $this->Ini->Str_btn_form; include($this->Ini->path_btn . $this->Ini->Str_btn_form . '/' . $this->Ini->Str_btn_form . $_SESSION['scriptcase']['reg_conf']['css_dir'] . '.php'); $_SESSION['scriptcase']['css_form_help'] = '../_lib/css/' . $this->Ini->str_schema_all . "_form.css"; $_SESSION['scriptcase']['css_form_help_dir'] = '../_lib/css/' . $this->Ini->str_schema_all . "_form" . $_SESSION['scriptcase']['reg_conf']['css_dir'] . ".css"; $this->Db = $this->Ini->Db; $this->Ini->str_google_fonts = isset($str_google_fonts)?$str_google_fonts:''; $this->Ini->Img_sep_form = "/" . trim($str_toolbar_separator); $this->Ini->Color_bg_ajax = !isset($str_ajax_bg) || "" == trim($str_ajax_bg) ? "#000" : $str_ajax_bg; $this->Ini->Border_c_ajax = !isset($str_ajax_border_c) || "" == trim($str_ajax_border_c) ? "" : $str_ajax_border_c; $this->Ini->Border_s_ajax = !isset($str_ajax_border_s) || "" == trim($str_ajax_border_s) ? "" : $str_ajax_border_s; $this->Ini->Border_w_ajax = !isset($str_ajax_border_w) || "" == trim($str_ajax_border_w) ? "" : $str_ajax_border_w; $this->Ini->Block_img_exp = !isset($str_block_exp) || "" == trim($str_block_exp) ? "" : $str_block_exp; $this->Ini->Block_img_col = !isset($str_block_col) || "" == trim($str_block_col) ? "" : $str_block_col; $this->Ini->Msg_ico_title = !isset($str_msg_ico_title) || "" == trim($str_msg_ico_title) ? "" : $str_msg_ico_title; $this->Ini->Msg_ico_body = !isset($str_msg_ico_body) || "" == trim($str_msg_ico_body) ? "" : $str_msg_ico_body; $this->Ini->Err_ico_title = !isset($str_err_ico_title) || "" == trim($str_err_ico_title) ? "" : $str_err_ico_title; $this->Ini->Err_ico_body = !isset($str_err_ico_body) || "" == trim($str_err_ico_body) ? "" : $str_err_ico_body; $this->Ini->Cal_ico_back = !isset($str_cal_ico_back) || "" == trim($str_cal_ico_back) ? "" : $str_cal_ico_back; $this->Ini->Cal_ico_for = !isset($str_cal_ico_for) || "" == trim($str_cal_ico_for) ? "" : $str_cal_ico_for; $this->Ini->Cal_ico_close = !isset($str_cal_ico_close) || "" == trim($str_cal_ico_close) ? "" : $str_cal_ico_close; $this->Ini->Tab_space = !isset($str_tab_space) || "" == trim($str_tab_space) ? "" : $str_tab_space; $this->Ini->Bubble_tail = !isset($str_bubble_tail) || "" == trim($str_bubble_tail) ? "" : $str_bubble_tail; $this->Ini->Label_sort_pos = !isset($str_label_sort_pos) || "" == trim($str_label_sort_pos) ? "" : $str_label_sort_pos; $this->Ini->Label_sort = !isset($str_label_sort) || "" == trim($str_label_sort) ? "" : $str_label_sort; $this->Ini->Label_sort_asc = !isset($str_label_sort_asc) || "" == trim($str_label_sort_asc) ? "" : $str_label_sort_asc; $this->Ini->Label_sort_desc = !isset($str_label_sort_desc) || "" == trim($str_label_sort_desc) ? "" : $str_label_sort_desc; $this->Ini->Img_status_ok = !isset($str_img_status_ok) || "" == trim($str_img_status_ok) ? "" : $str_img_status_ok; $this->Ini->Img_status_err = !isset($str_img_status_err) || "" == trim($str_img_status_err) ? "" : $str_img_status_err; $this->Ini->Css_status = "scFormInputError"; $this->Ini->Css_status_pwd_box = "scFormInputErrorPwdBox"; $this->Ini->Css_status_pwd_text = "scFormInputErrorPwdText"; $this->Ini->Error_icon_span = !isset($str_error_icon_span) || "" == trim($str_error_icon_span) ? false : "message" == $str_error_icon_span; $this->Ini->Img_qs_search = !isset($img_qs_search) || "" == trim($img_qs_search) ? "scriptcase__NM__qs_lupa.png" : $img_qs_search; $this->Ini->Img_qs_clean = !isset($img_qs_clean) || "" == trim($img_qs_clean) ? "scriptcase__NM__qs_close.png" : $img_qs_clean; $this->Ini->Str_qs_image_padding = !isset($str_qs_image_padding) || "" == trim($str_qs_image_padding) ? "0" : $str_qs_image_padding; $this->Ini->App_div_tree_img_col = trim($app_div_str_tree_col); $this->Ini->App_div_tree_img_exp = trim($app_div_str_tree_exp); $this->Ini->form_table_width = isset($str_form_table_width) && '' != trim($str_form_table_width) ? $str_form_table_width : ''; $this->Ini->Bubble_tail = trim($str_bubble_tail); $this->classes_100perc_fields['table'] = ''; $this->classes_100perc_fields['input'] = ''; $this->classes_100perc_fields['span_input'] = ''; $this->classes_100perc_fields['span_select'] = ''; $this->classes_100perc_fields['style_category'] = ''; $this->classes_100perc_fields['keep_field_size'] = true; $_SESSION['scriptcase']['error_icon']['form_bancos'] = "Ini->path_icones . "/scriptcase__NM__icnMensagemAlerta.png\" style=\"border-width: 0px\" align=\"top\"> "; $_SESSION['scriptcase']['error_close']['form_bancos'] = "" . nmButtonOutput($this->arr_buttons, "berrm_clse", "document.getElementById('id_error_display_fixed').style.display = 'none'; document.getElementById('id_error_message_fixed').innerHTML = ''; return false", "document.getElementById('id_error_display_fixed').style.display = 'none'; document.getElementById('id_error_message_fixed').innerHTML = ''; return false", "", "", "", "", "", "", "", $this->Ini->path_botoes, "", "", "", "", "", '', '', '', '', '', '', '', '', "") . ""; $this->Embutida_proc = isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_proc']) ? $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_proc'] : $this->Embutida_proc; $this->Embutida_form = isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_form']) ? $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_form'] : $this->Embutida_form; $this->Embutida_call = isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_call']) ? $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_call'] : $this->Embutida_call; $this->form_3versions_single = false; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['table_refresh'] = false; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_grid_edit']) && '' != $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_grid_edit']) { $this->Grid_editavel = ('on' == $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_grid_edit']) ? true : false; } if (isset($this->Grid_editavel) && $this->Grid_editavel) { $this->Embutida_form = true; $this->Embutida_ronly = true; } $this->Embutida_multi = false; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_multi']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_multi']) { $this->Grid_editavel = false; $this->Embutida_form = false; $this->Embutida_ronly = false; $this->Embutida_multi = true; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_tp_pag']) && '' != $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_tp_pag']) { $this->form_paginacao = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_tp_pag']; } if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_form']) || '' == $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_form']) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_form'] = $this->Embutida_form; } if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_grid_edit']) || '' == $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_grid_edit']) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_grid_edit'] = $this->Grid_editavel ? 'on' : 'off'; } if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_grid_edit']) || '' == $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_grid_edit']) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_grid_edit'] = $this->Embutida_call; } $this->Ini->cor_grid_par = $this->Ini->cor_grid_impar; $this->nm_location = $this->Ini->sc_protocolo . $this->Ini->server . $dir_raiz; $this->nmgp_url_saida = $nm_url_saida; $this->nmgp_form_show = "on"; $this->nmgp_form_empty = false; $this->Ini->sc_Include($this->Ini->path_lib_php . "/nm_valida.php", "C", "NM_Valida") ; $teste_validade = new NM_Valida ; $this->loadFieldConfig(); if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['first_time']) { unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['insert']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['new']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['update']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['delete']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['first']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['back']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['forward']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['last']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['qsearch']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['dynsearch']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['summary']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['navpage']); unset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['goto']); } $this->NM_cancel_return_new = (isset($this->NM_cancel_return_new) && $this->NM_cancel_return_new == 1) ? "1" : ""; $this->NM_cancel_insert_new = ((isset($this->NM_cancel_insert_new) && $this->NM_cancel_insert_new == 1) || $this->NM_cancel_return_new == 1) ? "document.F5.action='" . $nm_url_saida . "';" : ""; if (isset($this->NM_btn_insert) && '' != $this->NM_btn_insert && (!isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['insert']) || '' == $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['insert'])) { if ('N' == $this->NM_btn_insert) { $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['insert'] = 'off'; } else { $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['insert'] = 'on'; } } if (isset($this->NM_btn_new) && 'N' == $this->NM_btn_new) { $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['new'] = 'off'; } if (isset($this->NM_btn_update) && '' != $this->NM_btn_update && (!isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['update']) || '' == $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['update'])) { if ('N' == $this->NM_btn_update) { $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['update'] = 'off'; } else { $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['update'] = 'on'; } } if (isset($this->NM_btn_delete) && '' != $this->NM_btn_delete && (!isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['delete']) || '' == $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['delete'])) { if ('N' == $this->NM_btn_delete) { $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['delete'] = 'off'; } else { $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['delete'] = 'on'; } } if (isset($this->NM_btn_navega) && '' != $this->NM_btn_navega) { if ('N' == $this->NM_btn_navega) { $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['first'] = 'off'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['back'] = 'off'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['forward'] = 'off'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['last'] = 'off'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['qsearch'] = 'off'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['dynsearch'] = 'off'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['summary'] = 'off'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['navpage'] = 'off'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['goto'] = 'off'; $this->Nav_permite_ava = false; $this->Nav_permite_ret = false; } else { $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['first'] = 'on'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['back'] = 'on'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['forward'] = 'on'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['last'] = 'on'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['qsearch'] = 'on'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['dynsearch'] = 'on'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['summary'] = 'on'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['navpage'] = 'on'; $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['goto'] = 'on'; } } $this->nmgp_botoes['cancel'] = "on"; $this->nmgp_botoes['exit'] = "on"; $this->nmgp_botoes['qsearch'] = "on"; $this->nmgp_botoes['new'] = "on"; $this->nmgp_botoes['insert'] = "on"; $this->nmgp_botoes['copy'] = "off"; $this->nmgp_botoes['update'] = "on"; $this->nmgp_botoes['delete'] = "on"; $this->nmgp_botoes['first'] = "on"; $this->nmgp_botoes['back'] = "on"; $this->nmgp_botoes['forward'] = "on"; $this->nmgp_botoes['last'] = "on"; $this->nmgp_botoes['summary'] = "on"; $this->nmgp_botoes['navpage'] = "on"; $this->nmgp_botoes['goto'] = "on"; $this->nmgp_botoes['qtline'] = "off"; $this->nmgp_botoes['reload'] = "on"; if (isset($this->NM_btn_cancel) && 'N' == $this->NM_btn_cancel) { $this->nmgp_botoes['cancel'] = "off"; } $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_orig'] = ""; if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_pesq'])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_pesq'] = ""; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_pesq_filtro'] = ""; } $this->sc_where_orig = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_orig']; $this->sc_where_atual = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_pesq']; $this->sc_where_filtro = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_pesq_filtro']; if ($this->NM_ajax_flag && 'event_' == substr($this->NM_ajax_opcao, 0, 6)) { $this->nmgp_botoes = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['buttonStatus']; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['iframe_filtro']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['iframe_filtro'] == "S") { $this->nmgp_botoes['exit'] = "off"; } if (isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['btn_display']) && !empty($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['btn_display'])) { foreach ($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['btn_display'] as $NM_cada_btn => $NM_cada_opc) { $this->nmgp_botoes[$NM_cada_btn] = $NM_cada_opc; } } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['insert']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['insert'] != '') { $this->nmgp_botoes['new'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['insert']; $this->nmgp_botoes['insert'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['insert']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['new']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['new'] != '') { $this->nmgp_botoes['new'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['new']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['update']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['update'] != '') { $this->nmgp_botoes['update'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['update']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['delete']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['delete'] != '') { $this->nmgp_botoes['delete'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['delete']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['first']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['first'] != '') { $this->nmgp_botoes['first'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['first']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['back']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['back'] != '') { $this->nmgp_botoes['back'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['back']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['forward']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['forward'] != '') { $this->nmgp_botoes['forward'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['forward']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['last']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['last'] != '') { $this->nmgp_botoes['last'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['last']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['qsearch']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['qsearch'] != '') { $this->nmgp_botoes['qsearch'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['qsearch']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['dynsearch']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['dynsearch'] != '') { $this->nmgp_botoes['dynsearch'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['dynsearch']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['summary']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['summary'] != '') { $this->nmgp_botoes['summary'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['summary']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['navpage']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['navpage'] != '') { $this->nmgp_botoes['navpage'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['navpage']; } if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['goto']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['goto'] != '') { $this->nmgp_botoes['goto'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['form_bancos']['goto']; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_insert']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_insert'] != '') { $this->nmgp_botoes['new'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_insert']; $this->nmgp_botoes['insert'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_insert']; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_update']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_update'] != '') { $this->nmgp_botoes['update'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_update']; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_delete']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_delete'] != '') { $this->nmgp_botoes['delete'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_delete']; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_btn_nav']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_btn_nav'] != '') { $this->nmgp_botoes['first'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_btn_nav']; $this->nmgp_botoes['back'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_btn_nav']; $this->nmgp_botoes['forward'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_btn_nav']; $this->nmgp_botoes['last'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_btn_nav']; } if (isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['insert']) && $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['insert'] != '') { $this->nmgp_botoes['new'] = $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['insert']; $this->nmgp_botoes['insert'] = $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['insert']; } if (isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['update']) && $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['update'] != '') { $this->nmgp_botoes['update'] = $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['update']; } if (isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['delete']) && $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['delete'] != '') { $this->nmgp_botoes['delete'] = $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['delete']; } if (isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['field_display']) && !empty($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['field_display'])) { foreach ($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['field_display'] as $NM_cada_field => $NM_cada_opc) { $this->nmgp_cmp_hidden[$NM_cada_field] = $NM_cada_opc; $this->NM_ajax_info['fieldDisplay'][$NM_cada_field] = $NM_cada_opc; } } if (isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['field_readonly']) && !empty($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['field_readonly'])) { foreach ($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['field_readonly'] as $NM_cada_field => $NM_cada_opc) { $this->nmgp_cmp_readonly[$NM_cada_field] = "on"; $this->NM_ajax_info['readOnly'][$NM_cada_field] = $NM_cada_opc; } } if (isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['exit']) && $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['exit'] != '') { $_SESSION['scriptcase']['sc_url_saida'][$this->Ini->sc_page] = $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['exit']; $_SESSION['scriptcase']['sc_force_url_saida'][$this->Ini->sc_page] = true; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dashboard_info']['under_dashboard']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dashboard_info']['under_dashboard'] && !$_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dashboard_info']['maximized']) { $tmpDashboardApp = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dashboard_info']['dashboard_app']; if (isset($_SESSION['scriptcase']['dashboard_toolbar'][$tmpDashboardApp]['form_bancos'])) { $tmpDashboardButtons = $_SESSION['scriptcase']['dashboard_toolbar'][$tmpDashboardApp]['form_bancos']; if (!$tmpDashboardButtons['form_navigate']) { $this->nmgp_botoes['first'] = 'off'; $this->nmgp_botoes['back'] = 'off'; $this->nmgp_botoes['last'] = 'off'; $this->nmgp_botoes['forward'] = 'off'; } if (!$tmpDashboardButtons['form_update']) { $this->nmgp_botoes['update'] = 'off';} if (!$tmpDashboardButtons['form_insert']) { $this->nmgp_botoes['new'] = 'off';} if (!$tmpDashboardButtons['form_insert']) { $this->nmgp_botoes['insert'] = 'off';} if (!$tmpDashboardButtons['form_delete']) { $this->nmgp_botoes['delete'] = 'off';} if (!$tmpDashboardButtons['form_copy']) { $this->nmgp_botoes['copy'] = 'off';} if (!$tmpDashboardButtons['form_navpage']) { $this->nmgp_botoes['navpage'] = 'off';} if (!$tmpDashboardButtons['form_goto']) { $this->nmgp_botoes['goto'] = 'off';} if (!$tmpDashboardButtons['form_lineqty']) { $this->nmgp_botoes['qtline'] = 'off';} if (!$tmpDashboardButtons['form_summary']) { $this->nmgp_botoes['summary'] = 'off';} if (!$tmpDashboardButtons['form_qsearch']) { $this->nmgp_botoes['qsearch'] = 'off';} if (!$tmpDashboardButtons['form_dynsearch']) { $this->nmgp_botoes['dynsearch'] = 'off';} if (!$tmpDashboardButtons['form_reload']) { $this->nmgp_botoes['reload'] = 'off';} } } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dados_form'])) { $this->nmgp_dados_form = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dados_form']; if (!isset($this->idbanco)){$this->idbanco = $this->nmgp_dados_form['idbanco'];} if (!isset($this->saldoinicial)){$this->saldoinicial = $this->nmgp_dados_form['saldoinicial'];} if (!isset($this->otrasentradas)){$this->otrasentradas = $this->nmgp_dados_form['otrasentradas'];} if (!isset($this->otrassalidas)){$this->otrassalidas = $this->nmgp_dados_form['otrassalidas'];} } $glo_senha_protect = (isset($_SESSION['scriptcase']['glo_senha_protect'])) ? $_SESSION['scriptcase']['glo_senha_protect'] : "S"; $this->aba_iframe = false; if (isset($_SESSION['scriptcase']['sc_aba_iframe'])) { foreach ($_SESSION['scriptcase']['sc_aba_iframe'] as $aba => $apls_aba) { if (in_array("form_bancos", $apls_aba)) { $this->aba_iframe = true; break; } } } if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['iframe_menu'] && (!isset($_SESSION['scriptcase']['menu_mobile']) || empty($_SESSION['scriptcase']['menu_mobile']))) { $this->aba_iframe = true; } $this->Ini->sc_Include($this->Ini->path_lib_php . "/nm_gp_limpa.php", "F", "nm_limpa_valor") ; $this->Ini->sc_Include($this->Ini->path_libs . "/nm_gc.php", "F", "nm_gc") ; $_SESSION['scriptcase']['sc_tab_meses']['int'] = array( $this->Ini->Nm_lang['lang_mnth_janu'], $this->Ini->Nm_lang['lang_mnth_febr'], $this->Ini->Nm_lang['lang_mnth_marc'], $this->Ini->Nm_lang['lang_mnth_apri'], $this->Ini->Nm_lang['lang_mnth_mayy'], $this->Ini->Nm_lang['lang_mnth_june'], $this->Ini->Nm_lang['lang_mnth_july'], $this->Ini->Nm_lang['lang_mnth_augu'], $this->Ini->Nm_lang['lang_mnth_sept'], $this->Ini->Nm_lang['lang_mnth_octo'], $this->Ini->Nm_lang['lang_mnth_nove'], $this->Ini->Nm_lang['lang_mnth_dece']); $_SESSION['scriptcase']['sc_tab_meses']['abr'] = array( $this->Ini->Nm_lang['lang_shrt_mnth_janu'], $this->Ini->Nm_lang['lang_shrt_mnth_febr'], $this->Ini->Nm_lang['lang_shrt_mnth_marc'], $this->Ini->Nm_lang['lang_shrt_mnth_apri'], $this->Ini->Nm_lang['lang_shrt_mnth_mayy'], $this->Ini->Nm_lang['lang_shrt_mnth_june'], $this->Ini->Nm_lang['lang_shrt_mnth_july'], $this->Ini->Nm_lang['lang_shrt_mnth_augu'], $this->Ini->Nm_lang['lang_shrt_mnth_sept'], $this->Ini->Nm_lang['lang_shrt_mnth_octo'], $this->Ini->Nm_lang['lang_shrt_mnth_nove'], $this->Ini->Nm_lang['lang_shrt_mnth_dece']); $_SESSION['scriptcase']['sc_tab_dias']['int'] = array( $this->Ini->Nm_lang['lang_days_sund'], $this->Ini->Nm_lang['lang_days_mond'], $this->Ini->Nm_lang['lang_days_tued'], $this->Ini->Nm_lang['lang_days_wend'], $this->Ini->Nm_lang['lang_days_thud'], $this->Ini->Nm_lang['lang_days_frid'], $this->Ini->Nm_lang['lang_days_satd']); $_SESSION['scriptcase']['sc_tab_dias']['abr'] = array( $this->Ini->Nm_lang['lang_shrt_days_sund'], $this->Ini->Nm_lang['lang_shrt_days_mond'], $this->Ini->Nm_lang['lang_shrt_days_tued'], $this->Ini->Nm_lang['lang_shrt_days_wend'], $this->Ini->Nm_lang['lang_shrt_days_thud'], $this->Ini->Nm_lang['lang_shrt_days_frid'], $this->Ini->Nm_lang['lang_shrt_days_satd']); nm_gc($this->Ini->path_libs); $this->Ini->Gd_missing = true; if(function_exists("getProdVersion")) { $_SESSION['scriptcase']['sc_prod_Version'] = str_replace(".", "", getProdVersion($this->Ini->path_libs)); if(function_exists("gd_info")) { $this->Ini->Gd_missing = false; } } $this->Ini->sc_Include($this->Ini->path_lib_php . "/nm_trata_img.php", "C", "nm_trata_img") ; if (is_file($this->Ini->path_aplicacao . 'form_bancos_help.txt')) { $arr_link_webhelp = file($this->Ini->path_aplicacao . 'form_bancos_help.txt'); if ($arr_link_webhelp) { foreach ($arr_link_webhelp as $str_link_webhelp) { $str_link_webhelp = trim($str_link_webhelp); if ('form:' == substr($str_link_webhelp, 0, 5)) { $arr_link_parts = explode(':', $str_link_webhelp); if ('' != $arr_link_parts[1] && is_file($this->Ini->root . $this->Ini->path_help . $arr_link_parts[1])) { $this->url_webhelp = $this->Ini->path_help . $arr_link_parts[1]; } } } } } if (is_dir($this->Ini->path_aplicacao . 'img')) { $Res_dir_img = @opendir($this->Ini->path_aplicacao . 'img'); if ($Res_dir_img) { while (FALSE !== ($Str_arquivo = @readdir($Res_dir_img))) { if (@is_file($this->Ini->path_aplicacao . 'img/' . $Str_arquivo) && '.' != $Str_arquivo && '..' != $this->Ini->path_aplicacao . 'img/' . $Str_arquivo) { @unlink($this->Ini->path_aplicacao . 'img/' . $Str_arquivo); } } } @closedir($Res_dir_img); rmdir($this->Ini->path_aplicacao . 'img'); } if ($this->Embutida_proc) { require_once($this->Ini->path_embutida . 'form_bancos/form_bancos_erro.class.php'); } else { require_once($this->Ini->path_aplicacao . "form_bancos_erro.class.php"); } $this->Erro = new form_bancos_erro(); $this->Erro->Ini = $this->Ini; $this->proc_fast_search = false; if ($this->nmgp_opcao == "fast_search") { $this->SC_fast_search($this->nmgp_fast_search, $this->nmgp_cond_fast_search, $this->nmgp_arg_fast_search); $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opcao'] = "inicio"; $this->nmgp_opcao = "inicio"; $this->proc_fast_search = true; } if ((!isset($nm_opc_lookup) || $nm_opc_lookup != "lookup") && (!isset($nm_opc_php) || $nm_opc_php != "formphp")) { if (empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opcao'])) { if ($this->idbanco != "") { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opcao'] = "igual" ; } } } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opcao']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opcao']) && empty($this->nmgp_refresh_fields)) { $this->nmgp_opcao = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opcao']; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opcao'] = "" ; if ($this->nmgp_opcao == "edit_novo") { $this->nmgp_opcao = "novo"; $this->nm_flag_saida_novo = "S"; } } $this->nm_Start_new = false; if (isset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['start']) && $_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['start'] == 'new') { $this->nmgp_opcao = "novo"; $this->nm_Start_new = true; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opcao'] = "novo"; unset($_SESSION['scriptcase']['sc_apl_conf']['form_bancos']['start']); } if ($this->nmgp_opcao == "igual") { $this->nmgp_opc_ant = $this->nmgp_opcao; } else { $this->nmgp_opc_ant = (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opc_ant'])) ? $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opc_ant'] : ""; } if ($this->nmgp_opcao == "recarga" || $this->nmgp_opcao == "muda_form") { $this->nmgp_botoes = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['botoes']; $this->Nav_permite_ret = 0 != $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['inicio']; $this->Nav_permite_ava = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total'] != $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['final']; } else { } $this->nm_flag_iframe = false; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dados_form'])) { $this->nmgp_dados_form = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dados_form']; } if ($this->nmgp_opcao == "edit_novo") { $this->nmgp_opcao = "novo"; $this->nm_flag_saida_novo = "S"; } // $this->NM_case_insensitive = false; $this->sc_evento = $this->nmgp_opcao; $this->sc_insert_on = false; if ('ajax_check_file' == $this->nmgp_opcao ){ ob_start(); global $bol_api_prod; $bol_api_prod = true; if (isset($_SESSION['scriptcase']['form_bancos']['glo_nm_conexao']) && !empty($_SESSION['scriptcase']['form_bancos']['glo_nm_conexao'])) { $bol_api_prod = false; } include_once("../_lib/lib/php/nm_api.php"); switch( $_POST['rsargs'] ){ default: echo 0;exit; break; } $out1_img_cache = $_SESSION['scriptcase']['form_bancos']['glo_nm_path_imag_temp'] . $file_name; $orig_img = $_SESSION['scriptcase']['form_bancos']['glo_nm_path_imag_temp']. '/sc_'.md5(date('YmdHis').basename($_POST['AjaxCheckImg'])).'.gif'; copy($__file_download, $_SERVER['DOCUMENT_ROOT'].$orig_img); echo $orig_img . '_@@NM@@_'; copy($__file_download, $_SERVER['DOCUMENT_ROOT'].$out1_img_cache); $sc_obj_img = new nm_trata_img($_SERVER['DOCUMENT_ROOT'].$out1_img_cache, true); if(!empty($img_width) && !empty($img_height)){ $sc_obj_img->setWidth($img_width); $sc_obj_img->setHeight($img_height); } $sc_obj_img->setManterAspecto(true); $sc_obj_img->createImg($_SERVER['DOCUMENT_ROOT'].$out1_img_cache); echo $out1_img_cache; exit; } if (isset($this->tipocuenta)) { $this->nm_limpa_alfa($this->tipocuenta); } if (isset($this->nombre)) { $this->nm_limpa_alfa($this->nombre); } if (isset($this->formapago)) { $this->nm_limpa_alfa($this->formapago); } if (isset($this->ctacontable)) { $this->nm_limpa_alfa($this->ctacontable); } if (isset($this->nrocuenta)) { $this->nm_limpa_alfa($this->nrocuenta); } if (isset($this->nit)) { $this->nm_limpa_alfa($this->nit); } if (isset($this->idoficina)) { $this->nm_limpa_alfa($this->idoficina); } if (isset($this->perfil)) { $this->nm_limpa_alfa($this->perfil); } if (isset($this->taquilla)) { $this->nm_limpa_alfa($this->taquilla); } $Campos_Crit = ""; $Campos_erro = ""; $Campos_Falta = array(); $Campos_Erros = array(); $dir_raiz = strrpos($_SERVER['PHP_SELF'],"/") ; $dir_raiz = substr($_SERVER['PHP_SELF'], 0, $dir_raiz + 1) ; $this->Field_no_validate = (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Field_no_validate'])) ? $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Field_no_validate'] : array(); $this->nm_location = $this->Ini->sc_protocolo . $this->Ini->server . $dir_raiz; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opc_edit'] = true; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dados_select'])) { $this->nmgp_dados_select = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dados_select']; } } function loadFieldConfig() { $this->field_config = array(); //-- idbanco $this->field_config['idbanco'] = array(); $this->field_config['idbanco']['symbol_grp'] = $_SESSION['scriptcase']['reg_conf']['grup_num']; $this->field_config['idbanco']['symbol_fmt'] = $_SESSION['scriptcase']['reg_conf']['num_group_digit']; $this->field_config['idbanco']['symbol_dec'] = ''; $this->field_config['idbanco']['symbol_neg'] = $_SESSION['scriptcase']['reg_conf']['simb_neg']; $this->field_config['idbanco']['format_neg'] = $_SESSION['scriptcase']['reg_conf']['neg_num']; //-- saldoinicial $this->field_config['saldoinicial'] = array(); $this->field_config['saldoinicial']['symbol_grp'] = $_SESSION['scriptcase']['reg_conf']['grup_val']; $this->field_config['saldoinicial']['symbol_fmt'] = $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']; $this->field_config['saldoinicial']['symbol_dec'] = $_SESSION['scriptcase']['reg_conf']['dec_val']; $this->field_config['saldoinicial']['symbol_mon'] = ''; $this->field_config['saldoinicial']['format_pos'] = $_SESSION['scriptcase']['reg_conf']['monet_f_pos']; $this->field_config['saldoinicial']['format_neg'] = $_SESSION['scriptcase']['reg_conf']['monet_f_neg']; //-- otrasentradas $this->field_config['otrasentradas'] = array(); $this->field_config['otrasentradas']['symbol_grp'] = $_SESSION['scriptcase']['reg_conf']['grup_val']; $this->field_config['otrasentradas']['symbol_fmt'] = $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']; $this->field_config['otrasentradas']['symbol_dec'] = $_SESSION['scriptcase']['reg_conf']['dec_val']; $this->field_config['otrasentradas']['symbol_mon'] = ''; $this->field_config['otrasentradas']['format_pos'] = $_SESSION['scriptcase']['reg_conf']['monet_f_pos']; $this->field_config['otrasentradas']['format_neg'] = $_SESSION['scriptcase']['reg_conf']['monet_f_neg']; //-- otrassalidas $this->field_config['otrassalidas'] = array(); $this->field_config['otrassalidas']['symbol_grp'] = $_SESSION['scriptcase']['reg_conf']['grup_val']; $this->field_config['otrassalidas']['symbol_fmt'] = $_SESSION['scriptcase']['reg_conf']['unid_mont_group_digit']; $this->field_config['otrassalidas']['symbol_dec'] = $_SESSION['scriptcase']['reg_conf']['dec_val']; $this->field_config['otrassalidas']['symbol_mon'] = ''; $this->field_config['otrassalidas']['format_pos'] = $_SESSION['scriptcase']['reg_conf']['monet_f_pos']; $this->field_config['otrassalidas']['format_neg'] = $_SESSION['scriptcase']['reg_conf']['monet_f_neg']; } function controle() { global $nm_url_saida, $teste_validade, $glo_senha_protect, $nm_apl_dependente, $nm_form_submit, $sc_check_excl, $nm_opc_form_php, $nm_call_php, $nm_opc_lookup; $this->ini_controle(); if ('' != $_SESSION['scriptcase']['change_regional_old']) { $_SESSION['scriptcase']['str_conf_reg'] = $_SESSION['scriptcase']['change_regional_old']; $this->Ini->regionalDefault($_SESSION['scriptcase']['str_conf_reg']); $this->loadFieldConfig(); $this->nm_tira_formatacao(); $_SESSION['scriptcase']['str_conf_reg'] = $_SESSION['scriptcase']['change_regional_new']; $this->Ini->regionalDefault($_SESSION['scriptcase']['str_conf_reg']); $this->loadFieldConfig(); $guarda_formatado = $this->formatado; $this->nm_formatar_campos(); $this->formatado = $guarda_formatado; $_SESSION['scriptcase']['change_regional_old'] = ''; $_SESSION['scriptcase']['change_regional_new'] = ''; } if ($nm_form_submit == 1 && ($this->nmgp_opcao == 'inicio' || $this->nmgp_opcao == 'igual')) { $this->nm_tira_formatacao(); } if (!$this->NM_ajax_flag || 'alterar' != $this->nmgp_opcao || 'submit_form' != $this->NM_ajax_opcao) { } // //-----> // if ($this->NM_ajax_flag && 'validate_' == substr($this->NM_ajax_opcao, 0, 9)) { if ('validate_tipocuenta' == $this->NM_ajax_opcao) { $this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'tipocuenta'); } if ('validate_nombre' == $this->NM_ajax_opcao) { $this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'nombre'); } if ('validate_formapago' == $this->NM_ajax_opcao) { $this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'formapago'); } if ('validate_ctacontable' == $this->NM_ajax_opcao) { $this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'ctacontable'); } if ('validate_nrocuenta' == $this->NM_ajax_opcao) { $this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'nrocuenta'); } if ('validate_nit' == $this->NM_ajax_opcao) { $this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'nit'); } if ('validate_idoficina' == $this->NM_ajax_opcao) { $this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'idoficina'); } if ('validate_perfil' == $this->NM_ajax_opcao) { $this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'perfil'); } if ('validate_taquilla' == $this->NM_ajax_opcao) { $this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'taquilla'); } form_bancos_pack_ajax_response(); exit; } if (isset($this->sc_inline_call) && 'Y' == $this->sc_inline_call) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['inline_form_seq'] = $this->sc_seq_row; $this->nm_tira_formatacao(); } if ($this->nmgp_opcao == "recarga" || $this->nmgp_opcao == "recarga_mobile" || $this->nmgp_opcao == "muda_form") { $this->nm_tira_formatacao(); $nm_sc_sv_opcao = $this->nmgp_opcao; $this->nmgp_opcao = "nada"; $this->nm_acessa_banco(); if ($this->NM_ajax_flag) { $this->ajax_return_values(); form_bancos_pack_ajax_response(); exit; } $this->nm_formatar_campos(); $this->nmgp_opcao = $nm_sc_sv_opcao; $this->nm_gera_html(); $this->NM_close_db(); $this->nmgp_opcao = ""; exit; } if ($this->nmgp_opcao == "incluir" || $this->nmgp_opcao == "alterar" || $this->nmgp_opcao == "excluir") { $this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros) ; $_SESSION['scriptcase']['form_bancos']['contr_erro'] = 'off'; if ($Campos_Crit != "") { $Campos_Crit = $this->Ini->Nm_lang['lang_errm_flds'] . ' ' . $Campos_Crit ; } if ($Campos_Crit != "" || !empty($Campos_Falta) || $this->Campos_Mens_erro != "") { if ($this->NM_ajax_flag) { form_bancos_pack_ajax_response(); exit; } $campos_erro = $this->Formata_Erros($Campos_Crit, $Campos_Falta, $Campos_Erros, 4); $this->Campos_Mens_erro = ""; $this->Erro->mensagem(__FILE__, __LINE__, "critica", $campos_erro, '', true, true); $this->nmgp_opc_ant = $this->nmgp_opcao ; if ($this->nmgp_opcao == "incluir" && $nm_apl_dependente == 1) { $this->nm_flag_saida_novo = "S";; } if ($this->nmgp_opcao == "incluir") { $GLOBALS["erro_incl"] = 1; } $this->nmgp_opcao = "nada" ; } } elseif (isset($nm_form_submit) && 1 == $nm_form_submit && $this->nmgp_opcao != "menu_link" && $this->nmgp_opcao != "recarga_mobile") { } // if ($this->nmgp_opcao != "nada") { $this->nm_acessa_banco(); } else { if ($this->nmgp_opc_ant == "incluir") { $this->nm_proc_onload(false); } else { $this->nm_guardar_campos(); } } if ($this->nmgp_opcao != "recarga" && $this->nmgp_opcao != "muda_form" && !$this->Apl_com_erro) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['recarga'] = $this->nmgp_opcao; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['sc_redir_insert']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['sc_redir_insert'] == "ok") { if ($this->sc_evento == "insert" || ($this->nmgp_opc_ant == "novo" && $this->nmgp_opcao == "novo" && $this->sc_evento == "novo")) { $this->NM_close_db(); $this->nmgp_redireciona(2); } } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['sc_redir_atualiz']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['sc_redir_atualiz'] == "ok") { if ($this->sc_evento == "update") { $this->NM_close_db(); $this->nmgp_redireciona(2); } if ($this->sc_evento == "delete") { $this->NM_close_db(); $this->nmgp_redireciona(2); } } } if ($this->NM_ajax_flag && 'navigate_form' == $this->NM_ajax_opcao) { $this->ajax_return_values(); $this->ajax_add_parameters(); form_bancos_pack_ajax_response(); exit; } $this->nm_formatar_campos(); if ($this->NM_ajax_flag) { $this->NM_ajax_info['result'] = 'OK'; if ('alterar' == $this->NM_ajax_info['param']['nmgp_opcao']) { $this->NM_ajax_info['msgDisplay'] = NM_charset_to_utf8($this->Ini->Nm_lang['lang_othr_ajax_frmu']); } form_bancos_pack_ajax_response(); exit; } $this->nm_gera_html(); $this->NM_close_db(); $this->nmgp_opcao = ""; if ($this->Change_Menu) { $apl_menu = $_SESSION['scriptcase']['menu_atual']; $Arr_rastro = array(); if (isset($_SESSION['scriptcase']['menu_apls'][$apl_menu][$this->sc_init_menu]) && count($_SESSION['scriptcase']['menu_apls'][$apl_menu][$this->sc_init_menu]) > 1) { foreach ($_SESSION['scriptcase']['menu_apls'][$apl_menu][$this->sc_init_menu] as $menu => $apls) { $Arr_rastro[] = "'" . $apls['label'] . "'"; } $ult_apl = count($Arr_rastro) - 1; unset($Arr_rastro[$ult_apl]); $rastro = implode(",", $Arr_rastro); ?> Ini->root . $this->Ini->path_imag_temp . $nm_arquivo_html; $Parm_pass = ($Html_password != "") ? " -p" : ""; $Zip_name = "sc_prt_" . date("YmdHis") . "_" . rand(0, 1000) . "form_bancos.zip"; $Arq_htm = $this->Ini->path_imag_temp . "/" . $Zip_name; $Arq_zip = $this->Ini->root . $Arq_htm; $Zip_f = (FALSE !== strpos($Arq_zip, ' ')) ? " \"" . $Arq_zip . "\"" : $Arq_zip; $Arq_input = (FALSE !== strpos($Arq_base, ' ')) ? " \"" . $Arq_base . "\"" : $Arq_base; if (is_file($Arq_zip)) { unlink($Arq_zip); } $str_zip = ""; if (FALSE !== strpos(strtolower(php_uname()), 'windows')) { chdir($this->Ini->path_third . "/zip/windows"); $str_zip = "zip.exe " . strtoupper($Parm_pass) . " -j " . $Html_password . " " . $Zip_f . " " . $Arq_input; } elseif (FALSE !== strpos(strtolower(php_uname()), 'linux')) { if (FALSE !== strpos(strtolower(php_uname()), 'i686')) { chdir($this->Ini->path_third . "/zip/linux-i386/bin"); } else { chdir($this->Ini->path_third . "/zip/linux-amd64/bin"); } $str_zip = "./7za " . $Parm_pass . $Html_password . " a " . $Zip_f . " " . $Arq_input; } elseif (FALSE !== strpos(strtolower(php_uname()), 'darwin')) { chdir($this->Ini->path_third . "/zip/mac/bin"); $str_zip = "./7za " . $Parm_pass . $Html_password . " a " . $Zip_f . " " . $Arq_input; } if (!empty($str_zip)) { exec($str_zip); } // ----- ZIP log $fp = @fopen(trim(str_replace(array(".zip",'"'), array(".log",""), $Zip_f)), 'w'); if ($fp) { @fwrite($fp, $str_zip . "\r\n\r\n"); @fclose($fp); } foreach ($this->Ini->Img_export_zip as $cada_img_zip) { $str_zip = ""; $cada_img_zip = '"' . $cada_img_zip . '"'; if (FALSE !== strpos(strtolower(php_uname()), 'windows')) { $str_zip = "zip.exe " . strtoupper($Parm_pass) . " -j -u " . $Html_password . " " . $Zip_f . " " . $cada_img_zip; } elseif (FALSE !== strpos(strtolower(php_uname()), 'linux')) { $str_zip = "./7za " . $Parm_pass . $Html_password . " a " . $Zip_f . " " . $cada_img_zip; } elseif (FALSE !== strpos(strtolower(php_uname()), 'darwin')) { $str_zip = "./7za " . $Parm_pass . $Html_password . " a " . $Zip_f . " " . $cada_img_zip; } if (!empty($str_zip)) { exec($str_zip); } // ----- ZIP log $fp = @fopen(trim(str_replace(array(".zip",'"'), array(".log",""), $Zip_f)), 'a'); if ($fp) { @fwrite($fp, $str_zip . "\r\n\r\n"); @fclose($fp); } } if (is_file($Arq_zip)) { unlink($Arq_base); } $path_doc_md5 = md5($Arq_htm); $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos'][$path_doc_md5][0] = $Arq_htm; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos'][$path_doc_md5][1] = $Zip_name; ?> > <?php echo strip_tags("ACTUALIZA DATOS DE CAJA Y BANCOS") ?> GMT"/>
PRINT
Ini->Nm_lang['lang_othr_file_msge'] ?> arr_buttons, "bexportview", "document.Fview.submit()", "document.Fview.submit()", "idBtnView", "", "", "", "absmiddle", "", "0", $this->Ini->path_botoes, "", "", "", "", "", '', '', '', '', '', '', '', '', "");?> arr_buttons, "bdownload", "document.Fdown.submit()", "document.Fdown.submit()", "idBtnDown", "", "", "", "absmiddle", "", "0", $this->Ini->path_botoes, "", "", "", "", "", '', '', '', '', '', '', '', '', "");?> arr_buttons, "bvoltar", "document.F0.submit()", "document.F0.submit()", "idBtnBack", "", "", "", "absmiddle", "", "0", $this->Ini->path_botoes, "", "", "", "", "", '', '', '', '', '', '', '', '', "");?>
Ini->nm_tpbanco), $this->Ini->nm_bases_access); } // //-------------------------------------------------------------------------------------- function NM_commit_db() { if ($this->Ini->sc_tem_trans_banco && !$this->Embutida_proc) { $this->Db->CommitTrans(); $this->Ini->sc_tem_trans_banco = false; } } // //-------------------------------------------------------------------------------------- function NM_rollback_db() { if ($this->Ini->sc_tem_trans_banco && !$this->Embutida_proc) { $this->Db->RollbackTrans(); $this->Ini->sc_tem_trans_banco = false; } } // //-------------------------------------------------------------------------------------- function NM_close_db() { if ($this->Db && !$this->Embutida_proc) { $this->Db->Close(); } } // //-------------------------------------------------------------------------------------- function Formata_Erros($Campos_Crit, $Campos_Falta, $Campos_Erros, $mode = 3) { switch ($mode) { case 1: $campos_erro = array(); if (!empty($Campos_Crit)) { $campos_erro[] = $Campos_Crit; } if (!empty($Campos_Falta)) { $campos_erro[] = $this->Formata_Campos_Falta($Campos_Falta); } if (!empty($this->Campos_Mens_erro)) { $campos_erro[] = $this->Campos_Mens_erro; } return implode('
', $campos_erro); break; case 2: $campos_erro = array(); if (!empty($Campos_Crit)) { $campos_erro[] = $Campos_Crit; } if (!empty($Campos_Falta)) { $campos_erro[] = $this->Formata_Campos_Falta($Campos_Falta, true); } if (!empty($this->Campos_Mens_erro)) { $campos_erro[] = $this->Campos_Mens_erro; } return implode('
', $campos_erro); break; case 3: $campos_erro = array(); if (!empty($Campos_Erros)) { $campos_erro[] = $this->Formata_Campos_Erros($Campos_Erros); } if (!empty($this->Campos_Mens_erro)) { $campos_mens_erro = str_replace(array('
', '
', '
'), array('
', '
', '
'), $this->Campos_Mens_erro); $campos_mens_erro = explode('
', $campos_mens_erro); foreach ($campos_mens_erro as $msg_erro) { if ('' != $msg_erro && !in_array($msg_erro, $campos_erro)) { $campos_erro[] = $msg_erro; } } } return implode('
', $campos_erro); break; case 4: $campos_erro = array(); if (!empty($Campos_Erros)) { $campos_erro[] = $this->Formata_Campos_Erros_SweetAlert($Campos_Erros); } if (!empty($this->Campos_Mens_erro)) { $campos_mens_erro = str_replace(array('
', '
', '
'), array('
', '
', '
'), $this->Campos_Mens_erro); $campos_mens_erro = explode('
', $campos_mens_erro); foreach ($campos_mens_erro as $msg_erro) { if ('' != $msg_erro && !in_array($msg_erro, $campos_erro)) { $campos_erro[] = $msg_erro; } } } return implode('
', $campos_erro); break; } } function Formata_Campos_Falta($Campos_Falta, $table = false) { $Campos_Falta = array_unique($Campos_Falta); if (!$table) { return $this->Ini->Nm_lang['lang_errm_reqd'] . ' ' . implode('; ', $Campos_Falta); } $aCols = array(); $iTotal = sizeof($Campos_Falta); $iCols = 6 > $iTotal ? 1 : (11 > $iTotal ? 2 : (16 > $iTotal ? 3 : 4)); $iItems = ceil($iTotal / $iCols); $iNowC = 0; $iNowI = 0; foreach ($Campos_Falta as $campo) { $aCols[$iNowC][] = $campo; if ($iItems == ++$iNowI) { $iNowC++; $iNowI = 0; } } $sError = ''; $sError .= ''; $sError .= ''; foreach ($aCols as $aCol) { $sError .= ''; } $sError .= ''; $sError .= '
' . $this->Ini->Nm_lang['lang_errm_reqd'] . '' . implode('
', $aCol) . '
'; return $sError; } function Formata_Campos_Crit($Campos_Crit, $table = false) { $Campos_Crit = array_unique($Campos_Crit); if (!$table) { return $this->Ini->Nm_lang['lang_errm_flds'] . ' ' . implode('; ', $Campos_Crit); } $aCols = array(); $iTotal = sizeof($Campos_Crit); $iCols = 6 > $iTotal ? 1 : (11 > $iTotal ? 2 : (16 > $iTotal ? 3 : 4)); $iItems = ceil($iTotal / $iCols); $iNowC = 0; $iNowI = 0; foreach ($Campos_Crit as $campo) { $aCols[$iNowC][] = $campo; if ($iItems == ++$iNowI) { $iNowC++; $iNowI = 0; } } $sError = ''; $sError .= ''; $sError .= ''; foreach ($aCols as $aCol) { $sError .= ''; } $sError .= ''; $sError .= '
' . $this->Ini->Nm_lang['lang_errm_flds'] . '' . implode('
', $aCol) . '
'; return $sError; } function Formata_Campos_Erros($Campos_Erros) { $sError = ''; foreach ($Campos_Erros as $campo => $erros) { $sError .= ''; $sError .= ''; $sError .= ''; $sError .= ''; } $sError .= '
' . $this->Recupera_Nome_Campo($campo) . ':' . implode('
', array_unique($erros)) . '
'; return $sError; } function Formata_Campos_Erros_SweetAlert($Campos_Erros) { $sError = ''; foreach ($Campos_Erros as $campo => $erros) { $sError .= $this->Recupera_Nome_Campo($campo) . ': ' . implode('
', array_unique($erros)) . '
'; } return $sError; } function Recupera_Nome_Campo($campo) { switch($campo) { case 'tipocuenta': return "Tipocuenta"; break; case 'nombre': return "Nombre"; break; case 'formapago': return "Forma de Pago"; break; case 'ctacontable': return "Cuenta Contable"; break; case 'nrocuenta': return "Nro Cuenta Banco"; break; case 'nit': return "Nit"; break; case 'idoficina': return "Oficina"; break; case 'perfil': return "Orden"; break; case 'taquilla': return "Taquilla"; break; case 'idbanco': return "Idbanco"; break; case 'saldoinicial': return "Saldoinicial"; break; case 'otrasentradas': return "Otrasentradas"; break; case 'otrassalidas': return "Otrassalidas"; break; } return $campo; } function dateDefaultFormat() { if (isset($this->Ini->Nm_conf_reg[$this->Ini->str_conf_reg]['data_format'])) { $sDate = str_replace('yyyy', 'Y', $this->Ini->Nm_conf_reg[$this->Ini->str_conf_reg]['data_format']); $sDate = str_replace('mm', 'm', $sDate); $sDate = str_replace('dd', 'd', $sDate); return substr(chunk_split($sDate, 1, $this->Ini->Nm_conf_reg[$this->Ini->str_conf_reg]['data_sep']), 0, -1); } elseif ('en_us' == $this->Ini->str_lang) { return 'm/d/Y'; } else { return 'd/m/Y'; } } // dateDefaultFormat // //-------------------------------------------------------------------------------------- function Valida_campos(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros, $filtro = '') { global $nm_browser, $teste_validade; if (is_array($filtro) && empty($filtro)) { $filtro = ''; } //--------------------------------------------------------- $this->sc_force_zero = array(); if (!is_array($filtro) && '' == $filtro && isset($this->nm_form_submit) && '1' == $this->nm_form_submit && isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['csrf_token']) && $this->scCsrfGetToken() != $this->csrf_token) { $this->Campos_Mens_erro .= (empty($this->Campos_Mens_erro)) ? "" : "
"; $this->Campos_Mens_erro .= "CSRF: " . $this->Ini->Nm_lang['lang_errm_ajax_csrf']; if ($this->NM_ajax_flag) { if (!isset($this->NM_ajax_info['errList']['geral_form_bancos']) || !is_array($this->NM_ajax_info['errList']['geral_form_bancos'])) { $this->NM_ajax_info['errList']['geral_form_bancos'] = array(); } $this->NM_ajax_info['errList']['geral_form_bancos'][] = "CSRF: " . $this->Ini->Nm_lang['lang_errm_ajax_csrf']; } } if ((!is_array($filtro) && ('' == $filtro || 'tipocuenta' == $filtro)) || (is_array($filtro) && in_array('tipocuenta', $filtro))) $this->ValidateField_tipocuenta($Campos_Crit, $Campos_Falta, $Campos_Erros); if ((!is_array($filtro) && ('' == $filtro || 'nombre' == $filtro)) || (is_array($filtro) && in_array('nombre', $filtro))) $this->ValidateField_nombre($Campos_Crit, $Campos_Falta, $Campos_Erros); if ((!is_array($filtro) && ('' == $filtro || 'formapago' == $filtro)) || (is_array($filtro) && in_array('formapago', $filtro))) $this->ValidateField_formapago($Campos_Crit, $Campos_Falta, $Campos_Erros); if ((!is_array($filtro) && ('' == $filtro || 'ctacontable' == $filtro)) || (is_array($filtro) && in_array('ctacontable', $filtro))) $this->ValidateField_ctacontable($Campos_Crit, $Campos_Falta, $Campos_Erros); if ((!is_array($filtro) && ('' == $filtro || 'nrocuenta' == $filtro)) || (is_array($filtro) && in_array('nrocuenta', $filtro))) $this->ValidateField_nrocuenta($Campos_Crit, $Campos_Falta, $Campos_Erros); if ((!is_array($filtro) && ('' == $filtro || 'nit' == $filtro)) || (is_array($filtro) && in_array('nit', $filtro))) $this->ValidateField_nit($Campos_Crit, $Campos_Falta, $Campos_Erros); if ((!is_array($filtro) && ('' == $filtro || 'idoficina' == $filtro)) || (is_array($filtro) && in_array('idoficina', $filtro))) $this->ValidateField_idoficina($Campos_Crit, $Campos_Falta, $Campos_Erros); if ((!is_array($filtro) && ('' == $filtro || 'perfil' == $filtro)) || (is_array($filtro) && in_array('perfil', $filtro))) $this->ValidateField_perfil($Campos_Crit, $Campos_Falta, $Campos_Erros); if ((!is_array($filtro) && ('' == $filtro || 'taquilla' == $filtro)) || (is_array($filtro) && in_array('taquilla', $filtro))) $this->ValidateField_taquilla($Campos_Crit, $Campos_Falta, $Campos_Erros); if (!empty($Campos_Crit) || !empty($Campos_Falta) || !empty($this->Campos_Mens_erro)) { if (!empty($this->sc_force_zero)) { foreach ($this->sc_force_zero as $i_force_zero => $sc_force_zero_field) { eval('$this->' . $sc_force_zero_field . ' = "";'); unset($this->sc_force_zero[$i_force_zero]); } } } } function ValidateField_tipocuenta(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros) { global $teste_validade; $hasError = false; if (isset($this->Field_no_validate['tipocuenta'])) { return; } if ($this->tipocuenta == "" && $this->nmgp_opcao != "excluir") { } if ($hasError) { global $sc_seq_vert; $fieldName = 'tipocuenta'; if (isset($sc_seq_vert) && '' != $sc_seq_vert) { $fieldName .= $sc_seq_vert; } $this->NM_ajax_info['fieldsWithErrors'][] = $fieldName; } } // ValidateField_tipocuenta function ValidateField_nombre(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros) { global $teste_validade; $hasError = false; if (isset($this->Field_no_validate['nombre'])) { return; } if ($this->nmgp_opcao != "excluir") { if (NM_utf8_strlen($this->nombre) > 52) { $hasError = true; $Campos_Crit .= "Nombre " . $this->Ini->Nm_lang['lang_errm_mxch'] . " 52 " . $this->Ini->Nm_lang['lang_errm_nchr']; if (!isset($Campos_Erros['nombre'])) { $Campos_Erros['nombre'] = array(); } $Campos_Erros['nombre'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 52 " . $this->Ini->Nm_lang['lang_errm_nchr']; if (!isset($this->NM_ajax_info['errList']['nombre']) || !is_array($this->NM_ajax_info['errList']['nombre'])) { $this->NM_ajax_info['errList']['nombre'] = array(); } $this->NM_ajax_info['errList']['nombre'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 52 " . $this->Ini->Nm_lang['lang_errm_nchr']; } } if ($hasError) { global $sc_seq_vert; $fieldName = 'nombre'; if (isset($sc_seq_vert) && '' != $sc_seq_vert) { $fieldName .= $sc_seq_vert; } $this->NM_ajax_info['fieldsWithErrors'][] = $fieldName; } } // ValidateField_nombre function ValidateField_formapago(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros) { global $teste_validade; $hasError = false; if (isset($this->Field_no_validate['formapago'])) { return; } if ($this->formapago == "" && $this->nmgp_opcao != "excluir") { } if ($hasError) { global $sc_seq_vert; $fieldName = 'formapago'; if (isset($sc_seq_vert) && '' != $sc_seq_vert) { $fieldName .= $sc_seq_vert; } $this->NM_ajax_info['fieldsWithErrors'][] = $fieldName; } } // ValidateField_formapago function ValidateField_ctacontable(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros) { global $teste_validade; $hasError = false; if (isset($this->Field_no_validate['ctacontable'])) { return; } if ($this->nmgp_opcao != "excluir") { if (NM_utf8_strlen($this->ctacontable) > 12) { $hasError = true; $Campos_Crit .= "Cuenta Contable " . $this->Ini->Nm_lang['lang_errm_mxch'] . " 12 " . $this->Ini->Nm_lang['lang_errm_nchr']; if (!isset($Campos_Erros['ctacontable'])) { $Campos_Erros['ctacontable'] = array(); } $Campos_Erros['ctacontable'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 12 " . $this->Ini->Nm_lang['lang_errm_nchr']; if (!isset($this->NM_ajax_info['errList']['ctacontable']) || !is_array($this->NM_ajax_info['errList']['ctacontable'])) { $this->NM_ajax_info['errList']['ctacontable'] = array(); } $this->NM_ajax_info['errList']['ctacontable'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 12 " . $this->Ini->Nm_lang['lang_errm_nchr']; } } if ($hasError) { global $sc_seq_vert; $fieldName = 'ctacontable'; if (isset($sc_seq_vert) && '' != $sc_seq_vert) { $fieldName .= $sc_seq_vert; } $this->NM_ajax_info['fieldsWithErrors'][] = $fieldName; } } // ValidateField_ctacontable function ValidateField_nrocuenta(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros) { global $teste_validade; $hasError = false; if (isset($this->Field_no_validate['nrocuenta'])) { return; } if ($this->nmgp_opcao != "excluir") { if (NM_utf8_strlen($this->nrocuenta) > 20) { $hasError = true; $Campos_Crit .= "Nro Cuenta Banco " . $this->Ini->Nm_lang['lang_errm_mxch'] . " 20 " . $this->Ini->Nm_lang['lang_errm_nchr']; if (!isset($Campos_Erros['nrocuenta'])) { $Campos_Erros['nrocuenta'] = array(); } $Campos_Erros['nrocuenta'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 20 " . $this->Ini->Nm_lang['lang_errm_nchr']; if (!isset($this->NM_ajax_info['errList']['nrocuenta']) || !is_array($this->NM_ajax_info['errList']['nrocuenta'])) { $this->NM_ajax_info['errList']['nrocuenta'] = array(); } $this->NM_ajax_info['errList']['nrocuenta'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 20 " . $this->Ini->Nm_lang['lang_errm_nchr']; } } if ($hasError) { global $sc_seq_vert; $fieldName = 'nrocuenta'; if (isset($sc_seq_vert) && '' != $sc_seq_vert) { $fieldName .= $sc_seq_vert; } $this->NM_ajax_info['fieldsWithErrors'][] = $fieldName; } } // ValidateField_nrocuenta function ValidateField_nit(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros) { global $teste_validade; $hasError = false; if (isset($this->Field_no_validate['nit'])) { return; } if ($this->nmgp_opcao != "excluir") { if (NM_utf8_strlen($this->nit) > 20) { $hasError = true; $Campos_Crit .= "Nit " . $this->Ini->Nm_lang['lang_errm_mxch'] . " 20 " . $this->Ini->Nm_lang['lang_errm_nchr']; if (!isset($Campos_Erros['nit'])) { $Campos_Erros['nit'] = array(); } $Campos_Erros['nit'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 20 " . $this->Ini->Nm_lang['lang_errm_nchr']; if (!isset($this->NM_ajax_info['errList']['nit']) || !is_array($this->NM_ajax_info['errList']['nit'])) { $this->NM_ajax_info['errList']['nit'] = array(); } $this->NM_ajax_info['errList']['nit'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 20 " . $this->Ini->Nm_lang['lang_errm_nchr']; } } if ($hasError) { global $sc_seq_vert; $fieldName = 'nit'; if (isset($sc_seq_vert) && '' != $sc_seq_vert) { $fieldName .= $sc_seq_vert; } $this->NM_ajax_info['fieldsWithErrors'][] = $fieldName; } } // ValidateField_nit function ValidateField_idoficina(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros) { global $teste_validade; $hasError = false; if (isset($this->Field_no_validate['idoficina'])) { return; } if (!empty($this->idoficina) && isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina']) && !in_array($this->idoficina, $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'])) { $hasError = true; $Campos_Crit .= $this->Ini->Nm_lang['lang_errm_ajax_data']; if (!isset($Campos_Erros['idoficina'])) { $Campos_Erros['idoficina'] = array(); } $Campos_Erros['idoficina'][] = $this->Ini->Nm_lang['lang_errm_ajax_data']; if (!isset($this->NM_ajax_info['errList']['idoficina']) || !is_array($this->NM_ajax_info['errList']['idoficina'])) { $this->NM_ajax_info['errList']['idoficina'] = array(); } $this->NM_ajax_info['errList']['idoficina'][] = $this->Ini->Nm_lang['lang_errm_ajax_data']; } if ($hasError) { global $sc_seq_vert; $fieldName = 'idoficina'; if (isset($sc_seq_vert) && '' != $sc_seq_vert) { $fieldName .= $sc_seq_vert; } $this->NM_ajax_info['fieldsWithErrors'][] = $fieldName; } } // ValidateField_idoficina function ValidateField_perfil(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros) { global $teste_validade; $hasError = false; if (isset($this->Field_no_validate['perfil'])) { return; } if ($this->perfil == "" && $this->nmgp_opcao != "excluir") { } if ($hasError) { global $sc_seq_vert; $fieldName = 'perfil'; if (isset($sc_seq_vert) && '' != $sc_seq_vert) { $fieldName .= $sc_seq_vert; } $this->NM_ajax_info['fieldsWithErrors'][] = $fieldName; } } // ValidateField_perfil function ValidateField_taquilla(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros) { global $teste_validade; $hasError = false; if (isset($this->Field_no_validate['taquilla'])) { return; } if ($this->taquilla == "" && $this->nmgp_opcao != "excluir") { } if ($this->taquilla === "" || is_null($this->taquilla)) { $this->taquilla = 0; $this->sc_force_zero[] = 'taquilla'; } if ($hasError) { global $sc_seq_vert; $fieldName = 'taquilla'; if (isset($sc_seq_vert) && '' != $sc_seq_vert) { $fieldName .= $sc_seq_vert; } $this->NM_ajax_info['fieldsWithErrors'][] = $fieldName; } } // ValidateField_taquilla function removeDuplicateDttmError($aErrDate, &$aErrTime) { if (empty($aErrDate) || empty($aErrTime)) { return; } foreach ($aErrDate as $sErrDate) { foreach ($aErrTime as $iErrTime => $sErrTime) { if ($sErrDate == $sErrTime) { unset($aErrTime[$iErrTime]); } } } } // removeDuplicateDttmError function nm_guardar_campos() { global $sc_seq_vert; $this->nmgp_dados_form['tipocuenta'] = $this->tipocuenta; $this->nmgp_dados_form['nombre'] = $this->nombre; $this->nmgp_dados_form['formapago'] = $this->formapago; $this->nmgp_dados_form['ctacontable'] = $this->ctacontable; $this->nmgp_dados_form['nrocuenta'] = $this->nrocuenta; $this->nmgp_dados_form['nit'] = $this->nit; $this->nmgp_dados_form['idoficina'] = $this->idoficina; $this->nmgp_dados_form['perfil'] = $this->perfil; $this->nmgp_dados_form['taquilla'] = $this->taquilla; $this->nmgp_dados_form['idbanco'] = $this->idbanco; $this->nmgp_dados_form['saldoinicial'] = $this->saldoinicial; $this->nmgp_dados_form['otrasentradas'] = $this->otrasentradas; $this->nmgp_dados_form['otrassalidas'] = $this->otrassalidas; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dados_form'] = $this->nmgp_dados_form; } function nm_tira_formatacao() { global $nm_form_submit; $this->Before_unformat = array(); $this->formatado = false; $this->Before_unformat['idbanco'] = $this->idbanco; nm_limpa_numero($this->idbanco, $this->field_config['idbanco']['symbol_grp']) ; $this->Before_unformat['saldoinicial'] = $this->saldoinicial; if (!empty($this->field_config['saldoinicial']['symbol_dec'])) { $this->sc_remove_currency($this->saldoinicial, $this->field_config['saldoinicial']['symbol_dec'], $this->field_config['saldoinicial']['symbol_grp'], $this->field_config['saldoinicial']['symbol_mon']); nm_limpa_valor($this->saldoinicial, $this->field_config['saldoinicial']['symbol_dec'], $this->field_config['saldoinicial']['symbol_grp']); } $this->Before_unformat['otrasentradas'] = $this->otrasentradas; if (!empty($this->field_config['otrasentradas']['symbol_dec'])) { $this->sc_remove_currency($this->otrasentradas, $this->field_config['otrasentradas']['symbol_dec'], $this->field_config['otrasentradas']['symbol_grp'], $this->field_config['otrasentradas']['symbol_mon']); nm_limpa_valor($this->otrasentradas, $this->field_config['otrasentradas']['symbol_dec'], $this->field_config['otrasentradas']['symbol_grp']); } $this->Before_unformat['otrassalidas'] = $this->otrassalidas; if (!empty($this->field_config['otrassalidas']['symbol_dec'])) { $this->sc_remove_currency($this->otrassalidas, $this->field_config['otrassalidas']['symbol_dec'], $this->field_config['otrassalidas']['symbol_grp'], $this->field_config['otrassalidas']['symbol_mon']); nm_limpa_valor($this->otrassalidas, $this->field_config['otrassalidas']['symbol_dec'], $this->field_config['otrassalidas']['symbol_grp']); } } function sc_add_currency(&$value, $symbol, $pos) { if ('' == $value) { return; } $value = (1 == $pos || 3 == $pos) ? $symbol . ' ' . $value : $value . ' ' . $symbol; } function sc_remove_currency(&$value, $symbol_dec, $symbol_tho, $symbol_mon) { $value = preg_replace('~�*([0-9a-f]+);~i', '', $value); $sNew = str_replace($symbol_mon, '', $value); if ($sNew != $value) { $value = str_replace(' ', '', $sNew); return; } $aTest = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', $symbol_dec, $symbol_tho); $sNew = ''; for ($i = 0; $i < strlen($value); $i++) { if ($this->sc_test_currency_char($value[$i], $aTest)) { $sNew .= $value[$i]; } } $value = $sNew; } function sc_test_currency_char($char, $test) { $found = false; foreach ($test as $test_char) { if ($char === $test_char) { $found = true; } } return $found; } function nm_clear_val($Nome_Campo) { if ($Nome_Campo == "idbanco") { nm_limpa_numero($this->idbanco, $this->field_config['idbanco']['symbol_grp']) ; } if ($Nome_Campo == "saldoinicial") { if (!empty($this->field_config['saldoinicial']['symbol_dec'])) { $this->sc_remove_currency($this->saldoinicial, $this->field_config['saldoinicial']['symbol_dec'], $this->field_config['saldoinicial']['symbol_grp'], $this->field_config['saldoinicial']['symbol_mon']); nm_limpa_valor($this->saldoinicial, $this->field_config['saldoinicial']['symbol_dec'], $this->field_config['saldoinicial']['symbol_grp']); } } if ($Nome_Campo == "otrasentradas") { if (!empty($this->field_config['otrasentradas']['symbol_dec'])) { $this->sc_remove_currency($this->otrasentradas, $this->field_config['otrasentradas']['symbol_dec'], $this->field_config['otrasentradas']['symbol_grp'], $this->field_config['otrasentradas']['symbol_mon']); nm_limpa_valor($this->otrasentradas, $this->field_config['otrasentradas']['symbol_dec'], $this->field_config['otrasentradas']['symbol_grp']); } } if ($Nome_Campo == "otrassalidas") { if (!empty($this->field_config['otrassalidas']['symbol_dec'])) { $this->sc_remove_currency($this->otrassalidas, $this->field_config['otrassalidas']['symbol_dec'], $this->field_config['otrassalidas']['symbol_grp'], $this->field_config['otrassalidas']['symbol_mon']); nm_limpa_valor($this->otrassalidas, $this->field_config['otrassalidas']['symbol_dec'], $this->field_config['otrassalidas']['symbol_grp']); } } } function nm_formatar_campos($format_fields = array()) { global $nm_form_submit; if (isset($this->formatado) && $this->formatado) { return; } $this->formatado = true; } function nm_gera_mask(&$nm_campo, $nm_mask) { $trab_campo = $nm_campo; $trab_mask = $nm_mask; $tam_campo = strlen($nm_campo); $trab_saida = ""; if (false !== strpos($nm_mask, '9') || false !== strpos($nm_mask, 'a') || false !== strpos($nm_mask, '*')) { $new_campo = ''; $a_mask_ord = array(); $i_mask_size = -1; foreach (explode(';', $nm_mask) as $str_mask) { $a_mask_ord[ $this->nm_conta_mask_chars($str_mask) ] = $str_mask; } ksort($a_mask_ord); foreach ($a_mask_ord as $i_size => $s_mask) { if (-1 == $i_mask_size) { $i_mask_size = $i_size; } elseif (strlen($nm_campo) >= $i_size && strlen($nm_campo) > $i_mask_size) { $i_mask_size = $i_size; } } $nm_mask = $a_mask_ord[$i_mask_size]; for ($i = 0; $i < strlen($nm_mask); $i++) { $test_mask = substr($nm_mask, $i, 1); if ('9' == $test_mask || 'a' == $test_mask || '*' == $test_mask) { $new_campo .= substr($nm_campo, 0, 1); $nm_campo = substr($nm_campo, 1); } else { $new_campo .= $test_mask; } } $nm_campo = $new_campo; return; } $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 ($cont1 < $cont2 && $tam_campo <= $cont2 && $tam_campo > $cont1) { $trab_mask = $ver_duas[1]; } elseif ($cont1 > $cont2 && $tam_campo <= $cont2) { $trab_mask = $ver_duas[1]; } else { $trab_mask = $ver_duas[0]; } } $tam_mask = strlen($trab_mask); $xdados = 0; for ($x=0; $x < $tam_mask; $x++) { if (substr($trab_mask, $x, 1) == "#" && $xdados < $tam_campo) { $trab_saida .= substr($trab_campo, $xdados, 1); $xdados++; } elseif ($xdados < $tam_campo) { $trab_saida .= substr($trab_mask, $x, 1); } } if ($xdados < $tam_campo) { $trab_saida .= substr($trab_campo, $xdados); } $nm_campo = $trab_saida; return; } for ($ix = strlen($trab_mask); $ix > 0; $ix--) { $char_mask = substr($trab_mask, $ix - 1, 1); if ($char_mask != "x" && $char_mask != "z") { $trab_saida = $char_mask . $trab_saida; } else { if ($tam_campo != 0) { $trab_saida = substr($trab_campo, $tam_campo - 1, 1) . $trab_saida; $tam_campo--; } else { $trab_saida = "0" . $trab_saida; } } } if ($tam_campo != 0) { $trab_saida = substr($trab_campo, 0, $tam_campo) . $trab_saida; $trab_mask = str_repeat("z", $tam_campo) . $trab_mask; } $iz = 0; for ($ix = 0; $ix < strlen($trab_mask); $ix++) { $char_mask = substr($trab_mask, $ix, 1); if ($char_mask != "x" && $char_mask != "z") { if ($char_mask == "." || $char_mask == ",") { $trab_saida = substr($trab_saida, 0, $iz) . substr($trab_saida, $iz + 1); } else { $iz++; } } elseif ($char_mask == "x" || substr($trab_saida, $iz, 1) != "0") { $ix = strlen($trab_mask) + 1; } else { $trab_saida = substr($trab_saida, 0, $iz) . substr($trab_saida, $iz + 1); } } $nm_campo = $trab_saida; } function nm_conta_mask_chars($sMask) { $iLength = 0; for ($i = 0; $i < strlen($sMask); $i++) { if (in_array($sMask[$i], array('9', 'a', '*'))) { $iLength++; } } return $iLength; } function nm_tira_mask(&$nm_campo, $nm_mask, $nm_chars = '') { $mask_dados = $nm_campo; $trab_mask = $nm_mask; $tam_campo = strlen($nm_campo); $tam_mask = strlen($nm_mask); $trab_saida = ""; if (false !== strpos($nm_mask, '9') || false !== strpos($nm_mask, 'a') || false !== strpos($nm_mask, '*')) { $raw_campo = $this->sc_clear_mask($nm_campo, $nm_chars); $raw_mask = $this->sc_clear_mask($nm_mask, $nm_chars); $new_campo = ''; $test_mask = substr($raw_mask, 0, 1); $raw_mask = substr($raw_mask, 1); while ('' != $raw_campo) { $test_val = substr($raw_campo, 0, 1); $raw_campo = substr($raw_campo, 1); $ord = ord($test_val); $found = false; switch ($test_mask) { case '9': if (48 <= $ord && 57 >= $ord) { $new_campo .= $test_val; $found = true; } break; case 'a': if ((65 <= $ord && 90 >= $ord) || (97 <= $ord && 122 >= $ord)) { $new_campo .= $test_val; $found = true; } break; case '*': if ((48 <= $ord && 57 >= $ord) || (65 <= $ord && 90 >= $ord) || (97 <= $ord && 122 >= $ord)) { $new_campo .= $test_val; $found = true; } break; } if ($found) { $test_mask = substr($raw_mask, 0, 1); $raw_mask = substr($raw_mask, 1); } } $nm_campo = $new_campo; return; } $mask_num = false; for ($x=0; $x < strlen($trab_mask); $x++) { if (substr($trab_mask, $x, 1) == "#") { $mask_num = true; break; } } if ($mask_num ) { for ($x=0; $x < strlen($mask_dados); $x++) { if (is_numeric(substr($mask_dados, $x, 1))) { $trab_saida .= substr($mask_dados, $x, 1); } } $nm_campo = $trab_saida; return; } if ($tam_mask > $tam_campo) { $mask_desfaz = ""; for ($mask_ind = 0; $tam_mask > $tam_campo; $mask_ind++) { $mask_char = substr($trab_mask, $mask_ind, 1); if ($mask_char == "z") { $tam_mask--; } else { $mask_desfaz .= $mask_char; } if ($mask_ind == $tam_campo) { $tam_mask = $tam_campo; } } $trab_mask = $mask_desfaz . substr($trab_mask, $mask_ind); } $mask_saida = ""; for ($mask_ind = strlen($trab_mask); $mask_ind > 0; $mask_ind--) { $mask_char = substr($trab_mask, $mask_ind - 1, 1); if ($mask_char == "x" || $mask_char == "z") { if ($tam_campo > 0) { $mask_saida = substr($mask_dados, $tam_campo - 1, 1) . $mask_saida; } } else { if ($mask_char != substr($mask_dados, $tam_campo - 1, 1) && $tam_campo > 0) { $mask_saida = substr($mask_dados, $tam_campo - 1, 1) . $mask_saida; $mask_ind--; } } $tam_campo--; } if ($tam_campo > 0) { $mask_saida = substr($mask_dados, 0, $tam_campo) . $mask_saida; } $nm_campo = $mask_saida; } function sc_clear_mask($value, $chars) { $new = ''; for ($i = 0; $i < strlen($value); $i++) { if (false === strpos($chars, $value[$i])) { $new .= $value[$i]; } } return $new; } // function nm_limpa_alfa(&$str) { } function nm_conv_data_db($dt_in, $form_in, $form_out, $replaces = array()) { $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"; } if (strtoupper($form_out) == "SC_FORMAT_REGION") { $this->nm_data->SetaData($dt_in, strtoupper($form_in)); $prep_out = (strpos(strtolower($form_in), "dd") !== false) ? "dd" : ""; $prep_out .= (strpos(strtolower($form_in), "mm") !== false) ? "mm" : ""; $prep_out .= (strpos(strtolower($form_in), "aa") !== false) ? "aaaa" : ""; $prep_out .= (strpos(strtolower($form_in), "yy") !== false) ? "aaaa" : ""; return $this->nm_data->FormataSaida($this->nm_data->FormatRegion("DT", $prep_out)); } else { nm_conv_form_data($dt_out, $form_in, $form_out, $replaces); return $dt_out; } } function returnWhere($aCond, $sOp = 'AND') { $aWhere = array(); foreach ($aCond as $sCond) { $this->handleWhereCond($sCond); if ('' != $sCond) { $aWhere[] = $sCond; } } if (empty($aWhere)) { return ''; } else { return ' WHERE (' . implode(') ' . $sOp . ' (', $aWhere) . ')'; } } // returnWhere function handleWhereCond(&$sCond) { $sCond = trim($sCond); if ('where' == strtolower(substr($sCond, 0, 5))) { $sCond = trim(substr($sCond, 5)); } } // handleWhereCond function ajax_return_values() { $this->ajax_return_values_tipocuenta(); $this->ajax_return_values_nombre(); $this->ajax_return_values_formapago(); $this->ajax_return_values_ctacontable(); $this->ajax_return_values_nrocuenta(); $this->ajax_return_values_nit(); $this->ajax_return_values_idoficina(); $this->ajax_return_values_perfil(); $this->ajax_return_values_taquilla(); if ('navigate_form' == $this->NM_ajax_opcao) { $this->NM_ajax_info['clearUpload'] = 'S'; $this->NM_ajax_info['navStatus']['ret'] = $this->Nav_permite_ret ? 'S' : 'N'; $this->NM_ajax_info['navStatus']['ava'] = $this->Nav_permite_ava ? 'S' : 'N'; $this->NM_ajax_info['fldList']['idbanco']['keyVal'] = form_bancos_pack_protect_string($this->nmgp_dados_form['idbanco']); } } // ajax_return_values //----- tipocuenta function ajax_return_values_tipocuenta($bForce = false) { if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("tipocuenta", $this->nmgp_refresh_fields)) || $bForce) { $sTmpValue = NM_charset_to_utf8($this->tipocuenta); $aLookup = array(); $this->_tmp_lookup_tipocuenta = $this->tipocuenta; $aLookup[] = array(form_bancos_pack_protect_string('AHORROS') => str_replace('<', '<',form_bancos_pack_protect_string("AHORROS"))); $aLookup[] = array(form_bancos_pack_protect_string('CORRIENTE') => str_replace('<', '<',form_bancos_pack_protect_string("CORRIENTE"))); $aLookup[] = array(form_bancos_pack_protect_string('EFECTIVO') => str_replace('<', '<',form_bancos_pack_protect_string("CAJA"))); $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_tipocuenta'][] = 'AHORROS'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_tipocuenta'][] = 'CORRIENTE'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_tipocuenta'][] = 'EFECTIVO'; $aLookupOrig = $aLookup; $sSelComp = "name=\"tipocuenta\""; if (isset($this->NM_ajax_info['select_html']['tipocuenta']) && !empty($this->NM_ajax_info['select_html']['tipocuenta'])) { $sSelComp = str_replace('{SC_100PERC_CLASS_INPUT}', $this->classes_100perc_fields['input'], $this->NM_ajax_info['select_html']['tipocuenta']); } $sLookup = ''; if (empty($aLookup)) { $aLookup[] = array('' => ''); } foreach ($aLookup as $aOption) { foreach ($aOption as $sValue => $sLabel) { if ($this->tipocuenta == $sValue) { $this->_tmp_lookup_tipocuenta = $sLabel; } $sOpt = ($sValue !== $sLabel) ? $sValue : $sLabel; $sLookup .= ""; } } $aLookup = $sLookup; $this->NM_ajax_info['fldList']['tipocuenta'] = array( 'row' => '', 'type' => 'select', 'valList' => array($sTmpValue), ); $aLabel = array(); $aLabelTemp = array(); foreach ($this->NM_ajax_info['fldList']['tipocuenta']['valList'] as $i => $v) { $this->NM_ajax_info['fldList']['tipocuenta']['valList'][$i] = form_bancos_pack_protect_string($v); } foreach ($aLookupOrig as $aValData) { if (in_array(key($aValData), $this->NM_ajax_info['fldList']['tipocuenta']['valList'])) { $aLabelTemp[key($aValData)] = current($aValData); } } foreach ($this->NM_ajax_info['fldList']['tipocuenta']['valList'] as $iIndex => $sValue) { $aLabel[$iIndex] = (isset($aLabelTemp[$sValue])) ? $aLabelTemp[$sValue] : $sValue; } $this->NM_ajax_info['fldList']['tipocuenta']['labList'] = $aLabel; } } //----- nombre function ajax_return_values_nombre($bForce = false) { if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("nombre", $this->nmgp_refresh_fields)) || $bForce) { $sTmpValue = NM_charset_to_utf8($this->nombre); $aLookup = array(); $aLookupOrig = $aLookup; $this->NM_ajax_info['fldList']['nombre'] = array( 'row' => '', 'type' => 'text', 'valList' => array($this->form_encode_input($sTmpValue)), ); } } //----- formapago function ajax_return_values_formapago($bForce = false) { if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("formapago", $this->nmgp_refresh_fields)) || $bForce) { $sTmpValue = NM_charset_to_utf8($this->formapago); $aLookup = array(); $this->_tmp_lookup_formapago = $this->formapago; $aLookup[] = array(form_bancos_pack_protect_string('EFECTIVO') => str_replace('<', '<',form_bancos_pack_protect_string("EFECTIVO"))); $aLookup[] = array(form_bancos_pack_protect_string('TRANSFERENCIA') => str_replace('<', '<',form_bancos_pack_protect_string("TRANSFERENCIA"))); $aLookup[] = array(form_bancos_pack_protect_string('CONSIGNACION') => str_replace('<', '<',form_bancos_pack_protect_string("CONSIGNACION"))); $aLookup[] = array(form_bancos_pack_protect_string('TARJETA DEBITO') => str_replace('<', '<',form_bancos_pack_protect_string("TARJETA DEBITO"))); $aLookup[] = array(form_bancos_pack_protect_string('TARJETA CREDITO') => str_replace('<', '<',form_bancos_pack_protect_string("TARJETA CREDITO"))); $aLookup[] = array(form_bancos_pack_protect_string('CODIGO QR') => str_replace('<', '<',form_bancos_pack_protect_string("CODIGO QR"))); $aLookup[] = array(form_bancos_pack_protect_string('ANTICIPO VIAJE') => str_replace('<', '<',form_bancos_pack_protect_string("ANTICIPO VIAJE"))); $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_formapago'][] = 'EFECTIVO'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_formapago'][] = 'TRANSFERENCIA'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_formapago'][] = 'CONSIGNACION'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_formapago'][] = 'TARJETA DEBITO'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_formapago'][] = 'TARJETA CREDITO'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_formapago'][] = 'CODIGO QR'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_formapago'][] = 'ANTICIPO VIAJE'; $aLookupOrig = $aLookup; $sSelComp = "name=\"formapago\""; if (isset($this->NM_ajax_info['select_html']['formapago']) && !empty($this->NM_ajax_info['select_html']['formapago'])) { $sSelComp = str_replace('{SC_100PERC_CLASS_INPUT}', $this->classes_100perc_fields['input'], $this->NM_ajax_info['select_html']['formapago']); } $sLookup = ''; if (empty($aLookup)) { $aLookup[] = array('' => ''); } foreach ($aLookup as $aOption) { foreach ($aOption as $sValue => $sLabel) { if ($this->formapago == $sValue) { $this->_tmp_lookup_formapago = $sLabel; } $sOpt = ($sValue !== $sLabel) ? $sValue : $sLabel; $sLookup .= ""; } } $aLookup = $sLookup; $this->NM_ajax_info['fldList']['formapago'] = array( 'row' => '', 'type' => 'select', 'valList' => array($sTmpValue), ); $aLabel = array(); $aLabelTemp = array(); foreach ($this->NM_ajax_info['fldList']['formapago']['valList'] as $i => $v) { $this->NM_ajax_info['fldList']['formapago']['valList'][$i] = form_bancos_pack_protect_string($v); } foreach ($aLookupOrig as $aValData) { if (in_array(key($aValData), $this->NM_ajax_info['fldList']['formapago']['valList'])) { $aLabelTemp[key($aValData)] = current($aValData); } } foreach ($this->NM_ajax_info['fldList']['formapago']['valList'] as $iIndex => $sValue) { $aLabel[$iIndex] = (isset($aLabelTemp[$sValue])) ? $aLabelTemp[$sValue] : $sValue; } $this->NM_ajax_info['fldList']['formapago']['labList'] = $aLabel; } } //----- ctacontable function ajax_return_values_ctacontable($bForce = false) { if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("ctacontable", $this->nmgp_refresh_fields)) || $bForce) { $sTmpValue = NM_charset_to_utf8($this->ctacontable); $aLookup = array(); $aLookupOrig = $aLookup; $this->NM_ajax_info['fldList']['ctacontable'] = array( 'row' => '', 'type' => 'text', 'valList' => array($this->form_encode_input($sTmpValue)), ); } } //----- nrocuenta function ajax_return_values_nrocuenta($bForce = false) { if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("nrocuenta", $this->nmgp_refresh_fields)) || $bForce) { $sTmpValue = NM_charset_to_utf8($this->nrocuenta); $aLookup = array(); $aLookupOrig = $aLookup; $this->NM_ajax_info['fldList']['nrocuenta'] = array( 'row' => '', 'type' => 'text', 'valList' => array($this->form_encode_input($sTmpValue)), ); } } //----- nit function ajax_return_values_nit($bForce = false) { if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("nit", $this->nmgp_refresh_fields)) || $bForce) { $sTmpValue = NM_charset_to_utf8($this->nit); $aLookup = array(); $aLookupOrig = $aLookup; $this->NM_ajax_info['fldList']['nit'] = array( 'row' => '', 'type' => 'text', 'valList' => array($this->form_encode_input($sTmpValue)), ); } } //----- idoficina function ajax_return_values_idoficina($bForce = false) { if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("idoficina", $this->nmgp_refresh_fields)) || $bForce) { $sTmpValue = NM_charset_to_utf8($this->idoficina); $aLookup = array(); $this->_tmp_lookup_idoficina = $this->idoficina; $nmgp_def_dados = "" ; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'] = array_unique($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina']); } else { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'] = array(); } $nm_nao_carga = false; $nmgp_def_dados = "" ; $nm_comando = "SELECT Idoficina, nomoficina FROM oficinas ORDER BY nomoficina"; $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_comando; $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; if ($nm_comando != "" && $rs = $this->Db->Execute($nm_comando)) { while (!$rs->EOF) { $rs->fields[0] = str_replace(',', '.', $rs->fields[0]); $rs->fields[0] = (strpos(strtolower($rs->fields[0]), "e")) ? (float)$rs->fields[0] : $rs->fields[0]; $rs->fields[0] = (string)$rs->fields[0]; $aLookup[] = array(form_bancos_pack_protect_string(NM_charset_to_utf8($rs->fields[0])) => str_replace('<', '<', form_bancos_pack_protect_string(NM_charset_to_utf8($rs->fields[1])))); $nmgp_def_dados .= $rs->fields[1] . "?#?" ; $nmgp_def_dados .= $rs->fields[0] . "?#?N?@?" ; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'][] = $rs->fields[0]; $rs->MoveNext() ; } $rs->Close() ; } elseif ($GLOBALS["NM_ERRO_IBASE"] != 1 && $nm_comando != "") { $this->Erro->mensagem(__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit; } $GLOBALS["NM_ERRO_IBASE"] = 0; $aLookupOrig = $aLookup; $sSelComp = "name=\"idoficina\""; if (isset($this->NM_ajax_info['select_html']['idoficina']) && !empty($this->NM_ajax_info['select_html']['idoficina'])) { $sSelComp = str_replace('{SC_100PERC_CLASS_INPUT}', $this->classes_100perc_fields['input'], $this->NM_ajax_info['select_html']['idoficina']); } $sLookup = ''; if (empty($aLookup)) { $aLookup[] = array('' => ''); } foreach ($aLookup as $aOption) { foreach ($aOption as $sValue => $sLabel) { if ($this->idoficina == $sValue) { $this->_tmp_lookup_idoficina = $sLabel; } $sOpt = ($sValue !== $sLabel) ? $sValue : $sLabel; $sLookup .= ""; } } $aLookup = $sLookup; $this->NM_ajax_info['fldList']['idoficina'] = array( 'row' => '', 'type' => 'select', 'valList' => array($sTmpValue), 'optList' => $aLookup, ); $aLabel = array(); $aLabelTemp = array(); foreach ($this->NM_ajax_info['fldList']['idoficina']['valList'] as $i => $v) { $this->NM_ajax_info['fldList']['idoficina']['valList'][$i] = form_bancos_pack_protect_string($v); } foreach ($aLookupOrig as $aValData) { if (in_array(key($aValData), $this->NM_ajax_info['fldList']['idoficina']['valList'])) { $aLabelTemp[key($aValData)] = current($aValData); } } foreach ($this->NM_ajax_info['fldList']['idoficina']['valList'] as $iIndex => $sValue) { $aLabel[$iIndex] = (isset($aLabelTemp[$sValue])) ? $aLabelTemp[$sValue] : $sValue; } $this->NM_ajax_info['fldList']['idoficina']['labList'] = $aLabel; } } //----- perfil function ajax_return_values_perfil($bForce = false) { if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("perfil", $this->nmgp_refresh_fields)) || $bForce) { $sTmpValue = NM_charset_to_utf8($this->perfil); $aLookup = array(); $this->_tmp_lookup_perfil = $this->perfil; $aLookup[] = array(form_bancos_pack_protect_string('A') => str_replace('<', '<',form_bancos_pack_protect_string("A"))); $aLookup[] = array(form_bancos_pack_protect_string('B') => str_replace('<', '<',form_bancos_pack_protect_string("B"))); $aLookup[] = array(form_bancos_pack_protect_string('C') => str_replace('<', '<',form_bancos_pack_protect_string("C"))); $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_perfil'][] = 'A'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_perfil'][] = 'B'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_perfil'][] = 'C'; $aLookupOrig = $aLookup; $sSelComp = "name=\"perfil\""; if (isset($this->NM_ajax_info['select_html']['perfil']) && !empty($this->NM_ajax_info['select_html']['perfil'])) { $sSelComp = str_replace('{SC_100PERC_CLASS_INPUT}', $this->classes_100perc_fields['input'], $this->NM_ajax_info['select_html']['perfil']); } $sLookup = ''; if (empty($aLookup)) { $aLookup[] = array('' => ''); } foreach ($aLookup as $aOption) { foreach ($aOption as $sValue => $sLabel) { if ($this->perfil == $sValue) { $this->_tmp_lookup_perfil = $sLabel; } $sOpt = ($sValue !== $sLabel) ? $sValue : $sLabel; $sLookup .= ""; } } $aLookup = $sLookup; $this->NM_ajax_info['fldList']['perfil'] = array( 'row' => '', 'type' => 'select', 'valList' => array($sTmpValue), ); $aLabel = array(); $aLabelTemp = array(); foreach ($this->NM_ajax_info['fldList']['perfil']['valList'] as $i => $v) { $this->NM_ajax_info['fldList']['perfil']['valList'][$i] = form_bancos_pack_protect_string($v); } foreach ($aLookupOrig as $aValData) { if (in_array(key($aValData), $this->NM_ajax_info['fldList']['perfil']['valList'])) { $aLabelTemp[key($aValData)] = current($aValData); } } foreach ($this->NM_ajax_info['fldList']['perfil']['valList'] as $iIndex => $sValue) { $aLabel[$iIndex] = (isset($aLabelTemp[$sValue])) ? $aLabelTemp[$sValue] : $sValue; } $this->NM_ajax_info['fldList']['perfil']['labList'] = $aLabel; } } //----- taquilla function ajax_return_values_taquilla($bForce = false) { if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("taquilla", $this->nmgp_refresh_fields)) || $bForce) { $sTmpValue = NM_charset_to_utf8($this->taquilla); $aLookup = array(); $this->_tmp_lookup_taquilla = $this->taquilla; $aLookup[] = array(form_bancos_pack_protect_string('1') => str_replace('<', '<',form_bancos_pack_protect_string("SI"))); $aLookup[] = array(form_bancos_pack_protect_string('0') => str_replace('<', '<',form_bancos_pack_protect_string("NO"))); $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_taquilla'][] = '1'; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_taquilla'][] = '0'; $aLookupOrig = $aLookup; $sSelComp = "name=\"taquilla\""; if (isset($this->NM_ajax_info['select_html']['taquilla']) && !empty($this->NM_ajax_info['select_html']['taquilla'])) { $sSelComp = str_replace('{SC_100PERC_CLASS_INPUT}', $this->classes_100perc_fields['input'], $this->NM_ajax_info['select_html']['taquilla']); } $sLookup = ''; if (empty($aLookup)) { $aLookup[] = array('' => ''); } foreach ($aLookup as $aOption) { foreach ($aOption as $sValue => $sLabel) { if ($this->taquilla == $sValue) { $this->_tmp_lookup_taquilla = $sLabel; } $sOpt = ($sValue !== $sLabel) ? $sValue : $sLabel; $sLookup .= ""; } } $aLookup = $sLookup; $this->NM_ajax_info['fldList']['taquilla'] = array( 'row' => '', 'type' => 'select', 'valList' => array($sTmpValue), ); $aLabel = array(); $aLabelTemp = array(); foreach ($this->NM_ajax_info['fldList']['taquilla']['valList'] as $i => $v) { $this->NM_ajax_info['fldList']['taquilla']['valList'][$i] = form_bancos_pack_protect_string($v); } foreach ($aLookupOrig as $aValData) { if (in_array(key($aValData), $this->NM_ajax_info['fldList']['taquilla']['valList'])) { $aLabelTemp[key($aValData)] = current($aValData); } } foreach ($this->NM_ajax_info['fldList']['taquilla']['valList'] as $iIndex => $sValue) { $aLabel[$iIndex] = (isset($aLabelTemp[$sValue])) ? $aLabelTemp[$sValue] : $sValue; } $this->NM_ajax_info['fldList']['taquilla']['labList'] = $aLabel; } } function fetchUniqueUploadName($originalName, $uploadDir, $fieldName) { $originalName = trim($originalName); if ('' == $originalName) { return $originalName; } if (!@is_dir($uploadDir)) { return $originalName; } if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['upload_dir'][$fieldName])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['upload_dir'][$fieldName] = array(); $resDir = @opendir($uploadDir); if (!$resDir) { return $originalName; } while (false !== ($fileName = @readdir($resDir))) { if (@is_file($uploadDir . $fileName)) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['upload_dir'][$fieldName][] = $fileName; } } @closedir($resDir); } if (!in_array($originalName, $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['upload_dir'][$fieldName])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['upload_dir'][$fieldName][] = $originalName; return $originalName; } else { $newName = $this->fetchFileNextName($originalName, $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['upload_dir'][$fieldName]); $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['upload_dir'][$fieldName][] = $newName; $this->Upload_refresh_fields[] = $fieldName; return $newName; } } // fetchUniqueUploadName function fetchFileNextName($uniqueName, $uniqueList) { $aPathinfo = pathinfo($uniqueName); $fileExtension = $aPathinfo['extension']; $fileName = $aPathinfo['filename']; $foundName = false; $nameIt = 1; if ('' != $fileExtension) { $fileExtension = '.' . $fileExtension; } while (!$foundName) { $testName = $fileName . '(' . $nameIt . ')' . $fileExtension; if (in_array($testName, $uniqueList)) { $nameIt++; } else { $foundName = true; return $testName; } } } // fetchFileNextName function ajax_add_parameters() { $this->NM_ajax_info['summary_line'] = $this->getSummaryLine(); } // ajax_add_parameters function nm_proc_onload($bFormat = true) { $Ctrl_Proc_Onload = true; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Field_no_validate'] = array(); if (!isset($Ctrl_Format) || !$Ctrl_Format) { $this->nm_guardar_campos(); if ($bFormat) $this->nm_formatar_campos(); } } // //---------------------------------------------------- //-----> //---------------------------------------------------- // function nm_troca_decimal($sc_parm1, $sc_parm2) { $this->saldoinicial = str_replace($sc_parm1, $sc_parm2, $this->saldoinicial); $this->otrasentradas = str_replace($sc_parm1, $sc_parm2, $this->otrasentradas); $this->otrassalidas = str_replace($sc_parm1, $sc_parm2, $this->otrassalidas); } function nm_poe_aspas_decimal() { $this->saldoinicial = "'" . $this->saldoinicial . "'"; $this->otrasentradas = "'" . $this->otrasentradas . "'"; $this->otrassalidas = "'" . $this->otrassalidas . "'"; } function nm_tira_aspas_decimal() { $this->saldoinicial = str_replace("'", "", $this->saldoinicial); $this->otrasentradas = str_replace("'", "", $this->otrasentradas); $this->otrassalidas = str_replace("'", "", $this->otrassalidas); } //----------- function temRegistros($sWhere) { if ('' == $sWhere) { return false; } $nmgp_sel_count = 'SELECT COUNT(*) AS countTest FROM ' . $this->Ini->nm_tabela . ' WHERE ' . $sWhere; $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nmgp_sel_count; $rsc = $this->Db->Execute($nmgp_sel_count); if ($rsc === false && !$rsc->EOF) { $this->Erro->mensagem(__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dbas'], $this->Db->ErrorMsg()); exit; } $iTotal = $rsc->fields[0]; $rsc->Close(); return 0 < $iTotal; } // temRegistros function deletaRegistros($sWhere) { if ('' == $sWhere) { return false; } $nmgp_sel_count = 'DELETE FROM ' . $this->Ini->nm_tabela . ' WHERE ' . $sWhere; $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nmgp_sel_count; $rsc = $this->Db->Execute($nmgp_sel_count); $bResult = $rsc; $rsc->Close(); return $bResult == true; } // deletaRegistros function handleDbErrorMessage(&$dbErrorMessage, $dbErrorCode) { if (1267 == $dbErrorCode) { $dbErrorMessage = $this->Ini->Nm_lang['lang_errm_db_invalid_collation']; } } function restore_zeros_null() { if (!empty($this->sc_force_zero)) { foreach ($this->sc_force_zero as $i_force_zero => $sc_force_zero_field) { eval('if ($this->' . $sc_force_zero_field . ' == 0) {$this->' . $sc_force_zero_field . ' = "";}'); } } $this->sc_force_zero = array(); if (!empty($this->NM_val_null)) { foreach ($this->NM_val_null as $i_val_null => $sc_val_null_field) { eval('$this->' . $sc_val_null_field . ' = "";'); } } $this->NM_val_null = array(); } function nm_acessa_banco() { global $nm_form_submit, $teste_validade, $sc_where; $this->NM_val_null = array(); $NM_val_form = array(); $this->sc_erro_insert = ""; $this->sc_erro_update = ""; $this->sc_erro_delete = ""; $this->restore_zeros_null(); if ("excluir" == $this->nmgp_opcao) { $this->sc_evento = $this->nmgp_opcao; /*----- Scriptcase Locale: Event onBeforeDelete ------*/ $_SESSION['scriptcase']['form_bancos']['contr_erro'] = 'on'; if ($this->idbanco == 9 or $this->idbanco == 10){ if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";} if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= "Este registro de banco es fijo del sistema. No se puede borrar...."; if ('submit_form' == $this->NM_ajax_opcao || 'event_' == substr($this->NM_ajax_opcao, 0, 6) || (isset($this->wizard_action) && 'change_step' == $this->wizard_action)) { if (isset($this->wizard_action) && 'change_step' == $this->wizard_action) { $sErrorIndex = 'geral_form_bancos'; } elseif ('submit_form' == $this->NM_ajax_opcao) { $sErrorIndex = 'geral_form_bancos'; } else { $sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6); } $this->NM_ajax_info['errList'][$sErrorIndex][] = "Este registro de banco es fijo del sistema. No se puede borrar...."; } ; if (isset($this->Campos_Mens_erro) && !empty($this->Campos_Mens_erro)) { if ($this->NM_ajax_flag) { $_SESSION['scriptcase']['form_bancos']['contr_erro'] = 'off'; form_bancos_pack_ajax_response(); exit; } $Sc_Lixo = ob_get_clean(); $this->Erro->mensagem(__FILE__, __LINE__, "critica", $this->Campos_Mens_erro); $_SESSION['scriptcase']['form_bancos']['contr_erro'] = 'off'; $this->Campos_Mens_erro = ""; if ($this->nmgp_opcao == "incluir") {$this->nmgp_opcao = "novo";}; $this->nm_proc_onload(); $this->nm_formatar_campos(); $this->nm_gera_html(); $this->NM_close_db(); exit; } } $_SESSION['scriptcase']['form_bancos']['contr_erro'] = 'off'; /*----- END - Scriptcase Locale: Event onBeforeDelete ------*/ } if (!empty($this->Campos_Mens_erro)) { $this->Erro->mensagem(__FILE__, __LINE__, "critica", $this->Campos_Mens_erro); $this->Campos_Mens_erro = ""; $this->nmgp_opc_ant = $this->nmgp_opcao ; if ($this->nmgp_opcao == "incluir") { $GLOBALS["erro_incl"] = 1; } else { $this->sc_evento = ""; } if ($this->nmgp_opcao == "alterar" || $this->nmgp_opcao == "incluir" || $this->nmgp_opcao == "excluir") { $this->nmgp_opcao = "nada"; } $this->NM_rollback_db(); $this->Campos_Mens_erro = ""; } $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; $salva_opcao = $this->nmgp_opcao; if ($this->sc_evento != "novo" && $this->sc_evento != "incluir") { $this->sc_evento = ""; } if ((!isset($this->Ini->nm_bases_access) || !in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_access)) && !$this->Ini->sc_tem_trans_banco && in_array($this->nmgp_opcao, array('excluir', 'incluir', 'alterar'))) { $this->Ini->sc_tem_trans_banco = $this->Db->BeginTrans(); } $NM_val_form['tipocuenta'] = $this->tipocuenta; $NM_val_form['nombre'] = $this->nombre; $NM_val_form['formapago'] = $this->formapago; $NM_val_form['ctacontable'] = $this->ctacontable; $NM_val_form['nrocuenta'] = $this->nrocuenta; $NM_val_form['nit'] = $this->nit; $NM_val_form['idoficina'] = $this->idoficina; $NM_val_form['perfil'] = $this->perfil; $NM_val_form['taquilla'] = $this->taquilla; $NM_val_form['idbanco'] = $this->idbanco; $NM_val_form['saldoinicial'] = $this->saldoinicial; $NM_val_form['otrasentradas'] = $this->otrasentradas; $NM_val_form['otrassalidas'] = $this->otrassalidas; if ($this->idbanco === "" || is_null($this->idbanco)) { $this->idbanco = 0; } if ($this->saldoinicial === "" || is_null($this->saldoinicial)) { $this->saldoinicial = 0; $this->sc_force_zero[] = 'saldoinicial'; } if ($this->otrasentradas === "" || is_null($this->otrasentradas)) { $this->otrasentradas = 0; $this->sc_force_zero[] = 'otrasentradas'; } if ($this->otrassalidas === "" || is_null($this->otrassalidas)) { $this->otrassalidas = 0; $this->sc_force_zero[] = 'otrassalidas'; } if ($this->idoficina === "" || is_null($this->idoficina)) { $this->idoficina = 0; $this->sc_force_zero[] = 'idoficina'; } if ($this->taquilla === "" || is_null($this->taquilla)) { $this->taquilla = 0; $this->sc_force_zero[] = 'taquilla'; } $nm_bases_lob_geral = array_merge($this->Ini->nm_bases_mysql, $this->Ini->nm_bases_sqlite); if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['decimal_db'] == ",") { $this->nm_troca_decimal(".", ","); } if ($this->nmgp_opcao == "alterar" || $this->nmgp_opcao == "incluir") { $this->tipocuenta_before_qstr = $this->tipocuenta; $this->tipocuenta = substr($this->Db->qstr($this->tipocuenta), 1, -1); if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { $this->tipocuenta = str_replace(array("\\r\\n", "\\n", "\r\n"), array("\r\n", "\n", "\n"), $this->tipocuenta); } $this->nombre_before_qstr = $this->nombre; $this->nombre = substr($this->Db->qstr($this->nombre), 1, -1); if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { $this->nombre = str_replace(array("\\r\\n", "\\n", "\r\n"), array("\r\n", "\n", "\n"), $this->nombre); } $this->formapago_before_qstr = $this->formapago; $this->formapago = substr($this->Db->qstr($this->formapago), 1, -1); if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { $this->formapago = str_replace(array("\\r\\n", "\\n", "\r\n"), array("\r\n", "\n", "\n"), $this->formapago); } $this->ctacontable_before_qstr = $this->ctacontable; $this->ctacontable = substr($this->Db->qstr($this->ctacontable), 1, -1); if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { $this->ctacontable = str_replace(array("\\r\\n", "\\n", "\r\n"), array("\r\n", "\n", "\n"), $this->ctacontable); } $this->nrocuenta_before_qstr = $this->nrocuenta; $this->nrocuenta = substr($this->Db->qstr($this->nrocuenta), 1, -1); if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { $this->nrocuenta = str_replace(array("\\r\\n", "\\n", "\r\n"), array("\r\n", "\n", "\n"), $this->nrocuenta); } $this->nit_before_qstr = $this->nit; $this->nit = substr($this->Db->qstr($this->nit), 1, -1); if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { $this->nit = str_replace(array("\\r\\n", "\\n", "\r\n"), array("\r\n", "\n", "\n"), $this->nit); } $this->perfil_before_qstr = $this->perfil; $this->perfil = substr($this->Db->qstr($this->perfil), 1, -1); if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { $this->perfil = str_replace(array("\\r\\n", "\\n", "\r\n"), array("\r\n", "\n", "\n"), $this->perfil); } } if ($this->nmgp_opcao == "alterar") { $SC_fields_update = array(); if (($this->Embutida_form || $this->Embutida_multi) && isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['foreign_key']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['foreign_key'])) { foreach ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['foreign_key'] as $sFKName => $sFKValue) { if (isset($this->sc_conv_var[$sFKName])) { $sFKName = $this->sc_conv_var[$sFKName]; } eval("\$this->" . $sFKName . " = \"" . $sFKValue . "\";"); } } if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['decimal_db'] == ",") { $this->nm_poe_aspas_decimal(); } $_SESSION['scriptcase']['sc_sql_ult_comando'] = "select count(*) AS countTest from " . $this->Ini->nm_tabela . " where idbanco = $this->idbanco "; $rs1 = $this->Db->Execute("select count(*) AS countTest from " . $this->Ini->nm_tabela . " where idbanco = $this->idbanco "); if ($rs1 === false) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dbas'], $this->Db->ErrorMsg()); if ($this->NM_ajax_flag) { form_bancos_pack_ajax_response(); } exit; } $bUpdateOk = true; $tmp_result = (int) $rs1->fields[0]; if ($tmp_result != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "critica", $this->Ini->Nm_lang['lang_errm_nfnd']); $this->nmgp_opcao = "nada"; $bUpdateOk = false; $this->sc_evento = 'update'; } $aUpdateOk = array(); $bUpdateOk = $bUpdateOk && empty($aUpdateOk); if ($bUpdateOk) { $rs1->Close(); $aDoNotUpdate = array(); if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { $comando = "UPDATE " . $this->Ini->nm_tabela . " SET "; $SC_fields_update[] = "tipocuenta = '$this->tipocuenta', nombre = '$this->nombre', formapago = '$this->formapago', ctacontable = '$this->ctacontable', nrocuenta = '$this->nrocuenta', nit = '$this->nit', idoficina = $this->idoficina, perfil = '$this->perfil', taquilla = $this->taquilla"; } else { $comando = "UPDATE " . $this->Ini->nm_tabela . " SET "; $SC_fields_update[] = "tipocuenta = '$this->tipocuenta', nombre = '$this->nombre', formapago = '$this->formapago', ctacontable = '$this->ctacontable', nrocuenta = '$this->nrocuenta', nit = '$this->nit', idoficina = $this->idoficina, perfil = '$this->perfil', taquilla = $this->taquilla"; } $Prep_Tst = (isset($NM_val_form['saldoinicial']) && $NM_val_form['saldoinicial'] == "null" && $this->nmgp_dados_select['saldoinicial'] == "") ? "null" : $this->nmgp_dados_select['saldoinicial']; if (isset($NM_val_form['saldoinicial']) && $NM_val_form['saldoinicial'] != $Prep_Tst) { $SC_fields_update[] = "saldoinicial = $this->saldoinicial"; } $Prep_Tst = (isset($NM_val_form['otrasentradas']) && $NM_val_form['otrasentradas'] == "null" && $this->nmgp_dados_select['otrasentradas'] == "") ? "null" : $this->nmgp_dados_select['otrasentradas']; if (isset($NM_val_form['otrasentradas']) && $NM_val_form['otrasentradas'] != $Prep_Tst) { $SC_fields_update[] = "otrasentradas = $this->otrasentradas"; } $Prep_Tst = (isset($NM_val_form['otrassalidas']) && $NM_val_form['otrassalidas'] == "null" && $this->nmgp_dados_select['otrassalidas'] == "") ? "null" : $this->nmgp_dados_select['otrassalidas']; if (isset($NM_val_form['otrassalidas']) && $NM_val_form['otrassalidas'] != $Prep_Tst) { $SC_fields_update[] = "otrassalidas = $this->otrassalidas"; } $comando .= implode(",", $SC_fields_update); $comando .= " WHERE idbanco = $this->idbanco "; $comando = str_replace("N'null'", "null", $comando) ; $comando = str_replace("'null'", "null", $comando) ; $comando = str_replace("#null#", "null", $comando) ; $comando = str_replace($this->Ini->date_delim . "null" . $this->Ini->date_delim1, "null", $comando) ; $useUpdateProcedure = false; if (!empty($SC_fields_update) || $useUpdateProcedure) { $_SESSION['scriptcase']['sc_sql_ult_comando'] = $comando; $rs = $this->Db->Execute($comando); if ($rs === false) { if (FALSE === strpos(strtoupper($this->Db->ErrorMsg()), "MAIL SENT") && FALSE === strpos(strtoupper($this->Db->ErrorMsg()), "WARNING")) { $dbErrorMessage = $this->Db->ErrorMsg(); $dbErrorCode = $this->Db->ErrorNo(); $this->handleDbErrorMessage($dbErrorMessage, $dbErrorCode); $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_updt'], $dbErrorMessage, true); if (isset($_SESSION['scriptcase']['erro_handler']) && $_SESSION['scriptcase']['erro_handler']) { $this->sc_erro_update = $dbErrorMessage; $this->NM_rollback_db(); if ($this->NM_ajax_flag) { form_bancos_pack_ajax_response(); } exit; } } } } $this->tipocuenta = $this->tipocuenta_before_qstr; $this->nombre = $this->nombre_before_qstr; $this->formapago = $this->formapago_before_qstr; $this->ctacontable = $this->ctacontable_before_qstr; $this->nrocuenta = $this->nrocuenta_before_qstr; $this->nit = $this->nit_before_qstr; $this->perfil = $this->perfil_before_qstr; if (in_array(strtolower($this->Ini->nm_tpbanco), $nm_bases_lob_geral)) { } $this->sc_evento = "update"; $this->nmgp_opcao = "igual"; $this->nm_flag_iframe = true; if ($this->lig_edit_lookup) { $this->lig_edit_lookup_call = true; } $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['db_changed'] = true; if ($this->NM_ajax_flag) { $this->NM_ajax_info['clearUpload'] = 'S'; } if (isset($NM_val_form) && isset($NM_val_form['tipocuenta'])) { $this->tipocuenta = $NM_val_form['tipocuenta']; } elseif (isset($this->tipocuenta)) { $this->nm_limpa_alfa($this->tipocuenta); } if (isset($NM_val_form) && isset($NM_val_form['nombre'])) { $this->nombre = $NM_val_form['nombre']; } elseif (isset($this->nombre)) { $this->nm_limpa_alfa($this->nombre); } if (isset($NM_val_form) && isset($NM_val_form['formapago'])) { $this->formapago = $NM_val_form['formapago']; } elseif (isset($this->formapago)) { $this->nm_limpa_alfa($this->formapago); } if (isset($NM_val_form) && isset($NM_val_form['ctacontable'])) { $this->ctacontable = $NM_val_form['ctacontable']; } elseif (isset($this->ctacontable)) { $this->nm_limpa_alfa($this->ctacontable); } if (isset($NM_val_form) && isset($NM_val_form['nrocuenta'])) { $this->nrocuenta = $NM_val_form['nrocuenta']; } elseif (isset($this->nrocuenta)) { $this->nm_limpa_alfa($this->nrocuenta); } if (isset($NM_val_form) && isset($NM_val_form['nit'])) { $this->nit = $NM_val_form['nit']; } elseif (isset($this->nit)) { $this->nm_limpa_alfa($this->nit); } if (isset($NM_val_form) && isset($NM_val_form['idoficina'])) { $this->idoficina = $NM_val_form['idoficina']; } elseif (isset($this->idoficina)) { $this->nm_limpa_alfa($this->idoficina); } if (isset($NM_val_form) && isset($NM_val_form['perfil'])) { $this->perfil = $NM_val_form['perfil']; } elseif (isset($this->perfil)) { $this->nm_limpa_alfa($this->perfil); } if (isset($NM_val_form) && isset($NM_val_form['taquilla'])) { $this->taquilla = $NM_val_form['taquilla']; } elseif (isset($this->taquilla)) { $this->nm_limpa_alfa($this->taquilla); } $this->nm_formatar_campos(); $aOldRefresh = $this->nmgp_refresh_fields; $this->nmgp_refresh_fields = array_diff(array('tipocuenta', 'nombre', 'formapago', 'ctacontable', 'nrocuenta', 'nit', 'idoficina', 'perfil', 'taquilla'), $aDoNotUpdate); $this->ajax_return_values(); $this->nmgp_refresh_fields = $aOldRefresh; $this->nm_tira_formatacao(); } } if ($this->nmgp_opcao == "incluir") { $NM_cmp_auto = ""; $NM_seq_auto = ""; if (($this->Embutida_form || $this->Embutida_multi) && isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['foreign_key']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['foreign_key'])) { foreach ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['foreign_key'] as $sFKName => $sFKValue) { if (isset($this->sc_conv_var[$sFKName])) { $sFKName = $this->sc_conv_var[$sFKName]; } eval("\$this->" . $sFKName . " = \"" . $sFKValue . "\";"); } } if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['decimal_db'] == ",") { $this->nm_poe_aspas_decimal(); } if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_sqlite)) { $NM_seq_auto = "NULL, "; $NM_cmp_auto = "idbanco, "; } $bInsertOk = true; $aInsertOk = array(); $bInsertOk = $bInsertOk && empty($aInsertOk); if (!isset($_POST['nmgp_ins_valid']) || $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['insert_validation'] != $_POST['nmgp_ins_valid']) { $bInsertOk = false; $this->Erro->mensagem(__FILE__, __LINE__, 'security', $this->Ini->Nm_lang['lang_errm_inst_vald']); if (isset($_SESSION['scriptcase']['erro_handler']) && $_SESSION['scriptcase']['erro_handler']) { $this->nmgp_opcao = 'refresh_insert'; if ($this->NM_ajax_flag) { form_bancos_pack_ajax_response(); exit; } } } if ($bInsertOk) { if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { $comando = "INSERT INTO " . $this->Ini->nm_tabela . " (" . $NM_cmp_auto . "tipocuenta, nombre, formapago, ctacontable, nrocuenta, saldoinicial, otrasentradas, otrassalidas, nit, idoficina, perfil, taquilla) VALUES (" . $NM_seq_auto . "'$this->tipocuenta', '$this->nombre', '$this->formapago', '$this->ctacontable', '$this->nrocuenta', $this->saldoinicial, $this->otrasentradas, $this->otrassalidas, '$this->nit', $this->idoficina, '$this->perfil', $this->taquilla)"; } elseif (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_sqlite)) { $comando = "INSERT INTO " . $this->Ini->nm_tabela . " (" . $NM_cmp_auto . "tipocuenta, nombre, formapago, ctacontable, nrocuenta, saldoinicial, otrasentradas, otrassalidas, nit, idoficina, perfil, taquilla) VALUES (" . $NM_seq_auto . "'$this->tipocuenta', '$this->nombre', '$this->formapago', '$this->ctacontable', '$this->nrocuenta', $this->saldoinicial, $this->otrasentradas, $this->otrassalidas, '$this->nit', $this->idoficina, '$this->perfil', $this->taquilla)"; } else { $comando = "INSERT INTO " . $this->Ini->nm_tabela . " (" . $NM_cmp_auto . "tipocuenta, nombre, formapago, ctacontable, nrocuenta, saldoinicial, otrasentradas, otrassalidas, nit, idoficina, perfil, taquilla) VALUES (" . $NM_seq_auto . "'$this->tipocuenta', '$this->nombre', '$this->formapago', '$this->ctacontable', '$this->nrocuenta', $this->saldoinicial, $this->otrasentradas, $this->otrassalidas, '$this->nit', $this->idoficina, '$this->perfil', $this->taquilla)"; } $comando = str_replace("N'null'", "null", $comando) ; $comando = str_replace("'null'", "null", $comando) ; $comando = str_replace("#null#", "null", $comando) ; $comando = str_replace($this->Ini->date_delim . "null" . $this->Ini->date_delim1, "null", $comando) ; $_SESSION['scriptcase']['sc_sql_ult_comando'] = $comando; $rs = $this->Db->Execute($comando); if ($rs === false) { if (FALSE === strpos(strtoupper($this->Db->ErrorMsg()), "MAIL SENT") && FALSE === strpos(strtoupper($this->Db->ErrorMsg()), "WARNING")) { $dbErrorMessage = $this->Db->ErrorMsg(); $dbErrorCode = $this->Db->ErrorNo(); $this->handleDbErrorMessage($dbErrorMessage, $dbErrorCode); $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_inst'], $dbErrorMessage, true); if (isset($_SESSION['scriptcase']['erro_handler']) && $_SESSION['scriptcase']['erro_handler']) { $this->sc_erro_insert = $dbErrorMessage; $this->nmgp_opcao = 'refresh_insert'; $this->NM_rollback_db(); if ($this->NM_ajax_flag) { form_bancos_pack_ajax_response(); exit; } } } } if ('refresh_insert' != $this->nmgp_opcao) { if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { { $_SESSION['scriptcase']['sc_sql_ult_comando'] = "select last_insert_id()"; } $rsy = $this->Db->Execute($_SESSION['scriptcase']['sc_sql_ult_comando']); if ($rsy === false && !$rsy->EOF) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dbas'], $this->Db->ErrorMsg()); exit; } $this->idbanco = $rsy->fields[0]; $rsy->Close(); } if (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_sqlite)) { $_SESSION['scriptcase']['sc_sql_ult_comando'] = "select last_insert_rowid()"; $rsy = $this->Db->Execute($_SESSION['scriptcase']['sc_sql_ult_comando']); if ($rsy === false && !$rsy->EOF) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dbas'], $this->Db->ErrorMsg()); exit; } $this->idbanco = $rsy->fields[0]; $rsy->Close(); } $this->tipocuenta = $this->tipocuenta_before_qstr; $this->nombre = $this->nombre_before_qstr; $this->formapago = $this->formapago_before_qstr; $this->ctacontable = $this->ctacontable_before_qstr; $this->nrocuenta = $this->nrocuenta_before_qstr; $this->nit = $this->nit_before_qstr; $this->perfil = $this->perfil_before_qstr; } $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['db_changed'] = true; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total'])) { unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total']); } $this->sc_evento = "insert"; $this->tipocuenta = $this->tipocuenta_before_qstr; $this->nombre = $this->nombre_before_qstr; $this->formapago = $this->formapago_before_qstr; $this->ctacontable = $this->ctacontable_before_qstr; $this->nrocuenta = $this->nrocuenta_before_qstr; $this->nit = $this->nit_before_qstr; $this->perfil = $this->perfil_before_qstr; $this->sc_insert_on = true; if (empty($this->sc_erro_insert)) { $this->record_insert_ok = true; } if ('refresh_insert' != $this->nmgp_opcao && (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['sc_redir_insert']) || $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['sc_redir_insert'] != "S")) { $this->nmgp_opcao = "novo"; if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "F" || $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "R") { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['return_edit'] = "new"; } } $this->nm_flag_iframe = true; } if ($this->lig_edit_lookup) { $this->lig_edit_lookup_call = true; } } if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['decimal_db'] == ",") { $this->nm_tira_aspas_decimal(); } if ($this->nmgp_opcao == "excluir") { $this->idbanco = substr($this->Db->qstr($this->idbanco), 1, -1); $bDelecaoOk = true; $sMsgErro = ''; if ($bDelecaoOk) { $_SESSION['scriptcase']['sc_sql_ult_comando'] = "select count(*) AS countTest from " . $this->Ini->nm_tabela . " where idbanco = $this->idbanco"; $rs1 = $this->Db->Execute("select count(*) AS countTest from " . $this->Ini->nm_tabela . " where idbanco = $this->idbanco "); if ($rs1 === false) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dbas'], $this->Db->ErrorMsg()); exit; } if ($rs1 === false) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dbas'], $this->Db->ErrorMsg()); exit; } $tmp_result = (int) $rs1->fields[0]; if ($tmp_result != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "critica", $this->Ini->Nm_lang['lang_errm_dele_nfnd']); $this->nmgp_opcao = "nada"; $this->sc_evento = 'delete'; } else { $rs1->Close(); $_SESSION['scriptcase']['sc_sql_ult_comando'] = "DELETE FROM " . $this->Ini->nm_tabela . " where idbanco = $this->idbanco "; $rs = $this->Db->Execute("DELETE FROM " . $this->Ini->nm_tabela . " where idbanco = $this->idbanco "); if ($rs === false) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dele'], $this->Db->ErrorMsg(), true); if (isset($_SESSION['scriptcase']['erro_handler']) && $_SESSION['scriptcase']['erro_handler']) { $this->sc_erro_delete = $this->Db->ErrorMsg(); $this->NM_rollback_db(); if ($this->NM_ajax_flag) { form_bancos_pack_ajax_response(); exit; } } } $this->sc_evento = "delete"; if (empty($this->sc_erro_delete)) { $this->record_delete_ok = true; } $this->nmgp_opcao = "avanca"; $this->nm_flag_iframe = true; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start']--; if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] < 0) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] = 0; } $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['db_changed'] = true; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total'])) { unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total']); } if ($this->lig_edit_lookup) { $this->lig_edit_lookup_call = true; } } } else { $this->sc_evento = "delete"; $this->nmgp_opcao = "igual"; $this->Erro->mensagem(__FILE__, __LINE__, "critica", $sMsgErro); } } $this->restore_zeros_null(); if ($salva_opcao == "incluir" && $GLOBALS["erro_incl"] != 1) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['parms'] = "idbanco?#?$this->idbanco?@?"; } $this->NM_commit_db(); if ($this->sc_evento != "insert" && $this->sc_evento != "update" && $this->sc_evento != "delete") { $this->idbanco = null === $this->idbanco ? null : substr($this->Db->qstr($this->idbanco), 1, -1); } if (isset($this->NM_where_filter)) { $this->NM_where_filter = str_replace("@percent@", "%", $this->NM_where_filter); $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter'] = trim($this->NM_where_filter); if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total'])) { unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total']); } } $sc_where_filter = ''; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter_form']) && '' != $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter_form']) { $sc_where_filter = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter_form']; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter']) && '' != $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter'] && $sc_where_filter != $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter']) { if (empty($sc_where_filter)) { $sc_where_filter = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter']; } else { $sc_where_filter .= " and (" . $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter'] . ")"; } } //------------ if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "F" || $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "R") { if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['iframe_evento']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['iframe_evento'] == "insert") { $this->nmgp_opcao = "novo"; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['select'] = ""; } $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['iframe_evento'] = $this->sc_evento; } if (!isset($this->nmgp_opcao) || empty($this->nmgp_opcao)) { if (empty($this->idbanco)) { $this->nmgp_opcao = "inicio"; } else { $this->nmgp_opcao = "igual"; } } if (isset($_POST['master_nav']) && 'on' == $_POST['master_nav']) { $this->nmgp_opcao = "inicio"; } if ($this->nmgp_opcao != "nada" && (trim($this->idbanco) == "")) { if ($this->nmgp_opcao == "avanca") { $this->nmgp_opcao = "final"; } elseif ($this->nmgp_opcao != "novo") { $this->nmgp_opcao = "inicio"; } } if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "F" && $this->sc_evento == "insert") { $this->nmgp_opcao = "final"; } $sc_where = trim(""); if (substr(strtolower($sc_where), 0, 5) == "where") { $sc_where = substr($sc_where , 5); } if (!empty($sc_where)) { $sc_where = " where " . $sc_where . " "; } if ('' != $sc_where_filter) { $sc_where = ('' != $sc_where) ? $sc_where . ' and (' . $sc_where_filter . ')' : ' where ' . $sc_where_filter; } if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total'])) { $nmgp_select = "SELECT count(*) AS countTest from " . $this->Ini->nm_tabela . $sc_where; $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nmgp_select; $rt = $this->Db->Execute($nmgp_select) ; if ($rt === false && !$rt->EOF && $GLOBALS["NM_ERRO_IBASE"] != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit ; } $qt_geral_reg_form_bancos = isset($rt->fields[0]) ? $rt->fields[0] - 1 : 0; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total'] = $qt_geral_reg_form_bancos; $rt->Close(); if ($this->nmgp_opcao == "igual" && isset($this->NM_btn_navega) && 'S' == $this->NM_btn_navega && !empty($this->idbanco)) { $Key_Where = "idbanco < $this->idbanco "; $Where_Start = (empty($sc_where)) ? " where " . $Key_Where : $sc_where . " and (" . $Key_Where . ")"; $nmgp_select = "SELECT count(*) AS countTest from " . $this->Ini->nm_tabela . $Where_Start; $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nmgp_select; $rt = $this->Db->Execute($nmgp_select) ; if ($rt === false && !$rt->EOF && $GLOBALS["NM_ERRO_IBASE"] != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit ; } $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] = $rt->fields[0]; $rt->Close(); } } else { $qt_geral_reg_form_bancos = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total']; } if ($this->nmgp_opcao == "inicio") { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] = 0; } if ($this->nmgp_opcao == "avanca") { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start']++; if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] > $qt_geral_reg_form_bancos) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] = $qt_geral_reg_form_bancos; } } if ($this->nmgp_opcao == "retorna") { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start']--; if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] < 0) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] = 0; } } if ($this->nmgp_opcao == "final") { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] = $qt_geral_reg_form_bancos; } if ($this->nmgp_opcao == "navpage" && ($this->nmgp_ordem - 1) <= $qt_geral_reg_form_bancos) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] = $this->nmgp_ordem - 1; } if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start']) || empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] = 0; } $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_qtd'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] + 1; $this->NM_ajax_info['navSummary']['reg_ini'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] + 1; $this->NM_ajax_info['navSummary']['reg_qtd'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_qtd']; $this->NM_ajax_info['navSummary']['reg_tot'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total'] + 1; $this->NM_gera_nav_page(); $this->NM_ajax_info['navPage'] = $this->SC_nav_page; $GLOBALS["NM_ERRO_IBASE"] = 0; //---------- if ($this->nmgp_opcao != "novo" && $this->nmgp_opcao != "nada" && $this->nmgp_opcao != "refresh_insert") { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['parms'] = ""; $nmgp_select = "SELECT idbanco, tipocuenta, nombre, formapago, ctacontable, nrocuenta, saldoinicial, otrasentradas, otrassalidas, nit, idoficina, perfil, taquilla from " . $this->Ini->nm_tabela ; $aWhere = array(); $aWhere[] = $sc_where_filter; if ($this->nmgp_opcao == "igual" || (($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "F" || $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "R") && ($this->sc_evento == "insert" || $this->sc_evento == "update")) ) { $aWhere[] = "idbanco = $this->idbanco"; if (!empty($sc_where_filter)) { $teste_select = $nmgp_select . $this->returnWhere($aWhere); $_SESSION['scriptcase']['sc_sql_ult_comando'] = $teste_select; $rs = $this->Db->Execute($teste_select); if ($rs->EOF) { $aWhere = array($sc_where_filter); } $rs->Close(); } } $nmgp_select .= $this->returnWhere($aWhere) . ' '; $sc_order_by = ""; $sc_order_by = "idbanco"; $sc_order_by = str_replace("order by ", "", $sc_order_by); $sc_order_by = str_replace("ORDER BY ", "", trim($sc_order_by)); if (!empty($sc_order_by)) { $nmgp_select .= " order by $sc_order_by "; } if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "F" || $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "R") { if ($this->sc_evento == "update") { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['select'] = $nmgp_select; $this->nm_gera_html(); } elseif (!empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['select'])) { $nmgp_select = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['select']; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['select'] = ""; } } if ($this->nmgp_opcao == "igual") { $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nmgp_select; $rs = $this->Db->Execute($nmgp_select) ; } elseif (in_array(strtolower($this->Ini->nm_tpbanco), $this->Ini->nm_bases_mysql)) { $_SESSION['scriptcase']['sc_sql_ult_comando'] = "SelectLimit($nmgp_select, 1, " . $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] . ")" ; $rs = $this->Db->SelectLimit($nmgp_select, 1, $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start']) ; } else { $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nmgp_select; $rs = $this->Db->Execute($nmgp_select) ; if (!$rs === false && !$rs->EOF) { $rs->Move($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start']) ; } } if ($rs === false && !$rs->EOF && $GLOBALS["NM_ERRO_IBASE"] != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit ; } if ($rs === false && $GLOBALS["NM_ERRO_IBASE"] == 1) { $GLOBALS["NM_ERRO_IBASE"] = 0; $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_nfnd_extr'], $this->Db->ErrorMsg()); exit ; } if ($rs->EOF) { if (!empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter'])) { $this->nmgp_form_empty = true; $this->NM_ajax_info['buttonDisplay']['first'] = $this->nmgp_botoes['first'] = "off"; $this->NM_ajax_info['buttonDisplay']['back'] = $this->nmgp_botoes['back'] = "off"; $this->NM_ajax_info['buttonDisplay']['forward'] = $this->nmgp_botoes['forward'] = "off"; $this->NM_ajax_info['buttonDisplay']['last'] = $this->nmgp_botoes['last'] = "off"; $this->NM_ajax_info['buttonDisplay']['update'] = $this->nmgp_botoes['update'] = "off"; $this->NM_ajax_info['buttonDisplay']['delete'] = $this->nmgp_botoes['delete'] = "off"; $this->NM_ajax_info['buttonDisplay']['first'] = $this->nmgp_botoes['insert'] = "off"; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['empty_filter'] = true; return; } if ($this->nmgp_botoes['insert'] != "on") { $this->nmgp_form_empty = true; $this->NM_ajax_info['buttonDisplay']['first'] = $this->nmgp_botoes['first'] = "off"; $this->NM_ajax_info['buttonDisplay']['back'] = $this->nmgp_botoes['back'] = "off"; $this->NM_ajax_info['buttonDisplay']['forward'] = $this->nmgp_botoes['forward'] = "off"; $this->NM_ajax_info['buttonDisplay']['last'] = $this->nmgp_botoes['last'] = "off"; } $this->nmgp_opcao = "novo"; $this->nm_flag_saida_novo = "S"; $rs->Close(); if ($this->aba_iframe) { $this->NM_ajax_info['buttonDisplay']['exit'] = $this->nmgp_botoes['exit'] = 'off'; } } if ($rs === false && $GLOBALS["NM_ERRO_IBASE"] == 1) { $GLOBALS["NM_ERRO_IBASE"] = 0; $this->Erro->mensagem (__FILE__, __LINE__, "critica", $this->Ini->Nm_lang['lang_errm_nfnd_extr']); $this->nmgp_opcao = "novo"; } if ($this->nmgp_opcao != "novo") { $this->idbanco = $rs->fields[0] ; $this->nmgp_dados_select['idbanco'] = $this->idbanco; $this->tipocuenta = $rs->fields[1] ; $this->nmgp_dados_select['tipocuenta'] = $this->tipocuenta; $this->nombre = $rs->fields[2] ; $this->nmgp_dados_select['nombre'] = $this->nombre; $this->formapago = $rs->fields[3] ; $this->nmgp_dados_select['formapago'] = $this->formapago; $this->ctacontable = $rs->fields[4] ; $this->nmgp_dados_select['ctacontable'] = $this->ctacontable; $this->nrocuenta = $rs->fields[5] ; $this->nmgp_dados_select['nrocuenta'] = $this->nrocuenta; $this->saldoinicial = $rs->fields[6] ; $this->nmgp_dados_select['saldoinicial'] = $this->saldoinicial; $this->otrasentradas = $rs->fields[7] ; $this->nmgp_dados_select['otrasentradas'] = $this->otrasentradas; $this->otrassalidas = $rs->fields[8] ; $this->nmgp_dados_select['otrassalidas'] = $this->otrassalidas; $this->nit = $rs->fields[9] ; $this->nmgp_dados_select['nit'] = $this->nit; $this->idoficina = $rs->fields[10] ; $this->nmgp_dados_select['idoficina'] = $this->idoficina; $this->perfil = $rs->fields[11] ; $this->nmgp_dados_select['perfil'] = $this->perfil; $this->taquilla = $rs->fields[12] ; $this->nmgp_dados_select['taquilla'] = $this->taquilla; $GLOBALS["NM_ERRO_IBASE"] = 0; $this->nm_troca_decimal(",", "."); $this->idbanco = (string)$this->idbanco; $this->saldoinicial = (string)$this->saldoinicial; $this->otrasentradas = (string)$this->otrasentradas; $this->otrassalidas = (string)$this->otrassalidas; $this->idoficina = (string)$this->idoficina; $this->taquilla = (string)$this->taquilla; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['parms'] = "idbanco?#?$this->idbanco?@?"; } $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dados_select'] = $this->nmgp_dados_select; if (!$this->NM_ajax_flag || 'backup_line' != $this->NM_ajax_opcao) { $this->Nav_permite_ret = 0 != $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start']; $this->Nav_permite_ava = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] < $qt_geral_reg_form_bancos; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opcao'] = ''; } } if ($this->nmgp_opcao == "novo" || $this->nmgp_opcao == "refresh_insert") { $this->sc_evento_old = $this->sc_evento; $this->sc_evento = "novo"; if ('refresh_insert' == $this->nmgp_opcao) { $this->nmgp_opcao = 'novo'; } else { $this->nm_formatar_campos(); $this->idbanco = ""; $this->nmgp_dados_form["idbanco"] = $this->idbanco; $this->tipocuenta = ""; $this->nmgp_dados_form["tipocuenta"] = $this->tipocuenta; $this->nombre = ""; $this->nmgp_dados_form["nombre"] = $this->nombre; $this->formapago = ""; $this->nmgp_dados_form["formapago"] = $this->formapago; $this->ctacontable = ""; $this->nmgp_dados_form["ctacontable"] = $this->ctacontable; $this->nrocuenta = ""; $this->nmgp_dados_form["nrocuenta"] = $this->nrocuenta; $this->saldoinicial = ""; $this->nmgp_dados_form["saldoinicial"] = $this->saldoinicial; $this->otrasentradas = ""; $this->nmgp_dados_form["otrasentradas"] = $this->otrasentradas; $this->otrassalidas = ""; $this->nmgp_dados_form["otrassalidas"] = $this->otrassalidas; $this->nit = ""; $this->nmgp_dados_form["nit"] = $this->nit; $this->idoficina = ""; $this->nmgp_dados_form["idoficina"] = $this->idoficina; $this->perfil = ""; $this->nmgp_dados_form["perfil"] = $this->perfil; $this->taquilla = ""; $this->nmgp_dados_form["taquilla"] = $this->taquilla; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dados_form'] = $this->nmgp_dados_form; $this->formatado = false; } if (($this->Embutida_form || $this->Embutida_multi) && isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['foreign_key']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['foreign_key'])) { foreach ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['foreign_key'] as $sFKName => $sFKValue) { if (isset($this->sc_conv_var[$sFKName])) { $sFKName = $this->sc_conv_var[$sFKName]; } eval("\$this->" . $sFKName . " = \"" . $sFKValue . "\";"); } } } // // //-- if ($this->nmgp_opcao != "novo") { } if (!isset($this->nmgp_refresh_fields)) { $this->nm_proc_onload(); } } // //-- function nm_db_retorna($str_where_param = '') { $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; $str_where_filter = ('' != $str_where_param) ? ' and ' . $str_where_param : ''; $_SESSION['scriptcase']['sc_sql_ult_comando'] = "select max(idbanco) from " . $this->Ini->nm_tabela . " where idbanco < $this->idbanco" . $str_where_filter; $rs = $this->Db->Execute("select max(idbanco) from " . $this->Ini->nm_tabela . " where idbanco < $this->idbanco" . $str_where_filter); if ($rs === false && !$rs->EOF && $GLOBALS["NM_ERRO_IBASE"] != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit ; } if (isset($rs->fields[0]) && $rs->fields[0] != "") { $this->idbanco = substr($this->Db->qstr($rs->fields[0]), 1, -1); $rs->Close(); $this->nmgp_opcao = "igual"; return ; } else { $this->nmgp_opcao = "inicio"; $rs->Close(); return ; } } // //-- function nm_db_avanca($str_where_param = '') { $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; $str_where_filter = ('' != $str_where_param) ? ' and ' . $str_where_param : ''; $_SESSION['scriptcase']['sc_sql_ult_comando'] = "select min(idbanco) from " . $this->Ini->nm_tabela . " where idbanco > $this->idbanco" . $str_where_filter; $rs = $this->Db->Execute("select min(idbanco) from " . $this->Ini->nm_tabela . " where idbanco > $this->idbanco" . $str_where_filter); if ($rs === false && !$rs->EOF && $GLOBALS["NM_ERRO_IBASE"] != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit ; } if (isset($rs->fields[0]) && $rs->fields[0] != "") { $this->idbanco = substr($this->Db->qstr($rs->fields[0]), 1, -1); $rs->Close(); $this->nmgp_opcao = "igual"; return ; } else { $this->nmgp_opcao = "final"; $rs->Close(); return ; } } // //-- function nm_db_inicio($str_where_param = '') { $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; $_SESSION['scriptcase']['sc_sql_ult_comando'] = "select count(*) AS countTest from " . $this->Ini->nm_tabela; $rs = $this->Db->Execute("select count(*) AS countTest from " . $this->Ini->nm_tabela); if ($rs === false && !$rs->EOF && $GLOBALS["NM_ERRO_IBASE"] != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit ; } if ($rs->fields[0] == 0) { $this->nmgp_opcao = "novo"; $this->nm_flag_saida_novo = "S"; $rs->Close(); if ($this->aba_iframe) { $this->nmgp_botoes['exit'] = 'off'; } return; } $str_where_filter = ('' != $str_where_param) ? ' where ' . $str_where_param : ''; $_SESSION['scriptcase']['sc_sql_ult_comando'] = "select min(idbanco) from " . $this->Ini->nm_tabela . " " . $str_where_filter; $rs = $this->Db->Execute("select min(idbanco) from " . $this->Ini->nm_tabela . " " . $str_where_filter); if ($rs === false && !$rs->EOF && $GLOBALS["NM_ERRO_IBASE"] != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit ; } if (!isset($rs->fields[0]) || $rs->EOF) { if (!empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter'])) { $rs->Close(); return ; } $this->nm_flag_saida_novo = "S"; $this->nmgp_opcao = "novo"; $rs->Close(); if ($this->aba_iframe) { $this->nmgp_botoes['exit'] = 'off'; } return ; } $this->idbanco = substr($this->Db->qstr($rs->fields[0]), 1, -1); $rs->Close(); $this->nmgp_opcao = "igual"; return ; } // //-- function nm_db_final($str_where_param = '') { $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; $str_where_filter = ('' != $str_where_param) ? ' where ' . $str_where_param : ''; $_SESSION['scriptcase']['sc_sql_ult_comando'] = "select max(idbanco) from " . $this->Ini->nm_tabela . " " . $str_where_filter; $rs = $this->Db->Execute("select max(idbanco) from " . $this->Ini->nm_tabela . " " . $str_where_filter); if ($rs === false && !$rs->EOF && $GLOBALS["NM_ERRO_IBASE"] != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit ; } if (!isset($rs->fields[0]) || $rs->EOF) { $this->nm_flag_saida_novo = "S"; $this->nmgp_opcao = "novo"; $rs->Close(); if ($this->aba_iframe) { $this->nmgp_botoes['exit'] = 'off'; } return ; } $this->idbanco = substr($this->Db->qstr($rs->fields[0]), 1, -1); $rs->Close(); $this->nmgp_opcao = "igual"; return ; } function NM_gera_nav_page() { $this->SC_nav_page = ""; $Arr_result = array(); $Ind_result = 0; $Reg_Page = 1; $Max_link = 5; $Mid_link = ceil($Max_link / 2); $Corr_link = (($Max_link % 2) == 0) ? 0 : 1; $rec_tot = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total'] + 1; $rec_fim = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] + 1; $rec_fim = ($rec_fim > $rec_tot) ? $rec_tot : $rec_fim; if ($rec_tot == 0) { return; } $Qtd_Pages = ceil($rec_tot / $Reg_Page); $Page_Atu = ceil($rec_fim / $Reg_Page); $Link_ini = 1; if ($Page_Atu > $Max_link) { $Link_ini = $Page_Atu - $Mid_link + $Corr_link; } elseif ($Page_Atu > $Mid_link) { $Link_ini = $Page_Atu - $Mid_link + $Corr_link; } if (($Qtd_Pages - $Link_ini) < $Max_link) { $Link_ini = ($Qtd_Pages - $Max_link) + 1; } if ($Link_ini < 1) { $Link_ini = 1; } for ($x = 0; $x < $Max_link && $Link_ini <= $Qtd_Pages; $x++) { $rec = (($Link_ini - 1) * $Reg_Page) + 1; if ($Link_ini == $Page_Atu) { $Arr_result[$Ind_result] = '' . $Link_ini . ''; } else { $Arr_result[$Ind_result] = '' . $Link_ini . ''; } $Link_ini++; $Ind_result++; if (!isset($this->Ini->Str_toolbarnav_separator)) { $this->Ini->Str_toolbarnav_separator = ""; } if (($x + 1) < $Max_link && $Link_ini <= $Qtd_Pages && '' != $this->Ini->Str_toolbarnav_separator && @is_file($this->Ini->root . $this->Ini->path_img_global . $this->Ini->Str_toolbarnav_separator)) { $Arr_result[$Ind_result] = ''; $Ind_result++; } } if ($_SESSION['scriptcase']['reg_conf']['css_dir'] == "RTL") { krsort($Arr_result); } foreach ($Arr_result as $Ind_result => $Lin_result) { $this->SC_nav_page .= $Lin_result; } } function initializeRecordState() { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state'] = array(); } function storeRecordState($sc_seq_vert = 0) { if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state'])) { $this->initializeRecordState(); } if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state'][$sc_seq_vert])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state'][$sc_seq_vert] = array(); } $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state'][$sc_seq_vert]['buttons'] = array( 'delete' => $this->nmgp_botoes['delete'], 'update' => $this->nmgp_botoes['update'] ); } function loadRecordState($sc_seq_vert = 0) { if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state']) || !isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state'][$sc_seq_vert])) { return; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state'][$sc_seq_vert]['buttons']['delete'])) { $this->nmgp_botoes['delete'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state'][$sc_seq_vert]['buttons']['delete']; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state'][$sc_seq_vert]['buttons']['update'])) { $this->nmgp_botoes['update'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['record_state'][$sc_seq_vert]['buttons']['update']; } } // function nm_gera_html() { global $nm_url_saida, $nmgp_url_saida, $nm_saida_global, $nm_apl_dependente, $glo_subst, $sc_check_excl, $sc_check_incl, $nmgp_num_form, $NM_run_iframe; if ($this->Embutida_proc) { return; } if ($this->nmgp_form_show == 'off') { exit; } if (isset($NM_run_iframe) && $NM_run_iframe == 1) { $this->nmgp_botoes['exit'] = "off"; } $HTTP_REFERER = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : ""; $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['botoes'] = $this->nmgp_botoes; if ($this->nmgp_opcao != "recarga" && $this->nmgp_opcao != "muda_form") { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opc_ant'] = $this->nmgp_opcao; } else { $this->nmgp_opcao = $this->nmgp_opc_ant; } if (!empty($this->Campos_Mens_erro)) { $this->Erro->mensagem(__FILE__, __LINE__, "critica", $this->Campos_Mens_erro); $this->Campos_Mens_erro = ""; } if (($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "F" || $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "R") && $this->nm_flag_iframe && empty($this->nm_todas_criticas)) { if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe_ajax'])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['retorno_edit'] = array("edit", ""); } else { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['retorno_edit'] .= "&nmgp_opcao=edit"; } if ($this->sc_evento == "insert" && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] == "F") { if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe_ajax'])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['retorno_edit'] = array("edit", "fim"); } else { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['retorno_edit'] .= "&rec=fim"; } } $this->NM_close_db(); $sJsParent = ''; if ($this->NM_ajax_flag && isset($this->NM_ajax_info['param']['buffer_output']) && $this->NM_ajax_info['param']['buffer_output']) { if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe_ajax'])) { $this->NM_ajax_info['ajaxJavascript'][] = array("parent.ajax_navigate", $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['retorno_edit']); } else { $sJsParent .= 'parent'; $this->NM_ajax_info['redir']['metodo'] = 'location'; $this->NM_ajax_info['redir']['action'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['retorno_edit']; $this->NM_ajax_info['redir']['target'] = $sJsParent; } form_bancos_pack_ajax_response(); exit; } ?> initFormPages(); include_once("form_bancos_form0.php"); $this->hideFormPages(); } function initFormPages() { } // initFormPages function hideFormPages() { } // hideFormPages function form_format_readonly($field, $value) { $result = $value; $this->form_highlight_search($result, $field, $value); return $result; } function form_highlight_search(&$result, $field, $value) { if ($this->proc_fast_search) { $this->form_highlight_search_quicksearch($result, $field, $value); } } function form_highlight_search_quicksearch(&$result, $field, $value) { $searchOk = false; if ('SC_all_Cmp' == $this->nmgp_fast_search && in_array($field, array("idbanco", "tipocuenta", "nombre", "formapago", "ctacontable", "nrocuenta", "saldoinicial", "otrasentradas", "otrassalidas", "nit", "idoficina", "perfil", "taquilla"))) { $searchOk = true; } elseif ($field == $this->nmgp_fast_search && in_array($field, array(""))) { $searchOk = true; } if (!$searchOk || '' == $this->nmgp_arg_fast_search) { return; } $htmlIni = '
'; $htmlFim = '
'; if ('qp' == $this->nmgp_cond_fast_search) { $keywords = preg_quote($this->nmgp_arg_fast_search, '/'); $result = preg_replace('/'. $keywords .'/i', $htmlIni . '$0' . $htmlFim, $result); } elseif ('eq' == $this->nmgp_cond_fast_search) { if (strcasecmp($this->nmgp_arg_fast_search, $value) == 0) { $result = $htmlIni. $result .$htmlFim; } } } function form_encode_input($string) { if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['table_refresh']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['table_refresh']) { return NM_encode_input(NM_encode_input($string)); } else { return NM_encode_input($string); } } // form_encode_input function scCsrfGetToken() { if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['csrf_token'])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['csrf_token'] = $this->scCsrfGenerateToken(); } return $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['csrf_token']; } function scCsrfGenerateToken() { $aSources = array( 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '1234567890', '!@$*()-_[]{},.;:' ); $sRandom = ''; $aSourcesSizes = array(); $iSourceSize = sizeof($aSources) - 1; for ($i = 0; $i <= $iSourceSize; $i++) { $aSourcesSizes[$i] = strlen($aSources[$i]) - 1; } for ($i = 0; $i < 64; $i++) { $iSource = $this->scCsrfRandom(0, $iSourceSize); $sRandom .= substr($aSources[$iSource], $this->scCsrfRandom(0, $aSourcesSizes[$iSource]), 1); } return $sRandom; } function scCsrfRandom($iMin, $iMax) { return mt_rand($iMin, $iMax); } function addUrlParam($url, $param, $value) { $urlParts = explode('?', $url); $urlParams = isset($urlParts[1]) ? explode('&', $urlParts[1]) : array(); $objParams = array(); foreach ($urlParams as $paramInfo) { $paramParts = explode('=', $paramInfo); $objParams[ $paramParts[0] ] = isset($paramParts[1]) ? $paramParts[1] : ''; } $objParams[$param] = $value; $urlParams = array(); foreach ($objParams as $paramName => $paramValue) { $urlParams[] = $paramName . '=' . $paramValue; } return $urlParts[0] . '?' . implode('&', $urlParams); } function allowedCharsCharset($charlist) { if ($_SESSION['scriptcase']['charset'] != 'UTF-8') { $charlist = NM_conv_charset($charlist, $_SESSION['scriptcase']['charset'], 'UTF-8'); } return str_replace("'", "\'", $charlist); } function sc_file_size($file, $format = false) { if ('' == $file) { return ''; } if (!@is_file($file)) { return ''; } $fileSize = @filesize($file); if ($format) { $suffix = ''; if (1024 >= $fileSize) { $fileSize /= 1024; $suffix = ' KB'; } if (1024 >= $fileSize) { $fileSize /= 1024; $suffix = ' MB'; } if (1024 >= $fileSize) { $fileSize /= 1024; $suffix = ' GB'; } $fileSize = $fileSize . $suffix; } return $fileSize; } function new_date_format($type, $field) { $new_date_format_out = ''; if ('DT' == $type) { $date_format = $this->field_config[$field]['date_format']; $date_sep = $this->field_config[$field]['date_sep']; $date_display = $this->field_config[$field]['date_display']; $time_format = ''; $time_sep = ''; $time_display = ''; } elseif ('DH' == $type) { $date_format = false !== strpos($this->field_config[$field]['date_format'] , ';') ? substr($this->field_config[$field]['date_format'] , 0, strpos($this->field_config[$field]['date_format'] , ';')) : $this->field_config[$field]['date_format']; $date_sep = $this->field_config[$field]['date_sep']; $date_display = false !== strpos($this->field_config[$field]['date_display'], ';') ? substr($this->field_config[$field]['date_display'], 0, strpos($this->field_config[$field]['date_display'], ';')) : $this->field_config[$field]['date_display']; $time_format = false !== strpos($this->field_config[$field]['date_format'] , ';') ? substr($this->field_config[$field]['date_format'] , strpos($this->field_config[$field]['date_format'] , ';') + 1) : ''; $time_sep = $this->field_config[$field]['time_sep']; $time_display = false !== strpos($this->field_config[$field]['date_display'], ';') ? substr($this->field_config[$field]['date_display'], strpos($this->field_config[$field]['date_display'], ';') + 1) : ''; } elseif ('HH' == $type) { $date_format = ''; $date_sep = ''; $date_display = ''; $time_format = $this->field_config[$field]['date_format']; $time_sep = $this->field_config[$field]['time_sep']; $time_display = $this->field_config[$field]['date_display']; } if ('DT' == $type || 'DH' == $type) { $date_array = array(); $date_index = 0; $date_ult = ''; for ($i = 0; $i < strlen($date_format); $i++) { $char = strtolower(substr($date_format, $i, 1)); if (in_array($char, array('d', 'm', 'y', 'a'))) { if ('a' == $char) { $char = 'y'; } if ($char == $date_ult) { $date_array[$date_index] .= $char; } else { if ('' != $date_ult) { $date_index++; } $date_array[$date_index] = $char; } } $date_ult = $char; } $disp_array = array(); $date_index = 0; $date_ult = ''; for ($i = 0; $i < strlen($date_display); $i++) { $char = strtolower(substr($date_display, $i, 1)); if (in_array($char, array('d', 'm', 'y', 'a'))) { if ('a' == $char) { $char = 'y'; } if ($char == $date_ult) { $disp_array[$date_index] .= $char; } else { if ('' != $date_ult) { $date_index++; } $disp_array[$date_index] = $char; } } $date_ult = $char; } $date_final = array(); foreach ($date_array as $date_part) { if (in_array($date_part, $disp_array)) { $date_final[] = $date_part; } } $date_format = implode($date_sep, $date_final); } if ('HH' == $type || 'DH' == $type) { $time_array = array(); $time_index = 0; $time_ult = ''; for ($i = 0; $i < strlen($time_format); $i++) { $char = strtolower(substr($time_format, $i, 1)); if (in_array($char, array('h', 'i', 's'))) { if ($char == $time_ult) { $time_array[$time_index] .= $char; } else { if ('' != $time_ult) { $time_index++; } $time_array[$time_index] = $char; } } $time_ult = $char; } $disp_array = array(); $time_index = 0; $time_ult = ''; for ($i = 0; $i < strlen($time_display); $i++) { $char = strtolower(substr($time_display, $i, 1)); if (in_array($char, array('h', 'i', 's'))) { if ($char == $time_ult) { $disp_array[$time_index] .= $char; } else { if ('' != $time_ult) { $time_index++; } $disp_array[$time_index] = $char; } } $time_ult = $char; } $time_final = array(); foreach ($time_array as $time_part) { if (in_array($time_part, $disp_array)) { $time_final[] = $time_part; } } $time_format = implode($time_sep, $time_final); } if ('DT' == $type) { $old_date_format = $date_format; } elseif ('DH' == $type) { $old_date_format = $date_format . ';' . $time_format; } elseif ('HH' == $type) { $old_date_format = $time_format; } for ($i = 0; $i < strlen($old_date_format); $i++) { $char = substr($old_date_format, $i, 1); if ('/' == $char) { $new_date_format_out .= $date_sep; } elseif (':' == $char) { $new_date_format_out .= $time_sep; } else { $new_date_format_out .= $char; } } $this->field_config[$field]['date_format'] = $new_date_format_out; if ('DH' == $type) { $new_date_format_out = explode(';', $new_date_format_out); $this->field_config[$field]['date_format_js'] = $new_date_format_out[0]; $this->field_config[$field . '_hora']['date_format'] = $new_date_format_out[1]; $this->field_config[$field . '_hora']['time_sep'] = $this->field_config[$field]['time_sep']; } } // new_date_format function Form_lookup_tipocuenta() { $nmgp_def_dados = ""; $nmgp_def_dados .= "AHORROS?#?AHORROS?#?N?@?"; $nmgp_def_dados .= "CORRIENTE?#?CORRIENTE?#?N?@?"; $nmgp_def_dados .= "CAJA?#?EFECTIVO?#?N?@?"; $todo = explode("?@?", $nmgp_def_dados); return $todo; } function Form_lookup_formapago() { $nmgp_def_dados = ""; $nmgp_def_dados .= "EFECTIVO?#?EFECTIVO?#?N?@?"; $nmgp_def_dados .= "TRANSFERENCIA?#?TRANSFERENCIA?#?N?@?"; $nmgp_def_dados .= "CONSIGNACION?#?CONSIGNACION?#?N?@?"; $nmgp_def_dados .= "TARJETA DEBITO?#?TARJETA DEBITO?#?N?@?"; $nmgp_def_dados .= "TARJETA CREDITO?#?TARJETA CREDITO?#?N?@?"; $nmgp_def_dados .= "CODIGO QR?#?CODIGO QR?#?N?@?"; $nmgp_def_dados .= "ANTICIPO VIAJE?#?ANTICIPO VIAJE?#?N?@?"; $todo = explode("?@?", $nmgp_def_dados); return $todo; } function Form_lookup_idoficina() { $nmgp_def_dados = "" ; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'] = array_unique($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina']); } else { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'] = array(); } $nm_nao_carga = false; $nmgp_def_dados = "" ; if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'] = array_unique($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina']); } else { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'] = array(); } $nm_comando = "SELECT Idoficina, nomoficina FROM oficinas ORDER BY nomoficina"; $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_comando; $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; if ($nm_comando != "" && $rs = $this->Db->Execute($nm_comando)) { while (!$rs->EOF) { $rs->fields[0] = str_replace(',', '.', $rs->fields[0]); $rs->fields[0] = (strpos(strtolower($rs->fields[0]), "e")) ? (float)$rs->fields[0] : $rs->fields[0]; $rs->fields[0] = (string)$rs->fields[0]; $nmgp_def_dados .= $rs->fields[1] . "?#?" ; $nmgp_def_dados .= $rs->fields[0] . "?#?N?@?" ; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['Lookup_idoficina'][] = $rs->fields[0]; $rs->MoveNext() ; } $rs->Close() ; } elseif ($GLOBALS["NM_ERRO_IBASE"] != 1 && $nm_comando != "") { $this->Erro->mensagem(__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit; } $GLOBALS["NM_ERRO_IBASE"] = 0; $todox = str_replace("?#?@?#?", "?#?@ ?#?", trim($nmgp_def_dados)) ; $todo = explode("?@?", $todox) ; return $todo; } function Form_lookup_perfil() { $nmgp_def_dados = ""; $nmgp_def_dados .= "A?#?A?#?N?@?"; $nmgp_def_dados .= "B?#?B?#?N?@?"; $nmgp_def_dados .= "C?#?C?#?N?@?"; $todo = explode("?@?", $nmgp_def_dados); return $todo; } function Form_lookup_taquilla() { $nmgp_def_dados = ""; $nmgp_def_dados .= "SI?#?1?#?N?@?"; $nmgp_def_dados .= "NO?#?0?#?N?@?"; $todo = explode("?@?", $nmgp_def_dados); return $todo; } function SC_fast_search($in_fields, $arg_search, $data_search) { $fields = (strpos($in_fields, "SC_all_Cmp") !== false) ? array("SC_all_Cmp") : explode(";", $in_fields); $this->NM_case_insensitive = false; if (empty($data_search)) { unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dyn_search_and_or']); unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dyn_search_cache']); unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter']); unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total']); unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['fast_search']); if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_detal']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_detal'])) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter'] = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_detal']; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['empty_filter']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['empty_filter']) { unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['empty_filter']); $this->NM_ajax_info['empty_filter'] = 'ok'; form_bancos_pack_ajax_response(); exit; } return; } $comando = ""; if ($_SESSION['scriptcase']['charset'] != "UTF-8" && NM_is_utf8($data_search)) { $data_search = NM_conv_charset($data_search, $_SESSION['scriptcase']['charset'], "UTF-8"); } $sv_data = $data_search; foreach ($fields as $field) { if ($field == "SC_all_Cmp") { $this->SC_monta_condicao($comando, "idbanco", $arg_search, str_replace(",", ".", $data_search), "INT", false); } if ($field == "SC_all_Cmp") { $data_lookup = $this->SC_lookup_tipocuenta($arg_search, $data_search); if (is_array($data_lookup) && !empty($data_lookup)) { $this->SC_monta_condicao($comando, "tipocuenta", $arg_search, $data_lookup, "VARCHAR", false); } } if ($field == "SC_all_Cmp") { $this->SC_monta_condicao($comando, "nombre", $arg_search, $data_search, "VARCHAR", false); } if ($field == "SC_all_Cmp") { $data_lookup = $this->SC_lookup_formapago($arg_search, $data_search); if (is_array($data_lookup) && !empty($data_lookup)) { $this->SC_monta_condicao($comando, "formapago", $arg_search, $data_lookup, "VARCHAR", false); } } if ($field == "SC_all_Cmp") { $this->SC_monta_condicao($comando, "ctacontable", $arg_search, $data_search, "VARCHAR", false); } if ($field == "SC_all_Cmp") { $this->SC_monta_condicao($comando, "nrocuenta", $arg_search, $data_search, "VARCHAR", false); } if ($field == "SC_all_Cmp") { $this->SC_monta_condicao($comando, "saldoinicial", $arg_search, str_replace(",", ".", $data_search), "DECIMAL", false); } if ($field == "SC_all_Cmp") { $this->SC_monta_condicao($comando, "otrasentradas", $arg_search, str_replace(",", ".", $data_search), "DECIMAL", false); } if ($field == "SC_all_Cmp") { $this->SC_monta_condicao($comando, "otrassalidas", $arg_search, str_replace(",", ".", $data_search), "DECIMAL", false); } if ($field == "SC_all_Cmp") { $this->SC_monta_condicao($comando, "nit", $arg_search, $data_search, "VARCHAR", false); } if ($field == "SC_all_Cmp") { $data_lookup = $this->SC_lookup_idoficina($arg_search, $data_search); if (is_array($data_lookup) && !empty($data_lookup)) { $this->SC_monta_condicao($comando, "idoficina", $arg_search, $data_lookup, "SMALLINT", false); } } if ($field == "SC_all_Cmp") { $data_lookup = $this->SC_lookup_perfil($arg_search, $data_search); if (is_array($data_lookup) && !empty($data_lookup)) { $this->SC_monta_condicao($comando, "perfil", $arg_search, $data_lookup, "VARCHAR", false); } } if ($field == "SC_all_Cmp") { $data_lookup = $this->SC_lookup_taquilla($arg_search, $data_search); if (is_array($data_lookup) && !empty($data_lookup)) { $this->SC_monta_condicao($comando, "taquilla", $arg_search, $data_lookup, "INT", false); } } } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_detal']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_detal']) && !empty($comando)) { $comando = $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_detal'] . " and (" . $comando . ")"; } if (empty($comando)) { $comando = " 1 <> 1 "; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter_form']) && '' != $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter_form']) { $sc_where = " where " . $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter_form'] . " and (" . $comando . ")"; } else { $sc_where = " where " . $comando; } $nmgp_select = "SELECT count(*) AS countTest from " . $this->Ini->nm_tabela . $sc_where; $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nmgp_select; $rt = $this->Db->Execute($nmgp_select) ; if ($rt === false && !$rt->EOF && $GLOBALS["NM_ERRO_IBASE"] != 1) { $this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit ; } $qt_geral_reg_form_bancos = isset($rt->fields[0]) ? $rt->fields[0] - 1 : 0; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total'] = $qt_geral_reg_form_bancos; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['where_filter'] = $comando; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['fast_search'][0] = $field; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['fast_search'][1] = $arg_search; $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['fast_search'][2] = $sv_data; $rt->Close(); if (isset($rt->fields[0]) && $rt->fields[0] > 0 && isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['empty_filter']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['empty_filter']) { unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['empty_filter']); $this->NM_ajax_info['empty_filter'] = 'ok'; form_bancos_pack_ajax_response(); exit; } elseif (!isset($rt->fields[0]) || $rt->fields[0] == 0) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['empty_filter'] = true; $this->NM_ajax_info['empty_filter'] = 'ok'; form_bancos_pack_ajax_response(); exit; } } function SC_monta_condicao(&$comando, $nome, $condicao, $campo, $tp_campo="", $tp_unaccent=false) { $nm_aspas = "'"; $nm_aspas1 = "'"; $nm_numeric = array(); $Nm_datas = array(); $campo_join = strtolower(str_replace(".", "_", $nome)); $nm_ini_lower = ""; $nm_fim_lower = ""; $Nm_accent = $this->Ini->Nm_accent_no; if ($tp_unaccent) { $Nm_accent = $this->Ini->Nm_accent_yes; } $nm_numeric[] = "idbanco";$nm_numeric[] = "saldoinicial";$nm_numeric[] = "otrasentradas";$nm_numeric[] = "otrassalidas";$nm_numeric[] = "idoficina";$nm_numeric[] = "taquilla"; if (in_array($campo_join, $nm_numeric)) { if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['decimal_db'] == ".") { $nm_aspas = ""; $nm_aspas1 = ""; } if (is_array($campo)) { foreach ($campo as $Ind => $Cmp) { if (!is_numeric($Cmp)) { return; } if ($Cmp == "") { $campo[$Ind] = 0; } } } else { if (!is_numeric($campo)) { return; } if ($campo == "") { $campo = 0; } } } if (is_array($campo)) { foreach ($campo as $Ind => $Cmp) { if ($Cmp != null) { $campo[$Ind] = substr($this->Ini->Db->qstr($Cmp), 1, -1); } } } else { $campo = substr($this->Ini->Db->qstr($campo), 1, -1); } $comando .= (!empty($comando) ? " or " : ""); if (is_array($campo)) { $prep = ""; foreach ($campo as $Ind => $Cmp) { $prep .= (!empty($prep)) ? "," : ""; $Cmp = substr($this->Db->qstr($Cmp), 1, -1); $prep .= $nm_ini_lower . $nm_aspas . $Cmp . $nm_aspas1 . $nm_fim_lower; } $prep .= (empty($prep)) ? $nm_aspas . $nm_aspas1 : ""; $comando .= $nm_ini_lower . $nome . $nm_fim_lower . " in (" . $prep . ")"; return; } $campo = substr($this->Db->qstr($campo), 1, -1); $cond_tst = strtoupper($condicao); if ($cond_tst == "II" || $cond_tst == "QP" || $cond_tst == "NP") { $op_like = " like "; } switch ($cond_tst) { case "EQ": // $comando .= $nm_ini_lower . $nome . $nm_fim_lower . " = " . $nm_ini_lower . $nm_aspas . $campo . $nm_aspas1 . $nm_fim_lower; break; case "II": // $comando .= $nm_ini_lower . $Nm_accent['cmp_i'] . $nome . $Nm_accent['cmp_f'] . $nm_fim_lower . $Nm_accent['cmp_apos'] . $op_like . $nm_ini_lower . "'" . $Nm_accent['arg_i'] . sc_sql_escape($this->Ini->nm_tpbanco, $campo) . $Nm_accent['arg_f'] . "%'" . $nm_fim_lower . $Nm_accent['arg_apos'] . $_SESSION['sc_session']['sc_sql_escape']; break; case "QP": // $comando .= $nm_ini_lower . $Nm_accent['cmp_i'] . $nome . $Nm_accent['cmp_f'] . $nm_fim_lower . $Nm_accent['cmp_apos'] . $op_like . $nm_ini_lower . "'%" . $Nm_accent['arg_i'] . sc_sql_escape($this->Ini->nm_tpbanco, $campo) . $Nm_accent['arg_f'] . "%'" . $nm_fim_lower . $Nm_accent['arg_apos'] . $_SESSION['sc_session']['sc_sql_escape']; break; case "NP": // $comando .= $nm_ini_lower . $Nm_accent['cmp_i'] . $nome . $Nm_accent['cmp_f'] . $nm_fim_lower . $Nm_accent['cmp_apos'] . " not" . $op_like . $nm_ini_lower . "'%" . $Nm_accent['arg_i'] . sc_sql_escape($this->Ini->nm_tpbanco, $campo) . $Nm_accent['arg_f'] . "%'" . $nm_fim_lower . $Nm_accent['arg_apos'] . $_SESSION['sc_session']['sc_sql_escape']; break; case "DF": // $comando .= $nm_ini_lower . $nome . $nm_fim_lower . " <> " . $nm_ini_lower . $nm_aspas . $campo . $nm_aspas1 . $nm_fim_lower; break; case "GT": // $comando .= $nm_ini_lower . $nome . $nm_fim_lower . " > " . $nm_ini_lower . $nm_aspas . $campo . $nm_aspas1 . $nm_fim_lower; break; case "GE": // $comando .= $nm_ini_lower . $nome . $nm_fim_lower . " >= " . $nm_ini_lower . $nm_aspas . $campo . $nm_aspas1 . $nm_fim_lower; break; case "LT": // $comando .= $nm_ini_lower . $nome . $nm_fim_lower . " < " . $nm_ini_lower . $nm_aspas . $campo . $nm_aspas1 . $nm_fim_lower; break; case "LE": // $comando .= $nm_ini_lower . $nome . $nm_fim_lower . " <= " . $nm_ini_lower . $nm_aspas . $campo . $nm_aspas1 . $nm_fim_lower; break; } } function SC_lookup_tipocuenta($condicao, $campo) { $data_look = array(); $campo = substr($this->Db->qstr($campo), 1, -1); $data_look['AHORROS'] = "AHORROS"; $data_look['CORRIENTE'] = "CORRIENTE"; $data_look['EFECTIVO'] = "CAJA"; $result = array(); foreach ($data_look as $chave => $label) { if ($condicao == "eq" && $campo == $label) { $result[] = $chave; } if ($condicao == "ii" && $campo == substr($label, 0, strlen($campo))) { $result[] = $chave; } if ($condicao == "qp" && strstr($label, $campo)) { $result[] = $chave; } if ($condicao == "np" && !strstr($label, $campo)) { $result[] = $chave; } if ($condicao == "df" && $campo != $label) { $result[] = $chave; } if ($condicao == "gt" && $label > $campo ) { $result[] = $chave; } if ($condicao == "ge" && $label >= $campo) { $result[] = $chave; } if ($condicao == "lt" && $label < $campo) { $result[] = $chave; } if ($condicao == "le" && $label <= $campo) { $result[] = $chave; } } return $result; } function SC_lookup_formapago($condicao, $campo) { $data_look = array(); $campo = substr($this->Db->qstr($campo), 1, -1); $data_look['EFECTIVO'] = "EFECTIVO"; $data_look['TRANSFERENCIA'] = "TRANSFERENCIA"; $data_look['CONSIGNACION'] = "CONSIGNACION"; $data_look['TARJETA DEBITO'] = "TARJETA DEBITO"; $data_look['TARJETA CREDITO'] = "TARJETA CREDITO"; $data_look['CODIGO QR'] = "CODIGO QR"; $data_look['ANTICIPO VIAJE'] = "ANTICIPO VIAJE"; $result = array(); foreach ($data_look as $chave => $label) { if ($condicao == "eq" && $campo == $label) { $result[] = $chave; } if ($condicao == "ii" && $campo == substr($label, 0, strlen($campo))) { $result[] = $chave; } if ($condicao == "qp" && strstr($label, $campo)) { $result[] = $chave; } if ($condicao == "np" && !strstr($label, $campo)) { $result[] = $chave; } if ($condicao == "df" && $campo != $label) { $result[] = $chave; } if ($condicao == "gt" && $label > $campo ) { $result[] = $chave; } if ($condicao == "ge" && $label >= $campo) { $result[] = $chave; } if ($condicao == "lt" && $label < $campo) { $result[] = $chave; } if ($condicao == "le" && $label <= $campo) { $result[] = $chave; } } return $result; } function SC_lookup_idoficina($condicao, $campo) { $result = array(); $campo_orig = $campo; $campo = substr($this->Db->qstr($campo), 1, -1); $nm_comando = "SELECT nomoficina, Idoficina FROM oficinas WHERE (#cmp_inomoficina#cmp_f#cmp_apos LIKE '%#arg_i" . $campo . "#arg_f%'#arg_apos)" ; if ($condicao == "ii") { $nm_comando = str_replace("LIKE '%#arg_i" . $campo . "#arg_f%'", "LIKE '#arg_i" . $campo . "#arg_f%'", $nm_comando); } if ($condicao == "np") { $nm_comando = str_replace("LIKE '%#arg_i" . $campo . "#arg_f%'", "NOT LIKE '%#arg_i" . $campo . "#arg_f%'", $nm_comando); } if ($condicao == "df") { $nm_comando = str_replace("LIKE '%#arg_i" . $campo . "#arg_f%'", "<> '#arg_i" . $campo . "#arg_f'", $nm_comando); } if ($condicao == "gt") { $nm_comando = str_replace("LIKE '%#arg_i" . $campo . "#arg_f%'", "> '#arg_i" . $campo . "#arg_f'", $nm_comando); } if ($condicao == "ge") { $nm_comando = str_replace("LIKE '%#arg_i" . $campo . "#arg_f%'", ">= '#arg_i" . $campo . "#arg_f'", $nm_comando); } if ($condicao == "lt") { $nm_comando = str_replace("LIKE '%#arg_i" . $campo . "#arg_f%'", "< '#arg_i" . $campo . "#arg_f'", $nm_comando); } if ($condicao == "le") { $nm_comando = str_replace("LIKE '%#arg_i" . $campo . "#arg_f%'", "<= '#arg_i" . $campo . "#arg_f'", $nm_comando); } $nm_comando = str_replace(array('#cmp_i','#cmp_f','#cmp_apos','#arg_i','#arg_f','#arg_apos'), array('','','','','',''), $nm_comando); $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_comando; $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; if ($rx = $this->Db->Execute($nm_comando)) { $campo = $campo_orig; while (!$rx->EOF) { $chave = $rx->fields[1]; $label = $rx->fields[0]; if ($condicao == "eq" && $campo == $label) { $result[] = $chave; } if ($condicao == "ii" && $campo == substr($label, 0, strlen($campo))) { $result[] = $chave; } if ($condicao == "qp" && strstr($label, $campo)) { $result[] = $chave; } if ($condicao == "np" && !strstr($label, $campo)) { $result[] = $chave; } if ($condicao == "df" && $campo != $label) { $result[] = $chave; } if ($condicao == "gt" && $label > $campo ) { $result[] = $chave; } if ($condicao == "ge" && $label >= $campo) { $result[] = $chave; } if ($condicao == "lt" && $label < $campo) { $result[] = $chave; } if ($condicao == "le" && $label <= $campo) { $result[] = $chave; } $rx->MoveNext() ; } return $result; } elseif ($GLOBALS["NM_ERRO_IBASE"] != 1) { $this->Erro->mensagem(__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg()); exit; } } function SC_lookup_perfil($condicao, $campo) { $data_look = array(); $campo = substr($this->Db->qstr($campo), 1, -1); $data_look['A'] = "A"; $data_look['B'] = "B"; $data_look['C'] = "C"; $result = array(); foreach ($data_look as $chave => $label) { if ($condicao == "eq" && $campo == $label) { $result[] = $chave; } if ($condicao == "ii" && $campo == substr($label, 0, strlen($campo))) { $result[] = $chave; } if ($condicao == "qp" && strstr($label, $campo)) { $result[] = $chave; } if ($condicao == "np" && !strstr($label, $campo)) { $result[] = $chave; } if ($condicao == "df" && $campo != $label) { $result[] = $chave; } if ($condicao == "gt" && $label > $campo ) { $result[] = $chave; } if ($condicao == "ge" && $label >= $campo) { $result[] = $chave; } if ($condicao == "lt" && $label < $campo) { $result[] = $chave; } if ($condicao == "le" && $label <= $campo) { $result[] = $chave; } } return $result; } function SC_lookup_taquilla($condicao, $campo) { $data_look = array(); $campo = substr($this->Db->qstr($campo), 1, -1); $data_look['1'] = "SI"; $data_look['0'] = "NO"; $result = array(); foreach ($data_look as $chave => $label) { if ($condicao == "eq" && $campo == $label) { $result[] = $chave; } if ($condicao == "ii" && $campo == substr($label, 0, strlen($campo))) { $result[] = $chave; } if ($condicao == "qp" && strstr($label, $campo)) { $result[] = $chave; } if ($condicao == "np" && !strstr($label, $campo)) { $result[] = $chave; } if ($condicao == "df" && $campo != $label) { $result[] = $chave; } if ($condicao == "gt" && $label > $campo ) { $result[] = $chave; } if ($condicao == "ge" && $label >= $campo) { $result[] = $chave; } if ($condicao == "lt" && $label < $campo) { $result[] = $chave; } if ($condicao == "le" && $label <= $campo) { $result[] = $chave; } } return $result; } function nmgp_redireciona($tipo=0) { global $nm_apl_dependente; if (isset($_SESSION['scriptcase']['nm_sc_retorno']) && !empty($_SESSION['scriptcase']['nm_sc_retorno']) && $_SESSION['scriptcase']['sc_tp_saida'] != "D" && $nm_apl_dependente != 1) { $nmgp_saida_form = $_SESSION['scriptcase']['nm_sc_retorno']; } else { $nmgp_saida_form = $_SESSION['scriptcase']['sc_url_saida'][$this->Ini->sc_page]; } if ($tipo == 2) { $nmgp_saida_form = "form_bancos_fim.php"; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['redir']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['redir'] == 'redir') { unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']); } unset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['opc_ant']); if ($tipo == 2 && isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['nm_run_menu']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['nm_run_menu'] == 1) { $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['nm_run_menu'] = 2; $nmgp_saida_form = "form_bancos_fim.php"; } $diretorio = explode("/", $nmgp_saida_form); $cont = count($diretorio); $apl = $diretorio[$cont - 1]; $apl = str_replace(".php", "", $apl); $pos = strpos($apl, "?"); if ($pos !== false) { $apl = substr($apl, 0, $pos); } if ($tipo != 1 && $tipo != 2) { unset($_SESSION['sc_session'][$this->Ini->sc_page][$apl]['where_orig']); } if ($this->NM_ajax_flag) { $sTarget = '_self'; $this->NM_ajax_info['redir']['metodo'] = 'post'; $this->NM_ajax_info['redir']['action'] = $nmgp_saida_form; $this->NM_ajax_info['redir']['target'] = $sTarget; $this->NM_ajax_info['redir']['script_case_init'] = $this->Ini->sc_page; if (0 == $tipo) { $this->NM_ajax_info['redir']['nmgp_url_saida'] = $this->nm_location; } form_bancos_pack_ajax_response(); exit; } ?> GMT"/>
Embutida_call) { return; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['mostra_cab']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['mostra_cab'] == "N") { return; } if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dashboard_info']['under_dashboard'] && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dashboard_info']['compact_mode'] && !$_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['dashboard_info']['maximized']) { return; } if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['link_info']['compact_mode']) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['link_info']['compact_mode']) { return; } ?>
nmgp_opcao == "novo") { echo "ACTUALIZA DATOS DE CAJA Y BANCOS"; } else { echo "ACTUALIZA DATOS DE CAJA Y BANCOS"; } ?>
dateDefaultFormat()); ?>
Embutida_form || !$this->Embutida_call || $this->Grid_editavel || $this->Embutida_multi || ($this->Embutida_call && 'on' == $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['embutida_liga_form_btn_nav'])) && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] != "F" && $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['run_iframe'] != "R") { } else { return false; } return true; } // displayAppToolbars function displayTopToolbar() { if (!$this->displayAppToolbars()) { return; } } // displayTopToolbar function displayBottomToolbar() { if (!$this->displayAppToolbars()) { return; } } // displayBottomToolbar function getSummaryLine() { $summaryLine = "[" . $this->Ini->Nm_lang['lang_othr_smry_info_simp'] . "]"; $summaryLine = str_replace( [ '?final?', '?total?', ], [ $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['reg_start'] + 1, $_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['total'] + 1, ], $summaryLine ); return $summaryLine; } // getSummaryLine function scGetColumnOrderRule($fieldName, &$orderColName, &$orderColOrient, &$orderColRule) { $sortRule = 'nosort'; if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['ordem_cmp'] == $fieldName) { $orderColName = $fieldName; if ($_SESSION['sc_session'][$this->Ini->sc_page]['form_bancos']['ordem_ord'] == " desc") { $orderColOrient = $nome_img = $this->Ini->Label_sort_desc; $orderColRule = $sortRule = 'desc'; } else { $orderColOrient = $nome_img = $this->Ini->Label_sort_asc; $orderColRule = $sortRule = 'asc'; } } return $sortRule; } function scGetColumnOrderIcon($fieldName, $sortRule) { if ($this->scIsFieldNumeric($fieldName)) { $defaultOffIcon = 'asc' == $this->scGetDefaultFieldOrder($fieldName) ? "fas fa-sort-numeric-down" : "fas fa-sort-numeric-down-alt"; if ('desc' == $sortRule) { return ""; } elseif ('asc' == $sortRule) { return ""; } else { return ""; } } else { $defaultOffIcon = 'asc' == $this->scGetDefaultFieldOrder($fieldName) ? "fas fa-sort-alpha-down" : "fas fa-sort-alpha-down-alt"; if ('desc' == $sortRule) { return ""; } elseif ('asc' == $sortRule) { return ""; } else { return ""; } } } function scIsFieldNumeric($fieldName) { switch ($fieldName) { case "idbanco": return true; case "saldoinicial": return true; case "otrasentradas": return true; case "otrassalidas": return true; default: return false; } return false; } function scGetDefaultFieldOrder($fieldName) { switch ($fieldName) { case "idoficina": return 'desc'; case "taquilla": return 'desc'; case "idbanco": return 'desc'; case "saldoinicial": return 'desc'; case "otrasentradas": return 'desc'; case "otrassalidas": return 'desc'; default: return 'asc'; } return 'asc'; } } ?>