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


PHP insert_user_account函数代码示例

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


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

示例1: action_act_account

function action_act_account()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    include_once ROOT_PATH . 'includes/lib_clips.php';
    include_once ROOT_PATH . 'includes/lib_order.php';
    $amount = isset($_POST['amount']) ? floatval($_POST['amount']) : 0;
    if ($amount <= 0) {
        show_message($_LANG['amount_gt_zero']);
    }
    /* 变量初始化 */
    $surplus = array('user_id' => $user_id, 'rec_id' => !empty($_POST['rec_id']) ? intval($_POST['rec_id']) : 0, 'process_type' => isset($_POST['surplus_type']) ? intval($_POST['surplus_type']) : 0, 'payment_id' => isset($_POST['payment_id']) ? intval($_POST['payment_id']) : 0, 'user_note' => isset($_POST['user_note']) ? trim($_POST['user_note']) : '', 'amount' => $amount);
    /* 退款申请的处理 */
    if ($surplus['process_type'] == 1) {
        /* 判断是否有足够的余额的进行退款的操作 */
        $sur_amount = get_user_surplus($user_id);
        if ($amount > $sur_amount) {
            $content = $_LANG['surplus_amount_error'];
            show_message($content, $_LANG['back_page_up'], '', 'info');
        }
        // 插入会员账目明细
        $amount = '-' . $amount;
        $surplus['payment'] = '';
        $surplus['rec_id'] = insert_user_account($surplus, $amount);
        /* 如果成功提交 */
        if ($surplus['rec_id'] > 0) {
            $content = $_LANG['surplus_appl_submit'];
            show_message($content, $_LANG['back_account_log'], 'user.php?act=account_log', 'info');
        } else {
            $content = $_LANG['process_false'];
            show_message($content, $_LANG['back_page_up'], '', 'info');
        }
    } else {
        if ($surplus['payment_id'] <= 0) {
            show_message($_LANG['select_payment_pls']);
        }
        include_once ROOT_PATH . 'includes/lib_payment.php';
        // 获取支付方式名称
        $payment_info = array();
        $payment_info = payment_info($surplus['payment_id']);
        $surplus['payment'] = $payment_info['pay_name'];
        if ($surplus['rec_id'] > 0) {
            // 更新会员账目明细
            $surplus['rec_id'] = update_user_account($surplus);
        } else {
            // 插入会员账目明细
            $surplus['rec_id'] = insert_user_account($surplus, $amount);
        }
        // 取得支付信息,生成支付代码
        $payment = unserialize_config($payment_info['pay_config']);
        // 生成伪订单号, 不足的时候补0
        $order = array();
        $order['order_sn'] = $surplus['rec_id'];
        $order['user_name'] = $_SESSION['user_name'];
        $order['surplus_amount'] = $amount;
        // 计算支付手续费用
        $payment_info['pay_fee'] = pay_fee($surplus['payment_id'], $order['surplus_amount'], 0);
        // 计算此次预付款需要支付的总金额
        $order['order_amount'] = $amount + $payment_info['pay_fee'];
        // 记录支付log
        $order['log_id'] = insert_pay_log($surplus['rec_id'], $order['order_amount'], $type = PAY_SURPLUS, 0);
        /* 调用相应的支付方式文件 */
        include_once ROOT_PATH . 'includes/modules/payment/' . $payment_info['pay_code'] . '.php';
        /* 取得在线支付方式的支付按钮 */
        $pay_obj = new $payment_info['pay_code']();
        $payment_info['pay_button'] = $pay_obj->get_code($order, $payment);
        /* 模板赋值 */
        $smarty->assign('payment', $payment_info);
        $smarty->assign('pay_fee', price_format($payment_info['pay_fee'], false));
        $smarty->assign('amount', price_format($amount, false));
        $smarty->assign('order', $order);
        $smarty->display('user_transaction.dwt');
    }
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:79,代码来源:user.php

示例2: show_message

     }
 } else {
     if ($surplus['payment_id'] <= 0) {
         show_message($_LANG['select_payment_pls']);
     }
     include_once ROOT_PATH . 'includes/lib_payment.php';
     //获取支付方式名称
     $payment_info = array();
     $payment_info = payment_info($surplus['payment_id']);
     $surplus['payment'] = $payment_info['pay_name'];
     if ($surplus['rec_id'] > 0) {
         //更新会员账目明细
         $surplus['rec_id'] = update_user_account($surplus);
     } else {
         //插入会员账目明细
         $surplus['rec_id'] = insert_user_account($surplus, $amount);
     }
     //取得支付信息,生成支付代码
     $payment = unserialize_config($payment_info['pay_config']);
     //生成伪订单号, 不足的时候补0
     $order = array();
     $order['order_sn'] = $surplus['rec_id'];
     $order['user_name'] = $_SESSION['user_name'];
     $order['surplus_amount'] = $amount;
     //计算支付手续费用
     $payment_info['pay_fee'] = pay_fee($surplus['payment_id'], $order['surplus_amount'], 0);
     //计算此次预付款需要支付的总金额
     $order['order_amount'] = $amount + $payment_info['pay_fee'];
     //记录支付log
     $order['log_id'] = insert_pay_log($surplus['rec_id'], $order['order_amount'], $type = PAY_SURPLUS, 0);
     /* 调用相应的支付方式文件 */
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:user.php

示例3: die

    die($json->encode($res));
} elseif ($_REQUEST['act'] == 'act_account') {
    include_once ROOT_PATH . 'includes/lib_clips.php';
    include_once ROOT_PATH . 'includes/lib_order.php';
    $amount = isset($_REQUEST['surplus_amount']) ? floatval($_REQUEST['surplus_amount']) : 0;
    $user_id = intval($_REQUEST['user_id']);
    $res['req_msg'] = true;
    $res['timeout'] = 2000;
    if ($amount <= 0) {
        $res['message'] = '添加失败';
        die($json->encode($res));
    }
    $surplus = array('user_id' => $user_id, 'rec_id' => !empty($_REQUEST['rec_id']) ? intval($_REQUEST['rec_id']) : 0, 'process_type' => isset($_REQUEST['surplus_type']) ? intval($_REQUEST['surplus_type']) : 0, 'payment' => isset($_REQUEST['payment_id']) ? intval($_REQUEST['payment_id']) : 0, 'user_note' => isset($_REQUEST['user_note']) ? trim($_REQUEST['user_note']) : '', 'amount' => $amount);
    //充值
    if ($process_type == 0) {
        $res['insert_id'] = insert_user_account($surplus, $amount);
        if ($res['insert_id']) {
            $sql_update = 'UPDATE ' . $GLOBALS['ecs']->table('user_account') . " SET admin_user='{$_SESSION['admin_name']}'";
            $GLOBALS['db']->query($sql_update);
            $res['message'] = '添加成功';
        } else {
            $res['message'] = '添加失败';
        }
    }
    die($json->encode($res));
} elseif ($_REQUEST['act'] == 'del_user_inte') {
    $res = array();
    $res['row_id'] = intval($_REQUEST['row_id']);
    $user_inte_id = intval($_REQUEST['user_inte_id']);
    $res['req_msg'] = true;
    $res['timeout'] = 2000;
开发者ID:554119220,项目名称:kjrscrm,代码行数:31,代码来源:service.php


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