コード例 #1
0
ファイル: sell.php プロジェクト: tanmoy1234/cs75
<?php

require_once '../model/model.php';
require_once '../includes/helper.php';
if (isset($_POST['symbol'])) {
    // sell shares
    $userid = (int) $_SESSION['userid'];
    $result = sell_shares($userid, $_POST['symbol'], $error);
    $holdings = get_user_shares($userid);
    if ($result) {
        $cash = get_user_balance($userid);
        render('portfolio', array('holdings' => $holdings, 'cash' => $cash));
    } else {
        echo $error;
        render('sell', array('holdings' => $holdings));
    }
} else {
    $userid = (int) $_SESSION['userid'];
    $holdings = get_user_shares($userid);
    render('sell', array('holdings' => $holdings));
}
コード例 #2
0
ファイル: func_company.php プロジェクト: winiceo/job
function balance_deal_person($uid, $type = 1, $money = 0)
{
    global $db, $timestamp;
    $money = intval($money);
    $uid = intval($uid);
    $balance = get_user_balance($uid);
    if ($type == 1) {
        $sql = "select * from " . table('members_person_points') . " where uid='{$uid}'    LIMIT 1";
        if ($db->getone($sql)) {
            $sql = "UPDATE " . table('members_person_points') . " SET balance= balance+{$money} WHERE uid='{$uid}' LIMIT 1";
            if (!$db->query($sql)) {
                return false;
            }
        } else {
            $sqlarr['uid'] = $uid;
            $sqlarr['balance'] = $money;
            $db->inserttable(table('members_person_points'), $sqlarr);
        }
    }
    if ($type == 2 && $balance >= $money) {
        $sql = "UPDATE " . table('members_person_points') . " SET balance= balance-{$money} WHERE uid='{$uid}' LIMIT 1";
        if (!$db->query($sql)) {
            return false;
        }
    }
    return true;
}
コード例 #3
0
ファイル: admin_company_fun.php プロジェクト: winiceo/job
function order_paid($v_oid)
{
    global $db, $timestamp, $_CFG;
    $order = $db->getone("select * from " . table('order') . " WHERE oid ='{$v_oid}' AND is_paid= '1' LIMIT 1 ");
    if ($order['pay_type'] == '1' || $order['pay_type'] == '4') {
        $order_name = "套餐积分订单";
        $user = get_user($order['uid']);
        $sql = "UPDATE " . table('order') . " SET is_paid= '2',payment_time='{$timestamp}' WHERE oid='{$v_oid}' LIMIT 1 ";
        if (!$db->query($sql)) {
            return false;
        }
        if ($order['amount'] == '0.00') {
            $ismoney = 1;
        } else {
            $ismoney = 2;
        }
        if ($order['points'] > 0) {
            report_deal($order['uid'], 1, $order['points']);
            $user_points = get_user_points($order['uid']);
            $notes = "操作人:{$_SESSION['admin_name']},说明:确认收款。收款金额:{$order['amount']} 。" . date('Y-m-d H:i', time()) . "通过:" . get_payment_info($order['payment_name'], true) . " 成功充值 " . $order['amount'] . "元,(+{$order['points']}),(剩余:{$user_points}),订单:{$v_oid}";
            write_memberslog($order['uid'], 1, 9001, $user['username'], $notes);
            //会员套餐变更记录。管理员后台设置会员订单购买成功。4表示:管理员后台开通
            write_setmeallog($order['uid'], $user['username'], $notes, 4, $order['amount'], $ismoney, 1, 1);
        }
        if ($order['setmeal'] > 0) {
            set_members_setmeal($order['uid'], $order['setmeal']);
            $setmeal = get_setmeal_one($order['setmeal']);
            $notes = "操作人:{$_SESSION['admin_name']},说明:确认收款,收款金额:{$order['amount']} 。" . date('Y-m-d H:i', time()) . "通过:" . get_payment_info($order['payment_name'], true) . " 成功充值 " . $order['amount'] . "元并开通{$setmeal['setmeal_name']}";
            write_memberslog($order['uid'], 1, 9002, $user['username'], $notes);
            //会员套餐变更记录。管理员后台设置会员订单购买成功。4表示:管理员后台开通
            write_setmeallog($order['uid'], $user['username'], $notes, 4, $order['amount'], $ismoney, 2, 1);
        }
    } elseif ($order['pay_type'] == '2') {
        $order_name = "广告位订单";
        $sql = "UPDATE " . table('order') . " SET is_paid= '2',payment_time='{$timestamp}' WHERE oid='{$v_oid}' LIMIT 1 ";
        //is_paid =2 为确定支付
        if (!$db->query($sql)) {
            return false;
        }
        write_memberslog($_SESSION['uid'], 1, 9001, $_SESSION['username'], "申请广告位:<strong>{$order['description']}</strong>,(花费: {$order['amount']})。", 1, 1020, "申请广告位", "-{$order['amount']}", "{$user_points}");
    } elseif ($order['pay_type'] == '3') {
        $order_name = "短信订单";
        $user = get_user($order['uid']);
        $sql = "UPDATE " . table('order') . " SET is_paid= '2',payment_time='{$timestamp}' WHERE oid='{$v_oid}' LIMIT 1 ";
        if (!$db->query($sql)) {
            return false;
        }
        if ($order['setmeal'] > 0) {
            //查看短信套餐
            set_members_sms($order['uid'], intval($order['setmeal']));
            //支付成功,向用户增加短信条数
            $user_points = get_user_setmeal($order['uid']);
            write_memberslog($_SESSION['uid'], 1, 9003, $_SESSION['username'], "短信充值套餐:<strong>{$order['description']}</strong>,(- {$order['amount']}),(剩余:{$user_points['set_sms']})", 1, 1020, "申请广告位", "- {$order['amount']}", "{$user_points['set_sms']}");
        }
    } elseif ($order['pay_type'] == '7') {
        if ($order['amount'] == '0.00') {
            $ismoney = 1;
        } else {
            $ismoney = 2;
        }
        balance_deal($order['uid'], 1, $order['amount']);
        $user_balance = get_user_balance($order['uid']);
        $sql = "UPDATE " . table('order') . " SET is_paid= '2',payment_time='{$timestamp}' WHERE oid='{$v_oid}' LIMIT 1 ";
        //is_paid =2 为确定支付
        if (!$db->query($sql)) {
            return false;
        }
        $note = "余额充值:<strong>{$order['description']}</strong>,(: {$order['amount']})。当前余额为:{$user_balance}";
        write_memberslog($_SESSION['uid'], 1, 9101, $_SESSION['username'], $note, 4, $order['amount'], $ismoney, 1, 1);
    } elseif ($order['pay_type'] == '9') {
        if ($order['amount'] == '0.00') {
            $ismoney = 1;
        } else {
            $ismoney = 2;
        }
        if (get_user_can_balance($order['uid']) < $order['amount']) {
            adminmsg('余额不足', 1);
            return false;
        }
        balance_deal($order['uid'], 2, $order['amount']);
        $user_balance = get_user_balance($order['uid']);
        $sql = "UPDATE " . table('order') . " SET is_paid= '2',payment_time='{$timestamp}' WHERE oid='{$v_oid}' LIMIT 1 ";
        //is_paid =2 为确定支付
        if (!$db->query($sql)) {
            return false;
        }
        $note = "余额提现:<strong>{$order['description']}</strong>,(: {$order['amount']})。当前余额为:{$user_balance}";
        write_memberslog($_SESSION['uid'], 1, 9101, $_SESSION['username'], $note, 4, $order['amount'], $ismoney, 1, 1);
    }
    //发送邮件
    $mailconfig = get_cache('mailconfig');
    if ($mailconfig['set_payment'] == "1" && $user['email_audit'] == "1") {
        dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_mail.php?uid=" . $order['uid'] . "&key=" . asyn_userkey($order['uid']) . "&act=set_payment");
    }
    //发送邮件完毕
    //sms
    $sms = get_cache('sms_config');
    if ($sms['open'] == "1" && $sms['set_payment'] == "1" && $user['mobile_audit'] == "1") {
        dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_sms.php?uid=" . $order['uid'] . "&key=" . asyn_userkey($order['uid']) . "&act=set_payment");
    }
    //微信通知
    set_payment($order['uid'], $order_name, $order['oid'], $order['amount']);
    write_log("将订单号为" . $v_oid . "的订单设置为确认收款", $_SESSION['admin_name'], 3);
    return true;
}
コード例 #4
0
 */
require_once "../php/admin.php";
session_check();
?>
	    
		<div id="wrapper">
        	<?php 
require_once "../template/admin-menu.php";
?>

            <div id="core" class="admin-full pull-left">
                <h2 class="pull-center">Regisztrált Felhasználók</h2>

            <?php 
if (isset($_GET['uid'])) {
    $egyenleg = get_user_balance($_GET['uid']);
} else {
    echo "<script>alert('Nem valasztottal ki felhasznalot!'); window.location = 'users.php';</script>";
}
?>
            
            <form id="iform" name="egyenleg" method="post" action="">
            	<?php 
echo $egyenleg['FELHASZNALO_NEV'] . " jelenlegi egyenlege: " . $egyenleg['EGYENLEG'] . " FT<br />";
?>
				<input type="hidden" name="email" value="<?php 
echo $_GET['uid'];
?>
" />
            	 <div class="acc-row">
                    <span class="acc-info"><label for="rovid_leiras">Egyenlegmódosítás:</label></span><span class="acc-datam">
コード例 #5
0
ファイル: company_service.php プロジェクト: winiceo/job
        header("location:?act=payment&order_id=" . $order_id);
    } else {
        showmsg("添加订单失败!", 0);
    }
} elseif ($act == 'pay_add') {
    $smarty->assign('title', '在线充值 - 企业会员中心 - ' . $_CFG['site_name']);
    $smarty->assign('payment', get_payment());
    $smarty->assign('points', get_user_points($_SESSION['uid']));
    $smarty->assign('balance', get_user_balance($_SESSION['uid']));
    $smarty->assign('balance_can', get_user_can_balance($_SESSION['uid']));
    $smarty->display('member_company/company_pay_add.htm');
} elseif ($act == 'pay_reduce') {
    $smarty->assign('title', '在线充值 - 企业会员中心 - ' . $_CFG['site_name']);
    $smarty->assign('payment', get_payment());
    $smarty->assign('points', get_user_points($_SESSION['uid']));
    $smarty->assign('balance', get_user_balance($_SESSION['uid']));
    $smarty->assign('balance_can', get_user_can_balance($_SESSION['uid']));
    $smarty->display('member_company/company_pay_reduce.htm');
} elseif ($act == 'pay_add_save') {
    if (!$cominfo_flge) {
        $link[0]['text'] = "填写企业资料";
        $link[0]['href'] = 'company_info.php?act=company_profile';
        showmsg("请先填写您的企业资料!", 1, $link);
    }
    $myorder = get_user_order($_SESSION['uid'], 1);
    $order_num = count($myorder);
    if ($order_num >= 5) {
        $link[0]['text'] = "立即查看";
        $link[0]['href'] = '?act=order_list&is_paid=1';
        showmsg("未处理的订单不能超过 5 条,请先处理后再次申请!", 1, $link, true, 8);
    }