示例#1
0
function browse($dir)
{
    global $filenames;
    if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != ".." && is_file($dir . '/' . $file)) {
                $filenames[] = $dir . '/' . $file;
            } else {
                if ($file != "." && $file != ".." && is_dir($dir . '/' . $file)) {
                    browse($dir . '/' . $file);
                }
            }
        }
        closedir($handle);
    }
    return $filenames;
}
示例#2
0
function browse($path = null)
{
    $xoops_root_path = \XoopsBaseConfig::get('root-path');
    $root = $xoops_root_path . DIRECTORY_SEPARATOR . $path;
    $files = scandir($root);
    foreach ($files as $file) {
        if ($file == '.' or $file == '..') {
            continue;
        }
        if (is_dir($root . DIRECTORY_SEPARATOR . $file)) {
            $path1 = $path . DIRECTORY_SEPARATOR . $file;
            $excludes = array('xoops_lib' . DIRECTORY_SEPARATOR . 'vendor', 'xoops_lib' . DIRECTORY_SEPARATOR . 'smarty', 'xoops_lib' . DIRECTORY_SEPARATOR . 'Xmf', 'xoops_lib' . DIRECTORY_SEPARATOR . 'HTMLPurifier', 'class' . DIRECTORY_SEPARATOR . 'mail' . DIRECTORY_SEPARATOR . 'phpmailer', 'class' . DIRECTORY_SEPARATOR . 'xoopseditor' . DIRECTORY_SEPARATOR . 'tinymce', 'class' . DIRECTORY_SEPARATOR . 'xoopseditor' . DIRECTORY_SEPARATOR . 'tinymce4');
            if (in_array($path1, $excludes)) {
                continue;
            }
            browse($path1);
        } else {
            $index = strrpos($file, '.php');
            if ($index !== false) {
                verify($file, $path);
            }
        }
    }
}
示例#3
0
function browse($json_array)
{
    global $useGsonPrimitives;
    global $depth;
    global $stack;
    global $map;
    $contentType = contentType::NORMAL;
    foreach ($json_array as $key => $val) {
        if (is_numeric($key)) {
            //===>is an item of an array ( within [...])
            if (is_array($val)) {
                //item in array is an {}object
                browse($val);
            } else {
                //item in array is a primitive
                if ($useGsonPrimitives && getTypeName($val) == "int") {
                    $contentType = contentType::PRIMITIVE_INT;
                    $map->add("RealmInt", 'val', "int", null, null);
                } elseif ($useGsonPrimitives && getTypeName($val) == "String") {
                    $contentType = contentType::PRIMITIVE_STRING;
                    $map->add("RealmString", 'val', "String", null, null);
                } else {
                    $map->add(end($stack), 'value', getTypeName($val), null, null);
                }
            }
        } else {
            if (is_array($val)) {
                //===>is a new object ({} or [])
                $depth++;
                array_push($stack, $key);
                $innerType = browse($val);
                array_pop($stack);
                $depth--;
                if ($useGsonPrimitives && $innerType == contentType::PRIMITIVE_INT) {
                    $map->add(end($stack), lcfirst($key), getTypeName($val, "RealmInt"), $key, "RealmInt");
                } else {
                    if ($useGsonPrimitives && $innerType == contentType::PRIMITIVE_STRING) {
                        $map->add(end($stack), lcfirst($key), getTypeName($val, "RealmString"), $key, "RealmString");
                    } else {
                        $map->add(end($stack), lcfirst($key), getTypeName($val, ucfirst($key)), $key, ucfirst($key));
                    }
                }
            } else {
                if (getTypeName($val) != NULL) {
                    $map->add(end($stack), lcfirst($key), getTypeName($val), $key, null);
                }
            }
        }
    }
    return $contentType;
}
    // actually do copying after a user has selected object versions to copy
    $newParentNodeID = $http->postVariable('SelectedNodeID');
    copySubtree($NodeID, $newParentNodeID, $notifications, $allVersions, $keepCreator, $keepTime);
    if ($showNotification) {
        showNotificationAfterCopying($http, $Module, $Result, $notifications, $srcNode);
        return;
    }
    return $Module->redirectToView('view', array('full', $newParentNodeID));
} else {
    if ($Module->isCurrentAction('CopySubtree')) {
        // we get here after a user selects target node to place the source object under
        if ($chooseVersions or $chooseCreator or $chooseTime) {
            // redirect to the page with choice of versions to copy
            chooseOptionsToCopy($Module, $Result, $srcNode, $chooseVersions, $chooseCreator, $chooseTime);
        } else {
            // actually do copying of the pre-configured object version(s)
            $selectedNodeIDArray = eZContentBrowse::result($Module->currentAction());
            $newParentNodeID = $selectedNodeIDArray[0];
            copySubtree($NodeID, $newParentNodeID, $notifications, $allVersions, $keepCreator, $keepTime);
            if ($showNotification) {
                showNotificationAfterCopying($http, $Module, $Result, $notifications, $srcNode);
                return;
            }
            return $Module->redirectToView('view', array('full', $newParentNodeID));
        }
    } else {
        //Browse for target node.
        //We get here when a user clicks "copy" button when viewing some node.
        browse($Module, $srcNode);
    }
}
示例#5
0
function sendAnswereIt($iter)
{
    global $server;
    if (!file_exists("./answers/" . date('d-F') . ".json")) {
        return FALSE;
    }
    $html = browse("{$server}/AnswereIt.php");
    if (strstr($html, "AICompletion.php")) {
        return FALSE;
    }
    $reshtml = str_get_html($html);
    if ($reshtml && is_object($reshtml) && isset($reshtml->nodes)) {
        $p = $reshtml->find('p[class="qutinsubfont"]');
        $div = $reshtml->find('div[class="graphimg"]');
        $grp = $div[0]->first_child()->src;
        $img = $p[0]->first_child()->src;
    }
    $a = time();
    file_put_contents("tmp/{$a}.jpg", browse($img));
    file_put_contents("grp/{$a}.png", browse($grp));
    // graphic processing
    $str1 = processGraphic("grp/{$a}.png");
    // distance processing
    $str2 = processDistance("tmp/{$a}.jpg");
    // proceessing ends
    $str3 = $str1 + $str2;
    $ans = array();
    $ans = json_decode(file_get_contents("./answers/" . date('d-F') . ".json"), true);
    $hayKeys = array_keys($ans);
    $str = findClosest($str3, $hayKeys);
    if (isset($ans["{$str}"])) {
        $answer = $ans["{$str}"];
        $reshtml = str_get_html($html);
        $fieldList = array();
        if ($reshtml && is_object($reshtml) && isset($reshtml->nodes)) {
            $input = $reshtml->find('input');
            $loop = count($input);
            for ($i = 0; $i < $loop; $i++) {
                if (isset($input[$i]->attr["name"])) {
                    $fieldList[$input[$i]->attr["name"]] = $input[$i]->attr["value"];
                    if ($input[$i]->attr["value"] == "Type your answer here") {
                        if (isset($input[$i]->attr["style"])) {
                            if ($input[$i]->attr["style"] == 'border:0 none;') {
                                $fieldList[$input[$i]->attr["name"]] = $answer;
                            }
                        }
                    }
                }
            }
            $fieldList["x"] = rand(10, 50);
            $fieldList["y"] = rand(1, 15);
            $html = browse("{$server}/AnswereIt.php", 1, $fieldList);
            if (strstr($html, "AnswereItGraph.php")) {
                echo "\nANSWEREIT.{$iter} answered {$str} with answer : {$answer}";
                return TRUE;
            }
        }
    } else {
        echo "\nAnswer for this str not found : {$str}  original str : {$str3}";
        error_count();
        return TRUE;
    }
}
示例#6
0
文件: gudang.php 项目: AlvaCorp/maxon
 function browse($offset = 0, $limit = 10, $order_column = 'item_number', $order_type = 'asc')
 {
     $caption = "DAFTAR GUDANG";
     $data['_content'] = browse($this->sql, $caption, 'gudang', $offset, $limit, 'kode', 500, 300);
     $url = '';
     $this->session->set_userdata('_right_menu', $url);
     $this->template->display_browse2($data);
 }
示例#7
0
$chooseVersions = $versionHandling == 'user-defined';
if ($chooseVersions) {
    $allVersions = $Module->actionParameter('VersionChoice') == 1 ? true : false;
} else {
    $allVersions = $versionHandling == 'last-published' ? false : true;
}
if ($Module->isCurrentAction('Copy')) {
    // actually do copying after a user has selected object versions to copy
    $newParentNodeID = $http->postVariable('SelectedNodeID');
    return copyObject($Module, $object, $allVersions, $newParentNodeID);
} else {
    if ($Module->isCurrentAction('CopyNode')) {
        // we get here after a user selects target node to place the source object under
        if ($chooseVersions) {
            // redirect to the page with choice of versions to copy
            $Result = array();
            chooseObjectVersionsToCopy($Module, $Result, $object);
        } else {
            // actually do copying of the pre-configured object version(s)
            $selectedNodeIDArray = eZContentBrowse::result($Module->currentAction());
            $newParentNodeID = $selectedNodeIDArray[0];
            return copyObject($Module, $object, $allVersions, $newParentNodeID);
        }
    } else {
        /*
        Browse for target node.
        We get here when a user clicks "copy" button when viewing some node.
        */
        browse($Module, $object);
    }
}
示例#8
0
文件: beli.php 项目: AlvaCorp/maxon
 function browse($offset = 0, $limit = 50, $order_column = 'purchase_order_number', $order_type = 'asc')
 {
     //var_dump($_GET);
     $header = array('Nomor', 'Tanggal', 'Jumlah', 'Supplier', 'Supplier Name', 'Kota', 'Toko');
     $caption = "DAFTAR FAKTUR PEMBELIAN";
     $data['_content'] = browse("select purchase_order_number, \n\t\t\tpo_date, amount, \n\t\t\ti.supplier_number,c.supplier_name,c.city,i.warehouse_code\n\t\t\tfrom purchase_order i\n\t\t\tleft join suppliers c on c.supplier_number=i.supplier_number\n\t\t\twhere potype='i' and warehouse_code='" . $this->access->cid . "'\n\t\t\t", $caption, 'beli', $offset, $limit, $order_column, $order_type, $header);
     $this->template->display_browse('template_browse', $data);
 }
示例#9
0
            exit("AnswereIt completed!");
        }
        $reshtml = str_get_html($html);
        if ($reshtml && is_object($reshtml) && isset($reshtml->nodes)) {
            $p = $reshtml->find('p[class="qutinsubfont"]');
            $div = $reshtml->find('div[class="graphimg"]');
            $grp = $div[0]->first_child()->src;
            $img = $p[0]->first_child()->src;
        }
        $a = time();
        file_put_contents("tmp/{$a}.jpg", browse($img));
        file_put_contents("grp/{$a}.png", browse($grp));
        file_put_contents("tmp/{$a}.1.jpg", browse("{$server}/unsanswerit.php?iaodifu=1"));
        file_put_contents("tmp/{$a}.2.jpg", browse("{$server}/unsanswerit.php?iaodifu=2"));
        file_put_contents("tmp/{$a}.3.jpg", browse("{$server}/unsanswerit.php?iaodifu=3"));
        file_put_contents("tmp/{$a}.4.jpg", browse("{$server}/unsanswerit.php?iaodifu=4"));
        // graphic processing
        $str1 = processGraphic("grp/{$a}.png");
        // distance processing
        $str2 = processDistance("tmp/{$a}.jpg");
        // proceessing ends
        echo $str = $str1 + $str2;
    }
}
?>

<html>
	<head>
		<title>DESI BOYZ ADVANCE INSERTiON SYSTEM {FREAKARGE 4.0b}</title>
		<script type="text/javascript" src="./includes/keypress/keypress.js"></script>
		<script type="text/javascript">
示例#10
0
function listNotes($dir)
{
    $array = browse($dir, array("simplenotesync.db"));
    $content = "<p>Notes</p>";
    if (count($array) > 0) {
        $content .= "<ul>";
        foreach ($array as $file) {
            $content .= '<li>' . substr($file, 0, -4) . '</li>';
        }
        $content .= "</ul>";
    } else {
        $content = '<p class="notif" >No notes</p>';
    }
    return $content;
}
            $errors[] = "IP address is not valid!";
        }
    }
}
$filter['port'] = 0;
if (isset($_GET['port']) && !empty($_GET['port'])) {
    $port = strip_tags(trim($_GET['port']));
    if (preg_match("/^\\d+\$/", $filter['port'])) {
        if ((int) $_GET['port'] > 0 && (int) $_GET['port'] <= 65535) {
            $filter['port'] = (int) $_GET['port'];
        } else {
            $errors[] = 'Port number (' . (int) $filter['port'] . ') is not valid!';
        }
    } else {
        $filter['port'] = 0;
        $errors[] = 'Port number must be an integer from 1 to 65535';
    }
}
$filter['protocol'] = isset($_GET['protocol']) && !empty($_GET['protocol']) ? DB::escape($_GET['protocol']) : '';
$filter['state'] = isset($_GET['state']) && !empty($_GET['state']) ? DB::escape($_GET['state']) : '';
$filter['service'] = isset($_GET['service']) && !empty($_GET['service']) ? DB::escape($_GET['service']) : '';
$filter['banner'] = isset($_GET['banner']) && !empty($_GET['banner']) ? DB::escape($_GET['banner']) : '';
$filter['exact-match'] = isset($_GET['exact-match']) && (int) $_GET['exact-match'] === 1 ? 1 : 0;
$filter['text'] = isset($_GET['text']) && !empty($_GET['text']) ? DB::escape($_GET['text']) : '';
$filter['page'] = isset($_GET['page']) && (int) $_GET['page'] > 1 ? DB::escape($_GET['page']) : 1;
$filter['rec_per_page'] = isset($_GET['rec_per_page']) && in_array((int) $_GET['rec_per_page'], array(10, 20, 40, 50, 100)) ? (int) $_GET['rec_per_page'] : 10;
if (defined('EXPORT')) {
    $results = browse($filter, true);
} else {
    $results = browse($filter);
}
示例#12
0
            $div1 = $reshtml->find('div[class="kbcqutionimg"]');
            $div = $reshtml->find('div[class="kbcqutionimage"]');
            //	$ans = $reshtml -> find('img[width="200"]');
            $img = $div1[0]->first_child()->src;
            $grp = $div[0]->children(1)->src;
            //	$ans1 = $ans[0] -> src;
            //print_r($ans); exit();
        }
        $a = time();
        file_put_contents("ukbc/tmp/{$a}.jpg", browse($img));
        file_put_contents("ukbc/grp/{$a}.png", browse($grp));
        //	file_put_contents("ukbc/temp/$a.png", browse($ans1));
        file_put_contents("ukbc/tmp/{$a}.1.jpg", browse("{$server}/JWaXCZNAHZ.php?iaodifufewc=1"));
        file_put_contents("ukbc/tmp/{$a}.2.jpg", browse("{$server}/JWaXCZNAHZ.php?iaodifufewc=2"));
        file_put_contents("ukbc/tmp/{$a}.3.jpg", browse("{$server}/JWaXCZNAHZ.php?iaodifufewc=3"));
        file_put_contents("ukbc/tmp/{$a}.4.jpg", browse("{$server}/JWaXCZNAHZ.php?iaodifufewc=4"));
        // graphic processing
        $str1 = processGraphic("ukbc/grp/{$a}.png");
        // distance processing
        $str2 = processDistance("ukbc/tmp/{$a}.jpg");
        // proceessing ends
        echo $str = $str1 + $str2;
    }
}
?>

<html>
	<head>
		<title>DESI BOYZ ADVANCE INSERTiON SYSTEM {FREAKARGE 4.0b}</title>
		<script type="text/javascript" src="./includes/keypress/keypress.js"></script>
		<script type="text/javascript">
示例#13
0
文件: api.php 项目: jinzora/jinzora3
 case "playlist":
     return playlist();
     break;
 case "saveplaylist":
     return savePlaylist();
     break;
 case "deleteplaylist":
     return deletePlaylist();
     break;
 case "curtrack":
     return getCurrentTrack();
     break;
 case "search":
     return search();
 case "browse":
     return browse();
     break;
 case "home":
     return home();
     break;
 case "chart":
     return chart();
     break;
 case "userhistories":
     return userHistories();
     break;
 case "jukebox":
     return jukebox();
     break;
 case "adduser":
     return adduser();
示例#14
0
function list_pcap_files($dir)
{
    $ret = '';
    $dir = rtrim(realpath($dir), '/') . '/';
    $ret .= "PCAPs found - " . $dir . "<br/>\n";
    $tmp = browse($dir, '.pcap');
    $ret .= '<a href="index.php">Browse</a><br/>';
    foreach ($tmp as $f) {
        $ret .= '<a href="index.php?file=' . $f->name . '">' . $f->name . '</a> - ' . conv_bytes($f->size);
        if (been_parsed($dir . $f->name)) {
            $ret .= ' (Done/<a href="index.php?file=' . $f->name . '&force=1">Refresh</a>)';
        }
        $ret .= "<br/>";
    }
    $ret .= "<br/>";
    return $ret;
}
示例#15
0
<?php

include_once '../config/symbini.php';
include_once $serverRoot . '/classes/AgentManager.php';
Header("Content-Type: text/html; charset=" . $charset);
$lang = array_key_exists("lang", $_REQUEST) ? $_REQUEST["lang"] : $defaultLang;
$spDisplay = "Agent Search";
$name = array_key_exists("name", $_REQUEST) ? $_REQUEST["name"] : "";
pageheader($name);
if (strlen($name) > 0) {
    echo searchform($name);
    echo search($name);
} else {
    echo searchform();
    echo browse();
}
footer();
function search($term)
{
    $am = new AgentManager();
    $result = "<div id='loadedWithPage'><table id='innertable'>\n";
    $result .= $am->agentNameSearch($term);
    $result .= "</table></div>\n";
    return $result;
}
function browse()
{
    $am = new AgentManager();
    $result = "<div id='loadedWithPage'>\n";
    $result .= "<h3>Collector and other agent records</h3>";
    $result .= $am->getNameStats();