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


PHP res函数代码示例

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


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

示例1: define_hubs

function define_hubs()
{
    $_SESSION['mn'] = '';
    $qdu = $_SESSION['qdu'];
    $USE = $_SESSION['USE'];
    $exists = rse('id', $qdu . ' WHERE id=1');
    if (!$exists) {
        $_SESSION['stsys'] = 'no';
        $_SESSION['first'] = 1;
        alert(loged('', '', 'superadmin'));
    }
    $wh = ' WHERE active="1" ';
    //if(!auth(7))else $wh='';
    $req = res('name,hub,id,active', $qdu . $wh . ' ORDER BY nbarts DESC');
    if ($req) {
        while ($r = mysql_fetch_row($req)) {
            // && ($r[3] or auth(6))
            $hub = $r[1] ? $r[1] : $r[0];
            $ret[$r[0]] = $hub;
            $rtb[$r[0]] = $r[2];
        }
    }
    $_SESSION['mn'] = $ret;
    $_SESSION['mnd'] = $rtb;
    if (!$_SESSION['mn'][$USE] && $USE) {
        define_closed_hub($USE);
    }
}
开发者ID:philum,项目名称:cms,代码行数:28,代码来源:boot.php

示例2: make

 public static function make($name, $seed = 0)
 {
     $im = imagecreate(120, 60);
     $bg = imagecolorallocate($im, 240, 240, 240);
     srand($seed && is_numeric($seed) ? $seed : time());
     $text_colors = array();
     for ($i = 0; $i < 4; $i++) {
         $nr[$i] = rand(0, 9);
         $textcolor = imagecolorallocate($im, rand(50, 150), rand(50, 150), rand(50, 150));
         $text_colors[] = $textcolor;
         imagettftext($im, rand(25, 35), rand(-15, 15), $i * 27 + 5, rand(35, 50), $textcolor, $_SERVER['DOCUMENT_ROOT'] . res('assets/font/capcha.ttf'), $nr[$i]);
     }
     for ($i = 0; $i <= 2; $i++) {
         $line_color = $text_colors[mt_rand(0, count($text_colors) - 1)];
         imageline($im, mt_rand(0, 120), 0, mt_rand(0, 120), 60, $line_color);
         imageline($im, 0, mt_rand(0, 60), 120, mt_rand(0, 60), $line_color);
     }
     $codes = implode('', $nr);
     Session::put('capcha_' . $name, $codes);
     ob_start();
     imagepng($im);
     $imagedata = ob_get_contents();
     ob_end_clean();
     return "data:image/png;base64," . base64_encode($imagedata);
 }
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:25,代码来源:SimpleCapcha.php

示例3: raspiSensorGetSensorDataLast

function raspiSensorGetSensorDataLast($mysqli, $sensorID)
{
    if ($result = $mysqli->query("SELECT * FROM sensorData WHERE sensorID='" . res($sensorID) . "' ORDER BY date DESC LIMIT 1")) {
        $row = $result->fetch_assoc();
        $out = floatval($row['dataRefined']);
        $result->free();
    }
    return $out;
}
开发者ID:DevertNet,项目名称:RaspiSensor,代码行数:9,代码来源:raspiSensor.php

示例4: display

 function display()
 {
     global $websiteName;
     $content = $this->parse_legacy($this->content);
     $title = $this->parse_legacy($this->title);
     $header = $this->parse_legacy($this->header);
     $display = trim(str_replace("\n", ' ', '<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css" media="all">@import "/d/s.css";</style>' . $this->style . '<title>' . $title . '</title></head><body><div class="greenpage"></div><div class="fh"><a href="/" id="tl"><i>' . $websiteName . '</i></a></div><div id="content"><h1>' . $header . '</h1>' . $content . res('4.d2')));
     echo $display;
 }
开发者ID:achristensen3,项目名称:fracture-active,代码行数:9,代码来源:active0.3.php

示例5: insert

 public function insert($params)
 {
     if (isset($params['model_id'])) {
         unset($params['model_id']);
     }
     //插入模型
     $res = $this->dbm->single_insert($this->table, $params);
     if (empty($res['error'])) {
         return res(0, $res['autoid']);
     }
     return res(100, $res['error']);
 }
开发者ID:cranefly,项目名称:crane,代码行数:12,代码来源:model.model.php

示例6: update

 public function update($params, $group_id)
 {
     if (isset($params['group_id'])) {
         unset($params['group_id']);
     }
     $where = " group_id='" . $group_id . "'";
     $res = $this->dbm->single_update($this->table, $params, $where);
     if (empty($res['error'])) {
         return res(0);
     }
     return res(100, $res['error']);
 }
开发者ID:cranefly,项目名称:crane,代码行数:12,代码来源:user_group.model.php

示例7: res

 function res($cur_category, $s)
 {
     $children_categories = $cur_category->getChildrenCategories();
     if (!empty($children_categories)) {
         $s .= $s;
         foreach ($children_categories as $k => $v) {
             $all_data = $v->getData();
             $nm = $all_data['name'];
             echo $s . $nm . '<br/>';
             res($v, $s);
         }
     }
 }
开发者ID:ahsanmage,项目名称:vr,代码行数:13,代码来源:Categorytree.php

示例8: update

 public function update($params, $flink_id)
 {
     if (isset($params['flink_id'])) {
         unset($params['flink_id']);
     }
     $where = " flink_id = " . $flink_id;
     $res = $this->dbm->single_update($this->table, $params, $where);
     print_r($res);
     if (empty($res['error'])) {
         return res(0);
     }
     return res(100, $res['error']);
 }
开发者ID:cranefly,项目名称:crane,代码行数:13,代码来源:flink.model.php

示例9: e

function e($content, $pageVersionDirect)
{
    global $websiteName;
    global $cssFile;
    global $serverUrl;
    global $pageClass;
    if ($pageClass == 'w') {
        $tbl = '';
    } else {
        $tbl = '<table border="0" cellpadding="24" width="100%"><tbody><tr><td><br><h1>';
    }
    $univNeedles = array('href="' . $serverUrl, "\t", "\n", "\r", "  ", "  ", "  ", "> <", '@p1@', '@p2@', '@p3@', '@p4@', '@cssFile@', '@websiteName@', '@tbl@', '@l@', '@n@', 'https://futuramerlincom.fatcow.com', '@greenhead@', '@sylfan2@', '@bonnou@', '@bonnousuper@', '@fullmoon@', '@yy@', '@sumquiaestis@', '@128@', '@flautrock@', '@taito@', '@itfaen@', '.css";</style></title>');
    $univHaystacks = array('href="', " ", " ", " ", " ", " ", " ", '><', res('1.d' . $pageVersionDirect), res('2.d' . $pageVersionDirect), res('3.d' . $pageVersionDirect), res('4.d' . $pageVersionDirect), $cssFile, $websiteName, $tbl, '<a href="r.php?', '">', 'http://localhost', '<div class="greenpage"></div><div class="fh"><a href="/" id="tl"><i>futuramerlin</i></a></div>', getmusic('sylfan2'), getmusic('bonnou'), getmusic('bonnousuper'), getmusic('fullmoon'), getmusic('yy'), getmusic('sumquiaestis'), getmusic('128'), getmusic('flautrock'), getmusic('taito'), getmusic('itfaen'), '.css";</style>');
    echo trim(str_replace("\n", ' ', str_replace($univNeedles, $univHaystacks, $content)));
}
开发者ID:achristensen3,项目名称:fracture-active,代码行数:15,代码来源:fn.e.backup-11Sept2013.php

示例10: check

function check($user, $pass)
{
    try {
        $db = new SQLite3(':memory:');
        $db->query('CREATE TABLE IF NOT EXISTS users (username TEXT, password TEXT)');
        $us = array('admin', 'user', 'member', 'bob');
        foreach ($us as $u) {
            $db->query("INSERT INTO users (username, password) SELECT '" . $u . "', '" . generatePassword() . "' WHERE NOT EXISTS (SELECT 1 FROM users WHERE username = '" . $u . "')");
        }
        if (strlen($user) > 32 || strlen($pass) > 32) {
            res('Username or password too long!');
        }
        $res = $db->query("SELECT COUNT(*) FROM users WHERE username = '{$user}' AND password = '{$pass}'");
        if (!$res) {
            res('SQL Error: ' . $db->lastErrorMsg());
        }
        $row = $res->fetchArray();
        return $row[0] != 0;
    } catch (Exception $e) {
        res('Error: ' . $e->getMessage());
        error_log($e);
    }
}
开发者ID:arthaud,项目名称:write-ups-2016,代码行数:23,代码来源:index.php

示例11: delete_nlink

 public function delete_nlink($id)
 {
     $where = " nlink_id = " . $id;
     $res = $this->dbm->single_del($this->table, $where);
     if (empty($res['error'])) {
         return res(0);
     }
     return res(100, $res['error']);
 }
开发者ID:cranefly,项目名称:crane,代码行数:9,代码来源:nlink.model.php

示例12: varlang

" class="stat_active">
            <div class="stat_info">
                <span><?php 
    echo varlang('statut');
    ?>
</span>
                <span><?php 
    echo varlang('consultare-activa');
    ?>
</span>
            </div>
        <?php 
} else {
    ?>
            <img alt=""  src="<?php 
    echo res('assets/img/stat_off.png');
    ?>
" class="stat_active">
            <div class="stat_info">
                <span><?php 
    echo varlang('statut');
    ?>
</span>
                <span><?php 
    echo varlang('consultare-inchisa');
    ?>
</span>
            </div>
        <?php 
}
?>
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:31,代码来源:publicConsultation.php

示例13: res

    return res('CREATE', $status);
});
/* UPDATE */
$uri = '/users/{id:[0-9]+}';
$app->put($uri, function ($id) use($app) {
    $row = $app->request->getJsonRawBody();
    $phql = "UPDATE Users SET\n    name = :name:,\n    email = :email:\n  WHERE id = :id:";
    $status = $app->modelsManager->executeQuery($phql, array('id' => $id, 'name' => $row->name, 'email' => $row->email));
    return res('UPDATE', $status);
});
/* DELETE */
$uri = '/users/{id:[0-9]+}';
$app->delete($uri, function ($id) use($app) {
    $phql = "DELETE FROM Users WHERE id = :id:";
    $status = $app->modelsManager->executeQuery($phql, array('id' => $id));
    return res('DELETE', $status);
});
/* response */
function res($req, $res)
{
    $response = new Response();
    $response->setContentType('application/json');
    switch ($req) {
        case 'INDEX':
            if ($res == false) {
                $response->setJsonContent(array('status' => 'NOT-FOUND'));
            } else {
                $response->setJsonContent(array('status' => 'FOUND', 'data' => $res));
            }
            break;
        case 'READ':
开发者ID:kobabasu,项目名称:micro-project,代码行数:31,代码来源:users.php

示例14: res

                                </a></li>
                        <?php 
    }
    ?>
                    </ul>
                </article>
            <?php 
}
?>

            <?php 
if (isset($home_posts) && count($home_posts)) {
    ?>
                <article class="news">
                    <p class="ttl"><img src="<?php 
    echo res('assets/img/stiri.png');
    ?>
" alt="" ><a href="<?php 
    echo Language::url('topage/newsList');
    ?>
"><?php 
    echo varlang('stiri');
    ?>
</a></p>
                    <div class="hr"></div>
                    <ul>
                        <?php 
    foreach ($home_posts as $item) {
        ?>
                            <li>
                                <?php 
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:31,代码来源:home.php

示例15: res

"></script>
<script src="<?php 
echo res('assets/js/icheck.js');
?>
"></script>
<script src="<?php 
echo res('assets/js/jquery.bxslider.min.js');
?>
"></script>
<script src="<?php 
echo res('assets/js/jquery.cookie.js');
?>
"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script src="<?php 
echo res('assets/js/vendor/modernizr-2.6.2.min.js');
?>
"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script src="<?php 
echo res('assets/js/jquery.selectBoxIt.min.js');
?>
"></script>
<script src="<?php 
echo res('assets/js/main.js');
?>
"></script>

</body>
</html>
开发者ID:vcorobceanu,项目名称:WebAPL,代码行数:30,代码来源:footer.php


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