当前位置: 首页>>代码示例>>PHP>>正文


PHP loadData函数代码示例

本文整理汇总了PHP中loadData函数的典型用法代码示例。如果您正苦于以下问题:PHP loadData函数的具体用法?PHP loadData怎么用?PHP loadData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了loadData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _loadHeaders

 /**
  * Loads metadata from the ESRI shape file header
  *
  * @return void
  * @see ShapeFile::_loadHeaders()
  */
 public function _loadHeaders()
 {
     ImportShp::readFromBuffer(24);
     $this->fileLength = loadData("N", ImportShp::readFromBuffer(4));
     ImportShp::readFromBuffer(4);
     $this->shapeType = loadData("V", ImportShp::readFromBuffer(4));
     $this->boundingBox = array();
     $this->boundingBox["xmin"] = loadData("d", ImportShp::readFromBuffer(8));
     $this->boundingBox["ymin"] = loadData("d", ImportShp::readFromBuffer(8));
     $this->boundingBox["xmax"] = loadData("d", ImportShp::readFromBuffer(8));
     $this->boundingBox["ymax"] = loadData("d", ImportShp::readFromBuffer(8));
     if ($this->_isDbaseLoaded() && $this->_openDBFFile()) {
         $this->DBFHeader = $this->_loadDBFHeader();
     }
 }
开发者ID:itgsod-philip-skalander,项目名称:phpmyadmin,代码行数:21,代码来源:ShapeFile.php

示例2: manage

function manage()
{
    $layout = explode('/', $_GET['page'])[1];
    $Data = loadData($layout);
    $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'show';
    switch ($action) {
        case 'show':
            show($Data, $layout);
            break;
        case 'set':
            $Data->set($_POST[$layout]);
            show($Data, $layout, ['result' => 'success']);
            break;
    }
}
开发者ID:Qclanton,项目名称:Tonelp,代码行数:15,代码来源:tone.php

示例3: loadData

function loadData()
{
    global $offset;
    $jsonString = getData("http://api.nytimes.com/svc/news/v2/all/last24hours.json?api-key=6a30bd922857352952ccfd11c2c6b81f:6:59193871&offset=" . $offset);
    $newsObj = json_decode($jsonString);
    echo "status: " . $newsObj->status;
    if ($newsObj->status == "OK") {
        echo "<br><br><br><br>";
        for ($i = 0; $i < count($newsObj->results); $i++) {
            checkNewsItem($newsObj->results[$i]);
        }
        // keep going till we get an error //
        $offset += 20;
        loadData();
    }
}
开发者ID:bruzed,项目名称:tweetcatcha,代码行数:16,代码来源:newswireParser.php

示例4: start

function start()
{
    if (!empty($_POST['nom'])) {
        addUser();
        $tableauPeople = getPeople();
        require '../views/list.php';
    } elseif (!isset($_GET['id'])) {
        // charge la page list
        $tableauPeople = getPeople();
        require '../views/list.php';
    } else {
        // avec l'id charge la page show
        $data = loadData();
        require '../views/show.php';
    }
}
开发者ID:medanisL,项目名称:ExoSimplon,代码行数:16,代码来源:functions.php

示例5: loadData

$username;
$format;
$purpose;
$types;
$types_avoid;
$page;
$user_ident;
// The ident of the reader, used for validation reasons.
$reader_ident;
// Create variables used to build html
$from = 0;
$page = 0;
$results;
$resultcount;
// Load data from the GET variables & return.
loadData(&$readerhash, &$user_ident, &$username, &$format, &$purpose, &$types, &$types_avoid, &$page);
$page_owner = $user_ident;
// Run validation check.  if fail, -1 is returned.
if ($readerhash != '') {
    $reader_ident = folio_decodehash($readerhash);
    if ($reader_ident == -1) {
        error("Error, unable to validate your {$readerhash} value. Please log in and make sure you have the correct value.");
    }
} elseif (isloggedin()) {
    $reader_ident = $_SESSION['userid'];
} else {
    $reader_ident = -1;
}
// Build where condition
$where = buildWhere($purpose, $reader_ident, $user_ident, $types, $types_avoid);
// Get Data
开发者ID:pzingg,项目名称:saugus_elgg,代码行数:31,代码来源:feeds.php

示例6: _loadPolyLineRecord

 function _loadPolyLineRecord()
 {
     $this->SHPData = array();
     $this->SHPData["xmin"] = loadData("d", fread($this->SHPFile, 8));
     $this->SHPData["ymin"] = loadData("d", fread($this->SHPFile, 8));
     $this->SHPData["xmax"] = loadData("d", fread($this->SHPFile, 8));
     $this->SHPData["ymax"] = loadData("d", fread($this->SHPFile, 8));
     $this->SHPData["numparts"] = loadData("V", fread($this->SHPFile, 4));
     $this->SHPData["numpoints"] = loadData("V", fread($this->SHPFile, 4));
     for ($i = 0; $i < $this->SHPData["numparts"]; $i++) {
         $this->SHPData["parts"][$i] = loadData("V", fread($this->SHPFile, 4));
     }
     $firstIndex = ftell($this->SHPFile);
     $readPoints = 0;
     reset($this->SHPData["parts"]);
     while (list($partIndex, $partData) = each($this->SHPData["parts"])) {
         if (!isset($this->SHPData["parts"][$partIndex]["points"]) || !is_array($this->SHPData["parts"][$partIndex]["points"])) {
             $this->SHPData["parts"][$partIndex] = array();
             $this->SHPData["parts"][$partIndex]["points"] = array();
         }
         while (!in_array($readPoints, $this->SHPData["parts"]) && $readPoints < $this->SHPData["numpoints"] && !feof($this->SHPFile)) {
             $this->SHPData["parts"][$partIndex]["points"][] = $this->_loadPoint();
             $readPoints++;
         }
     }
     fseek($this->SHPFile, $firstIndex + $readPoints * 16);
 }
开发者ID:skduncan,项目名称:pizza-order,代码行数:27,代码来源:ShapeFile.lib.php

示例7: writeData

            print $mz . "\t\t" . $int . "\n";
        }
    }
    writeData($deIsoMzInt, $precursor, $out_file, $min_count);
} elseif (is_dir($filename)) {
    // print "DETECTED DTA DIRECTORY $filename\n";
    $files = array();
    foreach (glob($filename . "/*.dta") as $file) {
        $files[] = $file;
    }
    print count($files) . " files detected\n";
    foreach ($files as $curr) {
        $path_dir = pathinfo($curr);
        // print $curr." ".$path_dir['extension']."\n";
        if (is_readable($curr) && $path_dir['extension'] == 'dta') {
            list($inMzInt, $precursor, $charge) = loadData($curr);
            if ($major_debug) {
                print "Started with: \n";
                print $precursor . "\t" . $charge . "\n";
                foreach ($inMzInt as $mz => $int) {
                    print $mz . "\t\t" . $int . "\n";
                }
            }
            $deIsoMzInt = deisotope($inMzInt, $precursor, $charge);
            if ($major_debug) {
                print "Ended with: \n";
                print $precursor . "\t" . $charge . "\n";
                print "\n";
                foreach ($deIsoMzInt as $mz => $int) {
                    print $mz . "\t\t" . $int . "\n";
                }
开发者ID:adevabhaktuni,项目名称:LADS,代码行数:31,代码来源:deisotoper_mzxml_conversion.php

示例8: User_dao

$following_dao->countCommonFollowing(); //menghitung masing-masing common_friends dari following dan menyimpannya ke tabel following
$following_dao->countCommonFollower();  //menghitung masing-masing common_follower dari following dan menyimpannya ke tabel following
$following_dao->countSimilarity(); 
 */
$user_dao = new User_dao();
$user = $user_dao->getAll();
//mendapatkan data user
$following_dao = new Following_dao();
$datanya = $following_dao->getId();
//mendapatkan data id following
//var_dump($datanya);
// $column1 = "common_followers_count";
// $column2 = "common_friends_count";
$column1 = "similarity_followers";
$column2 = "similarity_friends";
$data = loadData($column1, $column2);
//mendapatkan data similarity dari tabel following
//var_dump($data);
//$data = array(array(0,0),array(0,2), array(2,0), array(2,2), array(5,0), array(5,2), array(7,0), array(7,2));
//$datanya = array("a","b","c","d","e","f","g","h");
$k = $_POST['k'];
//mendapatkan jumlah cluster yang telah diinput
//$k=2;
$results = kmeans($data, $k);
//melakukan clustering menggunakan k-means dan menghasilkan centroid dan cluster
//$result berupa array, terdiri dari 2 array: array pertama data centroid dan array kedua data cluster
//$jitter = addJitter($data);
// var_dump($data);
// echo "<br />";
// echo "<br />";
//var_dump($results);
开发者ID:iputipoet,项目名称:mytwit-clustering,代码行数:31,代码来源:kluster.php

示例9: _loadPolyLineRecord

 /**
  * Loads data from a polyline record
  *
  * @return void
  * @see ShapeRecord::_loadPolyLineRecord()
  */
 public function _loadPolyLineRecord()
 {
     $this->SHPData = array();
     $this->SHPData["xmin"] = loadData("d", ImportShp::readFromBuffer(8));
     $this->SHPData["ymin"] = loadData("d", ImportShp::readFromBuffer(8));
     $this->SHPData["xmax"] = loadData("d", ImportShp::readFromBuffer(8));
     $this->SHPData["ymax"] = loadData("d", ImportShp::readFromBuffer(8));
     $this->SHPData["numparts"] = loadData("V", ImportShp::readFromBuffer(4));
     $this->SHPData["numpoints"] = loadData("V", ImportShp::readFromBuffer(4));
     for ($i = 0; $i < $this->SHPData["numparts"]; $i++) {
         $this->SHPData["parts"][$i] = loadData("V", ImportShp::readFromBuffer(4));
     }
     $readPoints = 0;
     reset($this->SHPData["parts"]);
     while (list($partIndex, ) = each($this->SHPData["parts"])) {
         if (!isset($this->SHPData["parts"][$partIndex]["points"]) || !is_array($this->SHPData["parts"][$partIndex]["points"])) {
             $this->SHPData["parts"][$partIndex] = array();
             $this->SHPData["parts"][$partIndex]["points"] = array();
         }
         while (!in_array($readPoints, $this->SHPData["parts"]) && $readPoints < $this->SHPData["numpoints"]) {
             $this->SHPData["parts"][$partIndex]["points"][] = $this->_loadPoint();
             $readPoints++;
         }
     }
 }
开发者ID:pjiahao,项目名称:phpmyadmin,代码行数:31,代码来源:ShapeRecord.php

示例10: listOnlinePlayers

function listOnlinePlayers()
{
    global $ffa_modes;
    global $clientsBlue;
    global $clientsRed;
    global $clientsSpec;
    global $team1;
    global $team2;
    global $spectators;
    global $onlineplayers_bgcolor;
    global $gametype_short;
    global $geoip_path;
    if (!isset($pll_noteams)) {
        $pll_noteams = 0;
    }
    loadData();
    echo "\n    <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">\n    <tr class=\"serverstatus\"><td align=\"center\" class=\"onlineplayers\">Online Players";
    echo " (" . (count($clientsBlue) + count($clientsRed) + count($clientsSpec)) . " Players)";
    echo "\n    </td></tr><tr class=\"serverstatus\"><td class=\"serverstatus\">\n    <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">\n    <tr class=\"serverstatus\">\n    <td class=\"playerstitle_exp\" align=\"center\" width=\"\">Lp.</td>\n    <td class=\"playerstitle_exp\" align=\"center\" width=\"\">Nick</td>\n    <td class=\"playerstitle_exp\" align=\"center\">Score</td>";
    if (file_exists($geoip_path . "GeoIP.dat")) {
        echo "<td class=\"playerstitle_exp\" align=\"center\">Cntry</td>";
    }
    echo "    <td class=\"playerstitle_exp\" align=\"center\">Level</td>\n    <td class=\"playerstitle_exp\" align=\"center\">Con</td>\n    </tr>";
    if (in_array($gametype_short, $ffa_modes) || $pll_noteams != 0) {
        echo "<tr class=\"serverstatus\"><td class=\"teams\" colspan=6 align=\"center\" class=\"status-spectators\">Players (" . count($clientsSpec) . ") </td></tr>";
        addClientsNew($clientsSpec, $onlineplayers_bgcolor);
    } else {
        echo "<tr class=\"serverstatus\"><td class=\"teams\" colspan=6 align=\"center\" class=\"status-blueteam\">{$team2} (" . count($clientsBlue) . ") </td></tr>";
        addClientsNew($clientsBlue, $onlineplayers_bgcolor);
        echo "<tr class=\"serverstatus\"><td class=\"teams\" colspan=6 align=\"center\" class=\"status-redteam\">{$team1} (" . count($clientsRed) . ") </td></tr>";
        addClientsNew($clientsRed, $onlineplayers_bgcolor);
        echo "<tr class=\"serverstatus\"><td class=\"teams\" colspan=6 align=\"center\" class=\"status-spectators\">{$spectators} (" . count($clientsSpec) . ") </td></tr>";
        addClientsNew($clientsSpec, $onlineplayers_bgcolor);
    }
    echo " \n         </table> \n       </table>";
}
开发者ID:Gammelbob,项目名称:xlrstats-web-v2,代码行数:36,代码来源:serverstatus.php

示例11: welcometext

function welcometext($pop = 0)
{
    global $func;
    global $currentconfig;
    include $currentconfig;
    $link = baselink();
    global $coddb;
    global $separatorline;
    global $t;
    //table names
    global $a_name;
    //award names
    global $a_desc;
    //award descriptions
    global $w;
    global $m;
    global $minkills;
    global $minrounds;
    global $bp_head;
    global $text;
    // test if the status file exists
    $fp = @fopen($b3_status_url, "r");
    if (!@fread($fp, 4096)) {
        return;
    }
    // load data from settings.xml
    loadData();
    $query = "SELECT SUM( kills ) AS kills FROM {$t['players']} WHERE 1";
    $result = $coddb->sql_query($query);
    $row = $coddb->sql_fetchrow($result);
    $kills = $row['kills'];
    $result = null;
    $row = null;
    $query = "SELECT SUM(kills) as kills FROM {$t['playerbody']} WHERE bodypart_id IN {$bp_head}";
    $result = $coddb->sql_query($query);
    $row = $coddb->sql_fetchrow($result);
    $headshots = $row['kills'];
    $result = null;
    $row = null;
    $hpk = 0;
    if ($kills > 0) {
        $hpk = sprintf("%.4f", $headshots / $kills);
    } else {
        $hpk = sprintf("%.4f", 0);
    }
    $query = "SELECT SUM( rounds ) AS rounds FROM {$t['maps']} WHERE 1 ";
    $result = $coddb->sql_query($query);
    $row = $coddb->sql_fetchrow($result);
    $rounds = $row['rounds'];
    $result = null;
    $row = null;
    $query = " SELECT count( client_id ) AS players FROM {$t['players']} WHERE 1";
    $result = $coddb->sql_query($query);
    $row = $coddb->sql_fetchrow($result);
    $players = $row['players'];
    $result = null;
    $row = null;
    //$statusgame = htmlspecialchars( rcon("status"));
    //$currentmap = getCurrentMapName($statusgame);
    global $clientsRed;
    global $clientsBlue;
    global $clientsSpec;
    global $sv_hostname;
    global $sv_privateClients;
    global $gameType;
    global $mapName;
    global $sv_maxclients;
    global $shortversion;
    $result = null;
    $row = null;
    $curnumplayers = count($clientsBlue) + count($clientsRed) + count($clientsSpec);
    $currentmap = $mapName;
    if ($game == 'moh') {
        $currentmap = strtolower($currentmap);
    }
    $maxPlayers = $sv_maxclients - $sv_privateClients;
    // Replace the mapname with a friendly name
    if (isset($m[$currentmap])) {
        $currentmap = $m[$currentmap];
    }
    $today = date('l jS \\of F Y h:i:s A');
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"outertable\">";
    if ($func != "server") {
        echo "<tr><td align=\"center\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $text["welcome"] . "&nbsp;&nbsp;&nbsp;<span class=\"tiny\">({$today})</span></td><td width=\"40px\">" . checklang($pop) . "<a href=\"http://xlrstatshelp.xlr8or.com\" target=\"_blank\"><img src=\"" . pathlink($pop) . "images/ico/help.png\" border=\"0\" align=\"absmiddle\" title=\"Need help on XLRstats?\"></a></td></tr>";
    }
    echo "<tr>\n      <td colspan=\"2\">\n        <table align=\"center\" bgcolor=\"#99aaaa\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"100%\">\n      \t<tr bgcolor=\"#cccccc\" valign=\"bottom\">\n      \t\t<td style=\"padding: 4px;\" width=\"37%\">\n            <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n            <tr><td><font class=\"fontSmall\" size=\"1\"><font color=\"#000000\">&nbsp;" . $text["server"] . "</font></font></td>\n            <td><div align=\"right\">\n    ";
    echo gamelauncher('xfire');
    echo gamelauncher('qtracker');
    echo gamelauncher('gsc');
    echo gamelauncher('hlsw');
    echo "\n      </div></td><tr></table>\n      </td>\n  \t\t<td style=\"padding: 4px;\" width=\"18%\"><font class=\"fontSmall\" size=\"1\"><font color=\"#000000\">&nbsp;" . $text["address"] . "</font></font></td>\n  \t\t<td style=\"padding: 4px;\" align=\"center\" width=\"14%\"><font class=\"fontSmall\" size=\"1\"><font color=\"#000000\">&nbsp;" . $text["map"] . "</font></font></td>\n  \t\t<td style=\"padding: 4px;\" align=\"center\" width=\"10%\"><font class=\"fontSmall\" size=\"1\"><font color=\"#000000\">&nbsp;" . $text["playing"] . "</font></font></td>\n  \t\t<td style=\"padding: 4px;\" align=\"center\" width=\"7%\"><font class=\"fontSmall\" size=\"1\"><font color=\"#000000\">&nbsp;" . $text["rounds"] . "</font></font></td>\n  \t\t<td style=\"padding: 4px;\" align=\"center\" width=\"10%\"><font class=\"fontSmall\" size=\"1\"><font color=\"#000000\">&nbsp;" . $text["players"] . "</font></font></td>\n  \t\t<td style=\"padding: 4px;\" align=\"center\" width=\"6%\"><font class=\"fontSmall\" size=\"1\"><font color=\"#000000\">&nbsp;" . $text["killed"] . "</font></font></td>\n  \t\t<td style=\"padding: 4px;\" align=\"center\" width=\"6%\"><font class=\"fontSmall\" size=\"1\"><font color=\"#000000\">&nbsp;" . $text["headshots"] . "</font></font></td>\n  \t\t<td style=\"padding: 4px;\" align=\"center\" width=\"6%\"><font class=\"fontSmall\" size=\"1\"><font color=\"#000000\">&nbsp;" . $text["hpk"] . "</font></font></td>\n  \t</tr>";
    $flag = NULL;
    if (file_exists($geoip_path . "GeoIP.dat")) {
        $geocountry = $geoip_path . "GeoIP.dat";
        $ip = explode(":", $public_ip);
        $ip = $ip[0];
        $gi = geoip_open($geocountry, GEOIP_STANDARD);
        $countryid = strtolower(geoip_country_code_by_addr($gi, $ip));
        $country = geoip_country_name_by_addr($gi, $ip);
        if (!is_null($countryid) and $countryid != "") {
//.........这里部分代码省略.........
开发者ID:Gammelbob,项目名称:xlrstats-web-v2,代码行数:101,代码来源:func-globallogic.php

示例12: ini_set

    ini_set('display_errors', '1');
    $start = microtime(true);
}
if (isset($_GET['pc'])) {
    $pc = $_GET['pc'];
    $submitted = true;
} else {
    $pc = 5;
    $submitted = false;
}
isset($_GET['pl']) ? $pl = $_GET['pl'] : ($pl = 2);
isset($_GET['sl']) ? $sl = $_GET['sl'] : ($sl = 2);
isset($_GET['ln']) ? $ln = $_GET['ln'] : ($ln = 2);
isset($_GET['lf']) ? $lf = $_GET['lf'] : ($lf = '');
include "localipsum.php";
$array = loadData();
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><?php 
if ($array["title"]) {
    echo $array["title"];
} else {
    echo "Local Ipsum";
}
?>
</title>
<style type="text/css">
开发者ID:nessthehero,项目名称:local-ipsum,代码行数:31,代码来源:index.php

示例13: dispatch

function dispatch()
{
    $cmd = $_POST["cmd"];
    $cid = $_POST["cid"];
    $uid = $_POST["uid"];
    $data = $_POST["data"];
    if (!matchCredentials($uid, $cid)) {
        echo "Not allowed";
        //exit();
    } else {
        switch ($cmd) {
            case "load":
                return loadData($uid, $cid);
                break;
            case "save":
                return saveData($uid, $cid, $data);
                break;
            default:
                echo "42";
                break;
        }
    }
}
开发者ID:GnaritasInc,项目名称:gnlms,代码行数:23,代码来源:scormListener.php

示例14: elseif

            if ($result === True) {
                //echo back the users new value to the UI
                echo $new_value;
            } else {
                echo "Error in update. Please reload";
            }
        }
    } elseif (!empty($_POST['playlist_adding']) && !empty($_POST['song_adding']) && !empty($_POST['artist_adding'])) {
        //get the ID of the song that matches title and artist, no need to strip tags here.
        $playlist = $_POST['playlist_adding'];
        $song_title = $_POST['song_adding'];
        $song_artist = $_POST['artist_adding'];
        $result = $mysqli->query("SELECT Songs.song_id\n\t\t\t\tFROM Songs\n\t\t\t\tINNER JOIN Artists \n\t\t\t\tON Songs.artist_id = Artists.artist_id\n\t\t\t\tWHERE Songs.title = '{$song_title}' AND Artists.artist = '{$song_artist}'\n\t\t\t\t");
        $song_id = "";
        while ($row = $result->fetch_assoc()) {
            $song_id = $row['song_id'];
        }
        //echo($song_id);
        $result = $mysqli->query("SELECT Playlists.playlist_id\n\t\t\t\tFROM Playlists\n\t\t\t\tWHERE Playlists.name = '{$playlist}'\n\t\t\t\t");
        $playlist_id = "";
        while ($row = $result->fetch_assoc()) {
            $playlist_id = $row['playlist_id'];
        }
        $sql = $mysqli->query("INSERT INTO Song_Playlist VALUES(\n\t\t\t\t'{$song_id}', \n\t\t\t\t'{$playlist_id}'\n\t\t\t\t);");
        echo "Song added to playlist";
    } else {
        echo "<p id='error'>There was an error in your request. Please try again.</p>";
    }
}
loadData();
开发者ID:brandongiraldo,项目名称:Sonidus,代码行数:30,代码来源:request.php

示例15: dispatch

function dispatch()
{
    $cmd = $_POST["cmd"];
    $cid = $_POST["cid"];
    $uid = $_POST["uid"];
    $data = $_POST["data"];
    if (!matchCredentials($uid, $cid)) {
        echo "Not allowed";
        //exit();
    } else {
        switch ($cmd) {
            case "load":
                return loadData($uid, $cid);
                break;
            case "save":
                $result = saveData($uid, $cid, $data);
                do_action("gnlms_user_course_data_saved", $uid, $cid, $data);
                return $result;
                break;
            default:
                echo "42";
                break;
        }
    }
}
开发者ID:GnaritasInc,项目名称:gnlms,代码行数:25,代码来源:scormListener.php


注:本文中的loadData函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。