本文整理汇总了PHP中chksubmit函数的典型用法代码示例。如果您正苦于以下问题:PHP chksubmit函数的具体用法?PHP chksubmit怎么用?PHP chksubmit使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了chksubmit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pic_cutOp
/**
* 图片裁剪
*
*/
public function pic_cutOp()
{
import('function.thumb');
if (chksubmit()) {
$thumb_width = $_POST['x'];
$x1 = $_POST["x1"];
$y1 = $_POST["y1"];
$x2 = $_POST["x2"];
$y2 = $_POST["y2"];
$w = $_POST["w"];
$h = $_POST["h"];
$scale = $thumb_width / $w;
$src = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_POST['url']);
$save_file2 = str_replace('_small.', '_sm.', $src);
$cropped = resize_thumb($save_file2, $src, $w, $h, $x1, $y1, $scale);
@unlink($src);
$pathinfo = pathinfo($save_file2);
exit($pathinfo['basename']);
} else {
Language::read('cut');
$lang = Language::getLangContent();
}
$save_file = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_GET['url']);
$_GET['x'] = intval($_GET['x']) > 50 && $_GET['x'] < 400 ? $_GET['x'] : 200;
$_GET['y'] = intval($_GET['y']) > 50 && $_GET['y'] < 400 ? $_GET['y'] : 200;
$_GET['resize'] = $_GET['resize'] == '0' ? '0' : '1';
Tpl::output('height', get_height($save_file));
Tpl::output('width', get_width($save_file));
Tpl::showpage('cut', 'null_layout');
}
示例2: save_specOp
/**
* 保存规格值
*/
public function save_specOp()
{
$sp_id = intval($_POST['sp_id']);
$gc_id = intval($_POST['gc_id']);
if ($sp_id <= 0 || $gc_id <= 0 || !chksubmit()) {
showDialog(L('wrong_argument'));
}
$model_spec = Model('spec');
// 更新原规格值
if (is_array($_POST['sv']['old'])) {
foreach ($_POST['sv']['old'] as $key => $value) {
if (empty($value['name'])) {
continue;
}
$where = array('sp_value_id' => $key);
$update = array('sp_value_name' => $value['name'], 'sp_id' => $sp_id, 'gc_id' => $gc_id, 'store_id' => $_SESSION['store_id'], 'sp_value_color' => $value['color'], 'sp_value_sort' => intval($value['sort']));
$model_spec->editSpecValue($update, $where);
}
}
// 添加新规格值
if (is_array($_POST['sv']['new'])) {
$insert_array = array();
foreach ($_POST['sv']['new'] as $value) {
if (empty($value['name'])) {
continue;
}
$tmp_insert = array('sp_value_name' => $value['name'], 'sp_id' => $sp_id, 'gc_id' => $gc_id, 'store_id' => $_SESSION['store_id'], 'sp_value_color' => $value['color'], 'sp_value_sort' => intval($value['sort']));
$insert_array[] = $tmp_insert;
}
$model_spec->addSpecValueALL($insert_array);
}
showDialog(L('nc_common_op_succ'), 'reload', 'succ');
}
示例3: addOp
/**
* 充值添加
*/
public function addOp(){
if (!chksubmit()){
//信息输出
Tpl::output('menu_sign','predepositrecharge');
Tpl::output('menu_sign_url','index.php?act=predeposit');
Tpl::output('menu_sign1','predeposit_rechargeadd');
Tpl::showpage('charge_pd.add');
exit();
}
$pdr_amount = abs(floatval($_POST['pdr_amount']));
if ($pdr_amount <= 0) {
showMessage(Language::get('predeposit_recharge_add_pricemin_error'),'','html','error');
}
$model_pdr = Model('predeposit');
$data = array();
$data['pdr_sn'] = $pay_sn = $model_pdr->makeSn();
$data['pdr_member_id'] = $_SESSION['member_id'];
$data['pdr_member_name'] = $_SESSION['member_name'];
$data['pdr_amount'] = $pdr_amount;
$data['pdr_add_time'] = TIMESTAMP;
$insert = $model_pdr->addPdRecharge($data);
if ($insert) {
//转向到商城支付页面
redirect('index.php?act=buy&op=pd_pay&pay_sn='.$pay_sn);
}
}
示例4: save_mallconsultOp
/**
* 保存平台咨询
*/
public function save_mallconsultOp() {
if (!chksubmit()) {
showDialog(L('wrong_argument'), 'reload');
}
//验证表单信息
$obj_validate = new Validate();
$obj_validate->validateparam = array(
array("input"=>$_POST["type_id"],"require"=>"true","validator"=>"Number","message"=>"请选择咨询类型"),
array("input"=>$_POST["consult_content"],"require"=>"true","message"=>"请填写咨询内容")
);
$error = $obj_validate->validate();
if ($error != ''){
showDialog($error);
}
$insert = array();
$insert['mct_id'] = $_POST['type_id'];
$insert['member_id'] = $_SESSION['member_id'];
$insert['member_name'] = $_SESSION['member_name'];
$insert['mc_content'] = $_POST['consult_content'];
$result = Model('mall_consult')->addMallConsult($insert);
if ($result) {
showDialog(L('nc_common_op_succ'), 'reload', 'succ');
} else {
showDialog(L('nc_common_op_fail'), 'reload');
}
}
示例5: modifypwOp
/**
* 修改密码
*/
public function modifypwOp()
{
if (chksubmit()) {
if (trim($_POST['new_pw']) !== trim($_POST['new_pw2'])) {
//showMessage('两次输入的密码不一致,请重新输入');
showMessage(Language::get('index_modifypw_repeat_error'));
}
$admininfo = $this->getAdminInfo();
//查询管理员信息
$admin_model = Model('admin');
$admininfo = $admin_model->getOneAdmin($admininfo['id']);
if (!is_array($admininfo) || count($admininfo) <= 0) {
showMessage(Language::get('index_modifypw_admin_error'));
}
//旧密码是否正确
if ($admininfo['admin_password'] != md5(trim($_POST['old_pw']))) {
showMessage(Language::get('index_modifypw_oldpw_error'));
}
$new_pw = md5(trim($_POST['new_pw']));
$result = $admin_model->updateAdmin(array('admin_password' => $new_pw, 'admin_id' => $admininfo['admin_id']));
if ($result) {
showMessage(Language::get('index_modifypw_success'));
} else {
showMessage(Language::get('index_modifypw_fail'));
}
} else {
Language::read('admin');
Tpl::showpage('admin.modifypw');
}
}
示例6: store_class_editOp
/**
* 编辑
*/
public function store_class_editOp()
{
$lang = Language::getLangContent();
$model_class = Model('store_class');
if (chksubmit()) {
//验证
$obj_validate = new Validate();
$obj_validate->validateparam = array(array("input" => $_POST["sc_name"], "require" => "true", "message" => $lang['store_class_name_no_null']));
$error = $obj_validate->validate();
if ($error != '') {
showMessage($error);
} else {
$update_array = array();
$update_array['sc_name'] = $_POST['sc_name'];
$update_array['sc_bail'] = intval($_POST['sc_bail']);
$update_array['sc_sort'] = intval($_POST['sc_sort']);
$result = $model_class->editStoreClass($update_array, array('sc_id' => intval($_POST['sc_id'])));
if ($result) {
$this->log(L('nc_edit,store_class') . '[' . $_POST['sc_name'] . ']', 1);
showMessage($lang['nc_common_save_succ'], 'index.php?act=store_class&op=store_class');
} else {
showMessage($lang['nc_common_save_fail']);
}
}
}
$class_array = $model_class->getStoreClassInfo(array('sc_id' => intval($_GET['sc_id'])));
if (empty($class_array)) {
showMessage($lang['illegal_parameter']);
}
Tpl::output('class_array', $class_array);
Tpl::showpage('store_class.edit');
}
示例7: mb_appOp
/**
* 设置下载地址
*
*/
public function mb_appOp()
{
$model_setting = Model('setting');
$mobile_apk = $model_setting->getRowSetting('mobile_apk');
$mobile_content = $model_setting->getRowSetting('mobile_content');
$mobile_apk_version = $model_setting->getRowSetting('mobile_apk_version');
$mobile_ios = $model_setting->getRowSetting('mobile_ios');
if (chksubmit()) {
$update_array = array();
$update_array['mobile_apk'] = $_POST['mobile_apk'];
$update_array['mobile_apk_version'] = intval($_POST['mobile_apk_version']);
$update_array['mobile_content'] = $_POST['mobile_content'];
$update_array['mobile_ios'] = $_POST['mobile_ios'];
$state = $model_setting->updateSetting($update_array);
if ($state) {
$this->log('设置手机端下载地址');
showMessage(Language::get('nc_common_save_succ'), 'index.php?act=mb_app&op=mb_app');
} else {
showMessage(Language::get('nc_common_save_fail'));
}
}
Tpl::output('mobile_apk', $mobile_apk);
Tpl::output('mobile_version', $mobile_apk_version);
Tpl::output('mobile_ios', $mobile_ios);
Tpl::output('mobile_content', $mobile_content);
Tpl::showpage('mb_app.edit');
}
示例8: editOp
/**
* 编辑
*/
public function editOp()
{
$model_payment = Model('payment');
if (chksubmit()) {
$payment_id = intval($_POST["payment_id"]);
$data = array();
$data['payment_state'] = intval($_POST["payment_state"]);
$payment_config = '';
$config_array = explode(',', $_POST["config_name"]);
//配置参数
if (is_array($config_array) && !empty($config_array)) {
$config_info = array();
foreach ($config_array as $k) {
$config_info[$k] = trim($_POST[$k]);
}
$payment_config = serialize($config_info);
}
$data['payment_config'] = $payment_config;
//支付接口配置信息
$model_payment->editPayment($data, array('payment_id' => $payment_id));
showMessage(Language::get('nc_common_save_succ'), 'index.php?act=payment&op=index');
}
$payment_id = intval($_GET["payment_id"]);
$payment = $model_payment->getPaymentInfo(array('payment_id' => $payment_id));
if ($payment['payment_config'] != '') {
Tpl::output('config_array', unserialize($payment['payment_config']));
}
Tpl::output('payment', $payment);
Tpl::showpage('payment.edit');
}
示例9: pic_listOp
/**
* 图片列表
*/
public function pic_listOp()
{
$model = Model();
// 删除图片
if (chksubmit()) {
$where = array('ap_id' => array('in', $_POST['id']));
$ap_list = $model->table('sns_albumpic')->where($where)->select();
if (empty($ap_list)) {
showMessage(Language::get('snsalbum_choose_need_del_img'));
}
foreach ($ap_list as $val) {
@unlink(BASE_UPLOAD_PATH . DS . ATTACH_MALBUM . DS . $val['member_id'] . DS . $val['ap_cover']);
@unlink(BASE_UPLOAD_PATH . DS . ATTACH_MALBUM . DS . $val['member_id'] . DS . str_ireplace('.', '_240.', $val['ap_cover']));
@unlink(BASE_UPLOAD_PATH . DS . ATTACH_MALBUM . DS . $val['member_id'] . DS . str_ireplace('.', '_1280.', $val['ap_cover']));
}
$model->table('sns_albumpic')->where($where)->delete();
$this->log(L('nc_del,nc_member_album_manage') . '[ID:' . implode(',', $_POST['id']) . ']', 1);
showMessage(Language::get('nc_common_del_succ'));
}
$id = intval($_GET['id']);
if ($id <= 0) {
showMessage(Language::get('param_error'));
}
$where = array();
$where['ac_id'] = $id;
if ($_GET['pic_name'] != '') {
$where['ap_name|ap_cover'] = array('like', '%' . $_GET['pic_name'] . '%');
}
$pic_list = $model->table('sns_albumpic')->where($where)->page(33)->select();
Tpl::output('id', $id);
Tpl::output('showpage', $model->showpage(2));
Tpl::output('pic_list', $pic_list);
Tpl::showpage('sns_malbum.piclist');
}
示例10: pic_cutOp
/**
* 图片裁剪
*
*/
public function pic_cutOp()
{
Language::read('admin_common');
$lang = Language::getLangContent();
import('function.thumb');
if (chksubmit()) {
$thumb_width = $_POST['x'];
$x1 = $_POST["x1"];
$y1 = $_POST["y1"];
$x2 = $_POST["x2"];
$y2 = $_POST["y2"];
$w = $_POST["w"];
$h = $_POST["h"];
$scale = $thumb_width / $w;
$src = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_POST['url']);
if (strpos($src, '..') !== false || strpos($src, BASE_UPLOAD_PATH) !== 0) {
exit;
}
if (!empty($_POST['filename'])) {
// $save_file2 = BASE_UPLOAD_PATH.'/'.$_POST['filename'];
$save_file2 = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_POST['filename']);
} else {
$save_file2 = str_replace('_small.', '_sm.', $src);
}
$cropped = resize_thumb($save_file2, $src, $w, $h, $x1, $y1, $scale);
@unlink($src);
$pathinfo = pathinfo($save_file2);
exit($pathinfo['basename']);
}
$save_file = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_GET['url']);
$_GET['resize'] = $_GET['resize'] == '0' ? '0' : '1';
Tpl::output('height', get_height($save_file));
Tpl::output('width', get_width($save_file));
Tpl::showpage('common.pic_cut', 'null_layout');
}
示例11: editOp
/**
* 退货处理页
*
*/
public function editOp()
{
$model_refund = Model('refund_return');
$condition = array();
$condition['refund_id'] = intval($_GET['return_id']);
$return_list = $model_refund->getReturnList($condition);
$return = $return_list[0];
if (chksubmit()) {
if ($return['refund_state'] != '2') {
//检查状态,防止页面刷新不及时造成数据错误
showMessage(Language::get('nc_common_save_fail'));
}
$order_id = $return['order_id'];
$refund_array = array();
$refund_array['admin_time'] = time();
$refund_array['refund_state'] = '3';
//状态:1为处理中,2为待管理员处理,3为已完成
$refund_array['admin_message'] = $_POST['admin_message'];
$state = $model_refund->editOrderRefund($return);
if ($state) {
$model_refund->editRefundReturn($condition, $refund_array);
$this->log('退货确认,退货编号' . $return['refund_sn']);
showMessage(Language::get('nc_common_save_succ'), 'index.php?act=return&op=return_manage');
} else {
showMessage(Language::get('nc_common_save_fail'));
}
}
Tpl::output('return', $return);
Tpl::showpage('return.edit');
}
示例12: store_liveOp
public function store_liveOp()
{
if (chksubmit()) {
//编辑商户信息
$params = array();
//参数
$params['store_vrcode_prefix'] = preg_match('/^[a-zA-Z0-9]{1,3}$/', $_POST['store_vrcode_prefix']) ? $_POST['store_vrcode_prefix'] : null;
$params['live_store_name'] = $_POST['live_store_name'];
$params['live_store_address'] = $_POST['live_store_address'];
$params['live_store_tel'] = $_POST['live_store_tel'];
$params['live_store_bus'] = $_POST['live_store_bus'];
$model_store = Model('store');
$res = $model_store->editStore($params, array('store_id' => $_SESSION['store_id']));
if ($res) {
showMessage('编辑成功', '', '', 'succ');
} else {
showMessage('编辑失败', '', '', 'error');
}
}
$model_store = Model('store');
$store = $model_store->getStoreInfo(array('store_id' => $_SESSION['store_id']));
if (empty($store)) {
showMessage('该商家不存在');
}
Tpl::output('store', $store);
$this->profile_menu('store_live');
Tpl::showpage('store_liveinfo');
}
示例13: save_deliveryOp
/**
* 保存申请
*/
public function save_deliveryOp()
{
if (!chksubmit()) {
showDialog(L('wrong_argument'));
}
$insert = array();
$insert['dlyp_name'] = $_POST['dname'];
$insert['dlyp_passwd'] = md5($_POST['dpasswd']);
$insert['dlyp_truename'] = $_POST['dtruename'];
$insert['dlyp_mobile'] = $_POST['dmobile'];
$insert['dlyp_telephony'] = $_POST['dtelephony'];
$insert['dlyp_address_name'] = $_POST['daddressname'];
$insert['dlyp_area_2'] = $_POST['area_id_2'];
$insert['dlyp_area_3'] = $_POST['area_id'];
$insert['dlyp_area_info'] = $_POST['area_info'];
$insert['dlyp_address'] = $_POST['daddress'];
$insert['dlyp_idcard'] = $_POST['didcard'];
$insert['dlyp_addtime'] = TIMESTAMP;
$insert['dlyp_state'] = 10;
$upload = new UploadFile();
$upload->set('default_dir', ATTACH_DELIVERY);
$result = $upload->upfile('didcardimg');
if (!$result) {
showDialog($upload->error);
}
$insert['dlyp_idcard_image'] = $upload->file_name;
$result = Model('delivery_point')->addDeliveryPoint($insert);
if ($result) {
showDialog('操作成功,等待管理员审核', 'index.php?act=login', 'succ');
} else {
showDialog(L('nc_common_op_fail'));
}
}
示例14: expsettingOp
/**
* 设置经验值获取规则
*/
public function expsettingOp()
{
$model_setting = Model('setting');
if (chksubmit()) {
$exp_arr = array();
$exp_arr['exp_login'] = intval($_POST['exp_login']) ? $_POST['exp_login'] : 0;
$exp_arr['exp_comments'] = intval($_POST['exp_comments']) ? $_POST['exp_comments'] : 0;
$exp_arr['exp_orderrate'] = intval($_POST['exp_orderrate']) ? $_POST['exp_orderrate'] : 0;
$exp_arr['exp_ordermax'] = intval($_POST['exp_ordermax']) ? $_POST['exp_ordermax'] : 0;
$exp_arr['circle_exprelease'] = intval($_POST['c_exprelease']) ? $_POST['c_exprelease'] : 0;
$exp_arr['circle_expreply'] = intval($_POST['c_expreply']) ? $_POST['c_expreply'] : 0;
$exp_arr['circle_expreleasemax'] = intval($_POST['c_expreleasemax']) ? $_POST['c_expreleasemax'] : 0;
$exp_arr['circle_expreplied'] = intval($_POST['c_expreplied']) ? $_POST['c_expreplied'] : 0;
$exp_arr['circle_exprepliedmax'] = intval($_POST['c_exprepliedmax']) ? $_POST['c_exprepliedmax'] : 0;
$result = $model_setting->updateSetting(array('exppoints_rule' => serialize($exp_arr)));
if ($result === true) {
$this->log(L('nc_edit,nc_exppoints_manage,nc_exppoints_setting'), 1);
showMessage(L('nc_common_save_succ'));
} else {
showMessage(L('nc_common_save_fail'));
}
}
$list_setting = $model_setting->getListSetting();
$list_setting['exppoints_rule'] = $list_setting['exppoints_rule'] ? unserialize($list_setting['exppoints_rule']) : array();
Tpl::output('list_setting', $list_setting);
Tpl::showpage('exppoints.setting');
}
示例15: add_refundOp
/**
* 添加兑换码退款
*
*/
public function add_refundOp()
{
$model_vr_refund = Model('vr_refund');
$order_id = intval($_GET['order_id']);
if ($order_id < 1) {
//参数验证
showDialog(Language::get('wrong_argument'), 'index.php?act=member_vr_refund&op=index', 'error');
}
$condition = array();
$condition['buyer_id'] = $_SESSION['member_id'];
$condition['order_id'] = $order_id;
$order = $model_vr_refund->getRightOrderList($condition);
$order_id = $order['order_id'];
if (!$order['if_refund']) {
//检查状态,防止页面刷新不及时造成数据错误
showDialog(Language::get('wrong_argument'), 'index.php?act=member_vr_order&op=index', 'error');
}
if (chksubmit() && $order['if_refund']) {
$code_list = $order['code_list'];
$refund_array = array();
$goods_num = 0;
//兑换码数量
$refund_amount = 0;
//退款金额
$code_sn = '';
$rec_id_array = $_POST['rec_id'];
if (!empty($rec_id_array) && is_array($rec_id_array)) {
//选择退款的兑换码
foreach ($rec_id_array as $key => $value) {
$code = $code_list[$value];
if (!empty($code)) {
$goods_num += 1;
$refund_amount += $code['pay_price'];
//实际支付金额
$code_sn .= $code['vr_code'] . ',';
//兑换码编号
}
}
}
if ($goods_num < 1) {
showDialog(Language::get('wrong_argument'), 'reload', 'error');
}
$refund_array['code_sn'] = rtrim($code_sn, ',');
$refund_array['admin_state'] = '1';
//状态:1为待审核,2为同意,3为不同意
$refund_array['refund_amount'] = ncPriceFormat($refund_amount);
$refund_array['goods_num'] = $goods_num;
$refund_array['buyer_message'] = $_POST['buyer_message'];
$refund_array['add_time'] = time();
$state = $model_vr_refund->addRefund($refund_array, $order);
if ($state) {
showDialog(Language::get('nc_common_save_succ'), 'index.php?act=member_vr_refund&op=index', 'succ');
} else {
showDialog(Language::get('nc_common_save_fail'), 'reload', 'error');
}
}
Tpl::showpage('member_vr_refund_add');
}