public static function Modify($user_id, $newuser = array()) { if (!$user_id) { return; } $table = new Table('user', $newuser); $table->SetPk('id', $user_id); if ($table->password) { $plainpass = $table->password; $table->password = self::GenPassword($table->password); } return $table->Update(array_keys($newuser)); }
public static function Modify($user_id, $newuser = array()) { if (!$user_id) { return; } /* uc */ $curuser = Table::Fetch('user', $user_id); if ($newuser['password'] && function_exists('zuitu_uc_updatepw')) { $em = $curuser['email']; $un = $newuser['username']; $pp = $newuser['password']; if (!zuitu_uc_updatepw($em, $un, $pp)) { return false; } } /* tuan db */ $table = new Table('user', $newuser); $table->SetPk('id', $user_id); if ($table->password) { $plainpass = $table->password; $table->password = self::GenPassword($table->password); } return $table->Update(array_keys($newuser)); }
DB::Update('coupon', array('team_id' => $id), array( 'expire_time' => $team['expire_time'], )); /* update order */ DB::Update('order', array('team_id' => $id), array( 'allowrefund' => $team['allowrefund'], )); } //dbx($team); $insert = array_unique($insert); $table = new Table('team', $team); $table->SetStrip('detail', 'systemreview', 'notice', 'teambeizhu', 'teamviewb'); if ( $team['id'] && $team['id'] == $id ) { $table->SetPk('id', $id); $table->update($insert); DB::Update('team',$id,array('dptpl_id'=>$_POST['dptpl_id'])); log_admin('team', '编辑team项目',$insert); Session::Set('notice', '编辑项目信息成功'); redirect( WEB_ROOT . "/manage/team/index.php"); } else if ( $team['id'] ) { log_admin('team', '非法编辑team项目',$insert); Session::Set('error', '非法编辑'); redirect( WEB_ROOT . "/manage/team/index.php"); } if ( $table->insert($insert) ) {
<?php require_once dirname(dirname(dirname(__FILE__))) . '/app.php'; need_manager(); need_auth('market'); if ($_POST) { $table = new Table('partner', $_POST); $table->SetStrip('location', 'other'); $table->create_time = time(); $table->user_id = $login_user_id; $table->password = ZPartner::GenPassword($table->password); $table->group_id = abs(intval($table->group_id)); $table->city_id = abs(intval($table->city_id)); $table->open = strtoupper($table->open) == 'Y' ? 'Y' : 'N'; $table->display = strtoupper($table->display) == 'Y' ? 'Y' : 'N'; $table->image = upload_image('upload_image', null, 'team', true); $table->image1 = upload_image('upload_image1', null, 'team'); $table->image2 = upload_image('upload_image2', null, 'team'); $table->insert(array('username', 'user_id', 'city_id', 'title', 'group_id', 'bank_name', 'bank_user', 'bank_no', 'create_time', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone', 'password', 'address', 'open', 'display', 'image', 'image1', 'image2', 'longlat')); $partner = DB::GetTableRow('partner', array('username' => $username, 'password' => $password)); // 更新商户支付信息 if ($login_partner) { $table = new Table('partner_pay', $_POST); $table->SetPk('id', $partner['id']); $insert = array('id', 'tenpaymid', 'tenpaysec', 'alipaymid', 'alipaysec'); $flag = $table->insert($insert); } Session::Set('notice', '新建商户成功'); Utility::Redirect(WEB_ROOT . '/manage/partner/index.php'); } include template('manage_partner_create');
die("success"); } $plus = $team['conduser'] == 'Y' ? 1 : $quantity; $team['now_number'] += $plus; //团购数量已超过上限 if ($team['max_number'] > 0 && $team['now_number'] > $team['max_number']) { Phplog::RecordOrderFailLog(" 团购数量已超过上限 团购订单号:" . $order_id); die('success'); } elseif ($team['end_time'] < time()) { Phplog::RecordOrderFailLog(" 团购已结束 团购订单号:" . $order_id); //团购已超时 die('success'); } //1 $table = new Table('order'); $table->SetPk('id', $order_id); $table->pay_id = $out_trade_no; $table->money = $total_fee; $table->order_id = $out_trade_no; $table->state = 'pay'; $table->quantity = $quantity; $table->service = 'chinabank'; $flag = $table->update(array('state', 'pay_id', 'money', 'order_id', 'quantity', 'service')); if ($flag) { $table = new Table('pay'); $table->id = $out_trade_no; $table->order_id = $order_id; $table->money = $total_fee; $table->currency = 'CNY'; $table->bank = '网银(支付宝)'; $table->service = 'chinabank';
<?php require_once(dirname(dirname(__FILE__)) . '/app.php'); need_partner_m(); $partner_id = abs(intval($_SESSION['partner_id'])); $login_partner = $partner = Table::Fetch('partner', $partner_id); if ( $_POST ) { $table = new Table('partner', $_POST); $table->SetStrip('location', 'other'); $table->SetPk('id', $partner_id); if ( $table->password == $table->password2 && $table->password ) { $update[] = 'password'; $table->password = ZPartner::GenPassword($table->password); } $flag = $table->update($update); if ( $flag ) { Session::Set('notice', '密码修改成功,请将修够后的新密码通知到其他使用此账号的人员.'); redirect( WEB_ROOT . "/biz/settings.php"); } Session::Set('error', '修改商户信息失败'); $partner = $_POST; } include template('biz_settings');
$condbuy = implode('@', $_POST['condbuy']); $table = new Table('order', $_POST); $table->quantity = abs(intval($table->quantity)); if ( $table->quantity == 0 ) { Session::Set('error', '购买数量不能小于1份'); redirect( WEB_ROOT . "/team/buy.php?id={$team['id']}"); } elseif ( $team['per_number']>0 && $table->quantity > $team['per_number'] ) { Session::Set('error', '您本次购买本单产品已超出限额!'); redirect( WEB_ROOT . "/team.php?id={$id}"); } if ($order && $order['state']=='unpay') { $table->SetPk('id', $order['id']); } $table->user_id = $login_user_id; $table->state = 'unpay'; $table->allowrefund = $team['allowrefund']; $table->team_id = $team['id']; $table->city_id = $team['city_id']; $table->express = ($team['delivery']=='express') ? 'Y' : 'N'; $table->fare = $table->express=='Y' ? $express_price : 0; $table->express_id = $table->express=='Y' ? $express_id : 0; $table->price = $team['team_price']; $table->credit = 0; $table->condbuy = $condbuy; $table->ubi = 0;
<?php require_once dirname(dirname(__FILE__)) . '/app.php'; need_login(); if ($_POST) { $table = new Table('user', $_POST); $table->SetPk('id', $login_user_id); $update = array('username', 'realname', 'zipcode', 'address', 'mobile', 'avatar'); if ($table->password == $table->password2 && $table->password) { $update[] = 'password'; $table->password = ZUser::GenPassword($table->password); } $table->avatar = upload_image('upload_image', $login_user['avatar'], 'user'); $table->update($update); Utility::Redirect(WEB_ROOT . '/account/settings.php '); } include template('account_settings');
$table = new Table('partner', $_POST); $table->location = ''; $table->other = ''; $table->create_time = time(); $table->user_id = 1; $passwo = $table->password; $table->password = ZPartner::GenPassword($passwo); $table->group_id = abs(intval($table->group_id)); $table->city_id = abs(intval($table->city_id)); $table->open = 'N'; $table->image = upload_image('upload_image', null, 'team', true); $table->image1 = upload_image('upload_image1', null, 'team'); $table->image2 = upload_image('upload_image2', null, 'team'); $flag = $table->insert(array('username', 'user_id', 'city_id', 'title', 'group_id', 'bank_name', 'bank_user', 'bank_no', 'create_time', 'location', 'other', 'homepage', 'contact', 'mobile', 'phone', 'password', 'address', 'open', 'display', 'image', 'image1', 'image2', 'longlat')); $login_partner = ZPartner::GetLogin($table->username, $passwo); // 更新商户支付信息 if ($login_partner) { $table = new Table('partner_pay', $_POST); $table->SetPk('id', $login_partner['id']); $insert = array('id', 'alipaymid', 'alipaysec', 'alipayacc', 'alipayitbpay'); $flag = $table->insert($insert); } if ($flag) { Session::Set('partner_id', $login_partner['id']); Utility::Redirect(WEB_ROOT . '/biz/index.php'); } } } $partner = $_POST; $pagetitle = '商户注册'; include template('partner_create');
$table->order_id = $order_id; $table->money = $amount; $table->currency = 'AED'; $table->bank = $cardType . '-gift'; $table->service = 'migs'; $table->create_time = time(); $table->insert(array('id', 'order_id', 'money', 'currency', 'service', 'create_time', 'bank')); ZOrder::BuyGift($order); } Utility::Redirect(WEB_ROOT . "/gift_cards/giftpay.php?id={$order_id}"); } else { $order = Table::Fetch('order', $merchTxnRef); if ($order['state'] == 'unpay') { //1 $table = new Table('order'); $table->SetPk('id', $merchTxnRef); $table->pay_id = $transactionNo; $table->state = 'pay'; $table->money = $amount; $flag = $table->update(array('state', 'pay_id', 'money')); if ($flag) { $table = new Table('pay'); $table->id = $transactionNo; $table->order_id = $merchTxnRef; $table->money = $amount; $table->currency = 'AED'; $table->bank = $cardType; $table->service = 'migs'; $table->create_time = time(); $table->insert(array('id', 'order_id', 'money', 'currency', 'service', 'create_time', 'bank')); //update team state//