示例#1
0
 function render($region = "")
 {
     $out = "";
     if ($region == "page") {
         if ($this->all) {
             ob_start();
             include "inc/header.php";
             $out .= ob_get_contents();
             ob_end_clean();
         }
         if ($this->all) {
             if (isset($this->parent->scripts)) {
                 foreach ($this->parent->scripts as $script) {
                     $out .= $script->render("body");
                 }
             }
             $out .= parse($this, "body");
         }
         if ($this->file != "" and file_exists($this->file)) {
             ob_start();
             include $this->file;
             $out .= ob_get_contents();
             ob_end_clean();
         } else {
             $out .= "File not found: " . $this->file;
         }
         if ($this->all) {
             ob_start();
             include "inc/footer.php";
             $out .= ob_get_contents();
             ob_end_clean();
         }
     }
     return $out;
 }
示例#2
0
 public function getSU_paquetesPendientes($FUPE_NU_NRO_DOC, $FUPE_FE_ESTADO_DESDE, $FUPE_FE_ESTADO_HASTA, $FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO, $FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)
 {
     $query = "SELECT \"ID\", \"Fecha Carga\", \"Canal\", \"Nro. Documento\", \"Producto\", \"Sucursal\", \"Nro. Solicitud\", \"Fecha GD\",\n\t\t\"Estado Formulario\", \"Area Resolución\", \"Fecha Alta de Solicitud\", \"idSolicitante\", \"Modalidad de Venta\", \"Programa de Venta\",\n\t\t\"Fecha Ultimo Estado\", \"Ultimo Estado\", \"Fecha de Rechazo\", \"Tipo de Rechazo\", \"Motivos de Rechazo\" FROM (SELECT FUPE_NU_ID \"ID\",\n\t\tTO_CHAR (FUPE_FE_ESTADO_1, 'DD/MM/YYYY') \"Fecha Carga\", FUPE_CD_CANAL \"Canal\", FUPE_NU_NRO_DOC \"Nro. Documento\", FUPE_CD_PRODUCTO \"Producto\",\n\t\tFUPE_CD_COD_SUCURSAL \"Sucursal\", FUPE_NU_NRO_SOLICITUD \"Nro. Solicitud\", TO_CHAR (FUPE_FE_ESTADO_GD, 'DD/MM/YYYY') \"Fecha GD\",\n\t\tFUPE_CD_ESTADO_FORM \"Estado Formulario\", FUPE_CD_AREA_RESOL \"Area Resolución\", FUPE_FE_ALTA_SOL \"Fecha Alta de Solicitud\",\n\t\tFUPE_CD_IDSOL \"idSolicitante\", FUPE_CD_MOD_VENTA \"Modalidad de Venta\", FUPE_CD_PRG_VENTA \"Programa de Venta\", CASE\n\t\tWHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN CASE\n\t\tWHEN FUPE_CD_ESTADO_SCORING IS NULL THEN TO_CHAR (FUPE_FE_ESTADO_1, 'DD/MM/YYYY') ELSE TO_CHAR (FUPE_FE_ESTADO_SCORING, 'DD/MM/YYYY') END ELSE\n\t\tTO_CHAR (FUPE_FE_ESTADO_RCH_SCORING, 'DD/MM/YYYY') END ELSE TO_CHAR (FUPE_FE_ESTADO_RNG_SCORING, 'DD/MM/YYYY') END ELSE TO_CHAR (FUPE_FE_ESTADO_13, 'DD/MM/YYYY')\n\t\tEND \"Fecha Ultimo Estado\", CASE WHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE\n\t\tWHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_SCORING IS NULL THEN FUPE_CD_ESTADO_1 ELSE FUPE_CD_ESTADO_SCORING END ELSE\n\t\t'RECHAZO DE VERIFICACION DE VEAL' END ELSE FUPE_CD_ESTADO_RNG_SCORING END ELSE FUPE_CD_ESTADO_13 END \"Ultimo Estado\", CASE\n\t\tWHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN CASE\n\t\tWHEN FUPE_CD_ESTADO_SCORING IS NULL THEN NULL ELSE NULL END ELSE TO_CHAR (FUPE_FE_ESTADO_RCH_SCORING, 'DD/MM/YYYY') END ELSE NULL END ELSE NULL END\n\t\t\"Fecha de Rechazo\", CASE WHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE\n\t\tWHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_SCORING IS NULL THEN NULL ELSE NULL END ELSE FUPE_CD_MOTIVO_RCH_SCORING END ELSE\n\t\tNULL END ELSE NULL END \"Tipo de Rechazo\", CASE WHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL\n\t\tTHEN CASE WHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_SCORING IS NULL THEN NULL ELSE NULL END ELSE\n\t\tFUPE_CD_ESTADO_RCH_SCORING END ELSE NULL END ELSE NULL END \"Motivos de Rechazo\" FROM CPI.SUCURSALES\n\t\tWHERE FUPE_CD_ESTADO_REPROCESO IS NULL AND FUPE_CD_ESTADO_13 IS NULL AND (FUPE_CD_ESTADO_FORM IS NULL OR FUPE_CD_ESTADO_FORM != 'Solicitud Declinada') ";
     if (!empty($FUPE_NU_NRO_DOC)) {
         $query .= " AND FUPE_NU_NRO_DOC = '{$FUPE_NU_NRO_DOC}' ";
     }
     if (!empty($FUPE_FE_ESTADO_DESDE) && !empty($FUPE_FE_ESTADO_HASTA)) {
         $query .= " AND FUPE_FE_ESTADO_1 BETWEEN '{$FUPE_FE_ESTADO_DESDE}' AND '{$FUPE_FE_ESTADO_HASTA}'";
     }
     if (!empty($FUPE_FE_ESTADO_DESDE) && empty($FUPE_FE_ESTADO_HASTA)) {
         $query .= " AND FUPE_FE_ESTADO_1 >= '{$FUPE_FE_ESTADO_DESDE}'";
     }
     if (empty($FUPE_FE_ESTADO_DESDE) && !empty($FUPE_FE_ESTADO_HASTA)) {
         $query .= " AND FUPE_FE_ESTADO_1 <= '{$FUPE_FE_ESTADO_HASTA}'";
     }
     $query .= ") WHERE 1 = 1 ";
     if (!empty($FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO) && !empty($FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)) {
         $query .= " AND \"Fecha Ultimo Estado\" BETWEEN TO_DATE('{$FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO}','DD/MM/YYYY') AND TO_DATE('{$FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO}','DD/MM/YYYY')";
     }
     if (!empty($FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO) && empty($FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)) {
         $query .= " AND \"Fecha Ultimo Estado\" >= TO_DATE('{$FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO}','DD/MM/YYYY')";
     }
     if (empty($FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO) && !empty($FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)) {
         $query .= " AND \"Fecha Ultimo Estado\" <= TO_DATE('{$FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO}','DD/MM/YYYY')";
     }
     return json_encode($this->conection . parse($query));
 }
示例#3
0
function func_cd($param, $fd)
{
    static $prev;
    $nextdir = parse($param);
    if (isset($nextdir[1][1])) {
        if ($nextdir[1][1][0] == "~") {
            $nextdir[1][1] = preg_replace("/~/", my_getenv("HOME"), $nextdir[1][1]);
        }
        if ($nextdir[1][1] == "-") {
            cdmoin($prev, $fd);
        } else {
            if (!file_exists($nextdir[1][1])) {
                echo "cd: {$nextdir[1][1]} No such file or directory\n";
            } else {
                if (!is_readable($nextdir[1][1])) {
                    echo "cd: {$nextdirt[1][1]}: Permission denied\n";
                } else {
                    $prev = my_getenv("PWD");
                    majenv("OLDPWD", my_getenv("PWD"));
                    chdir($nextdir[1][1]);
                    majenv("PWD", getcwd());
                }
            }
        }
    } else {
        func_cd("cd ~", $fd);
    }
}
示例#4
0
/**
 * Generate the documentation. The "main loop", so to speak.
 * 
 * @param string $file (the filename)
 * @return void
 */
function generate_documentation($file)
{
    $code = file_get_contents($file);
    $sections = parse($file, $code);
    $sections = highlight($file, $sections);
    generate_html($file, $sections);
}
示例#5
0
function add_ban_ip($ip, $id_modo, $duree, $motif, $motif_admin)
{
    inc_lib('bbcode/parse');
    $motif_admin = parse(insertBD(trim($motif_admin)));
    $motif = insertBD(trim($motif_admin));
    Nw::$DB->query("INSERT INTO " . Nw::$prefix_table . "ban_ip(ban_ip, ban_id_modo,\n        ban_date, ban_date_end, ban_is_end, ban_motif, ban_motif_admin)\n        VALUES(" . ip2long($ip) . ", " . intval($id_modo) . ", NOW(),\n        NOW() + " . intval($duree) . " DAY, 0, '" . $motif . "', '" . $motif_admin . "'");
}
示例#6
0
 public function Parse($topic)
 {
     if ($_COOKIE['ostrich_mode'] == 1) {
         foreach ($User->IgnoreList as $ignored_phrase) {
             if (stripos($reply_body, $ignored_phrase) !== false) {
                 $this->Ignored = true;
                 $this->ParsedBody = '[This post has matched a phrase on your ignore list and is therefore hidden.]';
                 return;
             }
         }
     }
     $body = parse($this->Body);
     // Linkify citations. (This might be updated to use preg_replace_callback in the future.)
     preg_match_all('/^@([0-9,]+)/m', $body, $matches);
     foreach ($matches[0] as $formatted_id) {
         $name = '';
         $pure_id = str_replace(array('@', ','), '', $formatted_id);
         if (!array_key_exists($pure_id, $topic->Replies)) {
             $body = str_replace($formatted_id, '<span class="unimportant">(Citing a deleted or non-existent reply.)</span>', $body);
         } else {
             if ($topic->Replies[$pure_id]->isHidden()) {
                 $body = str_replace($formatted_id, '<span class="unimportant help" title="' . snippet($topic->Replies[$pure_id]->Body) . '">@hidden</span>', $body);
             } else {
                 if ($pure_id == $topic->PreviousReply->ID) {
                     $link_text = '@previous';
                 } else {
                     $link_text = $formatted_id;
                 }
                 $body = str_replace($formatted_id, '<a href="#reply_' . $pure_id . '" onclick="highlightReply(\'' . $pure_id . '\'); createSnapbackLink(\'' . $reply_id . '\')" class="unimportant help" title="' . snippet($topic->Replies[$pure_id]->Body) . '">' . $link_text . '</a> <span class="unimportant citation">(' . $topic->GetName($this, $pure_id) . ')</span>', $body);
             }
         }
     }
     $this->ParsedBody = preg_replace('/^@OP/', '<span class="unimportant">@OP</span>', $body);
 }
示例#7
0
    public function getContent()
    {
        global $sql;
        //Lang::load('blocks/shoutbox/lang.*.php');
        $err = new Error();
        $note = new Notifier('note-shoutbox');
        $form['author'] = LOGGED ? User::$nickname : '';
        $form['message'] = '';
        if (isset($_POST['reply-shoutbox'])) {
            $form['author'] = LOGGED ? User::$nickname : filter($_POST['author-shoutbox'], 100);
            $form['message'] = filter($_POST['message-shoutbox'], Kio::getConfig('message_max', 'shoutbox'));
            $err->setError('author_empty', t('Author field is required.'))->condition(!$form['author']);
            $err->setError('author_exists', t('Entered nickname is registered.'))->condition(!LOGGED && is_registered($form['author']));
            $err->setError('message_empty', t('Message field is required.'))->condition(!$form['message']);
            // No errors
            if ($err->noErrors()) {
                $sql->exec('
					INSERT INTO ' . DB_PREFIX . 'shoutbox (added, author, message, author_id, author_ip)
					VALUES (
						' . TIMESTAMP . ',
						"' . $form['author'] . '",
						"' . cut($form['message'], Kio::getConfig('message_max', 'shoutbox')) . '",
						' . UID . ',
						"' . IP . '")');
                $sql->clearCache('shoutbox');
                $note->success(t('Entry was added successfully.'));
                redirect(HREF . PATH . '#shoutbox');
            } else {
                $note->error($err->toArray());
            }
        }
        // If cache for shoutbox doesn't exists
        if (!($entries = $sql->getCache('shoutbox'))) {
            $query = $sql->query('
				SELECT u.nickname, u.group_id, s.added, s.author, s.author_id, s.message
				FROM ' . DB_PREFIX . 'shoutbox s
				LEFT JOIN ' . DB_PREFIX . 'users u ON u.id = s.author_id
				ORDER BY s.id DESC
				LIMIT ' . Kio::getConfig('limit', 'shoutbox'));
            while ($row = $query->fetch()) {
                if ($row['author_id']) {
                    $row['author'] = User::format($row['author_id'], $row['nickname'], $row['group_id']);
                    $row['message'] = parse($row['message'], Kio::getConfig('parser', 'shoutbox'));
                }
                $entries[] = $row;
            }
            $sql->putCacheContent('shoutbox', $entries);
        }
        try {
            $tpl = new PHPTAL('blocks/shoutbox/shoutbox.tpl.html');
            $tpl->entries = $entries;
            $tpl->err = $err->toArray();
            $tpl->form = $form;
            $tpl->note = $note;
            return $tpl->execute();
        } catch (Exception $e) {
            return template_error($e->getMessage());
            //echo Note::error($e->getMessage());
        }
    }
function oui_if_dailymotion($atts, $thing)
{
    global $thisarticle;
    extract(lAtts(array('custom' => null, 'video' => null), $atts));
    $result = $video ? _oui_dailymotion($video) : _oui_dailymotion($thisarticle[strtolower($custom)]);
    return defined('PREF_PLUGIN') ? parse($thing, $result) : parse(EvalElse($thing, $result));
}
function CheckHost($host, $port, $texture)
{

	$fp = fsockopen ($host, $port, $errno, $errstr, 10);

	if(!$fp)
	{
	$DbLink = new DB;
	$DbLink->query("UPDATE ".C_MAP_REGIONS_TBL." set failcounter = failcounter + 1 ".
			"where serverIP = '" . mysql_escape_string($host) . "' AND ".
			"serverPort = '" . mysql_escape_string($port) . "' AND ".
			"regionMapTexture = '".mysql_escape_string($texture) ."'");

	//Setting a "fake" update time so this host will have time
	//to get back online

	$next = time() + (30 * 60); // 30 mins, so we don't get stuck

	$DbLink->query("UPDATE ".C_MAP_REGIONS_TBL." set lastcheck = $next " .
			" where serverIP = '" . mysql_escape_string($host) . "' AND ".
			"serverPort = '" . mysql_escape_string($port) . "' AND ".
			"regionMapTexture = '".mysql_escape_string($texture) ."'");
	}
	else
	{
	$DbLink = new DB;
	$DbLink->query("UPDATE ".C_MAP_REGIONS_TBL." set failcounter = 0 ".
			" where serverIP = '" . mysql_escape_string($host) . "' AND ".
			"serverPort = '" . mysql_escape_string($port) . "' AND ".
			"regionMapTexture = '".mysql_escape_string($texture) ."'");

	parse($host,$port, $texture);
	}
}
 public function up()
 {
     $table = Base::table('pages');
     $table2 = Base::table('posts');
     if ($this->has_table_column($table, 'content')) {
         $sql = 'ALTER TABLE `' . $table . '` ';
         $sql .= 'CHANGE `content` `markdown` TEXT';
         DB::ask($sql);
     }
     if (!$this->has_table_column($table, 'html') && $this->has_table_column($table, 'markdown')) {
         $sql = 'ALTER TABLE `' . $table . '` ';
         $sql .= 'ADD `html` TEXT NOT NULL AFTER `markdown`';
         DB::ask($sql);
         $pages = Page::sort('menu_order', 'desc')->get();
         foreach ($pages as $page) {
             Page::update($page->id, array('html' => parse($page->markdown)));
         }
     }
     if (!$this->has_table_column($table2, 'markdown') && $this->has_table_column($table2, 'html')) {
         $sql = 'ALTER TABLE `' . $table2 . '` ';
         $sql .= 'ADD `markdown` TEXT NOT NULL AFTER `description`';
         DB::ask($sql);
         $migrate_data_sql = 'update `' . $table2 . '` set `markdown` = `html`, `html` = "";';
         DB::ask($migrate_data_sql);
         $posts = Post::sort('created', 'desc')->get();
         foreach ($posts as $post) {
             Post::update($post->id, array('html' => parse($post->markdown)));
         }
     }
 }
function main()
{
    download();
    parse();
    sanitize();
    final_html_generation();
}
示例#12
0
function process()
{
    global $error;
    if (isset($_FILES['file'])) {
        $file_name = $_FILES['file']['name'];
        $file_size = $_FILES['file']['size'];
        $file_tmp = $_FILES['file']['tmp_name'];
        $file_type = $_FILES['file']['type'];
        $file_ext = strtolower(end(explode('.', $_FILES['file']['name'])));
        $file_error = $_FILES['file']['error'];
        $expensions = array("xlsx");
        if ($file_error == 4) {
            $error = "Please upload file";
        } else {
            if ($file_size > 2097152) {
                $error = 'File size must be excately 2 MB';
            } else {
                if (in_array($file_ext, $expensions) === false) {
                    $error = "extension not allowed, please choose xlsx file.";
                } else {
                    move_uploaded_file($file_tmp, "files/" . $file_name);
                    parse("files/" . $file_name);
                    echo 'Success!!!';
                    return;
                }
            }
        }
    }
    include 'index.php';
}
示例#13
0
 /**
  * Conditional for yield.
  *
  * @param  array  $atts
  * @param  string $thing
  * @return string
  */
 public static function renderIfYield($atts, $thing)
 {
     global $yield;
     extract(lAtts(array('value' => null), $atts));
     $inner = end($yield);
     return parse(EvalElse($thing, $inner !== null && ($value === null || (string) $inner === (string) $value)));
 }
示例#14
0
function func_cp($argv, $fd)
{
    $argv = parse($argv);
    if (!file_exists($argv[1][1])) {
        echo "cp: {$argv[1][1]} No such file or directory\n";
    } else {
        if (is_dir($argv[1][1])) {
            echo "cp: {$argv[1][1]}: Is a directory\n";
        } else {
            if (!is_readable($argv[1][1])) {
                echo "cp: {$argv[1][1]}: Permission denied\n";
            } else {
                if (($file = fopen($argv[1][1], "r")) === FALSE) {
                    echo "cp: {$argv[1][1]}: Cannot open file\n";
                } else {
                    if (!file_exists($argv[1][2])) {
                        echo "cp: {$argv[1][2]} No such file or directory\n";
                    } else {
                        if (!is_dir($argv[1][2]) && file_exists($argv[2])) {
                            echo "cp: {$argv[1][2]}: Not a directory\n";
                        } else {
                            if (!opendir($argv[1][2])) {
                                echo "cp: {$argv[1][2]}: Permission denied\n";
                            } else {
                                mycp($file, $argv);
                            }
                        }
                    }
                }
            }
        }
    }
}
function ckr_if_image_count($atts, $thing)
{
    // Extract attributes from tag
    extract(lAtts(array('category' => false, 'min' => false, 'max' => false, 'equal' => false, 'not' => false), $atts));
    // Count the images in specified category if given or globally
    $count = $category ? intval(ckr_image_count(array('category' => $category))) : intval(ckr_image_count());
    // Instead of almost unreadable if-else syntax, we use this clever switch-true/case-if counstruct
    switch (true) {
        case $min && !$max && !$equal && !$not:
            // Is greater than min value
            return parse(EvalElse($thing, $count >= intval($min) ? true : false));
            break;
        case $max && !$min && !$equal && !$not:
            // Is lesser than max value
            return parse(EvalElse($thing, $count <= intval($max) ? true : false));
            break;
        case $equal && !$min && !$max && !$not:
            // Is equal
            return parse(EvalElse($thing, $count == intval($equal) ? true : false));
            break;
        case $not && !$min && !$max && !$equal:
            // Is not equal
            return parse(EvalElse($thing, $count != intval($not) ? true : false));
            break;
        case $min && $max && !$equal && !$not:
            // Between min and max
            return parse(EvalElse($thing, $count >= intval($min) && $count <= intval($max) ? true : false));
            break;
        default:
            // Anything else will output an error message
            return '<!-- ckr_if_image_count: Wrong attribute count or combination. -->';
    }
}
function rss_article_edit($atts, $thing = "")
{
    global $thisarticle, $rss_ae_cookie, $prefs;
    extract(lAtts(array('hidelive' => '', 'prefix' => '', 'suffix' => ''), $atts));
    $hidelive = !empty($hidelive) && 'live' === $prefs['production_status'];
    return isset($_COOKIE[$rss_ae_cookie]) && !$hidelive ? $prefix . '<a href="' . hu . 'textpattern/index.php?event=article&amp;step=edit&amp;ID=' . $thisarticle['thisid'] . '">' . parse($thing) . '</a>' . $suffix : '';
}
示例#17
0
文件: admin.php 项目: philum/cms
function clean_code($d)
{
    if (strpos($d, '<') !== false) {
        $d = parse($d);
    }
    return stripslashes_b($d);
}
function add_alert_news($id_user, $id_news, $texte, $motif)
{
    inc_lib('bbcode/parse');
    $texte = Nw::$DB->real_escape_string(parse(htmlspecialchars(trim($texte))));
    Nw::$DB->query("INSERT INTO " . Nw::$prefix_table . "news_alerts(a_id_news, a_auteur,\n        a_ip, a_date, a_texte, a_motif)\n        VALUES(" . intval($id_news) . ", " . intval($id_user) . ", " . get_ip() . ", NOW(), \n        '" . $texte . "', " . intval($motif) . ")") or Nw::$DB->trigger(__LINE__, __FILE__);
    return Nw::$DB->insert_id;
}
示例#19
0
文件: TK_Dao.php 项目: ezeed/CPI
 public function getTKPendientes($FUPE_NU_NRO_DOC, $FUPE_FE_ESTADO_DESDE, $FUPE_FE_ESTADO_HASTA, $FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO, $FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)
 {
     $query = "SELECT \"ID\", \"Fecha Carga\", \"Canal\", \"Nro. Documento\", \"Producto\", \"Sucursal\", \"Nro. Solicitud\",\n\t\t\"Fecha Ultimo Estado\", \"Ultimo Estado\", \"Fecha de Rechazo\", \"Tipo de Rechazo\", \"Motivos de Rechazo\", \"Responsable\"\n\t\tFROM (SELECT FUPE_NU_ID \"ID\", TO_CHAR (FUPE_FE_ESTADO_1, 'DD/MM/YYYY') \"Fecha Carga\", FUPE_CD_CANAL \"Canal\", FUPE_NU_NRO_DOC \"Nro. Documento\",\n\t\tFUPE_CD_PRODUCTO \"Producto\", FUPE_CD_COD_SUCURSAL \"Sucursal\", FUPE_NU_NRO_SOLICITUD \"Nro. Solicitud\" CASE WHEN FUPE_CD_ESTADO_13 IS NULL\n\t\tTHEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN TO_CHAR (FUPE_FE_ESTADO_1, 'DD/MM/YYYY')\n\t\tELSE TO_CHAR (FUPE_FE_ESTADO_RCH_SCORING, 'DD/MM/YYYY') END ELSE TO_CHAR (FUPE_FE_ESTADO_RNG_SCORING, 'DD/MM/YYYY') END ELSE\n\t\tTO_CHAR (FUPE_FE_ESTADO_13, 'DD/MM/YYYY') END \"Fecha Ultimo Estado\", CASE WHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL\n\t\tTHEN CASE WHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN FUPE_CD_ESTADO_1 ELSE 'RECHAZO DE VERIFICACION DE VEAL' END ELSE FUPE_CD_ESTADO_RNG_SCORING\n\t\tEND ELSE FUPE_CD_ESTADO_13 END \"Ultimo Estado\", CASE WHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE\n\t\tWHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN NULL ELSE TO_CHAR (FUPE_FE_ESTADO_RCH_SCORING,'DD/MM/YYYY') END ELSE NULL END ELSE NULL\n\t\tEND \"Fecha de Rechazo\", CASE WHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE\n\t\tWHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN NULL ELSE FUPE_CD_MOTIVO_RCH_SCORING END ELSE NULL END ELSE NULL END \"Tipo de Rechazo\",\n\t\tCASE WHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN NULL ELSE\n\t\tFUPE_CD_ESTADO_RCH_SCORING END ELSE NULL END ELSE NULL END \"Motivos de Rechazo\", FUPE_CD_RESPONSABLE \"Responsable\"\n\t\tFROM CPI.TELEMARKETING WHERE FUPE_CD_ESTADO_REPROCESO IS NULL AND FUPE_CD_ESTADO_13 IS NULL ";
     if (!empty($FUPE_NU_NRO_DOC)) {
         $query .= " AND FUPE_NU_NRO_DOC = '{$FUPE_NU_NRO_DOC}' ";
     }
     if (!empty($FUPE_FE_ESTADO_DESDE) && !empty($FUPE_FE_ESTADO_HASTA)) {
         $query .= " AND FUPE_FE_ESTADO_1 BETWEEN '{$FUPE_FE_ESTADO_DESDE}' AND '{$FUPE_FE_ESTADO_HASTA}'";
     }
     if (!empty($FUPE_FE_ESTADO_DESDE) && empty($FUPE_FE_ESTADO_HASTA)) {
         $query .= " AND FUPE_FE_ESTADO_1 >= '{$FUPE_FE_ESTADO_DESDE}'";
     }
     if (empty($FUPE_FE_ESTADO_DESDE) && !empty($FUPE_FE_ESTADO_HASTA)) {
         $query .= " AND FUPE_FE_ESTADO_1 <= '{$FUPE_FE_ESTADO_HASTA}'";
     }
     $query .= ") WHERE 1 = 1 ";
     if (!empty($FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO) && !empty($FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)) {
         $query .= " AND \"Fecha Ultimo Estado\" BETWEEN TO_DATE('{$FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO}','DD/MM/YYYY') AND TO_DATE('{$FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO}','DD/MM/YYYY')";
     }
     if (!empty($FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO) && empty($FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)) {
         $query .= " AND \"Fecha Ultimo Estado\" >= TO_DATE('{$FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO}','DD/MM/YYYY')";
     }
     if (empty($FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO) && !empty($FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)) {
         $query .= " AND \"Fecha Ultimo Estado\" <= TO_DATE('{$FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO}','DD/MM/YYYY')";
     }
     return json_encode($this->conection . parse($query));
 }
示例#20
0
function parse_file($to_use, $verbose = false, $very_verbose = false, $i = NULL, $count = NULL)
{
    global $tokens, $TEXT, $FILENAME, $OCPORTAL_PATH;
    $FILENAME = $to_use;
    if ($OCPORTAL_PATH != '' && substr($FILENAME, 0, strlen($OCPORTAL_PATH)) == $OCPORTAL_PATH) {
        $FILENAME = substr($FILENAME, strlen($OCPORTAL_PATH));
        if (substr($FILENAME, 0, 1) == DIRECTORY_SEPARATOR) {
            $FILENAME = substr($FILENAME, 1);
        }
        if (substr($FILENAME, 0, 1) == DIRECTORY_SEPARATOR) {
            $FILENAME = substr($FILENAME, 1);
        }
    }
    $TEXT = str_replace(chr(13), '', file_get_contents($to_use));
    if ($verbose) {
        echo '<hr /><p>DOING ' . $to_use . '</p>';
    }
    if ($verbose) {
        echo '<pre>';
    }
    if ($very_verbose) {
        echo '0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999' . "\n";
    }
    if ($very_verbose) {
        echo '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' . "\n";
    }
    if ($very_verbose) {
        echo '<b>Our code...</b>' . "\n";
    }
    if ($very_verbose) {
        echo htmlentities($TEXT);
    }
    if ($verbose) {
        echo "\n\n" . '<b>Starting lexing...</b>' . "\n";
    }
    $tokens = lex();
    if ($very_verbose) {
        print_r($tokens);
    }
    if ($very_verbose) {
        echo count($tokens) . ' tokens';
    }
    if ($verbose) {
        echo "\n\n" . '<b>Starting parsing...</b>' . "\n";
    }
    $structure = parse();
    if ($very_verbose) {
        print_r($structure);
    }
    if ($verbose) {
        echo '</pre>';
    }
    echo 'DONE ' . $FILENAME;
    if (!is_null($i)) {
        echo ' - ' . $i . ' of ' . $count;
    }
    echo cnl();
    return $structure;
}
示例#21
0
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */
function smarty_function_parse($params, &$smarty)
{
    $text = isset($params['text']) ? $params['text'] : false;
    if ($text !== false) {
        unset($params['text']);
        return parse($text, $params);
    }
}
示例#22
0
function pickRandomActivity($activities, $size)
{
    $picked_events = pickRandom($activities, $size);
    for ($i = 0; $i < sizeof($picked_events); $i++) {
        $picked_events[$i] = parse($picked_events[$i]);
    }
    return $picked_events;
}
示例#23
0
 function get_catetree_arr()
 {
     if (S('S_CATETREE2') == "") {
         $result = $this->query('select a.*,b.name as type_name,c.name as brand_name from __TABLE__ a left join ' . C('DB_PREFIX') . 'type_cate b on a.type_id=b.id left join ' . C('DB_PREFIX') . 'brand c on a.brandid=c.id order by sort desc');
         $arr = parse($result);
         S('S_CATETREE2', $arr);
     }
     return S('S_CATETREE2');
 }
示例#24
0
/**
 * Evaluate counting results.
 *
 * @param array $atts
 * @property string $atts['eval'] Valid PHP comparison operator.
 * @property string $atts['table'] MySQL table name.
 * @property string $atts['where'] MySQL WHERE clause.
 */
function jmd_if_count($atts, $thing)
{
    extract(lAtts(array('eval' => '', 'table' => '', 'where' => ''), $atts));
    global $jmd_count_value;
    $jmd_count_value = jmd_count(array('table' => $table, 'where' => $where));
    $condition = eval("return({$jmd_count_value} {$eval});");
    $out = EvalElse($thing, $condition);
    return parse($out);
}
示例#25
0
function get_litecoin($address)
{
    $return = array();
    $data = get_request('http://explorer.litecoin.net/address/' . $address);
    if (!empty($data) && strstr($data, 'Transactions in: ') && strstr($data, 'Received: ')) {
        $return += array('count' => (int) parse($data, 'Transactions in: ', '<br />'), 'amount' => (double) parse($data, 'Received: ', '<br />'));
        return $return;
    }
}
示例#26
0
function cycle($line)
{
    $numbers = remove_non_loop(parse($line));
    for ($i = 1; $i < count($numbers); $i++) {
        if ($numbers[0] == $numbers[$i]) {
            return implode(' ', array_slice($numbers, 0, $i));
        }
    }
    return '';
}
示例#27
0
function edit_article($id, $resource_name, $link, $num, $lang, $contenu, $date_pub)
{
    inc_lib('bbcode/parse');
    $contenu = Nw::$DB->real_escape_string(parse(htmlspecialchars(trim($contenu))));
    $resource_name = Nw::$DB->real_escape_string(htmlspecialchars(trim($resource_name)));
    $link = Nw::$DB->real_escape_string(htmlspecialchars(trim($link)));
    $lang = Nw::$DB->real_escape_string(htmlspecialchars(trim($lang)));
    $num = !empty($num) ? intval($num) : 'NULL';
    Nw::$DB->query("UPDATE " . Nw::$prefix_table . "press\n        SET p_ressource_name = '" . $resource_name . "',  p_link = '" . $link . "', p_num = " . intval($num) . ",\n        p_lang = '" . $lang . "', p_description = '" . $contenu . "', p_date = STR_TO_DATE('" . $date_pub . "', '%d/%m/%Y')\n        WHERE p_id = " . intval($id)) or Nw::$DB->trigger(__LINE__, __FILE__);
}
function add_msg_list_live($id_live, $message)
{
    inc_lib('bbcode/parse');
    $contenu = Nw::$DB->real_escape_string(parse(htmlspecialchars(trim($message))));
    Nw::$DB->query('INSERT INTO ' . Nw::$prefix_table . 'w_live_posts (post_id_membre,
        post_id_live, post_date, post_contenu, post_ip) VALUES(' . intval(Nw::$dn_mbr['u_id']) . ', 
        ' . intval($id_live) . ', NOW(), \'' . $contenu . '\', \'' . get_ip() . '\')') or Nw::$DB->trigger(__LINE__, __FILE__);
    $id_new_post = Nw::$DB->insert_id;
    return $id_new_post;
}
示例#29
0
function add_article($id_admin, $resource_name, $link, $num, $lang, $contenu, $date_pub)
{
    inc_lib('bbcode/parse');
    $contenu = Nw::$DB->real_escape_string(parse(htmlspecialchars(trim($contenu))));
    $resource_name = Nw::$DB->real_escape_string(htmlspecialchars(trim($resource_name)));
    $link = Nw::$DB->real_escape_string(htmlspecialchars(trim($link)));
    $lang = Nw::$DB->real_escape_string(htmlspecialchars(trim($lang)));
    $num = !empty($num) ? intval($num) : 'NULL';
    Nw::$DB->query("INSERT INTO " . Nw::$prefix_table . "press(p_id_admin, p_ressource_name,\n    p_link, p_num, p_lang, p_description, p_date)\n    VALUES(" . intval($id_admin) . ", '" . $resource_name . "',  '" . $link . "', " . $num . ",\n    '" . $lang . "', '" . $contenu . "', " . (!empty($date_pub) ? "STR_TO_DATE('" . $date_pub . "', '%d/%m/%Y')" : 'DATE(NOW())') . ")") or Nw::$DB->trigger(__LINE__, __FILE__);
}
示例#30
0
 function process($filename)
 {
     global $modx, $modx_version;
     $this->dbVersion = 3.23;
     // assume version 3.23
     if (function_exists("mysql_get_server_info")) {
         $ver = mysql_get_server_info();
         $this->dbVersion = (double) $ver;
         // Typecasting (float) instead of floatval() [PHP < 4.2]
     }
     // check to make sure file exists
     $path = "{$this->base_path}install/sql/{$filename}";
     if (!is_file($path)) {
         $this->mysqlErrors[] = array("error" => "File '{$path}' not found");
         $this->installFailed = true;
         return false;
     }
     $idata = file_get_contents($path);
     $idata = str_replace("\r", '', $idata);
     if (version_compare($this->dbVersion, '4.1.0', '>=')) {
         $char_collate = "DEFAULT CHARSET={$this->connection_charset} COLLATE {$this->connection_collation}";
         $idata = str_replace('ENGINE=MyISAM', "ENGINE=MyISAM {$char_collate}", $idata);
     }
     // replace {} tags
     $ph = array();
     $ph['PREFIX'] = $this->prefix;
     $ph['ADMINNAME'] = $this->adminname;
     $ph['ADMINFULLNAME'] = substr($this->adminemail, 0, strpos($this->adminemail, '@'));
     $ph['ADMINEMAIL'] = $this->adminemail;
     $ph['ADMINPASS'] = genHash($this->adminpass, '1');
     $ph['MANAGERLANGUAGE'] = $this->managerlanguage;
     $ph['DATE_NOW'] = time();
     $idata = parse($idata, $ph, '{', '}');
     $sql_array = preg_split('@;[ \\t]*\\n@', $idata);
     $num = 0;
     foreach ($sql_array as $sql_entry) {
         $sql_do = trim($sql_entry, "\r\n; ");
         $num++;
         if ($sql_do) {
             mysql_query($sql_do);
         }
         if (mysql_error()) {
             // Ignore duplicate and drop errors - Raymond
             if ($this->ignoreDuplicateErrors) {
                 if (mysql_errno() == 1060 || mysql_errno() == 1061 || mysql_errno() == 1091) {
                     continue;
                 }
             }
             // End Ignore duplicate
             $this->mysqlErrors[] = array("error" => mysql_error(), "sql" => $sql_do);
             $this->installFailed = true;
         }
     }
 }