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


PHP get_data函数代码示例

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


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

示例1: get_user_tokens

/**
 * Get all tokens attached to a user
 *
 * @param int $user_guid The user GUID
 *
 * @return false if none available or array of stdClass objects
 * 		(see users_apisessions schema for available variables in objects)
 * @since 1.7.0
 */
function get_user_tokens($user_guid)
{
    $dbprefix = elgg_get_config('dbprefix');
    $user_guid = (int) $user_guid;
    $tokens = get_data("SELECT * from {$dbprefix}users_apisessions\n\t\twhere user_guid={$user_guid}");
    return $tokens;
}
开发者ID:elgg,项目名称:elgg,代码行数:16,代码来源:tokens.php

示例2: table_settings

 public function table_settings()
 {
     $table = z(t(v('table')));
     $tables = get_table_list(db());
     if (!in_array($table, $tables)) {
         return info_page('<a href="javascript:history.back(1);">table不存在,点击返回</a>');
     }
     $data['fields'] = get_fields_info($table);
     $data['actions'] = array('list' => 'List', 'insert' => 'Insert', 'update' => 'Update', 'remove' => 'Remove');
     $data['table'] = $table;
     $data['my_actions'] = get_data("SELECT * FROM `__meta_code` WHERE `table` = '" . s($table) . "' ORDER BY `id` DESC");
     //print_r( $fields );
     $data['title'] = $data['top_title'] = 'API设置';
     $data['js'][] = 'codemirror.js';
     $data['js'][] = 'util/runmode.js';
     $data['js'][] = 'mode/php/php.js';
     $data['js'][] = 'mode/htmlmixed/htmlmixed.js';
     $data['js'][] = 'mode/css/css.js';
     $data['js'][] = 'mode/javascript/javascript.js';
     $data['js'][] = 'mode/xml/xml.js';
     $data['js'][] = 'mode/clike/clike.js';
     $data['css'][] = 'codemirror.css';
     $data['css'][] = 'theme/night.css';
     render($data);
 }
开发者ID:jfojfo,项目名称:LazyREST,代码行数:25,代码来源:default.class.php

示例3: JKY_return_piece

/**
 *	return Piece from Pieces Return
 * 
 *	$.ajax({ method:'return', table:'Pieces', barcode:9...9, ...};
 *
 * @return	string	''
 */
function JKY_return_piece($the_data)
{
    $db = Zend_Registry::get('db');
    $my_barcode = get_data($the_data, 'barcode');
    $my_inspected_by = get_data($the_data, 'inspected_by');
    $my_weighed_by = get_data($the_data, 'weighed_by');
    $my_remarks = get_data($the_data, 'remarks');
    $my_checkin_weight = get_data($the_data, 'checkin_weight');
    $my_checkin_location = get_data($the_data, 'checkin_location');
    $sql = 'UPDATE Pieces' . '   SET ' . get_updated() . ',           status="Check In"' . ',     inspected_by=  ' . $my_inspected_by . ',       weighed_by=  ' . $my_weighed_by . ',          remarks=\'' . $my_remarks . '\'' . ',   checkin_weight=  ' . $my_checkin_weight . ', checkin_location=\'' . $my_checkin_location . '\'' . ',       checkin_at=\'' . get_time() . '\'' . ' WHERE id =' . $my_barcode;
    log_sql('Pieces', 'update', $sql);
    $db->query($sql);
    insert_changes($db, 'Pieces', $my_barcode);
    $my_order_id = get_table_value('Pieces', 'order_id', $my_barcode);
    $my_set = ', produced_at=\'' . get_time() . '\'' . ', produced_pieces = produced_pieces + 1';
    if ($my_remarks != 'boa') {
        $my_set = ', rejected_pieces = rejected_pieces + 1';
    }
    $my_field_name = $my_remarks == 'boa' ? 'produced_pieces' : 'rejected_pieces';
    $sql = 'UPDATE Orders' . '   SET ' . get_updated() . $my_set . ' WHERE id = ' . $my_order_id;
    log_sql('Orders', 'update', $sql);
    $db->query($sql);
    insert_changes($db, 'Orders', $my_order_id);
    return '';
}
开发者ID:shadobladez,项目名称:erp2,代码行数:32,代码来源:Return.php

示例4: getUrlList

 /**
  * 获取目标链接列表
  *
  * @author boxcore
  * @date   2014-10-23
  * @param  array      $configs    配置条件
  * @param  string     $limit
  * @param  string     $table_name 表名
  * @return array|bool
  */
 public function getUrlList($configs, $limit = 'LIMIT 20 ', $table_name = 'task_url')
 {
     $where = $this->__getWhere($configs);
     $sql = 'SELECT * FROM ' . $table_name . ' ' . $where . 'ORDER BY id ' . $limit;
     $data = get_data($sql);
     return $data;
 }
开发者ID:boxcore,项目名称:xspider,代码行数:17,代码来源:ContentModel.php

示例5: get_files_by_cat

function get_files_by_cat($filecat)
{
    $sql_pre = "SELECT `id` , `filecat`  , `filename`  , `filepath` FROM `yxy_downloadfile` WHERE `filecat` = ?i LIMIT 5 ";
    $array = array($filecat);
    $sql = prepare($sql_pre, $array);
    return get_data($sql);
}
开发者ID:doumaomao,项目名称:Lazy-lawyer,代码行数:7,代码来源:default.function.php

示例6: westorElggMan_cron_handler

function westorElggMan_cron_handler($hook, $entity_type, $returnvalue, $params)
{
    global $CONFIG;
    // old elgg bevore 1.7.0
    global $is_admin;
    $is_admin = true;
    if (function_exists("elgg_set_ignore_access")) {
        // new function for access overwrite
        elgg_set_ignore_access(true);
    }
    $context = westorElggMan_get_context();
    westorElggMan_set_context('westorElggMan');
    $prefix = $CONFIG->dbprefix;
    $sql = "SELECT {$prefix}metadata.entity_guid\nFROM (({$prefix}metadata AS {$prefix}metadata_1 INNER JOIN {$prefix}metastrings AS {$prefix}metastrings_3\nON {$prefix}metadata_1.name_id = {$prefix}metastrings_3.id) INNER JOIN {$prefix}metastrings\nAS {$prefix}metastrings_2 ON {$prefix}metadata_1.value_id = {$prefix}metastrings_2.id) INNER JOIN (({$prefix}metadata INNER JOIN {$prefix}metastrings ON {$prefix}metadata.name_id = {$prefix}metastrings.id) INNER JOIN {$prefix}metastrings AS {$prefix}metastrings_1 ON {$prefix}metadata.value_id = {$prefix}metastrings_1.id) ON {$prefix}metadata_1.entity_guid = {$prefix}metadata.entity_guid\nWHERE ((({$prefix}metastrings.string)='waitForSend') AND (({$prefix}metastrings_1.string)='1')\nAND (({$prefix}metastrings_3.string)='hiddenTo') AND (({$prefix}metastrings_2.string)<>'1'))";
    // and (scheduled is null || scheduled <= now());
    try {
        $result = get_data($sql);
    } catch (Exception $e) {
        westorElggMan_set_context($context);
        throw new Exception($e);
    }
    if (is_array($result)) {
        $elggMan = new class_elggMan();
        $now = date("Y-m-d H:i:s");
        foreach ($result as $row) {
            $message = westorElggMan_get_entity($row->entity_guid);
            if (is_object($message) && $message->getSubtype() == "messages" && ($message->scheduled == null || $message->scheduled <= $now)) {
                $elggMan->sendMsgNow($message);
            }
        }
    }
    westorElggMan_set_context($context);
}
开发者ID:rijojoy,项目名称:MyIceBerg,代码行数:33,代码来源:start.php

示例7: get_entity_statistics

/**
 * Return an array reporting the number of various entities in the system.
 *
 * @param int $owner_guid Optional owner of the statistics
 *
 * @return array
 */
function get_entity_statistics($owner_guid = 0)
{
    global $CONFIG;
    $entity_stats = array();
    $owner_guid = (int) $owner_guid;
    $query = "SELECT distinct e.type,s.subtype,e.subtype as subtype_id\n\t\tfrom {$CONFIG->dbprefix}entities e left\n\t\tjoin {$CONFIG->dbprefix}entity_subtypes s on e.subtype=s.id";
    $owner_query = "";
    if ($owner_guid) {
        $query .= " where owner_guid={$owner_guid}";
        $owner_query = "and owner_guid={$owner_guid} ";
    }
    // Get a list of major types
    $types = get_data($query);
    foreach ($types as $type) {
        // assume there are subtypes for now
        if (!isset($entity_stats[$type->type]) || !is_array($entity_stats[$type->type])) {
            $entity_stats[$type->type] = array();
        }
        $query = "SELECT count(*) as count\n\t\t\tfrom {$CONFIG->dbprefix}entities where type='{$type->type}' {$owner_query}";
        if ($type->subtype) {
            $query .= " and subtype={$type->subtype_id}";
        }
        $subtype_cnt = get_data_row($query);
        if ($type->subtype) {
            $entity_stats[$type->type][$type->subtype] = $subtype_cnt->count;
        } else {
            $entity_stats[$type->type]['__base__'] = $subtype_cnt->count;
        }
    }
    return $entity_stats;
}
开发者ID:nooshin-mirzadeh,项目名称:web_2.0_benchmark,代码行数:38,代码来源:statistics.php

示例8: ucd_list_shortcode

function ucd_list_shortcode()
{
    ob_start();
    get_data();
    html();
    return ob_get_clean();
}
开发者ID:jbeegle,项目名称:Hi-there,代码行数:7,代码来源:ucd_list_form.php

示例9: module_comment_edit

function module_comment_edit()
{
    global $global, $smarty;
    $obj = new comment();
    $obj->set_where('com_id = ' . $global['id']);
    $one = $obj->get_one();
    $one['channel'] = '';
    $one['title'] = '';
    $obj = new channel();
    $list = $obj->get_list();
    for ($i = 0; $i < count($list); $i++) {
        if ($list[$i]['cha_id'] == $one['com_channel_id']) {
            $one['channel'] = $list[$i]['cha_code'];
            $original = $list[$i]['cha_code'];
            if ($list[$i]['cha_original'] != 0) {
                for ($j = 0; $j < count($list); $j++) {
                    if ($list[$i]['cha_original'] == $list[$j]['cha_id']) {
                        $original = $list[$j]['cha_code'];
                    }
                }
            }
            if ($original == 'goods') {
                $table = 'goods';
            } else {
                $table = 'article';
            }
            $one['title'] = get_data($table, $one['com_page_id'], substr($table, 0, 3) . '_title');
        }
    }
    $smarty->assign('comment', $one);
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:31,代码来源:comment_edit.php

示例10: facebook_init

function facebook_init()
{
    require 'src/facebook.php';
    global $facebook;
    $facebook = new Facebook(array('appId' => FB_KEY, 'secret' => FB_SECRET));
    if (!empty($_SESSION) && !empty($_SESSION['fb_code'])) {
        $url = "https://graph.facebook.com/oauth/access_token?";
        $params = array();
        $params[] = 'client_id=' . $facebook->getAppId();
        $params[] = 'redirect_uri=' . 'http://' . HOST . get_url('/facebook/auth/');
        $params[] = 'client_secret=' . $facebook->getApiSecret();
        $params[] = 'code=' . $_SESSION['fb_code'];
        $url .= implode('&', $params);
        $data = explode('&', get_data($url));
        foreach ($data as &$d) {
            $d = explode('=', $d);
            if ($d[0] == 'access_token') {
                $_SESSION['fb_access_token'] = $d[1];
            } elseif ($d[0] == 'expires') {
                $_SESSION['fb_at_expires'] = time() + $d[1];
            }
        }
    }
    if (array_key_exists('fb_access_token', $_SESSION)) {
        if ($_SESSION['fb_at_expires'] > time()) {
            $facebook->setAccessToken($_SESSION['fb_access_token']);
            unset($_SESSION['fb_code']);
        }
    }
}
开发者ID:nodefortytwo,项目名称:engagement,代码行数:30,代码来源:facebook.php

示例11: module_sheet

function module_sheet()
{
    global $global, $smarty;
    $prefix = $global['channel'] . '/mod-sheet';
    if (isset($global['field'])) {
        $prefix = $prefix . '/field-' . $global['field'];
    }
    if (isset($global['key'])) {
        $prefix = $prefix . '/key-' . $global['key'];
    }
    $obj = new article();
    $obj->set_where('art_channel_id = ' . $global['channel_id']);
    if (isset($global['key'])) {
        $obj->set_where($global['field'] . " like '%" . url_decode($global['key']) . "%'");
    }
    $obj->set_page_size(10);
    $obj->set_page_num($global['page']);
    $sheet = $obj->get_sheet();
    for ($i = 0; $i < count($sheet); $i++) {
        $sheet[$i]['cat_name'] = get_data('cat_art', $sheet[$i]['art_cat_id'], 'cat_name');
    }
    set_link($obj->get_page_sum());
    $smarty->assign('article', $sheet);
    $smarty->assign('prefix', $prefix);
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:25,代码来源:sheet.php

示例12: module_article_list

function module_article_list()
{
    global $smarty;
    $obj = new cat_art();
    $obj->set_where('cat_best = 1');
    $best_cat = $obj->get_list();
    $art_list = array();
    if (count($best_cat) > 0) {
        $smarty->assign('show_all_art', 0);
        $list_len = get_varia('index_art_list_len');
        for ($i = 0; $i < count($best_cat); $i++) {
            $cat_id = $best_cat[$i]['cat_id'];
            $best_cat[$i]['channel'] = get_data('channel', $best_cat[$i]['cat_channel_id'], 'cha_code');
            $family = implode(',', get_cat_family('cat_art', $cat_id));
            $obj = new article();
            $obj->set_field('art_id,art_title,art_add_time');
            $obj->set_where("art_cat_id in ({$family})");
            $obj->set_page_size($list_len ? $list_len : 5);
            $list = $obj->get_list();
            for ($j = 0; $j < count($list); $j++) {
                $list[$j]['short_title'] = cut_str($list[$j]['art_title'], 22);
            }
            $art_list[$cat_id] = $list;
            unset($obj);
        }
        $smarty->assign('best_art_cat', $best_cat);
        $smarty->assign('art_list', $art_list);
    } else {
        $smarty->assign('show_all_art', 1);
    }
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:31,代码来源:article_list.php

示例13: backpack_viewer

function backpack_viewer($sid)
{
    globalSchemas(440);
    $profile = json_decode(get_data('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=' . AKey() . '&steamids=' . $sid . '&format=json'), true);
    $profile = $profile['response']['players'][0];
    $bp = '';
    $hours = getHours($sid);
    $backpack = json_decode(get_data('http://api.steampowered.com/IEconItems_440/GetPlayerItems/v0001/?key=' . AKey() . '&SteamID=' . $sid . '&format=json'), true);
    if (isset($backpack) && $backpack['result']['status'] == 1) {
        usort($backpack['result']['items'], "sortInvPos");
        $mplace = '';
        $itemCount = array();
        //misplaced items
        foreach ($backpack['result']['items'] as $key => $item) {
            if ($item['inventory'] == 3221225475) {
                item_prepare($item);
                item_price($item);
                $mplace .= item_image($item);
                $itemCount[$item['defindex']] = 1;
            }
        }
        if ($mplace != '') {
            $bp .= '<div class="bp-mplaced">' . $mplace . '</div><br>';
        }
        $inv_pos = 2147483649;
        $total_items = 0;
        //start normal items
        foreach ($backpack['result']['items'] as $key => $item) {
            if ($item['inventory'] == 3221225475) {
                //end-of-backpack handler, writes out empty slots until we reach the max slots in the backpack.
                while ($backpack['result']['num_backpack_slots'] >= $total_items) {
                    $bp .= '<div><img alt="empty" class="mt" src="img/mt.gif"></div>';
                    $total_items++;
                    $bp .= pg_chk($total_items);
                    // echoes empty backpack slots.
                }
                break;
            }
            while ($item['inventory'] > $inv_pos + 1) {
                $bp .= '<div><img alt="empty" class="mt" src="img/mt.gif"></div>';
                $total_items++;
                $inv_pos++;
                $bp .= pg_chk($total_items);
            }
            item_prepare($item);
            item_price($item);
            $bp .= item_image($item);
            $inv_pos = $item['inventory'];
            $total_items++;
            $bp .= pg_chk($total_items);
            $itemCount[$item['defindex']] = 1;
        }
    } else {
        $bp .= 'problem retrieving backpack.';
    }
    echo '<div class="bp-container w800">', '<div class="bp-head">', '<img src=', $profile['avatarfull'], ' />', '<h1>', htmlspecialchars($profile['personaname']), '</h1>', '<h3>TF2: ', $hours[440], ' / DOTA 2: ', $hours[570], ' / CSGO: ', $hours[730], '</h3>', '</div>', '<div class="bp-mweapons">';
    fav_class_weapons_box($sid, $itemCount);
    echo '</div>', '<div class="bp-info">', '</div>', '<div class="bp-content">', $bp, '</div></div>';
    //end bp container.
}
开发者ID:aaronsnow123,项目名称:OpenEndgame,代码行数:60,代码来源:bp_core.php

示例14: getStations

function getStations()
{
    global $l_stations;
    $l_stations = array();
    $nbCh = 0;
    $url = "http://api.irail.be/stations/";
    $stationsF = get_data($url);
    $sizef = strlen($stationsF);
    $station = "";
    for ($i = 0; $i < $sizef; $i++) {
        if (substr($stationsF, $i, 1) == chr(62) or substr($stationsF, $i, 1) == chr(60)) {
            $nbCh = $nbCh + 1;
            if (strlen($station) > 3) {
                for ($j = 0; $j < strlen($station); $j++) {
                    if (substr($station, $j, 1) == "/") {
                        $station = substr($station, $j + 1);
                    }
                }
                $station = mb_convert_encoding($station, "ISO-8859-1", "auto");
                echo $station . "<br>";
                array_push($l_stations, $station);
            }
            $station = '';
        }
        if ($nbCh % 2 == 0 and $nbCh > 2 and substr($stationsF, $i, 1) != chr(62)) {
            $station = $station . substr($stationsF, $i, 1);
        }
    }
    return $l_stations;
}
开发者ID:OpenDelays,项目名称:script2.0,代码行数:30,代码来源:opendelays_be.php

示例15: module_cat_edit

function module_cat_edit()
{
    global $global, $smarty;
    $list = array();
    $obj = new cat_art();
    $obj->set_where('cat_channel_id = ' . $global['channel_id']);
    $arr = $obj->get_list();
    if (count($arr) > 0) {
        $list = $obj->set_cat_order($arr);
        for ($i = 0; $i < count($list); $i++) {
            $list[$i]['parent_name'] = get_data('cat_art', $list[$i]['cat_parent_id'], 'cat_name');
            $obj->set_where('');
            $obj->set_where('cat_parent_id = ' . $list[$i]['cat_id']);
            if ($obj->get_count() > 0) {
                $list[$i]['exist_child'] = 1;
            } else {
                $list[$i]['exist_child'] = 0;
            }
            $list[$i]['show'] = 1;
        }
    }
    $family = get_cat_family('cat_art', $global['id']);
    for ($i = 0; $i < count($family); $i++) {
        for ($j = 0; $j < count($list); $j++) {
            if ($family[$i] == $list[$j]['cat_id']) {
                $list[$j]['show'] = 0;
            }
        }
    }
    $smarty->assign('cat_list', $list);
    $obj = new cat_art();
    $obj->set_where('cat_id = ' . $global['id']);
    $one = $obj->get_one();
    $smarty->assign('cat', $one);
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:35,代码来源:cat_edit.php


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