<?php session_start(); putEnv("ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe"); putEnv("ORACLE_SID=XE"); putEnv("LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib"); include 'conexion.php'; //print("estamos en rol1\n"); if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) { } else { echo "<br/>" . "Esta pagina es solo para usuarios registrados." . "<br/>"; echo "<br/>" . "<a href='main_login.php'>Login Here!</a>"; exit; } ?> <!DOCTYPE html> <html lang="en"> <HEAD> <TITLE>CONSULTA 8</TITLE> </HEAD> <BODY> <!-- Aqui va todo lo chachi --> <H1>CONSULTA 8</H1> <hr/> <?php
function setLang($locale) { // Beware: this is changing the locale process-wide. // But *only* for LC_MESSAGES, not other LC_*. // This is not thread-safe. For threaded web servers, // the slower Translation2 classes should be used. //Setting the locale again here overrides what i18Nv2 just set //breaking Windows. However not setting it breaks some Linux distro's. //Because apparently LC_ALL doesn't matter on some Unix, it still doesn't set LC_MESSAGES. //So if we didn't explicity set LC_MESSAGES above, do it here. if (OPERATING_SYSTEM == 'LINUX') { $rc = setlocale(LC_MESSAGES, $locale); if ($rc == 0) { Debug::text('setLocale failed!: ' . (int) $rc . ' Locale: ' . $locale, __FILE__, __LINE__, __METHOD__, 10); } } // Normally, setting env var(s) would not be necessary, but I18Nv2 // is explicitly setting LANG* env variables, which seem to be // overriding setlocale(). Setting the env var here, fixes it. // Yes, I know it seems backwards. YMMV. @putEnv('LANGUAGE=' . $locale); $domain = 'messages'; //This fixes the mysterious issue of the "sticky locale". Where PHP //wouldn't change locales half way through a script. textdomain($domain); // Tell gettext where to find the locale translation files. bindtextdomain("{$domain}", Environment::getBasePath() . DIRECTORY_SEPARATOR . 'interface' . DIRECTORY_SEPARATOR . 'locale'); // Tell gettext which codeset to use for output. bind_textdomain_codeset($domain, 'UTF-8'); return TRUE; }
/** * Set Locale * * Example: * <code> * I18Nv2::setLocale('en_GB'); * </code> * * @static * @access public * @return mixed &type.string; used locale or false on failure * @param string $locale a valid locale like en_US or de_DE * @param int $cat the locale category - usually LC_ALL */ static function setLocale($locale = null, $cat = LC_ALL) { if (!strlen($locale)) { return setLocale($cat, null); } $locales = I18Nv2::getStaticProperty('locales'); // get complete standard locale code (en => en_US) if (isset($locales[$locale])) { $locale = $locales[$locale]; } // get Win32 locale code (en_US => enu) if (I18Nv2_WIN) { $windows = I18Nv2::getStaticProperty('windows'); $setlocale = isset($windows[$locale]) ? $windows[$locale] : $locale; } else { $setlocale = $locale; } $syslocale = setLocale($cat, $setlocale); // if the locale is not recognized by the system, check if there // is a fallback locale and try that, otherwise return false if (!$syslocale) { $fallbacks =& I18Nv2::getStaticProperty('fallbacks'); if (isset($fallbacks[$locale])) { // avoid endless recursion with circular fallbacks $trylocale = $fallbacks[$locale]; unset($fallbacks[$locale]); if ($retlocale = I18Nv2::setLocale($trylocale, $cat)) { $fallbacks[$locale] = $trylocale; return $retlocale; } } return false; } $language = substr($locale, 0, 2); if (I18Nv2_WIN) { @putEnv('LANG=' . $language); @putEnv('LANGUAGE=' . $language); } else { @putEnv('LANG=' . $locale); @putEnv('LANGUAGE=' . $locale); } // unshift locale stack $last =& I18Nv2::getStaticProperty('last'); array_unshift($last, array(0 => $locale, 1 => $language, 2 => $syslocale, 'locale' => $locale, 'language' => $language, 'syslocale' => $syslocale)); // fetch locale specific information $info =& I18Nv2::getStaticProperty('info'); $info = localeConv(); return $syslocale; }
function gs_setlang($locale) { global $g_gs_language; $locale = gs_lang_name_locale($locale); if (GS_INTL_USE_GETTEXT && extension_loaded('gettext')) { switch (strToLower(subStr($locale, 0, 2))) { case 'de': setLocale(LC_MESSAGES, array($locale, 'de_DE@euro', 'de_DE', 'de', 'deu_deu', 'ge')); break; case 'en': setLocale(LC_MESSAGES, array($locale, 'en_US', 'en')); break; default: setLocale(LC_MESSAGES, $locale); } putEnv('LANGUAGE=' . $locale); putEnv('LANG=' . $locale); return setLocale(LC_MESSAGES, '0'); } else { $langdirs = glob(GS_DIR . 'locale/*_*'); foreach ($langdirs as $langdir) { $langdir = baseName($langdir); $lc_locale = strToLower($locale); if ($lc_locale === strToLower($langdir)) { $g_gs_language = $langdir; return $langdir; } } foreach ($langdirs as $langdir) { $langdir = baseName($langdir); $lc_lang_locale = strToLower(subStr($locale, 0, 2)); if ($lc_lang_locale === strToLower(subStr($langdir, 0, 2))) { $g_gs_language = $langdir; return $langdir; } } return false; } }
/** * Set Locale * * Example: * <code> * I18Nv2::setLocale('en_GB'); * </code> * * @static * @access public * @return mixed &type.string; used locale or false on failure * @param string $locale a valid locale like en_US or de_DE * @param int $cat the locale category - usually LC_ALL */ static function setLocale($locale = null, $cat = LC_ALL) { if (!strlen($locale)) { return setLocale($cat, null); } $locales = I18Nv2::getStaticProperty('locales'); // get complete standard locale code (en => en_US) if (isset($locales[$locale])) { $locale = $locales[$locale]; } // get Win32 locale code (en_US => enu) if (I18Nv2_WIN) { $windows = I18Nv2::getStaticProperty('windows'); $setlocale = isset($windows[$locale]) ? $windows[$locale] : $locale; } else { $setlocale = $locale; } $syslocale = setLocale($cat, $setlocale); // if the locale is not recognized by the system, check if there // is a fallback locale and try that, otherwise return false if (!$syslocale) { $fallbacks =& I18Nv2::getStaticProperty('fallbacks'); if (isset($fallbacks[$locale])) { // avoid endless recursion with circular fallbacks $trylocale = $fallbacks[$locale]; unset($fallbacks[$locale]); if ($retlocale = I18Nv2::setLocale($trylocale, $cat)) { $fallbacks[$locale] = $trylocale; return $retlocale; } } return false; } $language = substr($locale, 0, 2); if (I18Nv2_WIN) { @putEnv('LANG=' . $language); @putEnv('LANGUAGE=' . $language); } else { @putEnv('LANG=' . $locale); @putEnv('LANGUAGE=' . $locale); } // unshift locale stack $last =& I18Nv2::getStaticProperty('last'); array_unshift($last, array(0 => $locale, 1 => $language, 2 => $syslocale, 'locale' => $locale, 'language' => $language, 'syslocale' => $syslocale)); // fetch locale specific information $info =& I18Nv2::getStaticProperty('info'); $info = localeConv(); //For some reason Windows can return bogus locale data where frac_digits is 127, in that case just fall back to default english values if (isset($info['frac_digits']) and $info['frac_digits'] == 127) { $info = array('decimal_point' => '.', 'thousands_sep' => ',', 'int_curr_symbol' => '', 'currency_symbol' => '$', 'mon_decimal_point' => '.', 'mon_thousands_sep' => ',', 'positive_sign' => '', 'negative_sign' => '-', 'int_frac_digits' => 2, 'frac_digits' => 2, 'p_cs_precedes' => 1, 'p_sep_by_space' => 0, 'n_cs_precedes' => 1, 'n_sep_by_space' => 0, 'p_sign_posn' => 1, 'n_sign_posn' => 1, 'grouping' => array(3, 3), 'mon_grouping' => array(3, 3)); } return $syslocale; }
if (!file_exists($AGI_SCRIPT)) { gs_log(GS_LOG_WARNING, 'AGI script "' . $argv[1] . '" not found!'); echo '### AGI script "' . $argv[1] . '" not found!' . "\n"; exit(1); } putEnv('AST_AGI_DIR=/tmp/FAKE'); putEnv('AST_CONFIG_DIR=/tmp/FAKE'); putEnv('AST_CONFIG_FILE='); putEnv('AST_DATA_DIR=/tmp/FAKE'); putEnv('AST_KEY_DIR=/tmp/FAKE'); putEnv('AST_LOG_DIR=/tmp/FAKE'); putEnv('AST_MODULE_DIR=/tmp/FAKE'); putEnv('AST_MONITOR_DIR=/tmp/FAKE'); putEnv('AST_RUN_DIR=/tmp/FAKE'); putEnv('AST_SPOOL_DIR=/tmp/FAKE'); putEnv('AST_VAR_DIR=/tmp/FAKE'); $cmd = $AGI_SCRIPT; for ($i = 2; $i < $argc; ++$i) { $cmd .= ' ' . ($argv[$i] != '' ? escapeShellArg($argv[$i]) : '\'\''); } //echo "### CMD: ".$cmd."\n"; gs_log(GS_LOG_DEBUG, "Fake AGI invocation: {$AGI_SCRIPT} ..."); $pipes = array(); $proc = proc_open($cmd, array(0 => array('pipe', 'rb'), 1 => array('pipe', 'wb'), 2 => array('pipe', 'wb')), $pipes, '/tmp'); if (!$proc) { gs_log(GS_LOG_WARNING, 'Failed to run AGI script!'); echo '### Failed to run AGI script!' . "\n"; exit(1); } function _fake_agi_send($fd, $line) {