• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mysqld_insert函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: member_create_qq

 function member_create_qq($qq_openid, $avatar = '', $nickname = '', $gender = 0)
 {
     if (!empty($qq_openid)) {
         $qq_fans = mysqld_select("SELECT * FROM " . table('qq_qqfans') . " WHERE qq_openid=:qq_openid ", array(':qq_openid' => $qq_openid));
         if (empty($qq_fans['qq_openid'])) {
             $row = array('nickname' => $nickname, 'gender' => intval($gender), 'qq_openid' => $qq_openid, 'avatar' => $avatar, 'createtime' => TIMESTAMP);
             mysqld_insert('qq_qqfans', $row);
         } else {
             $row = array('nickname' => $nickname, 'gender' => intval($gender), 'avatar' => $avatar);
             mysqld_update('qq_qqfans', $row, array('qq_openid' => $qq_openid));
         }
     }
 }
开发者ID:jasonhzy,项目名称:bjcms2.3,代码行数:13,代码来源:lib_qq.php


示例2: do_formsubmit

 public function do_formsubmit()
 {
     global $_GP;
     $id = intval($_GP['id']);
     $insert = array('list_id' => $id, 'str1' => $_GP['str1'], 'str2' => $_GP['str2'], 'str3' => $_GP['str3'], 'create_time' => time());
     if (!empty($_GP['iscomment'])) {
         $insert['str1'] = $_GP['from'];
         $insert['str2'] = $_GP['content'];
     }
     $temp = mysqld_insert('addon10_scene_subscribe', $insert);
     if ($temp == false) {
         $return = array('data' => 200, 'success' => false, 'message' => iconv('gb2312', 'utf-8', iconv('gb2312', 'utf-8', '提交失败')));
         die(json_encode($return));
     } else {
         $return = array('data' => 200, 'success' => true, 'message' => iconv('gb2312', 'utf-8', '提交成功'));
         if (!empty($_GP['iscomment'])) {
             $return = array('data' => array('id' => $id, 'date' => date('Y-m-d H:i:s')), 'success' => 1, 'message' => iconv('gb2312', 'utf-8', '提交成功'));
         }
         die(json_encode($return));
     }
 }
开发者ID:jasonhzy,项目名称:bjcms2.3,代码行数:21,代码来源:mobile.php


示例3: do_newkeupload

 public function do_newkeupload()
 {
     global $_CMS;
     $result = array('url' => '', 'message' => '', 'error' => 0);
     if (!empty($_FILES['imgFile']['name'])) {
         if ($_FILES['imgFile']['error'] != 0) {
             $result['state'] = '上传失败,请重试!';
             exit(json_encode($result));
         }
         $file = $this->new_file_upload($_FILES['imgFile'], 'other');
         if (is_error($file)) {
             $result['state'] = $file['message'];
             exit(json_encode($result));
         }
         $result['url'] = $file['path'];
         $result['filename'] = $file['path'];
         mysqld_insert('attachment', array('uid' => $_CMS['account']['id'], 'filename' => $_FILES['imgFile']['name'], 'attachment' => $result['filename'], 'type' => 1, 'createtime' => TIMESTAMP));
         exit(json_encode($result));
     } else {
         $result['message'] = '请选择要上传的图片!';
         $result['error'] = 1;
         exit(json_encode($result));
     }
 }
开发者ID:jasonhzy,项目名称:bjcms2.3,代码行数:24,代码来源:web.php


示例4: mysqld_select

<?php

$code = $_GP['code'];
require WEB_ROOT . '/system/modules/plugin/dispatch/' . $code . '/lang.php';
$item = mysqld_select("SELECT * FROM " . table('dispatch') . " WHERE code = :code", array(':code' => $code));
if (empty($item['id'])) {
    $data = array('code' => $code, 'name' => $_LANG['dispatch_' . $code . '_name'], 'desc' => $_LANG['dispatch_' . $code . '_desc'], 'enabled' => '1', 'sendtype' => $_LANG['dispatch_' . $code . '_sendtype']);
    mysqld_insert('dispatch', $data);
} else {
    $data = array('name' => $_LANG['dispatch_' . $code . '_name'], 'desc' => $_LANG['dispatch_' . $code . '_desc'], 'enabled' => '1', 'sendtype' => $_LANG['dispatch_' . $code . '_sendtype']);
    mysqld_update('dispatch', $data, array('code' => $code));
}
message("操作成功", create_url('site', array('name' => 'modules', 'do' => 'dispatch', 'op' => 'display')));
开发者ID:jaydom,项目名称:weishang,代码行数:13,代码来源:dispatch_install.php


示例5: mysqld_selectall

}
$paymentlist = mysqld_selectall("select * from " . table("payment") . " where `enabled`=1  and `code`!='gold' and `online`=1 {$paymentconfig} ");
$paymentscount = mysqld_selectcolumn("select count(id) from " . table("payment") . " where `enabled`=1  and `code`!='gold' and `online`=1 {$paymentconfig} ");
if (empty($paymentscount)) {
    message("未找到可用的在线支付方式,暂时不支持余额充值。");
}
if (checksubmit("submit")) {
    if (empty($_GP['charge']) || round($_GP['charge'], 2) <= 0) {
        message("请输入要充值的金额");
    }
    $paytypecode = $_GP['paymentcode'];
    if (empty($paytypecode)) {
        message("请选择充值方式。");
    }
    $payment = mysqld_select("select * from " . table("payment") . " where `enabled`=1 and `code`=:code and `code`!='gold' and `online`=1", array('code' => $paytypecode));
    if (empty($payment['id'])) {
        message("未找到付款方式,付款失败");
    }
    $goodtitle = "余额充值" . $_GP['charge'] . "元";
    $ordersn = 'bg' . date('Ymd') . random(6, 1);
    $gold_order = mysqld_select("SELECT * FROM " . table('gold_order') . " WHERE ordersn = '{$ordersn}'");
    if (!empty($gold_order['ordersn'])) {
        $ordersn = 'bg' . date('Ymd') . random(6, 1);
    }
    $insert = array('openid' => $openid, 'ordersn' => $ordersn, 'price' => $_GP['charge'], 'status' => 0, 'createtime' => TIMESTAMP);
    mysqld_insert('gold_order', $insert);
    $order = mysqld_select("SELECT * FROM " . table('gold_order') . " WHERE ordersn = '{$ordersn}' and openid='{$openid}'");
    require WEB_ROOT . '/system/modules/plugin/payment/' . $paytypecode . '/gold_payaction.php';
    exit;
}
include themePage('rechargegold');
开发者ID:jaydom,项目名称:weishang,代码行数:31,代码来源:rechargegold.php


示例6: message

    }
    if (empty($_GP['third_login'])) {
        if (empty($_GP['pwd'])) {
            message("请输入密码!");
        }
        $pwd = md5($_GP['pwd']);
    } else {
        $pwd = '';
    }
    $shop_regcredit = intval($cfg['shop_regcredit']);
    $openid = date("YmdH", time()) . rand(100, 999);
    $hasmember = mysqld_select("SELECT * FROM " . table('member') . " WHERE openid = :openid ", array(':openid' => $openid));
    if (!empty($hasmember['openid'])) {
        $openid = date("YmdH", time()) . rand(100, 999);
    }
    $data = array('mobile' => $_GP['mobile'], 'pwd' => $pwd, 'createtime' => time(), 'status' => 1, 'istemplate' => 0, 'experience' => 0, 'openid' => $openid);
    mysqld_insert('member', $data);
    if (!empty($shop_regcredit)) {
        member_credit($openid, $shop_regcredit, "addcredit", "注册系统赠送积分");
    }
    $member = get_session_account();
    $oldsessionid = $member['openid'];
    $loginid = save_member_login('', $openid);
    integration_session_account($loginid, $oldsessionid);
    message('注册成功!', to_member_loginfromurl(), 'success');
}
$qqlogin = mysqld_select("SELECT * FROM " . table('thirdlogin') . " WHERE enabled=1 and `code`='qq'");
if (!empty($qqlogin) && !empty($qqlogin['id'])) {
    $showqqlogin = true;
}
include themePage('regedit');
开发者ID:skystar,项目名称:cms,代码行数:31,代码来源:regedit.php


示例7: mysqld_select

<?php

$code = $_GP['code'];
require WEB_ROOT . '/system/modules/plugin/thirdlogin/' . $code . '/lang.php';
$item = mysqld_select("SELECT * FROM " . table('thirdlogin') . " WHERE code = :code", array(':code' => $code));
if (empty($item['id'])) {
    $data = array('code' => $code, 'name' => $_LANG['thirdlogin_' . $code . '_name'], 'enabled' => '0');
    mysqld_insert('thirdlogin', $data);
} else {
    $data = array('name' => $_LANG['thirdlogin_' . $code . '_name']);
    mysqld_update('thirdlogin', $data, array('code' => $code));
}
$this->do_thirdlogin_config();
开发者ID:jaydom,项目名称:weishang,代码行数:13,代码来源:thirdlogin_install.php


示例8: array

<?php

if (checksubmit("submit")) {
    $insert = array('title' => $_GP['title'], 'amount' => intval($_GP['amount']), 'endtime' => strtotime($_GP['endtime']), 'price' => $_GP['price'], 'gold' => $_GP['gold'], 'awardtype' => intval($_GP['awardtype']), 'credit_cost' => intval($_GP['credit_cost']), 'createtime' => time(), "deleted" => 0, 'content' => htmlspecialchars_decode($_GP['content']));
    if (!empty($_FILES['logo']['tmp_name'])) {
        $upload = file_upload($_FILES['logo']);
        if (is_error($upload)) {
            message($upload['message'], '', 'error');
        }
        $logo = $upload['path'];
    }
    if (!empty($logo)) {
        $insert['logo'] = $logo;
    }
    mysqld_insert('addon7_award', $insert);
    message('保存成功', web_url('awardlist'), 'success');
}
include addons_page('award');
开发者ID:jaydom,项目名称:weishang,代码行数:18,代码来源:addaward.php


示例9: explode

     $ids = $option_idss[$k];
     $idsarr = explode("_", $ids);
     $newids = array();
     foreach ($idsarr as $key => $ida) {
         foreach ($spec_items as $it) {
             if ($it['get_id'] == $ida) {
                 $newids[] = $it['id'];
                 break;
             }
         }
     }
     $newids = implode("_", $newids);
     $a = array("title" => $_GP['option_title_' . $ids][0], "productprice" => $_GP['option_productprice_' . $ids][0], "costprice" => $_GP['option_costprice_' . $ids][0], "marketprice" => $_GP['option_marketprice_' . $ids][0], "stock" => $_GP['option_stock_' . $ids][0], "weight" => $_GP['option_weight_' . $ids][0], "goodsid" => $id, "specs" => $newids);
     $totalstocks += $a['stock'];
     if (empty($get_option_id)) {
         mysqld_insert("shop_goods_option", $a);
         $option_id = mysqld_insertid();
     } else {
         mysqld_update("shop_goods_option", $a, array('id' => $get_option_id));
         $option_id = $get_option_id;
     }
     $optionids[] = $option_id;
 }
 if (count($optionids) > 0) {
     mysqld_query("delete from " . table('shop_goods_option') . " where goodsid={$id} and id not in ( " . implode(',', $optionids) . ")");
 } else {
     mysqld_query("delete from " . table('shop_goods_option') . " where goodsid={$id}");
 }
 //总库存
 if ($totalstocks > 0) {
     mysqld_update("shop_goods", array("total" => $totalstocks), array("id" => $id));
开发者ID:jasonhzy,项目名称:bjcms2.3,代码行数:31,代码来源:goods.php


示例10: mysqld_update

                if ($order['status'] == 0) {
                    mysqld_update('gold_order', array('status' => 1), array('id' => $order['id']));
                    mysqld_insert('paylog', array('typename' => '余额充值成功', 'pdate' => $post_data, 'ptype' => 'success', 'paytype' => 'alipay'));
                    member_gold($order['openid'], $order['price'], 'addgold', '余额在线充值-支付宝支付');
                }
                message('余额充值成功!', WEBSITE_ROOT . 'index.php?mod=mobile&name=shopwap&do=fansindex', 'success');
            } else {
                mysqld_insert('paylog', array('typename' => '余额充值未找到订单', 'pdate' => $post_data, 'ptype' => 'error', 'paytype' => 'alipay'));
                message('余额充值未找到订单!', WEBSITE_ROOT . 'index.php?mod=mobile&name=shopwap&do=fansindex', 'error');
                exit;
            }
        }
    }
    $response_msg = "trade_status=" . $_GET['trade_status'];
} else {
    mysqld_insert('paylog', array('typename' => '验证失败', 'pdate' => $post_data, 'ptype' => 'error', 'paytype' => 'alipay'));
    $response_msg = $response_msg . "验证失败";
}
?>
<!DOCTYPE HTML>
<html>
 <head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>支付宝手机网站支付接口</title>
	</head>
    <body>
    	<?php 
echo $response_msg;
?>
    </body>
</html>
开发者ID:skystar,项目名称:cms,代码行数:31,代码来源:alipay_return_url.php


示例11: mysqld_select

<?php

$setting = mysqld_select("SELECT * FROM " . table('addon7_config'));
if (checksubmit("submit")) {
    $cfg = array('title' => $_GP['title']);
    mysqld_delete('addon7_config', array());
    mysqld_insert('addon7_config', $cfg);
    message('保存成功', 'refresh', 'success');
}
include addons_page('setting');
开发者ID:jaydom,项目名称:weishang,代码行数:10,代码来源:setting.php


示例12: message

         if (is_error($upload)) {
             message($upload['message'], '', 'error');
         }
         $data['cover2'] = $upload['path'];
     }
     if (!empty($_GP['bg_music_url_del'])) {
         $data['bg_music_url'] = '';
     }
     if (!empty($_FILES['bg_music_url']['tmp_name'])) {
         $upload = file_upload($_FILES['bg_music_url'], 'music');
         if (is_error($upload)) {
             message($upload['message'], '', 'error');
         }
         $data['bg_music_url'] = $upload['path'];
     }
     mysqld_insert('addon10_scene_list', $data);
     message("添加成功", create_url('site', array('name' => 'addon10', 'do' => 'scene', 'op' => 'setting', 'id' => mysqld_insertid())), "success");
 } else {
     $fields = array('title', 'reply_title', 'reply_description', 'share_title', 'share_content', 'share_cb_url', 'share_cb_tel', 'first_type', 'first_btn_select', 'first_btn_url', 'first_btn_tel', 'bg_music_switch', 'bg_music_icon', 'cover_title', 'cover_subtitle', 'tongji');
     $data = array();
     foreach ($_GP as $k => $v) {
         if (in_array($k, $fields)) {
             $data[$k] = $_GP[$k];
         }
     }
     if (!empty($theme)) {
         $data['theme'] = $theme;
     }
     if (!empty($_GP['reply_thumb_del'])) {
         $data['reply_thumb'] = '';
     }
开发者ID:jasonhzy,项目名称:bjcms2.3,代码行数:31,代码来源:scene.php


示例13: mysqld_select

<?php

$code = $_GP['code'];
require WEB_ROOT . '/system/modules/plugin/payment/' . $code . '/lang.php';
$item = mysqld_select("SELECT * FROM " . table('payment') . " WHERE code = :code", array(':code' => $code));
if (empty($item['id'])) {
    $data = array('code' => $code, 'name' => $_LANG['payment_' . $code . '_name'], 'desc' => $_LANG['payment_' . $code . '_desc'], 'enabled' => '0', 'iscod' => $_LANG['payment_' . $code . '_iscod'], 'online' => $_LANG['payment_' . $code . '_online']);
    mysqld_insert('payment', $data);
} else {
    $data = array('name' => $_LANG['payment_' . $code . '_name'], 'desc' => $_LANG['payment_' . $code . '_desc'], 'iscod' => $_LANG['payment_' . $code . '_iscod'], 'online' => $_LANG['payment_' . $code . '_online']);
    mysqld_update('payment', $data, array('code' => $code));
}
$this->do_payment_config();
开发者ID:jaydom,项目名称:weishang,代码行数:13,代码来源:payment_install.php


示例14: message

if ($op == 'display') {
    if (checksubmit('submit')) {
        if (empty($_GP['charge']) || round($_GP['charge'], 2) <= 0) {
            message("请输入要充值的金额");
        }
        $fee = round($_GP['charge'], 2);
        if ($fee > $member['gold']) {
            message('账户余额不足,最多能提取' . $member['gold'] . '元');
        }
        $ordersn = 'rg' . date('Ymd') . random(6, 1);
        $gold_order = mysqld_select("SELECT * FROM " . table('gold_teller') . " WHERE ordersn = '{$ordersn}'");
        if (!empty($gold_order['ordersn'])) {
            $ordersn = 'rg' . date('Ymd') . random(6, 1);
        }
        member_gold($openid, $fee, 'usegold', '余额提取' . $fee . '元');
        mysqld_insert('gold_teller', array('openid' => $openid, 'fee' => $fee, 'status' => 0, 'ordersn' => $ordersn, 'createtime' => time()));
        message('余额提取申请成功!', 'refresh', 'success');
        exit;
    }
    $applygold = mysqld_selectcolumn("select sum(fee) from " . table("gold_teller") . " where status=0 and openid=" . $openid);
    if (empty($applygold)) {
        $applygold = '0';
    }
    include themePage('outchargegold');
    exit;
}
if ($op == 'history') {
    $pindex = max(1, intval($_GP['page']));
    $psize = 20;
    $list = mysqld_selectall("select * from " . table("gold_teller") . " where openid=:openid order by createtime desc LIMIT " . ($pindex - 1) * $psize . ',' . $psize, array(":openid" => $openid));
    $total = mysqld_selectcolumn('SELECT COUNT(*) FROM ' . table('gold_teller') . " where  openid=:openid ", array(":openid" => $openid));
开发者ID:jaydom,项目名称:weishang,代码行数:31,代码来源:outchargegold.php


示例15: message

        message('商品不能空', refresh(), 'error');
    }
    if (checksubmit("submit")) {
        $optionid = intval($_GP['optionid']);
        $option = mysqld_select("select * from " . table("shop_goods_option") . " where id=:id limit 1", array(":id" => $optionid));
        if ($item['status'] != 3) {
            message('订单未完成不能评论', refresh(), 'error');
        }
        if (empty($_GP['rsreson'])) {
            message('请输入评论内容', refresh(), 'error');
        }
        $shop_order_goods = mysqld_select("select * from " . table("shop_order_goods") . " where id=:id limit 1", array(":id" => $ogsid));
        if (!empty($shop_order_goods['iscomment'])) {
            message('订单已评论', refresh(), 'error');
        }
        mysqld_insert('shop_goods_comment', array('createtime' => time(), 'rate' => $_GP['rate'], 'ordersn' => $item['ordersn'], 'optionname' => $option['title'], 'goodsid' => $shop_order['goodsid'], 'comment' => $_GP['rsreson'], 'orderid' => $orderid, 'openid' => $openid));
        mysqld_update('shop_order_goods', array('iscomment' => 1), array('id' => $ogsid));
        message('评论成功!', mobile_url('myorder', array('status' => intval($_GP['fromstatus']))), 'success');
    }
    include themePage('order_detail_comment');
    exit;
}
if ($op == 'returnpay') {
    $orderid = intval($_GP['orderid']);
    $item = mysqld_select("SELECT * FROM " . table('shop_order') . " WHERE id = :id AND openid = :openid", array(':id' => $orderid, ':openid' => $openid));
    $dispatch = mysqld_select("select id,dispatchname,sendtype from " . table('shop_dispatch') . " where id=:id limit 1", array(":id" => $item['dispatch']));
    if (empty($item)) {
        message('抱歉,您的订单不存在或是已经被取消!', mobile_url('myorder'), 'error');
    }
    $opname = "退款";
    if (checksubmit("submit")) {
开发者ID:jaydom,项目名称:weishang,代码行数:31,代码来源:myorder.php


示例16: member_gold

function member_gold($openid, $fee, $type, $remark)
{
    $member = member_get($openid);
    if (!empty($member['openid'])) {
        if (!is_numeric($fee) || $fee < 0) {
            message("输入数字非法,请重新输入");
        }
        if ($type == 'addgold') {
            $data = array('remark' => $remark, 'type' => $type, 'fee' => $fee, 'account_fee' => $member['gold'] + $fee, 'createtime' => TIMESTAMP, 'openid' => $openid);
            mysqld_insert('member_paylog', $data);
            mysqld_update('member', array('gold' => $member['gold'] + $fee), array('openid' => $openid));
            return true;
        }
        if ($type == 'usegold') {
            if ($member['gold'] >= $fee) {
                $data = array('remark' => $remark, 'type' => $type, 'fee' => $fee, 'account_fee' => $member['gold'] - $fee, 'createtime' => TIMESTAMP, 'openid' => $openid);
                mysqld_insert('member_paylog', $data);
                mysqld_update('member', array('gold' => $member['gold'] - $fee), array('openid' => $openid));
                return true;
            }
        }
    }
    return false;
}
开发者ID:jaydom,项目名称:weishang,代码行数:24,代码来源:init.php


示例17: exit

<?php

if (!empty($_FILES['imgFile']['name'])) {
    if ($_FILES['imgFile']['error'] != 0) {
        $result['message'] = '上传失败,请重试!';
        exit(json_encode($result));
    }
    $file = file_upload($_FILES['imgFile'], 'image');
    if (is_error($file)) {
        $result['message'] = $file['message'];
        exit(json_encode($result));
    }
    $result['url'] = $file['url'];
    $result['error'] = 0;
    $result['filename'] = $file['path'];
    $result['url'] = WEBSITE_ROOT . 'attachment/' . $result['filename'];
    $filename = basename($result['url']);
    mysqld_insert('attachment', array('uid' => $_CMS['account']['id'], 'filename' => $filename, 'attachment' => $result['filename'], 'type' => 1, 'createtime' => TIMESTAMP));
    exit(json_encode($result));
} else {
    $result['message'] = '请选择要上传的图片!';
    exit(json_encode($result));
}
开发者ID:jasonhzy,项目名称:bjcms,代码行数:23,代码来源:upload.php


示例18: mysqld_select

        $option = mysqld_select("select marketprice,stock from " . table('shop_goods_option') . " where id=:id limit 1", array(":id" => $optionid));
        if (!empty($option)) {
            $marketprice = $option['marketprice'];
            $goodsOptionStock = $option['stock'];
        }
    }
    if ($goodsOptionStock <= $total && $goodsOptionStock != -1) {
        $result = array('result' => 0, 'maxbuy' => $goodsOptionStock);
        die(json_encode($result));
        exit;
    }
    $row = mysqld_select("SELECT id, total FROM " . table('shop_cart') . " WHERE session_id = :session_id  AND goodsid = :goodsid  and optionid=:optionid", array(':session_id' => $openid, ':goodsid' => $goodsid, ':optionid' => $optionid));
    if ($row == false) {
        //不存在
        $data = array('goodsid' => $goodsid, 'goodstype' => $goods['type'], 'marketprice' => $marketprice, 'session_id' => $openid, 'total' => $total, 'optionid' => $optionid);
        mysqld_insert('shop_cart', $data);
    } else {
        //累加最多限制购买数量
        $t = $total + $row['total'];
        //存在
        $data = array('marketprice' => $marketprice, 'total' => $t, 'optionid' => $optionid);
        mysqld_update('shop_cart', $data, array('id' => $row['id']));
    }
    //返回数据
    $carttotal = $this->getCartTotal();
    $result = array('result' => 1, 'total' => $carttotal);
    die(json_encode($result));
} else {
    if ($op == 'clear') {
        mysqld_delete('shop_cart', array('session_id' => $openid));
        die(json_encode(array("result" => 1)));
开发者ID:skystar,项目名称:cms,代码行数:31,代码来源:mycart.php


示例19: elseif

    } elseif ($insert['m_type'] == 7) {
        $data = $_GP['seventh'];
    } elseif ($insert['m_type'] == 8) {
        $data = $_GP['eighth'];
    } elseif ($insert['m_type'] == 9) {
        $data = $_GP['ninth'];
    } elseif ($insert['m_type'] == 10) {
        $data = $_GP['tenth'];
    }
    if (!empty($data)) {
        $insert['param'] = serialize($data);
    } else {
        $insert['param'] = '';
    }
    if ($item == false) {
        $temp = mysqld_insert('addon10_scene_page', $insert);
    } else {
        $temp = mysqld_update('addon10_scene_page', $insert, array('id' => $item['id']));
    }
    if ($temp == false) {
        $this->ajaxmessage('数据提交失败');
    } else {
        $this->ajaxmessage('数据提交成功', web_url('scene_page', array('listid' => $list_id, 'op' => 'display')), 'success');
    }
}
$uploadfolder = WEB_ROOT . '/attachment/image/addon10/';
mkdirs($uploadfolder);
$tmpfoldername = random(15);
copy(ADDONS_ROOT . 'addon10/style/img/default_bg.jpg', $uploadfolder . $tmpfoldername . 'jpg');
$tmpfoldername2 = random(15);
copy(ADDONS_ROOT . 'addon10/style/img/default_btn.png', $uploadfolder . $tmpfoldername2 . 'png');
开发者ID:jasonhzy,项目名称:bjcms2.3,代码行数:31,代码来源:page.php


示例20: do_user

 public function do_user()
 {
     global $_GP;
     $operation = !empty($_GP['op']) ? $_GP['op'] : 'listuser';
     if ($operation == 'listuser') {
         $list = mysqld_selectall("select * from " . table('user'));
         include page('listuser');
     }
     if ($operation == 'rule') {
         $allrule = mysqld_selectall('SELECT * FROM ' . table('rule'));
         $id = $_GP['id'];
         $account = mysqld_select('SELECT * FROM ' . table('user') . " WHERE  id=:id", array(':id' => $id));
         $username = $account['username'];
         $userRule = mysqld_selectall('SELECT * FROM ' . table('user_rule') . " WHERE  uid=:uid", array(':uid' => $id));
         foreach ($allrule as $key => $item) {
             foreach ($userRule as $rule) {
                 if ($item['modname'] == $rule['modname'] && $item['moddo'] == $rule['moddo']) {
                     $allrule[$key]['check'] = true;
                 }
             }
         }
         if (checksubmit('submit')) {
             if (empty($id)) {
                 message('操作异常', refresh(), 'error');
             }
             if (!empty($account['id'])) {
                 mysqld_delete('user_rule', array('uid' => $account['id']));
                 foreach ($allrule as $item) {
                     if (!empty($_GP[$item['modname'] . '-' . $item['moddo']])) {
                         $data = array('uid' => $account['id'], 'modname' => $item['modname'], 'moddo' => $item['moddo']);
                         mysqld_insert('user_rule', $data);
                     }
                 }
             }
             message('权限修改成功!', refresh(), 'succes');
         }
         include page('rule');
     }
     if ($operation == 'deleteuser') {
         mysqld_delete('user', array('id' => $_GP['id']));
         mysqld_delete('user_rule', array('uid' => $_GP['id']));
         message('删除成功', refresh(), 'success');
     }
     if ($operation == 'changepwduser') {
         $account = mysqld_select('SELECT * FROM ' . table('user') . " WHERE  id=:id", array(':id' => $_GP['id']));
         $username = $account['username'];
         $id = $account['id'];
         if (checksubmit('submit')) {
             if (empty($_GP['newpassword'])) {
                 message('密码不能为空', refresh(), 'error');
             }
             if (!empty($account['id'])) {
                 if ($_GP['newpassword'] != $_GP['confirmpassword']) {
                     message('两次密码不一致!', refresh(), 'error');
                 }
                 $data = array('password' => md5($_GP['newpassword']));
                 mysqld_update('user', $data, array('id' => $account['id']));
                 message('密码修改成功!', create_url('site', array('name' => 'user', 'do' => 'listuser')), 'succes');
             } else {
                 message($_GP['username'] . '用户名已存在', refresh(), 'error');
             }
         }
         include page('changepwd');
     }
     if ($operation == 'adduser') {
         $allrule = mysqld_selectall('SELECT * FROM ' . table('rule'));
         if (checksubmit('submit')) {
             if (empty($_GP['username']) || empty($_GP['newpassword'])) {
                 message('用户名或密码不能为空', refresh(), 'success');
             }
             $account = mysqld_select('SELECT * FROM ' . table('user') . " WHERE  username=:username", array(':username' => $_GP['username']));
             if (empty($account['id'])) {
                 if ($_GP['newpassword'] != $_GP['confirmpassword']) {
                     message('两次密码不一致!', refresh(), 'error');
                 }
                 $data = array('username' => $_GP['username'], 'password' => md5($_GP['newpassword']));
                 mysqld_insert('user', $data);
                 $account = mysqld_select('SELECT * FROM ' . table('user') . " WHERE  username=:username", array(':username' => $_GP['username']));
                 if (!empty($account['id'])) {
                     mysqld_delete('user_rule', array('uid' => $account['id']));
                     foreach ($allrule as $item) {
                         if (!empty($_GP[$item['modname'] . '-' . $item['moddo']])) {
                             $data = array('uid' => $account['id'], 'modname' => $item['modname'], 'moddo' => $item['moddo']);
                             mysqld_insert('user_rule', $data);
                         }
                     }
                 }
                 message('新增用户成功!', web_url('user'), 'succes');
             } else {
                 message($_GP['username'] . '用户名已存在', refresh(), 'error');
             }
         }
         include page('adduser');
     }
 }
开发者ID:jasonhzy,项目名称:bjcms,代码行数:95,代码来源:web.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mysqld_select函数代码示例发布时间:2022-05-15
下一篇:
PHP mysqld_delete函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap