當前位置: 首頁>>代碼示例>>PHP>>正文


PHP key_value函數代碼示例

本文整理匯總了PHP中key_value函數的典型用法代碼示例。如果您正苦於以下問題:PHP key_value函數的具體用法?PHP key_value怎麽用?PHP key_value使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了key_value函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 function __construct()
 {
     $this->member = load_class('member', 'member');
     $this->setting = get_cache('setting', 'member');
     parent::__construct();
     $this->payments_res = $this->db->get_list('payment', "id>1 AND status=1");
     $this->payments = key_value($this->payments_res, 'id', 'name');
     $this->status_arr = array(0 => '回收站', 1 => '交易成功', 2 => '交易失敗', 3 => '交易錯誤', 4 => '交易超時', 5 => '交易取消', 6 => '等待用戶付款', 7 => '待商家發貨', 8 => '待用戶確認收貨');
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:9,代碼來源:payment.php

示例2: add_content

 /**
  * 添加自定義內容
  */
 public function add_content()
 {
     $blockid = $GLOBALS['blockid'];
     if (isset($GLOBALS['submit'])) {
         $formdata = $GLOBALS['form'];
         $formdata['keyid'] = '';
         $formdata['blockid'] = $blockid;
         $formdata['addtime'] = SYS_TIME;
         $formdata['siteid'] = get_cookie('siteid');
         $formdata['isdiy'] = 1;
         $formdata = array_map('remove_xss', $formdata);
         if (isset($GLOBALS['attform'])) {
             $attform = $GLOBALS['attform'];
             $attform = array_map('remove_xss', $attform);
             $formdata['attach'] = serialize($attform);
         }
         $this->db->insert('block_data', $formdata);
         $forward = '?m=content&f=block&v=item_listing&blockid=' . $blockid . $this->su();
         MSG(L('add success'), $forward);
     } else {
         $show_formjs = 1;
         $form = load_class('form');
         $rs = $this->db->get_one('block', array('blockid' => $blockid));
         $attach = '';
         $result = $this->db->get_list('kind', array('keyid' => 'interest'), '*', 0, 50, 0, 'kid ASC');
         $interest = key_value($result, 'maxid', 'name');
         include $this->template('block_add_content');
     }
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:32,代碼來源:block.php

示例3:

<body class="body pxgridsbody">
<section class="wrapper">
<div class="row">
<div class="col-lg-12">
<section class="panel">
    <?php 
echo $this->menu($GLOBALS['_menuid']);
?>

    <div class="panel-body">
        <form class="form-horizontal tasi-form" method="post" action="">
            <div class="form-group">
                <label class="col-sm-2 control-label">所屬角色</label>
                <div class="col-sm-4 input-group">
                    <?php 
echo $form->select(key_value($roles, 'role', 'name'), $r['role'], 'name="form[role]" class="form-control"');
?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">管理員賬號</label>
                <div class="col-sm-4 input-group">
                    <input type="text" class="form-control" name="form[username]" color="#000000" value="<?php 
echo $username;
?>
" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">密碼</label>
                <div class="col-sm-4 input-group">
開發者ID:jackycgq,項目名稱:wuzhicms,代碼行數:31,代碼來源:power_edit.tpl.php

示例4: add

 /**
  * 後台充值
  */
 public function add()
 {
     $config = $this->db->get_one('payment', array('id' => 2));
     if ($config['status'] != 1) {
         MSG('不支持後台充值,開啟方式:充值配置中開啟後台充值功能');
     }
     if (isset($GLOBALS['submit'])) {
         load_function('common', 'pay');
         $formdata = array();
         $formdata['username'] = remove_xss($GLOBALS['username']);
         $mr = $this->db->get_one('member', array('username' => $formdata['username']));
         if (!$mr) {
             MSG('用戶不存在');
         }
         $formdata['uid'] = $mr['uid'];
         $plus_minus = intval($GLOBALS['plus_minus']);
         $money = $formdata['money'] = sprintf("%.2f", substr(sprintf("%.3f", $GLOBALS['money']), 0, -2));
         $formdata['order_no'] = create_order_no();
         $formdata['note'] = remove_xss($GLOBALS['note']);
         $formdata['plus_minus'] = $plus_minus;
         $formdata['adminuid'] = $_SESSION['uid'];
         $formdata['addtime'] = SYS_TIME;
         $formdata['paytime'] = SYS_TIME;
         $formdata['endtime'] = SYS_TIME;
         $formdata['quantity'] = 1;
         $formdata['status'] = 1;
         $formdata['payment'] = 1;
         $username = get_cookie('username');
         if ($plus_minus == 1) {
             $plus_minus_type = '充值';
             $formdata['payname'] = $username . '為用戶' . $plus_minus_type;
             $linkageid = $this->db->insert('pay', $formdata);
             $this->db->update('member', "`money`=(`money`+{$money})", array('uid' => $mr['uid']));
         } else {
             $plus_minus_type = '扣款';
             $formdata['payname'] = $username . '為用戶' . $plus_minus_type;
             $linkageid = $this->db->insert('pay', $formdata);
             $this->db->update('member', "`money`=(`money`-{$money})", array('uid' => $mr['uid']));
         }
         MSG(L('operation success'));
     } else {
         $show_formjs = 1;
         $form = load_class('form');
         $options = $this->db->get_list('kind', array('keyid' => 'link'));
         $options = key_value($options, 'kid', 'name');
         include $this->template('add');
     }
 }
開發者ID:haizhilin2013,項目名稱:wuzhicms,代碼行數:51,代碼來源:index.php

示例5: array

$user = $_SESSION['user'];
$level = $_SESSION[$user];
$db = new \sql\MysqlPDO($level);
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>裝配報表</title>
</head>
<link rel="stylesheet" type="text/css" href="../res/css/custom/list.css">
<body>
<h2>江蘇神通閥門股份有限公司</h2>

<h3>裝配加工路線單</h3>
<table width="100%" align="center">
    <?php 
$head = array('產品型號', '生產批號', '工藝編號', '產品名稱', '產品編號', '頁碼');
$table = key_value($head);
key_value_table($table, 3);
?>
</table>
<table width="100%">
    <?php 
$head = array('工序', '工序名稱', '工序要求', '自檢記錄', '裝配人員', '檢驗記錄', '檢驗結論', '檢驗員', '見證', '工藝設備');
simple_table($head);
?>
</table>
</body>
</html>
開發者ID:ab300819,項目名稱:CraftManage,代碼行數:30,代碼來源:report_assembly.php

示例6: copyfrom

 private function copyfrom($config, $value)
 {
     extract($config, EXTR_SKIP);
     $copyfrom_array = $this->db->get_list('copyfrom', '', '*', 0, 20);
     $copyfrom_array = key_value($copyfrom_array, 'fromid', 'name');
     $holder = '演示站點|www.wuzhicms.com';
     return "<div class='col-sm-4 input-group pull-left'><input type='text' id='{$field}' name='form[{$field}]' placeholder='{$holder}' value='{$value}' class='form-control input-text'></div><div class='col-sm-4'>" . $this->form->select($copyfrom_array, $value, "name='{$field}_data' class='form-control' onchange='change_value(\"{$field}\",this.value)'", "選擇已有來源") . "</div>";
 }
開發者ID:jackycgq,項目名稱:wuzhicms,代碼行數:8,代碼來源:guestbook_form.H_1_a.php

示例7: quyu

 private function quyu($config, $value)
 {
     extract($config, EXTR_SKIP);
     $quyulist = $this->db->get_list('quyu', array('pid' => $this->cid), '*', 0, 100, 0, 'sort ASC');
     $option = key_value($quyulist, 'areaid', 'name');
     $string = $this->form->select($option, $value, "name='form[{$field}]' class='form-control' style='width:auto;' id='{$field}' ");
     return $string;
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:8,代碼來源:content_form.H_1_a.php

示例8:

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-xs-4 control-label">名稱</label>
                            <div class="col-lg-3 col-sm-4 col-xs-4 input-group">
                                <input type="text" class="form-control" name="form[name]" color="#000000" datatype="*"  errormsg="請輸入標題" value="<?php 
echo $r['name'];
?>
">
                            </div>
                        </div>
                        <div class="form-group hide" id="models">
                            <label class="col-sm-2 col-xs-4 control-label">綁定模型</label>
                            <div class="col-lg-3 col-sm-4 col-xs-4 input-group">
                                <?php 
echo WUZHI_form::select(key_value($models, 'modelid', 'name'), $r['modelid'], 'name="modelid" class="form-control "', '--不限模型--');
?>
                            </div>
                        </div>
                        <div class="form-group hide" id="rssid">
                            <label class="col-sm-2 col-xs-4 control-label">RSS源</label>
                            <div class="col-lg-3 col-sm-4 col-xs-4 input-group">
                                <input type="text" class="form-control" name="form[rssurl]" color="#000000" datatype="url|*0-100"  errormsg="請輸入正確的網址!" value="<?php 
echo $r['url'];
?>
">
                            </div>
                        </div>
                        <div class="form-group hide" id="jsonid">
                            <label class="col-sm-2 col-xs-4 control-label">JSON源</label>
                            <div class="col-lg-3 col-sm-4 col-xs-4 input-group">
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:31,代碼來源:block_edit.tpl.php

示例9:

                        <div class="form-group">
                            <label class="col-sm-2 control-label">欄目圖片</label>
                            <div class="col-sm-4 input-group">
                                <div class="input-group"><?php 
echo $form->attachment('', '1', 'form[thumb]', $r['thumb']);
?>
</div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">工作流</label>
                            <div class="col-sm-4 input-group">
                                <?php 
echo $form->select(key_value($workflow, 'workflowid', 'name'), $r['workflowid'], 'name="form[workflowid]" class="form-control"', '≡ 無需審核 ≡');
?>
                            </div>
                        </div>
                        <div class="form-group <?php 
if ($r['pid']) {
    echo 'hide';
}
?>
" id="domain-div">
                            <label class="col-sm-2 control-label">綁定域名</label>
                            <div class="col-sm-4 input-group">
                                <input type="text" class="form-control" id="domain" name="form[domain]" value="<?php 
echo $r['domain'];
?>
">
開發者ID:jackycgq,項目名稱:wuzhicms,代碼行數:30,代碼來源:category_edit.tpl.php

示例10: edit

 /**
  * 修改友情鏈接
  */
 public function edit()
 {
     $linkid = intval($GLOBALS['linkid']);
     if (isset($GLOBALS['submit'])) {
         $formdata = array();
         $formdata['sitename'] = remove_xss($GLOBALS['form']['sitename']);
         $formdata['url'] = remove_xss($GLOBALS['form']['url']);
         $formdata['logo'] = remove_xss($GLOBALS['form']['logo']);
         $formdata['remark'] = remove_xss($GLOBALS['form']['remark']);
         $formdata['username'] = get_cookie('username');
         $formdata['addtime'] = SYS_TIME;
         $formdata['kid'] = intval($GLOBALS['form']['kid']);
         $this->db->update('link', $formdata, array('linkid' => $linkid));
         $forward = $GLOBALS['forward'];
         MSG(L('operation success'), $forward);
     } else {
         $show_formjs = 1;
         $form = load_class('form');
         $r = $this->db->get_one('link', array('linkid' => $linkid));
         $options = $this->db->get_list('kind', array('keyid' => 'link'));
         $options = key_value($options, 'kid', 'name');
         include $this->template('edit');
     }
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:27,代碼來源:index.php

示例11: array

<div><a href="../list_product.php">主頁</a></div>

<h2>產品信息</h2>

<div>
    <table width="100%">
        <?php 
$head = array('物料名稱', '工藝路線名稱', '規格型號', '物料編碼', '材質', '單位');
$table_column = array('material_name', 'craft_line', 'standard', 'material_num', 'material');
$list = $db->get_choice_select(PRODUCT, $table_column, "id={$product_id}");
$list['unit'] = null;
if ($list == null) {
    echo "<script>\n                    alert('沒有相關數據!');\n                    window.history.back();\n                  </script>";
} else {
    $content = key_value_change_one($list);
    $table = key_value($head, $content);
    key_value_table($table, 3);
}
?>
    </table>
</div>
<h2>機加工工藝</h2>

<div><a href='../add/add_metallurgy.php?id=<?php 
echo $product_id;
?>
'>添加</a></div>
<div>
    <table width="100%">
        <?php 
$material_num = $list['material_num'];
開發者ID:ab300819,項目名稱:CraftManage,代碼行數:31,代碼來源:panel_metallurgy.php

示例12: add

 /**
  * 積分入帳
  */
 public function add()
 {
     $config = get_cache('point_config');
     if ($config['status'] != 1) {
         MSG('未開啟後台積分入帳,如需開啟請在積分配置中開啟');
     }
     if (isset($GLOBALS['submit'])) {
         load_function('common', 'pay');
         $formdata = array();
         $formdata['username'] = remove_xss($GLOBALS['username']);
         $mr = $this->db->get_one('member', array('username' => $formdata['username']));
         if (!$mr) {
             MSG('用戶不存在');
         }
         $formdata['uid'] = $mr['uid'];
         $plus_minus = intval($GLOBALS['plus_minus']);
         $username = get_cookie('username');
         $point = intval($GLOBALS['point']);
         if ($plus_minus == 1) {
             $plus_minus_type = '增加';
             $plus_minus = '+';
             $left_point = $mr['points'] + $point;
         } else {
             $plus_minus_type = '減少';
             $plus_minus = '-';
             $left_point = $mr['points'] - $point;
             if ($left_point <= 0) {
                 MSG('用戶積分為:' . $mr['points'] . ',不足扣除' . $point);
             }
         }
         $payname = $username . '後台管理:' . $plus_minus_type . '積分,用戶剩餘積分:' . $left_point . '<br>' . $GLOBALS['note'];
         $credit_api = load_class('credit_api', 'credit');
         $credit_api->handle($mr['uid'], $plus_minus, $point, $payname);
         MSG(L('operation success'), HTTP_REFERER);
     } else {
         $show_formjs = 1;
         $form = load_class('form');
         $options = $this->db->get_list('kind', array('keyid' => 'link'));
         $options = key_value($options, 'kid', 'name');
         include $this->template('add');
     }
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:45,代碼來源:index.php

示例13: hotcity

function hotcity($type = 1)
{
    $db = load_class('db');
    $result = $db->get_list('category', array('modelid' => 3, 'ishot' => 1), '*', 0, 100, 0, 'sort ASC');
    if ($type == 1) {
        $result = key_value($result, 'cid', 'name');
        return WUZHI_form::select($result, 0, 'name="cityid" class="form-control input-sm"', '請選擇城市');
    } else {
        return $result;
    }
}
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:11,代碼來源:content.func.php

示例14: get_cache

                            <th class="tablehead center">目標欄目(<?php 
echo $modelname;
?>
)</th>

                        </tr>
                        </thead>
                        <tr>
                        <td><div class="col-lg-12 col-sm-12"><textarea name="ids" class="form-control" rows="14"><?php 
echo $ids;
?>
</textarea></div></td>

                        <td><div class="col-lg-12 col-sm-12"><?php 
$sitelist = get_cache('sitelist');
$site_arr = key_value($sitelist, 'siteid', 'name');
echo $form->select($site_arr, 0, 'name="cid" style="height:260px;" class="form-control" size=2 onchange="load_sitecate(this.value)"');
?>
</div></td>
                            <td><div class="col-lg-12 col-sm-12" id="categorys"><?php 
echo $form->tree_select($categorys, 0, 'name="cid" style="height:260px;width:260px;" class="form-control" size=2', '≡ 請選擇欄目 ≡');
?>
</div></td>
                        </tr>
                        <tr><td colspan="3" class="text-center">
                                <input name="forward" type="hidden" value="<?php 
echo HTTP_REFERER;
?>
">
                                <button type="submit" class="btn btn-primary"><i class=" icon-angle-double-right btn-icon"></i>批量推送</button></td></tr>
                        </table>
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:31,代碼來源:content_push.tpl.php

示例15:

<div class="row">
<div class="col-lg-12">
<section class="panel">
    <header class="panel-heading">
        <span>添加菜單</span>
    </header>
    <div class="panel-body">
        <form class="form-horizontal tasi-form" method="post" action="">
            <div class="form-group">
                <label class="col-sm-2 col-xs-4 control-label">上級菜單</label>
                <div class="col-lg-3 col-sm-4 col-xs-4 input-group">
                    <?php 
if ($pid) {
    echo '<input type="hidden" name="form[pid]" value="' . $pid . '"><input class="form-control" id="disabledInput" type="text" placeholder="' . $parentname . '" disabled>';
} else {
    echo $form->select(key_value($menus, 'menuid', 'name'), 0, 'name="form[pid]" class="form-control m-bot15"', '≡ 請選擇上級菜單 ≡');
}
?>

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-4 control-label">菜單中文名</label>
                <div class="col-lg-3 col-sm-4 col-xs-4 input-group">
                    <input type="text" class="form-control" name="form[name]" color="#000000">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 col-xs-4 control-label">模塊名</label>
                <div class="col-lg-3 col-sm-4 col-xs-4 input-group">
                    <input type="text" class="form-control" name="form[m]" value="<?php 
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:31,代碼來源:menu_add.tpl.php


注:本文中的key_value函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。