本文整理汇总了PHP中checksubmit函数的典型用法代码示例。如果您正苦于以下问题:PHP checksubmit函数的具体用法?PHP checksubmit怎么用?PHP checksubmit使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checksubmit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doWebSetting
public function doWebSetting()
{
global $_W, $_GPC;
checklogin();
load()->func('tpl');
$item = pdo_fetch("SELECT * FROM " . tablename($this->modulename . '_setting') . " WHERE weid = :weid", array(':weid' => $_W['uniacid']));
if (!empty($item)) {
if (!empty($item['share_image'])) {
$share_image = tomedia($item['share_image']);
}
}
if (checksubmit('submit')) {
$data = array('weid' => $_W['weid'], 'share_title' => trim($_GPC['share_title']), 'share_desc' => trim($_GPC['share_desc']), 'share_cancel' => trim($_GPC['share_cancel']), 'share_url' => trim($_GPC['share_url']), 'follow_url' => trim($_GPC['follow_url']));
if (!empty($_GPC['share_image'])) {
$data['share_image'] = $_GPC['share_image'];
load()->func('file');
file_delete($_GPC['share_image-old']);
}
if (!empty($item)) {
pdo_update($this->modulename . '_setting', $data, array('weid' => $_W['uniacid']));
} else {
pdo_insert($this->modulename . '_setting', $data);
}
message('更新成功!', $this->createWebUrl('setting'), 'success');
}
include $this->template('setting');
}
示例2: settingsDisplay
public function settingsDisplay($settings)
{
global $_GPC, $_W;
if (checksubmit()) {
$cfg = array('tablenum' => intval($_GPC['tablenum']), 'start_time' => $_GPC['start_time'], 'end_time' => $_GPC['end_time']);
$start_time = $cfg['start_time'];
$start_time = strtotime($start_time);
$end_time = $cfg['end_time'];
$end_time = strtotime($end_time);
if ($start_time >= $end_time) {
message('开始时间不得晚于结束时间', 'refresh', 'error');
} elseif ($this->saveSettings($cfg)) {
message('保存成功', 'refresh');
}
}
if (!isset($settings['tablenum'])) {
$settings['tablenum'] = '50';
}
if (!isset($settings['start_time'])) {
$settings['start_time'] = '2014-02-14 17:21';
}
if (!isset($settings['end_time'])) {
$settings['end_time'] = '2014-02-15 00:00';
}
include $this->template('setting');
}
示例3: index
public function index()
{
global $_W, $_GPC;
$set = $this->getSet();
if (checksubmit('submit')) {
$set['user'] = is_array($_GPC['user']) ? $_GPC['user'] : array();
$this->updateSet($set);
if (!empty($set['user']['upload'])) {
$ret = $this->check($set['user']);
if (empty($ret)) {
message('配置有误,请仔细检查参数设置!', '', 'error');
}
}
message('设置保存成功!', referer(), 'success');
}
if (checksubmit('submit_admin')) {
$set['admin'] = is_array($_GPC['admin']) ? $_GPC['admin'] : array();
$this->updateSet($set);
if (!empty($set['admin']['upload'])) {
$ret = $this->check($set['admin']);
if (empty($ret)) {
message('配置有误,请仔细检查参数设置!', '', 'error');
}
}
message('设置保存成功!', referer(), 'success');
}
include $this->template('set');
}
示例4: doWebRouteradd
public function doWebRouteradd()
{
global $_GPC, $_W;
$id = $_GPC['id'];
$weid = $_W['weid'];
if (!empty($id)) {
$item = pdo_fetch("SELECT * FROM " . tablename($this->routertable) . " WHERE weid=:weid and id=:id", array(':weid' => $weid, ':id' => $id));
if (empty($item)) {
message('抱歉,您编辑的路由器信息不存在或已删除');
}
}
if (checksubmit('submit')) {
if (empty($_GPC['rname'])) {
message('请输入路由器名称!');
}
$data = array('rname' => $_GPC['rname'], 'weid' => $_W['weid'], 'iurl' => $_GPC['iurl'], 'appid' => $_GPC['appid'], 'appkey' => $_GPC['appkey'], 'nodeid' => $_GPC['nodeid'], 'status' => $_GPC['status']);
if (empty($id)) {
pdo_insert($this->routertable, $data);
} else {
pdo_update($this->routertable, $data, array('id' => $id));
}
message('路由器信息更新成功!', $this->createWebUrl('routerlist'), 'success');
}
include $this->template('routeradd');
}
示例5: doWebAwardlist
public function doWebAwardlist()
{
global $_GPC, $_W;
$id = intval($_GPC['id']);
if (checksubmit('delete')) {
pdo_delete('zzz_user', " id IN ('" . implode("','", $_GPC['select']) . "')");
message('删除成功!', $this->createWebUrl('awardlist', array('id' => $id, 'page' => $_GPC['page'])));
}
if (!empty($_GPC['wid'])) {
$wid = intval($_GPC['wid']);
pdo_update('zzz_user', array('status' => intval($_GPC['status'])), array('id' => $wid));
message('标识领奖成功!', $this->createWebUrl('awardlist', array('id' => $id, 'page' => $_GPC['page'])));
}
$pindex = max(1, intval($_GPC['page']));
$psize = 50;
$where = '';
$condition = array('mobile' => " AND `b`.`mobile` LIKE '%" . $_GPC['profilevalue'] . "%'", 'realname' => " AND `b`.`realname` LIKE '%" . $_GPC['profilevalue'] . "%'", 'nickname' => " AND `b`.`nickname` LIKE '%" . $_GPC['profilevalue'] . "%'");
if (!empty($_GPC['profile'])) {
$where .= $condition[$_GPC['profile']];
}
$sql = 'SELECT `a`.`id`, `a`.`friendcount`, `a`.`points`, `a`.`createtime`, `b`.`realname`, `b`.`nickname`, `b`.`mobile` FROM ' . tablename('zzz_user') . ' AS `a` LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS `f` ON `f`.`fanid` = `a`.`fanid` LEFT
JOIN ' . tablename('mc_members') . " AS `b` ON `b`.`uid` = `f`.`uid` WHERE `a`.`rid` = :rid {$where} ORDER BY `a`.`points`\n DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize;
$params = array(':rid' => $id);
$list = pdo_fetchall($sql, $params);
if (!empty($list)) {
$sql = 'SELECT COUNT(*) FROM ' . tablename('zzz_user') . ' AS `a` LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS `f` ON `f`.`fanid` =
`a`.`fanid` LEFT JOIN ' . tablename('mc_members') . ' AS `b` ON `b`.`uid` = `f`.`uid` WHERE `a`.`rid` = :rid' . $where;
$total = pdo_fetchcolumn($sql, $params);
$pager = pagination($total, $pindex, $psize);
}
include $this->template('awardlist');
}
示例6: doWebList
public function doWebList()
{
global $_GPC, $_W;
checklogin();
$weid = $_W['account']['weid'];
//当前公众号ID
$id = intval($_GPC['id']);
$condition = '';
if (!empty($_GPC['name'])) {
$condition .= " AND ( grabername LIKE '%{$_GPC['realname']}%' OR fitername LIKE '%{$_GPC['realname']}%' )";
}
if (!empty($_GPC['mobile'])) {
$condition .= " AND ( grabermobile = '{$_GPC['mobile']}' OR fitermobile = '{$_GPC['mobile']}' )";
}
if (checksubmit('delete')) {
pdo_delete('grabseat_record', " id IN ('" . implode("','", $_GPC['select']) . "')");
message('删除成功!', $this->createWebUrl('list', array('id' => $id, 'page' => $_GPC['page'])));
}
if (!empty($_GPC['wid'])) {
$wid = intval($_GPC['wid']);
pdo_update('grabseat_record', array('status' => intval($_GPC['status'])), array('id' => $wid));
message('标识领奖成功!', $this->createWebUrl('list', array('id' => $id, 'page' => $_GPC['page'])));
}
$pindex = max(1, intval($_GPC['page']));
$psize = 25;
$list = pdo_fetchall("SELECT * FROM " . tablename('grabseat_record') . " WHERE weid = '{$_W['weid']}' {$condition} ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
$listtotal = pdo_fetchall("SELECT * FROM " . tablename('grabseat_record') . " WHERE weid = '{$_W['weid']}' {$condition} ");
$total = count($listtotal);
$pager = pagination($total, $pindex, $psize);
include $this->template('list');
}
示例7: settingsDisplay
public function settingsDisplay($settings)
{
global $_W, $_GPC;
load()->func('tpl');
$config = $this->module['config'];
if (empty($config['hlogo'])) {
$config['hlogo'] = MODULE_URL . 'template/style/img/logo.png';
}
if (empty($config['flogo'])) {
$config['flogo'] = MODULE_URL . 'template/style/img/un-logo.png';
}
if (empty($config['target'])) {
$config['target'] = MODULE_URL . 'template/style/img/husky.png';
}
if (checksubmit()) {
$dat = $_GPC['dat'];
$dat['hlogo'] = $_GPC['hlogo'];
$dat['flogo'] = $_GPC['flogo'];
$dat['target'] = $_GPC['target'];
$this->saveSettings($dat);
message('设置成功..', referer(), 'success');
}
//这里来展示设置项表单
include $this->template('setting');
}
示例8: dolist
public function dolist()
{
global $_GPC, $_W;
checklogin();
$weid = intval($_W['weid']);
if (checksubmit('verify') && !empty($_GPC['select'])) {
pdo_update('message_list', array('isshow' => 1, 'create_time' => TIMESTAMP), " id IN ('" . implode("','", $_GPC['select']) . "')");
message('审核成功!', create_url('site/module', array('do' => 'list', 'name' => 'message', 'weid' => $weid, 'page' => $_GPC['page'])));
}
if (checksubmit('delete') && !empty($_GPC['select'])) {
pdo_delete('message_list', " id IN ('" . implode("','", $_GPC['select']) . "')");
message('删除成功!', create_url('site/module', array('do' => 'list', 'name' => 'message', 'weid' => $weid, 'page' => $_GPC['page'])));
}
$isshow = isset($_GPC['isshow']) ? intval($_GPC['isshow']) : 0;
$pindex = max(1, intval($_GPC['page']));
$psize = 20;
$message = pdo_fetch("SELECT id, isshow, weid FROM " . tablename('message_reply') . " WHERE weid = '{$weid}' LIMIT 1");
$list = pdo_fetchall("SELECT * FROM " . tablename('message_list') . " WHERE weid = '{$message['weid']}' AND isshow = '{$isshow}' ORDER BY create_time DESC LIMIT " . ($pindex - 1) * $psize . ",{$psize}");
if (!empty($list)) {
$total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('message_list') . " WHERE weid = '{$message['weid']}' AND isshow = '{$isshow}'");
$pager = pagination($total, $pindex, $psize);
foreach ($list as &$row) {
$row['content'] = emotion($row['content']);
$userids[] = $row['from_user'];
}
unset($row);
}
include $this->template('list');
}
示例9: doWebAdd
public function doWebAdd()
{
global $_GPC, $_W;
$id = intval($_GPC['id']);
if (!empty($id)) {
$item = pdo_fetch("SELECT * FROM " . tablename($this->headtable) . " WHERE id = :id", array(':id' => $id));
if (empty($item)) {
message('抱歉,喜帖不存在或是已经删除!', '', 'error');
}
$hslists = unserialize($item['hs_pic']);
if (is_array($hslists)) {
//兼容0.5数据
foreach ($hslists as &$h) {
if (is_array($h) && isset($h['attachment'])) {
$h = $h['attachment'];
}
}
unset($h);
}
}
if (checksubmit('submit')) {
if (empty($_GPC['title'])) {
message('请输入喜帖标题!');
}
$data = array('weid' => $_W['uniacid'], 'title' => $_GPC['title'], 'xl_name' => $_GPC['xl_name'], 'xn_name' => $_GPC['xn_name'], 'is_front' => $_GPC['is_front'], 'tel' => $_GPC['tel'], 'hy_time' => $_GPC['hy_time'], 'hy_addr' => $_GPC['hy_addr'], 'jw_addr' => $_GPC['hy_addr'], 'lng' => $_GPC['baidumap']['lng'], 'lat' => $_GPC['baidumap']['lat'], 'video' => $_GPC['video'], 'music' => $_GPC['music'], 'pwd' => $_GPC['pwd'], 'word' => htmlspecialchars_decode($_GPC['word']), 'province' => $_GPC['district']['province'], 'city' => $_GPC['district']['city'], 'dist' => $_GPC['district']['dist'], 'createtime' => TIMESTAMP, 'sendtitle' => $_GPC['sendtitle'], 'senddescription' => $_GPC['senddescription'], 'copyright' => htmlspecialchars_decode($_GPC['copyright']));
load()->func('file');
//上传图片
if (!empty($_GPC['art_pic']) && $_GPC['art_pic'] != $_GPC['art_pic_old']) {
file_delete($_GPC['art_pic_old']);
$data['art_pic'] = $_GPC['art_pic'];
}
if (!empty($_GPC['bg_pic']) && $_GPC['bg_pic'] != $_GPC['bg_pic_old']) {
file_delete($_GPC['bg_pic_old']);
$data['bg_pic'] = $_GPC['bg_pic'];
}
if (!empty($_GPC['donghua_pic']) && $_GPC['donghua_pic'] != $_GPC['donghua_pic_old']) {
file_delete($_GPC['donghua_pic_old']);
$data['donghua_pic'] = $_GPC['donghua_pic'];
}
if (!empty($_GPC['suolue_pic']) && $_GPC['suolue_pic'] != $_GPC['suolue_pic_old']) {
file_delete($_GPC['suolue_pic_old']);
$data['suolue_pic'] = $_GPC['suolue_pic'];
}
if (!empty($_GPC['music']) && $_GPC['music'] != $_GPC['music_old']) {
file_delete($_GPC['music_old']);
$data['music'] = $_GPC['music'];
}
if (is_array($_GPC['thumbs'])) {
$data['hs_pic'] = iserializer($_GPC['thumbs']);
}
if (empty($id)) {
pdo_insert($this->headtable, $data);
} else {
unset($data['createtime']);
pdo_update($this->headtable, $data, array('id' => $id));
}
message('喜帖信息更新成功!', $this->createWebUrl('manager'), 'success');
}
include $this->template('add');
}
示例10: settingsDisplay
public function settingsDisplay($settings)
{
global $_W, $_GPC;
if (checksubmit()) {
$cfg = array('title' => $_GPC['title'], 's_botton' => $_GPC['s_botton'], 'pic' => $_GPC['pic'], 's_url' => $_GPC['s_url'], 'm_url' => $_GPC['m_url'], 'desc' => $_GPC['desc']);
if ($this->saveSettings($cfg)) {
message('保存成功', 'refresh');
}
}
if (empty($settings['title'])) {
$settings['title'] = '你有一通来自亲爱的的未接电话!';
}
if (empty($settings['s_url'])) {
$settings['s_url'] = '';
}
if (empty($settings['m_url'])) {
$settings['m_url'] = $_W['siteroot'] . 'addons/n1ce_love/template/mobile/images/aini.mp3';
}
if (empty($settings['s_botton'])) {
$settings['s_botton'] = '媳妇';
}
if (empty($settings['pic'])) {
$settings['pic'] = $_W['siteroot'] . 'addons/n1ce_love/template/mobile/images/answer.png';
}
include $this->template('setting');
}
示例11: settingsDisplay
public function settingsDisplay($settings)
{
global $_W, $_GPC, $frames;
require_once MB_ROOT . '/source/backlist.class.php';
$backlist = new backlist();
$frames = $backlist->getModuleFrames('feng_fightgroups');
$backlist->_calc_current_frames2($frames);
load()->func('tpl');
load()->model('account');
$modules = uni_modules();
if (checksubmit()) {
load()->func('file');
$r = mkdirs(MB_ROOT . '/cert/' . $_W['uniacid']);
if (!empty($_GPC['cert'])) {
$ret = file_put_contents(MB_ROOT . '/cert/' . $_W['uniacid'] . '/apiclient_cert.pem', trim($_GPC['cert']));
$r = $r && $ret;
}
if (!empty($_GPC['key'])) {
$ret = file_put_contents(MB_ROOT . '/cert/' . $_W['uniacid'] . '/apiclient_key.pem', trim($_GPC['key']));
$r = $r && $ret;
}
if (!$r) {
message('证书保存失败, 请保证 /addons/feng_fightgroups/cert/ 目录可写');
}
$dat = array('userrefund' => $_GPC['userrefund'], 'gettime' => $_GPC['gettime'], 'goodstip' => $_GPC['goodstip'], 'openfirstpay' => $_GPC['openfirstpay'], 'firstpay' => $_GPC['firstpay'], 'refundpercent' => $_GPC['refundpercent'], 'status' => $_GPC['status'], 'sharestatus' => $_GPC['sharestatus'], 'mode' => $_GPC['mode'], 'picmode' => $_GPC['picmode'], 'mchid' => $_GPC['mchid'], 'apikey' => $_GPC['apikey'], 'share_title' => $_GPC['share_title'], 'share_image' => $_GPC['share_image'], 'share_desc' => $_GPC['share_desc'], 'share_imagestatus' => $_GPC['share_imagestatus'], 'pay_suc' => $_GPC['pay_suc'], 'm_pay' => $_GPC['m_pay'], 'm_tuan' => $_GPC['m_tuan'], 'm_cancle' => $_GPC['m_cancle'], 'm_ref' => $_GPC['m_ref'], 'm_send' => $_GPC['m_send'], 'pay_remark' => $_GPC['pay_remark'], 'tuan_remark' => $_GPC['tuan_remark'], 'tuan_suc' => $_GPC['tuan_suc'], 'cancle_remark' => $_GPC['cancle_remark'], 'cancle' => $_GPC['cancle'], 'send_remark' => $_GPC['send_remark'], 'send' => $_GPC['send'], 'ref_remark' => $_GPC['ref_remark'], 'ref' => $_GPC['ref'], 'sname' => $_GPC['sname'], 'slogo' => $_GPC['slogo'], 'marketprice1' => $_GPC['marketprice1'], 'marketprice2' => $_GPC['marketprice2'], 'marketprice3' => $_GPC['marketprice3'], 'marketprice4' => $_GPC['marketprice4'], 'productprice1' => $_GPC['productprice1'], 'productprice2' => $_GPC['productprice2'], 'productprice3' => $_GPC['productprice3'], 'productprice4' => $_GPC['productprice4'], 'copyright' => $_GPC['copyright'], 'content' => htmlspecialchars_decode($_GPC['content']));
if ($this->saveSettings($dat)) {
message('保存成功', 'refresh');
}
}
//这里来展示设置项表单
include $this->template('web/setting');
}
示例12: doWebPost
public function doWebPost()
{
//这个操作被定义用来呈现 管理中心导航菜单
global $_GPC, $_W;
$id = intval($_GPC['id']);
if (!empty($id)) {
$item = pdo_fetch("SELECT * FROM " . tablename($this->table_stores) . " WHERE id = :id", array(':id' => $id));
if (empty($item)) {
message('抱歉,位置不存在或是已经删除!', '', 'error');
}
}
if (checksubmit('submit')) {
if (empty($_GPC['title'])) {
message('请输入位置名称!');
}
$data = array('uniacid' => $_W['uniacid'], 'title' => $_GPC['title'], 'thumb' => $_GPC['thumb'], 'content' => htmlspecialchars_decode($_GPC['content']), 'phone' => $_GPC['phone'], 'qq' => $_GPC['qq'], 'province' => $_GPC['reside']['province'], 'city' => $_GPC['reside']['city'], 'dist' => $_GPC['reside']['district'], 'address' => $_GPC['address'], 'lng' => $_GPC['baidumap']['lng'], 'lat' => $_GPC['baidumap']['lat'], 'icon' => $_GPC['icon'], 'industry1' => $_GPC['industry_1'], 'industry2' => $_GPC['industry_2'], 'createtime' => TIMESTAMP);
if (empty($id)) {
pdo_insert($this->table_stores, $data);
} else {
unset($data['createtime']);
pdo_update($this->table_stores, $data, array('id' => $id));
}
message('位置信息更新成功!', $this->createWebUrl('list'), 'success');
}
load()->func('tpl');
include $this->template('post');
}
示例13: doWebSystemaward
/**
*
* 系统奖励积分
*/
public function doWebSystemaward()
{
global $_GPC, $_W;
$uid = $_GPC['uid'];
$sid = $_GPC['sid'];
$signUser = CRUD::findById(CRUD::$table_sign_user, $uid);
$sign = CRUD::findById(CRUD::$table_sign, $sid);
if (checksubmit()) {
if (empty($_GPC['credit'])) {
message("请输入积分");
}
$record_data = array('uid' => $uid, 'sid' => $sid, 'sign_type' => self::$TYPE_SYSTEM, 'credit' => $_GPC['credit'], 'createtime' => TIMESTAMP);
CRUD::create(CRUD::$table_sign_award, $record_data);
$user_credit = $signUser['credit'];
$user_data = array('credit' => $user_credit + $_GPC['credit']);
if ($sign['sync_credit'] == 1) {
//同步积分
$this->synFanscredit($signUser['openid'], $_GPC['credit']);
//同步
}
CRUD::updateById(CRUD::$table_sign_user, $user_data, $uid);
// 更新用户积分
message('更新用户称成功!', $this->createWebUrl('SignUser', array('sid' => $sid)), 'success');
}
include $this->template("system_award");
}
示例14: settingsDisplay
public function settingsDisplay($settings)
{
// 声明为全局才可以访问到.
global $_W, $_GPC;
if (checksubmit()) {
// $_GPC 可以用来获取 Cookies,表单中以及地址栏参数
$data = $_GPC['data'];
// message() 方法用于提示用户操作提示
empty($data['name']) && message('请填写便利店名称');
empty($data['logo']) && message('请填写便利店 LOGO');
empty($data['linkman']) && message('请填写便利店联系人');
empty($data['phone']) && message('请填写便利店联系电话');
empty($data['address']) && message('请填写便利店地址');
empty($data['description']) && message('请填写便利店介绍');
//字段验证, 并获得正确的数据$dat
if (!$this->saveSettings($data)) {
message('保存信息失败', '', 'error');
} else {
message('保存信息成功', '', 'success');
}
}
// 模板中需要用到 "tpl" 表单控件函数的话, 记得一定要调用此方法.
load()->func('tpl');
//这里来展示设置项表单
include $this->template('setting');
}
示例15: doMobilePay
public function doMobilePay()
{
global $_W, $_GPC;
if (empty($_W['member']['uid'])) {
checkauth();
}
$username = $_W['member']['email'] ? $_W['member']['email'] : $_W['member']['mobile'];
if (empty($username)) {
message('您的用户信息不完整,请完善用户信息后再充值', '', 'error');
}
if (checksubmit('submit', true) || !empty($_GPC['ajax'])) {
$fee = floatval($_GPC['money']);
if ($fee <= 0) {
message('支付错误, 金额小于0');
}
$chargerecord = pdo_fetch("SELECT * FROM " . tablename('mc_credits_recharge') . " WHERE uniacid = :uniacid AND uid = :uid AND fee = :fee AND status = '0'", array(':uniacid' => $_W['uniacid'], ':uid' => $_W['member']['uid'], ':fee' => $fee));
if (empty($chargerecord)) {
$chargerecord = array('uid' => $_W['member']['uid'], 'uniacid' => $_W['uniacid'], 'tid' => date('YmdHi') . random(10, 1), 'fee' => $fee, 'status' => 0, 'createtime' => TIMESTAMP);
if (!pdo_insert('mc_credits_recharge', $chargerecord)) {
message('创建充值订单失败,请重试!', url('entry', array('m' => 'recharge', 'do' => 'pay')), 'error');
}
}
$params = array('tid' => $chargerecord['tid'], 'ordersn' => $chargerecord['tid'], 'title' => '系统充值余额', 'fee' => $chargerecord['fee'], 'user' => $_W['member']['uid']);
$this->pay($params);
} else {
include $this->template('recharge');
}
}