本文整理汇总了PHP中fb函数的典型用法代码示例。如果您正苦于以下问题:PHP fb函数的具体用法?PHP fb怎么用?PHP fb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fb函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit()
{
$id = (int) $_GET['id'];
if (!empty($_POST)) {
$level = $this->category->get_level($_POST['p_id']);
if ($level <= 3 && $level > 0) {
$data = array('id' => $id, 'name' => $_POST['name'], 'intro' => $_POST['intro'], 'sort' => $_POST['sort'], 'pid' => $_POST['p_id'], 'level' => $level);
$this->category->save($data);
$this->success('更新成功', '/category');
return;
} else {
$this->success('更新失败,最大分类不能超过三级', '/category/edit?id=' . $id);
}
}
$p_name = '根节点';
$categories = $this->category->format_tree($this->category->get_all());
$root = array(array('id' => -1, 'pId' => 0, 'name' => $p_name));
$categories = array_merge($root, $categories);
fb($categories);
$category = $this->category->find($id);
foreach ($categories as $value) {
if ($value['id'] == $category['pid']) {
$p_name = $value['name'];
}
}
$this->assign('categories', $categories);
$this->assign('category', $category);
$this->assign('p_name', $p_name);
$this->display();
}
示例2: ajax_carga_capa
/**
*
*/
public function ajax_carga_capa()
{
header('Content-type: application/json');
$this->load->library("visor/capa/visor_capa_elemento");
$params = $this->input->post(null, true);
$data = array("correcto" => true, "capa" => array("zona" => "", "icono" => "", "nombre" => "", "color" => "", "json" => array()));
/*$regiones_usuario = explode(",",$this->session->userdata('session_regiones'));
foreach($regiones_usuario as $region){
$retorno = $this->visor_capa_elemento->cargaCapasRegion($region);
$data["capa"]["nombre"] = $retorno["capa"]["nombre"];
$data["capa"]["icono"] = $retorno["capa"]["icono"];
$data["capa"]["color"] = $retorno["capa"]["color"];
$data["capa"]["zona"] = $retorno["capa"]["zona"];
if(is_array($retorno["capa"]["json"])){
$data["capa"]["json"] = array_merge($retorno["capa"]["json"], $data["capa"]["json"]);
}
}*/
foreach ($params["emergencia"] as $id_emergencia) {
fb($id_emergencia);
$this->visor_capa_elemento->setEmergencia($id_emergencia);
$retorno = $this->visor_capa_elemento->cargaCapa($params["id"]);
$data["capa"]["nombre"] = $retorno["capa"]["nombre"];
$data["capa"]["icono"] = $retorno["capa"]["icono"];
$data["capa"]["color"] = $retorno["capa"]["color"];
$data["capa"]["zona"] = $retorno["capa"]["zona"];
if (is_array($retorno["capa"]["json"])) {
$data["capa"]["json"] = array_merge($retorno["capa"]["json"], $data["capa"]["json"]);
}
}
echo json_encode($data);
}
示例3: showTrace
/**
+----------------------------------------------------------
* 显示页面Trace信息
+----------------------------------------------------------
* @access private
+----------------------------------------------------------
*/
private function showTrace()
{
// 系统默认显示信息
$log = Log::$log;
$files = get_included_files();
$trace = array('请求时间' => date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']), '当前页面' => __SELF__, '请求协议' => $_SERVER['SERVER_PROTOCOL'] . ' ' . $_SERVER['REQUEST_METHOD'], '运行信息' => $this->showTime(), '会话ID' => session_id(), '日志记录' => !empty($log) ? $log : '无日志记录', '加载文件' => $files);
// 读取项目定义的Trace文件
$traceFile = CONF_PATH . 'trace.php';
if (is_file($traceFile)) {
// 定义格式 return array('当前页面'=>$_SERVER['PHP_SELF'],'通信协议'=>$_SERVER['SERVER_PROTOCOL'],...);
$trace = array_merge(include $traceFile, $trace);
}
// 设置trace信息
trace($trace);
$fire = array(array('', ''));
foreach (trace() as $key => $value) {
$fire[] = array($key, $value);
}
if (headers_sent($filename, $linenum)) {
$fileInfo = !empty($filename) ? "(在{$filename}文件的第{$linenum}行)" : '';
Log::record("已经有Http Header信息头输出{$fileInfo},请在你的入口文件加入ob_start() 或通过配置output_buffering,已确保headers不被提前输出");
} else {
fb(array('页面Trace信息', $fire), FirePHP::TABLE);
}
}
示例4: beforeSave
/**
* 修改之前,如果没有修改权限的权力,而且又对权限进行了修改,则强制失败并提示
* @see \yii\db\BaseActiveRecord::beforeSave($insert)
*/
public function beforeSave($insert)
{
if (parent::beforeSave($insert)) {
if ($insert) {
//新建插入
//没有新建的权限(插入前检查)
// Yii::$app->getSession()->setFlash('denger', 'You do not have permission to modify the user permissions!');
// return false;
} else {
//更新
$is_admin = Yii::$app->getUser()->getIdentity()->attributes['is_admin'];
if (!$is_admin && !Yii::$app->getUser()->can('auth/auth')) {
//无权修改
fb('ddd');
exit;
//如果修改了权限则
if ($this->getAttribute('role_name') != $this->getOldAttribute('role_name')) {
$this->setAttribute('role_name', $this->getOldAttribute('role_name'));
//恢复并提示
Yii::$app->getSession()->setFlash('warning', 'You do not have permission to modify the user permissions!');
}
}
}
return true;
} else {
return false;
}
}
示例5: getAllNetworksByAid
public static function getAllNetworksByAid($aid)
{
$sdb = SDB::getInstance();
$domain = Network::$SDBDomain;
$aaa = array();
foreach (Network::$SDBFields as $field => $meta) {
$aaa[] = $field;
}
$where = "where `aid` = '{$aid}'";
if (!$sdb->select($domain, $aaa, $where)) {
return null;
}
fb("aaa", $aaa);
$appNetworks = array();
foreach ($aaa as $aa) {
$appNetwork = new Network();
foreach (Network::$SDBFields as $field => $meta) {
if (array_key_exists($field, $aa)) {
$appNetwork->{$field} = $aa[$field];
}
}
$appNetwork->id = $aa['id'];
$appNetwork->postGet();
$appNetworks[] = $appNetwork;
}
return $appNetworks;
}
示例6: listaByCapaPropiedad
/**
* Lista la capa por una propiedad del elemento
* @param int $id_capa
* @param string $string
* @return html
*/
public function listaByCapaPropiedad($id_capa, $string)
{
$query = $this->_query->select("p.*")->from($this->_tabla . " p")->join("capas_geometria g", "g.geometria_id = p.poligono_capitem", "INNER")->whereAND("g.geometria_capa", $id_capa)->whereAND("p.poligono_propiedades", $string, "like");
fb($query->getQuery());
$result = $query->getAllResult();
return $result;
}
开发者ID:CarlosAyala,项目名称:midas-codeigniter-modulo-emergencias,代码行数:13,代码来源:capa_detalle_elemento_model.php
示例7: _handle_permission_check_logging
/**
* Log permission checks to the permission_checks.log file
*
* @param MEMBER The user checking against
* @param ID_TEXT The function that was called to check a permission
* @param array Parameters to this permission-checking function
* @param boolean Whether the permission was held
*/
function _handle_permission_check_logging($member, $op, $params, $result)
{
global $PERMISSION_CHECK_LOGGER;
if ($op == 'has_specific_permission') {
require_all_lang();
$params[0] = $params[0] . ' ("' . do_lang('PT_' . $params[0]) . '")';
}
$str = $op;
if (count($params) != 0) {
$str .= ': ';
foreach ($params as $i => $p) {
if ($i != 0) {
$str .= ',';
}
$str .= is_string($p) ? $p : (is_null($p) ? '' : strval($p));
}
}
if ($PERMISSION_CHECK_LOGGER !== false && !$result) {
fwrite($PERMISSION_CHECK_LOGGER, "\t" . $str);
$username = $GLOBALS['FORUM_DRIVER']->get_username($member);
if (is_null($username)) {
$username = do_lang('UNKNOWN');
}
if ($member != get_member()) {
fwrite($PERMISSION_CHECK_LOGGER, ' -- ' . $username);
}
// fwrite($PERMISSION_CHECK_LOGGER,' --> '.($result?do_lang('YES'):do_lang('NO')).chr(10));
fwrite($PERMISSION_CHECK_LOGGER, chr(10));
sync_file(get_custom_file_base() . '/data_custom/permissioncheckslog.php');
}
if (function_exists('fb') && get_param_integer('keep_firephp', 0) == 1 && !headers_sent()) {
fb('Permission check ' . ($result ? 'PASSED' : 'FAILED') . ': ' . $str);
}
}
示例8: write
protected function write(array $record)
{
if (function_exists('fb')) {
switch ($record['level_name']) {
case 'DEBUG':
$l = 'LOG';
break;
case 'INFO':
case 'NOTICE':
$l = 'INFO';
break;
case 'WARNING':
$l = 'WARN';
break;
case 'ERROR':
case 'CRITICAL':
case 'ALERT':
case 'EMERGENCY':
$l = 'ERROR';
break;
default:
$l = 'LOG';
break;
}
if (!empty($record['context'])) {
fb($record['context'], $record['message'], $l);
} else {
fb($record['message'], $l);
}
}
}
示例9: kataDebugOutput
/**
* replace internal katadebug-function
*/
function kataDebugOutput($var = null, $isTable = false)
{
if (!$isTable) {
fb($var);
} else {
/*
$widths = array();
foreach ($var as $line) {
$cellNo = 0;
foreach ($line as $cell) {
if (!isset($widths[$cellNo])) { $widths[$cellNo]=0; }
$widths[$cellNo] = max($widths[$cellNo],strlen($cell));
$cellNo++;
}
}
foreach ($var as $line) {
$s = '';
$cellNo = 0;
foreach ($line as $cell) {
$s.=$cell.str_repeat(' ',$widths[$cellNo]-strlen($cell)).' | ';
$cellNo++;
}
fb($s);
}
*/
fb($var, 'see below', FirePHP::TABLE);
}
}
示例10: index
public function index()
{
$articles = $this->articleModel->getArticles();
fb($articles);
$this->assign('articles', $articles);
$this->display();
}
示例11: __construct
function __construct($text1, $text2)
{
$this->text1 = $text1;
$this->text2 = $text2;
$this->get_trial1();
fb($this);
}
示例12: js
public function js()
{
$row = $this->input->getInt('row');
$col = $this->input->getInt('col');
$uid = $this->input->getInt('uid');
$count = $row * $col;
$sql = 'SELECT
ads.*
FROM ck_ads as ads
JOIN ck_packages as pack
ON(ads.package_id=pack.id)
WHERE
ads.status="approve" AND
ads.clicked < pack.max_click
ORDER BY RAND()
LIMIT ' . $count;
$query = $this->db->query($sql);
$tmpl = Template::getInstance('empty.tpl');
$tmpl->loadPage('jsAds');
fb($col, 'row');
for ($i = 0; $i < $row; ++$i) {
$tmp = array();
for ($j = 0; $j < $col; ++$j) {
$tmp[] = $query->fetch();
}
$data[] = $tmp;
}
fb($data);
$tmpl->assign('uid', $uid);
$tmpl->assign('row', $row);
$tmpl->assign('col', $col);
$tmpl->assign('data', $data);
Response::getInstance()->setTemplate($tmpl);
}
示例13: show
public function show()
{
if ($this->input->getString('traceID') || $this->input->getString('traceCode')) {
$this->traceID = $this->input->getString('traceID');
$this->traceCode = $this->input->getString('traceCode');
$this->tmpl->assign('hasResult', true);
$req = array();
$req[] = $this->db->SimpleSelect('sh_requests', 'status,code', array('code' => $this->traceID))->fetch();
$req[] = $this->db->SimpleSelect('sh_requests', 'status,code', array('code' => $this->traceCode))->fetch();
$req[] = $this->db->SimpleSelect('fr_requests', 'status,code', array('code' => $this->traceID))->fetch();
$req[] = $this->db->SimpleSelect('fr_requests', 'status,code', array('code' => $this->traceCode))->fetch();
for ($i = 0; $i < 4; ++$i) {
if ($req[$i] != null) {
if ($i < 2) {
$this->tmpl->assign('shop_type', 'شخصی');
} else {
$this->tmpl->assign('shop_type', 'مشارکتی');
}
$this->tmpl->assign('status', $req[$i]->status);
$this->tmpl->assign('trace_code', $req[$i]->code);
fb($req);
}
}
}
$this->reponse->setTitle('لیست کالاها');
$this->tmpl->loadPage('traceShow');
$this->reponse->setTemplate($this->tmpl);
}
示例14: _send
protected function _send($content)
{
if (!function_exists('fb')) {
throw new lmbException("FirePHP function 'fb' not found");
}
fb($content, 'new mail');
}
示例15: fbDebug
/**
* firephp debug
*
* @param string $info debug信息
*/
public static function fbDebug($info = '')
{
if (!RThink_Config::get('app.debug')) {
return;
}
require_once 'Debug/Firephp/Fb.php';
fb($info, FirePHP::TRACE);
}