public function response($request) { $return_res = array('info' => '', 'status' => false); $payment = $GLOBALS['db']->getRow("select id,config from " . DB_PREFIX . "payment where class_name='Alipay'"); $payment['config'] = unserialize($payment['config']); /* 检查数字签名是否正确 */ ksort($request); reset($request); foreach ($request as $key => $val) { if ($key != 'sign' && $key != 'sign_type' && $key != 'code' && $key != 'class_name' && $key != 'act' && $key != 'ctl') { $sign .= "{$key}={$val}&"; } } $sign = substr($sign, 0, -1) . $payment['config']['alipay_key']; if (md5($sign) != $request['sign']) { showErr("签名验证失败"); } $payment_notice_sn = $request['out_trade_no']; $money = $request['total_fee']; $outer_notice_sn = $request['trade_no']; if ($request['trade_status'] == 'TRADE_SUCCESS' || $request['trade_status'] == 'TRADE_FINISHED' || $request['trade_status'] == 'WAIT_SELLER_SEND_GOODS' || $request['trade_status'] == 'WAIT_BUYER_CONFIRM_GOODS') { require_once APP_ROOT_PATH . "system/libs/cart.php"; $rs = payment_paid($payment_notice_sn, $outer_notice_sn); showSuccess($rs['info'], 0, $rs['jump'], 1); } else { showErr("支付失败", 0, url("index"), 1); } }
public function pay() { $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . intval($_REQUEST['id'])); if ($payment_notice) { if ($payment_notice['is_paid'] == 0) { $payment_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where id = " . $payment_notice['payment_id']); if ($payment_info) { require_once APP_ROOT_PATH . "system/payment/" . $payment_info['class_name'] . "_payment.php"; $payment_class = $payment_info['class_name'] . "_payment"; $payment_object = new $payment_class(); $payment_code = $payment_object->get_payment_code($payment_notice['id']); } $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['PAY_NOW']); $GLOBALS['tmpl']->assign("payment_code", $payment_code); //$GLOBALS['tmpl']->assign("order",$order); $GLOBALS['tmpl']->assign("payment_notice", $payment_notice); if (intval($_REQUEST['check']) == 1) { showErr($GLOBALS['lang']['PAYMENT_NOT_PAID_RENOTICE']); } $GLOBALS['tmpl']->display("page/payment_pay.html"); } else { showSuccess($GLOBALS['lang']['NOTICE_PAY_SUCCESS'], 0, APP_ROOT . "/", 1); } } else { showErr($GLOBALS['lang']['NOTICE_SN_NOT_EXIST'], 0, APP_ROOT . "/", 1); } }
public function save_info() { $data = array(); $ajax = intval($_REQUEST['ajax']); $data['user_name'] = strim($_REQUEST['user_name']); if (empty($data['user_name'])) { showErr("请填写您的姓名", $ajax); } $data['tel'] = strim($_REQUEST['tel']); if (empty($data['tel'])) { showErr("请填写您的联系方式", $ajax); } $data['content'] = strim($_REQUEST['content']); if (empty($data['content'])) { showErr("请填写您的留言内容", $ajax); } $data['cate_id'] = intval($_REQUEST['cate_id']); $data['create_time'] = NOW_TIME; $data['user_id'] = intval($_REQUEST['user_id']); $GLOBALS['db']->autoExecute(DB_PREFIX . "message", $data, "INSERT", "", "SILENT"); $message_id = $GLOBALS['db']->insert_id(); if ($message_id > 0) { showSuccess("申请成功!", $ajax, url_wap("index")); } else { showErr("发送失败,请重新申请!", $ajax); } }
function wsnotify($resultStr, $class_act, $cert_md5) { $pMerCode = $resultStr["pMerCode"]; $pErrCode = $resultStr["pErrCode"]; $pErrMsg = $resultStr["pErrMsg"]; $p3DesXmlPara = $resultStr["p3DesXmlPara"]; $pSign = $resultStr["pSign"]; $signPlainText = $pMerCode . $pErrCode . $pErrMsg . $p3DesXmlPara . $cert_md5; $localSign = md5($signPlainText); if ($localSign == $pSign) { //file_put_contents(PATH_LOG_FILE,PATH."--".date('YmdHis')." 验签通过"."\r\n",FILE_APPEND); $Crypt3Des = new Crypt3Des(); //new 3des class $str3XmlParaInfo = $Crypt3Des->DESDecrypt($p3DesXmlPara); //3des解密 if (empty($str3XmlParaInfo)) { //file_put_contents(PATH_LOG_FILE,PATH."--".date('YmdHis')." 3DES解密失败"."\r\n",FILE_APPEND); return; } else { require_once APP_ROOT_PATH . 'system/collocation/ips/xml.php'; $str3ParaInfo = @XML_unserialize($str3XmlParaInfo); $str3Req = $str3ParaInfo['pReq']; if ($class_act == 'GuaranteeUnfreeze') { require_once APP_ROOT_PATH . 'system/collocation/ips/GuaranteeUnfreeze.php'; GuaranteeUnfreezeCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req); showSuccess($pErrMsg, 0, SITE_DOMAIN . APP_ROOT); } if ($class_act == 'Transfer') { require_once APP_ROOT_PATH . 'system/collocation/ips/Transfer.php'; TransferCallBack($pMerCode, $pErrCode, $pErrMsg, $str3Req); showSuccess($pErrMsg, 0, SITE_DOMAIN . APP_ROOT); } } } }
/** * 添加或修改项目类型 */ function add() { $this->load->model('proTypeModel'); if ($_POST) { $proTypeId = (int) $this->input->get('proTypeId'); $data = array('proTypeName' => $this->input->post('proTypeName'), 'statusIs' => (int) $this->input->post('statusIs')); if ($proTypeId) { if ($this->proTypeModel->edit(array('proTypeId' => $proTypeId), $data)) { $this->proTypeModel->createCache(); showSuccess('修改项目类型成功'); } else { showError('修改项目类型失败'); } } else { $data['createTime'] = time(); if ($this->proTypeModel->add($data)) { $this->proTypeModel->createCache(); showSuccess('添加项目类型成功'); } else { showError('添加项目类型失败'); } } } else { $proTypeId = (int) $this->input->get('proTypeId'); if ($proTypeId) { $proTypeData = $this->proTypeModel->getData(array('proTypeId' => $proTypeId)); $this->viewData['proTypeData'] = $proTypeData; } $this->load->view('AdminProType/add', $this->viewData); } }
public function save() { if (trim($_REQUEST['consignee']) == '') { showErr($GLOBALS['lang']['FILL_CORRECT_CONSIGNEE']); } if (trim($_REQUEST['address']) == '') { showErr($GLOBALS['lang']['FILL_CORRECT_ADDRESS']); } if (trim($_REQUEST['zip']) == '') { showErr($GLOBALS['lang']['FILL_CORRECT_ZIP']); } if (trim($_REQUEST['mobile']) == '') { showErr($GLOBALS['lang']['FILL_MOBILE_PHONE']); } if (!check_mobile($_REQUEST['mobile'])) { showErr($GLOBALS['lang']['FILL_CORRECT_MOBILE_PHONE']); } $consignee_data['user_id'] = $GLOBALS['user_info']['id']; $consignee_data['region_lv1'] = intval($_REQUEST['region_lv1']); $consignee_data['region_lv2'] = intval($_REQUEST['region_lv2']); $consignee_data['region_lv3'] = intval($_REQUEST['region_lv3']); $consignee_data['region_lv4'] = intval($_REQUEST['region_lv4']); $consignee_data['address'] = addslashes(trim(htmlspecialchars($_REQUEST['address']))); $consignee_data['mobile'] = addslashes(trim(htmlspecialchars($_REQUEST['mobile']))); $consignee_data['consignee'] = addslashes(trim(htmlspecialchars($_REQUEST['consignee']))); $consignee_data['zip'] = addslashes(trim(htmlspecialchars($_REQUEST['zip']))); $consignee_id = intval($_REQUEST['id']); if ($consignee_id == 0) { $GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $consignee_data); } else { $GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $consignee_data, "UPDATE", "id=" . $consignee_id); } rm_auto_cache("consignee_info", array("consignee_id" => intval($consignee_id))); showSuccess($GLOBALS['lang']['UPDATE_SUCCESS']); }
public function del() { $id = intval($_REQUEST['id']); $GLOBALS['db']->query("delete from " . DB_PREFIX . "deal_collect where id = " . $id . " and user_id = " . intval($GLOBALS['user_info']['id'])); if ($GLOBALS['db']->affected_rows()) { showSuccess($GLOBALS['lang']['DELETE_SUCCESS']); } else { showErr($GLOBALS['lang']['INVALID_COLLECT']); } }
public function index() { $root = array(); $ajax = intval($_REQUEST['ajax']); $root['ajax'] = $ajax; $email = strim($GLOBALS['request']['email']); //用户名或邮箱 $pwd = strim($GLOBALS['request']['pwd']); //密码 //检查用户,用户密码 $user = user_check($email, $pwd); $user_id = intval($user['id']); if ($user_id > 0) { $comment['deal_id'] = intval($_REQUEST['id']); $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $comment['deal_id'] . " and is_delete = 0 and is_effect = 1 "); if (!$deal_info) { $root['info'] = "该项目暂时不能评论"; output($root); } if (!check_ipop_limit(get_client_ip(), "deal_savedealcomment", 3)) { $root['info'] = "提交太快"; } output($root); $comment['content'] = strim($_REQUEST['content']); $comment['user_id'] = intval($GLOBALS['user_info']['id']); $comment['create_time'] = NOW_TIME; $comment['user_name'] = $GLOBALS['user_info']['user_name']; $comment['pid'] = intval($_REQUEST['pid']); $comment['deal_user_id'] = intval($GLOBALS['db']->getOne("select user_id from " . DB_PREFIX . "deal where id = " . $comment['deal_id'])); $comment['reply_user_id'] = intval($GLOBALS['db']->getOne("select user_id from " . DB_PREFIX . "deal_comment where id = " . $comment['pid'])); $comment['deal_user_name'] = $GLOBALS['db']->getOne("select user_name from " . DB_PREFIX . "user where id = " . intval($comment['deal_user_id'])); $comment['reply_user_name'] = $GLOBALS['db']->getOne("select user_name from " . DB_PREFIX . "user where id = " . intval($comment['reply_user_id'])); $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_comment", $comment); $comment['id'] = $GLOBALS['db']->insert_id(); $GLOBALS['db']->query("update " . DB_PREFIX . "deal set comment_count = comment_count+1 where id = " . $comment['deal_id']); if (intval($_REQUEST['syn_weibo']) == 1) { $weibo_info = array(); $weibo_info['content'] = $comment['content'] . " " . get_domain() . url("deal#show", array("id" => $comment['deal_id'])); $img = $GLOBALS['db']->getOne("select image from " . DB_PREFIX . "deal where id = " . intval($comment['deal_id'])); if ($img) { $weibo_info['img'] = APP_ROOT_PATH . "/" . $img; } syn_weibo($weibo_info); } if ($ajax == 1) { $data['status'] = 1; ajax_return($data); } else { showSuccess("发表成功"); } } else { $root['user_login_status'] = 0; output($root); } }
/** * 删除下下活动明细 */ function del() { $id = (int) $this->input->post('id'); $id || showError('请选择要删除的线下活动明细项'); $this->load->model('carMatchingModel'); if ($this->carMatchingModel->del(array('id' => $id, 'storeId' => $this->user['userId']))) { showSuccess('删除线下活动明细项成功'); } else { showError('删除线下活动明细项失败'); } }
public function delnotify() { $ajax = intval($_REQUEST['ajax']); if (!$GLOBALS['user_info']) { showErr("", $ajax, url("user#login")); } $id = intval($_REQUEST['id']); $user_id = intval($GLOBALS['user_info']['id']); $GLOBALS['db']->query("delete from " . DB_PREFIX . "user_notify where user_id = " . $user_id . " and id = " . $id); showSuccess("", $ajax, get_gopreview()); }
function autoopen() { if (intval($GLOBALS['user_info']['id']) == 0) { showErr($GLOBALS['lang']['PLEASE_LOGIN_FIRST'], 1); } if (!isset($_REQUEST['is_effect'])) { showErr($GLOBALS['lang']['ERROR_TITLE'], 1); } $is_effect = intval($_REQUEST['is_effect']); $GLOBALS['db']->autoExecute(DB_PREFIX . "user_autobid", array("is_effect" => $is_effect), "UPDATE", "user_id=" . intval($GLOBALS['user_info']['id'])); showSuccess($GLOBALS['lang']['SUCCESS_TITLE'], 1); }
public function refund() { $coupon_id = intval($_REQUEST['id']); $coupon_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_coupon where id = " . $coupon_id . " and is_valid = 1 and is_delete = 0 and balance_time = 0 and confirm_time=0 and user_id = " . intval($GLOBALS['user_info']['id'])); if ($coupon_data['any_refund'] == 1 || $coupon_data['expire_refund'] == 1 && $coupon_data['end_time'] > 0 && get_gmtime() > $coupon_data['end_time']) { $GLOBALS['db']->query("update " . DB_PREFIX . "deal_coupon set refund_status = 1 where id = " . $coupon_data['id']); $GLOBALS['db']->query("update " . DB_PREFIX . "deal_order set refund_status = 1 where id = " . intval($coupon_data['order_id'])); showSuccess("退款申请已提交,等待管理员审核"); } else { showErr($GLOBALS['lang']['INVALID_ACCESS']); } }
public function dounsubscribe() { $email_code = trim($_REQUEST['code']); $email_code = base64_decode($email_code); $arr = explode("|", $email_code); $GLOBALS['db']->query("delete from " . DB_PREFIX . "mail_list where code = '" . $arr[0] . "' and mail_address = '" . $arr[1] . "'"); $rs = $GLOBALS['db']->affected_rows(); if ($rs) { showSuccess($GLOBALS['lang']['MAIL_UNSUBSCRIBE_SUCCESS'], 0, APP_ROOT . "/"); } else { showErr($GLOBALS['lang']['MAIL_UNSUBSCRIBE_FAILED'], 0, APP_ROOT . "/"); } }
public function dovote() { $ok = false; $ajax = intval($_REQUEST['ajax']); foreach ($_REQUEST['name'] as $vote_ask_id => $names) { foreach ($names as $kk => $name) { if ($name != '') { $ok = true; } } } if (!$ok) { showErr("请选择要调查的内容", $ajax, ''); } $vote_id = intval($_REQUEST['vote_id']); if (check_ipop_limit(get_client_ip(), "vote", 3600, $vote_id)) { foreach ($_REQUEST['name'] as $vote_ask_id => $names) { foreach ($names as $kk => $name) { $name = htmlspecialchars(addslashes(trim($name))); $result = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "vote_result where name = '" . $name . "' and vote_id = " . $vote_id . " and vote_ask_id = " . $vote_ask_id); $is_add = true; if ($result) { $GLOBALS['db']->query("update " . DB_PREFIX . "vote_result set count = count + 1 where name = '" . $name . "' and vote_id = " . $vote_id . " and vote_ask_id = " . $vote_ask_id); if (intval($GLOBALS['db']->affected_rows()) != 0) { $is_add = false; } } if ($is_add) { if ($name != '') { $result = array(); $result['name'] = $name; $result['vote_id'] = $vote_id; $result['vote_ask_id'] = $vote_ask_id; $result['count'] = 1; $GLOBALS['db']->autoExecute(DB_PREFIX . "vote_result", $result); } } } } $vote_list = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "vote_list where vote_id = " . $vote_id); $vote_list = array(); $vote_list['vote_id'] = $vote_id; $vote_list['value'] = serialize($_REQUEST['name']); $GLOBALS['db']->autoExecute(DB_PREFIX . "vote_list", $vote_list); showSuccess("调查提交成功", $ajax, url("vote#index")); } else { showErr("你已经提交过该问卷", $ajax, ''); } }
public function index() { $root = array(); $ajax = intval($_REQUEST['ajax']); $root['ajax'] = $ajax; $email = strim($GLOBALS['request']['email']); //用户名或邮箱 $pwd = strim($GLOBALS['request']['pwd']); //密码 //检查用户,用户密码 $user = user_check($email, $pwd); $user_id = intval($user['id']); if ($user_id > 0) { $id = intval($_REQUEST['id']); $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $id . " and is_delete = 0 and is_effect = 1 and user_id = " . intval($GLOBALS['user_info']['id'])); if (!$deal_info) { $root['info'] = "不能更新该项目的动态"; output($root); } else { $data['log_info'] = strim($_REQUEST['log_info']); if ($data['log_info'] == "") { $root['info'] = "请输入更新的内容"; output($root); } $data['image'] = strim($_REQUEST['image']) != "" ? replace_public($_REQUEST['image']) : ""; $data['vedio'] = strim($_REQUEST['vedio']); if ($data['vedio'] != "") { require_once APP_ROOT_PATH . "system/utils/vedio.php"; $vedio = fetch_vedio_url($_REQUEST['vedio']); if ($vedio != "") { $data['source_vedio'] = $vedio; } else { $root['info'] = "非法的视频地址"; output($root); } } $data['user_id'] = intval($GLOBALS['user_info']['id']); $data['deal_id'] = $id; $data['create_time'] = NOW_TIME; $data['user_name'] = $GLOBALS['user_info']['user_name']; $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_log", $data); $GLOBALS['db']->query("update " . DB_PREFIX . "deal set log_count = log_count + 1 where id = " . $deal_info['id']); showSuccess("", $ajax, url("deal#update", array("id" => $deal_info['id']))); } } else { $root['user_login_status'] = 0; output($root); } }
public function pay() { $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . intval($_REQUEST['id'])); save_debug_log('pay', 'payment_notice:' . json_encode($payment_notice)); if ($payment_notice) { if ($payment_notice['is_paid'] == 0) { $payment_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where id = " . $payment_notice['payment_id']); $order = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']); save_debug_log('pay', 'payment_info:' . json_encode($payment_info)); save_debug_log('pay', 'order:' . json_encode($order)); if ($order['pay_status'] == 2) { if ($order['after_sale'] == 0) { app_redirect(url("shop", "payment#done", array("id" => $order['id']))); exit; } else { showErr($GLOBALS['lang']['DEAL_ERROR_COMMON'], 0, APP_ROOT . "/", 1); } } require_once APP_ROOT_PATH . "system/payment/" . $payment_info['class_name'] . "_payment.php"; $payment_class = $payment_info['class_name'] . "_payment"; $payment_object = new $payment_class(); $payment_code = $payment_object->get_payment_code($payment_notice['id']); $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['PAY_NOW']); $GLOBALS['tmpl']->assign("payment_code", $payment_code); save_debug_log('pay', '$payment_code:' . $payment_code); $GLOBALS['tmpl']->assign("order", $order); $GLOBALS['tmpl']->assign("payment_notice", $payment_notice); if (intval($_REQUEST['check']) == 1) { showErr($GLOBALS['lang']['PAYMENT_NOT_PAID_RENOTICE']); } $GLOBALS['tmpl']->display("payment_pay.html"); } else { $order = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']); save_debug_log('pay', 'order:' . json_encode($order)); if ($order['pay_status'] == 2) { if ($order['after_sale'] == 0) { app_redirect(url("shop", "payment#done", array("id" => $order['id']))); } else { showErr($GLOBALS['lang']['DEAL_ERROR_COMMON'], 0, APP_ROOT . "/", 1); } } else { showSuccess($GLOBALS['lang']['NOTICE_PAY_SUCCESS'], 0, APP_ROOT . "/", 1); } } } else { showSuccess($GLOBALS['lang']['NOTICE_PAY_SUCCESS'], 0, APP_ROOT . "/", 1); //showErr($GLOBALS['lang']['NOTICE_SN_NOT_EXIST'],0,APP_ROOT."/",1); } }
public function do_add_quota() { $data['user_id'] = $GLOBALS['user_info']['id']; $data['money'] = intval($_REQUEST['money']); $data['memo'] = strim($_REQUEST['memo']); $data['other_memo'] = strim($_REQUEST['other_memo']); $data['create_time'] = TIME_UTC; //申请时间 $GLOBALS['db']->autoExecute(DB_PREFIX . "rebid_submit", $data); if ($GLOBALS['db']->insert_id()) { showSuccess('提交成功,等待管理员审核', 0, url("index", "uc_rebid")); } else { showErr('提交失败', 0, url("index", "uc_rebid")); } }
public function save() { require_once APP_ROOT_PATH . 'system/libs/user.php'; foreach ($_REQUEST as $k => $v) { $_REQUEST[$k] = htmlspecialchars(addslashes(trim($v))); } if ($GLOBALS['user_info']['user_name']) { $_REQUEST['user_name'] = $GLOBALS['user_info']['user_name']; } $res = save_user($_REQUEST, 'UPDATE'); if ($res['status'] == 1) { // user_name mobile province_id city_id byear bmonth bday sex my_intro id // 向im.lingang.me发送用户名片修改请求 $phone = $_REQUEST['mobile']; $rid = es_cookie::get("rid"); $sig = md5($phone . "_" . $rid . "_" . $rid); $url = get_doubi_host(); $post = array('action' => 'edit_profile', 'sig' => $sig, 'phone' => $phone, 'uname' => $_REQUEST['user_name'], 'uintro' => $_REQUEST['my_intro'], 'gender' => $_REQUEST['sex'], 'birth' => $_REQUEST['byear'] . "-" . $_REQUEST['bmonth'] . "-" . $_REQUEST['bday']); $response = json_decode(sentSigPost($url, $post), true); $s_user_info = es_session::get("user_info"); $user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = '" . intval($s_user_info['id']) . "'"); es_session::set("user_info", $user_info); if (intval($_REQUEST['is_ajax']) == 1) { echo 1; } else { showSuccess($GLOBALS['lang']['SAVE_USER_SUCCESS']); } } else { $error = $res['data']; if (!$error['field_show_name']) { $error['field_show_name'] = $GLOBALS['lang']['USER_TITLE_' . strtoupper($error['field_name'])]; } if ($error['error'] == EMPTY_ERROR) { $error_msg = sprintf($GLOBALS['lang']['EMPTY_ERROR_TIP'], $error['field_show_name']); } if ($error['error'] == FORMAT_ERROR) { $error_msg = sprintf($GLOBALS['lang']['FORMAT_ERROR_TIP'], $error['field_show_name']); } if ($error['error'] == EXIST_ERROR) { $error_msg = sprintf($GLOBALS['lang']['EXIST_ERROR_TIP'], $error['field_show_name']); } if (intval($_REQUEST['is_ajax']) == 1) { echo 1; } else { showErr($error_msg); } } }
public function delete_order() { $id = intval($_REQUEST['id']); $total_score = intval($_REQUEST['total_score']); $count_sql = "SELECT count(*) from " . DB_PREFIX . "goods_order where id=" . $id . " and order_status =0 and user_id=" . $GLOBALS['user_info']['id']; $order_count = $GLOBALS['db']->getOne($count_sql); if (!$order_count) { showErr('订单取消失败', 0, url("index", "uc_goods_order")); } require_once APP_ROOT_PATH . "system/libs/user.php"; modify_account(array('score' => $total_score), $GLOBALS['user_info']['id'], "用户取消订单积分返还", 22); $GLOBALS['db']->query("update " . DB_PREFIX . "goods_order set order_status = 3 where id = " . $id); if ($GLOBALS['db']->affected_rows() == 0) { showErr('订单取消失败', 0, url("index", "uc_goods_order")); } else { showSuccess('订单取消成功', 0, url("index", "uc_goods_order")); } }
/** * 增加或修改时段 */ function timeUnitAdd() { $this->theme = 'bootstrap'; if ($_POST) { $id = $this->input->post('id'); $data = array('year' => (int) $this->input->post('year'), 'name' => $this->input->post('name'), 'orderNum' => (int) $this->input->post('orderNum'), 'startTime' => $this->input->post('startTime'), 'endTime' => $this->input->post('endTime'), 'weekNum' => (int) $this->input->post('weekNum'), 'timeSetting' => serialize(array())); $data['year'] || showError('请输入年份'); $data['year'] >= 2016 || showError('年份应大于或等于2016年'); $data['name'] || showError('请输入时段名称'); $data['orderNum'] || ($data['orderNum'] = 0); $data['startTime'] || showError('请选择时段开始时间'); $data['endTime'] || showError('请选择时段结束时间'); date('d', strtotime($data['startTime'])) == 1 || showError('开始时间非当月第一天'); //结束时间戳 $endTime = strtotime($data['endTime']); date('d', $endTime) == date('t', $endTime) || showError('结束时间非当月最后一天'); //周数 $data['weekNum'] > 0 || showError('双月周数必须大于0'); $weekList = $this->timeUnitModel->getWeekNumList($data['weekNum']); $data['weekList'] = serialize($weekList); if ($this->timeUnitModel->getData(array('year' => $data['year'], 'name' => $data['name'], 'id !=' => $id))) { showError('已存在同名时段'); } if ($id) { $timeId = $this->timeUnitModel->edit($id, $data); } else { $timeId = $this->timeUnitModel->add($data); } if ($timeId) { $this->timeUnitModel->createTimeUnitCache(); showSuccess('时段保存成功'); } else { showError('时段保存失败'); } } else { $id = (int) $this->input->get('id'); if ($id) { $this->viewData['timeUnitData'] = $this->timeUnitModel->getNewData($id); $this->viewData['timeUnitData'] || showError('数据不存在'); } $this->load->view('Admin/timeUnitAdd', $this->viewData); } }
public function dovote() { $ok = false; foreach ($_REQUEST['name'] as $vote_ask_id => $names) { foreach ($names as $kk => $name) { if ($name != '') { $ok = true; } } } if (!$ok) { showErr($GLOBALS['lang']['YOU_DONT_CHOICE']); } $vote_id = intval($_REQUEST['vote_id']); if (check_ipop_limit(get_client_ip(), "vote", 3600, $vote_id)) { foreach ($_REQUEST['name'] as $vote_ask_id => $names) { foreach ($names as $kk => $name) { $name = htmlspecialchars(addslashes(trim($name))); $result = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "vote_result where name = '" . $name . "' and vote_id = " . $vote_id . " and vote_ask_id = " . $vote_ask_id); $is_add = true; if ($result) { $GLOBALS['db']->query("update " . DB_PREFIX . "vote_result set count = count + 1 where name = '" . $name . "' and vote_id = " . $vote_id . " and vote_ask_id = " . $vote_ask_id); if (intval($GLOBALS['db']->affected_rows()) != 0) { $is_add = false; } } if ($is_add) { if ($name != '') { $result = array(); $result['name'] = $name; $result['vote_id'] = $vote_id; $result['vote_ask_id'] = $vote_ask_id; $result['count'] = 1; $GLOBALS['db']->autoExecute(DB_PREFIX . "vote_result", $result); } } } } showSuccess($GLOBALS['lang']['VOTE_SUCCESS']); } else { showErr($GLOBALS['lang']['YOU_VOTED']); } }
public function del() { $id = intval($_REQUEST['id']); $is_ajax = intval($_REQUEST['is_ajax']); $GLOBALS['db']->query("delete from " . DB_PREFIX . "user_contacter where id = " . $id . " and user_id = " . intval($GLOBALS['user_info']['id'])); if ($GLOBALS['db']->affected_rows()) { if ($is_ajax) { ajax_return(array("status" => 1, "html" => $html)); } else { showSuccess($GLOBALS['lang']['DELETE_SUCCESS']); } } else { if ($is_ajax) { ajax_return(array("status" => 0, "message" => $GLOBALS['lang']['INVALID_COLLECT'])); } else { showErr($GLOBALS['lang']['INVALID_COLLECT']); } } }
public function response($request) { $return_res = array('info' => '', 'status' => false); $payment_notice_sn = $BillNo = $request["BillNo"]; $Amount = $request["Amount"]; $Succeed = $request["Succeed"]; $MD5info = $request["MD5info"]; $Result = $request["Result"]; $payment_notice_id = $request['MerRemark']; /*获取支付信息*/ $payment = $GLOBALS['db']->getRow("select id,config from " . DB_PREFIX . "payment where class_name='Sqepay'"); $payment['config'] = unserialize($payment['config']); $MerNo = $payment['config']['merno']; $MD5key = $payment['config']['md5key']; /*比对连接加密字符串*/ $md5sign = $this->getSignature_return($MerNo, $BillNo, $Amount, $Succeed, $MD5key); if ($MD5info == $md5sign && $Succeed == "88") { require_once APP_ROOT_PATH . "system/libs/cart.php"; $rs = payment_paid($payment_notice_sn, $BillNo); showSuccess($rs['info'], 0, $rs['jump'], 1); } else { showErr("支付失败", 0, url("index"), 1); } }
function reback() { $id = intval($_REQUEST['id']); if ($id == 0) { showErr("借款不存在", 1); } $GLOBALS['db']->query("UPDATE " . DB_PREFIX . "deal SET is_delete=2 WHERE publish_wait=1 and is_effect=1 and is_delete=0 and id=" . $id); if ($GLOBALS['db']->affected_rows() > 0) { showSuccess("借款不存在", 1); } else { showError("撤销失败,请检测借款是否存在,或者是否已经审核通过", 1); } }
/** * 补报预算审核 */ function adminAudit() { if ($_POST) { $procId = (int) $this->input->post('procId'); $procId || showError('请选择要审核的双月数据'); $projectData = $this->input->post('project'); //项目 $audit = $this->input->post('audit'); //审核数据 if (!$projectData) { showError('您未选择审核项'); } if ($projectData) { $this->load->model('singleProjectModel'); foreach ($projectData as $k => $v) { $this->singleProjectModel->budgetOneKeyAudit((int) $k, (int) $v['budgetAuditRs'], $this->user); } } //插入审核日志 $this->load->model('auditLogModel'); $this->auditLogModel->addLog(13, array('targetId' => $procId, 'auditRole' => $this->user['userRole'], 'auditUid' => $this->user['userId'], 'auditRs' => 1, 'auditDes' => $audit['auditDes'] ? $audit['auditDes'] : '补报预算一键审核')); showSuccess('审核成功'); } else { $procId = (int) $this->input->get('procId'); $procId || showError('请选择要审核的双月数据'); //面包屑 $this->viewData['breadcrumb'][] = array('url' => printUrl('SingleBudgetAgain', 'adminList'), 'title' => '补报预算管理列表'); $this->viewData['breadcrumb'][] = array('url' => '', 'title' => '补报预算审核'); //主线流程数据 $this->load->model('singleProcessModel'); $procData = $this->singleProcessModel->getNewData(array('id' => $procId)); $procData || showError('双月数据不存在'); $this->viewData['procData'] = $procData; if (!$this->auth->isSingleBudgetAudit($procData, true)) { showError('您无权限审核'); } //专营店数据 $this->load->model('sellpointModel'); $this->viewData['storeData'] = $this->sellpointModel->getStoreIdData($procData['storeId']); //项目列表 $this->load->model('singleProjectModel'); $this->viewData['projectList'] = $this->singleProjectModel->getNewList(array('procId' => $procId, 'isBubao' => 1, 'budgetAuditRs !=' => -1), NULL, NULL, '', 'id desc'); //天网行动 $this->load->model('singleNetModel'); $this->viewData['netList'] = $this->singleNetModel->getNewList(array('procId' => $procId, 'isBubao' => 1, 'budgetAuditRs !=' => -1), NULL, NULL, '', 'id desc'); //审核日志 $this->load->model('auditLogModel'); $this->viewData['auditList'] = $this->auditLogModel->getLogs(11, $procId); //页面动作 $this->viewData['action'] = 'audit'; $this->load->view('SingleBudget/adminAudit', $this->viewData); } }
$donation = new Donation(); $donation->approveDonation($donation_id, $poc_id); showSuccess("Donation approved", array('donation_id' => $donation_id)); }); $api->request("/user/login", function () { global $QUERY; $user = new User(); $phone = i($QUERY, 'phone'); $password = i($QUERY, 'password'); if (!$user->login($phone, $password)) { showError($user->error, array('')); exit; } $return = array('user' => $user->user); $return['user']['roles'] = $user->getRoles(); showSuccess("Login successful", $return); }); $api->handle(); function showSuccess($message, $extra = array()) { showSituation('success', $message, $extra); } function showError($message, $extra = array()) { showSituation('error', $message, $extra); } function showSituation($status, $message, $extra) { $other_status = $status == 'success' ? 'error' : 'success'; $return = array($status => true, $other_status => false); if (is_string($message)) {
function replenishPatchCable() { if (commitModifyPatchCableAmount(genericAssertion('id', 'uint'), 1)) { showSuccess('replenished OK'); } else { showError('could not replenish'); } }
public function save() { global $_FANWE; if ($_FANWE['uid'] == 0) { exit; } include_once fimport('class/image'); $image = new Image(); if (intval($_FANWE['setting']['max_upload']) > 0) { $image->max_size = intval($_FANWE['setting']['max_upload']); } $daren = array(); $daren['uid'] = $_FANWE['uid']; $daren['reason'] = $_FANWE['request']['reason']; $daren['status'] = 0; $daren['create_time'] = TIME_UTC; //个人街拍照 $img = $_FILES['img']; if (!empty($img)) { $image->init($img, 'daren'); if ($image->save()) { $daren['img'] = $image->file['target']; } } $index_img = $_FILES['index_img']; if (!empty($index_img)) { $image->init($index_img, 'daren'); if ($image->save()) { $daren['index_img'] = $image->file['target']; } } $id = FDB::insert('user_daren', $daren, true, false, true); if ($id > 0) { showSuccess('提交申请成功', '你的达人申请已经成功提交,我们会尽快处理你的达人申请!', FU('daren/index')); } else { showError('提交申请失败', '你的达人申请提交失败,请重新提交达人申请', -1); } }
public function check() { $ajax = intval($_REQUEST['ajax']); if (!$GLOBALS['user_info']) { showErr("", $ajax, url("user#login")); } $id = intval($_REQUEST['id']); $deal_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_item where id = " . $id); if (!$deal_item) { showErr("", $ajax, url("index")); } elseif ($deal_item['support_count'] >= $deal_item['limit_user'] && $deal_item['limit_user'] != 0) { showErr("", $ajax, url("deal#show", array("id" => $deal_item['deal_id']))); } $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where is_delete = 0 and is_effect = 1 and id = " . $deal_item['deal_id']); if (!$deal_info) { showErr("", $ajax, url("index")); } elseif ($deal_info['begin_time'] > NOW_TIME || $deal_info['end_time'] < NOW_TIME && $deal_info['end_time'] != 0) { showErr("", $ajax, url("deal#show", array("id" => $deal_item['deal_id']))); } if ($deal_item['is_delivery'] == 1) { $consignee_id = intval($_REQUEST['consignee_id']); if ($consignee_id == 0) { $consignee_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user_consignee where user_id = " . intval($GLOBALS['user_info']['id'])); if ($consignee_list) { showErr("请选择配送方式", $ajax); } else { $consignee = strim($_REQUEST['consignee']); $province = strim($_REQUEST['province']); $city = strim($_REQUEST['city']); $address = strim($_REQUEST['address']); $zip = strim($_REQUEST['zip']); $mobile = strim($_REQUEST['mobile']); if ($consignee == "") { showErr("请填写收货人姓名", $ajax, ""); } if ($province == "") { showErr("请选择省份", $ajax, ""); } if ($city == "") { showErr("请选择城市", $ajax, ""); } if ($address == "") { showErr("请填写详细地址", $ajax, ""); } if ($mobile == "") { showErr("请填写收货人手机号码", $ajax, ""); } if (!check_mobile($mobile)) { showErr("请填写正确的手机号码", $ajax, ""); } $data = array(); $data['consignee'] = $consignee; $data['province'] = $province; $data['city'] = $city; $data['address'] = $address; $data['zip'] = $zip; $data['mobile'] = $mobile; $data['user_id'] = intval($GLOBALS['user_info']['id']); $GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $data); $consignee_id = $GLOBALS['db']->insert_id(); } } } if (intval($consignee_id) == 0 && $deal_item['is_delivery'] == 1) { showErr("请选择配送方式", $ajax, ""); } else { $memo = strim($_REQUEST['memo']); if ($memo != "" && $memo != "在此填写关于回报内容的具体选择或者任何你想告诉项目发起人的话") { es_session::set("cart_memo_" . intval($id), $memo); } if ($deal_item['is_delivery'] == 0) { showSuccess("", $ajax, url("cart#pay", array("id" => $id))); } else { showSuccess("", $ajax, url("cart#pay", array("id" => $id, "did" => $consignee_id))); } } }
public function dosend() { define("ACTION_NAME", "dosend"); if (intval($GLOBALS['fanwe']->var['uid']) == 0) { fHeader("location: " . FU('user/login')); } global $_FANWE; $uid = intval($_REQUEST['uid']); $sql = "select u.uid,u.user_name from " . FDB::table("user") . " as u left join " . FDB::table("user_follow") . " as f on f.f_uid = u.uid where u.uid = " . $uid . " and f.uid = " . intval($GLOBALS['fanwe']->var['uid']); $user = FDB::fetchFirst($sql); if ($user) { $msg['title'] = addslashes(htmlspecialchars(trim($_POST['message_title']))); $msg['content'] = addslashes(htmlspecialchars(trim($_POST['message_content']))); $msg['author_id'] = intval($GLOBALS['fanwe']->var['uid']); $msg['create_time'] = fGmtTime(); $msg['status'] = 1; if ($msg['title'] == '') { showError("标题不能为空"); } if ($msg['content'] == '') { showError("内容不能为空"); } $mid = FDB::insert("user_msg", $msg, true); if ($mid > 0) { $rel_data['mid'] = $mid; $rel_data['uid'] = $user['uid']; FDB::insert("user_msg_rel", $rel_data, true); showSuccess("成功发送", "成功发送"); } } else { showError("只能给fans发私信", "只能给fans发私信"); } }