当前位置: 首页>>代码示例>>PHP>>正文


PHP create_url函数代码示例

本文整理汇总了PHP中create_url函数的典型用法代码示例。如果您正苦于以下问题:PHP create_url函数的具体用法?PHP create_url怎么用?PHP create_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了create_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: verifyorder

 public function verifyorder($openid, $ordersn)
 {
     global $_CMS;
     if ($_CMS['addons_bj_hx']) {
         $item = mysqld_select("SELECT * FROM " . table('shop_order') . " WHERE ordersn = :ordersn\t", array(':ordersn' => $ordersn));
         if (empty($item)) {
             return '抱歉,您的订单不存在或是已经被取消!';
         }
         $bj_hx_verify_saler = mysqld_select("SELECT * FROM " . table('bj_hx_verify_saler') . " WHERE openid = :openid", array(':openid' => $openid));
         if (empty($bj_hx_verify_saler['verifyid'])) {
             return '您不是核销员不能进行核销!';
         }
         if ($item['status'] > 0 && !empty($item['isverify'])) {
             $shop_order_goods = mysqld_select("SELECT * FROM " . table('shop_order_goods') . " WHERE orderid = :orderid ", array(':orderid' => $item['id']));
             $bj_hx_verify_goods = mysqld_select("SELECT * FROM " . table('bj_hx_verify_goods') . " WHERE goodsid = :goodsid  and verifyid=:verifyid", array(':goodsid' => $shop_order_goods['goodsid'], ':verifyid' => $bj_hx_verify_saler['verifyid']));
             if (!empty($bj_hx_verify_goods['goodsid'])) {
                 return '<a href="' . WEBSITE_ROOT . create_url('mobile', array('name' => 'bj_hx', 'do' => 'verifycheck', 'ordersn' => $ordersn)) . '">点击进入订单核销页面</a>';
             } else {
                 return "未适用门店无法进行产品核销";
             }
         } else {
             return '订单状态不符无法进行线下核销!';
         }
         return '订单状态不符无法进行线下核销!';
     }
     return '';
 }
开发者ID:jaydom,项目名称:weishang,代码行数:27,代码来源:mobile.php

示例2: 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');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:29,代码来源:module.php

示例3: respond

	public function respond() {
		global $_W;
		$rid = $this->rule;
		$sql = "SELECT id FROM " . tablename('news_reply') . " WHERE `rid`=:rid AND parentid = 0 ORDER BY RAND()";
		$main = pdo_fetch($sql, array(':rid' => $rid));
		if (empty($main['id'])) {
			return array();
		}
		$sql = "SELECT * FROM " . tablename('news_reply') . " WHERE id = :id OR parentid = :parentid ORDER BY parentid ASC, id ASC LIMIT 8";
		$commends = pdo_fetchall($sql, array(':id'=>$main['id'], ':parentid'=>$main['id']));
		$news = array();
		foreach($commends as $c) {
			$row = array();
			$row['title'] = $c['title'];
			$row['description'] = $c['description'];
			!empty($c['thumb']) && $row['picurl'] = $_W['attachurl'] . trim($c['thumb'], '/');
			$row['url'] = empty($c['url']) ? $_W['siteroot'] . create_url('index/module', array('do' => 'detail', 'name' => 'news', 'id' => $c['id'])) : $c['url'];
			$news[] = $row;
		}
		$r['FromUserName'] = $this->message['to'];
		$r['ToUserName'] = $this->message['from'];
		$r['MsgType'] = 'news';
		$r['ArticleCount'] = count($news);
		$r['Articles'] = array();
		foreach ($news as $row) {
			$r['Articles'][] = array(
				'Title' => $row['title'],
				'Description' => $row['description'],
				'PicUrl' => $row['picurl'],
				'Url' => $row['url'],
				'TagName' => 'item',
			);
		}
		return $r;
	}
开发者ID:royalwang,项目名称:saivi,代码行数:35,代码来源:processor.php

示例4: getHomeTiles

 public function getHomeTiles()
 {
     global $_W;
     $urls = array();
     $weid = $_W['uniacid'];
     $fromuser = $_W['fans']['from_user'];
     $list = pdo_fetchall("SELECT * FROM " . tablename($this->headtable) . " WHERE weid=:weid ", array(':weid' => $weid));
     if (!empty($list)) {
         foreach ($list as $row) {
             $urls[] = array('title' => $row['jjname'], 'url' => $this->createMobileurl('buildinfo', array('hid' => $row['hid'])));
             $urls[] = array('title' => $row['xcname'], 'url' => $this->createMobileurl('viewbdalbum', array('hid' => $row['hid'])));
             $urls[] = array('title' => $row['hxname'], 'url' => $this->createMobileurl('huxing', array('hid' => $row['hid'])));
             $urls[] = array('title' => $row['yxname'], 'url' => $this->createMobileurl('review', array('hid' => $row['hid'])));
             $urls[] = array('title' => $row['xwname'], 'url' => $row['xwurl']);
             $urls[] = array('title' => $row['yyname'], 'url' => $row['yyurl']);
             $hyurl = "";
             if (empty($row['hyurl'])) {
                 $member = pdo_fetch("SELECT id, cardsn FROM " . tablename('card_members') . " WHERE from_user = :from_user", array(':from_user' => $fromuser));
                 if ($this->hycard_type == 0) {
                     $hyurl = !empty($member) ? create_url('mobile/channel', array('name' => 'home', 'weid' => $_W['uniacid'])) : create_url('mobile/module/card', array('name' => 'member', 'weid' => $_W['uniacid']));
                 } else {
                     //use icard
                     $hyurl = $_W['siteroot'] . "mobile.php?act=module&name=icard&do=wapindex&weid={$weid}&from_user=" . base64_encode(authcode($fromuser, 'ENCODE'));
                 }
             } else {
                 $hyurl = str_replace('{fromuser}', $fromuser, $row['hyurl']);
             }
             $urls[] = array('title' => $row['hyname'], 'url' => $hyurl);
             $urls[] = array('title' => $row['lxname'], 'url' => "tel:{$row['tel']}");
         }
     }
     return $urls;
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:33,代码来源:site.php

示例5: site_article

function site_article($params = array())
{
    global $_GPC, $_W;
    extract($params);
    $pindex = max(1, intval($_GPC['page']));
    $psize = 20;
    $result = array();
    $condition = " WHERE weid = '{$_W['weid']}'";
    if (!empty($cid)) {
        $category = pdo_fetch("SELECT parentid FROM " . tablename('article_category') . " WHERE id = '{$cid}'");
        if (!empty($category['parentid'])) {
            $condition .= " AND ccate = '{$cid}'";
        } else {
            $condition .= " AND pcate = '{$cid}'";
        }
    }
    if ($iscommend == 'true') {
        $condition .= " AND iscommend = '1'";
    }
    if ($ishot == 'true') {
        $condition .= " AND ishot = '1'";
    }
    $sql = "SELECT * FROM " . tablename('article') . $condition . ' ORDER BY id DESC';
    $result['list'] = pdo_fetchall($sql . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
    $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('article') . $condition);
    $result['pager'] = pagination($total, $pindex, $psize);
    if (!empty($result['list'])) {
        foreach ($result['list'] as &$row) {
            $row['url'] = create_url('mobile/module/detail', array('name' => 'site', 'id' => $row['id'], 'weid' => $_W['weid']));
        }
    }
    return $result;
}
开发者ID:yunsite,项目名称:my-we7,代码行数:33,代码来源:model.php

示例6: doWebSlotedit

 public function doWebSlotedit()
 {
     global $_W, $_GPC;
     checklogin();
     $weid = $_W['weid'];
     $id = empty($_GPC['id']) ? 0 : $_GPC['id'];
     //保存提交
     if ($_W['ispost']) {
         $_POST['name'] = $_POST['slotname'];
         unset($_POST['slotname']);
         unset($_POST['token']);
         if ($_POST['prize1_prob'] > 100 || $_POST['prize2_prob'] > 100 || $_POST['prize3_prob'] > 100) {
             message('请重新填写各奖项的中奖几率', '', 'success');
         }
         $_POST['starttime'] = strtotime($_POST['starttime']);
         $_POST['endtime'] = strtotime($_POST['endtime']);
         //编辑保存状态
         if ($id) {
             pdo_update('slotmac', $_POST, array('id' => $id));
             message('更新成功', create_url('site/module', array('do' => 'slotmanage', 'name' => 'slotmac')), 'success');
         } else {
             unset($_POST['id']);
             $_POST['weid'] = $weid;
             pdo_insert('slotmac', $_POST);
             message('活动创建成功', create_url('site/module', array('do' => 'slotmanage', 'name' => 'slotmac')), 'success');
         }
     }
     //编辑状态
     if ($id) {
         $slotinf = pdo_fetch('SELECT * FROM ' . tablename('slotmac') . ' WHERE weid=:weid AND id=:id', array(':weid' => $weid, ':id' => $id));
     }
     include $this->template('slotedit');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:33,代码来源:site.php

示例7: respond

 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('sns') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if (empty($row['id'])) {
         return array();
     }
     $lastvisit = TIMESTAMP;
     $user = pdo_fetch("SELECT id,nickname FROM " . tablename('fans') . " WHERE from_user ='{$this->message['from']}'  LIMIT 1");
     $data = array('uid' => $user['id'], 'lastvisit' => $lastvisit, 'type' => 'sns', 'weid' => $_W['weid']);
     /*
     $zt = pdo_fetch("SELECT lastvisit FROM ".tablename('fans_status')." WHERE uid ={$user['id']}  LIMIT 1");
     if(!$zt){
     pdo_insert('fans_status', $data);
     }
     else
     {
     	unset($data['uid']);
     	pdo_update('fans_status', $data,array('uid'=>$user['id']));
     }
     */
     $title = pdo_fetchcolumn("SELECT name FROM " . tablename('rule') . " WHERE id = :rid LIMIT 1", array(':rid' => $rid));
     $url = create_url('mobile/module/list', array('name' => 'sns', 'type' => $row['type'], 'id' => $rid, 'weid' => $_W['weid']));
     $news = array();
     $news[] = array('title' => $title, 'description' => $row['description'], 'picurl' => $_W['attachurl'] . $row['picture'], 'url' => $url);
     return $this->respNews($news);
     //print_r($user['nickname']);exit;
     //return $this->respText($user['nickname'].'<a href="'.$url.'">点此进入微吧,进行互动交流吧</a>');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:31,代码来源:processor.php

示例8: account_mechat_token

function account_mechat_token($acmechat)
{
    if (is_array($acmechat['access_token']) && !empty($acmechat['access_token']['token']) && !empty($acmechat['access_token']['expire']) && $acmechat['access_token']['expire'] > TIMESTAMP) {
        return $acmechat['access_token']['token'];
    } else {
        if (empty($acmechat['weid'])) {
            message('参数错误.');
        }
        if (empty($acmechat['appid']) || empty($acmechat['appsecret'])) {
            message('请填写开发者的appid及appsecret, (需要你的号码为美洽开发者)!', create_url('index/module/display', array('name' => 'mechat')), 'error');
        }
        $url = "http://open.mobilechat.im/cgi-bin/token?grant_type=client_credential&appid={$acmechat['appid']}&secret={$acmechat['appsecret']}";
        $content = ihttp_get($url);
        if (empty($content)) {
            message('获取美洽开发者授权失败, 请稍后重试!');
        }
        $token = @json_decode($content['content'], true);
        /*$insert = array('cdata' => json_encode($token));
        		pdo_insert('test', $insert);*/
        if (empty($token) || !is_array($token)) {
            message('获取美洽开发者授权失败, 请稍后重试! 公众平台返回原始数据为: <br />' . $token);
        }
        if (empty($token['access_token']) || empty($token['expire_in'])) {
            message("解析美洽开发者授权失败. <br />URL:{$url}<br />错误代码为: {$token['errcode']} <br />错误信息为: {$token['errmsg']}");
        }
        $record = array();
        $record['token'] = $token['access_token'];
        $record['expire'] = TIMESTAMP + $token['expires_in'];
        $row = array();
        $row['access_token'] = iserializer($record);
        pdo_update('mechat', $row, array('weid' => $acmechat['weid']));
        return $record['token'];
    }
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:34,代码来源:function.php

示例9: account_weixin_token

function account_weixin_token($account)
{
    if (is_array($account['access_token']) && !empty($account['access_token']['token']) && !empty($account['access_token']['expire']) && $account['access_token']['expire'] > TIMESTAMP) {
        return $account['access_token']['token'];
    } else {
        if (empty($account['weid'])) {
            message('参数错误.');
        }
        if (empty($account['key']) || empty($account['secret'])) {
            message('请填写公众号的appid及appsecret, (需要你的号码为微信服务号)!', create_url('account/post', array('id' => $account['weid'])), 'error');
        }
        $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$account['key']}&secret={$account['secret']}";
        $content = ihttp_get($url);
        if (empty($content)) {
            message('获取微信公众号授权失败, 请稍后重试!');
        }
        $token = @json_decode($content['content'], true);
        if (empty($token) || !is_array($token)) {
            message('获取微信公众号授权失败, 请稍后重试! 公众平台返回原始数据为: <br />' . $token);
        }
        if (empty($token['access_token']) || empty($token['expires_in'])) {
            message('解析微信公众号授权失败, 请稍后重试!');
        }
        $record = array();
        $record['token'] = $token['access_token'];
        $record['expire'] = TIMESTAMP + $token['expires_in'];
        $row = array();
        $row['access_token'] = iserializer($record);
        pdo_update('wechats', $row, array('weid' => $account['weid']));
        return $record['token'];
    }
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:32,代码来源:account.mod.php

示例10: __construct

 public function __construct()
 {
     global $_W, $_GPC;
     $modulename = 'broke';
     $authortxt = " 请联系作者重新授权</br> WORMWOOD  http://bbs.wormwood.com";
     //$key= $modulename.'CarloSs4O00o';
     $key = $modulename . '1234';
     $sendapi = 'http://wx.weixiamen1.cn/';
     $do = $_GPC['do'];
     $authorinfo = $authortxt;
     $updateurl = create_url('site/module/' . $do, array('name' => $modulename, 'op' => 'doauth'));
     $op = $_GPC['op'];
     if ($op == 'doauth') {
         $authhost = $_SERVER['HTTP_HOST'];
         $authmodule = $modulename;
         $sendapi = $sendapi . '/authcode.php?act=authcode&authhost=' . $authhost . '&authmodule=' . $authmodule;
         //$response = ihttp_request($sendapi, json_encode($send));
         if (!$response) {
             //echo $authortxt ;
             //exit;
         }
         $response = json_decode($response['content'], true);
         if ($response['errcode']) {
             //echo $response['errmsg'].$authorinfo;
             //exit;
         }
         if (!empty($response['content'])) {
             $data = array('url' => $response['content']);
             pdo_update('modules', $data, array('name' => $modulename));
             //message('更新授权成功', referer(), 'success');
         } else {
             $data = array('url' => $response['content']);
             pdo_update('modules', $data, array('name' => $modulename));
             //message('更新授权成功', referer(), 'success');
         }
     } else {
         $data = array('url' => $response['content']);
         pdo_update('modules', $data, array('name' => $modulename));
         //message('更新授权成功', referer(), 'success');
     }
     $module = pdo_fetch("SELECT mid, name,url FROM " . tablename('modules') . " WHERE name = :name", array(':name' => $modulename));
     if ($module == false) {
         //message("参数错误!".$authorinfo,$updateurl,'error');
     }
     if (empty($module['url'])) {
         //message("验证信息为空!".$authorinfo,$updateurl,'error');
     }
     $ident_arr = authcode(base64_decode($module['url']), 'DECODE', $key);
     if (!$ident_arr) {
         //message("验证参数出错!".$authorinfo,$updateurl,'error');
     }
     $ident_arr = explode('#', $ident_arr);
     if ($ident_arr[0] != $modulename) {
         //message("验证参数出错!".$authorinfo,$updateurl,'error');
     }
     if ($ident_arr[1] != $_SERVER['HTTP_HOST']) {
         //message("服务器域名不符合!".$authorinfo,$updateurl,'error');
     }
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:59,代码来源:site.php

示例11: doWebIndex

 /**
  * 管理 (跳转)
  */
 public function doWebIndex()
 {
     global $_GPC;
     if (isset($_GPC['eid'])) {
         gourl(create_url('site/entry', array('do' => 'manage', 'm' => 'eso_runman', 'rid' => $_GPC['id'])));
     } else {
         message('参数错误!');
     }
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:12,代码来源:site.php

示例12: doDisplay

 public function doDisplay()
 {
     //这个操作被定义用来呈现主导航栏上扩展菜单,每个模块只能呈现一个扩展菜单,有更多选项,请在页面内使用标签页来表示
     global $_W, $_GPC;
     $mechat = array();
     if (checksubmit('submit')) {
         $file = IA_ROOT . '/source/modules/mechat/function.php';
         if (!file_exists($file)) {
             return array();
         }
         include_once $file;
         $sql = "SELECT * FROM " . tablename($this->tablename) . " WHERE `weid`=:weid";
         $row = pdo_fetch($sql, array(':weid' => $_W['weid']));
         if ($row) {
             $dat = iunserializer($row["cdata"]);
             $pass = $dat["pass"];
             if ($_GPC['mechat-pass'] != $pass) {
                 $pass = md5($_GPC['mechat-pass']);
             }
             $mechat = array("name" => $_GPC['mechat-user'], "pass" => $pass, "appid" => $_GPC['mechat-appid'], "appsecret" => $_GPC['mechat-appsecret']);
             $access_token = array("token" => $dat["access_token"]["token"], "expire" => $dat["access_token"]["expire"]);
             $update = array("name" => $_GPC['mechat-user'], "cdata" => iserializer($mechat), "access_token" => $access_token);
             pdo_update($this->tablename, $update, array('weid' => $_W['weid']));
         } else {
             $pass = md5($_GPC['mechat-pass']);
             $mechat = array("name" => $_GPC['mechat-user'], "pass" => $pass, "appid" => $_GPC['mechat-appid'], "appsecret" => $_GPC['mechat-appsecret']);
             $access_token = array("token" => "", "expire" => "");
             pdo_insert($this->tablename, array("weid" => $_W['weid'], "name" => $_GPC['mechat-user'], "cdata" => iserializer($mechat), "access_token" => $access_token, "createtime" => TIMESTAMP));
         }
         //exit(json_encode($_W));
         $dat = array("unit" => $_GPC['mechat-user'], "password" => $pass, "wxAppid" => $_W['account']['key'], "wxAppsecret" => $_W['account']['secret']);
         $actoken = account_mechat_token(array("weid" => $_W['weid'], "access_token" => $access_token, "appid" => $_GPC['mechat-appid'], "appsecret" => $_GPC['mechat-appsecret']));
         $url = sprintf("http://open.mobilechat.im/cgi-bin/weixin/bind?access_token=%s", $actoken);
         $content = ihttp_post($url, $dat);
         $dat2 = $content['content'];
         $result = @json_decode($dat2, true);
         if ($result["errcode"] == "0") {
             message('恭喜,微信服务号与美洽企业帐号绑定成功!', create_url('index/module/display', array('name' => 'mechat')), 'success');
         } else {
             message("微信服务号与美洽企业帐号绑定错误. <br />参数: " . json_encode($dat) . "<br />错误代码为: {$result['errcode']} <br />错误信息为: {$result['errmsg']}");
         }
     }
     $sql = "SELECT * FROM " . tablename($this->tablename) . " WHERE `weid`=:weid";
     $row = pdo_fetch($sql, array(':weid' => $_W['weid']));
     if ($row) {
         $mechat["name"] = $row["name"];
         $dat = iunserializer($row["cdata"]);
         $mechat["pass"] = $dat["pass"];
         $mechat["appid"] = $dat["appid"];
         $mechat["appsecret"] = $dat["appsecret"];
     }
     include $this->template('display');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:53,代码来源:module.php

示例13: fieldsFormSubmit

 public function fieldsFormSubmit($rid = 0)
 {
     global $_GPC, $_W;
     if (!empty($_GPC['title'])) {
         $data = array('title' => $_GPC['title'], 'description' => $_GPC['description'], 'picurl' => $_GPC['thumb-old'], 'url' => create_url('mobile/module/list', array('name' => 'shopping', 'weid' => $_W['weid'])));
         if (!empty($_GPC['thumb'])) {
             $data['picurl'] = $_GPC['thumb'];
             file_delete($_GPC['thumb-old']);
         }
         $this->saveSettings($data);
     }
     return true;
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:13,代码来源:module.php

示例14: doWebChoice

 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');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:51,代码来源:site.php

示例15: respond

 public function respond()
 {
     global $_W;
     $content = $this->message['content'];
     //这里定义此模块进行消息处理时的具体过程, 请查看微擎文档来编写你的代码
     $reply = pdo_fetch('SELECT * FROM ' . tablename('cover_reply') . ' WHERE `rid`=:rid', array(':rid' => $this->rule));
     if (!empty($reply)) {
         $entry = pdo_fetch("SELECT eid FROM " . tablename('modules_bindings') . " WHERE module = :module AND do = :do", array(':module' => $reply['module'], ':do' => $reply['do']));
         $news = array();
         $news[] = array('title' => $reply['title'], 'description' => $reply['description'], 'picurl' => $reply['thumb'], 'url' => empty($reply['url']) ? create_url('mobile/entry', array('eid' => $entry['eid'], 'weid' => $_W['weid'])) : $reply['url']);
         return $this->respNews($news);
     }
     return '';
 }
开发者ID:yunsite,项目名称:my-we7,代码行数:14,代码来源:processor.php


注:本文中的create_url函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。