本文整理汇总了PHP中compile_str函数的典型用法代码示例。如果您正苦于以下问题:PHP compile_str函数的具体用法?PHP compile_str怎么用?PHP compile_str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了compile_str函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: address
function address()
{
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
$r_data = get_consignee_list($_SESSION['user_id']);
return $r_data;
break;
case 'DELETE':
$consignee_id = intval($_GET['id']);
if (drop_consignee($consignee_id)) {
$r_data = 'Delete Address Success!';
} else {
$r_data = 'Delete Address Failed!';
}
return $r_data;
break;
case 'POST':
$address = array('user_id' => $_SESSION['user_id'], 'address_id' => intval($_POST['address_id']), 'country' => isset($_POST['country']) ? intval($_POST['country']) : 0, 'province' => isset($_POST['province']) ? intval($_POST['province']) : 0, 'city' => isset($_POST['city']) ? intval($_POST['city']) : 0, 'district' => isset($_POST['district']) ? intval($_POST['district']) : 0, 'address' => isset($_POST['address']) ? compile_str(trim($_POST['address'])) : '', 'consignee' => isset($_POST['consignee']) ? compile_str(trim($_POST['consignee'])) : '', 'email' => isset($_POST['email']) ? compile_str(trim($_POST['email'])) : '', 'tel' => isset($_POST['tel']) ? compile_str(make_semiangle(trim($_POST['tel']))) : '', 'mobile' => isset($_POST['mobile']) ? compile_str(make_semiangle(trim($_POST['mobile']))) : '', 'best_time' => isset($_POST['best_time']) ? compile_str(trim($_POST['best_time'])) : '', 'sign_building' => isset($_POST['sign_building']) ? compile_str(trim($_POST['sign_building'])) : '', 'zipcode' => isset($_POST['zipcode']) ? compile_str(make_semiangle(trim($_POST['zipcode']))) : '');
if (update_address($address)) {
$r_data = 'Update Address Success!';
} else {
$r_data = 'Update Address Failed!';
}
return $r_data;
break;
default:
return 'This API can not support ' . $_SERVER['REQUEST_METHOD'] . ' method';
break;
}
}
示例2: secret
function secret($db, $ecs)
{
switch ($_SERVER['REQUEST_METHOD']) {
case 'POST':
$sel_question = empty($_POST['sel_question']) ? '' : compile_str($_POST['sel_question']);
$passwd_answer = isset($_POST['passwd_answer']) ? compile_str(trim($_POST['passwd_answer'])) : '';
/* 写入密码提示问题和答案 */
if (!empty($passwd_answer) && !empty($sel_question)) {
$sql = 'UPDATE ' . $ecs->table('users') . " SET `passwd_question`='{$sel_question}', `passwd_answer`='{$passwd_answer}' WHERE `user_id`='" . $_SESSION['user_id'] . "'";
$db->query($sql);
$r_data = 'Update Secret Question Success!';
} else {
$r_data = 'Update Secret Question Failed!';
}
return $r_data;
break;
default:
return 'This API can not support ' . $_SERVER['REQUEST_METHOD'] . ' method';
break;
}
}
示例3: idcard
function idcard()
{
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
return get_idcard_list();
//get_user_orders($user_id, $limit, $page);
break;
case 'POST':
$idcard = array('user_id' => $_SESSION['user_id'], 'idcard_id' => intval($_POST['idcard_id']), 'default' => intval($_POST['default']), 'idcard_name' => isset($_POST['name']) ? compile_str(trim($_POST['name'])) : '', 'idcard_img_z' => isset($_POST['img_z']) ? compile_str(trim($_POST['img_z'])) : '', 'idcard_img_f' => isset($_POST['img_f']) ? compile_str(trim($_POST['img_f'])) : '', 'idcard_num' => isset($_POST['id_number']) ? compile_str(trim($_POST['id_number'])) : '');
return update_idcard($idcard);
break;
case 'DELETE':
if (drop_idcard($idcard_id)) {
$r_data = 'Delete IdCard Success!';
} else {
$r_data = 'Delete IdCard Failed!';
}
return $r_data;
break;
default:
return 'This API can not support ' . $_SERVER['REQUEST_METHOD'] . ' method';
break;
}
}
示例4: define
<?php
define('IN_ECS', true);
require 'D:/wamp/www/benhushop1231' . '/includes/init.php';
//$type = trim(compile_str($_REQUEST['type']));
$userName = trim(compile_str($_REQUEST['userName']));
$password = trim(compile_str($_REQUEST['password']));
/*
$ec_salt = -1; $validate = 0;
$result = array();
switch($type)
{
case 'ec_salt':
$result['ec_salt'] = getEcsaltByUserName($userName);
break;
case 'user_validate':
$result['validate'] = isUserValidated($userName, $password);
break;
}
*/
$result = array();
$ec_salt = getEcsaltByUserName($userName);
$result['validate'] = isUserValidated($userName, $password, $ec_salt);
die(urldecode(json_encode($result)));
function getEcsaltByUserName($userName)
{
$sql = "SELECT ec_salt FROM " . $GLOBALS['ecs']->table('users') . " WHERE user_name = '{$userName}'";
$ec_salt = $GLOBALS['db']->getOne($sql);
$ec_salt = empty($ec_salt) ? -1 : $ec_salt;
示例5: show_message
if ($is_distribor != 1) {
show_message('您还不是分销商!', '去首页', 'index.php');
exit;
}
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'edit') {
$id = intval($_REQUEST['id']);
$info = get_dp_info($id, $_SESSION['user_id']);
if ($info) {
$smarty->assign('info', $info);
} else {
show_message('您没有权限查看此信息!');
}
}
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'act_save') {
$id = intval($_POST['id']);
$tixian = array('real_name' => empty($_POST['real_name']) ? '' : compile_str(trim($_POST['real_name'])), 'account_name' => empty($_POST['account_name']) ? '' : compile_str($_POST['account_name']), 'bank_account' => empty($_POST['bank_account']) ? '' : compile_str($_POST['bank_account']), 'phone' => empty($_POST['phone']) ? '' : compile_str(trim($_POST['phone'])), 'remark' => empty($_POST['remark']) ? '' : compile_str(trim($_POST['remark'])), 'user_id' => $_SESSION['user_id']);
if ($tixian) {
if ($id) {
$GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('user_deposit'), $tixian, 'UPDATE', 'id = ' . $id);
$error_no = $GLOBALS['db']->errno();
if ($error_no > 0) {
show_message($GLOBALS['db']->errorMsg());
} else {
ecs_header("Location: v_user_tixian.php\n");
exit;
}
} else {
$GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('user_deposit'), $tixian, 'INSERT');
$error_no = $GLOBALS['db']->errno();
if ($error_no > 0) {
show_message($GLOBALS['db']->errorMsg());
示例6: action_register
/**
* 注册会员的处理
*/
function action_register()
{
// 获取全局变量
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$err = $GLOBALS['err'];
include_once 'includes/cls_json.php';
$json = new JSON();
$res = array('err_msg' => '', 'result' => '');
/* 增加是否关闭注册 */
if ($_CFG['shop_reg_closed']) {
$smarty->assign('action', 'register');
$smarty->assign('shop_reg_closed', $_CFG['shop_reg_closed']);
$smarty->display('user_passport.dwt');
} else {
include_once ROOT_PATH . 'includes/lib_passport.php';
$username = isset($_POST['username']) ? trim($_POST['username']) : '';
$password = isset($_POST['password']) ? trim($_POST['password']) : '';
$email = isset($_POST['email']) ? trim($_POST['email']) : '';
$other['msn'] = isset($_POST['extend_field1']) ? $_POST['extend_field1'] : '';
$other['qq'] = isset($_POST['extend_field2']) ? $_POST['extend_field2'] : '';
$other['office_phone'] = isset($_POST['extend_field3']) ? $_POST['extend_field3'] : '';
$other['home_phone'] = isset($_POST['extend_field4']) ? $_POST['extend_field4'] : '';
$other['mobile_phone'] = isset($_POST['extend_field5']) ? $_POST['extend_field5'] : '';
$sel_question = empty($_POST['sel_question']) ? '' : compile_str($_POST['sel_question']);
$passwd_answer = isset($_POST['passwd_answer']) ? compile_str(trim($_POST['passwd_answer'])) : '';
// 注册类型:email、mobile
$register_type = isset($_POST['register_type']) ? trim($_POST['register_type']) : '';
$back_act = isset($_POST['back_act']) ? trim($_POST['back_act']) : '';
if (empty($_POST['agreement'])) {
$res['err_msg'] = $_LANG['passport_js']['agreement'];
$res['err_no'] = 1;
die($json->encode($res));
}
if (strlen($username) < 3) {
$res['err_msg'] = $_LANG['passport_js']['username_shorter'];
$res['err_no'] = 1;
die($json->encode($res));
}
if (strlen($password) < 6) {
$res['err_msg'] = $_LANG['passport_js']['password_shorter'];
$res['err_no'] = 1;
die($json->encode($res));
}
if (strpos($password, ' ') > 0) {
$res['err_msg'] = $_LANG['passwd_balnk'];
$res['err_no'] = 1;
die($json->encode($res));
}
/* 验证码检查 */
if (intval($_CFG['captcha']) & CAPTCHA_REGISTER && gd_version() > 0) {
if (empty($_POST['captcha'])) {
$res['err_msg'] = $_LANG['invalid_captcha'];
$res['err_no'] = 1;
die($json->encode($res));
}
/* 检查验证码 */
include_once 'includes/cls_captcha.php';
$validator = new captcha();
if (!$validator->check_word($_POST['captcha'])) {
$res['err_msg'] = $_LANG['invalid_captcha'];
$res['err_no'] = 1;
die($json->encode($res));
}
}
if (register($username, $password, $email, $other) !== false) {
/*把新注册用户的扩展信息插入数据库*/
$sql = 'SELECT id FROM ' . $ecs->table('reg_fields') . ' WHERE type = 0 AND display = 1 ORDER BY dis_order, id';
//读出所有自定义扩展字段的id
$fields_arr = $db->getAll($sql);
$extend_field_str = '';
//生成扩展字段的内容字符串
foreach ($fields_arr as $val) {
$extend_field_index = 'extend_field' . $val['id'];
if (!empty($_POST[$extend_field_index])) {
$temp_field_content = strlen($_POST[$extend_field_index]) > 100 ? mb_substr($_POST[$extend_field_index], 0, 99) : $_POST[$extend_field_index];
$extend_field_str .= " ('" . $_SESSION['user_id'] . "', '" . $val['id'] . "', '" . compile_str($temp_field_content) . "'),";
}
}
$extend_field_str = substr($extend_field_str, 0, -1);
if ($extend_field_str) {
$sql = 'INSERT INTO ' . $ecs->table('reg_extend_info') . ' (`user_id`, `reg_field_id`, `content`) VALUES' . $extend_field_str;
$db->query($sql);
}
/* 写入密码提示问题和答案 */
if (!empty($passwd_answer) && !empty($sel_question)) {
$sql = 'UPDATE ' . $ecs->table('users') . " SET `passwd_question`='{$sel_question}', `passwd_answer`='{$passwd_answer}' WHERE `user_id`='" . $_SESSION['user_id'] . "'";
$db->query($sql);
}
/* 判断是否需要自动发送注册邮件 */
if ($GLOBALS['_CFG']['member_email_validate'] && $GLOBALS['_CFG']['send_verify_email']) {
send_regiter_hash($_SESSION['user_id']);
}
$ucdata = empty($user->ucdata) ? "" : $user->ucdata;
//.........这里部分代码省略.........
示例7: get_consignee
exit;
}
$consignee = get_consignee($_SESSION['user_id']);
/* 检查收货人信息是否完整 */
if (!check_consignee_info($consignee, $flow_type)) {
/* 如果不完整则转向到收货人信息填写界面 */
ecs_header("Location: flow.php?step=consignee\n");
exit;
}
$_POST['how_oos'] = isset($_POST['how_oos']) ? intval($_POST['how_oos']) : 0;
$_POST['card_message'] = isset($_POST['card_message']) ? compile_str($_POST['card_message']) : '';
$_POST['inv_type'] = !empty($_POST['inv_type']) ? compile_str($_POST['inv_type']) : '';
$_POST['inv_payee'] = isset($_POST['inv_payee']) ? compile_str($_POST['inv_payee']) : '';
$_POST['inv_content'] = isset($_POST['inv_content']) ? compile_str($_POST['inv_content']) : '';
$_POST['postscript'] = isset($_POST['postscript']) ? compile_str($_POST['postscript']) : '';
$_POST['jintofee'] = isset($_POST['jintofee']) ? compile_str($_POST['jintofee']) : '';
$order = array('shipping_id' => intval($_POST['shipping']), 'pay_id' => intval($_POST['payment']), 'pack_id' => isset($_POST['pack']) ? intval($_POST['pack']) : 0, 'card_id' => isset($_POST['card']) ? intval($_POST['card']) : 0, 'card_message' => trim($_POST['card_message']), 'surplus' => isset($_POST['surplus']) ? floatval($_POST['surplus']) : 0.0, 'integral' => isset($_POST['integral']) ? intval($_POST['integral']) : 0, 'bonus_id' => isset($_POST['bonus']) ? intval($_POST['bonus']) : 0, 'need_inv' => empty($_POST['need_inv']) ? 0 : 1, 'inv_type' => $_POST['inv_type'], 'inv_payee' => trim($_POST['inv_payee']), 'inv_content' => $_POST['inv_content'], 'postscript' => trim($_POST['postscript']), 'how_oos' => isset($_LANG['oos'][$_POST['how_oos']]) ? addslashes($_LANG['oos'][$_POST['how_oos']]) : '', 'need_insure' => isset($_POST['need_insure']) ? intval($_POST['need_insure']) : 0, 'user_id' => $_SESSION['user_id'], 'add_time' => gmtime(), 'order_status' => OS_UNCONFIRMED, 'shipping_status' => SS_UNSHIPPED, 'pay_status' => PS_UNPAYED, 'agency_id' => get_agency_by_regions(array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district'])));
/* 扩展信息 */
if (isset($_SESSION['flow_type']) && intval($_SESSION['flow_type']) != CART_GENERAL_GOODS) {
$order['extension_code'] = $_SESSION['extension_code'];
$order['extension_id'] = $_SESSION['extension_id'];
} else {
$order['extension_code'] = '';
$order['extension_id'] = 0;
}
/* 检查积分余额是否合法 */
$user_id = $_SESSION['user_id'];
if ($user_id > 0) {
$user_info = user_info($user_id);
$order['surplus'] = min($order['surplus'], $user_info['user_money'] + $user_info['credit_line']);
if ($order['surplus'] < 0) {
示例8: get_consignee
$consignee = get_consignee($_SESSION['user_id']);
/* 检查收货人信息是否完整 */
if (!check_consignee_info($consignee, $flow_type))
{
/* 如果不完整则转向到收货人信息填写界面 */
ecs_header("Location: flow.php?step=consignee\n");
exit;
}
$_POST['how_oos'] = isset($_POST['how_oos']) ? intval($_POST['how_oos']) : 0;
$_POST['card_message'] = isset($_POST['card_message']) ? compile_str($_POST['card_message']) : '';
$_POST['inv_type'] = !empty($_POST['inv_type']) ? compile_str($_POST['inv_type']) : '';
$_POST['inv_payee'] = isset($_POST['inv_payee']) ? compile_str($_POST['inv_payee']) : '';
$_POST['inv_content'] = isset($_POST['inv_content']) ? compile_str($_POST['inv_content']) : '';
$_POST['postscript'] = isset($_POST['postscript']) ? compile_str($_POST['postscript']) : '';
$order = array(
'shipping_id' => intval($_POST['shipping']),
'pay_id' => intval($_POST['payment']),
'pack_id' => isset($_POST['pack']) ? intval($_POST['pack']) : 0,
'card_id' => isset($_POST['card']) ? intval($_POST['card']) : 0,
'card_message' => trim($_POST['card_message']),
'surplus' => isset($_POST['surplus']) ? floatval($_POST['surplus']) : 0.00,
'integral' => isset($_POST['integral']) ? intval($_POST['integral']) : 0,
'bonus_id' => isset($_POST['bonus']) ? intval($_POST['bonus']) : 0,
'need_inv' => empty($_POST['need_inv']) ? 0 : 1,
'inv_type' => $_POST['inv_type'],
'inv_payee' => trim($_POST['inv_payee']),
'inv_content' => $_POST['inv_content'],
'postscript' => trim($_POST['postscript']),
示例9: order_info
$content = '提交评论成功';
$hrefs = 'user.php?act=order_list&ctl=5';
$order = order_info($order_id);
$integral = integral_to_give($order);
unfreeze_integral('order', $order['order_sn']);
} else {
$content = '提交评论失败';
$hrefs = 'user.php?act=order_list';
}
show_message($content, $links = '返回我的订单', $hrefs, $type = 'info', $auto_redirect = true);
}
}
} else {
if ($_REQUEST['act'] == 'article_comment') {
$id_value = intval($_REQUEST['article_id']);
$content = trim(compile_str($_REQUEST['comment']));
$comment_rank = intval($_REQUEST['comment_rate']);
$add_time = gmtime();
if (!chechCaptcha()) {
show_message('验证码不正确');
exit;
}
if (empty($content)) {
show_message('评论内容不能为空');
exit;
}
$sql = "INSERT INTO " . $GLOBALS['ecs']->table('comment') . " (comment_type, id_value, \temail, user_name, content, comment_rank, add_time, ip_address, status, parent_id, user_id, order_id, is_anonymity) VALUES(1, '{$id_value}', '', '" . $_SESSION['user_name'] . "', '{$content}', {$comment_rank}, {$add_time}, '" . $_SESSION['last_ip'] . "', 1, 0, '" . $_SESSION['user_id'] . "', '', 0)";
if ($GLOBALS['db']->query($sql)) {
$smarty->assign('redrectUrl', $_SERVER['HTTP_REFERER']);
$smarty->assign('smalltext', '已评论');
$smarty->assign('content', '您成功评论。3秒后将返回上一页,如果未跳转请');
示例10: show_message
$smarty->caching = true;
}
if ($_CFG['is_distrib'] == 0) {
show_message('没有开启微信分销服务!', '返回首页', 'index.php');
}
if ($_SESSION['user_id'] == 0) {
ecs_header("Location: ./\n");
exit;
}
$is_distribor = is_distribor($_SESSION['user_id']);
if ($is_distribor != 1) {
show_message('您还不是分销商!', '去首页', 'index.php');
exit;
}
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'act_tixian') {
$tixian = array('deposit_money' => empty($_POST['deposit_money']) ? '' : $_POST['deposit_money'], 'real_name' => empty($_POST['real_name']) ? '' : compile_str(trim($_POST['real_name'])), 'account_name' => empty($_POST['account_name']) ? '' : compile_str($_POST['account_name']), 'bank_account' => empty($_POST['bank_account']) ? '' : compile_str($_POST['bank_account']), 'phone' => empty($_POST['phone']) ? '' : compile_str(trim($_POST['phone'])), 'remark' => empty($_POST['remark']) ? '' : compile_str(trim($_POST['remark'])), 'add_time' => gmtime(), 'user_id' => $_SESSION['user_id'], 'status' => 0);
if ($tixian['deposit_money'] <= 0) {
show_message('您输入的提现金额不正确!');
}
if ($tixian['real_name'] == '' || $tixian['account_name'] == '' || $tixian['bank_account'] == '') {
show_message('信息请填写完整!');
}
if (!is_telephone($tixian['phone'])) {
show_message('手机号格式不正确!');
}
$user_money = get_user_money_by_user_id($_SESSION['user_id']);
if ($tixian['deposit_money'] > $user_money) {
show_message('您的余额不足,请重新输入!');
}
$GLOBALS['db']->autoExecute($GLOBALS['ecs']->table('deposit'), $tixian, 'INSERT');
$error_no = $GLOBALS['db']->errno();
示例11: define
<?php
define('IN_ECS', true);
define('WEB_ROOT', 'D:/wamp/www/benhushop1231');
define('NEW_UESER_RANKNAME', 'VIP0');
require WEB_ROOT . '/includes/init.php';
require WEB_ROOT . '/MobileInterface/lib/lib_category.php';
$act = trim(compile_str($_REQUEST['act']));
$cateId = intval(trim(compile_str($_REQUEST['cateId'])));
switch ($act) {
case 'categoryList':
$categoryList = getCategoryList($cateId);
die(urldecode(json_encode($categoryList)));
break;
case 'test':
$categoryList = getCategoryList($cateId);
echo "<pre>";
print_r($categoryList);
echo "</pre>";
die;
// die(urldecode(json_encode($categoryList)));
break;
default:
die(urldecode('参数不对'));
break;
}
function getCategoryList($parent_id = 0)
{
$sql = "SELECT cat_id,cat_name FROM " . $GLOBALS['ecs']->table('category') . " WHERE parent_id='{$parent_id}' AND is_show=1 ORDER BY sort_order ASC";
$categorys = $GLOBALS['db']->getAll($sql);
if (!empty($categorys)) {
示例12: array
//是否有房贷
$loanqi = array('3个月以上', '3-6个月', '6个月以上');
//已还款期数
/* 取得国家的省列表 */
$province_list[$region_id] = get_regions(1, 1);
$smarty->assign('province_list', $province_list);
$smarty->assign('righttye', $righttye);
$smarty->assign('decideloan', $decideloan);
$smarty->assign('loanqi', $loanqi);
$smarty->assign('act', $action);
$smarty->display('borrow_money.dwt');
} elseif ($action == 'insert_house_info') {
include_once ROOT_PATH . 'includes/lib_transaction.php';
$houseaddress = isset($_POST['hosue_houseadd']) ? compile_str(trim($_POST['hosue_houseadd'])) : '0';
$housetype = compile_str(trim($_POST['housetype']));
$houseloan = compile_str(trim($_POST['houseloan']));
if (empty($houseaddress) || empty($housetype) || empty($houseloan)) {
show_message($_LANG['borrow_userinfo_fail'], $_LANG['back_up_page'], 'borrow_money.php?act=houseinfo');
}
$carinfo = array('user_id' => $userid, 'house_add' => $houseaddress, 'house_type' => $housetype, 'house_loan' => $houseloan, 'addtime' => gmtime());
if (insert_borrow($carinfo, 3)) {
show_message($_LANG['borrow_record_success'], $_LANG['back_up_page'], './index.php');
}
} elseif ($action == 'creditinfo') {
/* 查询纯信用信息 */
$sql = 'SELECT * FROM ' . $GLOBALS['ecs']->table('borrow_credit') . ' WHERE user_id=' . $userid;
$creditinfo = $GLOBALS['db']->getAll($sql);
$creditinfo[0]['cardright'] = empty($creditinfo[0]['cardright']) ? '0' : $creditinfo[0]['cardright'];
$creditinfo[0]['cardleft'] = empty($creditinfo[0]['cardleft']) ? '0' : $creditinfo[0]['cardleft'];
$creditinfo[0]['cardhead'] = empty($creditinfo[0]['cardhead']) ? '0' : $creditinfo[0]['cardhead'];
$creditinfo[0]['contract'] = empty($creditinfo[0]['contract']) ? '0' : $creditinfo[0]['contract'];
示例13: sprintf
$result['error'] = sprintf($_LANG['bonus_min_amount_error'], price_format($bonus['min_goods_amount'], false));
}
$smarty->assign('total', $total);
/* 团购标志 */
if ($flow_type == CART_GROUP_BUY_GOODS) {
$smarty->assign('is_group_buy', 1);
}
$result['content'] = $smarty->fetch('library/order_total.lbi');
}
$json = new JSON();
die($json->encode($result));
} elseif ($_REQUEST['step'] == 'saveadd') {
include_once ROOT_PATH . 'includes/lib_transaction.php';
include_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/shopping_flow.php';
$smarty->assign('lang', $_LANG);
$address = array('user_id' => $_SESSION['user_id'], 'address_id' => intval($_REQUEST['address_id']), 'country' => isset($_REQUEST['country']) ? intval($_REQUEST['country']) : 1, 'province' => isset($_REQUEST['province']) ? intval($_REQUEST['province']) : 0, 'city' => isset($_REQUEST['city']) ? intval($_REQUEST['city']) : 0, 'district' => isset($_REQUEST['district']) ? intval($_REQUEST['district']) : 0, 'address' => isset($_REQUEST['address']) ? compile_str(trim($_REQUEST['address'])) : '', 'consignee' => isset($_REQUEST['consignee']) ? compile_str(trim($_REQUEST['consignee'])) : '', 'email' => isset($_REQUEST['email']) ? compile_str(trim($_REQUEST['email'])) : '', 'tel' => isset($_REQUEST['tel']) ? compile_str(make_semiangle(trim($_REQUEST['tel']))) : '', 'zipcode' => isset($_REQUEST['zipcode']) ? compile_str(make_semiangle(trim($_REQUEST['zipcode']))) : '', 'is_first' => isset($_REQUEST['is_first']) ? intval($_REQUEST['is_first']) : 0);
if (update_address($address)) {
set_session_consignee($smarty);
$result = 1;
}
echo json_encode($result);
exit;
} elseif ($_REQUEST['step'] == 'add_package_to_cart') {
include_once 'includes/cls_json.php';
$_POST['package_info'] = json_str_iconv($_POST['package_info']);
$result = array('error' => 0, 'message' => '', 'content' => '', 'package_id' => '');
$json = new JSON();
if (empty($_POST['package_info'])) {
$result['error'] = 1;
die($json->encode($result));
}
示例14: elseif
}
/* 保存订单详情收货地址 */
elseif ($action == 'save_order_address')
{
include_once(ROOT_PATH .'includes/lib_transaction.php');
$address = array(
'consignee' => isset($_POST['consignee']) ? compile_str(trim($_POST['consignee'])) : '',
'email' => isset($_POST['email']) ? compile_str(trim($_POST['email'])) : '',
'address' => isset($_POST['address']) ? compile_str(trim($_POST['address'])) : '',
'zipcode' => isset($_POST['zipcode']) ? compile_str(make_semiangle(trim($_POST['zipcode']))) : '',
'tel' => isset($_POST['tel']) ? compile_str(trim($_POST['tel'])) : '',
'mobile' => isset($_POST['mobile']) ? compile_str(trim($_POST['mobile'])) : '',
'sign_building' => isset($_POST['sign_building']) ? compile_str(trim($_POST['sign_building'])) : '',
'best_time' => isset($_POST['best_time']) ? compile_str(trim($_POST['best_time'])) : '',
'order_id' => isset($_POST['order_id']) ? intval($_POST['order_id']) : 0
);
if (save_order_address($address, $user_id))
{
ecs_header('Location: user.php?act=order_detail&order_id=' .$address['order_id']. "\n");
exit;
}
else
{
$err->show($_LANG['order_list_lnk'], 'user.php?act=order_list');
}
}
/* 我的红包列表 */
elseif ($action == 'bonus')
示例15: array
$order_info = array();
//组装拆分的子订单数组信息start
foreach ($cart_goods_new as $ckey => $cval) {
$cart_goods = $cval['goodlist'];
$_POST['how_oos'] = isset($_POST['how_oos']) ? intval($_POST['how_oos']) : 0;
$_POST['card_message'] = isset($_POST['card_message']) ? compile_str($_POST['card_message']) : '';
$_POST['inv_type'] = !empty($_POST['inv_type']) ? compile_str($_POST['inv_type']) : '';
$_POST['inv_payee'] = isset($_POST['inv_payee']) ? compile_str($_POST['inv_payee']) : '';
$_POST['inv_content'] = isset($_POST['inv_content']) ? compile_str($_POST['inv_content']) : '';
$_POST['postscript'] = isset($_POST['postscript']) ? compile_str($_POST['postscript']) : '';
$order_integral = isset($_POST['integral']) ? $_POST['integral'] : array();
$order_bonus_id = isset($_POST['bonus']) ? $_POST['bonus'] : array();
$order_bonus_sn = isset($_POST['bonus_sn']) ? $_POST['bonus_sn'] : array();
$order_surplus = isset($_POST['surplus']) ? $_POST['surplus'] : array();
$_POST['vat_invoice'] = isset($_POST['vat_invoice']) ? compile_str($_POST['vat_invoice']) : '';
$_POST['normal_invoice'] = isset($_POST['normal_invoice']) ? compile_str($_POST['normal_invoice']) : '';
//$_POST['danwei'] = isset($_POST['danwei']) ? compile_str($_POST['danwei']) : '';
$order = array('shipping_id' => intval($_POST['shipping']), 'pay_id' => intval($_POST['payment']), 'pack_id' => isset($_POST['pack']) ? intval($_POST['pack']) : 0, 'card_id' => isset($_POST['card']) ? intval($_POST['card']) : 0, 'card_message' => trim($_POST['card_message']), 'surplus' => isset($order_surplus[$ckey]) ? floatval($order_surplus[$ckey]) : 0.0, 'integral' => isset($order_integral[$ckey]) ? intval($order_integral[$ckey]) : 0, 'bonus_id' => isset($order_bonus_id[$ckey]) ? intval($order_bonus_id[$ckey]) : 0, 'need_inv' => empty($_POST['need_inv']) ? 0 : 1, 'postscript' => trim($_POST['postscript']), 'how_oos' => isset($_LANG['oos'][$_POST['how_oos']]) ? addslashes($_LANG['oos'][$_POST['how_oos']]) : '', 'need_insure' => isset($_POST['need_insure']) ? intval($_POST['need_insure']) : 0, 'user_id' => $_SESSION['user_id'], 'add_time' => gmtime(), 'order_status' => OS_UNCONFIRMED, 'shipping_status' => SS_UNSHIPPED, 'pay_status' => PS_UNPAYED, 'agency_id' => get_agency_by_regions(array($consignee['country'], $consignee['province'], $consignee['city'], $consignee['district'])), 'supplier_id' => $ckey, 'need_inv' => 1, 'inv_content' => $_POST['cont'], 'vat_inv_company_name' => $_POST['vat_inv_company_name'], 'vat_inv_taxpayer_id' => $_POST['vat_inv_taxpayer_id'], 'vat_inv_registration_address' => $_POST['vat_inv_registration_address'], 'vat_inv_registration_phone' => $_POST['vat_inv_registration_phone'], 'vat_inv_deposit_bank' => $_POST['vat_inv_deposit_bank'], 'vat_inv_bank_account' => $_POST['vat_inv_bank_account'], 'inv_consignee_name' => $_POST['inv_consignee_name'], 'inv_consignee_phone' => $_POST['inv_consignee_phone'], 'inv_consignee_country ' => '1', 'inv_consignee_province' => $_POST['inv_consignee_province'], 'inv_consignee_city' => $_POST['selCities'], 'inv_consignee_district' => $_POST['selDistricts'], 'inv_consignee_address' => $_POST['inv_consignee_address']);
if ($_POST['normal_invoice']) {
$order['inv_type'] = $_POST['normal_invoice'];
if ($_POST['danwei']) {
$order['inv_payee'] = $_POST['danwei'];
} else {
$order['inv_payee'] = '个人';
}
$order['inv_payee_type'] = $_POST['oadio'];
$order['inv_payee_type'] = 'individual';
} else {
$order['inv_type'] = $_POST['vat_invoice'];
}
/* 扩展信息 */