コード例 #1
0
ファイル: web.php プロジェクト: noikiy/mygit
 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');
 }
コード例 #2
0
ファイル: downapp.mod.php プロジェクト: pf5512/phpstudy
	public function main()
	{
		$this->Title = '下载手机版享更多优惠';
		$android_url = ini('settings.site_url').'/get-last-apk.php';
		$iphone = ini('iphone');
		$iphone_url = $iphone['url'];

		$referer_url = referer('index.php?');
		if(false !== strpos($referer_url, '?')) {
			$referer_url .= '&ignore_jump=1';
		} else {
			$referer_url .= '/ignore_jump-1';
		}

		$user_agent = $_SERVER['HTTP_USER_AGENT'];
		if (stripos($user_agent, 'MicroMessenger') === false) {
						if( false != preg_match("/(iphone|android|mobile)/i",$_SERVER['HTTP_USER_AGENT']) ) {
				include handler('template')->file('downapp_mobile');
			} else {
				include handler('template')->file('downapp');	
			}
		} else {
						include handler('template')->file('downapp_weixin');
		}
	}
コード例 #3
0
ファイル: site.php プロジェクト: aspnmy/weizan
 public function doWebAddInfo()
 {
     global $_W, $_GPC;
     load()->func('tpl');
     $infoid = intval($_GPC['infoid']);
     if ($infoid) {
         $info = pdo_fetch("SELECT * FROM " . tablename('water_query_info') . " WHERE id= " . $infoid);
     }
     if ($_GPC['op'] == 'delete') {
         $infoid = intval($_GPC['infoid']);
         $info = pdo_fetch("SELECT id FROM " . tablename('water_query_info') . " WHERE id = " . $infoid);
         if (empty($info)) {
             message('抱歉,信息不存在或是已经被删除!');
         }
         pdo_delete('water_query_info', array('id' => $infoid));
         message('删除成功!', referer(), 'success');
     }
     if (checksubmit()) {
         $data = array('keyword' => $_GPC['keyword'], 'info' => htmlspecialchars_decode($_GPC['info']), 'infophoto' => $_GPC['infophoto']);
         if (!empty($infoid)) {
             pdo_update('water_query_info', $data, array('id' => $infoid));
         } else {
             $data['uniacid'] = $_W['uniacid'];
             pdo_insert('water_query_info', $data);
             $infoid = pdo_insertid();
         }
         message('更新成功!', referer(), 'success');
     }
     include $this->template('addinfo');
 }
コード例 #4
0
ファイル: site.php プロジェクト: alextiannus/wormwood_wechat
 public function doWebManage()
 {
     global $_W, $_GPC;
     $data = array();
     if ($_W['ispost']) {
         if (empty($_GPC['items'])) {
             message('创建点内容吧!', referer(), 'error', 1);
         }
         $data['weid'] = $_W['weid'];
         $data['title'] = $_GPC['title'];
         $data['bgimg'] = $_GPC['bgimg'];
         $data['bgcol'] = $_GPC['bgcol'];
         $data['time'] = time();
         foreach ($_GPC['items']['type'] as $k => $val) {
             $data['items'][] = array('type' => $_GPC['items']['type'][$k], 'title' => $_GPC['items']['title'][$k], 'direct' => $_GPC['items']['direct'][$k], 'detail' => $_GPC['items']['detail'][$k]);
         }
         $data['items'] = serialize($data['items']);
         if (empty($_GPC['id'])) {
             pdo_insert('timeaxis', $data);
         } else {
             pdo_update('timeaxis', $data, array('id' => $_GPC['id']));
         }
         //WeUtility::logging('tips','items:'.$data['items']);
         message('活动创建成功', '', 'success', 1);
     }
     $timeinf = array();
     if (!empty($_GPC['id'])) {
         $timeinf = pdo_fetch('SELECT * FROM ' . tablename('timeaxis') . ' WHERE id=:id', array(':id' => $_GPC['id']));
         $timeinf['items'] = unserialize($timeinf['items']);
         $timeinf['url'] = $this->createMobileUrl('index', array('weid' => $_W['weid'], 'tid' => $_GPC['id']));
     }
     include $this->template('manage');
 }
コード例 #5
0
ファイル: site.php プロジェクト: alextiannus/wormwood_wechat
 public function doWebCredit()
 {
     // 1. display reservation
     // 2. add credit
     // 3. delete credit
     // 4. update credit
     global $_W;
     global $_GPC;
     // 获取query string中的参数
     $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
     if ($operation == 'delete') {
         //删除兑换请求
         $id = intval($_GPC['id']);
         $row = pdo_fetch("SELECT id FROM " . tablename('credit_request') . " WHERE id = :id", array(':id' => $id));
         if (empty($row)) {
             message('抱歉,编号为' . $id . '的兑换请求不存在或是已经被删除!');
         }
         pdo_delete('credit_request', array('id' => $id));
         message('删除成功!', referer(), 'success');
     } else {
         if ($operation == 'display') {
             $condition = '';
             $sql = "SELECT * FROM " . tablename('award_list') . " as t1," . tablename('credit_request') . "as t2 WHERE t1.award_id=t2.award_id AND t1.weid = '{$_W['weid']}' ORDER BY t2.createtime DESC";
             $list = pdo_fetchall($sql);
             $ar = pdo_fetchall($sql, array(), 'from_user');
             $fans = fans_search(array_keys($ar), array('realname', 'mobile', 'credit1', 'residedist'));
         }
     }
     include $this->template('credit_request');
 }
コード例 #6
0
ファイル: site.php プロジェクト: eduNeusoft/weixin
 public function doWebsetting()
 {
     global $_W, $_GPC;
     $weid = $_W['uniacid'];
     load()->func('tpl');
     $subject = pdo_fetch("SELECT * FROM " . tablename(hc_ybdzs_setting) . " WHERE weid = '{$weid}' ORDER BY id DESC LIMIT 1");
     $item['hc_ybdzs_title'] = empty($item['hc_ybdzs_title']) ? '月饼大战' : $item['hc_ybdzs_title'];
     $item['share_desc'] = empty($item['share_desc']) ? '我只用了一层功力,已经无人可及了!' : $item['share_desc'];
     $item['wechat'] = empty($item['wechat']) ? '导流标题' : $item['wechat'];
     $item['hc_ybdzs_url'] = empty($item['hc_ybdzs_url']) ? 'http://52jscn.com' : $item['hc_ybdzs_url'];
     if (checksubmit()) {
         $data = array('hc_ybdzs_title' => $_GPC['hc_ybdzs_title'], 'hc_ybdzs_url' => $_GPC['hc_ybdzs_url'], 'share_desc' => $_GPC['share_desc'], 'wechat' => $_GPC['wechat'], 'counts' => $_GPC['counts'], 'photo' => $_GPC['photo']);
         if (empty($subject)) {
             $data['weid'] = $weid;
             pdo_insert(hc_ybdzs_setting, $data);
         } else {
             pdo_update(hc_ybdzs_setting, $data, array('weid' => $weid));
         }
         message('欧了!欧了!更新完毕!', referer(), 'success');
     }
     if (!$subject['photo']) {
         $subject = array("photo" => "../addons/hc_ybdzs/template/mobile/b.gif");
     }
     include $this->template('setting');
 }
コード例 #7
0
ファイル: common.func.php プロジェクト: legeng/project-2
function message($msg, $redirect = '', $type = '')
{
    global $_W;
    if ($redirect == 'refresh') {
        $redirect = $_W['script_name'] . '?' . $_SERVER['QUERY_STRING'];
    }
    if ($redirect == 'referer') {
        $redirect = referer();
    }
    if ($redirect == '') {
        $type = in_array($type, array('success', 'error', 'info', 'warning', 'ajax', 'sql')) ? $type : 'info';
    } else {
        $type = in_array($type, array('success', 'error', 'info', 'warning', 'ajax', 'sql')) ? $type : 'success';
    }
    if ($_W['isajax'] || $type == 'ajax') {
        $vars = array();
        $vars['message'] = $msg;
        $vars['redirect'] = $redirect;
        $vars['type'] = $type;
        exit(json_encode($vars));
    }
    if (empty($msg) && !empty($redirect)) {
        header('location: ' . $redirect);
    }
    $label = $type;
    if ($type == 'error') {
        $label = 'danger';
    }
    if ($type == 'ajax' || $type == 'sql') {
        $label = 'warning';
    }
    include template('common/message', TEMPLATE_INCLUDEPATH);
    exit;
}
コード例 #8
0
ファイル: login.mod.php プロジェクト: pf5512/phpstudy
	function login()
	{
		$this->_fix_failedlogins();

		if(MEMBER_ID < 1)
		{
			$this->Messager("请先在前台进行<a href='index.php?mod=account&code=login'><b>登录</b></a>",null);
		}
		$loginperm = $this->_logincheck();
		if(!$loginperm) {
			$this->Messager("累计 5 次错误尝试,15 分钟内您将不能登录。",null);
		}
		$this->Title="用户登录";
		if ($this->CookieHandler->GetVar('referer')=='')
		{
			$this->CookieHandler->Setvar('referer',referer());
		}
		$action="admin.php?mod=login&code=dologin";

		$question_select=FormHandler::Select('question',ConfigHandler::get('member','question_list'),0);
		$role_type_select=FormHandler::Radio('role_type',ConfigHandler::get('member','role_type_list'),'normal');
		ob_clean();

		include(handler('template')->file("@admin/login"));
	}
コード例 #9
0
ファイル: module.php プロジェクト: aspnmy/weizan
 public function settingsDisplay($settings)
 {
     global $_W, $_GPC;
     if (checksubmit('submit')) {
         $this->editSetting($_GPC);
         message('配置参数更新成功!', referer(), 'success');
     }
     $member_table = str_replace("`", "", tablename("mc_members"));
     $sql = "SELECT\r\n\t\t\tCOLUMN_NAME,\r\n\t\t\tcolumn_comment\r\n\t\tFROM\r\n\t\t\tINFORMATION_SCHEMA. COLUMNS\r\n\t\tWHERE\r\n\t\t\ttable_name = '{$member_table}'";
     $column = pdo_fetchall($sql);
     $sql = "select * from " . tablename("fl_dkf_column") . " where weid={$_W['weid']}";
     $wcolumn = pdo_fetchall($sql);
     if (!$wcolumn) {
         $sql = "select * from " . tablename("fl_dkf_column") . " where weid=0";
         $wcolumn = pdo_fetchall($sql);
     }
     foreach ($wcolumn as $key => $value) {
         $wcolumn_keys[$value['column_name']] = $value;
     }
     foreach ($column as $key => $value) {
         $column[$key]['column_show_name'] = $wcolumn_keys[$value['COLUMN_NAME']]['column_show_name'];
         $column[$key]['is_show'] = $wcolumn_keys[$value['COLUMN_NAME']]['is_show'];
         $column[$key]['is_edit'] = $wcolumn_keys[$value['COLUMN_NAME']]['is_edit'];
     }
     include $this->template('setting');
 }
コード例 #10
0
ファイル: module.php プロジェクト: eduNeusoft/weixin
 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');
 }
コード例 #11
0
ファイル: site.php プロジェクト: 6662680/qday_wx
 public function doWebTalklist()
 {
     global $_W, $_GPC;
     $pageIndex = max(1, intval($_GPC['page']));
     $pageSize = 50;
     $total = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename($this->table_comments) . " WHERE `uniacid`=:uniacid  ", array(':uniacid' => $_W['uniacid']));
     if ($_GPC['foo'] == 'change') {
         if (empty($_GPC['id'])) {
             message('缺失重要的参数', '', 'error');
         }
         pdo_update($this->table_comments, array('isok' => $_GPC['doit']), array('uniacid' => $_W['uniacid'], 'id' => $_GPC['id']));
         message('哎呦,状态修改成功了哦', referer(), 'success');
     }
     if ($_GPC['foo'] == 'delete') {
         if (empty($_GPC['id'])) {
             message('缺失重要的参数', '', 'error');
         }
         pdo_delete($this->table_comments, array('id' => $_GPC['id'], 'uniacid' => $_W['uniacid']));
         message('哎呦,删除了哦..', referer(), 'success');
     }
     $list = pdo_fetchall('SELECT * FROM' . tablename($this->table_comments) . " WHERE uniacid = :uniacid GROUP BY createtime DESC LIMIT " . ($pageIndex - 1) * $pageSize . ',' . $pageSize, array(':uniacid' => $_W['uniacid']));
     foreach ($list as $key => $value) {
         $temp = pdo_fetch('SELECT * FROM' . tablename($this->table_fans) . " WHERE uniacid = :uniacid AND openid = :openid", array(':uniacid' => $_W['uniacid'], ':openid' => $value['openid']));
         $list[$key]['nickname'] = $temp['nickname'];
     }
     $pager = pagination($total, $pageIndex, $pageSize);
     include $this->template('talklist');
 }
コード例 #12
0
ファイル: site.php プロジェクト: keycoolkui/weixinfenxiao
 public function doWebdatadelete()
 {
     global $_W, $_GPC;
     $uniacid = $_W['uniacid'];
     $id = $_GPC['id'];
     pdo_delete("lee_tlvoice_record", array('id' => $id));
     message("删除成功", referer(), 'success');
 }
コード例 #13
0
ファイル: qqwb.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function Login()
 {
     if (jsg_getcookie("referer") == "") {
         jsg_setcookie("referer", referer('?', 1));
     }
     $aurl = $this->_get_oauth_url();
     $this->Messager(null, $aurl);
 }
コード例 #14
0
ファイル: module.php プロジェクト: aspnmy/weizan
 public function settingsDisplay($settings)
 {
     global $_GPC, $_W;
     if (checksubmit()) {
         $this->saveSettings($_POST);
         message('保存成功!', referer(), 'success');
     }
     include $this->template('setting');
 }
コード例 #15
0
ファイル: site.php プロジェクト: alextiannus/wormwood_wechat
 public function doWebstatus($rid = 0)
 {
     global $_GPC;
     $rid = $_GPC['rid'];
     echo $rid;
     $insert = array('status' => $_GPC['status']);
     pdo_update($this->table_reply, $insert, array('rid' => $rid));
     message('模块操作成功!', referer(), 'success');
 }
コード例 #16
0
ファイル: site.php プロジェクト: alextiannus/wormwood_wechat
 public function doWebDelete()
 {
     global $_W, $_GPC;
     $id = $_GPC['id'];
     if (!empty($id)) {
         pdo_delete($this->manage, array('weid' => $_W['weid'], 'id' => $id));
         message('删除成功', referer(), 'success');
     }
 }
コード例 #17
0
ファイル: site.php プロジェクト: eduNeusoft/weixin
    public function doWebAwardlist()
    {
        global $_GPC, $_W;
        $id = intval($_GPC['id']);
        if (checksubmit('delete')) {
            if (empty($_GPC['select'])) {
                message('请选择需要删除的数据', referer(), 'error');
            }
            pdo_delete('bbb_user', ' id IN (' . implode(',', $_GPC['select']) . ')');
            message('删除成功!', $this->createWebUrl('awardlist', array('id' => $id, 'page' => $_GPC['page'])));
        }
        $where = ' WHERE `a`.`rid` = :rid AND `f`.`uniacid` = :uniacid';
        $params = array(':rid' => intval($_GPC['id']), ':uniacid' => $_W['uniacid']);
        $join = ' FROM ' . tablename('bbb_user') . ' AS `a` JOIN ' . tablename('mc_mapping_fans') . ' AS `f` ON
				`a`.`from_user` = `f`.`openid`';
        if (!empty($_GPC['nickname'])) {
            $where .= ' AND `f`.`nickname` LIKE :nickname';
            $params[':nickname'] = '%' . $_GPC['nickname'] . '%';
        }
        $sql = 'SELECT COUNT(*) ' . $join . $where;
        $total = pdo_fetchcolumn($sql, $params);
        if ($total > 0) {
            $pindex = max(1, intval($_GPC['page']));
            $psize = 15;
            $sql = 'SELECT `a`.`id`, `a`.`points`, `a`.`createtime`, `f`.`nickname` ' . $join . $where . ' ORDER BY
					`a`.`points` DESC LIMIT ' . ($pindex - 1) * $psize . ',' . $psize;
            $list = pdo_fetchall($sql, $params);
            $pager = pagination($total, $pindex, $psize);
        }
        if (!empty($_GPC['export'])) {
            /* 输入到CSV文件 */
            $html = "";
            /* 输出表头 */
            $filter = array('nickname' => '昵称', 'points' => '分数', 'createtime' => '时间');
            foreach ($filter as $key => $value) {
                $html .= $value . "\t,";
            }
            $html .= "\n";
            foreach ($list as $key => $value) {
                foreach ($filter as $index => $title) {
                    if ($index != 'createtime') {
                        $html .= $value[$index] . "\t, ";
                    } else {
                        $html .= date('Y-m-d H:i:s', $value[$index]) . "\t, ";
                    }
                }
                $html .= "\n";
            }
            /* 输出CSV文件 */
            header("Content-type:text/csv");
            header("Content-Disposition:attachment; filename=全部数据.csv");
            echo $html;
            exit;
        }
        include $this->template('awardlist');
    }
コード例 #18
0
 public function settingsDisplay($settings)
 {
     global $_GPC, $_W;
     if (checksubmit()) {
         $data = $_GPC['data'];
         $this->saveSettings($data);
         message('设置成功!', referer(), 'success');
     }
     include $this->template('setting');
 }
コード例 #19
0
ファイル: module.php プロジェクト: eduNeusoft/weixin
 public function doDelete()
 {
     global $_GPC, $_W;
     $id = intval($_GPC['id']);
     $rid = intval($_GPC['rid']);
     if (!empty($id) && !empty($rid)) {
         pdo_delete('xc_article_article_reply', array('id' => $id, 'rid' => $rid));
     }
     message('删除成功!', referer(), 'success');
 }
コード例 #20
0
ファイル: member.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function Register()
 {
     if (MEMBER_ID != 0 and false == $this->IsAdmin) {
         $this->Messager('您已经是注册用户,无需再注册!', -1);
     }
     $regstatus = jsg_member_register_check_status();
     if ($regstatus['error']) {
         $this->Messager($regstatus['error'], null);
     }
     $inviter_member = array();
     $action = "index.php?mod=member&code=doregister";
     $check_result = jsg_member_register_check_invite($this->Code);
     if ($regstatus['invite_enable'] && !$regstatus['normal_enable']) {
         if (!$this->Code) {
             $this->Messager("本站目前需要有邀请链接才能注册。" . jsg_member_third_party_reg_msg(), null);
         }
         if (!$check_result) {
             $this->Messager("对不起,您访问的邀请链接不正确或者因邀请数已满而失效,请重新与邀请人索取链接。", null);
         }
     }
     if ($check_result['uid'] > 0) {
         $inviter_member = jsg_member_info($check_result['uid']);
     }
     $action .= "&invite_code=" . urlencode($this->Code);
     if (jsg_getcookie('referer') == '') {
         jsg_setcookie('referer', referer());
     }
     $noemail = 0;
     if ($this->_sms_register()) {
         $sms_bind_num = $this->Post['sms_bind_num'] ? $this->Post['sms_bind_num'] : $this->Get['sms_bind_num'];
         if (!sms_is_phone($sms_bind_num)) {
             $action = "index.php?mod=member&invite_code=" . urlencode($this->Code);
             $this->Title = "请输入您的手机号码";
             include template('member_register_sms');
             return;
         } else {
             if (($_user_info = _sms_client_user($sms_bind_num)) && $_user_info['uid']) {
                 $this->Messager('此手机号已经绑定了其他的帐号');
             }
             if ($_user_info['bind_key_time'] + 60 > time()) {
                 $this->Messager('60秒内仅发送一次,请稍候再试');
             }
             $bind_key = mt_rand(100000, 999999);
             $sets = array('user_im' => $sms_bind_num, 'bind_key' => $bind_key, 'bind_key_time' => time());
             sms_client_user_update($sets, $_user_info);
             $sms_msg = "您的验证码为 {$bind_key}";
             $sms_msg = array_iconv('UTF-8', $this->Config['charset'], $sms_msg);
             sms_send($sms_bind_num, $sms_msg, 0);
         }
         $noemail = jconf::get('sms', 'register_verify', 'noemail');
     }
     $action = "index.php?mod=member&code=doregister&invite_code=" . urlencode($this->Code);
     $this->Title = "注册新用户";
     include template('member_register');
 }
コード例 #21
0
ファイル: site.php プロジェクト: eduNeusoft/weixin
 public function doWebDelete()
 {
     global $_GPC;
     $id = intval($_GPC['id']);
     $item = pdo_fetch("SELECT * FROM " . tablename($this->table_stores) . " WHERE id = :id", array(':id' => $id));
     if (empty($item)) {
         message('抱歉,位置不存在或是已经删除!', '', 'error');
     }
     pdo_delete($this->table_stores, array('id' => $item['id']));
     message('删除成功!', referer(), 'success');
 }
コード例 #22
0
ファイル: module.php プロジェクト: aspnmy/weizan
 public function settingsDisplay($settings)
 {
     global $_W, $_GPC;
     if (checksubmit()) {
         $dat = array('payroll' => $_GPC['payroll'], 'welfare' => $_GPC['welfare'], 'educational' => $_GPC['educational'], 'positiontype' => $_GPC['positiontype'], 'workexperience' => $_GPC['workexperience'], 'companytype' => $_GPC['companytype'], 'scale' => $_GPC['scale'], 'qrcode' => $_GPC['qrcode'], 'telephone' => $_GPC['telephone'], 'isopenaudit' => $_GPC['isopenaudit'], 'viewresumenums' => empty($_GPC['viewresumenums']) ? intval($_GPC['viewresumenums']) : 5, 'isopenindexhot' => empty($_GPC['isopenindexhot']) ? intval($_GPC['isopenindexhot']) : 5, 'indextopnums' => empty($_GPC['indextopnums']) ? intval($_GPC['indextopnums']) : 5, 'indexhotnums' => empty($_GPC['indexhotnums']) ? intval($_GPC['indexhotnums']) : 5, 'indexlastnums' => empty($_GPC['indexlastnums']) ? intval($_GPC['indexlastnums']) : 5, 'indexcompanynums' => empty($_GPC['indexcompanynums']) ? intval($_GPC['indexcompanynums']) : 5, 'isopenlicense' => $_GPC['isopenlicense'], 'maxfilesize' => $_GPC['maxfilesize'], 'headimgurlsize' => $_GPC['headimgurlsize'], 'headimgurlwidth' => $_GPC['headimgurlwidth']);
         $this->saveSettings($dat);
         message('配置参数更新成功!', referer(), 'success');
     }
     load()->func('tpl');
     include $this->template('setting');
 }
コード例 #23
0
ファイル: module.php プロジェクト: keycoolkui/weixinfenxiao
 public function settingsDisplay($settings)
 {
     global $_W, $_GPC;
     if (checksubmit()) {
         $dat['colspan'] = $_GPC['colspan'];
         $dat['isopenmap'] = $_GPC['isopenmap'];
         $this->saveSettings($dat);
         message('配置参数更新成功!', referer(), 'success');
     }
     include $this->template('setting');
 }
コード例 #24
0
ファイル: site.php プロジェクト: alextiannus/wormwood_wechat
 public function doWebDelrouter()
 {
     global $_GPC, $_W;
     $id = intval($_GPC['id']);
     $item = pdo_fetch("SELECT * FROM " . tablename($this->routertable) . " WHERE id = :id and weid=:weid", array(':id' => $id, ':weid' => $_W['weid']));
     if (empty($item)) {
         message('抱歉,指定路由器不存在或是已经删除!', '', 'error');
     }
     pdo_delete($this->routertable, array('id' => $item['id']));
     message('删除成功!', referer(), 'success');
 }
コード例 #25
0
ファイル: site.php プロジェクト: zhang19960118/html11
 public function doWebChatlog()
 {
     global $_GPC, $_W;
     load()->func('tpl');
     $starttime = empty($_GPC['starttime']) ? strtotime(date('Y-m-d')) : strtotime($_GPC['starttime']);
     if (!empty($_GPC['token'])) {
         unset($_GPC['token']);
         $avatar = '';
         $endtime = $starttime + 23 * 3600 + 3599;
         $acid = $_W['acid'];
         if (!empty($_GPC['nickname']) && empty($_GPC['openid'])) {
             $user = pdo_fetch('SELECT b.openid,a.avatar,b.nickname FROM ' . tablename('mc_members') . ' AS a LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS b ON a.uid = b.uid WHERE b.acid = :acid AND a.nickname = :nickname', array(':nickname' => trim($_GPC['nickname']), ':acid' => $_W['acid']));
             if (empty($user['openid'])) {
                 message('没有找到昵称为 "' . $_GPC['nickname'] . '" 的用户', $this->createWebUrl('chatlog', array('acid' => $acid, 'nickname' => $_GPC['nickname'], 'openid' => $_GPC['openid'], 'starttime' => $_GPC['starttime'])), 'error');
             } else {
                 if (!empty($user['avatar'])) {
                     $avatar = tomedia($user['avatar']);
                     $nickname = $user['nickname'];
                 }
             }
         } else {
             $openid = trim($_GPC['openid']);
             $user = pdo_fetch('SELECT b.openid,a.avatar,b.nickname FROM ' . tablename('mc_members') . ' AS a LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS b ON a.uid = b.uid WHERE b.acid = :acid AND b.openid = :openid', array(':openid' => trim($_GPC['openid']), ':acid' => $_W['acid']));
             if (!empty($user['avatar'])) {
                 $avatar = tomedia($user['avatar']);
                 $nickname = $user['nickname'];
             }
         }
         if (empty($user['openid'])) {
             message('请输入粉丝昵称或者粉丝openid', referer(), 'error');
         }
         if ($acid > 0 && !empty($starttime) && !empty($endtime)) {
             $pindex = max(1, intval($_GPC['page']));
             $acc = WeAccount::create($acid);
             $params = array('openid' => trim($user['openid']), 'starttime' => $starttime, 'endtime' => $endtime, 'pageindex' => $pindex, 'pagesize' => 50);
             $logs = $acc->fetchChatLog($params);
             $next = 1;
             if (is_error($logs) || empty($logs['recordlist']) || count($logs['recordlist']) < $params['pagesize']) {
                 $next = 0;
             }
             $codedata = array();
             $codedata[1000] = '创建未接入会话';
             $codedata[1001] = '接入会话';
             $codedata[1002] = '主动发起会话';
             $codedata[1004] = '关闭会话';
             $codedata[1005] = '抢接会话';
             $codedata[2001] = '公众号收到消息';
             $codedata[2002] = '客服发送消息';
             $codedata[2003] = '客服收到消息';
         }
     }
     include $this->template('chatlog');
 }
コード例 #26
0
ファイル: site.php プロジェクト: alextiannus/wormwood_wechat
 public function doWebList()
 {
     global $_GPC, $_W;
     $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
     if ($operation == 'post') {
         $id = intval($_GPC['id']);
         if (!empty($id)) {
             $item = pdo_fetch("SELECT * FROM " . tablename('tail_list') . " WHERE weid = :weid AND id=:id", array(':weid' => $_W['weid'], ':id' => $id));
         }
         if (checksubmit()) {
             $insert = array('weid' => $_W['weid'], 'displayorder' => intval($_GPC['displayorder']), 'module' => $_GPC['module']);
             if ($_GPC['module'] == 'basic') {
                 $insert['content'] = $_GPC['basic-content'];
             } elseif ($_GPC['module'] == 'news') {
                 $insert['title'] = $_GPC['title'];
                 $insert['description'] = $_GPC['description'];
                 $insert['thumb'] = $_GPC['thumb'];
                 $insert['url'] = $_GPC['url'];
             }
             if (empty($id)) {
                 $temp = pdo_insert('tail_list', $insert);
             } else {
                 unset($insert['weid']);
                 $temp = pdo_update('tail_list', $insert, array('weid' => $_W['weid'], 'id' => $id));
             }
             if ($temp == false) {
                 message('数据保存失败');
             } else {
                 message('数据保存成功', $this->createWebUrl('list'));
             }
         }
         if (empty($item)) {
             $item = array('displayorder' => 0, 'module' => 'basic');
         }
     } elseif ($operation == 'delete') {
         $id = intval($_GPC['id']);
         $row = pdo_fetch("SELECT id, thumb FROM " . tablename('tail_list') . " WHERE id = :id AND weid=" . $_W['weid'] . "", array(':id' => $id));
         if (empty($row)) {
             message('抱歉,小尾巴不存在或是已经被删除!');
         }
         pdo_delete('tail_list', array('id' => $id));
         message('删除成功!', referer(), 'success');
     } else {
         $pindex = max(1, intval($_GPC['page']));
         $psize = 20;
         $condition = '';
         $list = pdo_fetchall("SELECT * FROM " . tablename('tail_list') . " WHERE weid = '{$_W['weid']}' {$condition} ORDER BY displayorder DESC, id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
         $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('tail_list') . " WHERE weid = '{$_W['weid']}' {$condition}");
         $pager = pagination($total, $pindex, $psize);
     }
     include $this->template('list');
 }
コード例 #27
0
ファイル: module.php プロジェクト: aspnmy/weizan
 public function settingsDisplay($settings)
 {
     global $_W, $_GPC;
     if (checksubmit('submit')) {
         $dat['followurl'] = $_GPC['followurl'];
         $dat['copyright'] = $_GPC['copyright'];
         $dat['followneed'] = intval($_GPC['followneed']);
         $this->saveSettings($dat);
         message('配置参数更新成功!', referer(), 'success');
     }
     //这里来展示设置项表单
     include $this->template('settings');
 }
コード例 #28
0
ファイル: site.php プロジェクト: alextiannus/wormwood_wechat
 public function doWebChoice()
 {
     global $_W;
     global $_GPC;
     // 获取query string中的参数
     $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
     if ($operation == 'post') {
         $choice_id = intval($_GPC['choice_id']);
         if (!empty($choice_id)) {
             $item = pdo_fetch("SELECT * FROM " . tablename('exam_choice') . " WHERE choice_id = :id", array(':id' => $choice_id));
             if (empty($item)) {
                 message('抱歉,试题不存在或是已经删除!', '', 'error');
             }
         }
         if (checksubmit('submit')) {
             if (empty($_GPC['title'])) {
                 message('请输入题干');
             }
             if (empty($_GPC['body'])) {
                 message('请输入选项!');
             }
             if (empty($_GPC['answer'])) {
                 message('请输入答案!');
             }
             $data = array('weid' => $_W['weid'], 'title' => $_GPC['title'], 'body' => $_GPC['body'], 'answer' => $_GPC['answer'], 'explain' => $_GPC['explain']);
             if (!empty($choice_id)) {
                 pdo_update('exam_choice', $data, array('choice_id' => $choice_id));
             } else {
                 pdo_insert('exam_choice', $data);
             }
             message('更新成功!', create_url('site/module/choice', array('name' => 'exam', 'op' => 'display')), 'success');
         }
     } else {
         if ($operation == 'delete') {
             //删除酒店
             $choice_id = intval($_GPC['choice_id']);
             $row = pdo_fetch("SELECT choice_id FROM " . tablename('exam_choice') . " WHERE choice_id = :choice_id", array(':choice_id' => $choice_id));
             if (empty($row)) {
                 message('抱歉,酒店不存在或是已经被删除!');
             }
             pdo_delete('exam_choice', array('choice_id' => $choice_id));
             message('删除成功!', referer(), 'success');
         } else {
             if ($operation == 'display') {
                 $condition = '';
                 $list = pdo_fetchall("SELECT * FROM " . tablename('exam_choice') . " WHERE weid = '{$_W['weid']}' {$condition} ORDER BY choice_id DESC");
             }
         }
     }
     include $this->template('choice');
 }
コード例 #29
0
ファイル: module.php プロジェクト: eduNeusoft/weixin
 public function fieldsFormValidate($rid = 0)
 {
     //规则编辑保存时,要进行的数据验证,返回空串表示验证无误,返回其他字符串将呈现为错误提示。这里 $rid 为对应的规则编号,新增时为 0
     global $_W, $_GPC;
     $dat = $_GPC['dat'];
     foreach ($dat as $k => &$v) {
         if (empty($v) && $k != 'url') {
             message('必填项没有填写完整..', referer(), 'error');
             exit;
         }
         $v = trim($v);
     }
     return '';
 }
コード例 #30
0
ファイル: module.php プロジェクト: randyli/redstar
 public function settingsDisplay($settings)
 {
     global $_W, $_GPC;
     //点击模块设置时将调用此方法呈现模块设置页面,$settings 为模块设置参数, 结构为数组。这个参数系统针对不同公众账号独立保存。
     //在此呈现页面中自行处理post请求并保存设置参数(通过使用$this->saveSettings()来实现)
     if (checksubmit('submit')) {
         //字段验证, 并获得正确的数据$dat
         $dat['option1'] = $_GPC['option1'];
         $this->saveSettings($dat);
         message('配置参数更新成功!', referer(), 'success');
     }
     //这里来展示设置项表单
     include $this->template('settings');
 }