Beispiel #1
0
<?php

defined('SYSTEM_IN') or exit('Access Denied');
hasrule('weixin', 'weixin');
$operation = !empty($_GP['op']) ? $_GP['op'] : 'display';
if ($operation == 'detail') {
    if (!empty($_GP['id'])) {
        $rule = mysqld_select('SELECT * FROM ' . table('weixin_rule') . " WHERE  id = :id", array(':id' => intval($_GP['id'])));
    }
    if (checksubmit()) {
        if (empty($_GP['id'])) {
            $count = mysqld_selectcolumn('SELECT count(id) FROM ' . table('weixin_rule') . " WHERE  keywords = :keywords", array(':keywords' => $_GP['keywords']));
            if ($count > 0) {
                message('触发关键字' . $_GP['keywords'] . "已存在!");
            }
            if (!empty($_FILES['thumb']['tmp_name'])) {
                file_delete($_GP['thumb_old']);
                $upload = file_upload($_FILES['thumb']);
                if (is_error($upload)) {
                    message($upload['message'], '', 'error');
                }
                $thumb = $upload['path'];
            }
            $data = array('title' => $_GP['title'], 'ruletype' => $_GP['ruletype'], 'keywords' => $_GP['keywords'], 'thumb' => $thumb, 'description' => $_GP['description'], 'url' => $_GP['url']);
            mysqld_insert('weixin_rule', $data);
            message('保存成功!', 'refresh', 'success');
        } else {
            if ($rule['keywords'] != $_GP['keywords']) {
                $count = mysqld_selectcolumn('SELECT count(id) FROM ' . table('weixin_rule') . " WHERE  keywords = :keywords", array(':keywords' => $_GP['keywords']));
                if ($count > 0) {
                    message('触发关键字' . $_GP['keywords'] . "已存在!");
Beispiel #2
0
<?php

defined('SYSTEM_IN') or exit('Access Denied');
hasrule('alipay', 'alipay');
$ret = $this->menuDelete();
if (is_error($ret)) {
    message($ret['message'], 'refresh');
} else {
    message('已经成功删除菜单,请重新创建。', 'refresh');
}