/home/suroeste/public_html/gorbus.transportessuroeste.com/suroeste/app2_Login
Edit: /home/suroeste/public_html/gorbus.transportessuroeste.com/suroeste/app2_Login/app2_Login_apl.php (444560B)
'',
'param' => array(),
'autoComp' => '',
'rsSize' => '',
'msgDisplay' => '',
'errList' => array(),
'fldList' => array(),
'varList' => array(),
'focus' => '',
'navStatus' => 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 $login;
var $pswd;
var $remember_me;
var $remember_me_1;
var $new_user;
var $retrieve_pswd;
var $language;
var $idusuario2;
var $idempresa;
var $idempresa_1;
var $idtaquilla;
var $idtaquilla_1;
var $idoficina;
var $cargo;
var $nomoficina;
var $perfil;
var $idusuario;
var $nutaquilla;
var $nomtaquilla;
var $nuperfil;
var $fechacierre;
var $fechahoy;
var $pruebas;
var $bdbasedatos;
var $empresa;
var $taquillaactual;
var $jornada;
var $nm_data;
var $nmgp_opcao;
var $nmgp_opc_ant;
var $sc_evento;
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, $bok, $nm_apl_dependente, $nm_form_submit, $nm_opc_form_php, $nm_call_php, $nm_opc_lookup, $nmgp_redir;
if ($this->NM_ajax_flag)
{
if (isset($this->NM_ajax_info['param']['captcha_code']))
{
$this->captcha_code = $this->NM_ajax_info['param']['captcha_code'];
}
if (isset($this->NM_ajax_info['param']['captcha_sent']))
{
$this->captcha_sent = $this->NM_ajax_info['param']['captcha_sent'];
}
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']['fechacierre']))
{
$this->fechacierre = $this->NM_ajax_info['param']['fechacierre'];
}
if (isset($this->NM_ajax_info['param']['fechahoy']))
{
$this->fechahoy = $this->NM_ajax_info['param']['fechahoy'];
}
if (isset($this->NM_ajax_info['param']['idempresa']))
{
$this->idempresa = $this->NM_ajax_info['param']['idempresa'];
}
if (isset($this->NM_ajax_info['param']['idoficina']))
{
$this->idoficina = $this->NM_ajax_info['param']['idoficina'];
}
if (isset($this->NM_ajax_info['param']['idtaquilla']))
{
$this->idtaquilla = $this->NM_ajax_info['param']['idtaquilla'];
}
if (isset($this->NM_ajax_info['param']['idusuario2']))
{
$this->idusuario2 = $this->NM_ajax_info['param']['idusuario2'];
}
if (isset($this->NM_ajax_info['param']['jornada']))
{
$this->jornada = $this->NM_ajax_info['param']['jornada'];
}
if (isset($this->NM_ajax_info['param']['login']))
{
$this->login = $this->NM_ajax_info['param']['login'];
}
if (isset($this->NM_ajax_info['param']['new_user']))
{
$this->new_user = $this->NM_ajax_info['param']['new_user'];
}
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_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_refresh_fields']))
{
$this->nmgp_refresh_fields = $this->NM_ajax_info['param']['nmgp_refresh_fields'];
}
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']['nomoficina']))
{
$this->nomoficina = $this->NM_ajax_info['param']['nomoficina'];
}
if (isset($this->NM_ajax_info['param']['nomtaquilla']))
{
$this->nomtaquilla = $this->NM_ajax_info['param']['nomtaquilla'];
}
if (isset($this->NM_ajax_info['param']['nutaquilla']))
{
$this->nutaquilla = $this->NM_ajax_info['param']['nutaquilla'];
}
if (isset($this->NM_ajax_info['param']['perfil']))
{
$this->perfil = $this->NM_ajax_info['param']['perfil'];
}
if (isset($this->NM_ajax_info['param']['pswd']))
{
$this->pswd = $this->NM_ajax_info['param']['pswd'];
}
if (isset($this->NM_ajax_info['param']['retrieve_pswd']))
{
$this->retrieve_pswd = $this->NM_ajax_info['param']['retrieve_pswd'];
}
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']['taquillaactual']))
{
$this->taquillaactual = $this->NM_ajax_info['param']['taquillaactual'];
}
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->sett_auth_sn_fb_app_id) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_auth_sn_fb_app_id'] = $this->sett_auth_sn_fb_app_id;
}
if (isset($this->sett_auth_sn_fb_secret) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_auth_sn_fb_secret'] = $this->sett_auth_sn_fb_secret;
}
if (isset($this->sett_auth_sn_x_key) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_auth_sn_x_key'] = $this->sett_auth_sn_x_key;
}
if (isset($this->sett_auth_sn_x_secret) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_auth_sn_x_secret'] = $this->sett_auth_sn_x_secret;
}
if (isset($this->sett_auth_sn_google_client_id) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_auth_sn_google_client_id'] = $this->sett_auth_sn_google_client_id;
}
if (isset($this->sett_auth_sn_google_secret) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_auth_sn_google_secret'] = $this->sett_auth_sn_google_secret;
}
if (isset($this->facebook_error_code) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['facebook_error_code'] = $this->facebook_error_code;
}
if (isset($this->facebook_error_msg) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['facebook_error_msg'] = $this->facebook_error_msg;
}
if (isset($this->facebook_user) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['facebook_user'] = $this->facebook_user;
}
if (isset($this->facebook_email) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['facebook_email'] = $this->facebook_email;
}
if (isset($this->facebook_name) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['facebook_name'] = $this->facebook_name;
}
if (isset($this->usr_login) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['usr_login'] = $this->usr_login;
}
if (isset($this->usr_priv_admin) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['usr_priv_admin'] = $this->usr_priv_admin;
}
if (isset($this->usr_name) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['usr_name'] = $this->usr_name;
}
if (isset($this->usr_email) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['usr_email'] = $this->usr_email;
}
if (isset($this->usr_phone) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['usr_phone'] = $this->usr_phone;
}
if (isset($this->remember_me) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['remember_me'] = $this->remember_me;
}
if (isset($this->usr_groups) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['usr_groups'] = $this->usr_groups;
}
if (isset($this->sett_group_administrator) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_group_administrator'] = $this->sett_group_administrator;
}
if (isset($this->usr_picture) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['usr_picture'] = $this->usr_picture;
}
if (isset($this->sett_enable_2fa) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_enable_2fa'] = $this->sett_enable_2fa;
}
if (isset($this->sett_mfa_last_updated) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_mfa_last_updated'] = $this->sett_mfa_last_updated;
}
if (isset($this->sett_enable_2fa_mode) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_enable_2fa_mode'] = $this->sett_enable_2fa_mode;
}
if (isset($this->google_error_code) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['google_error_code'] = $this->google_error_code;
}
if (isset($this->google_error_msg) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['google_error_msg'] = $this->google_error_msg;
}
if (isset($this->google_user) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['google_user'] = $this->google_user;
}
if (isset($this->google_email) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['google_email'] = $this->google_email;
}
if (isset($this->google_name) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['google_name'] = $this->google_name;
}
if (isset($this->google_photo) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['google_photo'] = $this->google_photo;
}
if (isset($this->gnomoficina) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['gnomoficina'] = $this->gnomoficina;
}
if (isset($this->gnomtaquilla) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['gnomtaquilla'] = $this->gnomtaquilla;
}
if (isset($this->empresa) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['empresa'] = $this->empresa;
}
if (isset($this->sett_new_users) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_new_users'] = $this->sett_new_users;
}
if (isset($this->sett_group_default) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_group_default'] = $this->sett_group_default;
}
if (isset($this->nomtaquilla) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['nomtaquilla'] = $this->nomtaquilla;
}
if (isset($this->sett_smtp_api) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_smtp_api'] = $this->sett_smtp_api;
}
if (isset($this->sett_smtp) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_smtp'] = $this->sett_smtp;
}
if (isset($this->sett_smtp_server) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_smtp_server'] = $this->sett_smtp_server;
}
if (isset($this->sett_smtp_security) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_smtp_security'] = $this->sett_smtp_security;
}
if (isset($this->sett_smtp_port) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_smtp_port'] = $this->sett_smtp_port;
}
if (isset($this->sett_smtp_user) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_smtp_user'] = $this->sett_smtp_user;
}
if (isset($this->sett_smtp_pass) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_smtp_pass'] = $this->sett_smtp_pass;
}
if (isset($this->sett_smtp_from_email) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_smtp_from_email'] = $this->sett_smtp_from_email;
}
if (isset($this->sett_smtp_from_name) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_smtp_from_name'] = $this->sett_smtp_from_name;
}
if (isset($this->sett_theme) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_theme'] = $this->sett_theme;
}
if (isset($this->sett_captcha) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_captcha'] = $this->sett_captcha;
}
if (isset($this->logged_date_login) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['logged_date_login'] = $this->logged_date_login;
}
if (isset($this->sett_remember_me) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_remember_me'] = $this->sett_remember_me;
}
if (isset($this->return_msg_email_act) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['return_msg_email_act'] = $this->return_msg_email_act;
}
if (isset($this->sett_retrieve_password) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_retrieve_password'] = $this->sett_retrieve_password;
}
if (isset($this->sett_language) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_language'] = $this->sett_language;
}
if (isset($this->sett_auth_sn_fb) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_auth_sn_fb'] = $this->sett_auth_sn_fb;
}
if (isset($this->sett_auth_sn_x) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_auth_sn_x'] = $this->sett_auth_sn_x;
}
if (isset($this->sett_auth_sn_google) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_auth_sn_google'] = $this->sett_auth_sn_google;
}
if (isset($this->sett_auth_sn_position) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_auth_sn_position'] = $this->sett_auth_sn_position;
}
if (isset($this->sett_login_mode) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_login_mode'] = $this->sett_login_mode;
}
if (isset($this->usr_oficina) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['usr_oficina'] = $this->usr_oficina;
}
if (isset($this->usr_perfil) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['usr_perfil'] = $this->usr_perfil;
}
if (isset($this->nomoficina) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['nomoficina'] = $this->nomoficina;
}
if (isset($this->sett_pswd_last_updated) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_pswd_last_updated'] = $this->sett_pswd_last_updated;
}
if (isset($this->sett_cookie_expiration_time) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_cookie_expiration_time'] = $this->sett_cookie_expiration_time;
}
if (isset($this->sett_session_expire) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['sett_session_expire'] = $this->sett_session_expire;
}
if (isset($this->usr_taquilla) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['usr_taquilla'] = $this->usr_taquilla;
}
if (isset($this->twitter_user) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['twitter_user'] = $this->twitter_user;
}
if (isset($this->twitter_email) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['twitter_email'] = $this->twitter_email;
}
if (isset($this->twitter_name) && isset($this->NM_contr_var_session) && $this->NM_contr_var_session == "Yes")
{
$_SESSION['twitter_name'] = $this->twitter_name;
}
if (isset($_POST["gnomoficina"]) && isset($this->gnomoficina))
{
$_SESSION['gnomoficina'] = $this->gnomoficina;
}
if (isset($_POST["gnomtaquilla"]) && isset($this->gnomtaquilla))
{
$_SESSION['gnomtaquilla'] = $this->gnomtaquilla;
}
if (isset($_POST["nomtaquilla"]) && isset($this->nomtaquilla))
{
$_SESSION['nomtaquilla'] = $this->nomtaquilla;
}
if (isset($_POST["nomoficina"]) && isset($this->nomoficina))
{
$_SESSION['nomoficina'] = $this->nomoficina;
}
if (isset($_POST["usr_taquilla"]) && isset($this->usr_taquilla))
{
$_SESSION['usr_taquilla'] = $this->usr_taquilla;
}
if (isset($_GET["gnomoficina"]) && isset($this->gnomoficina))
{
$_SESSION['gnomoficina'] = $this->gnomoficina;
}
if (isset($_GET["gnomtaquilla"]) && isset($this->gnomtaquilla))
{
$_SESSION['gnomtaquilla'] = $this->gnomtaquilla;
}
if (isset($_GET["nomtaquilla"]) && isset($this->nomtaquilla))
{
$_SESSION['nomtaquilla'] = $this->nomtaquilla;
}
if (isset($_GET["nomoficina"]) && isset($this->nomoficina))
{
$_SESSION['nomoficina'] = $this->nomoficina;
}
if (isset($_GET["usr_taquilla"]) && isset($this->usr_taquilla))
{
$_SESSION['usr_taquilla'] = $this->usr_taquilla;
}
if (isset($this->Refresh_aba_menu)) {
$_SESSION['sc_session'][$script_case_init]['app2_Login']['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]['app2_Login']['opcao'] = "novo";
$_SESSION['sc_session'][$script_case_init]['app2_Login']['opc_ant'] = "inicio";
}
if (isset($_SESSION['sc_session'][$script_case_init]['app2_Login']['embutida_parms']))
{
$this->nmgp_parms = $_SESSION['sc_session'][$script_case_init]['app2_Login']['embutida_parms'];
unset($_SESSION['sc_session'][$script_case_init]['app2_Login']['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_app2_Login($cadapar[1]);
if ($cadapar[1] == "@ ") {$cadapar[1] = trim($cadapar[1]); }
$Tmp_par = $cadapar[0];
$this->$Tmp_par = $cadapar[1];
}
$ix++;
}
if (isset($this->sett_auth_sn_fb_app_id))
{
$_SESSION['sett_auth_sn_fb_app_id'] = $this->sett_auth_sn_fb_app_id;
}
if (isset($this->sett_auth_sn_fb_secret))
{
$_SESSION['sett_auth_sn_fb_secret'] = $this->sett_auth_sn_fb_secret;
}
if (isset($this->sett_auth_sn_x_key))
{
$_SESSION['sett_auth_sn_x_key'] = $this->sett_auth_sn_x_key;
}
if (isset($this->sett_auth_sn_x_secret))
{
$_SESSION['sett_auth_sn_x_secret'] = $this->sett_auth_sn_x_secret;
}
if (isset($this->sett_auth_sn_google_client_id))
{
$_SESSION['sett_auth_sn_google_client_id'] = $this->sett_auth_sn_google_client_id;
}
if (isset($this->sett_auth_sn_google_secret))
{
$_SESSION['sett_auth_sn_google_secret'] = $this->sett_auth_sn_google_secret;
}
if (isset($this->facebook_error_code))
{
$_SESSION['facebook_error_code'] = $this->facebook_error_code;
}
if (isset($this->facebook_error_msg))
{
$_SESSION['facebook_error_msg'] = $this->facebook_error_msg;
}
if (isset($this->facebook_user))
{
$_SESSION['facebook_user'] = $this->facebook_user;
}
if (isset($this->facebook_email))
{
$_SESSION['facebook_email'] = $this->facebook_email;
}
if (isset($this->facebook_name))
{
$_SESSION['facebook_name'] = $this->facebook_name;
}
if (isset($this->usr_login))
{
$_SESSION['usr_login'] = $this->usr_login;
}
if (isset($this->usr_priv_admin))
{
$_SESSION['usr_priv_admin'] = $this->usr_priv_admin;
}
if (isset($this->usr_name))
{
$_SESSION['usr_name'] = $this->usr_name;
}
if (isset($this->usr_email))
{
$_SESSION['usr_email'] = $this->usr_email;
}
if (isset($this->usr_phone))
{
$_SESSION['usr_phone'] = $this->usr_phone;
}
if (isset($this->remember_me))
{
$_SESSION['remember_me'] = $this->remember_me;
}
if (isset($this->usr_groups))
{
$_SESSION['usr_groups'] = $this->usr_groups;
}
if (isset($this->sett_group_administrator))
{
$_SESSION['sett_group_administrator'] = $this->sett_group_administrator;
}
if (isset($this->usr_picture))
{
$_SESSION['usr_picture'] = $this->usr_picture;
}
if (isset($this->sett_enable_2fa))
{
$_SESSION['sett_enable_2fa'] = $this->sett_enable_2fa;
}
if (isset($this->sett_mfa_last_updated))
{
$_SESSION['sett_mfa_last_updated'] = $this->sett_mfa_last_updated;
}
if (isset($this->sett_enable_2fa_mode))
{
$_SESSION['sett_enable_2fa_mode'] = $this->sett_enable_2fa_mode;
}
if (isset($this->google_error_code))
{
$_SESSION['google_error_code'] = $this->google_error_code;
}
if (isset($this->google_error_msg))
{
$_SESSION['google_error_msg'] = $this->google_error_msg;
}
if (isset($this->google_user))
{
$_SESSION['google_user'] = $this->google_user;
}
if (isset($this->google_email))
{
$_SESSION['google_email'] = $this->google_email;
}
if (isset($this->google_name))
{
$_SESSION['google_name'] = $this->google_name;
}
if (isset($this->google_photo))
{
$_SESSION['google_photo'] = $this->google_photo;
}
if (isset($this->gnomoficina))
{
$_SESSION['gnomoficina'] = $this->gnomoficina;
}
if (isset($this->gnomtaquilla))
{
$_SESSION['gnomtaquilla'] = $this->gnomtaquilla;
}
if (isset($this->empresa))
{
$_SESSION['empresa'] = $this->empresa;
}
if (isset($this->sett_new_users))
{
$_SESSION['sett_new_users'] = $this->sett_new_users;
}
if (isset($this->sett_group_default))
{
$_SESSION['sett_group_default'] = $this->sett_group_default;
}
if (isset($this->nomtaquilla))
{
$_SESSION['nomtaquilla'] = $this->nomtaquilla;
}
if (isset($this->sett_smtp_api))
{
$_SESSION['sett_smtp_api'] = $this->sett_smtp_api;
}
if (isset($this->sett_smtp))
{
$_SESSION['sett_smtp'] = $this->sett_smtp;
}
if (isset($this->sett_smtp_server))
{
$_SESSION['sett_smtp_server'] = $this->sett_smtp_server;
}
if (isset($this->sett_smtp_security))
{
$_SESSION['sett_smtp_security'] = $this->sett_smtp_security;
}
if (isset($this->sett_smtp_port))
{
$_SESSION['sett_smtp_port'] = $this->sett_smtp_port;
}
if (isset($this->sett_smtp_user))
{
$_SESSION['sett_smtp_user'] = $this->sett_smtp_user;
}
if (isset($this->sett_smtp_pass))
{
$_SESSION['sett_smtp_pass'] = $this->sett_smtp_pass;
}
if (isset($this->sett_smtp_from_email))
{
$_SESSION['sett_smtp_from_email'] = $this->sett_smtp_from_email;
}
if (isset($this->sett_smtp_from_name))
{
$_SESSION['sett_smtp_from_name'] = $this->sett_smtp_from_name;
}
if (isset($this->sett_theme))
{
$_SESSION['sett_theme'] = $this->sett_theme;
}
if (isset($this->sett_captcha))
{
$_SESSION['sett_captcha'] = $this->sett_captcha;
}
if (isset($this->logged_date_login))
{
$_SESSION['logged_date_login'] = $this->logged_date_login;
}
if (isset($this->sett_remember_me))
{
$_SESSION['sett_remember_me'] = $this->sett_remember_me;
}
if (isset($this->return_msg_email_act))
{
$_SESSION['return_msg_email_act'] = $this->return_msg_email_act;
}
if (isset($this->sett_retrieve_password))
{
$_SESSION['sett_retrieve_password'] = $this->sett_retrieve_password;
}
if (isset($this->sett_language))
{
$_SESSION['sett_language'] = $this->sett_language;
}
if (isset($this->sett_auth_sn_fb))
{
$_SESSION['sett_auth_sn_fb'] = $this->sett_auth_sn_fb;
}
if (isset($this->sett_auth_sn_x))
{
$_SESSION['sett_auth_sn_x'] = $this->sett_auth_sn_x;
}
if (isset($this->sett_auth_sn_google))
{
$_SESSION['sett_auth_sn_google'] = $this->sett_auth_sn_google;
}
if (isset($this->sett_auth_sn_position))
{
$_SESSION['sett_auth_sn_position'] = $this->sett_auth_sn_position;
}
if (isset($this->sett_login_mode))
{
$_SESSION['sett_login_mode'] = $this->sett_login_mode;
}
if (isset($this->usr_oficina))
{
$_SESSION['usr_oficina'] = $this->usr_oficina;
}
if (isset($this->usr_perfil))
{
$_SESSION['usr_perfil'] = $this->usr_perfil;
}
if (isset($this->nomoficina))
{
$_SESSION['nomoficina'] = $this->nomoficina;
}
if (isset($this->sett_pswd_last_updated))
{
$_SESSION['sett_pswd_last_updated'] = $this->sett_pswd_last_updated;
}
if (isset($this->sett_cookie_expiration_time))
{
$_SESSION['sett_cookie_expiration_time'] = $this->sett_cookie_expiration_time;
}
if (isset($this->sett_session_expire))
{
$_SESSION['sett_session_expire'] = $this->sett_session_expire;
}
if (isset($this->usr_taquilla))
{
$_SESSION['usr_taquilla'] = $this->usr_taquilla;
}
if (isset($this->twitter_user))
{
$_SESSION['twitter_user'] = $this->twitter_user;
}
if (isset($this->twitter_email))
{
$_SESSION['twitter_email'] = $this->twitter_email;
}
if (isset($this->twitter_name))
{
$_SESSION['twitter_name'] = $this->twitter_name;
}
if (isset($this->NM_where_filter_form))
{
$_SESSION['sc_session'][$script_case_init]['app2_Login']['where_filter_form'] = $this->NM_where_filter_form;
unset($_SESSION['sc_session'][$script_case_init]['app2_Login']['total']);
}
if (isset($this->sc_redir_atualiz))
{
$_SESSION['sc_session'][$script_case_init]['app2_Login']['sc_redir_atualiz'] = $this->sc_redir_atualiz;
}
if (isset($this->sc_redir_insert))
{
$_SESSION['sc_session'][$script_case_init]['app2_Login']['sc_redir_insert'] = $this->sc_redir_insert;
unset($_SESSION['sc_session'][$script_case_init]['app2_Login']['opc_ant']);
}
if (isset($this->sett_auth_sn_fb_app_id))
{
$_SESSION['sett_auth_sn_fb_app_id'] = $this->sett_auth_sn_fb_app_id;
}
if (isset($this->sett_auth_sn_fb_secret))
{
$_SESSION['sett_auth_sn_fb_secret'] = $this->sett_auth_sn_fb_secret;
}
if (isset($this->sett_auth_sn_x_key))
{
$_SESSION['sett_auth_sn_x_key'] = $this->sett_auth_sn_x_key;
}
if (isset($this->sett_auth_sn_x_secret))
{
$_SESSION['sett_auth_sn_x_secret'] = $this->sett_auth_sn_x_secret;
}
if (isset($this->sett_auth_sn_google_client_id))
{
$_SESSION['sett_auth_sn_google_client_id'] = $this->sett_auth_sn_google_client_id;
}
if (isset($this->sett_auth_sn_google_secret))
{
$_SESSION['sett_auth_sn_google_secret'] = $this->sett_auth_sn_google_secret;
}
if (isset($this->facebook_error_code))
{
$_SESSION['facebook_error_code'] = $this->facebook_error_code;
}
if (isset($this->facebook_error_msg))
{
$_SESSION['facebook_error_msg'] = $this->facebook_error_msg;
}
if (isset($this->facebook_user))
{
$_SESSION['facebook_user'] = $this->facebook_user;
}
if (isset($this->facebook_email))
{
$_SESSION['facebook_email'] = $this->facebook_email;
}
if (isset($this->facebook_name))
{
$_SESSION['facebook_name'] = $this->facebook_name;
}
if (isset($this->usr_login))
{
$_SESSION['usr_login'] = $this->usr_login;
}
if (isset($this->usr_priv_admin))
{
$_SESSION['usr_priv_admin'] = $this->usr_priv_admin;
}
if (isset($this->usr_name))
{
$_SESSION['usr_name'] = $this->usr_name;
}
if (isset($this->usr_email))
{
$_SESSION['usr_email'] = $this->usr_email;
}
if (isset($this->usr_phone))
{
$_SESSION['usr_phone'] = $this->usr_phone;
}
if (isset($this->remember_me))
{
$_SESSION['remember_me'] = $this->remember_me;
}
if (isset($this->usr_groups))
{
$_SESSION['usr_groups'] = $this->usr_groups;
}
if (isset($this->sett_group_administrator))
{
$_SESSION['sett_group_administrator'] = $this->sett_group_administrator;
}
if (isset($this->usr_picture))
{
$_SESSION['usr_picture'] = $this->usr_picture;
}
if (isset($this->sett_enable_2fa))
{
$_SESSION['sett_enable_2fa'] = $this->sett_enable_2fa;
}
if (isset($this->sett_mfa_last_updated))
{
$_SESSION['sett_mfa_last_updated'] = $this->sett_mfa_last_updated;
}
if (isset($this->sett_enable_2fa_mode))
{
$_SESSION['sett_enable_2fa_mode'] = $this->sett_enable_2fa_mode;
}
if (isset($this->google_error_code))
{
$_SESSION['google_error_code'] = $this->google_error_code;
}
if (isset($this->google_error_msg))
{
$_SESSION['google_error_msg'] = $this->google_error_msg;
}
if (isset($this->google_user))
{
$_SESSION['google_user'] = $this->google_user;
}
if (isset($this->google_email))
{
$_SESSION['google_email'] = $this->google_email;
}
if (isset($this->google_name))
{
$_SESSION['google_name'] = $this->google_name;
}
if (isset($this->google_photo))
{
$_SESSION['google_photo'] = $this->google_photo;
}
if (isset($this->gnomoficina))
{
$_SESSION['gnomoficina'] = $this->gnomoficina;
}
if (isset($this->gnomtaquilla))
{
$_SESSION['gnomtaquilla'] = $this->gnomtaquilla;
}
if (isset($this->empresa))
{
$_SESSION['empresa'] = $this->empresa;
}
if (isset($this->sett_new_users))
{
$_SESSION['sett_new_users'] = $this->sett_new_users;
}
if (isset($this->sett_group_default))
{
$_SESSION['sett_group_default'] = $this->sett_group_default;
}
if (isset($this->nomtaquilla))
{
$_SESSION['nomtaquilla'] = $this->nomtaquilla;
}
if (isset($this->sett_smtp_api))
{
$_SESSION['sett_smtp_api'] = $this->sett_smtp_api;
}
if (isset($this->sett_smtp))
{
$_SESSION['sett_smtp'] = $this->sett_smtp;
}
if (isset($this->sett_smtp_server))
{
$_SESSION['sett_smtp_server'] = $this->sett_smtp_server;
}
if (isset($this->sett_smtp_security))
{
$_SESSION['sett_smtp_security'] = $this->sett_smtp_security;
}
if (isset($this->sett_smtp_port))
{
$_SESSION['sett_smtp_port'] = $this->sett_smtp_port;
}
if (isset($this->sett_smtp_user))
{
$_SESSION['sett_smtp_user'] = $this->sett_smtp_user;
}
if (isset($this->sett_smtp_pass))
{
$_SESSION['sett_smtp_pass'] = $this->sett_smtp_pass;
}
if (isset($this->sett_smtp_from_email))
{
$_SESSION['sett_smtp_from_email'] = $this->sett_smtp_from_email;
}
if (isset($this->sett_smtp_from_name))
{
$_SESSION['sett_smtp_from_name'] = $this->sett_smtp_from_name;
}
if (isset($this->sett_theme))
{
$_SESSION['sett_theme'] = $this->sett_theme;
}
if (isset($this->sett_captcha))
{
$_SESSION['sett_captcha'] = $this->sett_captcha;
}
if (isset($this->logged_date_login))
{
$_SESSION['logged_date_login'] = $this->logged_date_login;
}
if (isset($this->sett_remember_me))
{
$_SESSION['sett_remember_me'] = $this->sett_remember_me;
}
if (isset($this->return_msg_email_act))
{
$_SESSION['return_msg_email_act'] = $this->return_msg_email_act;
}
if (isset($this->sett_retrieve_password))
{
$_SESSION['sett_retrieve_password'] = $this->sett_retrieve_password;
}
if (isset($this->sett_language))
{
$_SESSION['sett_language'] = $this->sett_language;
}
if (isset($this->sett_auth_sn_fb))
{
$_SESSION['sett_auth_sn_fb'] = $this->sett_auth_sn_fb;
}
if (isset($this->sett_auth_sn_x))
{
$_SESSION['sett_auth_sn_x'] = $this->sett_auth_sn_x;
}
if (isset($this->sett_auth_sn_google))
{
$_SESSION['sett_auth_sn_google'] = $this->sett_auth_sn_google;
}
if (isset($this->sett_auth_sn_position))
{
$_SESSION['sett_auth_sn_position'] = $this->sett_auth_sn_position;
}
if (isset($this->sett_login_mode))
{
$_SESSION['sett_login_mode'] = $this->sett_login_mode;
}
if (isset($this->usr_oficina))
{
$_SESSION['usr_oficina'] = $this->usr_oficina;
}
if (isset($this->usr_perfil))
{
$_SESSION['usr_perfil'] = $this->usr_perfil;
}
if (isset($this->nomoficina))
{
$_SESSION['nomoficina'] = $this->nomoficina;
}
if (isset($this->sett_pswd_last_updated))
{
$_SESSION['sett_pswd_last_updated'] = $this->sett_pswd_last_updated;
}
if (isset($this->sett_cookie_expiration_time))
{
$_SESSION['sett_cookie_expiration_time'] = $this->sett_cookie_expiration_time;
}
if (isset($this->sett_session_expire))
{
$_SESSION['sett_session_expire'] = $this->sett_session_expire;
}
if (isset($this->usr_taquilla))
{
$_SESSION['usr_taquilla'] = $this->usr_taquilla;
}
if (isset($this->twitter_user))
{
$_SESSION['twitter_user'] = $this->twitter_user;
}
if (isset($this->twitter_email))
{
$_SESSION['twitter_email'] = $this->twitter_email;
}
if (isset($this->twitter_name))
{
$_SESSION['twitter_name'] = $this->twitter_name;
}
}
elseif (isset($script_case_init) && !empty($script_case_init) && isset($_SESSION['sc_session'][$script_case_init]['app2_Login']['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]['app2_Login']['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]['app2_Login']['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]['app2_Login']['lig_edit_lookup'] = true;
$_SESSION['sc_session'][$script_case_init]['app2_Login']['lig_edit_lookup_cb'] = $this->nm_evt_ret_edit;
$_SESSION['sc_session'][$script_case_init]['app2_Login']['lig_edit_lookup_row'] = isset($this->nm_evt_ret_row) ? $this->nm_evt_ret_row : '';
}
if (isset($_SESSION['sc_session'][$script_case_init]['app2_Login']['lig_edit_lookup']) && $_SESSION['sc_session'][$script_case_init]['app2_Login']['lig_edit_lookup'])
{
$this->lig_edit_lookup = true;
$this->lig_edit_lookup_cb = $_SESSION['sc_session'][$script_case_init]['app2_Login']['lig_edit_lookup_cb'];
$this->lig_edit_lookup_row = $_SESSION['sc_session'][$script_case_init]['app2_Login']['lig_edit_lookup_row'];
}
if (!$this->Ini)
{
$this->Ini = new app2_Login_ini();
$this->Ini->init();
$this->nm_data = new nm_data("es");
$this->app_is_initializing = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['initialize'];
$this->Db = $this->Ini->Db;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['initialize']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['initialize'])
{
/*----- Scriptcase Locale: Event onApplicationInit ------*/
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (isset($_SESSION['scriptcase']['sc_apl_conf']['app2_form_add_users']))
{
unset($_SESSION['scriptcase']['sc_apl_conf']['app2_form_add_users']);
}
;
if (isset($_SESSION['scriptcase']['sc_apl_conf']['app2_retrieve_pswd']))
{
unset($_SESSION['scriptcase']['sc_apl_conf']['app2_retrieve_pswd']);
}
;
$this->get_settings();
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
/*----- END - Scriptcase Locale: Event onApplicationInit ------*/
}
$this->Ini->init2();
}
else
{
$this->nm_data = new nm_data("es");
}
$_SESSION['sc_session'][$script_case_init]['app2_Login']['upload_field_info'] = array();
unset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['masterValue']);
$this->Change_Menu = false;
$run_iframe = (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['run_iframe']) && ($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['run_iframe'] == "F" || $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['run_iframe'] == "R")) ? true : false;
if (!$run_iframe && isset($_SESSION['scriptcase']['menu_atual']) && (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['sc_outra_jan']) || !$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['sc_outra_jan']))
{
$this->sc_init_menu = "x";
if (isset($_SESSION['scriptcase'][$_SESSION['scriptcase']['menu_atual']]['sc_init']['app2_Login']))
{
$this->sc_init_menu = $_SESSION['scriptcase'][$_SESSION['scriptcase']['menu_atual']]['sc_init']['app2_Login'];
}
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]['app2_Login']))
{
$_SESSION['scriptcase']['menu_apls'][$_SESSION['scriptcase']['menu_atual']][$this->sc_init_menu]['app2_Login']['link'] = $this->Ini->sc_protocolo . $this->Ini->server . $this->Ini->path_link . "" . SC_dir_app_name('app2_Login') . "/";
$_SESSION['scriptcase']['menu_apls'][$_SESSION['scriptcase']['menu_atual']][$this->sc_init_menu]['app2_Login']['label'] = "app2_Login";
$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 == "app2_Login")
{
$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 = trim($str_button);
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->nm_new_label['login'] = '' . $this->Ini->Nm_lang['lang_sec_users_fild_login'] . '';
$this->nm_new_label['pswd'] = '' . $this->Ini->Nm_lang['lang_sec_users_fild_pswd'] . '';
$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;
if ($this->use_100perc_fields) {
$this->classes_100perc_fields['table'] = ' sc-ui-100perc-table';
$this->classes_100perc_fields['input'] = ' sc-ui-100perc-input';
$this->classes_100perc_fields['span_input'] = ' sc-ui-100perc-span-input';
$this->classes_100perc_fields['span_select'] = ' sc-ui-100perc-span-select';
$this->classes_100perc_fields['style_category'] = ' style="width: 100%"';
$this->classes_100perc_fields['keep_field_size'] = false;
}
$_SESSION['scriptcase']['error_icon']['app2_Login'] = "

Ini->path_icones . "/scriptcase__NM__btn__NM__scriptcase9_Lemon__NM__nm_scriptcase9_Lemon_error.png\" style=\"border-width: 0px\" align=\"top\"> ";
$_SESSION['scriptcase']['error_close']['app2_Login'] = "
" . 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]['app2_Login']['embutida_proc']) ? $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_proc'] : $this->Embutida_proc;
$this->Embutida_form = isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_form']) ? $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_form'] : $this->Embutida_form;
$this->Embutida_call = isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_call']) ? $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_call'] : $this->Embutida_call;
$this->form_3versions_single = false;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['table_refresh'] = false;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_grid_edit']) && '' != $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_grid_edit'])
{
$this->Grid_editavel = ('on' == $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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]['app2_Login']['embutida_multi']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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]['app2_Login']['embutida_liga_tp_pag']) && '' != $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_tp_pag'])
{
$this->form_paginacao = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_tp_pag'];
}
if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_form']) || '' == $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_form'])
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_form'] = $this->Embutida_form;
}
if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_grid_edit']) || '' == $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_grid_edit'])
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_grid_edit'] = $this->Grid_editavel ? 'on' : 'off';
}
if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_grid_edit']) || '' == $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_grid_edit'])
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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]['app2_Login']['first_time'])
{
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['insert']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['new']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['update']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['delete']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['first']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['back']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['forward']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['last']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['qsearch']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['dynsearch']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['summary']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['navpage']);
unset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['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']['app2_Login']['insert']) || '' == $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['insert']))
{
if ('N' == $this->NM_btn_insert)
{
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['insert'] = 'off';
}
else
{
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['insert'] = 'on';
}
}
if (isset($this->NM_btn_new) && 'N' == $this->NM_btn_new)
{
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['new'] = 'off';
}
if (isset($this->NM_btn_update) && '' != $this->NM_btn_update && (!isset($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['update']) || '' == $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['update']))
{
if ('N' == $this->NM_btn_update)
{
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['update'] = 'off';
}
else
{
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['update'] = 'on';
}
}
if (isset($this->NM_btn_delete) && '' != $this->NM_btn_delete && (!isset($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['delete']) || '' == $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['delete']))
{
if ('N' == $this->NM_btn_delete)
{
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['delete'] = 'off';
}
else
{
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['delete'] = 'on';
}
}
if (isset($this->NM_btn_navega) && '' != $this->NM_btn_navega)
{
if ('N' == $this->NM_btn_navega)
{
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['first'] = 'off';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['back'] = 'off';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['forward'] = 'off';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['last'] = 'off';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['qsearch'] = 'off';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['dynsearch'] = 'off';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['summary'] = 'off';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['navpage'] = 'off';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['goto'] = 'off';
$this->Nav_permite_ava = false;
$this->Nav_permite_ret = false;
}
else
{
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['first'] = 'on';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['back'] = 'on';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['forward'] = 'on';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['last'] = 'on';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['qsearch'] = 'on';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['dynsearch'] = 'on';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['summary'] = 'on';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['navpage'] = 'on';
$_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['goto'] = 'on';
}
}
$this->nmgp_botoes['cancel'] = "on";
$this->nmgp_botoes['exit'] = "off";
$this->nmgp_botoes['ok'] = "on";
$this->nmgp_botoes['facebook'] = "on";
$this->nmgp_botoes['google'] = "on";
$this->nmgp_botoes['twitter'] = "on";
$this->nmgp_botoes['paypal'] = "off";
if (isset($this->NM_btn_cancel) && 'N' == $this->NM_btn_cancel)
{
$this->nmgp_botoes['cancel'] = "off";
}
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_orig'] = "";
if (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_pesq']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_pesq'] = "";
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_pesq_filtro'] = "";
}
$this->sc_where_orig = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_orig'];
$this->sc_where_atual = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_pesq'];
$this->sc_where_filtro = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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]['app2_Login']['buttonStatus'];
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['iframe_filtro']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['iframe_filtro'] == "S")
{
$this->nmgp_botoes['exit'] = "off";
}
if (isset($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['btn_display']) && !empty($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['btn_display']))
{
foreach ($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['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']['app2_Login']['insert']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['insert'] != '')
{
$this->nmgp_botoes['new'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['insert'];
$this->nmgp_botoes['insert'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['insert'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['new']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['new'] != '')
{
$this->nmgp_botoes['new'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['new'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['update']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['update'] != '')
{
$this->nmgp_botoes['update'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['update'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['delete']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['delete'] != '')
{
$this->nmgp_botoes['delete'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['delete'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['first']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['first'] != '')
{
$this->nmgp_botoes['first'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['first'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['back']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['back'] != '')
{
$this->nmgp_botoes['back'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['back'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['forward']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['forward'] != '')
{
$this->nmgp_botoes['forward'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['forward'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['last']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['last'] != '')
{
$this->nmgp_botoes['last'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['last'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['qsearch']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['qsearch'] != '')
{
$this->nmgp_botoes['qsearch'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['qsearch'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['dynsearch']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['dynsearch'] != '')
{
$this->nmgp_botoes['dynsearch'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['dynsearch'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['summary']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['summary'] != '')
{
$this->nmgp_botoes['summary'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['summary'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['navpage']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['navpage'] != '')
{
$this->nmgp_botoes['navpage'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['navpage'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['goto']) && $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['goto'] != '')
{
$this->nmgp_botoes['goto'] = $_SESSION['scriptcase']['sc_apl_conf_lig']['app2_Login']['goto'];
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_insert']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_insert'] != '')
{
$this->nmgp_botoes['new'] = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_insert'];
$this->nmgp_botoes['insert'] = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_insert'];
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_update']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_update'] != '')
{
$this->nmgp_botoes['update'] = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_update'];
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_delete']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_delete'] != '')
{
$this->nmgp_botoes['delete'] = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_delete'];
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_btn_nav']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_btn_nav'] != '')
{
$this->nmgp_botoes['first'] = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_btn_nav'];
$this->nmgp_botoes['back'] = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_btn_nav'];
$this->nmgp_botoes['forward'] = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_btn_nav'];
$this->nmgp_botoes['last'] = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_liga_form_btn_nav'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['insert']) && $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['insert'] != '')
{
$this->nmgp_botoes['new'] = $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['insert'];
$this->nmgp_botoes['insert'] = $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['insert'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['update']) && $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['update'] != '')
{
$this->nmgp_botoes['update'] = $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['update'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['delete']) && $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['delete'] != '')
{
$this->nmgp_botoes['delete'] = $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['delete'];
}
if (isset($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['field_display']) && !empty($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['field_display']))
{
foreach ($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['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']['app2_Login']['field_readonly']) && !empty($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['field_readonly']))
{
foreach ($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['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']['app2_Login']['exit']) && $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['exit'] != '')
{
$_SESSION['scriptcase']['sc_url_saida'][$this->Ini->sc_page] = $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['exit'];
$_SESSION['scriptcase']['sc_force_url_saida'][$this->Ini->sc_page] = true;
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dashboard_info']['under_dashboard']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dashboard_info']['under_dashboard'] && !$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dashboard_info']['maximized']) {
$tmpDashboardApp = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dashboard_info']['dashboard_app'];
if (isset($_SESSION['scriptcase']['dashboard_toolbar'][$tmpDashboardApp]['app2_Login'])) {
$tmpDashboardButtons = $_SESSION['scriptcase']['dashboard_toolbar'][$tmpDashboardApp]['app2_Login'];
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]['app2_Login']['dados_form']))
{
$this->nmgp_dados_form = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dados_form'];
if (!isset($this->remember_me)){$this->remember_me = $this->nmgp_dados_form['remember_me'];}
if (!isset($this->language)){$this->language = $this->nmgp_dados_form['language'];}
if (!isset($this->cargo)){$this->cargo = $this->nmgp_dados_form['cargo'];}
if (!isset($this->idusuario)){$this->idusuario = $this->nmgp_dados_form['idusuario'];}
if (!isset($this->nuperfil)){$this->nuperfil = $this->nmgp_dados_form['nuperfil'];}
if (!isset($this->pruebas)){$this->pruebas = $this->nmgp_dados_form['pruebas'];}
if (!isset($this->bdbasedatos)){$this->bdbasedatos = $this->nmgp_dados_form['bdbasedatos'];}
if (!isset($this->empresa)){$this->empresa = $this->nmgp_dados_form['empresa'];}
}
$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("app2_Login", $apls_aba))
{
$this->aba_iframe = true;
break;
}
}
}
if ($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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 . 'app2_Login_help.txt'))
{
$arr_link_webhelp = file($this->Ini->path_aplicacao . 'app2_Login_help.txt');
if ($arr_link_webhelp)
{
foreach ($arr_link_webhelp as $str_link_webhelp)
{
$str_link_webhelp = trim($str_link_webhelp);
if ('contr:' == substr($str_link_webhelp, 0, 6))
{
$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 . 'app2_Login/app2_Login_erro.class.php');
}
else
{
require_once($this->Ini->path_aplicacao . "app2_Login_erro.class.php");
}
$this->Erro = new app2_Login_erro();
$this->Erro->Ini = $this->Ini;
$this->proc_fast_search = false;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['opcao']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['opcao']) && empty($this->nmgp_refresh_fields))
{
$this->nmgp_opcao = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['opcao'];
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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']['app2_Login']['start']) && $_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['start'] == 'new')
{
$this->nmgp_opcao = "novo";
$this->nm_Start_new = true;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['opcao'] = "novo";
unset($_SESSION['scriptcase']['sc_apl_conf']['app2_Login']['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]['app2_Login']['opc_ant'])) ? $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['opc_ant'] : "";
}
if ($this->nmgp_opcao == "recarga" || $this->nmgp_opcao == "muda_form")
{
$this->nmgp_botoes = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['botoes'];
$this->Nav_permite_ret = 0 != $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['inicio'];
$this->Nav_permite_ava = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['total'] != $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['final'];
}
else
{
}
$this->nm_flag_iframe = false;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dados_form']))
{
$this->nmgp_dados_form = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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;
if (!isset($this->NM_ajax_flag) || ('validate_' != substr($this->NM_ajax_opcao, 0, 9) && 'add_new_line' != $this->NM_ajax_opcao && 'autocomp_' != substr($this->NM_ajax_opcao, 0, 9)))
{
/*----- Scriptcase Locale: Event onScriptinit ------*/
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_sett_remember_me)) {$this->sc_temp_sett_remember_me = (isset($_SESSION['sett_remember_me'])) ? $_SESSION['sett_remember_me'] : "";}
if (!isset($this->sc_temp_logged_date_login)) {$this->sc_temp_logged_date_login = (isset($_SESSION['logged_date_login'])) ? $_SESSION['logged_date_login'] : "";}
if (!isset($this->sc_temp_sett_captcha)) {$this->sc_temp_sett_captcha = (isset($_SESSION['sett_captcha'])) ? $_SESSION['sett_captcha'] : "";}
if (!isset($this->sc_temp_sett_theme)) {$this->sc_temp_sett_theme = (isset($_SESSION['sett_theme'])) ? $_SESSION['sett_theme'] : "";}
if (!isset($this->sc_temp_sett_smtp_from_name)) {$this->sc_temp_sett_smtp_from_name = (isset($_SESSION['sett_smtp_from_name'])) ? $_SESSION['sett_smtp_from_name'] : "";}
if (!isset($this->sc_temp_sett_smtp_from_email)) {$this->sc_temp_sett_smtp_from_email = (isset($_SESSION['sett_smtp_from_email'])) ? $_SESSION['sett_smtp_from_email'] : "";}
if (!isset($this->sc_temp_sett_smtp_pass)) {$this->sc_temp_sett_smtp_pass = (isset($_SESSION['sett_smtp_pass'])) ? $_SESSION['sett_smtp_pass'] : "";}
if (!isset($this->sc_temp_sett_smtp_user)) {$this->sc_temp_sett_smtp_user = (isset($_SESSION['sett_smtp_user'])) ? $_SESSION['sett_smtp_user'] : "";}
if (!isset($this->sc_temp_sett_smtp_port)) {$this->sc_temp_sett_smtp_port = (isset($_SESSION['sett_smtp_port'])) ? $_SESSION['sett_smtp_port'] : "";}
if (!isset($this->sc_temp_sett_smtp_security)) {$this->sc_temp_sett_smtp_security = (isset($_SESSION['sett_smtp_security'])) ? $_SESSION['sett_smtp_security'] : "";}
if (!isset($this->sc_temp_sett_smtp_server)) {$this->sc_temp_sett_smtp_server = (isset($_SESSION['sett_smtp_server'])) ? $_SESSION['sett_smtp_server'] : "";}
if (!isset($this->sc_temp_sett_smtp)) {$this->sc_temp_sett_smtp = (isset($_SESSION['sett_smtp'])) ? $_SESSION['sett_smtp'] : "";}
if (!isset($this->sc_temp_sett_smtp_api)) {$this->sc_temp_sett_smtp_api = (isset($_SESSION['sett_smtp_api'])) ? $_SESSION['sett_smtp_api'] : "";}
if (!isset($this->sc_temp_usr_picture)) {$this->sc_temp_usr_picture = (isset($_SESSION['usr_picture'])) ? $_SESSION['usr_picture'] : "";}
if (!isset($this->sc_temp_usr_phone)) {$this->sc_temp_usr_phone = (isset($_SESSION['usr_phone'])) ? $_SESSION['usr_phone'] : "";}
if (!isset($this->sc_temp_usr_name)) {$this->sc_temp_usr_name = (isset($_SESSION['usr_name'])) ? $_SESSION['usr_name'] : "";}
if (!isset($this->sc_temp_usr_email)) {$this->sc_temp_usr_email = (isset($_SESSION['usr_email'])) ? $_SESSION['usr_email'] : "";}
if (!isset($this->sc_temp_usr_login)) {$this->sc_temp_usr_login = (isset($_SESSION['usr_login'])) ? $_SESSION['usr_login'] : "";}
if (isset($_SESSION['scriptcase']['sc_apl_conf']['app2_retrieve_pswd']))
{
unset($_SESSION['scriptcase']['sc_apl_conf']['app2_retrieve_pswd']);
}
;
if($this->sc_temp_sett_smtp_api == 'custom'){
$this->sc_temp_sett_smtp = array(
'settings' => array(
'gateway' => 'smtp',
'smtp_server' => $this->sc_temp_sett_smtp_server,
'smtp_protocol' => $this->sc_temp_sett_smtp_security,
'smtp_port' => $this->sc_temp_sett_smtp_port,
'smtp_user' => $this->sc_temp_sett_smtp_user,
'smtp_password' => $this->sc_temp_sett_smtp_pass,
'from_email' => $this->sc_temp_sett_smtp_from_email,
'from_name' => $this->sc_temp_sett_smtp_from_name,
)
);
}else{
$this->sc_temp_sett_smtp = array('profile' => $_SESSION['sett_smtp_api']);
}
$this->Ini->sc_set_schema('$this->sc_temp_sett_theme');;
if($this->sc_temp_sett_captcha == 'Y'){
$this->nmgp_captcha_display = '';
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['captcha_display'] = $this->nmgp_captcha_display;
;
}else{
$this->nmgp_captcha_display = 'none';
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['captcha_display'] = $this->nmgp_captcha_display;
;
}
$this->sc_looged_check_logout();
$date_login = (isset($this->sc_temp_logged_date_login)? $this->sc_temp_logged_date_login : '');
$this->sc_logged_out($this->sc_temp_usr_login, $date_login);
unset($_SESSION['scriptcase']['sc_apl_seg']);unset($_SESSION['scriptcase']['pass']);unset($_SESSION['usr_login']);
unset($this->sc_temp_usr_login);
unset($_SESSION['usr_email']);
unset($this->sc_temp_usr_email);
unset($_SESSION['usr_name']);
unset($this->sc_temp_usr_name);
unset($_SESSION['usr_phone']);
unset($this->sc_temp_usr_phone);
unset($_SESSION['usr_picture']);
unset($this->sc_temp_usr_picture);
;
if(isset($this->sc_temp_sett_remember_me) && $this->sc_temp_sett_remember_me == 'Y'){
$this->remember_me_init();
}
else{
}
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_sett_smtp_api)) { $_SESSION['sett_smtp_api'] = $this->sc_temp_sett_smtp_api;}
if (isset($this->sc_temp_sett_smtp)) { $_SESSION['sett_smtp'] = $this->sc_temp_sett_smtp;}
if (isset($this->sc_temp_sett_smtp_server)) { $_SESSION['sett_smtp_server'] = $this->sc_temp_sett_smtp_server;}
if (isset($this->sc_temp_sett_smtp_security)) { $_SESSION['sett_smtp_security'] = $this->sc_temp_sett_smtp_security;}
if (isset($this->sc_temp_sett_smtp_port)) { $_SESSION['sett_smtp_port'] = $this->sc_temp_sett_smtp_port;}
if (isset($this->sc_temp_sett_smtp_user)) { $_SESSION['sett_smtp_user'] = $this->sc_temp_sett_smtp_user;}
if (isset($this->sc_temp_sett_smtp_pass)) { $_SESSION['sett_smtp_pass'] = $this->sc_temp_sett_smtp_pass;}
if (isset($this->sc_temp_sett_smtp_from_email)) { $_SESSION['sett_smtp_from_email'] = $this->sc_temp_sett_smtp_from_email;}
if (isset($this->sc_temp_sett_smtp_from_name)) { $_SESSION['sett_smtp_from_name'] = $this->sc_temp_sett_smtp_from_name;}
if (isset($this->sc_temp_sett_theme)) { $_SESSION['sett_theme'] = $this->sc_temp_sett_theme;}
if (isset($this->sc_temp_sett_captcha)) { $_SESSION['sett_captcha'] = $this->sc_temp_sett_captcha;}
if (isset($this->sc_temp_logged_date_login)) { $_SESSION['logged_date_login'] = $this->sc_temp_logged_date_login;}
if (isset($this->sc_temp_sett_remember_me)) { $_SESSION['sett_remember_me'] = $this->sc_temp_sett_remember_me;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
/*----- END - Scriptcase Locale: Event onScriptinit ------*/
}
if ('ajax_check_file' == $this->nmgp_opcao ){
ob_start();
global $bol_api_prod;
$bol_api_prod = true;
if (isset($_SESSION['scriptcase']['app2_Login']['glo_nm_conexao']) && !empty($_SESSION['scriptcase']['app2_Login']['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']['app2_Login']['glo_nm_path_imag_temp'] . $file_name;
$orig_img = $_SESSION['scriptcase']['app2_Login']['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->createImg($_SERVER['DOCUMENT_ROOT'].$out1_img_cache);
echo $out1_img_cache;
exit;
}
if (!isset($this->NM_ajax_flag) || ('validate_' != substr($this->NM_ajax_opcao, 0, 9) && 'add_new_line' != $this->NM_ajax_opcao))
{
if ((isset($this->nm_form_submit) && '1' == $this->nm_form_submit && isset($this->nmgp_opcao) && 'facebook_login' == $this->nmgp_opcao) || (isset($_GET['code']) && isset($_GET['state'])) || (isset($_GET['error_code']) && isset($_GET['error_msg'])))
{
include_once($this->Ini->path_third ."/facebookauth/src/Facebook/autoload.php");
if(!empty('' . $_SESSION['sett_auth_sn_fb_app_id'] . '') && !empty('' . $_SESSION['sett_auth_sn_fb_secret'] . ''))
{
$fb = new Facebook\Facebook([
'app_id' => '' . $_SESSION['sett_auth_sn_fb_app_id'] . '', // Replace {app-id} with your app id
'app_secret' => '' . $_SESSION['sett_auth_sn_fb_secret'] . '',
'default_graph_version' => 'v2.2',
]);
$helper = $fb->getRedirectLoginHelper();
$permissions = ['email']; // Optional permissions
if(!isset($_GET['code']))
{
$loginUrl = $helper->getLoginUrl('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'], $permissions);
header("Location: " . $loginUrl );
exit;
}
elseif(strpos($_SERVER['QUERY_STRING'], 'googleapis') === false)
{
try {
$accessToken = $helper->getAccessToken();
} catch(Facebook\Exceptions\FacebookResponseException $e) {
// When Graph returns an error
$_SESSION['facebook_error_msg'] = 'Graph returned an error: ' . $e->getMessage();
//exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
// When validation fails or other local issues
$_SESSION['facebook_error_msg'] = 'Facebook SDK returned an error: ' . $e->getMessage();
//exit;
}
if (! isset($accessToken)) {
if ($helper->getError()) {
$_SESSION['facebook_error_code'] = $helper->getErrorCode();
$_SESSION['facebook_error_msg'] = $helper->getErrorDescription();
} /*else {
header('HTTP/1.0 400 Bad Request');
echo 'Bad request';
}
exit;*/
}
// The OAuth 2.0 client handler helps us manage access tokens
$oAuth2Client = $fb->getOAuth2Client();
$_SESSION['fb_access_token'] = (string) $accessToken;
$fb->setDefaultAccessToken($accessToken);
$response = $fb->get('/me');
$user = $response->getGraphUser();
$_SESSION['facebook_user'] = $user->getId();
$_SESSION['facebook_photo'] = 'https://graph.facebook.com/' . $user->getId() . '/picture';
$_SESSION['facebook_name'] = $user->getName();
$_SESSION['facebook_email'] = $user['email'];
$this->fb_return();
}
}
}
} include_once($this->Ini->path_third .'/../vendor/autoload.php');
if (!isset($this->NM_ajax_flag) || ('validate_' != substr($this->NM_ajax_opcao, 0, 9) && 'add_new_line' != $this->NM_ajax_opcao))
{
if ((isset($this->nm_form_submit) && '1' == $this->nm_form_submit && isset($this->nmgp_opcao) && 'google_login' == $this->nmgp_opcao) || (isset($_GET['code'])))
{
$this_script = 'http://';
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
{
$this_script = 'https://';
}
$this_script .= $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
$provider = new Google([
'clientId' => '' . $_SESSION['sett_auth_sn_google_client_id'] . '',
'clientSecret' => '' . $_SESSION['sett_auth_sn_google_secret'] . '',
'redirectUri' => $this_script,
// 'hostedDomain' => 'example.com', // optional; used to restrict access to users on your G Suite/Google Apps for Business accounts
]);
$_SESSION['google_error_msg'] = '';
if (!empty($_GET['error'])) {
// Got an error, probably user denied access
$_SESSION['google_error_msg'] = ('Got error: ' . htmlspecialchars($_GET['error'], ENT_QUOTES, 'UTF-8'));
} elseif (empty($_GET['code'])) {
// If we don't have an authorization code then get one
$authUrl = $provider->getAuthorizationUrl();
$_SESSION['oauth2state'] = $provider->getState();
header('Location: ' . $authUrl);
exit;
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
// State is invalid, possible CSRF attack in progress
unset($_SESSION['oauth2state']);
$_SESSION['google_error_msg'] = ('Invalid state');
} else {
$token = $provider->getAccessToken('authorization_code', [
'code' => $_GET['code']
]);
$_SESSION['google_user'] = '';
$_SESSION['google_name'] = '';
$_SESSION['google_photo'] = '';
$_SESSION['google_email'] = '';
// Optional: Now you have a token you can look up a users profile data
try {
// We got an access token, let's now get the owner details
$ownerDetails = $provider->getResourceOwner($token);
// Use these details to create a new profile
$_SESSION['google_user'] = $ownerDetails->getId();
$_SESSION['google_name'] = $ownerDetails->getName();
$_SESSION['google_photo'] = $ownerDetails->getAvatar();
$_SESSION['google_email'] = $ownerDetails->getEmail();
$this->go_return();
} catch (Exception $e) {
// Failed to get user details
$_SESSION['google_error_msg'] = ('Something went wrong: ' . $e->getMessage());
}
if(isset($_SESSION['google_error_msg'])){
echo $_SESSION['google_error_msg'];
}
}
}
}
if (!isset($this->NM_ajax_flag) || ('validate_' != substr($this->NM_ajax_opcao, 0, 9) && 'add_new_line' != $this->NM_ajax_opcao))
{
if ((isset($this->nm_form_submit) && '1' == $this->nm_form_submit && isset($this->nmgp_opcao) && 'twitter_login' == $this->nmgp_opcao) || (isset($_GET['oauth_token']) && isset($_GET['oauth_verifier'])))
{
define('CONSUMER_KEY', '' . $_SESSION['sett_auth_sn_x_key'] . '');
define('CONSUMER_SECRET', '' . $_SESSION['sett_auth_sn_x_secret'] . '');
define('OAUTH_CALLBACK', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
include_once($this->Ini->path_third ."/twitteroauth/autoload.php");
if (!isset($_GET['oauth_token']) || !isset($_GET['oauth_verifier'])) {
$twitterConnection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
$twitterRequestToken = $twitterConnection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));
$_SESSION['oauth_token'] = $twitterRequestToken['oauth_token'];
$_SESSION['oauth_token_secret'] = $twitterRequestToken['oauth_token_secret'];
if ($twitterConnection->getLastHttpCode() == 200) {
header('Location: ' . $twitterConnection->url('oauth/authorize', array('oauth_token' => $twitterRequestToken['oauth_token'])));
exit;
}
}
else {
if (isset($_REQUEST['oauth_token']) && $_SESSION['oauth_token'] !== $_REQUEST['oauth_token']) {
echo "Error in settings of API";
}
else {
$twitterConnection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
$twitterAccessToken = $twitterConnection->oauth("oauth/access_token", array("oauth_verifier" => $_REQUEST['oauth_verifier']));
$_SESSION['access_token'] = $twitterAccessToken;
if (200 == $twitterConnection->getLastHttpCode()) {
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $twitterAccessToken['oauth_token'], $twitterAccessToken['oauth_token_secret']);
$twitterContent = $connection->get('account/verify_credentials',['include_email' => 'true']);
$_SESSION['twitter_user'] = $twitterContent->id;
$_SESSION['twitter_photo'] = $twitterContent->profile_image_url_https;
$_SESSION['twitter_name'] = $twitterContent->name;
$_SESSION['twitter_email'] = $twitterContent->email;
$this->tw_return();
}
}
}
}
} $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]['app2_Login']['Field_no_validate'])) ? $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Field_no_validate'] : array();
$this->nm_location = $this->Ini->sc_protocolo . $this->Ini->server . $dir_raiz;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['opc_edit'] = true;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dados_select']))
{
$this->nmgp_dados_select = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dados_select'];
}
}
function loadFieldConfig()
{
$this->field_config = array();
//-- nutaquilla
$this->field_config['nutaquilla'] = array();
$this->field_config['nutaquilla']['symbol_grp'] = $_SESSION['scriptcase']['reg_conf']['grup_num'];
$this->field_config['nutaquilla']['symbol_fmt'] = $_SESSION['scriptcase']['reg_conf']['num_group_digit'];
$this->field_config['nutaquilla']['symbol_dec'] = '';
$this->field_config['nutaquilla']['symbol_neg'] = $_SESSION['scriptcase']['reg_conf']['simb_neg'];
$this->field_config['nutaquilla']['format_neg'] = $_SESSION['scriptcase']['reg_conf']['neg_num'];
//-- perfil
$this->field_config['perfil'] = array();
$this->field_config['perfil']['symbol_grp'] = $_SESSION['scriptcase']['reg_conf']['grup_num'];
$this->field_config['perfil']['symbol_fmt'] = $_SESSION['scriptcase']['reg_conf']['num_group_digit'];
$this->field_config['perfil']['symbol_dec'] = '';
$this->field_config['perfil']['symbol_neg'] = $_SESSION['scriptcase']['reg_conf']['simb_neg'];
$this->field_config['perfil']['format_neg'] = $_SESSION['scriptcase']['reg_conf']['neg_num'];
//-- fechacierre
$this->field_config['fechacierre'] = array();
$this->field_config['fechacierre']['date_format'] = $_SESSION['scriptcase']['reg_conf']['date_format'];
$this->field_config['fechacierre']['date_sep'] = $_SESSION['scriptcase']['reg_conf']['date_sep'];
$this->field_config['fechacierre']['date_display'] = "ddmmaaaa";
$this->new_date_format('DT', 'fechacierre');
//-- fechahoy
$this->field_config['fechahoy'] = array();
$this->field_config['fechahoy']['date_format'] = $_SESSION['scriptcase']['reg_conf']['date_format'];
$this->field_config['fechahoy']['date_sep'] = $_SESSION['scriptcase']['reg_conf']['date_sep'];
$this->field_config['fechahoy']['date_display'] = "ddmmaaaa";
$this->new_date_format('DT', 'fechahoy');
//-- idoficina
$this->field_config['idoficina'] = array();
$this->field_config['idoficina']['symbol_grp'] = $_SESSION['scriptcase']['reg_conf']['grup_num'];
$this->field_config['idoficina']['symbol_fmt'] = $_SESSION['scriptcase']['reg_conf']['num_group_digit'];
$this->field_config['idoficina']['symbol_dec'] = '';
$this->field_config['idoficina']['symbol_neg'] = $_SESSION['scriptcase']['reg_conf']['simb_neg'];
$this->field_config['idoficina']['format_neg'] = $_SESSION['scriptcase']['reg_conf']['neg_num'];
//-- jornada
$this->field_config['jornada'] = array();
$this->field_config['jornada']['symbol_grp'] = $_SESSION['scriptcase']['reg_conf']['grup_num'];
$this->field_config['jornada']['symbol_fmt'] = $_SESSION['scriptcase']['reg_conf']['num_group_digit'];
$this->field_config['jornada']['symbol_dec'] = '';
$this->field_config['jornada']['symbol_neg'] = $_SESSION['scriptcase']['reg_conf']['simb_neg'];
$this->field_config['jornada']['format_neg'] = $_SESSION['scriptcase']['reg_conf']['neg_num'];
//-- nuperfil
$this->field_config['nuperfil'] = array();
$this->field_config['nuperfil']['symbol_grp'] = $_SESSION['scriptcase']['reg_conf']['grup_num'];
$this->field_config['nuperfil']['symbol_fmt'] = $_SESSION['scriptcase']['reg_conf']['num_group_digit'];
$this->field_config['nuperfil']['symbol_dec'] = '';
$this->field_config['nuperfil']['symbol_neg'] = $_SESSION['scriptcase']['reg_conf']['simb_neg'];
$this->field_config['nuperfil']['format_neg'] = $_SESSION['scriptcase']['reg_conf']['neg_num'];
}
function controle()
{
global $nm_url_saida, $teste_validade,
$glo_senha_protect, $bok, $nm_apl_dependente, $nm_form_submit, $nm_opc_form_php, $nm_call_php, $nm_opc_lookup, $nmgp_redir;
$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_idempresa' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'idempresa');
}
if ('validate_login' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'login');
}
if ('validate_pswd' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'pswd');
}
if ('validate_new_user' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'new_user');
}
if ('validate_retrieve_pswd' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'retrieve_pswd');
}
if ('validate_idtaquilla' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'idtaquilla');
}
if ('validate_nutaquilla' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'nutaquilla');
}
if ('validate_perfil' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'perfil');
}
if ('validate_nomtaquilla' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'nomtaquilla');
}
if ('validate_idusuario2' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'idusuario2');
}
if ('validate_fechacierre' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'fechacierre');
}
if ('validate_fechahoy' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'fechahoy');
}
if ('validate_nomoficina' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'nomoficina');
}
if ('validate_idoficina' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'idoficina');
}
if ('validate_taquillaactual' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'taquillaactual');
}
if ('validate_jornada' == $this->NM_ajax_opcao)
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros, 'jornada');
}
app2_Login_pack_ajax_response();
exit;
}
if ($this->NM_ajax_flag && 'event_' == substr($this->NM_ajax_opcao, 0, 6))
{
$this->nm_tira_formatacao();
$this->nm_converte_datas();
if ('event_idtaquilla_onchange' == $this->NM_ajax_opcao)
{
$this->idtaquilla_onChange();
}
if ('event_login_onchange' == $this->NM_ajax_opcao)
{
$this->login_onChange();
}
if ('event_login_onfocus' == $this->NM_ajax_opcao)
{
$this->login_onFocus();
}
if ('event_pswd_onchange' == $this->NM_ajax_opcao)
{
$this->pswd_onChange();
}
if ('event_pswd_onfocus' == $this->NM_ajax_opcao)
{
$this->pswd_onFocus();
}
app2_Login_pack_ajax_response();
exit;
}
if (isset($this->sc_inline_call) && 'Y' == $this->sc_inline_call)
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['inline_form_seq'] = $this->sc_seq_row;
$this->nm_tira_formatacao();
$this->nm_converte_datas();
}
if ($this->nmgp_opcao == "recarga" || $this->nmgp_opcao == "recarga_mobile" || $this->nmgp_opcao == "muda_form")
{
if (is_array($this->remember_me))
{
$x = 0;
$this->remember_me_1 = $this->remember_me;
$this->remember_me = "";
if ($this->remember_me_1 != "")
{
foreach ($this->remember_me_1 as $dados_remember_me_1 )
{
if ($x != 0)
{
$this->remember_me .= ";";
}
$this->remember_me .= $dados_remember_me_1;
$x++ ;
}
}
}
$this->nm_tira_formatacao();
$this->nm_converte_datas();
$nm_sc_sv_opcao = $this->nmgp_opcao;
$this->nmgp_opcao = "nada";
if ($this->NM_ajax_flag)
{
$this->ajax_return_values();
app2_Login_pack_ajax_response();
exit;
}
$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) ;
if ($this->nmgp_opcao != "incluir")
{
$this->scFormFocusErrorName = '';
}
$_SESSION['scriptcase']['app2_Login']['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)
{
app2_Login_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")
{
$this->Valida_campos($Campos_Crit, $Campos_Falta, $Campos_Erros) ;
$_SESSION['scriptcase']['app2_Login']['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)
{
app2_Login_pack_ajax_response();
exit;
}
$campos_erro = $this->Formata_Erros($Campos_Crit, $Campos_Falta, $Campos_Erros);
$this->Campos_Mens_erro = "";
$this->Erro->mensagem(__FILE__, __LINE__, "critica", $campos_erro);
$this->nmgp_opc_ant = $this->nmgp_opcao ;
if ($this->nmgp_opcao == "incluir")
{
$GLOBALS["erro_incl"] = 1;
}
$this->nmgp_opcao = "nada" ;
}
}
//
if (!isset($nm_form_submit) && $this->nmgp_opcao != "nada")
{
$this->login = "" ;
$this->pswd = "" ;
$this->remember_me = "" ;
$this->new_user = "" ;
$this->retrieve_pswd = "" ;
$this->language = "" ;
$this->idusuario2 = "" ;
$this->idempresa = "" ;
$this->idtaquilla = "" ;
$this->idoficina = "" ;
$this->cargo = "" ;
$this->nomoficina = "" ;
$this->perfil = "" ;
$this->idusuario = "" ;
$this->nutaquilla = "" ;
$this->nomtaquilla = "" ;
$this->nuperfil = "" ;
$this->fechacierre = "" ;
$this->fechahoy = date('Y') . "-" . date('m') . "-" . date('d');
nm_conv_form_data($this->fechahoy, "aaaa-mm-dd", "AAAAMMDD", array($this->field_config['fechahoy']['date_sep'])) ;
$this->pruebas = "" ;
$this->bdbasedatos = "" ;
$this->empresa = "" ;
$this->taquillaactual = "" ;
$this->jornada = "" ;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dados_form']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dados_form']))
{
foreach ($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dados_form'] as $NM_campo => $NM_valor)
{
$$NM_campo = $NM_valor;
}
}
}
else
{
if ($this->nmgp_opcao != "nada")
{
}
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]['app2_Login']['recarga'] = $this->nmgp_opcao;
}
if ($Campos_Crit != "" || !empty($Campos_Falta) || $this->Campos_Mens_erro != "" || $campos_erro != "" || !isset($this->bok) || $this->bok != "OK" || $this->nmgp_opcao == "recarga")
{
if ($Campos_Crit == "" && empty($Campos_Falta) && $this->Campos_Mens_erro == "" && !isset($this->bok) && $this->nmgp_opcao != "recarga")
{
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos']))
{
$idempresa = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][0];
$login = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][1];
$pswd = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][2];
$new_user = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][3];
$retrieve_pswd = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][4];
$idtaquilla = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][5];
$nutaquilla = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][6];
$perfil = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][7];
$nomtaquilla = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][8];
$idusuario2 = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][9];
$fechacierre = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][10];
$fechahoy = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][11];
$nomoficina = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][12];
$idoficina = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][13];
$taquillaactual = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][14];
$jornada = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][15];
}
}
$this->nm_gera_html();
$this->NM_close_db();
}
elseif (isset($this->bok) && $this->bok == "OK")
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'] = array();
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][0] = $this->idempresa;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][1] = $this->login;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][2] = $this->pswd;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][3] = $this->new_user;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][4] = $this->retrieve_pswd;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][5] = $this->idtaquilla;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][6] = $this->nutaquilla;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][7] = $this->perfil;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][8] = $this->nomtaquilla;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][9] = $this->idusuario2;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][10] = $this->fechacierre;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][11] = $this->fechahoy;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][12] = $this->nomoficina;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][13] = $this->idoficina;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][14] = $this->taquillaactual;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['campos'][15] = $this->jornada;
if (!empty($this->new_user))
{
$trab_saida = $this->new_user;
$diretorio = explode("/", $trab_saida);
if (count($diretorio) > 2 || count($diretorio) == 0 || strtolower(substr($this->new_user, 0, 7)) == "http://" || strtolower(substr($this->new_user, 0, 8)) == "https://" || strtolower(substr($this->new_user, 0, 3)) == "../")
{
$_SESSION['scriptcase']['sc_url_saida'][$this->Ini->sc_page] = $trab_saida;
}
else
{
if (count($diretorio) == 1)
{
$limpa_dir = 2;
$compoe_url = str_replace(".php", "", $trab_saida);
$trab_saida = SC_dir_app_name($compoe_url) . "/";
}
else
{
$limpa_dir = 3;
$trab_saida = $diretorio[0] . "/";
$compoe_url = str_replace(".php", "", $diretorio[1]);
$trab_saida .= $compoe_url . "/" . $compoe_url . ".php";
}
$trab_path = explode("/", $_SERVER['PHP_SELF']);
$trab_count_path = count($trab_path);
$path_retorno_aplicacao = "";
for ($ix = 0; $ix + $limpa_dir < $trab_count_path; $ix++)
{
$path_retorno_aplicacao .= $trab_path[$ix] . "/";
}
$path_retorno_aplicacao .= $trab_saida;
$_SESSION['scriptcase']['sc_url_saida'][$this->Ini->sc_page] = $path_retorno_aplicacao;
$nm_apl_dependente = 1;
}
$this->NM_close_db();
$this->nmgp_redireciona();
exit;
}
if (!empty($this->retrieve_pswd))
{
$trab_saida = $this->retrieve_pswd;
$diretorio = explode("/", $trab_saida);
if (count($diretorio) > 2 || count($diretorio) == 0 || strtolower(substr($this->retrieve_pswd, 0, 7)) == "http://" || strtolower(substr($this->retrieve_pswd, 0, 8)) == "https://" || strtolower(substr($this->retrieve_pswd, 0, 3)) == "../")
{
$_SESSION['scriptcase']['sc_url_saida'][$this->Ini->sc_page] = $trab_saida;
}
else
{
if (count($diretorio) == 1)
{
$limpa_dir = 2;
$compoe_url = str_replace(".php", "", $trab_saida);
$trab_saida = SC_dir_app_name($compoe_url) . "/";
}
else
{
$limpa_dir = 3;
$trab_saida = $diretorio[0] . "/";
$compoe_url = str_replace(".php", "", $diretorio[1]);
$trab_saida .= $compoe_url . "/" . $compoe_url . ".php";
}
$trab_path = explode("/", $_SERVER['PHP_SELF']);
$trab_count_path = count($trab_path);
$path_retorno_aplicacao = "";
for ($ix = 0; $ix + $limpa_dir < $trab_count_path; $ix++)
{
$path_retorno_aplicacao .= $trab_path[$ix] . "/";
}
$path_retorno_aplicacao .= $trab_saida;
$_SESSION['scriptcase']['sc_url_saida'][$this->Ini->sc_page] = $path_retorno_aplicacao;
$nm_apl_dependente = 1;
}
$this->NM_close_db();
$this->nmgp_redireciona();
exit;
}
if ($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['redir'] == "redir")
{
$this->nmgp_redireciona();
}
else
{
$contr_menu = "";
if ($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['iframe_menu'])
{
$contr_menu = "glo_menu";
}
if (isset($_SESSION['scriptcase']['sc_ult_apl_menu']) && in_array("app2_Login", $_SESSION['scriptcase']['sc_ult_apl_menu']))
{
$this->NM_close_db();
$this->nmgp_redireciona_form("app2_Login_fim.php", $this->nm_location, $contr_menu);
}
else
{
$this->nm_gera_html();
if (!$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['embutida_proc'])
{
$this->NM_close_db();
}
}
}
$this->NM_close_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
exit;
}
}
$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[] = "'
sc_init_menu . "\" target=\"#NMIframe#\">" . $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) . "app2_Login.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]['app2_Login'][$path_doc_md5][0] = $Arq_htm;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login'][$path_doc_md5][1] = $Zip_name;
?>
>
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 .= '| ' . $this->Ini->Nm_lang['lang_errm_reqd'] . ' | ';
foreach ($aCols as $aCol)
{
$sError .= '' . implode(' ', $aCol) . ' | ';
}
$sError .= '
';
$sError .= '
';
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 .= '| ' . $this->Ini->Nm_lang['lang_errm_flds'] . ' | ';
foreach ($aCols as $aCol)
{
$sError .= '' . implode(' ', $aCol) . ' | ';
}
$sError .= '
';
$sError .= '
';
return $sError;
}
function Formata_Campos_Erros($Campos_Erros)
{
$sError = '
';
foreach ($Campos_Erros as $campo => $erros)
{
$sError .= '';
$sError .= '| ' . $this->Recupera_Nome_Campo($campo) . ': | ';
$sError .= '' . implode(' ', array_unique($erros)) . ' | ';
$sError .= '
';
}
$sError .= '
';
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 'idempresa':
return "Empresa";
break;
case 'login':
return "" . $this->Ini->Nm_lang['lang_sec_users_fild_login'] . "";
break;
case 'pswd':
return "" . $this->Ini->Nm_lang['lang_sec_users_fild_pswd'] . "";
break;
case 'new_user':
return "new_user";
break;
case 'retrieve_pswd':
return "retrieve_pswd";
break;
case 'idtaquilla':
return "Taquilla";
break;
case 'nutaquilla':
return "nutaquilla";
break;
case 'perfil':
return "perfil";
break;
case 'nomtaquilla':
return "nomtaquilla";
break;
case 'idusuario2':
return "idusuario2";
break;
case 'fechacierre':
return "fechacierre";
break;
case 'fechahoy':
return "fechahoy";
break;
case 'nomoficina':
return "nomoficina";
break;
case 'idoficina':
return "idoficina";
break;
case 'taquillaactual':
return "";
break;
case 'jornada':
return "jornada";
break;
case 'remember_me':
return "";
break;
case 'language':
return "" . $this->Ini->Nm_lang['lang_btns_lang'] . "";
break;
case 'cargo':
return "Cargo";
break;
case 'idusuario':
return "idusuario";
break;
case 'nuperfil':
return "nuperfil";
break;
case 'pruebas':
return "Accesos de Prueba";
break;
case 'bdbasedatos':
return "base de datos";
break;
case 'empresa':
return "Empresa";
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->scFormFocusErrorName = '';
$this->sc_force_zero = array();
if (true && (!isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['captcha_display']) || $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['captcha_display'] != 'none')) {
include_once 'app2_Login_securimage.php';
$img_secur = new securimage();
$valid = $img_secur->check($this->captcha_code);
if (!$valid)
{
$this->Campos_Mens_erro .= (empty($this->Campos_Mens_erro)) ? "" : "
";
$this->Campos_Mens_erro .= "CAPTCHA: " . $this->Ini->Nm_lang['lang_othr_cptc_errm'] . "";
if ($this->NM_ajax_flag)
{
if (!isset($this->NM_ajax_info['errList']['geral_app2_Login']) || !is_array($this->NM_ajax_info['errList']['geral_app2_Login']))
{
$this->NM_ajax_info['errList']['geral_app2_Login'] = array();
}
$this->NM_ajax_info['errList']['geral_app2_Login'][] = "CAPTCHA: " . $this->Ini->Nm_lang['lang_othr_cptc_errm'] . "";
}
}
}
if (!is_array($filtro) && '' == $filtro && isset($this->nm_form_submit) && '1' == $this->nm_form_submit && isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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_app2_Login']) || !is_array($this->NM_ajax_info['errList']['geral_app2_Login']))
{
$this->NM_ajax_info['errList']['geral_app2_Login'] = array();
}
$this->NM_ajax_info['errList']['geral_app2_Login'][] = "CSRF: " . $this->Ini->Nm_lang['lang_errm_ajax_csrf'];
}
}
if ((!is_array($filtro) && ('' == $filtro || 'idempresa' == $filtro)) || (is_array($filtro) && in_array('idempresa', $filtro)))
$this->ValidateField_idempresa($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "idempresa";
if ((!is_array($filtro) && ('' == $filtro || 'login' == $filtro)) || (is_array($filtro) && in_array('login', $filtro)))
$this->ValidateField_login($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "login";
if ((!is_array($filtro) && ('' == $filtro || 'pswd' == $filtro)) || (is_array($filtro) && in_array('pswd', $filtro)))
$this->ValidateField_pswd($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "pswd";
if ((!is_array($filtro) && ('' == $filtro || 'new_user' == $filtro)) || (is_array($filtro) && in_array('new_user', $filtro)))
$this->ValidateField_new_user($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "new_user";
if ((!is_array($filtro) && ('' == $filtro || 'retrieve_pswd' == $filtro)) || (is_array($filtro) && in_array('retrieve_pswd', $filtro)))
$this->ValidateField_retrieve_pswd($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "retrieve_pswd";
if ((!is_array($filtro) && ('' == $filtro || 'idtaquilla' == $filtro)) || (is_array($filtro) && in_array('idtaquilla', $filtro)))
$this->ValidateField_idtaquilla($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "idtaquilla";
if ((!is_array($filtro) && ('' == $filtro || 'nutaquilla' == $filtro)) || (is_array($filtro) && in_array('nutaquilla', $filtro)))
$this->ValidateField_nutaquilla($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "nutaquilla";
if ((!is_array($filtro) && ('' == $filtro || 'perfil' == $filtro)) || (is_array($filtro) && in_array('perfil', $filtro)))
$this->ValidateField_perfil($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "perfil";
if ((!is_array($filtro) && ('' == $filtro || 'nomtaquilla' == $filtro)) || (is_array($filtro) && in_array('nomtaquilla', $filtro)))
$this->ValidateField_nomtaquilla($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "nomtaquilla";
if ((!is_array($filtro) && ('' == $filtro || 'idusuario2' == $filtro)) || (is_array($filtro) && in_array('idusuario2', $filtro)))
$this->ValidateField_idusuario2($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "idusuario2";
if ((!is_array($filtro) && ('' == $filtro || 'fechacierre' == $filtro)) || (is_array($filtro) && in_array('fechacierre', $filtro)))
$this->ValidateField_fechacierre($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "fechacierre";
if ((!is_array($filtro) && ('' == $filtro || 'fechahoy' == $filtro)) || (is_array($filtro) && in_array('fechahoy', $filtro)))
$this->ValidateField_fechahoy($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "fechahoy";
if ((!is_array($filtro) && ('' == $filtro || 'nomoficina' == $filtro)) || (is_array($filtro) && in_array('nomoficina', $filtro)))
$this->ValidateField_nomoficina($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "nomoficina";
if ((!is_array($filtro) && ('' == $filtro || 'idoficina' == $filtro)) || (is_array($filtro) && in_array('idoficina', $filtro)))
$this->ValidateField_idoficina($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "idoficina";
if ((!is_array($filtro) && ('' == $filtro || 'taquillaactual' == $filtro)) || (is_array($filtro) && in_array('taquillaactual', $filtro)))
$this->ValidateField_taquillaactual($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "taquillaactual";
if ((!is_array($filtro) && ('' == $filtro || 'jornada' == $filtro)) || (is_array($filtro) && in_array('jornada', $filtro)))
$this->ValidateField_jornada($Campos_Crit, $Campos_Falta, $Campos_Erros);
if ((!isset($this->scFormFocusErrorName) || '' == $this->scFormFocusErrorName) && ( !empty($Campos_Crit) || !empty($Campos_Falta) ))
$this->scFormFocusErrorName = "jornada";
//-- converter datas
$this->nm_converte_datas();
//---
if (empty($Campos_Crit) && empty($Campos_Falta))
{
if (!isset($this->NM_ajax_flag) || 'validate_' != substr($this->NM_ajax_opcao, 0, 9))
{
/*----- Scriptcase Locale: Event onValidate ------*/
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (isset($this->NM_ajax_flag) && $this->NM_ajax_flag)
{
$original_login = $this->login;
$original_nomoficina = $this->nomoficina;
$original_pswd = $this->pswd;
}
if (!isset($this->sc_temp_sett_enable_2fa_mode)) {$this->sc_temp_sett_enable_2fa_mode = (isset($_SESSION['sett_enable_2fa_mode'])) ? $_SESSION['sett_enable_2fa_mode'] : "";}
if (!isset($this->sc_temp_sett_mfa_last_updated)) {$this->sc_temp_sett_mfa_last_updated = (isset($_SESSION['sett_mfa_last_updated'])) ? $_SESSION['sett_mfa_last_updated'] : "";}
if (!isset($this->sc_temp_sett_enable_2fa)) {$this->sc_temp_sett_enable_2fa = (isset($_SESSION['sett_enable_2fa'])) ? $_SESSION['sett_enable_2fa'] : "";}
if (!isset($this->sc_temp_sett_pswd_last_updated)) {$this->sc_temp_sett_pswd_last_updated = (isset($_SESSION['sett_pswd_last_updated'])) ? $_SESSION['sett_pswd_last_updated'] : "";}
if (!isset($this->sc_temp_sett_group_administrator)) {$this->sc_temp_sett_group_administrator = (isset($_SESSION['sett_group_administrator'])) ? $_SESSION['sett_group_administrator'] : "";}
if (!isset($this->sc_temp_usr_groups)) {$this->sc_temp_usr_groups = (isset($_SESSION['usr_groups'])) ? $_SESSION['usr_groups'] : "";}
if (!isset($this->sc_temp_nomoficina)) {$this->sc_temp_nomoficina = (isset($_SESSION['nomoficina'])) ? $_SESSION['nomoficina'] : "";}
if (!isset($this->sc_temp_usr_picture)) {$this->sc_temp_usr_picture = (isset($_SESSION['usr_picture'])) ? $_SESSION['usr_picture'] : "";}
if (!isset($this->sc_temp_remember_me)) {$this->sc_temp_remember_me = (isset($_SESSION['remember_me'])) ? $_SESSION['remember_me'] : "";}
if (!isset($this->sc_temp_usr_perfil)) {$this->sc_temp_usr_perfil = (isset($_SESSION['usr_perfil'])) ? $_SESSION['usr_perfil'] : "";}
if (!isset($this->sc_temp_usr_oficina)) {$this->sc_temp_usr_oficina = (isset($_SESSION['usr_oficina'])) ? $_SESSION['usr_oficina'] : "";}
if (!isset($this->sc_temp_usr_phone)) {$this->sc_temp_usr_phone = (isset($_SESSION['usr_phone'])) ? $_SESSION['usr_phone'] : "";}
if (!isset($this->sc_temp_usr_email)) {$this->sc_temp_usr_email = (isset($_SESSION['usr_email'])) ? $_SESSION['usr_email'] : "";}
if (!isset($this->sc_temp_usr_name)) {$this->sc_temp_usr_name = (isset($_SESSION['usr_name'])) ? $_SESSION['usr_name'] : "";}
if (!isset($this->sc_temp_usr_priv_admin)) {$this->sc_temp_usr_priv_admin = (isset($_SESSION['usr_priv_admin'])) ? $_SESSION['usr_priv_admin'] : "";}
if (!isset($this->sc_temp_sett_login_mode)) {$this->sc_temp_sett_login_mode = (isset($_SESSION['sett_login_mode'])) ? $_SESSION['sett_login_mode'] : "";}
if (!isset($this->sc_temp_usr_login)) {$this->sc_temp_usr_login = (isset($_SESSION['usr_login'])) ? $_SESSION['usr_login'] : "";}
$slogin = $this->Db->qstr($this->login );
$spswd = $this->Db->qstr(hash("md5",$this->pswd ));
switch( $this->sc_temp_sett_login_mode ){
default:
case 'username':
$str_login_validate = "login =". $slogin;
break;
case 'email':
$str_login_validate = "email =". $slogin;
break;
case 'both':
$str_login_validate = "(login =". $slogin . " OR email =".$slogin . ")";
break;
}
$sql = "SELECT
priv_admin,
active,
name,
email,
mfa,
pswd_last_updated,
login,
phone,
picture,
mfa_last_updated,
oficina,
perfil
FROM sec1_users
WHERE
".$str_login_validate."
AND pswd = ".$spswd."";
$nm_select = $sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if ( ($this->rs === false) || (!is_array($this->rs) ) || (empty($this->rs)) )
{
;
$this->sc_logged_in_fail($this->login );
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= $this->Ini->Nm_lang['lang_error_login'] ;
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = $this->Ini->Nm_lang['lang_error_login'] ;
}
;
}
else if($this->rs[0][1] == 'Y')
{
$this->sc_temp_usr_login = $this->rs[0][6];
$this->sc_temp_usr_priv_admin = ($this->rs[0][0] == 'Y') ? TRUE : FALSE;
$this->sc_temp_usr_name = $this->rs[0][2];
$this->sc_temp_usr_email = $this->rs[0][3];
$this->sc_temp_usr_phone = $this->rs[0][7];
$this->sc_temp_usr_oficina = $this->rs[0][10];
$this->sc_temp_usr_perfil = $this->rs[0][11];
$this->sc_temp_remember_me = $this->remember_me ;
$this->sc_temp_usr_picture = '';
$usr_grp = array();
$check_sql = "SELECT nomoficina"
. " FROM oficinas"
. " WHERE idoficina = '" . $oficina . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->nomoficina = $this->rs[0][0];
}
else
{
$other_field = "";
$other_region = "";
}
$this->sc_temp_nomoficina = "Oficina: ".$this->nomoficina ;
$nm_select = "SELECT group_id FROM sec1_users_groups WHERE login =". $this->Db->qstr($this->sc_temp_usr_login);
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs_groups = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
$SCrx->fields[0] = str_replace(',', '.', $SCrx->fields[0]);
$SCrx->fields[0] = (strpos(strtolower($SCrx->fields[0]), "e")) ? (float)$SCrx->fields[0] : $SCrx->fields[0];
$SCrx->fields[0] = (string)$SCrx->fields[0];
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs_groups[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs_groups = false;
$this->rs_groups_erro = $this->Db->ErrorMsg();
}
if(isset($this->rs_groups[0][0])){
foreach($this->rs_groups as $r){
$usr_grp[] = $r[0];
}
}
$this->sc_temp_usr_groups = $usr_grp;
if(in_array($this->sc_temp_sett_group_administrator, $this->sc_temp_usr_groups)){
$this->sc_temp_usr_priv_admin = TRUE;
}
if(!empty($this->rs[0][8])){
$path_img = $_SESSION['scriptcase']['app2_Login']['glo_nm_path_imag_temp'] .'/sc_img_'. $this->sc_temp_usr_login . hash("md5",date('YmdHis')) . '.png';
file_put_contents($this->Ini->root . $path_img, $this->rs[0][8]);
$this->sc_temp_usr_picture = $path_img;
}
if( $this->sc_temp_sett_pswd_last_updated != 0 ){
$diff = $this->nm_data->Dif_Datas(date("Y-m-d", strtotime($this->rs[0][5] . " +".$this->sc_temp_sett_pswd_last_updated. "days") ), "aaaa-mm-dd", date("Y-m-d"), "aaaa-mm-dd");
if($diff <= 0){
$code = hash("md5",date("YmdHis"));
$nm_select ="UPDATE sec1_users SET activation_code=".$this->Db->qstr($code) . " WHERE login=". $this->Db->qstr($this->sc_temp_usr_login);
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
if ($this->Ini->sc_tem_trans_banco)
{
$this->Db->CommitTrans();
$this->Ini->sc_tem_trans_banco = false;
}
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_sett_login_mode)) { $_SESSION['sett_login_mode'] = $this->sc_temp_sett_login_mode;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_usr_oficina)) { $_SESSION['usr_oficina'] = $this->sc_temp_usr_oficina;}
if (isset($this->sc_temp_usr_perfil)) { $_SESSION['usr_perfil'] = $this->sc_temp_usr_perfil;}
if (isset($this->sc_temp_remember_me)) { $_SESSION['remember_me'] = $this->sc_temp_remember_me;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_nomoficina)) { $_SESSION['nomoficina'] = $this->sc_temp_nomoficina;}
if (isset($this->sc_temp_usr_groups)) { $_SESSION['usr_groups'] = $this->sc_temp_usr_groups;}
if (isset($this->sc_temp_sett_group_administrator)) { $_SESSION['sett_group_administrator'] = $this->sc_temp_sett_group_administrator;}
if (isset($this->sc_temp_sett_pswd_last_updated)) { $_SESSION['sett_pswd_last_updated'] = $this->sc_temp_sett_pswd_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa)) { $_SESSION['sett_enable_2fa'] = $this->sc_temp_sett_enable_2fa;}
if (isset($this->sc_temp_sett_mfa_last_updated)) { $_SESSION['sett_mfa_last_updated'] = $this->sc_temp_sett_mfa_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa_mode)) { $_SESSION['sett_enable_2fa_mode'] = $this->sc_temp_sett_enable_2fa_mode;}
if (!isset($this->Campos_Mens_erro) || empty($this->Campos_Mens_erro))
{
$this->nmgp_redireciona_form($this->Ini->path_link . "" . SC_dir_app_name('app2_change_pswd') . "/", $this->nm_location, "act_code?#?" . NM_encode_input($code) . "?@?" . "pswd_expired?#?" . NM_encode_input("1") . "?@?", "_self", "ret_self", 440, 630);
};
}
}
if( isset($this->sc_temp_sett_enable_2fa) && $this->sc_temp_sett_enable_2fa == 'Y' ){
if(!empty($this->rs[0][4])){
$mfa_key = ($_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '').($_SERVER['REMOTE_ADDR'] ?? '' ). ($_SERVER['HTTP_HOST'] ?? '') . ($_SERVER['SERVER_NAME'] ?? '') . ($_SERVER['HTTP_USER_AGENT'] ?? '');
$mfa_key = '_'.hash("md5",$mfa_key);
$diff = 0;
if( $this->sc_temp_sett_mfa_last_updated != 0 && !empty($this->rs[0][9]) ){
$diff = $this->nm_data->Dif_Datas(
date("Y-m-d", strtotime($this->rs[0][9] . " +".$this->sc_temp_sett_mfa_last_updated. "days") ),
"aaaa-mm-dd",
date("Y-m-d"),
"aaaa-mm-dd");
}
$diff_cookie = 0;
if(isset($_COOKIE[ $mfa_key ]) && !empty($_COOKIE[ $mfa_key ])){
$diff_cookie = $this->nm_data->Dif_Datas(
date("Y-m-d", strtotime(decode_string($_COOKIE[ $mfa_key ]) . " +".$this->sc_temp_sett_mfa_last_updated. "days") ),
"aaaa-mm-dd",
date("Y-m-d"),
"aaaa-mm-dd");
}
if($diff <= 0 || $diff_cookie <= 0){
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_sett_login_mode)) { $_SESSION['sett_login_mode'] = $this->sc_temp_sett_login_mode;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_usr_oficina)) { $_SESSION['usr_oficina'] = $this->sc_temp_usr_oficina;}
if (isset($this->sc_temp_usr_perfil)) { $_SESSION['usr_perfil'] = $this->sc_temp_usr_perfil;}
if (isset($this->sc_temp_remember_me)) { $_SESSION['remember_me'] = $this->sc_temp_remember_me;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_nomoficina)) { $_SESSION['nomoficina'] = $this->sc_temp_nomoficina;}
if (isset($this->sc_temp_usr_groups)) { $_SESSION['usr_groups'] = $this->sc_temp_usr_groups;}
if (isset($this->sc_temp_sett_group_administrator)) { $_SESSION['sett_group_administrator'] = $this->sc_temp_sett_group_administrator;}
if (isset($this->sc_temp_sett_pswd_last_updated)) { $_SESSION['sett_pswd_last_updated'] = $this->sc_temp_sett_pswd_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa)) { $_SESSION['sett_enable_2fa'] = $this->sc_temp_sett_enable_2fa;}
if (isset($this->sc_temp_sett_mfa_last_updated)) { $_SESSION['sett_mfa_last_updated'] = $this->sc_temp_sett_mfa_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa_mode)) { $_SESSION['sett_enable_2fa_mode'] = $this->sc_temp_sett_enable_2fa_mode;}
if (!isset($this->Campos_Mens_erro) || empty($this->Campos_Mens_erro))
{
$this->nmgp_redireciona_form($this->Ini->path_link . "" . SC_dir_app_name('app2_control_2fa') . "/", $this->nm_location, "", "_self", "ret_self", 440, 630);
};
}
}
else if($this->sc_temp_sett_enable_2fa_mode == 'all'){
$_SESSION['scriptcase']['sc_apl_seg']['app2_add_2fa'] = "on";;
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_sett_login_mode)) { $_SESSION['sett_login_mode'] = $this->sc_temp_sett_login_mode;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_usr_oficina)) { $_SESSION['usr_oficina'] = $this->sc_temp_usr_oficina;}
if (isset($this->sc_temp_usr_perfil)) { $_SESSION['usr_perfil'] = $this->sc_temp_usr_perfil;}
if (isset($this->sc_temp_remember_me)) { $_SESSION['remember_me'] = $this->sc_temp_remember_me;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_nomoficina)) { $_SESSION['nomoficina'] = $this->sc_temp_nomoficina;}
if (isset($this->sc_temp_usr_groups)) { $_SESSION['usr_groups'] = $this->sc_temp_usr_groups;}
if (isset($this->sc_temp_sett_group_administrator)) { $_SESSION['sett_group_administrator'] = $this->sc_temp_sett_group_administrator;}
if (isset($this->sc_temp_sett_pswd_last_updated)) { $_SESSION['sett_pswd_last_updated'] = $this->sc_temp_sett_pswd_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa)) { $_SESSION['sett_enable_2fa'] = $this->sc_temp_sett_enable_2fa;}
if (isset($this->sc_temp_sett_mfa_last_updated)) { $_SESSION['sett_mfa_last_updated'] = $this->sc_temp_sett_mfa_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa_mode)) { $_SESSION['sett_enable_2fa_mode'] = $this->sc_temp_sett_enable_2fa_mode;}
if (!isset($this->Campos_Mens_erro) || empty($this->Campos_Mens_erro))
{
$this->nmgp_redireciona_form($this->Ini->path_link . "" . SC_dir_app_name('app2_add_2fa') . "/", $this->nm_location, "redir_menu?#?" . NM_encode_input("1") . "?@?", "_self", "ret_self", 440, 630);
};
}
}
$this->remember_me_validate();
}
else
{
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= $this->Ini->Nm_lang['lang_error_not_active'] ;
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = $this->Ini->Nm_lang['lang_error_not_active'] ;
}
;
if (isset($this->Campos_Mens_erro) && !empty($this->Campos_Mens_erro))
{
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_sett_login_mode)) { $_SESSION['sett_login_mode'] = $this->sc_temp_sett_login_mode;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_usr_oficina)) { $_SESSION['usr_oficina'] = $this->sc_temp_usr_oficina;}
if (isset($this->sc_temp_usr_perfil)) { $_SESSION['usr_perfil'] = $this->sc_temp_usr_perfil;}
if (isset($this->sc_temp_remember_me)) { $_SESSION['remember_me'] = $this->sc_temp_remember_me;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_nomoficina)) { $_SESSION['nomoficina'] = $this->sc_temp_nomoficina;}
if (isset($this->sc_temp_usr_groups)) { $_SESSION['usr_groups'] = $this->sc_temp_usr_groups;}
if (isset($this->sc_temp_sett_group_administrator)) { $_SESSION['sett_group_administrator'] = $this->sc_temp_sett_group_administrator;}
if (isset($this->sc_temp_sett_pswd_last_updated)) { $_SESSION['sett_pswd_last_updated'] = $this->sc_temp_sett_pswd_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa)) { $_SESSION['sett_enable_2fa'] = $this->sc_temp_sett_enable_2fa;}
if (isset($this->sc_temp_sett_mfa_last_updated)) { $_SESSION['sett_mfa_last_updated'] = $this->sc_temp_sett_mfa_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa_mode)) { $_SESSION['sett_enable_2fa_mode'] = $this->sc_temp_sett_enable_2fa_mode;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
return;
}
}
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_sett_login_mode)) { $_SESSION['sett_login_mode'] = $this->sc_temp_sett_login_mode;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_usr_oficina)) { $_SESSION['usr_oficina'] = $this->sc_temp_usr_oficina;}
if (isset($this->sc_temp_usr_perfil)) { $_SESSION['usr_perfil'] = $this->sc_temp_usr_perfil;}
if (isset($this->sc_temp_remember_me)) { $_SESSION['remember_me'] = $this->sc_temp_remember_me;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_nomoficina)) { $_SESSION['nomoficina'] = $this->sc_temp_nomoficina;}
if (isset($this->sc_temp_usr_groups)) { $_SESSION['usr_groups'] = $this->sc_temp_usr_groups;}
if (isset($this->sc_temp_sett_group_administrator)) { $_SESSION['sett_group_administrator'] = $this->sc_temp_sett_group_administrator;}
if (isset($this->sc_temp_sett_pswd_last_updated)) { $_SESSION['sett_pswd_last_updated'] = $this->sc_temp_sett_pswd_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa)) { $_SESSION['sett_enable_2fa'] = $this->sc_temp_sett_enable_2fa;}
if (isset($this->sc_temp_sett_mfa_last_updated)) { $_SESSION['sett_mfa_last_updated'] = $this->sc_temp_sett_mfa_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa_mode)) { $_SESSION['sett_enable_2fa_mode'] = $this->sc_temp_sett_enable_2fa_mode;}
if (isset($this->NM_ajax_flag) && $this->NM_ajax_flag)
{
if (isset($Ctrl_Proc_Onload) && $Ctrl_Proc_Onload) {
$Ctrl_Format = true;
$this->nm_guardar_campos();
if ($bFormat) $this->nm_formatar_campos();
}
if (($original_login != $this->login || (isset($bFlagRead_login) && $bFlagRead_login)))
{
$this->ajax_return_values_login(true);
}
if (($original_nomoficina != $this->nomoficina || (isset($bFlagRead_nomoficina) && $bFlagRead_nomoficina)))
{
$this->ajax_return_values_nomoficina(true);
}
if (($original_pswd != $this->pswd || (isset($bFlagRead_pswd) && $bFlagRead_pswd)))
{
$this->ajax_return_values_pswd(true);
}
}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
/*----- END - Scriptcase Locale: Event onValidate ------*/
}
}
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]);
}
}
}
if (empty($Campos_Crit) && empty($Campos_Falta) && empty($this->Campos_Mens_erro))
{
if (!isset($this->NM_ajax_flag) || 'validate_' != substr($this->NM_ajax_opcao, 0, 9))
{
/*----- Scriptcase Locale: Event onValidateSuccess ------*/
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (isset($this->NM_ajax_flag) && $this->NM_ajax_flag)
{
$original_fechacierre = $this->fechacierre;
$original_idempresa = $this->idempresa;
$original_idoficina = $this->idoficina;
$original_idtaquilla = $this->idtaquilla;
$original_idusuario2 = $this->idusuario2;
$original_jornada = $this->jornada;
$original_login = $this->login;
$original_nomoficina = $this->nomoficina;
$original_nomtaquilla = $this->nomtaquilla;
$original_nutaquilla = $this->nutaquilla;
$original_perfil = $this->perfil;
$original_pswd = $this->pswd;
$original_taquillaactual = $this->taquillaactual;
}
if ($this->fechacierre != "" && $this->perfil == 4 && $this->jornada == 0){
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 usuario ya cerró caja hoy. No Autorizado para mÔs ventas..';
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = 'Este usuario ya cerró caja hoy. No Autorizado para mÔs ventas..';
}
;
if (isset($this->Campos_Mens_erro) && !empty($this->Campos_Mens_erro))
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
return;
}
}
if ($this->idempresa == ""){
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= 'Debe seleccionar una Empresa ..';
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = 'Debe seleccionar una Empresa ..';
}
;
if (isset($this->Campos_Mens_erro) && !empty($this->Campos_Mens_erro))
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
return;
}
}
if ($this->perfil == 4 && $this->nutaquilla == 0 ){
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= 'Debe seleccionar una Taquilla ...';
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = 'Debe seleccionar una Taquilla ...';
}
;
if (isset($this->Campos_Mens_erro) && !empty($this->Campos_Mens_erro))
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
return;
}
}
if ($this->perfil == 4 && $this->nomtaquilla == "" ){
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= 'Debe seleccionar una Taquilla ...';
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = 'Debe seleccionar una Taquilla ...';
}
;
if (isset($this->Campos_Mens_erro) && !empty($this->Campos_Mens_erro))
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
return;
}
}
if ($this->idusuario2 != $this->login && $this->idusuario2 != "0" && $this->perfil == 4) {
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= 'Taquilla ocupada por otro Usuario...';
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = 'Taquilla ocupada por otro Usuario...';
}
;
if (isset($this->Campos_Mens_erro) && !empty($this->Campos_Mens_erro))
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
return;
}
}
if ($this->nomtaquilla == "" and $this->perfil == 4){
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= 'Verifique su usuario y clave para ingresar al sistema...';
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = 'Verifique su usuario y clave para ingresar al sistema...';
}
;
if (isset($this->Campos_Mens_erro) && !empty($this->Campos_Mens_erro))
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
return;
}
}
if ($this->perfil != 4) {
$this->nutaquilla = 0;
}
if($this->idoficina == 0){
$check_sql = "SELECT nomtaquilla,idoficina"
. " FROM taquillas"
. " WHERE idusuario = '" . $this->login . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->idtaquilla = $this->rs[0][0];
$this->idoficina = $this->rs[0][1];
}
}
if($this->perfil == 4){
$this->taquillaactual = $this->nomtaquilla ;
}else{
$this->taquillaactual = "";
}
$this->sc_validate_success();
if (isset($this->NM_ajax_flag) && $this->NM_ajax_flag)
{
if (isset($Ctrl_Proc_Onload) && $Ctrl_Proc_Onload) {
$Ctrl_Format = true;
$this->nm_guardar_campos();
if ($bFormat) $this->nm_formatar_campos();
}
if (($original_fechacierre != $this->fechacierre || (isset($bFlagRead_fechacierre) && $bFlagRead_fechacierre)))
{
$this->ajax_return_values_fechacierre(true);
}
if (($original_idempresa != $this->idempresa || (isset($bFlagRead_idempresa) && $bFlagRead_idempresa)))
{
$this->ajax_return_values_idempresa(true);
}
if (($original_idoficina != $this->idoficina || (isset($bFlagRead_idoficina) && $bFlagRead_idoficina)))
{
$this->ajax_return_values_idoficina(true);
}
if (($original_idtaquilla != $this->idtaquilla || (isset($bFlagRead_idtaquilla) && $bFlagRead_idtaquilla)))
{
$this->ajax_return_values_idtaquilla(true);
}
if (($original_idusuario2 != $this->idusuario2 || (isset($bFlagRead_idusuario2) && $bFlagRead_idusuario2)))
{
$this->ajax_return_values_idusuario2(true);
}
if (($original_jornada != $this->jornada || (isset($bFlagRead_jornada) && $bFlagRead_jornada)))
{
$this->ajax_return_values_jornada(true);
}
if (($original_login != $this->login || (isset($bFlagRead_login) && $bFlagRead_login)))
{
$this->ajax_return_values_login(true);
}
if (($original_nomoficina != $this->nomoficina || (isset($bFlagRead_nomoficina) && $bFlagRead_nomoficina)))
{
$this->ajax_return_values_nomoficina(true);
}
if (($original_nomtaquilla != $this->nomtaquilla || (isset($bFlagRead_nomtaquilla) && $bFlagRead_nomtaquilla)))
{
$this->ajax_return_values_nomtaquilla(true);
}
if (($original_nutaquilla != $this->nutaquilla || (isset($bFlagRead_nutaquilla) && $bFlagRead_nutaquilla)))
{
$this->ajax_return_values_nutaquilla(true);
}
if (($original_perfil != $this->perfil || (isset($bFlagRead_perfil) && $bFlagRead_perfil)))
{
$this->ajax_return_values_perfil(true);
}
if (($original_pswd != $this->pswd || (isset($bFlagRead_pswd) && $bFlagRead_pswd)))
{
$this->ajax_return_values_pswd(true);
}
if (($original_taquillaactual != $this->taquillaactual || (isset($bFlagRead_taquillaactual) && $bFlagRead_taquillaactual)))
{
$this->ajax_return_values_taquillaactual(true);
}
}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
/*----- END - Scriptcase Locale: Event onValidateSuccess ------*/
}
}
}
function ValidateField_idempresa(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['idempresa'])) {
return;
}
if (!empty($this->idempresa) && isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa']) && !in_array($this->idempresa, $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa']))
{
$hasError = true;
$Campos_Crit .= $this->Ini->Nm_lang['lang_errm_ajax_data'];
if (!isset($Campos_Erros['idempresa']))
{
$Campos_Erros['idempresa'] = array();
}
$Campos_Erros['idempresa'][] = $this->Ini->Nm_lang['lang_errm_ajax_data'];
if (!isset($this->NM_ajax_info['errList']['idempresa']) || !is_array($this->NM_ajax_info['errList']['idempresa']))
{
$this->NM_ajax_info['errList']['idempresa'] = array();
}
$this->NM_ajax_info['errList']['idempresa'][] = $this->Ini->Nm_lang['lang_errm_ajax_data'];
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'idempresa';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_idempresa
function ValidateField_login(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['login'])) {
return;
}
if ($this->nmgp_opcao != "excluir")
{
if (NM_utf8_strlen($this->login) > 255)
{
$hasError = true;
$Campos_Crit .= "" . $this->Ini->Nm_lang['lang_sec_users_fild_login'] . " " . $this->Ini->Nm_lang['lang_errm_mxch'] . " 255 " . $this->Ini->Nm_lang['lang_errm_nchr'];
if (!isset($Campos_Erros['login']))
{
$Campos_Erros['login'] = array();
}
$Campos_Erros['login'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 255 " . $this->Ini->Nm_lang['lang_errm_nchr'];
if (!isset($this->NM_ajax_info['errList']['login']) || !is_array($this->NM_ajax_info['errList']['login']))
{
$this->NM_ajax_info['errList']['login'] = array();
}
$this->NM_ajax_info['errList']['login'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 255 " . $this->Ini->Nm_lang['lang_errm_nchr'];
}
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'login';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_login
function ValidateField_pswd(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['pswd'])) {
return;
}
if ($this->nmgp_opcao != "excluir")
{
if (NM_utf8_strlen($this->pswd) > 255)
{
$hasError = true;
$Campos_Crit .= "" . $this->Ini->Nm_lang['lang_sec_users_fild_pswd'] . " " . $this->Ini->Nm_lang['lang_errm_mxch'] . " 255 " . $this->Ini->Nm_lang['lang_errm_nchr'];
if (!isset($Campos_Erros['pswd']))
{
$Campos_Erros['pswd'] = array();
}
$Campos_Erros['pswd'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 255 " . $this->Ini->Nm_lang['lang_errm_nchr'];
if (!isset($this->NM_ajax_info['errList']['pswd']) || !is_array($this->NM_ajax_info['errList']['pswd']))
{
$this->NM_ajax_info['errList']['pswd'] = array();
}
$this->NM_ajax_info['errList']['pswd'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 255 " . $this->Ini->Nm_lang['lang_errm_nchr'];
}
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'pswd';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_pswd
function ValidateField_new_user(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['new_user'])) {
return;
}
if ($this->nmgp_opcao != "excluir")
{
if (trim($this->new_user) != "")
{
}
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'new_user';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_new_user
function ValidateField_retrieve_pswd(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['retrieve_pswd'])) {
return;
}
if ($this->nmgp_opcao != "excluir")
{
if (trim($this->retrieve_pswd) != "")
{
}
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'retrieve_pswd';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_retrieve_pswd
function ValidateField_idtaquilla(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['idtaquilla'])) {
return;
}
if (!empty($this->idtaquilla) && isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla']) && !in_array($this->idtaquilla, $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla']))
{
$hasError = true;
$Campos_Crit .= $this->Ini->Nm_lang['lang_errm_ajax_data'];
if (!isset($Campos_Erros['idtaquilla']))
{
$Campos_Erros['idtaquilla'] = array();
}
$Campos_Erros['idtaquilla'][] = $this->Ini->Nm_lang['lang_errm_ajax_data'];
if (!isset($this->NM_ajax_info['errList']['idtaquilla']) || !is_array($this->NM_ajax_info['errList']['idtaquilla']))
{
$this->NM_ajax_info['errList']['idtaquilla'] = array();
}
$this->NM_ajax_info['errList']['idtaquilla'][] = $this->Ini->Nm_lang['lang_errm_ajax_data'];
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'idtaquilla';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_idtaquilla
function ValidateField_nutaquilla(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['nutaquilla'])) {
nm_limpa_numero($this->nutaquilla, $this->field_config['nutaquilla']['symbol_grp']) ;
return;
}
if ($this->nutaquilla === "" || is_null($this->nutaquilla))
{
$this->nutaquilla = 0;
$this->sc_force_zero[] = 'nutaquilla';
}
nm_limpa_numero($this->nutaquilla, $this->field_config['nutaquilla']['symbol_grp']) ;
if ($this->nmgp_opcao != "excluir")
{
if ($this->nutaquilla != '')
{
$iTestSize = 2;
if ('-' == substr($this->nutaquilla, 0, 1))
{
$iTestSize++;
}
elseif ('-' == substr($this->nutaquilla, -1))
{
$iTestSize++;
$this->nutaquilla = '-' . substr($this->nutaquilla, 0, -1);
}
if (strlen($this->nutaquilla) > $iTestSize)
{
$hasError = true;
$Campos_Crit .= "nutaquilla: " . $this->Ini->Nm_lang['lang_errm_size'];
if (!isset($Campos_Erros['nutaquilla']))
{
$Campos_Erros['nutaquilla'] = array();
}
$Campos_Erros['nutaquilla'][] = $this->Ini->Nm_lang['lang_errm_size'];
if (!isset($this->NM_ajax_info['errList']['nutaquilla']) || !is_array($this->NM_ajax_info['errList']['nutaquilla']))
{
$this->NM_ajax_info['errList']['nutaquilla'] = array();
}
$this->NM_ajax_info['errList']['nutaquilla'][] = $this->Ini->Nm_lang['lang_errm_size'];
}
if ($teste_validade->Valor($this->nutaquilla, 2, 0, 0, 0, "S") == false)
{
$hasError = true;
$Campos_Crit .= "nutaquilla; " ;
if (!isset($Campos_Erros['nutaquilla']))
{
$Campos_Erros['nutaquilla'] = array();
}
$Campos_Erros['nutaquilla'][] = "" . $this->Ini->Nm_lang['lang_errm_ajax_data'] . "";
if (!isset($this->NM_ajax_info['errList']['nutaquilla']) || !is_array($this->NM_ajax_info['errList']['nutaquilla']))
{
$this->NM_ajax_info['errList']['nutaquilla'] = array();
}
$this->NM_ajax_info['errList']['nutaquilla'][] = "" . $this->Ini->Nm_lang['lang_errm_ajax_data'] . "";
}
}
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'nutaquilla';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_nutaquilla
function ValidateField_perfil(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['perfil'])) {
nm_limpa_numero($this->perfil, $this->field_config['perfil']['symbol_grp']) ;
return;
}
if ($this->perfil === "" || is_null($this->perfil))
{
$this->perfil = 0;
$this->sc_force_zero[] = 'perfil';
}
nm_limpa_numero($this->perfil, $this->field_config['perfil']['symbol_grp']) ;
if ($this->nmgp_opcao != "excluir")
{
if ($this->perfil != '')
{
$iTestSize = 20;
if ('-' == substr($this->perfil, 0, 1))
{
$iTestSize++;
}
elseif ('-' == substr($this->perfil, -1))
{
$iTestSize++;
$this->perfil = '-' . substr($this->perfil, 0, -1);
}
if (strlen($this->perfil) > $iTestSize)
{
$hasError = true;
$Campos_Crit .= "perfil: " . $this->Ini->Nm_lang['lang_errm_size'];
if (!isset($Campos_Erros['perfil']))
{
$Campos_Erros['perfil'] = array();
}
$Campos_Erros['perfil'][] = $this->Ini->Nm_lang['lang_errm_size'];
if (!isset($this->NM_ajax_info['errList']['perfil']) || !is_array($this->NM_ajax_info['errList']['perfil']))
{
$this->NM_ajax_info['errList']['perfil'] = array();
}
$this->NM_ajax_info['errList']['perfil'][] = $this->Ini->Nm_lang['lang_errm_size'];
}
if ($teste_validade->Valor($this->perfil, 20, 0, 0, 0, "S") == false)
{
$hasError = true;
$Campos_Crit .= "perfil; " ;
if (!isset($Campos_Erros['perfil']))
{
$Campos_Erros['perfil'] = array();
}
$Campos_Erros['perfil'][] = "" . $this->Ini->Nm_lang['lang_errm_ajax_data'] . "";
if (!isset($this->NM_ajax_info['errList']['perfil']) || !is_array($this->NM_ajax_info['errList']['perfil']))
{
$this->NM_ajax_info['errList']['perfil'] = array();
}
$this->NM_ajax_info['errList']['perfil'][] = "" . $this->Ini->Nm_lang['lang_errm_ajax_data'] . "";
}
}
}
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_nomtaquilla(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['nomtaquilla'])) {
return;
}
if ($this->nmgp_opcao != "excluir")
{
if (NM_utf8_strlen($this->nomtaquilla) > 30)
{
$hasError = true;
$Campos_Crit .= "nomtaquilla " . $this->Ini->Nm_lang['lang_errm_mxch'] . " 30 " . $this->Ini->Nm_lang['lang_errm_nchr'];
if (!isset($Campos_Erros['nomtaquilla']))
{
$Campos_Erros['nomtaquilla'] = array();
}
$Campos_Erros['nomtaquilla'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 30 " . $this->Ini->Nm_lang['lang_errm_nchr'];
if (!isset($this->NM_ajax_info['errList']['nomtaquilla']) || !is_array($this->NM_ajax_info['errList']['nomtaquilla']))
{
$this->NM_ajax_info['errList']['nomtaquilla'] = array();
}
$this->NM_ajax_info['errList']['nomtaquilla'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 30 " . $this->Ini->Nm_lang['lang_errm_nchr'];
}
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'nomtaquilla';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_nomtaquilla
function ValidateField_idusuario2(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['idusuario2'])) {
return;
}
if ($this->nmgp_opcao != "excluir")
{
if (NM_utf8_strlen($this->idusuario2) > 30)
{
$hasError = true;
$Campos_Crit .= "idusuario2 " . $this->Ini->Nm_lang['lang_errm_mxch'] . " 30 " . $this->Ini->Nm_lang['lang_errm_nchr'];
if (!isset($Campos_Erros['idusuario2']))
{
$Campos_Erros['idusuario2'] = array();
}
$Campos_Erros['idusuario2'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 30 " . $this->Ini->Nm_lang['lang_errm_nchr'];
if (!isset($this->NM_ajax_info['errList']['idusuario2']) || !is_array($this->NM_ajax_info['errList']['idusuario2']))
{
$this->NM_ajax_info['errList']['idusuario2'] = array();
}
$this->NM_ajax_info['errList']['idusuario2'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 30 " . $this->Ini->Nm_lang['lang_errm_nchr'];
}
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'idusuario2';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_idusuario2
function ValidateField_fechacierre(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
nm_limpa_data($this->fechacierre, $this->field_config['fechacierre']['date_sep']) ;
if (isset($this->Field_no_validate['fechacierre'])) {
return;
}
$trab_dt_min = "";
$trab_dt_max = "";
if ($this->nmgp_opcao != "excluir")
{
$guarda_datahora = $this->field_config['fechacierre']['date_format'];
if (false !== strpos($guarda_datahora, ';')) $this->field_config['fechacierre']['date_format'] = substr($guarda_datahora, 0, strpos($guarda_datahora, ';'));
$Format_Data = $this->field_config['fechacierre']['date_format'];
nm_limpa_data($Format_Data, $this->field_config['fechacierre']['date_sep']) ;
if (trim($this->fechacierre) != "")
{
$validateTest = $teste_validade->Data($this->fechacierre, $Format_Data, $trab_dt_min, $trab_dt_max);
if ($validateTest == false)
{
$hasError = true;
$Campos_Crit .= "fechacierre; " ;
if (!isset($Campos_Erros['fechacierre']))
{
$Campos_Erros['fechacierre'] = array();
}
$Campos_Erros['fechacierre'][] = "" . $this->Ini->Nm_lang['lang_errm_ajax_data'] . "";
if (!isset($this->NM_ajax_info['errList']['fechacierre']) || !is_array($this->NM_ajax_info['errList']['fechacierre']))
{
$this->NM_ajax_info['errList']['fechacierre'] = array();
}
$this->NM_ajax_info['errList']['fechacierre'][] = "" . $this->Ini->Nm_lang['lang_errm_ajax_data'] . "";
}
}
$this->field_config['fechacierre']['date_format'] = $guarda_datahora;
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'fechacierre';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_fechacierre
function ValidateField_fechahoy(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
nm_limpa_data($this->fechahoy, $this->field_config['fechahoy']['date_sep']) ;
if (isset($this->Field_no_validate['fechahoy'])) {
return;
}
$trab_dt_min = "";
$trab_dt_max = "";
$trab_dt_min = date('Ymd');
$trab_dt_max = date('Ymd');
if ($this->nmgp_opcao != "excluir")
{
$guarda_datahora = $this->field_config['fechahoy']['date_format'];
if (false !== strpos($guarda_datahora, ';')) $this->field_config['fechahoy']['date_format'] = substr($guarda_datahora, 0, strpos($guarda_datahora, ';'));
$Format_Data = $this->field_config['fechahoy']['date_format'];
nm_limpa_data($Format_Data, $this->field_config['fechahoy']['date_sep']) ;
if (trim($this->fechahoy) != "")
{
$validateTest = $teste_validade->Data($this->fechahoy, $Format_Data, $trab_dt_min, $trab_dt_max);
if ($validateTest == false)
{
$hasError = true;
$Campos_Crit .= "fechahoy; " ;
if (!isset($Campos_Erros['fechahoy']))
{
$Campos_Erros['fechahoy'] = array();
}
$Campos_Erros['fechahoy'][] = "" . $this->Ini->Nm_lang['lang_errm_ajax_data'] . "";
if (!isset($this->NM_ajax_info['errList']['fechahoy']) || !is_array($this->NM_ajax_info['errList']['fechahoy']))
{
$this->NM_ajax_info['errList']['fechahoy'] = array();
}
$this->NM_ajax_info['errList']['fechahoy'][] = "" . $this->Ini->Nm_lang['lang_errm_ajax_data'] . "";
}
}
$this->field_config['fechahoy']['date_format'] = $guarda_datahora;
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'fechahoy';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_fechahoy
function ValidateField_nomoficina(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['nomoficina'])) {
return;
}
if ($this->nmgp_opcao != "excluir")
{
if (NM_utf8_strlen($this->nomoficina) > 20)
{
$hasError = true;
$Campos_Crit .= "nomoficina " . $this->Ini->Nm_lang['lang_errm_mxch'] . " 20 " . $this->Ini->Nm_lang['lang_errm_nchr'];
if (!isset($Campos_Erros['nomoficina']))
{
$Campos_Erros['nomoficina'] = array();
}
$Campos_Erros['nomoficina'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 20 " . $this->Ini->Nm_lang['lang_errm_nchr'];
if (!isset($this->NM_ajax_info['errList']['nomoficina']) || !is_array($this->NM_ajax_info['errList']['nomoficina']))
{
$this->NM_ajax_info['errList']['nomoficina'] = array();
}
$this->NM_ajax_info['errList']['nomoficina'][] = $this->Ini->Nm_lang['lang_errm_mxch'] . " 20 " . $this->Ini->Nm_lang['lang_errm_nchr'];
}
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'nomoficina';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_nomoficina
function ValidateField_idoficina(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['idoficina'])) {
nm_limpa_numero($this->idoficina, $this->field_config['idoficina']['symbol_grp']) ;
return;
}
if ($this->idoficina === "" || is_null($this->idoficina))
{
$this->idoficina = 0;
$this->sc_force_zero[] = 'idoficina';
}
nm_limpa_numero($this->idoficina, $this->field_config['idoficina']['symbol_grp']) ;
if ($this->nmgp_opcao != "excluir")
{
if ($this->idoficina != '')
{
$iTestSize = 20;
if ('-' == substr($this->idoficina, 0, 1))
{
$iTestSize++;
}
elseif ('-' == substr($this->idoficina, -1))
{
$iTestSize++;
$this->idoficina = '-' . substr($this->idoficina, 0, -1);
}
if (strlen($this->idoficina) > $iTestSize)
{
$hasError = true;
$Campos_Crit .= "idoficina: " . $this->Ini->Nm_lang['lang_errm_size'];
if (!isset($Campos_Erros['idoficina']))
{
$Campos_Erros['idoficina'] = array();
}
$Campos_Erros['idoficina'][] = $this->Ini->Nm_lang['lang_errm_size'];
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_size'];
}
if ($teste_validade->Valor($this->idoficina, 20, 0, 0, 0, "S") == false)
{
$hasError = true;
$Campos_Crit .= "idoficina; " ;
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_taquillaactual(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['taquillaactual'])) {
return;
}
if ($this->nmgp_opcao != "excluir")
{
if (trim($this->taquillaactual) != "")
{
}
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'taquillaactual';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_taquillaactual
function ValidateField_jornada(&$Campos_Crit, &$Campos_Falta, &$Campos_Erros)
{
global $teste_validade;
$hasError = false;
if (isset($this->Field_no_validate['jornada'])) {
nm_limpa_numero($this->jornada, $this->field_config['jornada']['symbol_grp']) ;
return;
}
if ($this->jornada === "" || is_null($this->jornada))
{
$this->jornada = 0;
$this->sc_force_zero[] = 'jornada';
}
nm_limpa_numero($this->jornada, $this->field_config['jornada']['symbol_grp']) ;
if ($this->nmgp_opcao != "excluir")
{
if ($this->jornada != '')
{
$iTestSize = 20;
if ('-' == substr($this->jornada, 0, 1))
{
$iTestSize++;
}
elseif ('-' == substr($this->jornada, -1))
{
$iTestSize++;
$this->jornada = '-' . substr($this->jornada, 0, -1);
}
if (strlen($this->jornada) > $iTestSize)
{
$hasError = true;
$Campos_Crit .= "jornada: " . $this->Ini->Nm_lang['lang_errm_size'];
if (!isset($Campos_Erros['jornada']))
{
$Campos_Erros['jornada'] = array();
}
$Campos_Erros['jornada'][] = $this->Ini->Nm_lang['lang_errm_size'];
if (!isset($this->NM_ajax_info['errList']['jornada']) || !is_array($this->NM_ajax_info['errList']['jornada']))
{
$this->NM_ajax_info['errList']['jornada'] = array();
}
$this->NM_ajax_info['errList']['jornada'][] = $this->Ini->Nm_lang['lang_errm_size'];
}
if ($teste_validade->Valor($this->jornada, 20, 0, 0, 0, "S") == false)
{
$hasError = true;
$Campos_Crit .= "jornada; " ;
if (!isset($Campos_Erros['jornada']))
{
$Campos_Erros['jornada'] = array();
}
$Campos_Erros['jornada'][] = "" . $this->Ini->Nm_lang['lang_errm_ajax_data'] . "";
if (!isset($this->NM_ajax_info['errList']['jornada']) || !is_array($this->NM_ajax_info['errList']['jornada']))
{
$this->NM_ajax_info['errList']['jornada'] = array();
}
$this->NM_ajax_info['errList']['jornada'][] = "" . $this->Ini->Nm_lang['lang_errm_ajax_data'] . "";
}
}
}
if ($hasError) {
global $sc_seq_vert;
$fieldName = 'jornada';
if (isset($sc_seq_vert) && '' != $sc_seq_vert) {
$fieldName .= $sc_seq_vert;
}
$this->NM_ajax_info['fieldsWithErrors'][] = $fieldName;
}
} // ValidateField_jornada
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['idempresa'] = $this->idempresa;
$this->nmgp_dados_form['login'] = $this->login;
$this->nmgp_dados_form['pswd'] = $this->pswd;
$this->nmgp_dados_form['new_user'] = $this->new_user;
$this->nmgp_dados_form['retrieve_pswd'] = $this->retrieve_pswd;
$this->nmgp_dados_form['idtaquilla'] = $this->idtaquilla;
$this->nmgp_dados_form['nutaquilla'] = $this->nutaquilla;
$this->nmgp_dados_form['perfil'] = $this->perfil;
$this->nmgp_dados_form['nomtaquilla'] = $this->nomtaquilla;
$this->nmgp_dados_form['idusuario2'] = $this->idusuario2;
$this->nmgp_dados_form['fechacierre'] = (strlen(trim($this->fechacierre)) > 19) ? str_replace(".", ":", $this->fechacierre) : trim($this->fechacierre);
$this->nmgp_dados_form['fechahoy'] = (strlen(trim($this->fechahoy)) > 19) ? str_replace(".", ":", $this->fechahoy) : trim($this->fechahoy);
$this->nmgp_dados_form['nomoficina'] = $this->nomoficina;
$this->nmgp_dados_form['idoficina'] = $this->idoficina;
$this->nmgp_dados_form['taquillaactual'] = $this->taquillaactual;
$this->nmgp_dados_form['jornada'] = $this->jornada;
$this->nmgp_dados_form['remember_me'] = $this->remember_me;
$this->nmgp_dados_form['language'] = $this->language;
$this->nmgp_dados_form['cargo'] = $this->cargo;
$this->nmgp_dados_form['idusuario'] = $this->idusuario;
$this->nmgp_dados_form['nuperfil'] = $this->nuperfil;
$this->nmgp_dados_form['pruebas'] = $this->pruebas;
$this->nmgp_dados_form['bdbasedatos'] = $this->bdbasedatos;
$this->nmgp_dados_form['empresa'] = $this->empresa;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dados_form'] = $this->nmgp_dados_form;
}
function nm_tira_formatacao()
{
global $nm_form_submit;
$this->Before_unformat = array();
$this->formatado = false;
$this->Before_unformat['nutaquilla'] = $this->nutaquilla;
nm_limpa_numero($this->nutaquilla, $this->field_config['nutaquilla']['symbol_grp']) ;
$this->Before_unformat['perfil'] = $this->perfil;
nm_limpa_numero($this->perfil, $this->field_config['perfil']['symbol_grp']) ;
$this->Before_unformat['fechacierre'] = $this->fechacierre;
nm_limpa_data($this->fechacierre, $this->field_config['fechacierre']['date_sep']) ;
$this->Before_unformat['fechahoy'] = $this->fechahoy;
nm_limpa_data($this->fechahoy, $this->field_config['fechahoy']['date_sep']) ;
$this->Before_unformat['idoficina'] = $this->idoficina;
nm_limpa_numero($this->idoficina, $this->field_config['idoficina']['symbol_grp']) ;
$this->Before_unformat['jornada'] = $this->jornada;
nm_limpa_numero($this->jornada, $this->field_config['jornada']['symbol_grp']) ;
$this->Before_unformat['nuperfil'] = $this->nuperfil;
nm_limpa_numero($this->nuperfil, $this->field_config['nuperfil']['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 == "nutaquilla")
{
nm_limpa_numero($this->nutaquilla, $this->field_config['nutaquilla']['symbol_grp']) ;
}
if ($Nome_Campo == "perfil")
{
nm_limpa_numero($this->perfil, $this->field_config['perfil']['symbol_grp']) ;
}
if ($Nome_Campo == "idoficina")
{
nm_limpa_numero($this->idoficina, $this->field_config['idoficina']['symbol_grp']) ;
}
if ($Nome_Campo == "jornada")
{
nm_limpa_numero($this->jornada, $this->field_config['jornada']['symbol_grp']) ;
}
if ($Nome_Campo == "nuperfil")
{
nm_limpa_numero($this->nuperfil, $this->field_config['nuperfil']['symbol_grp']) ;
}
}
function nm_formatar_campos($format_fields = array())
{
global $nm_form_submit;
if (isset($this->formatado) && $this->formatado)
{
return;
}
$this->formatado = true;
if ('' !== $this->nutaquilla || (!empty($format_fields) && isset($format_fields['nutaquilla'])))
{
nmgp_Form_Num_Val($this->nutaquilla, $this->field_config['nutaquilla']['symbol_grp'], $this->field_config['nutaquilla']['symbol_dec'], "0", "S", $this->field_config['nutaquilla']['format_neg'], "", "", "-", $this->field_config['nutaquilla']['symbol_fmt']) ;
}
if ('' !== $this->perfil || (!empty($format_fields) && isset($format_fields['perfil'])))
{
nmgp_Form_Num_Val($this->perfil, $this->field_config['perfil']['symbol_grp'], $this->field_config['perfil']['symbol_dec'], "0", "S", $this->field_config['perfil']['format_neg'], "", "", "-", $this->field_config['perfil']['symbol_fmt']) ;
}
if ((!empty($this->fechacierre) && 'null' != $this->fechacierre) || (!empty($format_fields) && isset($format_fields['fechacierre'])))
{
nm_volta_data($this->fechacierre, $this->field_config['fechacierre']['date_format']) ;
nmgp_Form_Datas($this->fechacierre, $this->field_config['fechacierre']['date_format'], $this->field_config['fechacierre']['date_sep']) ;
}
elseif ('null' == $this->fechacierre || '' == $this->fechacierre)
{
$this->fechacierre = '';
}
if ((!empty($this->fechahoy) && 'null' != $this->fechahoy) || (!empty($format_fields) && isset($format_fields['fechahoy'])))
{
nm_volta_data($this->fechahoy, $this->field_config['fechahoy']['date_format']) ;
nmgp_Form_Datas($this->fechahoy, $this->field_config['fechahoy']['date_format'], $this->field_config['fechahoy']['date_sep']) ;
}
elseif ('null' == $this->fechahoy || '' == $this->fechahoy)
{
$this->fechahoy = '';
}
if ('' !== $this->idoficina || (!empty($format_fields) && isset($format_fields['idoficina'])))
{
nmgp_Form_Num_Val($this->idoficina, $this->field_config['idoficina']['symbol_grp'], $this->field_config['idoficina']['symbol_dec'], "0", "S", $this->field_config['idoficina']['format_neg'], "", "", "-", $this->field_config['idoficina']['symbol_fmt']) ;
}
if ('' !== $this->jornada || (!empty($format_fields) && isset($format_fields['jornada'])))
{
nmgp_Form_Num_Val($this->jornada, $this->field_config['jornada']['symbol_grp'], $this->field_config['jornada']['symbol_dec'], "0", "S", $this->field_config['jornada']['format_neg'], "", "", "-", $this->field_config['jornada']['symbol_fmt']) ;
}
}
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_converte_datas($use_null = true, $bForce = false)
{
if ($this->fechacierre != "")
{
nm_conv_form_data($this->fechacierre, $this->field_config['fechacierre']['date_format'], "AAAAMMDD", array($this->field_config['fechacierre']['date_sep'])) ;
}
if ($this->fechahoy != "")
{
nm_conv_form_data($this->fechahoy, $this->field_config['fechahoy']['date_format'], "AAAAMMDD", array($this->field_config['fechahoy']['date_sep'])) ;
}
}
//
function nm_prep_date_change($cmp_date, $format_dt)
{
$vl_return = "";
if ($cmp_date != 'null') {
$vl_return .= (strpos($format_dt, "yy") !== false) ? substr($cmp_date, 0, 4) : "";
$vl_return .= (strpos($format_dt, "mm") !== false) ? substr($cmp_date, 5, 2) : "";
$vl_return .= (strpos($format_dt, "dd") !== false) ? substr($cmp_date, 8, 2) : "";
$vl_return .= (strpos($format_dt, "hh") !== false) ? substr($cmp_date, 11, 2) : "";
$vl_return .= (strpos($format_dt, "ii") !== false) ? substr($cmp_date, 14, 2) : "";
$vl_return .= (strpos($format_dt, "ss") !== false) ? substr($cmp_date, 17, 2) : "";
}
return $vl_return;
}
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 ajax_return_values()
{
$this->ajax_return_values_idempresa();
$this->ajax_return_values_login();
$this->ajax_return_values_pswd();
$this->ajax_return_values_new_user();
$this->ajax_return_values_retrieve_pswd();
$this->ajax_return_values_idtaquilla();
$this->ajax_return_values_nutaquilla();
$this->ajax_return_values_perfil();
$this->ajax_return_values_nomtaquilla();
$this->ajax_return_values_idusuario2();
$this->ajax_return_values_fechacierre();
$this->ajax_return_values_fechahoy();
$this->ajax_return_values_nomoficina();
$this->ajax_return_values_idoficina();
$this->ajax_return_values_taquillaactual();
$this->ajax_return_values_jornada();
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';
}
} // ajax_return_values
//----- idempresa
function ajax_return_values_idempresa($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("idempresa", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->idempresa);
$aLookup = array();
$this->_tmp_lookup_idempresa = $this->idempresa;
$nmgp_def_dados = "" ;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa'] = array_unique($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa']);
}
else
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa'] = array();
}
$nm_nao_carga = false;
$nmgp_def_dados = "" ;
$old_value_nutaquilla = $this->nutaquilla;
$old_value_perfil = $this->perfil;
$old_value_fechacierre = $this->fechacierre;
$old_value_fechahoy = $this->fechahoy;
$old_value_idoficina = $this->idoficina;
$old_value_jornada = $this->jornada;
$this->nm_tira_formatacao();
if ($this->nmgp_opcao != "nada") {
$this->nm_converte_datas(false);
}
$unformatted_value_nutaquilla = $this->nutaquilla;
$unformatted_value_perfil = $this->perfil;
$unformatted_value_fechacierre = $this->fechacierre;
$unformatted_value_fechahoy = $this->fechahoy;
$unformatted_value_idoficina = $this->idoficina;
$unformatted_value_jornada = $this->jornada;
$remember_me_val_str = "''";
if (!empty($this->remember_me))
{
if (is_array($this->remember_me))
{
$Tmp_array = $this->remember_me;
}
else
{
$Tmp_array = explode(";", $this->remember_me);
}
$remember_me_val_str = "";
foreach ($Tmp_array as $Tmp_val_cmp)
{
if ("" != $remember_me_val_str)
{
$remember_me_val_str .= ", ";
}
$remember_me_val_str .= "'$Tmp_val_cmp'";
}
}
$nm_comando = "SELECT idempresa,empresa FROM empresas ORDER BY idempresa";
$this->nutaquilla = $old_value_nutaquilla;
$this->perfil = $old_value_perfil;
$this->fechacierre = $old_value_fechacierre;
$this->fechahoy = $old_value_fechahoy;
$this->idoficina = $old_value_idoficina;
$this->jornada = $old_value_jornada;
$_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(app2_Login_pack_protect_string(NM_charset_to_utf8($rs->fields[0])) => str_replace('<', '<', app2_Login_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]['app2_Login']['Lookup_idempresa'][] = $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=\"idempresa\"";
if (isset($this->NM_ajax_info['select_html']['idempresa']) && !empty($this->NM_ajax_info['select_html']['idempresa']))
{
$sSelComp = str_replace('{SC_100PERC_CLASS_INPUT}', $this->classes_100perc_fields['input'], $this->NM_ajax_info['select_html']['idempresa']);
}
$sLookup = '';
if (empty($aLookup))
{
$aLookup[] = array('' => '');
}
foreach ($aLookup as $aOption)
{
foreach ($aOption as $sValue => $sLabel)
{
if ($this->idempresa == $sValue)
{
$this->_tmp_lookup_idempresa = $sLabel;
}
$sOpt = ($sValue !== $sLabel) ? $sValue : $sLabel;
$sLookup .= "
";
}
}
$aLookup = $sLookup;
$this->NM_ajax_info['fldList']['idempresa'] = array(
'row' => '',
'type' => 'select',
'valList' => array($sTmpValue),
'optList' => $aLookup,
);
$aLabel = array();
$aLabelTemp = array();
foreach ($this->NM_ajax_info['fldList']['idempresa']['valList'] as $i => $v)
{
$this->NM_ajax_info['fldList']['idempresa']['valList'][$i] = app2_Login_pack_protect_string($v);
}
foreach ($aLookupOrig as $aValData)
{
if (in_array(key($aValData), $this->NM_ajax_info['fldList']['idempresa']['valList']))
{
$aLabelTemp[key($aValData)] = current($aValData);
}
}
foreach ($this->NM_ajax_info['fldList']['idempresa']['valList'] as $iIndex => $sValue)
{
$aLabel[$iIndex] = (isset($aLabelTemp[$sValue])) ? $aLabelTemp[$sValue] : $sValue;
}
$this->NM_ajax_info['fldList']['idempresa']['labList'] = $aLabel;
}
}
//----- login
function ajax_return_values_login($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("login", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->login);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['login'] = array(
'row' => '',
'type' => 'text',
'valList' => array($this->form_encode_input($sTmpValue)),
);
}
}
//----- pswd
function ajax_return_values_pswd($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("pswd", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->pswd);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['pswd'] = array(
'row' => '',
'type' => 'text',
'valList' => array(''),
);
}
}
//----- new_user
function ajax_return_values_new_user($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("new_user", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->new_user);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['new_user'] = array(
'row' => '',
'type' => 'text',
'valList' => array($sTmpValue),
);
}
}
//----- retrieve_pswd
function ajax_return_values_retrieve_pswd($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("retrieve_pswd", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->retrieve_pswd);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['retrieve_pswd'] = array(
'row' => '',
'type' => 'text',
'valList' => array($sTmpValue),
);
}
}
//----- idtaquilla
function ajax_return_values_idtaquilla($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("idtaquilla", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->idtaquilla);
$aLookup = array();
$this->_tmp_lookup_idtaquilla = $this->idtaquilla;
$nmgp_def_dados = "" ;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla'] = array_unique($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla']);
}
else
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla'] = array();
}
$aLookup[] = array(app2_Login_pack_protect_string('') => str_replace('<', '<',app2_Login_pack_protect_string('
')));
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla'][] = '';
$nm_nao_carga = false;
$nmgp_def_dados = "" ;
$old_value_nutaquilla = $this->nutaquilla;
$old_value_perfil = $this->perfil;
$old_value_fechacierre = $this->fechacierre;
$old_value_fechahoy = $this->fechahoy;
$old_value_idoficina = $this->idoficina;
$old_value_jornada = $this->jornada;
$this->nm_tira_formatacao();
if ($this->nmgp_opcao != "nada") {
$this->nm_converte_datas(false);
}
$unformatted_value_nutaquilla = $this->nutaquilla;
$unformatted_value_perfil = $this->perfil;
$unformatted_value_fechacierre = $this->fechacierre;
$unformatted_value_fechahoy = $this->fechahoy;
$unformatted_value_idoficina = $this->idoficina;
$unformatted_value_jornada = $this->jornada;
$nm_comando = "SELECT idtaquilla, nomtaquilla FROM taquillas WHERE perfil = 4 and idusuario = \"0\" ORDER BY nomtaquilla";
$this->nutaquilla = $old_value_nutaquilla;
$this->perfil = $old_value_perfil;
$this->fechacierre = $old_value_fechacierre;
$this->fechahoy = $old_value_fechahoy;
$this->idoficina = $old_value_idoficina;
$this->jornada = $old_value_jornada;
$_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(app2_Login_pack_protect_string(NM_charset_to_utf8($rs->fields[0])) => str_replace('<', '<', app2_Login_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]['app2_Login']['Lookup_idtaquilla'][] = $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=\"idtaquilla\"";
if (isset($this->NM_ajax_info['select_html']['idtaquilla']) && !empty($this->NM_ajax_info['select_html']['idtaquilla']))
{
$sSelComp = str_replace('{SC_100PERC_CLASS_INPUT}', $this->classes_100perc_fields['input'], $this->NM_ajax_info['select_html']['idtaquilla']);
}
$sLookup = '';
if (empty($aLookup))
{
$aLookup[] = array('' => '');
}
foreach ($aLookup as $aOption)
{
foreach ($aOption as $sValue => $sLabel)
{
if ($this->idtaquilla == $sValue)
{
$this->_tmp_lookup_idtaquilla = $sLabel;
}
$sOpt = ($sValue !== $sLabel) ? $sValue : $sLabel;
$sLookup .= "";
}
}
$aLookup = $sLookup;
$this->NM_ajax_info['fldList']['idtaquilla'] = array(
'row' => '',
'type' => 'select',
'valList' => array($sTmpValue),
'optList' => $aLookup,
);
$aLabel = array();
$aLabelTemp = array();
foreach ($this->NM_ajax_info['fldList']['idtaquilla']['valList'] as $i => $v)
{
$this->NM_ajax_info['fldList']['idtaquilla']['valList'][$i] = app2_Login_pack_protect_string($v);
}
foreach ($aLookupOrig as $aValData)
{
if (in_array(key($aValData), $this->NM_ajax_info['fldList']['idtaquilla']['valList']))
{
$aLabelTemp[key($aValData)] = current($aValData);
}
}
foreach ($this->NM_ajax_info['fldList']['idtaquilla']['valList'] as $iIndex => $sValue)
{
$aLabel[$iIndex] = (isset($aLabelTemp[$sValue])) ? $aLabelTemp[$sValue] : $sValue;
}
$this->NM_ajax_info['fldList']['idtaquilla']['labList'] = $aLabel;
}
}
//----- nutaquilla
function ajax_return_values_nutaquilla($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("nutaquilla", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->nutaquilla);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['nutaquilla'] = array(
'row' => '',
'type' => 'text',
'valList' => array($sTmpValue),
);
}
}
//----- 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();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['perfil'] = array(
'row' => '',
'type' => 'text',
'valList' => array($sTmpValue),
);
}
}
//----- nomtaquilla
function ajax_return_values_nomtaquilla($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("nomtaquilla", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->nomtaquilla);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['nomtaquilla'] = array(
'row' => '',
'type' => 'text',
'valList' => array($this->form_encode_input($sTmpValue)),
);
}
}
//----- idusuario2
function ajax_return_values_idusuario2($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("idusuario2", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->idusuario2);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['idusuario2'] = array(
'row' => '',
'type' => 'text',
'valList' => array($this->form_encode_input($sTmpValue)),
);
}
}
//----- fechacierre
function ajax_return_values_fechacierre($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("fechacierre", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->fechacierre);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['fechacierre'] = array(
'row' => '',
'type' => 'text',
'valList' => array($sTmpValue),
);
}
}
//----- fechahoy
function ajax_return_values_fechahoy($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("fechahoy", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->fechahoy);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['fechahoy'] = array(
'row' => '',
'type' => 'text',
'valList' => array($sTmpValue),
);
}
}
//----- nomoficina
function ajax_return_values_nomoficina($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("nomoficina", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->nomoficina);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['nomoficina'] = 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();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['idoficina'] = array(
'row' => '',
'type' => 'text',
'valList' => array($sTmpValue),
);
}
}
//----- taquillaactual
function ajax_return_values_taquillaactual($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("taquillaactual", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->taquillaactual);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['taquillaactual'] = array(
'row' => '',
'type' => 'label',
'valList' => array($sTmpValue),
);
}
}
//----- jornada
function ajax_return_values_jornada($bForce = false)
{
if ('navigate_form' == $this->NM_ajax_opcao || 'backup_line' == $this->NM_ajax_opcao || (isset($this->nmgp_refresh_fields) && in_array("jornada", $this->nmgp_refresh_fields)) || $bForce)
{
$sTmpValue = NM_charset_to_utf8($this->jornada);
$aLookup = array();
$aLookupOrig = $aLookup;
$this->NM_ajax_info['fldList']['jornada'] = array(
'row' => '',
'type' => 'text',
'valList' => array($sTmpValue),
);
}
}
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]['app2_Login']['upload_dir'][$fieldName]))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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]['app2_Login']['upload_dir'][$fieldName][] = $fileName;
}
}
@closedir($resDir);
}
if (!in_array($originalName, $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['upload_dir'][$fieldName]))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['upload_dir'][$fieldName][] = $originalName;
return $originalName;
}
else
{
$newName = $this->fetchFileNextName($originalName, $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['upload_dir'][$fieldName]);
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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
//
/*----- Scriptcase Locale: PHP Method: fb_return ------*/
function fb_return()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_facebook_name)) {$this->sc_temp_facebook_name = (isset($_SESSION['facebook_name'])) ? $_SESSION['facebook_name'] : "";}
if (!isset($this->sc_temp_facebook_email)) {$this->sc_temp_facebook_email = (isset($_SESSION['facebook_email'])) ? $_SESSION['facebook_email'] : "";}
if (!isset($this->sc_temp_facebook_user)) {$this->sc_temp_facebook_user = (isset($_SESSION['facebook_user'])) ? $_SESSION['facebook_user'] : "";}
if (!isset($this->sc_temp_facebook_error_msg)) {$this->sc_temp_facebook_error_msg = (isset($_SESSION['facebook_error_msg'])) ? $_SESSION['facebook_error_msg'] : "";}
if (!isset($this->sc_temp_facebook_error_code)) {$this->sc_temp_facebook_error_code = (isset($_SESSION['facebook_error_code'])) ? $_SESSION['facebook_error_code'] : "";}
if(!empty($this->sc_temp_facebook_error_code))
{
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= 'urlencode($this->sc_temp_facebook_error_msg)';
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = 'urlencode($this->sc_temp_facebook_error_msg)';
}
;
}
else
{
$this->get_social("facebook", $this->sc_temp_facebook_user, $this->sc_temp_facebook_email, $this->sc_temp_facebook_name);
}
if (isset($this->sc_temp_facebook_error_code)) { $_SESSION['facebook_error_code'] = $this->sc_temp_facebook_error_code;}
if (isset($this->sc_temp_facebook_error_msg)) { $_SESSION['facebook_error_msg'] = $this->sc_temp_facebook_error_msg;}
if (isset($this->sc_temp_facebook_user)) { $_SESSION['facebook_user'] = $this->sc_temp_facebook_user;}
if (isset($this->sc_temp_facebook_email)) { $_SESSION['facebook_email'] = $this->sc_temp_facebook_email;}
if (isset($this->sc_temp_facebook_name)) { $_SESSION['facebook_name'] = $this->sc_temp_facebook_name;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: fb_return ------*/
/*----- Scriptcase Locale: PHP Method: get_settings ------*/
function get_settings()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
$check_sql = "SELECT set_name, set_value FROM sec1_settings";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
foreach($this->rs as $f ){
$_SESSION[ 'sett_'. $f[0] ] = $f[1];
}
}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: get_settings ------*/
/*----- Scriptcase Locale: PHP Method: get_social ------*/
function get_social($resource, $user_id, $email, $name, $picture='')
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_sett_enable_2fa_mode)) {$this->sc_temp_sett_enable_2fa_mode = (isset($_SESSION['sett_enable_2fa_mode'])) ? $_SESSION['sett_enable_2fa_mode'] : "";}
if (!isset($this->sc_temp_sett_mfa_last_updated)) {$this->sc_temp_sett_mfa_last_updated = (isset($_SESSION['sett_mfa_last_updated'])) ? $_SESSION['sett_mfa_last_updated'] : "";}
if (!isset($this->sc_temp_sett_enable_2fa)) {$this->sc_temp_sett_enable_2fa = (isset($_SESSION['sett_enable_2fa'])) ? $_SESSION['sett_enable_2fa'] : "";}
if (!isset($this->sc_temp_usr_picture)) {$this->sc_temp_usr_picture = (isset($_SESSION['usr_picture'])) ? $_SESSION['usr_picture'] : "";}
if (!isset($this->sc_temp_sett_group_administrator)) {$this->sc_temp_sett_group_administrator = (isset($_SESSION['sett_group_administrator'])) ? $_SESSION['sett_group_administrator'] : "";}
if (!isset($this->sc_temp_usr_groups)) {$this->sc_temp_usr_groups = (isset($_SESSION['usr_groups'])) ? $_SESSION['usr_groups'] : "";}
if (!isset($this->sc_temp_remember_me)) {$this->sc_temp_remember_me = (isset($_SESSION['remember_me'])) ? $_SESSION['remember_me'] : "";}
if (!isset($this->sc_temp_usr_phone)) {$this->sc_temp_usr_phone = (isset($_SESSION['usr_phone'])) ? $_SESSION['usr_phone'] : "";}
if (!isset($this->sc_temp_usr_email)) {$this->sc_temp_usr_email = (isset($_SESSION['usr_email'])) ? $_SESSION['usr_email'] : "";}
if (!isset($this->sc_temp_usr_name)) {$this->sc_temp_usr_name = (isset($_SESSION['usr_name'])) ? $_SESSION['usr_name'] : "";}
if (!isset($this->sc_temp_usr_priv_admin)) {$this->sc_temp_usr_priv_admin = (isset($_SESSION['usr_priv_admin'])) ? $_SESSION['usr_priv_admin'] : "";}
if (!isset($this->sc_temp_usr_login)) {$this->sc_temp_usr_login = (isset($_SESSION['usr_login'])) ? $_SESSION['usr_login'] : "";}
if(empty($user_id)) return;
$sql = "SELECT
priv_admin,
active,
name,
email,
mfa,
pswd_last_updated,
login,
phone,
picture,
mfa_last_updated
FROM sec1_users
WHERE email = ". $this->Db->qstr($email).
" OR login = (
SELECT
sec1_users_social.login
FROM
sec1_users_social
WHERE
sec1_users_social.resource = '". $resource ."'
AND sec1_users_social.resource_id = ". $this->Db->qstr($user_id) .")";
$nm_select = $sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if($this->rs === false || count($this->rs) == 0)
{
$this->link_user($resource, $user_id, $email, $name, $picture);
;
$this->sc_logged_in_fail($user_id);
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= $this->Ini->Nm_lang['lang_error_login'] ;
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = $this->Ini->Nm_lang['lang_error_login'] ;
}
;
}
else if($this->rs[0][1] == 'Y')
{
$this->sc_temp_usr_login = $this->rs[0][6];
$this->sc_temp_usr_priv_admin = ($this->rs[0][0] == 'Y') ? TRUE : FALSE;
$this->sc_temp_usr_name = $this->rs[0][2];
$this->sc_temp_usr_email = $this->rs[0][3];
$this->sc_temp_usr_phone = $this->rs[0][7];
$this->sc_temp_remember_me = $this->remember_me ;
$usr_grp = array();
$nm_select = "SELECT group_id FROM sec1_users_groups WHERE login =". $this->Db->qstr($this->sc_temp_usr_login);
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs_groups = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
$SCrx->fields[0] = str_replace(',', '.', $SCrx->fields[0]);
$SCrx->fields[0] = (strpos(strtolower($SCrx->fields[0]), "e")) ? (float)$SCrx->fields[0] : $SCrx->fields[0];
$SCrx->fields[0] = (string)$SCrx->fields[0];
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs_groups[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs_groups = false;
$this->rs_groups_erro = $this->Db->ErrorMsg();
}
if(isset($this->rs_groups[0][0])){
foreach($this->rs_groups as $r){
$usr_grp[] = $r[0];
}
}
$this->sc_temp_usr_groups = $usr_grp;
if(in_array($this->sc_temp_sett_group_administrator, $this->sc_temp_usr_groups)){
$this->sc_temp_usr_priv_admin = TRUE;
}
if(!empty($picture)){
$path_img = $_SESSION['scriptcase']['app2_Login']['glo_nm_path_imag_temp'] .'/sc_img_'. $this->sc_temp_usr_login . hash("md5",date('YmdHis')) . '.png';
$picture_data = file_get_contents($picture);
file_put_contents($this->Ini->root . $path_img, $picture_data);
$this->sc_temp_usr_picture = $path_img;
$this->update_login_img($this->sc_temp_usr_login, $picture_data);
}
if(empty($this->sc_temp_usr_picture) && !empty($this->rs[0][8])){
if(substr($this->rs[0][8], 0, 5) != 'http:' && substr($this->rs[0][8], 0, 6) != 'https:'){
$path_img = $_SESSION['scriptcase']['app2_Login']['glo_nm_path_imag_temp'] .'/sc_img_'. $this->sc_temp_usr_login . hash("md5",date('YmdHis')) . '.png';
file_put_contents($this->Ini->root . $path_img, $this->rs[0][8]);
$this->sc_temp_usr_picture = $path_img;
}
else{
$this->sc_temp_usr_picture = $this->rs[0][8];
}
}
if( isset($this->sc_temp_sett_enable_2fa) && $this->sc_temp_sett_enable_2fa == 'Y' ){
if(!empty($this->rs[0][4])){
$mfa_key = ($_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '').($_SERVER['REMOTE_ADDR'] ?? '' ). ($_SERVER['HTTP_HOST'] ?? '') . ($_SERVER['SERVER_NAME'] ?? '') . ($_SERVER['HTTP_USER_AGENT'] ?? '');
$mfa_key = '_'.hash("md5",$mfa_key);
$diff = 0;
if( $this->sc_temp_sett_mfa_last_updated != 0 && !empty($this->rs[0][9]) ){
$diff = $this->nm_data->Dif_Datas(
date("Y-m-d", strtotime($this->rs[0][9] . " +".$this->sc_temp_sett_mfa_last_updated. "days") ),
"aaaa-mm-dd",
date("Y-m-d"),
"aaaa-mm-dd");
}
$diff_cookie = 0;
if(isset($_COOKIE[ $mfa_key ]) && !empty($_COOKIE[ $mfa_key ])){
$diff_cookie = $this->nm_data->Dif_Datas(
date("Y-m-d", strtotime(decode_string($_COOKIE[ $mfa_key ]) . " +".$this->sc_temp_sett_mfa_last_updated. "days") ),
"aaaa-mm-dd",
date("Y-m-d"),
"aaaa-mm-dd");
}
if($diff <= 0 || $diff_cookie <= 0){
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_remember_me)) { $_SESSION['remember_me'] = $this->sc_temp_remember_me;}
if (isset($this->sc_temp_usr_groups)) { $_SESSION['usr_groups'] = $this->sc_temp_usr_groups;}
if (isset($this->sc_temp_sett_group_administrator)) { $_SESSION['sett_group_administrator'] = $this->sc_temp_sett_group_administrator;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_sett_enable_2fa)) { $_SESSION['sett_enable_2fa'] = $this->sc_temp_sett_enable_2fa;}
if (isset($this->sc_temp_sett_mfa_last_updated)) { $_SESSION['sett_mfa_last_updated'] = $this->sc_temp_sett_mfa_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa_mode)) { $_SESSION['sett_enable_2fa_mode'] = $this->sc_temp_sett_enable_2fa_mode;}
if (!isset($this->Campos_Mens_erro) || empty($this->Campos_Mens_erro))
{
$this->nmgp_redireciona_form($this->Ini->path_link . "" . SC_dir_app_name('app2_control_2fa') . "/", $this->nm_location, "", "_self", "ret_self", 440, 630);
};
}
}
else if($this->sc_temp_sett_enable_2fa_mode == 'all'){
$_SESSION['scriptcase']['sc_apl_seg']['app2_add_2fa'] = "on";;
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_remember_me)) { $_SESSION['remember_me'] = $this->sc_temp_remember_me;}
if (isset($this->sc_temp_usr_groups)) { $_SESSION['usr_groups'] = $this->sc_temp_usr_groups;}
if (isset($this->sc_temp_sett_group_administrator)) { $_SESSION['sett_group_administrator'] = $this->sc_temp_sett_group_administrator;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_sett_enable_2fa)) { $_SESSION['sett_enable_2fa'] = $this->sc_temp_sett_enable_2fa;}
if (isset($this->sc_temp_sett_mfa_last_updated)) { $_SESSION['sett_mfa_last_updated'] = $this->sc_temp_sett_mfa_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa_mode)) { $_SESSION['sett_enable_2fa_mode'] = $this->sc_temp_sett_enable_2fa_mode;}
if (!isset($this->Campos_Mens_erro) || empty($this->Campos_Mens_erro))
{
$this->nmgp_redireciona_form($this->Ini->path_link . "" . SC_dir_app_name('app2_add_2fa') . "/", $this->nm_location, "redir_menu?#?" . NM_encode_input("1") . "?@?", "_self", "ret_self", 440, 630);
};
}
}
$this->remember_me_validate();
$this->sc_validate_success();
}
else
{
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= $this->Ini->Nm_lang['lang_error_not_active'] ;
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = $this->Ini->Nm_lang['lang_error_not_active'] ;
}
;
if (isset($this->Campos_Mens_erro) && !empty($this->Campos_Mens_erro))
{
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_remember_me)) { $_SESSION['remember_me'] = $this->sc_temp_remember_me;}
if (isset($this->sc_temp_usr_groups)) { $_SESSION['usr_groups'] = $this->sc_temp_usr_groups;}
if (isset($this->sc_temp_sett_group_administrator)) { $_SESSION['sett_group_administrator'] = $this->sc_temp_sett_group_administrator;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_sett_enable_2fa)) { $_SESSION['sett_enable_2fa'] = $this->sc_temp_sett_enable_2fa;}
if (isset($this->sc_temp_sett_mfa_last_updated)) { $_SESSION['sett_mfa_last_updated'] = $this->sc_temp_sett_mfa_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa_mode)) { $_SESSION['sett_enable_2fa_mode'] = $this->sc_temp_sett_enable_2fa_mode;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
return;
}
}
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_remember_me)) { $_SESSION['remember_me'] = $this->sc_temp_remember_me;}
if (isset($this->sc_temp_usr_groups)) { $_SESSION['usr_groups'] = $this->sc_temp_usr_groups;}
if (isset($this->sc_temp_sett_group_administrator)) { $_SESSION['sett_group_administrator'] = $this->sc_temp_sett_group_administrator;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_sett_enable_2fa)) { $_SESSION['sett_enable_2fa'] = $this->sc_temp_sett_enable_2fa;}
if (isset($this->sc_temp_sett_mfa_last_updated)) { $_SESSION['sett_mfa_last_updated'] = $this->sc_temp_sett_mfa_last_updated;}
if (isset($this->sc_temp_sett_enable_2fa_mode)) { $_SESSION['sett_enable_2fa_mode'] = $this->sc_temp_sett_enable_2fa_mode;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: get_social ------*/
/*----- Scriptcase Locale: PHP Method: go_return ------*/
function go_return()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_google_photo)) {$this->sc_temp_google_photo = (isset($_SESSION['google_photo'])) ? $_SESSION['google_photo'] : "";}
if (!isset($this->sc_temp_google_name)) {$this->sc_temp_google_name = (isset($_SESSION['google_name'])) ? $_SESSION['google_name'] : "";}
if (!isset($this->sc_temp_google_email)) {$this->sc_temp_google_email = (isset($_SESSION['google_email'])) ? $_SESSION['google_email'] : "";}
if (!isset($this->sc_temp_google_user)) {$this->sc_temp_google_user = (isset($_SESSION['google_user'])) ? $_SESSION['google_user'] : "";}
if (!isset($this->sc_temp_google_error_msg)) {$this->sc_temp_google_error_msg = (isset($_SESSION['google_error_msg'])) ? $_SESSION['google_error_msg'] : "";}
if (!isset($this->sc_temp_google_error_code)) {$this->sc_temp_google_error_code = (isset($_SESSION['google_error_code'])) ? $_SESSION['google_error_code'] : "";}
if(!empty($this->sc_temp_google_error_code))
{
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= 'urlencode($this->sc_temp_google_error_msg)';
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = 'urlencode($this->sc_temp_google_error_msg)';
}
;
}
else
{
$this->get_social("google", $this->sc_temp_google_user, $this->sc_temp_google_email, $this->sc_temp_google_name, $this->sc_temp_google_photo);
}
if (isset($this->sc_temp_google_error_code)) { $_SESSION['google_error_code'] = $this->sc_temp_google_error_code;}
if (isset($this->sc_temp_google_error_msg)) { $_SESSION['google_error_msg'] = $this->sc_temp_google_error_msg;}
if (isset($this->sc_temp_google_user)) { $_SESSION['google_user'] = $this->sc_temp_google_user;}
if (isset($this->sc_temp_google_email)) { $_SESSION['google_email'] = $this->sc_temp_google_email;}
if (isset($this->sc_temp_google_name)) { $_SESSION['google_name'] = $this->sc_temp_google_name;}
if (isset($this->sc_temp_google_photo)) { $_SESSION['google_photo'] = $this->sc_temp_google_photo;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: go_return ------*/
/*----- Scriptcase Locale: PHP Method: has_priv ------*/
function has_priv($param)
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
return ($param == 'Y' ? 'on' : 'off');
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: has_priv ------*/
/*----- Scriptcase Locale: Ajax Event idtaquilla_onChange ------*/
function idtaquilla_onChange()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_empresa)) {$this->sc_temp_empresa = (isset($_SESSION['empresa'])) ? $_SESSION['empresa'] : "";}
if (!isset($this->sc_temp_gnomtaquilla)) {$this->sc_temp_gnomtaquilla = (isset($_SESSION['gnomtaquilla'])) ? $_SESSION['gnomtaquilla'] : "";}
if (!isset($this->sc_temp_gnomoficina)) {$this->sc_temp_gnomoficina = (isset($_SESSION['gnomoficina'])) ? $_SESSION['gnomoficina'] : "";}
$original_login = $this->login;
$original_perfil = $this->perfil;
$original_idusuario2 = $this->idusuario2;
$original_idtaquilla = $this->idtaquilla;
$original_nutaquilla = $this->nutaquilla;
$original_nomtaquilla = $this->nomtaquilla;
$original_idoficina = $this->idoficina;
$original_nomoficina = $this->nomoficina;
$original_taquillaactual = $this->taquillaactual;
$date = date('d-m-Y');
$check_sql = "SELECT name,perfil"
. " FROM sec1_users"
. " WHERE login = '" . $this->login . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$nomusuario = $this->rs[0][0];
$this->perfil = $this->rs[0][1];
}
else
{
$other_field = '';
$other_region = '';
}
if($this->perfil == 4 && $this->idusuario2 == '0'){
$check_sql = "SELECT idtaquilla,nomtaquilla,idoficina"
. " FROM taquillas"
. " WHERE idtaquilla = '" . $this->idtaquilla . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->nutaquilla = $this->rs[0][0];
$this->nomtaquilla = $this->rs[0][1];
$this->idoficina = $this->rs[0][2];
$this->nutaquilla = $this->idtaquilla ;
}
else
{
$this->idtaquilla = '';
$this->nomtaquilla = '';
$this->idoficina = '';
$this->idtaquilla = 0;
$this->nutaquilla = 0;
}
}
$check_sql = "SELECT nomoficina"
. " FROM oficinas"
. " WHERE idoficina = '" . $this->idoficina . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->nomoficina = $this->rs[0][0];
}
else
{
$other_field = "";
$other_region = "";
}
$this->sc_temp_gnomoficina = "Oficina: ".$this->nomoficina ;
$this->sc_temp_gnomtaquilla = $this->nomtaquilla ;
if($this->perfil == 4){
$this->taquillaactual = $this->nomtaquilla ;
}else{
$this->taquillaactual = "";
}
$this->sc_temp_empresa =
$this->empresa ."                                                                 Fecha: ".$date."                                               ".$this->nomtaquilla ;
if (isset($this->sc_temp_gnomoficina)) { $_SESSION['gnomoficina'] = $this->sc_temp_gnomoficina;}
if (isset($this->sc_temp_gnomtaquilla)) { $_SESSION['gnomtaquilla'] = $this->sc_temp_gnomtaquilla;}
if (isset($this->sc_temp_empresa)) { $_SESSION['empresa'] = $this->sc_temp_empresa;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
$modificado_login = $this->login;
$modificado_perfil = $this->perfil;
$modificado_idusuario2 = $this->idusuario2;
$modificado_idtaquilla = $this->idtaquilla;
$modificado_nutaquilla = $this->nutaquilla;
$modificado_nomtaquilla = $this->nomtaquilla;
$modificado_idoficina = $this->idoficina;
$modificado_nomoficina = $this->nomoficina;
$modificado_taquillaactual = $this->taquillaactual;
$this->nm_formatar_campos('login', 'perfil', 'idusuario2', 'idtaquilla', 'nutaquilla', 'nomtaquilla', 'idoficina', 'nomoficina', 'taquillaactual');
if ($original_login !== $modificado_login || isset($this->nmgp_cmp_readonly['login']) || (isset($bFlagRead_login) && $bFlagRead_login))
{
$this->ajax_return_values_login(true);
}
if ($original_perfil !== $modificado_perfil || isset($this->nmgp_cmp_readonly['perfil']) || (isset($bFlagRead_perfil) && $bFlagRead_perfil))
{
$this->ajax_return_values_perfil(true);
}
if ($original_idusuario2 !== $modificado_idusuario2 || isset($this->nmgp_cmp_readonly['idusuario2']) || (isset($bFlagRead_idusuario2) && $bFlagRead_idusuario2))
{
$this->ajax_return_values_idusuario2(true);
}
if ($original_idtaquilla !== $modificado_idtaquilla || isset($this->nmgp_cmp_readonly['idtaquilla']) || (isset($bFlagRead_idtaquilla) && $bFlagRead_idtaquilla))
{
$this->ajax_return_values_idtaquilla(true);
}
if ($original_nutaquilla !== $modificado_nutaquilla || isset($this->nmgp_cmp_readonly['nutaquilla']) || (isset($bFlagRead_nutaquilla) && $bFlagRead_nutaquilla))
{
$this->ajax_return_values_nutaquilla(true);
}
if ($original_nomtaquilla !== $modificado_nomtaquilla || isset($this->nmgp_cmp_readonly['nomtaquilla']) || (isset($bFlagRead_nomtaquilla) && $bFlagRead_nomtaquilla))
{
$this->ajax_return_values_nomtaquilla(true);
}
if ($original_idoficina !== $modificado_idoficina || isset($this->nmgp_cmp_readonly['idoficina']) || (isset($bFlagRead_idoficina) && $bFlagRead_idoficina))
{
$this->ajax_return_values_idoficina(true);
}
if ($original_nomoficina !== $modificado_nomoficina || isset($this->nmgp_cmp_readonly['nomoficina']) || (isset($bFlagRead_nomoficina) && $bFlagRead_nomoficina))
{
$this->ajax_return_values_nomoficina(true);
}
if ($original_taquillaactual !== $modificado_taquillaactual || isset($this->nmgp_cmp_readonly['taquillaactual']) || (isset($bFlagRead_taquillaactual) && $bFlagRead_taquillaactual))
{
$this->ajax_return_values_taquillaactual(true);
}
$this->NM_ajax_info['event_field'] = 'idtaquilla';
app2_Login_pack_ajax_response();
exit;
}
/*----- END - Scriptcase Locale: Ajax Event idtaquilla_onChange ------*/
/*----- Scriptcase Locale: PHP Method: link_user ------*/
function link_user($resource, $usr_id, $email, $name, $picture='')
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_sett_group_default)) {$this->sc_temp_sett_group_default = (isset($_SESSION['sett_group_default'])) ? $_SESSION['sett_group_default'] : "";}
if (!isset($this->sc_temp_sett_new_users)) {$this->sc_temp_sett_new_users = (isset($_SESSION['sett_new_users'])) ? $_SESSION['sett_new_users'] : "";}
if (!isset($this->sc_temp_usr_picture)) {$this->sc_temp_usr_picture = (isset($_SESSION['usr_picture'])) ? $_SESSION['usr_picture'] : "";}
if (!isset($this->sc_temp_usr_email)) {$this->sc_temp_usr_email = (isset($_SESSION['usr_email'])) ? $_SESSION['usr_email'] : "";}
if (!isset($this->sc_temp_usr_priv_admin)) {$this->sc_temp_usr_priv_admin = (isset($_SESSION['usr_priv_admin'])) ? $_SESSION['usr_priv_admin'] : "";}
if (!isset($this->sc_temp_usr_login)) {$this->sc_temp_usr_login = (isset($_SESSION['usr_login'])) ? $_SESSION['usr_login'] : "";}
if($this->sc_temp_sett_new_users != 'Y'){
return;
}
$group_default = (int)$this->sc_temp_sett_group_default;
$sql = "INSERT INTO
sec1_users( login, name, pswd, email, active )
VALUES
(". $this->Db->qstr($usr_id). ", ".
$this->Db->qstr($name) . ", ".
$this->Db->qstr(hash("md5",date("YmdHis"))) . ", ".
$this->Db->qstr($email) .
", 'Y'".
")";
$nm_select = $sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
if(!empty($picture)){
$picture_data = file_get_contents($picture);
$picture = $_SESSION['scriptcase']['app2_Login']['glo_nm_path_imag_temp'] .'/sc_img_'. $this->sc_temp_usr_login . hash("md5",date('YmdHis')) . '.png';
file_put_contents($this->Ini->root . $picture, $picture_data);
$this->update_login_img($usr_id, $picture_data);
}
$sql = "INSERT INTO
sec1_users_social( sec1_users_social.login, sec1_users_social.resource, sec1_users_social.resource_id )
VALUES
(". $this->Db->qstr($usr_id). ", ".
$this->Db->qstr($resource) . ", ".
$this->Db->qstr($usr_id) . ")";
$nm_select = $sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
$sql = "INSERT INTO
sec1_users_groups( login, group_id )
VALUES
(". $this->Db->qstr($usr_id). ", ".
$this->Db->qstr($group_default) . ")";
$nm_select = $sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
$usr_login = $usr_id;
$usr_priv_admin = FALSE;
$usr_email = $email;
$usr_picture = $picture;
if (isset($usr_login)) {$this->sc_temp_usr_login = $usr_login;}
;
if (isset($usr_priv_admin)) {$this->sc_temp_usr_priv_admin = $usr_priv_admin;}
;
if (isset($usr_email)) {$this->sc_temp_usr_email = $usr_email;}
;
if (isset($usr_picture)) {$this->sc_temp_usr_picture = $usr_picture;}
;
$this->sc_validate_success();
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_sett_new_users)) { $_SESSION['sett_new_users'] = $this->sc_temp_sett_new_users;}
if (isset($this->sc_temp_sett_group_default)) { $_SESSION['sett_group_default'] = $this->sc_temp_sett_group_default;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: link_user ------*/
/*----- Scriptcase Locale: Ajax Event login_onChange ------*/
function login_onChange()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_empresa)) {$this->sc_temp_empresa = (isset($_SESSION['empresa'])) ? $_SESSION['empresa'] : "";}
if (!isset($this->sc_temp_gnomtaquilla)) {$this->sc_temp_gnomtaquilla = (isset($_SESSION['gnomtaquilla'])) ? $_SESSION['gnomtaquilla'] : "";}
if (!isset($this->sc_temp_gnomoficina)) {$this->sc_temp_gnomoficina = (isset($_SESSION['gnomoficina'])) ? $_SESSION['gnomoficina'] : "";}
if (!isset($this->sc_temp_nomtaquilla)) {$this->sc_temp_nomtaquilla = (isset($_SESSION['nomtaquilla'])) ? $_SESSION['nomtaquilla'] : "";}
$original_login = $this->login;
$original_perfil = $this->perfil;
$original_nutaquilla = $this->nutaquilla;
$original_nomtaquilla = $this->nomtaquilla;
$original_idoficina = $this->idoficina;
$original_idusuario2 = $this->idusuario2;
$original_idtaquilla = $this->idtaquilla;
$original_fechahoy = $this->fechahoy;
$original_fechacierre = $this->fechacierre;
$original_nomoficina = $this->nomoficina;
$original_jornada = $this->jornada;
$original_taquillaactual = $this->taquillaactual;
$date = date('d-m-Y');
$check_sql = "SELECT name,perfil"
. " FROM sec1_users"
. " WHERE login = '" . $this->login . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$nomusuario = $this->rs[0][0];
$this->perfil = $this->rs[0][1];
}
else
{
$other_field = '';
$other_region = '';
}
if($this->perfil == 4){
$check_sql = "SELECT idtaquilla,nomtaquilla,idoficina,idusuario"
. " FROM taquillas"
. " WHERE idusuario = '" . $this->login . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->nutaquilla = $this->rs[0][0];
$this->nomtaquilla = $this->rs[0][1];
$this->idoficina = $this->rs[0][2];
$this->idusuario2 = $this->rs[0][3];
$this->sc_temp_nomtaquilla = $this->nomtaquilla ;
}
else
{
$this->idusuario2 = '0';
$this->idtaquilla = '';
$this->nomtaquilla = '';
$this->idoficina = '';
$this->nutaquilla = 0;
}
}
$check_sql = "SELECT fechacierre"
. " FROM cuadresdecaja"
. " WHERE idusuario = '" . $this->login . "' and fechacierre = '" . $this->fechahoy . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->fechacierre = $this->rs[0][0];
$other_region = $this->rs[0][1];
}
else
{
$other_field = '';
$other_region = '';
$this->fechacierre = '';
}
if ($this->perfil != 4){
$check_sql = "SELECT idtaquilla,nomtaquilla,idoficina"
. " FROM taquillas"
. " WHERE perfil = '" . $this->perfil . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->nutaquilla = $this->rs[0][0];
$this->nomtaquilla = $this->rs[0][1];
$this->idoficina = $this->rs[0][2];
$this->idusuario2 = '0';
}
else
{
$other_field = '';
$other_region = '';
}
}
$check_sql = "SELECT nomoficina,jornada"
. " FROM oficinas"
. " WHERE idoficina = '" . $this->idoficina . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->nomoficina = $this->rs[0][0];
$this->jornada = $this->rs[0][1];
}
else
{
$other_field = "";
$other_region = "";
}
if($this->perfil == 4){
$this->taquillaactual = $this->nomtaquilla ;
}else{
$this->taquillaactual = "";
}
if($this->taquillaactual != ""){
$this->idtaquilla = $this->taquillaactual ;
}
$this->sc_temp_gnomoficina = "oficina: ".$this->nomoficina ;
$this->sc_temp_gnomtaquilla = $this->nomtaquilla ;
$this->sc_temp_empresa = $this->empresa ."                                                                 Fecha: ".$date."                                               ".$this->nomtaquilla ;
if (isset($this->sc_temp_nomtaquilla)) { $_SESSION['nomtaquilla'] = $this->sc_temp_nomtaquilla;}
if (isset($this->sc_temp_gnomoficina)) { $_SESSION['gnomoficina'] = $this->sc_temp_gnomoficina;}
if (isset($this->sc_temp_gnomtaquilla)) { $_SESSION['gnomtaquilla'] = $this->sc_temp_gnomtaquilla;}
if (isset($this->sc_temp_empresa)) { $_SESSION['empresa'] = $this->sc_temp_empresa;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
$modificado_login = $this->login;
$modificado_perfil = $this->perfil;
$modificado_nutaquilla = $this->nutaquilla;
$modificado_nomtaquilla = $this->nomtaquilla;
$modificado_idoficina = $this->idoficina;
$modificado_idusuario2 = $this->idusuario2;
$modificado_idtaquilla = $this->idtaquilla;
$modificado_fechahoy = $this->fechahoy;
$modificado_fechacierre = $this->fechacierre;
$modificado_nomoficina = $this->nomoficina;
$modificado_jornada = $this->jornada;
$modificado_taquillaactual = $this->taquillaactual;
$this->nm_formatar_campos('login', 'perfil', 'nutaquilla', 'nomtaquilla', 'idoficina', 'idusuario2', 'idtaquilla', 'fechahoy', 'fechacierre', 'nomoficina', 'jornada', 'taquillaactual');
if ($original_login !== $modificado_login || isset($this->nmgp_cmp_readonly['login']) || (isset($bFlagRead_login) && $bFlagRead_login))
{
$this->ajax_return_values_login(true);
}
if ($original_perfil !== $modificado_perfil || isset($this->nmgp_cmp_readonly['perfil']) || (isset($bFlagRead_perfil) && $bFlagRead_perfil))
{
$this->ajax_return_values_perfil(true);
}
if ($original_nutaquilla !== $modificado_nutaquilla || isset($this->nmgp_cmp_readonly['nutaquilla']) || (isset($bFlagRead_nutaquilla) && $bFlagRead_nutaquilla))
{
$this->ajax_return_values_nutaquilla(true);
}
if ($original_nomtaquilla !== $modificado_nomtaquilla || isset($this->nmgp_cmp_readonly['nomtaquilla']) || (isset($bFlagRead_nomtaquilla) && $bFlagRead_nomtaquilla))
{
$this->ajax_return_values_nomtaquilla(true);
}
if ($original_idoficina !== $modificado_idoficina || isset($this->nmgp_cmp_readonly['idoficina']) || (isset($bFlagRead_idoficina) && $bFlagRead_idoficina))
{
$this->ajax_return_values_idoficina(true);
}
if ($original_idusuario2 !== $modificado_idusuario2 || isset($this->nmgp_cmp_readonly['idusuario2']) || (isset($bFlagRead_idusuario2) && $bFlagRead_idusuario2))
{
$this->ajax_return_values_idusuario2(true);
}
if ($original_idtaquilla !== $modificado_idtaquilla || isset($this->nmgp_cmp_readonly['idtaquilla']) || (isset($bFlagRead_idtaquilla) && $bFlagRead_idtaquilla))
{
$this->ajax_return_values_idtaquilla(true);
}
if ($original_fechahoy !== $modificado_fechahoy || isset($this->nmgp_cmp_readonly['fechahoy']) || (isset($bFlagRead_fechahoy) && $bFlagRead_fechahoy))
{
$this->ajax_return_values_fechahoy(true);
}
if ($original_fechacierre !== $modificado_fechacierre || isset($this->nmgp_cmp_readonly['fechacierre']) || (isset($bFlagRead_fechacierre) && $bFlagRead_fechacierre))
{
$this->ajax_return_values_fechacierre(true);
}
if ($original_nomoficina !== $modificado_nomoficina || isset($this->nmgp_cmp_readonly['nomoficina']) || (isset($bFlagRead_nomoficina) && $bFlagRead_nomoficina))
{
$this->ajax_return_values_nomoficina(true);
}
if ($original_jornada !== $modificado_jornada || isset($this->nmgp_cmp_readonly['jornada']) || (isset($bFlagRead_jornada) && $bFlagRead_jornada))
{
$this->ajax_return_values_jornada(true);
}
if ($original_taquillaactual !== $modificado_taquillaactual || isset($this->nmgp_cmp_readonly['taquillaactual']) || (isset($bFlagRead_taquillaactual) && $bFlagRead_taquillaactual))
{
$this->ajax_return_values_taquillaactual(true);
}
$this->NM_ajax_info['event_field'] = 'login';
app2_Login_pack_ajax_response();
exit;
}
/*----- END - Scriptcase Locale: Ajax Event login_onChange ------*/
/*----- Scriptcase Locale: Ajax Event login_onFocus ------*/
function login_onFocus()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
$original_login = $this->login;
$original_perfil = $this->perfil;
$original_idoficina = $this->idoficina;
$original_nomoficina = $this->nomoficina;
$check_sql = "SELECT name,perfil"
. " FROM sec1_users"
. " WHERE login = '" . $this->login . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$nomusuario = $this->rs[0][0];
$this->perfil = $this->rs[0][1];
}
else
{
$other_field = '';
$other_region = '';
}
$check_sql = "SELECT nomoficina"
. " FROM oficinas"
. " WHERE idoficina = '" . $this->idoficina . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->nomoficina = $this->rs[0][0];
}
else
{
$other_field = "";
$other_region = "";
}
$modificado_login = $this->login;
$modificado_perfil = $this->perfil;
$modificado_idoficina = $this->idoficina;
$modificado_nomoficina = $this->nomoficina;
$this->nm_formatar_campos('login', 'perfil', 'idoficina', 'nomoficina');
if ($original_login !== $modificado_login || isset($this->nmgp_cmp_readonly['login']) || (isset($bFlagRead_login) && $bFlagRead_login))
{
$this->ajax_return_values_login(true);
}
if ($original_perfil !== $modificado_perfil || isset($this->nmgp_cmp_readonly['perfil']) || (isset($bFlagRead_perfil) && $bFlagRead_perfil))
{
$this->ajax_return_values_perfil(true);
}
if ($original_idoficina !== $modificado_idoficina || isset($this->nmgp_cmp_readonly['idoficina']) || (isset($bFlagRead_idoficina) && $bFlagRead_idoficina))
{
$this->ajax_return_values_idoficina(true);
}
if ($original_nomoficina !== $modificado_nomoficina || isset($this->nmgp_cmp_readonly['nomoficina']) || (isset($bFlagRead_nomoficina) && $bFlagRead_nomoficina))
{
$this->ajax_return_values_nomoficina(true);
}
$this->NM_ajax_info['event_field'] = 'login';
app2_Login_pack_ajax_response();
exit;
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: Ajax Event login_onFocus ------*/
/*----- Scriptcase Locale: Ajax Event pswd_onChange ------*/
function pswd_onChange()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
$original_login = $this->login;
if($this->login == ''){
$this->login = "Admin";
}
$modificado_login = $this->login;
$this->nm_formatar_campos('login');
if ($original_login !== $modificado_login || isset($this->nmgp_cmp_readonly['login']) || (isset($bFlagRead_login) && $bFlagRead_login))
{
$this->ajax_return_values_login(true);
}
$this->NM_ajax_info['event_field'] = 'pswd';
app2_Login_pack_ajax_response();
exit;
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: Ajax Event pswd_onChange ------*/
/*----- Scriptcase Locale: Ajax Event pswd_onFocus ------*/
function pswd_onFocus()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
$original_login = $this->login;
if($this->login == ''){
if (!isset($this->Campos_Mens_erro) || empty($this->Campos_Mens_erro))
{
$this->nmgp_redireciona_form($this->Ini->path_link . "" . SC_dir_app_name('app2_Login') . "/", $this->nm_location, "", "_self", "ret_self", 440, 630);
};
}
$modificado_login = $this->login;
$this->nm_formatar_campos('login');
if ($original_login !== $modificado_login || isset($this->nmgp_cmp_readonly['login']) || (isset($bFlagRead_login) && $bFlagRead_login))
{
$this->ajax_return_values_login(true);
}
$this->NM_ajax_info['event_field'] = 'pswd';
app2_Login_pack_ajax_response();
exit;
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: Ajax Event pswd_onFocus ------*/
/*----- Scriptcase Locale: PHP Method: remember_me_init ------*/
function remember_me_init()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_usr_perfil)) {$this->sc_temp_usr_perfil = (isset($_SESSION['usr_perfil'])) ? $_SESSION['usr_perfil'] : "";}
if (!isset($this->sc_temp_usr_oficina)) {$this->sc_temp_usr_oficina = (isset($_SESSION['usr_oficina'])) ? $_SESSION['usr_oficina'] : "";}
if (!isset($this->sc_temp_usr_email)) {$this->sc_temp_usr_email = (isset($_SESSION['usr_email'])) ? $_SESSION['usr_email'] : "";}
if (!isset($this->sc_temp_usr_name)) {$this->sc_temp_usr_name = (isset($_SESSION['usr_name'])) ? $_SESSION['usr_name'] : "";}
if (!isset($this->sc_temp_usr_priv_admin)) {$this->sc_temp_usr_priv_admin = (isset($_SESSION['usr_priv_admin'])) ? $_SESSION['usr_priv_admin'] : "";}
if (!isset($this->sc_temp_usr_login)) {$this->sc_temp_usr_login = (isset($_SESSION['usr_login'])) ? $_SESSION['usr_login'] : "";}
if(isset($_COOKIE['usr_data']) && !empty($_COOKIE['usr_data'])){
$usr_data = unserialize(decode_string($_COOKIE['usr_data']));
if(substr($usr_data['code'], 0, 7) == 'cookie_'){
$sql = "SELECT
priv_admin,
active,
name,
email,
oficina,
perfil
FROM sec1_users
WHERE login = ". $this->Db->qstr($usr_data['login']) ."
AND activation_code = ".$this->Db->qstr($usr_data['code']);
$nm_select = $sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if(count($this->rs) != 0 && $this->rs[0][1] == 'Y')
{
$this->sc_temp_usr_login = $usr_data['login'];
$this->sc_temp_usr_priv_admin = ($this->rs[0][0] == 'Y') ? TRUE : FALSE;
$this->sc_temp_usr_name = $this->rs[0][2];
$this->sc_temp_usr_email = $this->rs[0][3];
$this->sc_temp_usr_oficina = $this->rs[0][4];
$this->sc_temp_usr_perfil = $this->rs[0][5];
$this->sc_validate_success();
}
}
}
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_usr_priv_admin)) { $_SESSION['usr_priv_admin'] = $this->sc_temp_usr_priv_admin;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_oficina)) { $_SESSION['usr_oficina'] = $this->sc_temp_usr_oficina;}
if (isset($this->sc_temp_usr_perfil)) { $_SESSION['usr_perfil'] = $this->sc_temp_usr_perfil;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: remember_me_init ------*/
/*----- Scriptcase Locale: PHP Method: remember_me_validate ------*/
function remember_me_validate()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_sett_cookie_expiration_time)) {$this->sc_temp_sett_cookie_expiration_time = (isset($_SESSION['sett_cookie_expiration_time'])) ? $_SESSION['sett_cookie_expiration_time'] : "";}
if (!isset($this->sc_temp_sett_remember_me)) {$this->sc_temp_sett_remember_me = (isset($_SESSION['sett_remember_me'])) ? $_SESSION['sett_remember_me'] : "";}
if(!isset($this->sc_temp_sett_remember_me) || $this->sc_temp_sett_remember_me != 'Y'){
return;
}
if($this->remember_me == 1){
$chars = 'abcdefghijklmnopqrstuvxywz';
$chars .= 'ABCDEFGHIJKLMNOPQRSTUVXYWZ';
$chars .= '0123456789!@$*.,;:';
$max = strlen($chars)-1;
$code = "cookie_";
for($i=0; $i < 25; $i++)
{
$code .= $chars[mt_rand(0, $max)];
}
$slogin = $this->Db->qstr($this->login );
$nm_select ="UPDATE sec1_users SET activation_code = ". $this->Db->qstr($code) . " WHERE login = ". $slogin;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
$usr_data = array(
'login' => $this->login ,
'code' => $code,
);
$remember_me_expiry_cookie = $this->sc_temp_sett_cookie_expiration_time;
setcookie("usr_data", encode_string(serialize($usr_data)),time()+60*60*24* $remember_me_expiry_cookie, '/');
}
if (isset($this->sc_temp_sett_remember_me)) { $_SESSION['sett_remember_me'] = $this->sc_temp_sett_remember_me;}
if (isset($this->sc_temp_sett_cookie_expiration_time)) { $_SESSION['sett_cookie_expiration_time'] = $this->sc_temp_sett_cookie_expiration_time;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: remember_me_validate ------*/
/*----- Scriptcase Locale: PHP Method: sc_validate_success ------*/
function sc_validate_success()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_gnomoficina)) {$this->sc_temp_gnomoficina = (isset($_SESSION['gnomoficina'])) ? $_SESSION['gnomoficina'] : "";}
if (!isset($this->sc_temp_sett_session_expire)) {$this->sc_temp_sett_session_expire = (isset($_SESSION['sett_session_expire'])) ? $_SESSION['sett_session_expire'] : "";}
if (!isset($this->sc_temp_usr_taquilla)) {$this->sc_temp_usr_taquilla = (isset($_SESSION['usr_taquilla'])) ? $_SESSION['usr_taquilla'] : "";}
if (!isset($this->sc_temp_usr_perfil)) {$this->sc_temp_usr_perfil = (isset($_SESSION['usr_perfil'])) ? $_SESSION['usr_perfil'] : "";}
if (!isset($this->sc_temp_usr_oficina)) {$this->sc_temp_usr_oficina = (isset($_SESSION['usr_oficina'])) ? $_SESSION['usr_oficina'] : "";}
if (!isset($this->sc_temp_usr_login)) {$this->sc_temp_usr_login = (isset($_SESSION['usr_login'])) ? $_SESSION['usr_login'] : "";}
if (!isset($this->sc_temp_usr_phone)) {$this->sc_temp_usr_phone = (isset($_SESSION['usr_phone'])) ? $_SESSION['usr_phone'] : "";}
if (!isset($this->sc_temp_usr_name)) {$this->sc_temp_usr_name = (isset($_SESSION['usr_name'])) ? $_SESSION['usr_name'] : "";}
if (!isset($this->sc_temp_usr_picture)) {$this->sc_temp_usr_picture = (isset($_SESSION['usr_picture'])) ? $_SESSION['usr_picture'] : "";}
if (!isset($this->sc_temp_usr_email)) {$this->sc_temp_usr_email = (isset($_SESSION['usr_email'])) ? $_SESSION['usr_email'] : "";}
if ($this->idusuario2 != $this->login ) {
$fecha = date('y-m-d');
$update_table = 'taquillas';
$update_where = "idtaquilla = '$this->nutaquilla'";
$update_fields = array(
"idusuario = '$this->login'",
"fechaabre = '$fecha'",
);
$update_sql = 'UPDATE ' . $update_table
. ' SET ' . implode(', ', $update_fields)
. ' WHERE ' . $update_where;
$nm_select = $update_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
}
$sql = "SELECT
app_name,
priv_access,
priv_insert,
priv_delete,
priv_update,
priv_export,
priv_print
FROM sec1_groups_apps
WHERE group_id IN
(SELECT
group_id
FROM
sec1_users_groups
WHERE
login = '". $this->sc_temp_usr_login ."')";
$nm_select = $sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
if ($this->rs = $this->Db->Execute($nm_select))
{ }
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
$arr_default = array(
'access' => 'off',
'insert' => 'off',
'delete' => 'off',
'update' => 'off',
'export' => 'btn_display_off',
'print' => 'btn_display_off',
);
if ($this->rs !== false)
{
$arr_perm = array();
while (!$this->rs->EOF)
{
$app = $this->rs->fields[0];
if(!isset($arr_perm[$app]))
{
$arr_perm[$app] = $arr_default;
}
if( $this->rs->fields[1] == 'Y')
{
$arr_perm[$app][ 'access' ] = 'on';
}
if($this->rs->fields[2] == 'Y')
{
$arr_perm[$app][ 'insert' ] = 'on';
}
if($this->rs->fields[3] == 'Y')
{
$arr_perm[$app][ 'delete' ] = 'on';
}
if($this->rs->fields[4] == 'Y')
{
$arr_perm[$app][ 'update' ] = 'on';
}
if($this->rs->fields[5] == 'Y')
{
$arr_perm[$app]['export'] = 'btn_display_on';
}
if($this->rs->fields[6] == 'Y')
{
$arr_perm[$app]['print'] = 'btn_display_on';
}
$this->rs->MoveNext();
}
$this->rs->Close();
foreach($arr_perm as $app => $perm)
{
$_SESSION['scriptcase']['sc_apl_seg'][$app] = $perm['access'];;
$_SESSION['scriptcase']['sc_apl_conf'][$app]['insert'] = $perm['insert'];
$_SESSION['scriptcase']['sc_apl_conf'][$app]['delete'] = $perm['delete'];
$_SESSION['scriptcase']['sc_apl_conf'][$app]['update'] = $perm['update'];
if ($perm['export'] == 'btn_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['xls'] = 'on';
}
elseif ($perm['export'] == 'btn_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['xls'] = 'off';
}
elseif ($perm['export'] == 'field_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['xls'] = 'on';
}
elseif ($perm['export'] == 'field_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['xls'] = 'off';
}
elseif ($perm['export'] == 'field_readonly') {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']]['xls'] = 'on';
}
else {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']] = 'xls';
}
;
if ($perm['export'] == 'btn_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['word'] = 'on';
}
elseif ($perm['export'] == 'btn_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['word'] = 'off';
}
elseif ($perm['export'] == 'field_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['word'] = 'on';
}
elseif ($perm['export'] == 'field_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['word'] = 'off';
}
elseif ($perm['export'] == 'field_readonly') {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']]['word'] = 'on';
}
else {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']] = 'word';
}
;
if ($perm['export'] == 'btn_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['pdf'] = 'on';
}
elseif ($perm['export'] == 'btn_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['pdf'] = 'off';
}
elseif ($perm['export'] == 'field_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['pdf'] = 'on';
}
elseif ($perm['export'] == 'field_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['pdf'] = 'off';
}
elseif ($perm['export'] == 'field_readonly') {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']]['pdf'] = 'on';
}
else {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']] = 'pdf';
}
;
if ($perm['export'] == 'btn_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['xml'] = 'on';
}
elseif ($perm['export'] == 'btn_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['xml'] = 'off';
}
elseif ($perm['export'] == 'field_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['xml'] = 'on';
}
elseif ($perm['export'] == 'field_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['xml'] = 'off';
}
elseif ($perm['export'] == 'field_readonly') {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']]['xml'] = 'on';
}
else {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']] = 'xml';
}
;
if ($perm['export'] == 'btn_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['csv'] = 'on';
}
elseif ($perm['export'] == 'btn_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['csv'] = 'off';
}
elseif ($perm['export'] == 'field_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['csv'] = 'on';
}
elseif ($perm['export'] == 'field_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['csv'] = 'off';
}
elseif ($perm['export'] == 'field_readonly') {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']]['csv'] = 'on';
}
else {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']] = 'csv';
}
;
if ($perm['export'] == 'btn_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['rtf'] = 'on';
}
elseif ($perm['export'] == 'btn_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['rtf'] = 'off';
}
elseif ($perm['export'] == 'field_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['rtf'] = 'on';
}
elseif ($perm['export'] == 'field_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['rtf'] = 'off';
}
elseif ($perm['export'] == 'field_readonly') {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']]['rtf'] = 'on';
}
else {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']] = 'rtf';
}
;
if ($perm['export'] == 'btn_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['json'] = 'on';
}
elseif ($perm['export'] == 'btn_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['json'] = 'off';
}
elseif ($perm['export'] == 'field_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['json'] = 'on';
}
elseif ($perm['export'] == 'field_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['json'] = 'off';
}
elseif ($perm['export'] == 'field_readonly') {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']]['json'] = 'on';
}
else {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['export']] = 'json';
}
;
if ($perm['print'] == 'btn_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['print'] = 'on';
}
elseif ($perm['print'] == 'btn_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['btn_display']['print'] = 'off';
}
elseif ($perm['print'] == 'field_display_on') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['print'] = 'on';
}
elseif ($perm['print'] == 'field_display_off') {
$_SESSION['scriptcase']['sc_apl_conf'][$app]['field_display']['print'] = 'off';
}
elseif ($perm['print'] == 'field_readonly') {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['print']]['print'] = 'on';
}
else {
$_SESSION['scriptcase']['sc_apl_conf'][$app][$perm['print']] = 'print';
}
;
}
if($this->sc_logged($this->sc_temp_usr_login)):
;
$_SESSION['scriptcase']['user_logout'][] = array('V' => 'logged_user', 'U' => 'logout', 'R' => 'app2_Login', 'T' => '_top');;
if($this->sc_temp_sett_session_expire != 'N'){
if (is_file($_SESSION['scriptcase']['dir_temp'] . "/sc_apl_default_GorbusWeb.txt")) {
unlink($_SESSION['scriptcase']['dir_temp'] . "/sc_apl_default_GorbusWeb.txt");
}
if (is_file("../_lib/_app_data/app2_Login_ini.php")) {
$SC_arq_def = fopen($_SESSION['scriptcase']['dir_temp'] . "/sc_apl_default_GorbusWeb.txt", "w");
fwrite ($SC_arq_def, 'app2_Login, $this->sc_temp_sett_session_expire');
fclose ($SC_arq_def);
setcookie('sc_apl_default_GorbusWeb','app2_Login, $this->sc_temp_sett_session_expire','0','/', '', ini_get('session.cookie_secure'), ini_get('session.cookie_httponly'));
}
;
}
if (isset($this->usr_email)) {$this->sc_temp_usr_email = $this->usr_email;}
;
if (isset($this->usr_picture)) {$this->sc_temp_usr_picture = $this->usr_picture;}
;
if (isset($this->usr_name)) {$this->sc_temp_usr_name = $this->usr_name;}
;
if (isset($this->usr_phone)) {$this->sc_temp_usr_phone = $this->usr_phone;}
;
if (isset($this->usr_login)) {$this->sc_temp_usr_login = $this->usr_login;}
;
$this->sc_temp_usr_oficina = $this->idoficina ;
$this->sc_temp_usr_perfil = $this->perfil ;
$this->sc_temp_usr_taquilla = $this->nutaquilla ;
if (isset($this->usr_oficina)) {$this->sc_temp_usr_oficina = $this->usr_oficina;}
;
if (isset($this->usr_perfil)) {$this->sc_temp_usr_perfil = $this->usr_perfil;}
;
if (isset($this->usr_taquilla)) {$this->sc_temp_usr_taquilla = $this->usr_taquilla;}
;
if ($this->nomoficina != ""){
$this->sc_temp_gnomoficina = "oficina: ".$this->nomoficina ;
}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_usr_oficina)) { $_SESSION['usr_oficina'] = $this->sc_temp_usr_oficina;}
if (isset($this->sc_temp_usr_perfil)) { $_SESSION['usr_perfil'] = $this->sc_temp_usr_perfil;}
if (isset($this->sc_temp_usr_taquilla)) { $_SESSION['usr_taquilla'] = $this->sc_temp_usr_taquilla;}
if (isset($this->sc_temp_sett_session_expire)) { $_SESSION['sett_session_expire'] = $this->sc_temp_sett_session_expire;}
if (isset($this->sc_temp_gnomoficina)) { $_SESSION['gnomoficina'] = $this->sc_temp_gnomoficina;}
if (!isset($this->Campos_Mens_erro) || empty($this->Campos_Mens_erro))
{
$this->nmgp_redireciona_form($this->Ini->path_link . "" . SC_dir_app_name('menudos') . "/", $this->nm_location, "", "_self", "ret_self", 440, 630);
};
endif;
}
if($this->pswd == ''){
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_usr_oficina)) { $_SESSION['usr_oficina'] = $this->sc_temp_usr_oficina;}
if (isset($this->sc_temp_usr_perfil)) { $_SESSION['usr_perfil'] = $this->sc_temp_usr_perfil;}
if (isset($this->sc_temp_usr_taquilla)) { $_SESSION['usr_taquilla'] = $this->sc_temp_usr_taquilla;}
if (isset($this->sc_temp_sett_session_expire)) { $_SESSION['sett_session_expire'] = $this->sc_temp_sett_session_expire;}
if (isset($this->sc_temp_gnomoficina)) { $_SESSION['gnomoficina'] = $this->sc_temp_gnomoficina;}
if (!isset($this->Campos_Mens_erro) || empty($this->Campos_Mens_erro))
{
$this->nmgp_redireciona_form($this->Ini->path_link . "" . SC_dir_app_name('app2_Login') . "/", $this->nm_location, "", "_self", "ret_self", 440, 630);
};
}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
if (isset($this->sc_temp_usr_picture)) { $_SESSION['usr_picture'] = $this->sc_temp_usr_picture;}
if (isset($this->sc_temp_usr_name)) { $_SESSION['usr_name'] = $this->sc_temp_usr_name;}
if (isset($this->sc_temp_usr_phone)) { $_SESSION['usr_phone'] = $this->sc_temp_usr_phone;}
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_usr_oficina)) { $_SESSION['usr_oficina'] = $this->sc_temp_usr_oficina;}
if (isset($this->sc_temp_usr_perfil)) { $_SESSION['usr_perfil'] = $this->sc_temp_usr_perfil;}
if (isset($this->sc_temp_usr_taquilla)) { $_SESSION['usr_taquilla'] = $this->sc_temp_usr_taquilla;}
if (isset($this->sc_temp_sett_session_expire)) { $_SESSION['sett_session_expire'] = $this->sc_temp_sett_session_expire;}
if (isset($this->sc_temp_gnomoficina)) { $_SESSION['gnomoficina'] = $this->sc_temp_gnomoficina;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: sc_validate_success ------*/
/*----- Scriptcase Locale: PHP Method: tw_return ------*/
function tw_return()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_twitter_name)) {$this->sc_temp_twitter_name = (isset($_SESSION['twitter_name'])) ? $_SESSION['twitter_name'] : "";}
if (!isset($this->sc_temp_twitter_email)) {$this->sc_temp_twitter_email = (isset($_SESSION['twitter_email'])) ? $_SESSION['twitter_email'] : "";}
if (!isset($this->sc_temp_twitter_user)) {$this->sc_temp_twitter_user = (isset($_SESSION['twitter_user'])) ? $_SESSION['twitter_user'] : "";}
$this->get_social("twitter", $this->sc_temp_twitter_user, $this->sc_temp_twitter_email,$this->sc_temp_twitter_name);
if (isset($this->sc_temp_twitter_user)) { $_SESSION['twitter_user'] = $this->sc_temp_twitter_user;}
if (isset($this->sc_temp_twitter_email)) { $_SESSION['twitter_email'] = $this->sc_temp_twitter_email;}
if (isset($this->sc_temp_twitter_name)) { $_SESSION['twitter_name'] = $this->sc_temp_twitter_name;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: tw_return ------*/
/*----- Scriptcase Locale: PHP Method: update_login_img ------*/
function update_login_img($key_val, $img_val)
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
$databaseType = strtolower($this->Ini->nm_tpbanco);
$nm_bases_lob_geral = array_merge(
$this->Ini->nm_bases_oracle,
$this->Ini->nm_bases_ibase,
$this->Ini->nm_bases_informix,
$this->Ini->nm_bases_mysql,
$this->Ini->nm_bases_access,
$this->Ini->nm_bases_sqlite,
$this->Ini->nm_bases_db2,
$this->Ini->nm_bases_postgres,
['pdo_sqlsrv']
);
if (in_array($databaseType, $this->Ini->nm_bases_access)) {
$nm_tmp = preg_replace('/\s+/', '', $img_val);
if (is_string($img_val) && substr($img_val, 0, 4) !== "*nm*" && substr($nm_tmp, 0, 4) === "*nm*") {
$img_val = $nm_tmp;
}
if (!empty($img_val) && $img_val !== 'null' && substr($img_val, 0, 4) !== "*nm*") {
$img_val = "*nm*" . base64_encode($img_val);
}
} elseif (in_array($databaseType, $this->Ini->nm_bases_mssql) && $databaseType !== "pdo_sqlsrv") {
if (!empty($img_val) && $img_val !== 'null' && substr($img_val, 0, 4) !== "*nm*") {
$img_val = "*nm*" . base64_encode($img_val);
}
} elseif (!in_array($databaseType, $nm_bases_lob_geral)) {
$img_val = substr($this->Db->qstr($img_val), 1, -1);
}
$temp_img = "''";
if ($img_val === "" && in_array($databaseType, $this->Ini->nm_bases_access)) {
$temp_img = "null";
} elseif (!in_array($databaseType, $nm_bases_lob_geral)) {
$temp_img = "'" . $img_val . "'";
} elseif (in_array($databaseType, array_merge(
$this->Ini->nm_bases_ibase,
$this->Ini->nm_bases_mysql,
$this->Ini->nm_bases_access
))) {
$temp_img = "''";
} elseif (in_array($databaseType, $this->Ini->nm_bases_informix)) {
$temp_img = "null";
} elseif (!in_array($databaseType, array_merge($this->Ini->nm_bases_sqlite, $this->Ini->nm_bases_postgres))) {
$temp_img = "empty_blob()";
}
$comando = "UPDATE sec1_users SET picture = $temp_img WHERE login = " . $this->Db->qstr($key_val);
$rs = $this->Db->Execute($comando);
if ($rs === false) {
return $this->Db->ErrorMsg();
}
if (in_array($databaseType, $nm_bases_lob_geral)) {
$rs = $this->Db->UpdateBlob("sec1_users", "picture", $img_val, "login = " . $this->Db->qstr($key_val));
if ($rs === false) {
return $this->Db->ErrorMsg();
}
}
return 'ok';
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: PHP Method: update_login_img ------*/
/*----- Scriptcase Locale: Internal Lib: sc_logged.php ------*/
function sc_logged($user, $ip = '')
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
$str_sql = "SELECT date_login, ip FROM sec1_logged WHERE login = ". $this->Db->qstr($user) ." AND sc_session <> ".$this->Db->qstr('_SC_FAIL_SC_');
$nm_select = $str_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
if ($this->data = $this->Db->Execute($nm_select))
{ }
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->data = false;
$this->data_erro = $this->Db->ErrorMsg();
}
if($this->data === FALSE || !isset($this->data->fields[0]))
{
$ip = ($ip == '') ? $_SERVER['REMOTE_ADDR'] : $ip;
$this->sc_logged_in($user, $ip);
return true;
}
else
{
return true;
}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: Internal Lib: sc_logged.php ------*/
/*----- Scriptcase Locale: Internal Lib: sc_logged.php ------*/
function sc_verify_logged()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_logged_date_login)) {$this->sc_temp_logged_date_login = (isset($_SESSION['logged_date_login'])) ? $_SESSION['logged_date_login'] : "";}
if (!isset($this->sc_temp_logged_user)) {$this->sc_temp_logged_user = (isset($_SESSION['logged_user'])) ? $_SESSION['logged_user'] : "";}
$str_sql = "SELECT count(*) FROM sec1_logged WHERE login = ". $this->Db->qstr($this->sc_temp_logged_user) . " AND date_login = ". $this->Db->qstr($this->sc_temp_logged_date_login) ." AND sc_session <> ".$this->Db->qstr('_SC_FAIL_SC_');
$nm_select = $str_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs_logged = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs_logged[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs_logged = false;
$this->rs_logged_erro = $this->Db->ErrorMsg();
}
if($this->rs_logged[0][0] != 1)
{
if (isset($this->sc_temp_logged_user)) { $_SESSION['logged_user'] = $this->sc_temp_logged_user;}
if (isset($this->sc_temp_logged_date_login)) { $_SESSION['logged_date_login'] = $this->sc_temp_logged_date_login;}
if (!isset($this->Campos_Mens_erro) || empty($this->Campos_Mens_erro))
{
$this->nmgp_redireciona_form($this->Ini->path_link . "" . SC_dir_app_name('app2_Login') . "/", $this->nm_location, "", "_parent", "ret_self", 440, 630);
};
}
if (isset($this->sc_temp_logged_user)) { $_SESSION['logged_user'] = $this->sc_temp_logged_user;}
if (isset($this->sc_temp_logged_date_login)) { $_SESSION['logged_date_login'] = $this->sc_temp_logged_date_login;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: Internal Lib: sc_logged.php ------*/
/*----- Scriptcase Locale: Internal Lib: sc_logged.php ------*/
function sc_logged_in($user, $ip = '')
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_logged_date_login)) {$this->sc_temp_logged_date_login = (isset($_SESSION['logged_date_login'])) ? $_SESSION['logged_date_login'] : "";}
if (!isset($this->sc_temp_logged_user)) {$this->sc_temp_logged_user = (isset($_SESSION['logged_user'])) ? $_SESSION['logged_user'] : "";}
$ip = ($ip == '') ? $_SERVER['REMOTE_ADDR'] : $ip;
$this->sc_temp_logged_user = $user;
$this->sc_temp_logged_date_login = microtime(true);
$str_sql = "DELETE FROM sec1_logged WHERE login = ". $this->Db->qstr($user) . " AND sc_session = ".$this->Db->qstr('_SC_FAIL_SC_')." AND ip = ".$this->Db->qstr($ip);
$nm_select = $str_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
$str_sql = "INSERT INTO sec1_logged(login, date_login, sc_session, ip) VALUES (". $this->Db->qstr($user) .", ". $this->Db->qstr($this->sc_temp_logged_date_login) .", ". $this->Db->qstr(session_id()) .", ". $this->Db->qstr($ip) .")";
$nm_select = $str_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
if (isset($this->sc_temp_logged_user)) { $_SESSION['logged_user'] = $this->sc_temp_logged_user;}
if (isset($this->sc_temp_logged_date_login)) { $_SESSION['logged_date_login'] = $this->sc_temp_logged_date_login;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: Internal Lib: sc_logged.php ------*/
/*----- Scriptcase Locale: Internal Lib: sc_logged.php ------*/
function sc_logged_in_fail($user, $ip = '')
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
$ip = ($ip == '') ? $_SERVER['REMOTE_ADDR'] : $ip;
$user = $this->Db->qstr($user);
$str_sql = "INSERT INTO sec1_logged(login, date_login, sc_session, ip) VALUES (" . $this->Db->qstr($user) . ", " . $this->Db->qstr(microtime(true)) . ", ". $this->Db->qstr('_SC_FAIL_SC_').", " . $this->Db->qstr($ip) . ")";
$nm_select = $str_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
return true;
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: Internal Lib: sc_logged.php ------*/
/*----- Scriptcase Locale: Internal Lib: sc_logged.php ------*/
function sc_logged_is_blocked($ip = '')
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_sett_brute_force_attempts)) {$this->sc_temp_sett_brute_force_attempts = (isset($_SESSION['sett_brute_force_attempts'])) ? $_SESSION['sett_brute_force_attempts'] : "";}
if (!isset($this->sc_temp_sett_brute_force_time_block)) {$this->sc_temp_sett_brute_force_time_block = (isset($_SESSION['sett_brute_force_time_block'])) ? $_SESSION['sett_brute_force_time_block'] : "";}
$ip = ($ip == '') ? $_SERVER['REMOTE_ADDR'] : $ip;
$minutes_ago = strtotime("-". $this->sc_temp_sett_brute_force_time_block ." minutes");
$str_select = "SELECT count(*) FROM sec1_logged WHERE sc_session = ".$this->Db->qstr('_SC_BLOCKED_SC_')." AND ip = ".$this->Db->qstr($ip)." AND date_login > ". $this->Db->qstr($minutes_ago);
$nm_select = $str_select;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs_logged = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs_logged[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs_logged = false;
$this->rs_logged_erro = $this->Db->ErrorMsg();
}
if($this->rs_logged !== FALSE && $this->rs_logged[0][0] == 1)
{
$message = $this->Ini->Nm_lang['lang_user_blocked'] ;
$message = sprintf($message, 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 .= $message;
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = $message;
}
;
return true;
}
$str_select = "SELECT count(*) FROM sec1_logged WHERE sc_session = ".$this->Db->qstr('_SC_FAIL_SC_')." AND ip = ".$this->Db->qstr($ip)." AND date_login > ". $this->Db->qstr($minutes_ago);
$nm_select = $str_select;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs_logged = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs_logged[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs_logged = false;
$this->rs_logged_erro = $this->Db->ErrorMsg();
}
if($this->rs_logged !== FALSE && $this->rs_logged[0][0] == $this->sc_temp_sett_brute_force_attempts )
{
$str_sql = "INSERT INTO sec1_logged(login, date_login, sc_session, ip) VALUES (".$this->Db->qstr('blocked').", ". $this->Db->qstr(microtime(true)) .", ".$this->Db->qstr('_SC_BLOCKED_SC_'). ", ". $this->Db->qstr($ip) .")";
$nm_select = $str_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
$message = $this->Ini->Nm_lang['lang_user_blocked'] ;
$message = sprintf($message, $this->sc_temp_sett_brute_force_time_block);
if (!isset($this->Campos_Mens_erro)){$this->Campos_Mens_erro = "";}
if (!empty($this->Campos_Mens_erro)){$this->Campos_Mens_erro .= "
";}$this->Campos_Mens_erro .= $message;
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_app2_Login';
} elseif ('submit_form' == $this->NM_ajax_opcao) {
$sErrorIndex = 'geral_app2_Login';
} else {
$sErrorIndex = substr(substr($this->NM_ajax_opcao, 0, strrpos($this->NM_ajax_opcao, '_')), 6);
}
$this->NM_ajax_info['errList'][$sErrorIndex][] = $message;
}
;
return true;
}
return false;
if (isset($this->sc_temp_sett_brute_force_time_block)) { $_SESSION['sett_brute_force_time_block'] = $this->sc_temp_sett_brute_force_time_block;}
if (isset($this->sc_temp_sett_brute_force_attempts)) { $_SESSION['sett_brute_force_attempts'] = $this->sc_temp_sett_brute_force_attempts;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: Internal Lib: sc_logged.php ------*/
/*----- Scriptcase Locale: Internal Lib: sc_logged.php ------*/
function sc_logged_out($user, $date_login = '')
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_logged_user)) {$this->sc_temp_logged_user = (isset($_SESSION['logged_user'])) ? $_SESSION['logged_user'] : "";}
if (!isset($this->sc_temp_logged_date_login)) {$this->sc_temp_logged_date_login = (isset($_SESSION['logged_date_login'])) ? $_SESSION['logged_date_login'] : "";}
$date_login = ($date_login == '' ? "" : " AND date_login = ". $this->Db->qstr($date_login) ."");
$str_sql = "SELECT sc_session FROM sec1_logged WHERE login = ". $this->Db->qstr($user) ." ". $date_login . " AND sc_session <> ".$this->Db->qstr('_SC_FAIL_SC_');
$nm_select = $str_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->data = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->data[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->data = false;
$this->data_erro = $this->Db->ErrorMsg();
}
if(isset($this->data[0][0]) && !empty($this->data[0][0]))
{
$session_bkp = $_SESSION;
$sessionid = session_id();
session_write_close();
session_id($this->data[0][0]);
session_start();
$_SESSION['logged_user'] = 'logout';
session_write_close();
session_id($sessionid);
session_start();
$_SESSION = $session_bkp;
}
$str_sql = "DELETE FROM sec1_logged WHERE login = ". $this->Db->qstr($user) . " " . $date_login;
$nm_select = $str_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$rf = $this->Db->Execute($nm_select);
if ($rf === false)
{
$this->Erro->mensagem (__FILE__, __LINE__, "banco", $this->Ini->Nm_lang['lang_errm_dber'], $this->Db->ErrorMsg());
$this->NM_rollback_db();
if ($this->NM_ajax_flag)
{
app2_Login_pack_ajax_response();
}
exit;
}
$rf->Close();
unset($_SESSION['logged_date_login']);
unset($this->sc_temp_logged_date_login);
unset($_SESSION['logged_user']);
unset($this->sc_temp_logged_user);
;
if (isset($this->sc_temp_logged_date_login)) { $_SESSION['logged_date_login'] = $this->sc_temp_logged_date_login;}
if (isset($this->sc_temp_logged_user)) { $_SESSION['logged_user'] = $this->sc_temp_logged_user;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: Internal Lib: sc_logged.php ------*/
/*----- Scriptcase Locale: Internal Lib: sc_logged.php ------*/
function sc_looged_check_logout()
{
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (!isset($this->sc_temp_usr_email)) {$this->sc_temp_usr_email = (isset($_SESSION['usr_email'])) ? $_SESSION['usr_email'] : "";}
if (!isset($this->sc_temp_logged_date_login)) {$this->sc_temp_logged_date_login = (isset($_SESSION['logged_date_login'])) ? $_SESSION['logged_date_login'] : "";}
if (!isset($this->sc_temp_logged_user)) {$this->sc_temp_logged_user = (isset($_SESSION['logged_user'])) ? $_SESSION['logged_user'] : "";}
if (!isset($this->sc_temp_usr_login)) {$this->sc_temp_usr_login = (isset($_SESSION['usr_login'])) ? $_SESSION['usr_login'] : "";}
if(isset($this->sc_temp_logged_user) && ($this->sc_temp_logged_user == 'logout' || empty($this->sc_temp_logged_user)))
{
unset($_SESSION['usr_login']);
unset($this->sc_temp_usr_login);
unset($_SESSION['logged_user']);
unset($this->sc_temp_logged_user);
unset($_SESSION['logged_date_login']);
unset($this->sc_temp_logged_date_login);
unset($_SESSION['usr_email']);
unset($this->sc_temp_usr_email);
;
}
if (isset($this->sc_temp_usr_login)) { $_SESSION['usr_login'] = $this->sc_temp_usr_login;}
if (isset($this->sc_temp_logged_user)) { $_SESSION['logged_user'] = $this->sc_temp_logged_user;}
if (isset($this->sc_temp_logged_date_login)) { $_SESSION['logged_date_login'] = $this->sc_temp_logged_date_login;}
if (isset($this->sc_temp_usr_email)) { $_SESSION['usr_email'] = $this->sc_temp_usr_email;}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
}
/*----- END - Scriptcase Locale: Internal Lib: sc_logged.php ------*/
//
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]['app2_Login']['botoes'] = $this->nmgp_botoes;
if ($this->nmgp_opcao != "recarga" && $this->nmgp_opcao != "muda_form")
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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]['app2_Login']['run_iframe'] == "F" || $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['run_iframe'] == "R") && $this->nm_flag_iframe && empty($this->nm_todas_criticas))
{
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['run_iframe_ajax']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['retorno_edit'] = array("edit", "");
}
else
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['retorno_edit'] .= "&nmgp_opcao=edit";
}
if ($this->sc_evento == "insert" && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['run_iframe'] == "F")
{
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['run_iframe_ajax']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['retorno_edit'] = array("edit", "fim");
}
else
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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]['app2_Login']['run_iframe_ajax']))
{
$this->NM_ajax_info['ajaxJavascript'][] = array("parent.ajax_navigate", $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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]['app2_Login']['retorno_edit'];
$this->NM_ajax_info['redir']['target'] = $sJsParent;
}
app2_Login_pack_ajax_response();
exit;
}
?>
fechahoy_Dt_min = date('Ymd');
$this->fechahoy_Dt_max = date('Ymd');
if (!$this->NM_ajax_flag || !isset($this->nmgp_refresh_fields)) {
/*----- Scriptcase Locale: Event onLoad ------*/
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'on';
if (isset($this->NM_ajax_flag) && $this->NM_ajax_flag)
{
$original_idoficina = $this->idoficina;
$original_idtaquilla = $this->idtaquilla;
$original_login = $this->login;
$original_new_user = $this->new_user;
$original_pswd = $this->pswd;
$original_retrieve_pswd = $this->retrieve_pswd;
}
if (!isset($this->sc_temp_sett_login_mode)) {$this->sc_temp_sett_login_mode = (isset($_SESSION['sett_login_mode'])) ? $_SESSION['sett_login_mode'] : "";}
if (!isset($this->sc_temp_sett_auth_sn_position)) {$this->sc_temp_sett_auth_sn_position = (isset($_SESSION['sett_auth_sn_position'])) ? $_SESSION['sett_auth_sn_position'] : "";}
if (!isset($this->sc_temp_sett_auth_sn_google)) {$this->sc_temp_sett_auth_sn_google = (isset($_SESSION['sett_auth_sn_google'])) ? $_SESSION['sett_auth_sn_google'] : "";}
if (!isset($this->sc_temp_sett_auth_sn_x)) {$this->sc_temp_sett_auth_sn_x = (isset($_SESSION['sett_auth_sn_x'])) ? $_SESSION['sett_auth_sn_x'] : "";}
if (!isset($this->sc_temp_sett_auth_sn_fb)) {$this->sc_temp_sett_auth_sn_fb = (isset($_SESSION['sett_auth_sn_fb'])) ? $_SESSION['sett_auth_sn_fb'] : "";}
if (!isset($this->sc_temp_sett_language)) {$this->sc_temp_sett_language = (isset($_SESSION['sett_language'])) ? $_SESSION['sett_language'] : "";}
if (!isset($this->sc_temp_sett_retrieve_password)) {$this->sc_temp_sett_retrieve_password = (isset($_SESSION['sett_retrieve_password'])) ? $_SESSION['sett_retrieve_password'] : "";}
if (!isset($this->sc_temp_sett_new_users)) {$this->sc_temp_sett_new_users = (isset($_SESSION['sett_new_users'])) ? $_SESSION['sett_new_users'] : "";}
if (!isset($this->sc_temp_return_msg_email_act)) {$this->sc_temp_return_msg_email_act = (isset($_SESSION['return_msg_email_act'])) ? $_SESSION['return_msg_email_act'] : "";}
$cia = 1;
$check_sql = "SELECT empresa"
. " FROM empresas"
. " WHERE idempresa = '" . $cia . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->empresa = $this->rs[0][0];
$other_region = $this->rs[0][1];
}
else
{
$other_field = '';
$other_region = '';
}
$check_sql = "SELECT nomtaquilla,idoficina"
. " FROM taquillas"
. " WHERE idusuario = '" . $this->login . "'";
$nm_select = $check_sql;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
$this->rs = array();
if ($SCrx = $this->Db->Execute($nm_select))
{
$SCy = 0;
$nm_count = $SCrx->FieldCount();
while (!$SCrx->EOF)
{
for ($SCx = 0; $SCx < $nm_count; $SCx++)
{
$this->rs[$SCy] [$SCx] = $SCrx->fields[$SCx];
}
$SCy++;
$SCrx->MoveNext();
}
$SCrx->Close();
}
elseif (isset($GLOBALS["NM_ERRO_IBASE"]) && $GLOBALS["NM_ERRO_IBASE"] != 1)
{
$this->rs = false;
$this->rs_erro = $this->Db->ErrorMsg();
}
if (isset($this->rs[0][0]))
{
$this->idtaquilla = $this->rs[0][0];
$this->idoficina = $this->rs[0][1];
}
$_SESSION['scriptcase']['sc_apl_conf']['app2_form_add_users']['start'] = 'new';
if(isset($this->sc_temp_return_msg_email_act) && $this->sc_temp_return_msg_email_act == 1){
$this->nm_mens_alert[] = $this->Ini->Nm_lang['lang_sec_add_user_success']; $this->nm_params_alert[] = array(
'title' => $this->Ini->Nm_lang['lang_sec_2fa_success_title'],
'type' => 'success',
'timer' => '5000',
'showConfirmButton' => false,
'position' => 'center',
'toast' => true
); if ($this->NM_ajax_flag) { $this->sc_ajax_alert($this->Ini->Nm_lang['lang_sec_add_user_success'], array(
'title' => $this->Ini->Nm_lang['lang_sec_2fa_success_title'],
'type' => 'success',
'timer' => '5000',
'showConfirmButton' => false,
'position' => 'center',
'toast' => true
)); }$this->sc_temp_return_msg_email_act=0;
}
if($this->sc_temp_sett_new_users != 'Y'){
$this->nmgp_cmp_hidden["new_user"] = 'off'; $this->NM_ajax_info['fieldDisplay']['new_user'] = 'off';
}
if($this->sc_temp_sett_retrieve_password != 'Y'){
$this->nmgp_cmp_hidden["retrieve_pswd"] = 'off'; $this->NM_ajax_info['fieldDisplay']['retrieve_pswd'] = 'off';
}
if($this->sc_temp_sett_language != 'Y'){
}
$arr_btn_social = ['#bfacebook_b', '#btwitter_b', '#bgoogle_b', '#sub_form_b'];
if($this->sc_temp_sett_auth_sn_fb != 'Y'){
unset($arr_btn_social[0]);
$this->NM_ajax_info['buttonDisplay']['facebook'] = $this->nmgp_botoes["facebook"] = 'off';;
}
if($this->sc_temp_sett_auth_sn_x != 'Y'){
unset($arr_btn_social[1]);
$this->NM_ajax_info['buttonDisplay']['twitter'] = $this->nmgp_botoes["twitter"] = 'off';;
}
if($this->sc_temp_sett_auth_sn_google != 'Y'){
unset($arr_btn_social[2]);
$this->NM_ajax_info['buttonDisplay']['google'] = $this->nmgp_botoes["google"] = 'off';;
}
$str_btn_social = implode(', ', $arr_btn_social);
if($this->sc_temp_sett_auth_sn_position == 'below'){
echo <<
$str_btn_social
{
margin: 10px 20px;
display: block !important;
}
.scFormToolbarPadding:not(:has(.sc-unique-btn-1)){
width: 0 !important;
padding: 0px;
}
.scFormToolbarPadding:has(.sc-unique-btn-1){
width:100% !important;
padding:4px;
}
CSS;
}
switch( $this->sc_temp_sett_login_mode ){
default:
case 'username':
$sc_tmp_field_name = 'login';
$this->NM_ajax_info['fieldLabel'][$sc_tmp_field_name] = $this->nm_new_label[$sc_tmp_field_name] = $this->Ini->Nm_lang['lang_field_login'] ;
break;
case 'email':
$sc_tmp_field_name = 'login';
$this->NM_ajax_info['fieldLabel'][$sc_tmp_field_name] = $this->nm_new_label[$sc_tmp_field_name] = $this->Ini->Nm_lang['lang_field_email'] ;
break;
case 'both':
$sc_tmp_field_name = 'login';
$this->NM_ajax_info['fieldLabel'][$sc_tmp_field_name] = $this->nm_new_label[$sc_tmp_field_name] = $this->Ini->Nm_lang['lang_field_both'] ;
break;
}
$this->pswd = "Taquilla123*";
if (isset($this->sc_temp_return_msg_email_act)) { $_SESSION['return_msg_email_act'] = $this->sc_temp_return_msg_email_act;}
if (isset($this->sc_temp_sett_new_users)) { $_SESSION['sett_new_users'] = $this->sc_temp_sett_new_users;}
if (isset($this->sc_temp_sett_retrieve_password)) { $_SESSION['sett_retrieve_password'] = $this->sc_temp_sett_retrieve_password;}
if (isset($this->sc_temp_sett_language)) { $_SESSION['sett_language'] = $this->sc_temp_sett_language;}
if (isset($this->sc_temp_sett_auth_sn_fb)) { $_SESSION['sett_auth_sn_fb'] = $this->sc_temp_sett_auth_sn_fb;}
if (isset($this->sc_temp_sett_auth_sn_x)) { $_SESSION['sett_auth_sn_x'] = $this->sc_temp_sett_auth_sn_x;}
if (isset($this->sc_temp_sett_auth_sn_google)) { $_SESSION['sett_auth_sn_google'] = $this->sc_temp_sett_auth_sn_google;}
if (isset($this->sc_temp_sett_auth_sn_position)) { $_SESSION['sett_auth_sn_position'] = $this->sc_temp_sett_auth_sn_position;}
if (isset($this->sc_temp_sett_login_mode)) { $_SESSION['sett_login_mode'] = $this->sc_temp_sett_login_mode;}
if (isset($this->NM_ajax_flag) && $this->NM_ajax_flag)
{
if (isset($Ctrl_Proc_Onload) && $Ctrl_Proc_Onload) {
$Ctrl_Format = true;
$this->nm_guardar_campos();
if ($bFormat) $this->nm_formatar_campos();
}
if (($original_idoficina != $this->idoficina || (isset($bFlagRead_idoficina) && $bFlagRead_idoficina)))
{
$this->ajax_return_values_idoficina(true);
}
if (($original_idtaquilla != $this->idtaquilla || (isset($bFlagRead_idtaquilla) && $bFlagRead_idtaquilla)))
{
$this->ajax_return_values_idtaquilla(true);
}
if (($original_login != $this->login || (isset($bFlagRead_login) && $bFlagRead_login)))
{
$this->ajax_return_values_login(true);
}
if (($original_new_user != $this->new_user || (isset($bFlagRead_new_user) && $bFlagRead_new_user)))
{
$this->ajax_return_values_new_user(true);
}
if (($original_pswd != $this->pswd || (isset($bFlagRead_pswd) && $bFlagRead_pswd)))
{
$this->ajax_return_values_pswd(true);
}
if (($original_retrieve_pswd != $this->retrieve_pswd || (isset($bFlagRead_retrieve_pswd) && $bFlagRead_retrieve_pswd)))
{
$this->ajax_return_values_retrieve_pswd(true);
}
}
$_SESSION['scriptcase']['app2_Login']['contr_erro'] = 'off';
/*----- END - Scriptcase Locale: Event onLoad ------*/
}
if (!empty($this->Campos_Mens_erro))
{
$this->Erro->mensagem(__FILE__, __LINE__, "critica", $this->Campos_Mens_erro);
}
$this->nm_guardar_campos();
$this->nm_formatar_campos();
$this->initFormPages();
include_once("app2_Login_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(""))) {
$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]['app2_Login']['table_refresh']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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]['app2_Login']['csrf_token']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['csrf_token'] = $this->scCsrfGenerateToken();
}
return $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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_idempresa()
{
$nmgp_def_dados = "" ;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa'] = array_unique($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa']);
}
else
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa'] = array();
}
$nm_nao_carga = false;
$nmgp_def_dados = "" ;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa'] = array_unique($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa']);
}
else
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idempresa'] = array();
}
$old_value_nutaquilla = $this->nutaquilla;
$old_value_perfil = $this->perfil;
$old_value_fechacierre = $this->fechacierre;
$old_value_fechahoy = $this->fechahoy;
$old_value_idoficina = $this->idoficina;
$old_value_jornada = $this->jornada;
$this->nm_tira_formatacao();
if ($this->nmgp_opcao != "nada") {
$this->nm_converte_datas(false);
}
$unformatted_value_nutaquilla = $this->nutaquilla;
$unformatted_value_perfil = $this->perfil;
$unformatted_value_fechacierre = $this->fechacierre;
$unformatted_value_fechahoy = $this->fechahoy;
$unformatted_value_idoficina = $this->idoficina;
$unformatted_value_jornada = $this->jornada;
$remember_me_val_str = "''";
if (!empty($this->remember_me))
{
if (is_array($this->remember_me))
{
$Tmp_array = $this->remember_me;
}
else
{
$Tmp_array = explode(";", $this->remember_me);
}
$remember_me_val_str = "";
foreach ($Tmp_array as $Tmp_val_cmp)
{
if ("" != $remember_me_val_str)
{
$remember_me_val_str .= ", ";
}
$remember_me_val_str .= "'$Tmp_val_cmp'";
}
}
$nm_comando = "SELECT idempresa,empresa FROM empresas ORDER BY idempresa";
$this->nutaquilla = $old_value_nutaquilla;
$this->perfil = $old_value_perfil;
$this->fechacierre = $old_value_fechacierre;
$this->fechahoy = $old_value_fechahoy;
$this->idoficina = $old_value_idoficina;
$this->jornada = $old_value_jornada;
$_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]['app2_Login']['Lookup_idempresa'][] = $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_idtaquilla()
{
$nmgp_def_dados = "" ;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla'] = array_unique($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla']);
}
else
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla'] = array();
}
$nm_nao_carga = false;
$nmgp_def_dados = "" ;
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla'] = array_unique($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla']);
}
else
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['Lookup_idtaquilla'] = array();
}
$old_value_nutaquilla = $this->nutaquilla;
$old_value_perfil = $this->perfil;
$old_value_fechacierre = $this->fechacierre;
$old_value_fechahoy = $this->fechahoy;
$old_value_idoficina = $this->idoficina;
$old_value_jornada = $this->jornada;
$this->nm_tira_formatacao();
if ($this->nmgp_opcao != "nada") {
$this->nm_converte_datas(false);
}
$unformatted_value_nutaquilla = $this->nutaquilla;
$unformatted_value_perfil = $this->perfil;
$unformatted_value_fechacierre = $this->fechacierre;
$unformatted_value_fechahoy = $this->fechahoy;
$unformatted_value_idoficina = $this->idoficina;
$unformatted_value_jornada = $this->jornada;
$nm_comando = "SELECT idtaquilla, nomtaquilla FROM taquillas WHERE perfil = 4 and idusuario = \"0\" ORDER BY nomtaquilla";
$this->nutaquilla = $old_value_nutaquilla;
$this->perfil = $old_value_perfil;
$this->fechacierre = $old_value_fechacierre;
$this->fechahoy = $old_value_fechahoy;
$this->idoficina = $old_value_idoficina;
$this->jornada = $old_value_jornada;
$_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]['app2_Login']['Lookup_idtaquilla'][] = $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 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]['app2_Login']['dyn_search_and_or']);
unset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dyn_search_cache']);
unset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_filter']);
unset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['total']);
unset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['fast_search']);
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_detal']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_detal']))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_filter'] = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_detal'];
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['empty_filter']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['empty_filter'])
{
unset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['empty_filter']);
$this->NM_ajax_info['empty_filter'] = 'ok';
app2_Login_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 (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_detal']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_detal']) && !empty($comando))
{
$comando = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_detal'] . " and (" . $comando . ")";
}
if (empty($comando))
{
$comando = " 1 <> 1 ";
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_filter_form']) && '' != $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_filter_form'])
{
$sc_where = " where " . $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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_app2_Login = isset($rt->fields[0]) ? $rt->fields[0] - 1 : 0;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['total'] = $qt_geral_reg_app2_Login;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['where_filter'] = $comando;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['fast_search'][0] = $field;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['fast_search'][1] = $arg_search;
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['fast_search'][2] = $sv_data;
$rt->Close();
if (isset($rt->fields[0]) && $rt->fields[0] > 0 && isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['empty_filter']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['empty_filter'])
{
unset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['empty_filter']);
$this->NM_ajax_info['empty_filter'] = 'ok';
app2_Login_pack_ajax_response();
exit;
}
elseif (!isset($rt->fields[0]) || $rt->fields[0] == 0)
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['empty_filter'] = true;
$this->NM_ajax_info['empty_filter'] = 'ok';
app2_Login_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[] = "";
if (in_array($campo_join, $nm_numeric))
{
if ($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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);
}
$Nm_datas[""] = "date";
if (isset($Nm_datas[$campo_join]))
{
for ($x = 0; $x < strlen($campo); $x++)
{
$tst = substr($campo, $x, 1);
if (!is_numeric($tst) && ($tst != "-" && $tst != ":" && $tst != " "))
{
return;
}
}
}
if (isset($Nm_datas[$campo_join]))
{
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['SC_sep_date']) && !empty($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['SC_sep_date']))
{
$nm_aspas = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['SC_sep_date'];
$nm_aspas1 = $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['SC_sep_date1'];
}
}
if (isset($Nm_datas[$campo_join]) && (strtoupper($condicao) == "II" || strtoupper($condicao) == "QP" || strtoupper($condicao) == "NP" || strtoupper($condicao) == "DF"))
{
if (strtoupper($condicao) == "DF")
{
$condicao = "NP";
}
}
$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 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 = "app2_Login_fim.php";
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['redir']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['redir'] == 'redir')
{
unset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']);
}
unset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['opc_ant']);
if ($tipo == 2 && isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['nm_run_menu']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['nm_run_menu'] == 1)
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['nm_run_menu'] = 2;
$nmgp_saida_form = "app2_Login_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;
}
app2_Login_pack_ajax_response();
exit;
}
?>
GMT"/>
NM_is_redirected) && $this->NM_is_redirected)
{
return;
}
if (is_array($nm_apl_parms))
{
$tmp_parms = "";
foreach ($nm_apl_parms as $par => $val)
{
$par = trim($par);
$val = trim($val);
$tmp_parms .= str_replace(".", "_", $par) . "?#?";
if (substr($val, 0, 1) == "$")
{
$tmp_parms .= $$val;
}
elseif (substr($val, 0, 1) == "{")
{
$val = substr($val, 1, -1);
$tmp_parms .= $this->$val;
}
elseif (substr($val, 0, 1) == "[")
{
$tmp_parms .= $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login'][substr($val, 1, -1)];
}
else
{
$tmp_parms .= $val;
}
$tmp_parms .= "?@?";
}
$nm_apl_parms = $tmp_parms;
}
if (empty($opc))
{
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['opcao'] = "";
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['opc_ant'] = "";
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['retorno_edit'] = "";
}
$nm_target_form = (empty($nm_target)) ? "_self" : $nm_target;
if (strtolower(substr($nm_apl_dest, -4)) != ".php" && (strtolower(substr($nm_apl_dest, 0, 7)) == "http://" || strtolower(substr($nm_apl_dest, 0, 8)) == "https://" || strtolower(substr($nm_apl_dest, 0, 3)) == "../"))
{
if ($this->NM_ajax_flag)
{
$this->NM_ajax_info['redir']['metodo'] = 'location';
$this->NM_ajax_info['redir']['action'] = $nm_apl_dest;
$this->NM_ajax_info['redir']['target'] = $nm_target_form;
app2_Login_pack_ajax_response();
exit;
}
echo "";
return;
}
else
{
echo "window.location='" . $nm_apl_dest . "';";
echo "";
$this->NM_close_db();
exit;
}
}
$dir = explode("/", $nm_apl_dest);
if (count($dir) == 1)
{
$nm_apl_dest = str_replace(".php", "", $nm_apl_dest);
$nm_apl_dest = $this->Ini->path_link . SC_dir_app_name($nm_apl_dest) . "/" . $nm_apl_dest . ".php";
}
if ($this->NM_ajax_flag)
{
$nm_apl_parms = str_replace("?#?", "*scin", NM_charset_to_utf8($nm_apl_parms));
$nm_apl_parms = str_replace("?@?", "*scout", $nm_apl_parms);
$this->NM_ajax_info['redir']['metodo'] = 'post';
$this->NM_ajax_info['redir']['action'] = $nm_apl_dest;
$this->NM_ajax_info['redir']['nmgp_parms'] = $nm_apl_parms;
$this->NM_ajax_info['redir']['target'] = $nm_target_form;
$this->NM_ajax_info['redir']['h_modal'] = $alt_modal;
$this->NM_ajax_info['redir']['w_modal'] = $larg_modal;
if ($nm_target_form == "_blank")
{
$this->NM_ajax_info['redir']['nmgp_outra_jan'] = 'true';
}
else
{
$this->NM_ajax_info['redir']['nmgp_url_saida'] = $nm_apl_retorno;
$this->NM_ajax_info['redir']['script_case_init'] = $this->Ini->sc_page;
}
app2_Login_pack_ajax_response();
exit;
}
if ($nm_target == "modal")
{
if (!empty($nm_apl_parms))
{
$nm_apl_parms = str_replace("?#?", "*scin", $nm_apl_parms);
$nm_apl_parms = str_replace("?@?", "*scout", $nm_apl_parms);
$nm_apl_parms = "nmgp_parms=" . $nm_apl_parms . "&";
}
$par_modal = "?script_case_init=" . $this->Ini->sc_page . "&nmgp_outra_jan=true&nmgp_url_saida=modal&NMSC_modal=ok&";
$this->redir_modal = "$(function() { tb_show('', '" . $nm_apl_dest . $par_modal . $nm_apl_parms . "TB_iframe=true&modal=true&height=" . $alt_modal . "&width=" . $larg_modal . "', '') })";
$this->NM_is_redirected = true;
return;
}
if ($nm_target == "_blank")
{
?>
GMT"/>
NM_close_db();
exit;
}
}
function sc_ajax_alert($sMessage, $params = array())
{
if ($this->NM_ajax_flag)
{
$this->NM_ajax_info['ajaxAlert']['message'] = NM_charset_to_utf8($sMessage);
$this->NM_ajax_info['ajaxAlert']['params'] = $this->sc_ajax_alert_params($params);
}
} // sc_ajax_alert
function sc_ajax_alert_params($params)
{
$paramList = array();
foreach ($params as $paramName => $paramValue)
{
if (in_array($paramName, array('title', 'timer', 'confirmButtonText', 'confirmButtonFA', 'confirmButtonFAPos', 'cancelButtonText', 'cancelButtonFA', 'cancelButtonFAPos', 'footer', 'width', 'padding', 'position')))
{
$paramList[$paramName] = NM_charset_to_utf8($paramValue);
}
elseif (in_array($paramName, array('showConfirmButton', 'showCancelButton', 'toast')) && in_array($paramValue, array(true, false)))
{
$paramList[$paramName] = NM_charset_to_utf8($paramValue);
}
elseif ('position' == $paramName && in_array($paramValue, array('top', 'top-start', 'top-end', 'center', 'center-start', 'center-end', 'bottom', 'bottom-start', 'bottom-end')))
{
$paramList[$paramName] = NM_charset_to_utf8($paramValue);
}
elseif ('type' == $paramName && in_array($paramValue, array('warning', 'error', 'success', 'info', 'question')))
{
$paramList[$paramName] = NM_charset_to_utf8($paramValue);
}
elseif ('background' == $paramName)
{
$paramList[$paramName] = $this->sc_ajax_alert_image(NM_charset_to_utf8($paramValue));
}
}
return $paramList;
} // sc_ajax_alert_params
function sc_ajax_alert_image($background)
{
$image_param = $background;
preg_match_all('/url\(([\s])?(["|\'])?(.*?)(["|\'])?([\s])?\)/i', $background, $matches, PREG_PATTERN_ORDER);
if (isset($matches[3])) {
foreach ($matches[3] as $match) {
if ('http:' != substr($match, 0, 5) && 'https:' != substr($match, 0, 6) && '/' != substr($match, 0, 1)) {
$image_param = str_replace($match, "{$this->Ini->path_img_global}/{$match}", $image_param);
}
}
}
return $image_param;
} // sc_ajax_alert_image
function getButtonIds($buttonName) {
switch ($buttonName) {
case "ok":
return array("sub_form_b.sc-unique-btn-1");
break;
case "facebook":
return array("bfacebook_b.sc-unique-btn-2");
break;
case "google":
return array("bgoogle_b.sc-unique-btn-3");
break;
case "twitter":
return array("btwitter_b.sc-unique-btn-4");
break;
}
return array($buttonName);
} // getButtonIds
function displayAppHeader()
{
if ($this->Embutida_call) {
return;
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['mostra_cab']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['mostra_cab'] == "N") {
return;
}
if ($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dashboard_info']['under_dashboard'] && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dashboard_info']['compact_mode'] && !$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dashboard_info']['maximized']) {
return;
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['link_info']['compact_mode']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['link_info']['compact_mode']) {
return;
}
?>
Embutida_call) {
return;
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['mostra_cab']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['mostra_cab'] == "N") {
return;
}
if ($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dashboard_info']['under_dashboard'] && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dashboard_info']['compact_mode'] && !$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['dashboard_info']['maximized']) {
return;
}
if (isset($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['link_info']['compact_mode']) && $_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['link_info']['compact_mode']) {
return;
}
?>
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]['app2_Login']['reg_start'] + 1,
$_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['total'] + 1,
],
$summaryLine
);
return $summaryLine;
} // getSummaryLine
function scGetColumnOrderRule($fieldName, &$orderColName, &$orderColOrient, &$orderColRule)
{
$sortRule = 'nosort';
if ($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['ordem_cmp'] == $fieldName) {
$orderColName = $fieldName;
if ($_SESSION['sc_session'][$this->Ini->sc_page]['app2_Login']['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 "":
return true;
case "":
return true;
case "":
return true;
case "":
return true;
case "":
return true;
default:
return false;
}
return false;
}
function scGetDefaultFieldOrder($fieldName)
{
switch ($fieldName) {
default:
return 'asc';
}
return 'asc';
}
}
?>