Exemple #1
0
function msqdt_build($p, $o)
{
    req('msql');
    $ra['_menus_'] = explode(',', $o);
    $r = msql_read_b('', ses('msqdt'), '', '', $ra);
    $murl = sesm('murl', murl('users', '', ses('qb'), $p, ''));
    if ($r) {
        return draw_table($r, $murl, '');
    }
}
Exemple #2
0
 public function fieldsFormDisplay($rid = 0)
 {
     global $_W;
     if (!empty($rid)) {
         $reply = CRUD::findUnique(CRUD::$table_sign, array(":rid" => $rid));
         $reply['starttime'] = date("Y-m-d  H:i", $reply['starttime']);
         $reply['endtime'] = date("Y-m-d  H:i", $reply['endtime']);
         $sin_serials = pdo_fetchall("select * from " . tablename(CRUD::$table_sign_serial) . " where sid=:sid order by day asc ", array(":sid" => $reply['id']));
         $links = pdo_fetchall("select * from " . tablename(CRUD::$table_sign_link) . " where sid=:sid order by sort asc ", array(":sid" => $reply['id']));
         $entryurl = murl('entry', array('do' => 'index', 'm' => 'wwx_sign')) . '&sid=' . $reply['id'];
     }
     load()->func('tpl');
     include $this->template('form');
 }
Exemple #3
0
 public function doWebDelete()
 {
     checklogin();
     global $_W, $_GPC;
     $id = intval($_GPC['id']);
     $rid = intval($_GPC['rid']);
     $sql = "SELECT id FROM " . tablename('superman_floor_award') . " WHERE `id`=:id";
     $row = pdo_fetch($sql, array(':id' => $id));
     if (empty($row)) {
         message('抱歉,奖品不存在或是已经被删除!', '', 'error');
     }
     if (pdo_delete('superman_floor_award', array('id' => $id))) {
         message('删除成功', murl('platform/reply/post', array('m' => 'superman_floor', 'rid' => $rid)), 'success');
     }
 }
function module_entries($name, $types = array(), $args = null)
{
    $ts = array('rule', 'cover', 'menu', 'home', 'profile', 'shortcut', 'function');
    if (empty($types)) {
        $types = $ts;
    } else {
        $types = array_intersect($types, $ts);
    }
    $fields = implode("','", $types);
    $sql = 'SELECT * FROM ' . tablename('modules_bindings') . " WHERE `module`=:module AND `entry` IN ('{$fields}') ORDER BY eid ASC";
    $pars = array();
    $pars[':module'] = $name;
    $bindings = pdo_fetchall($sql, $pars);
    $entries = array();
    foreach ($bindings as $bind) {
        if (!empty($bind['call'])) {
            $site = WeUtility::createModuleSite($bind['module']);
            $ret = @$site->{$bind}['call']($args);
            if (is_array($ret)) {
                foreach ($ret as $et) {
                    $et['url'] .= '&__title=' . urlencode($et['title']);
                    $entries[$bind['entry']][] = array('title' => $et['title'], 'url' => $et['url'], 'from' => 'call');
                }
            }
        } else {
            if ($bind['entry'] == 'cover') {
                $url = wurl("platform/cover", array('eid' => $bind['eid']));
            }
            if ($bind['entry'] == 'menu') {
                $url = wurl("site/entry", array('eid' => $bind['eid']));
            }
            if ($bind['entry'] == 'rule') {
                $url = wurl("site/entry", array('eid' => $bind['eid'], 'id' => '{id}'));
            }
            if ($bind['entry'] == 'home') {
                $url = murl("entry", array('eid' => $bind['eid']));
            }
            if ($bind['entry'] == 'profile') {
                $url = murl("entry", array('eid' => $bind['eid']));
            }
            if ($bind['entry'] == 'shortcut') {
                $url = murl("entry", array('eid' => $bind['eid']));
            }
            $entries[$bind['entry']][] = array('title' => $bind['title'], 'url' => $url, 'from' => 'define');
        }
    }
    return $entries;
}
Exemple #5
0
    if (empty($eid)) {
        message('访问错误');
    }
    $sql = 'SELECT * FROM ' . tablename('modules_bindings') . ' WHERE `eid`=:eid';
    $pars = array();
    $pars[':eid'] = $eid;
    $entry = pdo_fetch($sql, $pars);
    if (empty($entry) || $entry['entry'] != 'cover') {
        message('访问错误');
    }
    load()->model('module');
    $module = module_fetch($entry['module']);
    if (empty($module)) {
        message('访问错误');
    }
    $entry['url'] = murl('entry', array('do' => $entry['do'], 'm' => $entry['module']));
    $cover['title'] = $entry['title'];
    if ($module['issolution']) {
        $solution = $module;
        define('FRAME', 'solution');
    } else {
        define('FRAME', 'ext');
        $types = module_types();
        define('ACTIVE_FRAME_URL', url('home/welcome/ext', array('m' => $entry['module'])));
    }
    $frames = buildframes(array(FRAME), $entry['module']);
    $frames = $frames[FRAME];
}
$sql = "SELECT * FROM " . tablename('cover_reply') . ' WHERE `module` = :module AND `do` = :do AND uniacid = :uniacid AND multiid = :multiid';
$pars = array();
$pars[':module'] = $entry['module'];
function url($segment, $params = array(), $noredirect = false)
{
    return murl($segment, $params, $noredirect);
}
Exemple #7
0
function site_article($params = array())
{
    global $_GPC, $_W;
    extract($params);
    $pindex = max(1, intval($_GPC['page']));
    if (!isset($limit)) {
        $psize = 10;
    } else {
        $psize = intval($limit);
        $psize = max(1, $limit);
    }
    $result = array();
    $condition = " WHERE uniacid = '{$_W['uniacid']}'";
    if (!empty($cid)) {
        $category = pdo_fetch("SELECT parentid FROM " . tablename('site_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('site_article') . $condition . ' ORDER BY displayorder DESC, id DESC';
    $result['list'] = pdo_fetchall($sql . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
    $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('site_article') . $condition);
    $result['pager'] = pagination($total, $pindex, $psize);
    if (!empty($result['list'])) {
        foreach ($result['list'] as &$row) {
            if (empty($row['linkurl'])) {
                $row['linkurl'] = murl('site/site/detail', array('id' => $row['id'], 'uniacid' => $_W['uniacid']));
            }
            $row['thumb'] = tomedia($row['thumb']);
        }
    }
    return $result;
}
Exemple #8
0
 function init($baseinfo)
 {
     if (empty($baseinfo['logo_url'])) {
         return error(-1, '商户logo不能为空');
     }
     if (empty($baseinfo['brand_name'])) {
         return error(-1, '商户名称不能为空');
     }
     empty($baseinfo['code_type']) && ($baseinfo['code_type'] = 1);
     $baseinfo['code_type'] = $this->code_types[$baseinfo['code_type']];
     if (empty($baseinfo['title'])) {
         return error(-1, '卡券标题不能为空');
     }
     empty($baseinfo['color']) && ($baseinfo['color'] = 'Color010');
     if (empty($baseinfo['notice'])) {
         return error(-1, '操作提示不能为空');
     }
     if (empty($baseinfo['service_phone'])) {
         return error(-1, '客服电话不能为空');
     }
     if (empty($baseinfo['description'])) {
         return error(-1, '使用须知不能为空');
     }
     if (empty($baseinfo['time_type'])) {
         return error(-1, '使用期限不能为空');
     } else {
         if ($baseinfo['time_type'] == 1) {
             if (!empty($baseinfo['time_limit[start]'])) {
                 $baseinfo['begin_timestamp'] = strtotime($baseinfo['time_limit[start]']);
                 $baseinfo['end_timestamp'] = strtotime($baseinfo['time_limit[end]']);
             } else {
                 return error(-1, '使用期限限制错误');
             }
         } else {
             if (!empty($baseinfo['limit'])) {
                 $baseinfo['fixed_begin_term'] = intval($baseinfo['deadline']);
                 $baseinfo['fixed_term'] = intval($baseinfo['limit']);
             } else {
                 return error(-1, '使用期限限制错误');
             }
         }
     }
     $baseinfo['quantity'] = intval($baseinfo['quantity']);
     if (!$baseinfo['quantity']) {
         return error(-1, '卡券库存不能为空或无限制');
     }
     $this->base_info['logo_url'] = urlencode($baseinfo['logo_url']);
     $this->base_info['brand_name'] = urlencode($baseinfo['brand_name']);
     $this->base_info['code_type'] = $baseinfo['code_type'];
     $this->base_info['title'] = urlencode($baseinfo['title']);
     $this->base_info['sub_title'] = urlencode($baseinfo['sub_title']);
     $this->base_info['color'] = $baseinfo['color'];
     $this->base_info['notice'] = urlencode($baseinfo['notice']);
     $this->base_info['service_phone'] = urlencode($baseinfo['service_phone']);
     $this->base_info['description'] = urlencode($baseinfo['description']);
     if ($baseinfo['time_type'] == 1) {
         $this->base_info['date_info'] = array('type' => 1, 'begin_timestamp' => $baseinfo['begin_timestamp'], 'end_timestamp' => $baseinfo['end_timestamp']);
     } else {
         $this->base_info['date_info'] = array('type' => 2, 'fixed_term' => $baseinfo['fixed_term'], 'fixed_begin_term' => $baseinfo['fixed_begin_term']);
     }
     $this->base_info['sku'] = array('quantity' => $baseinfo['quantity']);
     $this->base_info['get_limit'] = intval($baseinfo['get_limit']);
     $this->base_info['can_share'] = intval($baseinfo['can_share']) ? true : false;
     $this->base_info['can_give_friend'] = intval($baseinfo['can_give_friend']) ? true : false;
     if ($baseinfo['is_location'] && $baseinfo['location-select']) {
         $baseinfo['location'] = explode('-', $baseinfo['location-select']);
         if (!empty($baseinfo['location'])) {
             $this->base_info['location_id_list'] = $baseinfo['location'];
         }
     }
     $this->base_info['custom_url_name'] = urlencode('立即使用');
     $this->base_info['custom_url'] = urlencode(murl('wechat/card/use', array(), true, true));
     $this->base_info['custom_url_sub_title'] = '';
     if (!empty($baseinfo['promotion_url_name']) && !empty($baseinfo['promotion_url'])) {
         $this->base_info['promotion_url_name'] = urlencode($baseinfo['promotion_url_name']);
         $this->base_info['promotion_url'] = urlencode($baseinfo['promotion_url']);
         $this->base_info['promotion_url_sub_title'] = urlencode($baseinfo['promotion_url_sub_title']);
     }
     return $this->base_info;
 }
Exemple #9
0
 $params = json_decode(html_entity_decode(urldecode($params)), true);
 if (empty($params)) {
     message('请您先设计手机端页面.', '', 'error');
 }
 $page = $params[0];
 $html = htmlspecialchars_decode($_GPC['wapeditor']['html'], ENT_QUOTES);
 $data = array('uniacid' => $_W['uniacid'], 'multiid' => '0', 'title' => $page['params']['title'], 'description' => $page['params']['description'], 'type' => 3, 'status' => 1, 'params' => json_encode($params), 'html' => $html, 'createtime' => TIMESTAMP);
 $id = pdo_fetchcolumn("SELECT id FROM " . tablename('site_page') . " WHERE uniacid = :uniacid AND type = '3'", array(':uniacid' => $_W['uniacid']));
 if (empty($id)) {
     pdo_insert('site_page', $data);
     $id = pdo_insertid();
 } else {
     pdo_update('site_page', $data, array('id' => $id));
 }
 if (!empty($page['params']['keyword'])) {
     $cover = array('uniacid' => $_W['uniacid'], 'title' => $page['params']['title'], 'keyword' => $page['params']['keyword'], 'url' => murl('mc/home', array(), true, false), 'description' => $page['params']['description'], 'thumb' => $page['params']['cover'], 'module' => 'mc');
     site_cover($cover);
 }
 $nav = json_decode(html_entity_decode(urldecode($_GPC['wapeditor']['nav'])), true);
 if (!empty($nav)) {
     $ids = array(0);
     foreach ($nav as $row) {
         $data = array('uniacid' => $_W['uniacid'], 'name' => $row['name'], 'position' => 2, 'url' => $row['url'], 'icon' => '', 'css' => iserializer($row['css']), 'status' => 1, 'displayorder' => 0);
         if (!empty($row['id'])) {
             pdo_update('site_nav', $data, array('id' => $row['id']));
         } else {
             pdo_insert('site_nav', $data);
             $row['id'] = pdo_insertid();
         }
         $ids[] = $row['id'];
     }
Exemple #10
0
        $signature_tmp = sha1(implode($data));
        if ($signature_tmp != $signature) {
            $error_signature = 1;
        }
        $record = pdo_get('coupon_record', array('acid' => $_W['acid'], 'card_id' => $card_id, 'code' => $code));
    }
    if (checksubmit()) {
        $password = trim($_GPC['password']);
        $clerk = pdo_get('activity_coupon_password', array('uniacid' => $_W['uniacid'], 'password' => $password));
        if (empty($clerk)) {
            message('店员密码错误');
        }
        $status = $coupon->ConsumeCode(array('code' => $code['code']));
        if (is_error($status)) {
            message($status['message']);
        }
        pdo_update('coupon_record', array('status' => 3, 'clerk_id' => $clerk['id'], 'clerk_name' => $clerk['name']), array('acid' => $_W['acid'], 'card_id' => $card_id, 'openid' => $openid, 'code' => $code));
        message('核销微信卡券成功', url('mc/home'), 'success');
    }
}
if ($do == 'qr') {
    require_once '../framework/library/qrcode/phpqrcode.php';
    $errorCorrectionLevel = "L";
    $matrixPointSize = "5";
    $id = intval($_GPC['id']);
    $code = intval($_GPC['code']);
    $url = murl('clerk/wechat', array('uid' => $_W['member']['uid'], 'id' => $id, 'code' => $code), false, true);
    QRcode::png($url, false, $errorCorrectionLevel, $matrixPointSize);
    exit;
}
template('wechat/card');
Exemple #11
0
                }
            }
        });
    }
    function tiaozhuan(url){
        window.location.href=url;
    }

    //点赞功能,ajax方法
    function likeAjax(){
        var mid = $('#mid').val();
        var cid = $('#cid').val();
        $.ajax({
            "type": "post",
            "url": "<?php 
echo murl('entry//like', array('m' => 'amouse_ecard'), true);
?>
",
            "data": {"mid": mid, "cid": cid},
            "dataType": "json",
            "success": function(data){
                if(data.success){
                    if(data.status == 1){
                        $.flytip("点赞成功!");
                        document.getElementById('zan').innerHTML=data.zan;
                        //setTimeout(tiaozhuan(data.guanzhuUrl),30000);
                    }if(data.status == 0){
                        $.flytip("您还没有建立微名片,马上为您跳转到帮助链接");
                        setTimeout("tiaozhuan('"+data.guanzhuUrl+"')",3000)
                    }if(data.status == 2){
                        $.flytip("点赞失败,可能是网络有问题?");
Exemple #12
0
    public function ChooseCard($card_id)
    {
        $acid = $this->account['acid'];
        if (empty($card_id)) {
            return error(-1, '卡券不存在');
        }
        $time = TIMESTAMP;
        $randstr = random(8);
        $sign = array($card_id, $time, $randstr, $this->account['key']);
        $signature = $this->SignatureCard($sign);
        if (is_error($signature)) {
            return $signature;
        }
        $url = murl("wechat/pay/card");
        return <<<EOF
\t\t\twx.ready(function(){
\t\t\t\twx.chooseCard({
\t\t\t\t\tshopId: '',
\t\t\t\t\tcardType: '',
\t\t\t\t\tcardId:'{$card_id}',
\t\t\t\t\ttimestamp:{$time},
\t\t\t\t\tnonceStr:'{$randstr}',
\t\t\t\t\tsignType:'SHA1',
\t\t\t\t\tcardSign:'{$signature}',
\t\t\t\t\tsuccess: function(res) {
\t\t\t\t\t\tif(res.errMsg == 'chooseCard:ok') {
\t\t\t\t\t\t\teval("var rs = " + res.cardList);
\t\t\t\t\t\t\t\$.post('{$url}', {'card_id':rs[0].card_id}, function(data){
\t\t\t\t\t\t\t\tvar data = \$.parseJSON(data);
\t\t\t\t\t\t\t\tif(!data.errno) {
\t\t\t\t\t\t\t\t\tvar card = data.error;
\t\t\t\t\t\t\t\t\tif(card.type == 'discount') {

\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t} else {
\t\t\t\t\t\t\t\t\tu.message('卡券不存在', '', 'error');
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t});
\t\t\t\t\t\t} else {
\t\t\t\t\t\t\tu.message('使用卡券失败', '', 'error');
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t});
\t\t\t});
EOF;
    }
Exemple #13
0
                $alist = pdo_fetchall("SELECT * FROM " . tablename('fineness_article') . " WHERE weid={$weid} AND ccate={$aid}  ORDER BY displayorder ASC limit 8 ");
                if ($alist) {
                    foreach ($alist as $par) {
                        $reply2['title'] = $par['title'];
                        $reply2['description'] = $par['description'];
                        $reply2['thumb'] = $par['thumb'];
                        $reply2['url'] = murl('entry/module/detail', array('m' => 'amouse_article', 'id' => $par[id]));
                        $reply2['rid'] = $rid;
                        pdo_insert('news_reply', $reply2);
                    }
                } else {
                    $reply['title'] = $_GPC['cname'];
                    $reply['description'] = $_GPC['description'];
                    $reply['thumb'] = $_GPC['thumb'];
                    $reply['displayorder'] = $_GPC['displayorder'];
                    $reply['url'] = murl('entry/module/index', array('m' => 'amouse_article', 'cid' => $aid));
                    pdo_insert('news_reply', $reply);
                }
            }
        }
        message('更新分类成功!', $this->createWebUrl('category', array('do' => 'display')), 'success');
    }
} elseif ($op == 'fetch') {
    $category = pdo_fetchall("SELECT id, name FROM " . tablename('fineness_article_category') . " WHERE parentid = '" . intval($_GPC['parentid']) . "' ORDER BY id ASC, displayorder ASC, id ASC ");
    message($category, '', 'ajax');
} elseif ($op == 'delete') {
    load()->func('file');
    $id = intval($_GPC['id']);
    pdo_delete('fineness_article_category', array('id' => $id));
    message('分类删除成功!', $this->createWebUrl('category', array('do' => 'display')), 'success');
}
Exemple #14
0
    public function sendmessage($content, $openid)
    {
        global $_W, $_GPC;
        $weid = $_W['weid'];
        $cfg = $this->module['config'];
        $appid = $cfg['appid'];
        $secret = $cfg['secret'];
        $img = $_W['attachurl'] . $cfg['kefuimg'];
        $id = $_W['openid'];
        //当前粉丝$openid为发送者
        $res = $this->getusers($weid, $id);
        load()->classs('weixin.account');
        $accObj = WeixinAccount::create($_W['account']['acid']);
        $access_token = $accObj->fetch_token();
        $token2 = $access_token;
        $title = $res['nickname'] . '给你发来新消息了!';
        $fans = pdo_fetch('SELECT salt,acid,openid FROM ' . tablename('mc_mapping_fans') . ' WHERE uniacid = :uniacid AND openid = :openid', array(':uniacid' => $weid, ':openid' => $openid));
        $pass['time'] = TIMESTAMP;
        $pass['acid'] = $fans['acid'];
        $pass['openid'] = $fans['openid'];
        $pass['hash'] = md5("{$fans['openid']}{$pass['time']}{$fans['salt']}{$_W['config']['setting']['authkey']}");
        $auth = base64_encode(json_encode($pass));
        $vars = array();
        $vars['__auth'] = $auth;
        $vars['forward'] = base64_encode($this->createMobileUrl('hitmail', array('toname' => $res['nickname'], 'toopenid' => $id)));
        $url2 = $_W['siteroot'] . 'app/' . murl('auth/forward', $vars);
        $data = '{
										"touser":"******",
										"msgtype":"news",
										"news":{
											"articles": [
											 {
												 "title":"' . $title . '",
												 "description":"' . $title . '",
												 "url":"' . $url2 . '",
												 "picurl":"' . $img . '",
											 }
											 ]
										}
									}';
        $url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" . $token2;
        load()->func('communication');
        $it = ihttp_post($url, $data);
    }
Exemple #15
0
        message('访问错误');
    }
    $sql = 'SELECT * FROM ' . tablename('modules_bindings') . ' WHERE `eid`=:eid';
    $pars = array();
    $pars[':eid'] = $eid;
    $entry = pdo_fetch($sql, $pars);
    if (empty($entry) || $entry['entry'] != 'cover') {
        message('访问错误');
    }
    load()->model('module');
    $module = module_fetch($entry['module']);
    if (empty($module)) {
        message('访问错误');
    }
    $entry['url'] = murl('entry', array('do' => $entry['do'], 'm' => $entry['module']));
    $entry['url_show'] = murl('entry', array('do' => $entry['do'], 'm' => $entry['module']), true, true);
    $cover['title'] = $entry['title'];
    define('FRAME', 'ext');
    $types = module_types();
    if (!$GLOBALS['ext_type']) {
        define('ACTIVE_FRAME_URL', url('platform/cover', array('eid' => $entry['eid'])));
    } else {
        echo 8;
        define('ACTIVE_FRAME_URL', url('home/welcome/ext', array('m' => $entry['module'])));
    }
    $frames = buildframes(array(FRAME));
    $frames = $frames[FRAME];
}
$sql = "SELECT * FROM " . tablename('cover_reply') . ' WHERE `module` = :module AND `do` = :do AND uniacid = :uniacid';
$pars = array();
$pars[':module'] = $entry['module'];
Exemple #16
0
 public function doMobilePtjpostinfo()
 {
     //发布信息内容
     global $_W, $_GPC;
     load()->func('tpl');
     load()->model('mc');
     load()->func('file');
     $uid = mc_openid2uid($_W['openid']);
     $creditarray = mc_credit_fetch($uid);
     $credit = $creditarray['credit1'];
     $ground = $_GPC['ground'];
     $type = $_GPC['type'];
     $user = $this->DboperateSearchUser($_W['openid']);
     if ($_GPC) {
         $title = $_GPC['title'];
         $content = $_GPC['description'];
         $privacy = $_GPC['top'] == 'on' ? 1 : 0;
         $c_pay = $_GPC['credit'];
         $phone = $_GPC['default_tel'] != '' ? $_GPC['default_tel'] : $_GPC['new_tel'];
         if ($_FILES['pic1']['name']) {
             $pic1 = file_upload($_FILES['pic1'], 'image');
             $path1 = tomedia($pic1['path']);
         }
         if ($_FILES['pic2']['name']) {
             $pic2 = file_upload($_FILES['pic2'], 'image');
             $path2 = tomedia($pic2['path']);
         }
         if ($_FILES['pic3']['name']) {
             $pic3 = file_upload($_FILES['pic3'], 'image');
             $path3 = tomedia($pic3['path']);
         }
         //检测状态
         if ($title != "" and $content != "" and $phone != "" and $credit >= floatval($c_pay)) {
             //判断置顶招聘是否已满
             if ($privacy and $this->GetPrivacyNum() > 10) {
                 message('置顶招聘已满...请稍后重试!', '', 'warning');
                 exit;
             } else {
                 if ($privacy and $credit >= 100) {
                     $value = mc_credit_update(mc_openid2uid($_W['openid']), 'credit1', -100);
                     $this->SendTpl($_W['openid'], $user, 'credit1', $credit - 100);
                 } else {
                     if ($privacy) {
                         message('积分不足,您无权进行此操作,请前往个人中心充值。如有问题,请与管理员联系!');
                         exit;
                     }
                 }
             }
             $jobid = substr(md5(substr(time(), 4, 8)), 4, 9);
             $t = $this->DboperateInsertGroundInfo($_W['openid'], $jobid, $title, $content, $phone, $privacy, $path1, $path2, $path3, intval($c_pay), $type);
             if ($t) {
                 $url = murl('entry//ptjindex', array('m' => $this->modulename));
                 echo "<script>\r\n        \t\t\tlocation.href='{$url}';\r\n        \t\t\t</script>";
             }
         } else {
             if ($credit < floatval($c_pay)) {
                 message('积分不足,请前往个人中心充值。如有问题,请与管理员联系!', 'referer');
             }
         }
     }
     include $this->template('postinfo');
 }
Exemple #17
0
					<input type="submit" class="btn btn-primary" name="submit" value="提交" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">模板预览</label>
				<div class="col-sm-9 col-xs-12">
					<iframe scrolling="yes" allowtransparency="true" src="../app/<?php 
echo murl('utility/preview/shortcut', array('file' => !empty($quickmenu['template']) ? $quickmenu['template'] : 'default', 't' => $id));
?>
" id="preview" style="width: 320px; height: 480px; border:1px solid #eee;"></iframe>
				</div>
			</div>
		</div>
	</div>
</div>
</form>
<script type="text/javascript">
	function preview(name) {
		var id = "<?php 
echo $id;
?>
";
		var url = "../app/<?php 
echo murl('utility/preview/shortcut');
?>
file=" + name + '&t=' + id;
		$('#preview').attr('src', url);
	}
</script>
<?php 
!empty($this) && $this instanceof WeModuleSite || 0 ? include $this->template('common/footer', TEMPLATE_INCLUDEPATH) : (include template('common/footer', TEMPLATE_INCLUDEPATH));
Exemple #18
0
<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
checkauth();
load()->model('activity');
load()->model('mc');
$creditnames = array();
$unisettings = uni_setting($uniacid, array('creditnames'));
if (!empty($unisettings) && !empty($unisettings['creditnames'])) {
    foreach ($unisettings['creditnames'] as $key => $credit) {
        $creditnames[$key] = $credit['title'];
    }
}
$sql = 'SELECT `status` FROM ' . tablename('mc_card') . " WHERE `uniacid` = :uniacid";
$cardstatus = pdo_fetch($sql, array(':uniacid' => $_W['uniacid']));
if ($do == 'token_qrcode') {
    require_once '../framework/library/qrcode/phpqrcode.php';
    $errorCorrectionLevel = "L";
    $matrixPointSize = "8";
    $token_id = intval($_GPC['id']);
    $url = $_W['siteroot'] . 'app' . ltrim(murl('clerk/token', array('uid' => $_W['member']['uid'], 'id' => $token_id)), '.');
    QRcode::png($url, false, $errorCorrectionLevel, $matrixPointSize);
    exit;
}
Exemple #19
0
    protected function click($params = array())
    {
        global $_W;
        $url = murl('utility/click', array('module' => $params['module'], 'action' => $params['action'], 'sign' => $params['sign'], 'tuid' => $params['tuid'], 'fuid' => $params['fuid']));
        echo <<<EOF
\t\t<script>
\t\t\tvar url = "{$url}";
\t\t\t\$.post(url);
\t\t</script>
EOF;
    }
Exemple #20
0
 }
 if (empty($id)) {
     if (!empty($keywords)) {
         pdo_insert('rule', $rule);
         $rid = pdo_insertid();
         foreach ($keywords as $li) {
             $li['rid'] = $rid;
             pdo_insert('rule_keyword', $li);
         }
         $reply['rid'] = $rid;
         pdo_insert('news_reply', $reply);
         $data['rid'] = $rid;
     }
     pdo_insert('site_article', $data);
     $aid = pdo_insertid();
     pdo_update('news_reply', array('url' => murl('site/site/detail', array('id' => $aid))), array('rid' => $rid));
 } else {
     unset($data['createtime']);
     pdo_delete('rule', array('id' => $item['rid'], 'uniacid' => $_W['uniacid']));
     pdo_delete('rule_keyword', array('rid' => $item['rid'], 'uniacid' => $_W['uniacid']));
     pdo_delete('news_reply', array('rid' => $item['rid']));
     if (!empty($keywords)) {
         pdo_insert('rule', $rule);
         $rid = pdo_insertid();
         foreach ($keywords as $li) {
             $li['rid'] = $rid;
             pdo_insert('rule_keyword', $li);
         }
         $reply['rid'] = $rid;
         pdo_insert('news_reply', $reply);
         $data['rid'] = $rid;
Exemple #21
0
?>
"+ "&id=" + id;
			$.getJSON(url, function(s){
				$("#item_" + s.cartid).remove();
				if($(".shopcart-item").length<=0){
					$("#cartempty").show();
					$("#cartfooter").hide();
				}
				tip_close();
				canculate();
			});
		}
	}
	function updateCart(id,num){
		var url = "<?php 
echo murl('entry//mycart', array('m' => 'wdl_shopping', 'op' => 'update'), true);
?>
"+ "&id=" + id+"&num=" + num;
		$.getJSON(url, function(s){

		});
	}
	function checkMaxBuy(id, maxbuy){

	}
	function addNum(id,maxbuy){
		var mb = maxbuy;
		 var stock =$("#stock_" + id).html()==''?-1:parseInt($("#stock_" + id).html());
				if(mb>stock && stock!=-1){
					mb = stock;
				}
function module_app_entries($name, $types = array(), $args = null)
{
    $ts = array('rule', 'cover', 'menu', 'home', 'profile', 'shortcut', 'function');
    if (empty($types)) {
        $types = $ts;
    } else {
        $types = array_intersect($types, $ts);
    }
    $fields = implode("','", $types);
    $sql = 'SELECT * FROM ' . tablename('modules_bindings') . " WHERE `module`=:module AND `entry` IN ('{$fields}') ORDER BY eid ASC";
    $pars = array();
    $pars[':module'] = $name;
    $bindings = pdo_fetchall($sql, $pars);
    $entries = array();
    foreach ($bindings as $bind) {
        if (!empty($bind['call'])) {
            $extra = array();
            $extra['Host'] = $_SERVER['HTTP_HOST'];
            load()->func('communication');
            $urlset = parse_url($_W['siteurl']);
            $urlset = pathinfo($urlset['path']);
            $response = ihttp_request('http://127.0.0.1/' . $urlset['dirname'] . '/' . url('utility/bindcall', array('modulename' => $bind['module'], 'callname' => $bind['call'], 'args' => $args, 'uniacid' => $_W['uniacid'])), array('W' => base64_encode(iserializer($_W))));
            if (is_error($response)) {
                continue;
            }
            $response = json_decode($response['content'], true);
            $ret = $response['message'];
            if (is_array($ret)) {
                foreach ($ret as $et) {
                    $et['url'] .= '&__title=' . urlencode($et['title']);
                    $entries[$bind['entry']][] = array('title' => $et['title'], 'url' => $et['url'], 'from' => 'call');
                }
            }
        } else {
            if ($bind['entry'] == 'cover') {
                $url = murl("entry", array('eid' => $bind['eid']));
            }
            if ($bind['entry'] == 'home') {
                $url = murl("entry", array('eid' => $bind['eid']));
            }
            if ($bind['entry'] == 'profile') {
                $url = murl("entry", array('eid' => $bind['eid']));
            }
            if ($bind['entry'] == 'shortcut') {
                $url = murl("entry", array('eid' => $bind['eid']));
            }
            $entries[$bind['entry']][] = array('title' => $bind['title'], 'url' => $url, 'from' => 'define');
        }
    }
    return $entries;
}
Exemple #23
0
             $row = array();
             $row['title'] = urlencode($c['title']);
             $row['description'] = urlencode($c['description']);
             !empty($c['thumb']) && ($row['picurl'] = tomedia($c['thumb']));
             if (strexists($c['url'], 'http://') || strexists($c['url'], 'https://')) {
                 $row['url'] = $c['url'];
             } else {
                 $pass['time'] = TIMESTAMP;
                 $pass['acid'] = $fans['acid'];
                 $pass['openid'] = $fans['openid'];
                 $pass['hash'] = md5("{$fans['openid']}{$pass['time']}{$fans['salt']}{$_W['config']['setting']['authkey']}");
                 $auth = base64_encode(json_encode($pass));
                 $vars = array();
                 $vars['__auth'] = $auth;
                 $vars['forward'] = base64_encode($c['url']);
                 $row['url'] = $_W['siteroot'] . 'app/' . murl('auth/forward', $vars);
             }
             $news[] = $row;
         }
         $send['news']['articles'] = $news;
     } else {
         $idata = array();
         $send['news'] = '';
     }
 }
 if ($acid) {
     $acc = WeAccount::create($acid);
     $data = $acc->sendCustomNotice($send);
     if (is_error($data)) {
         exit(json_encode(array('status' => 'error', 'message' => $data['message'])));
     } else {
Exemple #24
0
                $tips .= "打{$rate}折";
            } else {
                $tips .= "减{$discount[$_W['member']['groupid']]['discount']}元";
            }
            $mine_discount = $discount[$_W['member']['groupid']];
        }
    }
    $url = $_W['siteroot'] . 'app' . ltrim(murl('clerk/card', array('uid' => $_W['member']['uid'])), '.');
    template('mc/consume');
    exit;
}
if ($do == 'card_qrcode') {
    require_once '../framework/library/qrcode/phpqrcode.php';
    $errorCorrectionLevel = "L";
    $matrixPointSize = "8";
    $url = $_W['siteroot'] . 'app' . ltrim(murl('clerk/card', array('uid' => $_W['member']['uid'])), '.');
    QRcode::png($url, false, $errorCorrectionLevel, $matrixPointSize);
    exit;
}
if ($do == 'barcode') {
    $cardsn = $_W['member']['uid'];
    $barcode_path = '../framework/library/barcode/';
    require_once $barcode_path . 'class/BCGFontFile.php';
    require_once $barcode_path . 'class/BCGColor.php';
    require_once $barcode_path . 'class/BCGDrawing.php';
    require_once $barcode_path . 'class/BCGcode39.barcode.php';
    $color_black = new BCGColor(0, 0, 0);
    $color_white = new BCGColor(255, 255, 255);
    $drawException = null;
    try {
        $code = new BCGcode39();
Exemple #25
0
 public function payResult($params)
 {
     global $_W;
     load()->model('mc');
     $order = pdo_fetch("SELECT * FROM " . tablename('mc_credits_recharge') . " WHERE tid = :tid", array(':tid' => $params['tid']));
     if (empty($order['status'])) {
         $fee = $params['fee'];
         $total_fee = $fee;
         $data = array('status' => $params['result'] == 'success' ? 1 : -1);
         if ($params['type'] == 'wechat') {
             $data['transid'] = $params['tag']['transaction_id'];
             $params['user'] = mc_openid2uid($params['user']);
         }
         pdo_update('mc_credits_recharge', $data, array('tid' => $params['tid']));
         if ($params['result'] == 'success' && $params['from'] == 'notify') {
             $paydata = array('wechat' => '微信', 'alipay' => '支付宝', 'baifubao' => '百付宝', 'unionpay' => '银联');
             if (empty($order['type']) || $order['type'] == 'credit') {
                 $setting = uni_setting($_W['uniacid'], array('creditbehaviors', 'recharge'));
                 $credit = $setting['creditbehaviors']['currency'];
                 if (empty($credit)) {
                     message('站点积分行为参数配置错误,请联系服务商', '', 'error');
                 } else {
                     $recharge = $setting['recharge'];
                     $add_fee = 0;
                     if (!empty($recharge)) {
                         $back = -1;
                         foreach ($recharge as $k => $li) {
                             if ($li['recharge'] <= $fee) {
                                 $back = $k;
                             }
                         }
                         if (!empty($recharge[$back])) {
                             $add_fee = $recharge[$back]['back'];
                             $total_fee = $add_fee + $fee;
                             $add_str = ",满足 充{$recharge[$back]['recharge']}返{$recharge[$back]['back']},返余额{$recharge[$back]['back']}元,本次操作共增加余额{$total_fee}元";
                         }
                     }
                     $record[] = $params['user'];
                     $record[] = '用户通过' . $paydata[$params['type']] . '充值' . $fee . $add_str;
                     mc_credit_update($order['uid'], $credit, $total_fee, $record);
                     $remark = '用户通过' . $paydata[$params['type']] . '充值' . $fee . $add_str;
                     mc_notice_recharge($order['openid'], $order['uid'], $total_fee, '', $remark);
                 }
             }
             if ($order['type'] == 'card_nums') {
                 $member_card = pdo_get('mc_card_members', array('uniacid' => $order['uniacid'], 'uid' => $order['uid']));
                 $total_num = $member_card['nums'] + $order['tag'];
                 pdo_update('mc_card_members', array('nums' => $total_num), array('uniacid' => $order['uniacid'], 'uid' => $order['uid']));
                 $log = array('uniacid' => $order['uniacid'], 'uid' => $order['uid'], 'type' => 'nums', 'fee' => $params['fee'], 'model' => '1', 'tag' => $order['tag'], 'note' => date('Y-m-d H:i') . "通过{$paydata[$params['type']]}充值{$params['fee']}元,返{$order['tag']}次,总共剩余{$total_num}次", 'addtime' => TIMESTAMP);
                 pdo_insert('mc_card_record', $log);
                 $type = pdo_fetchcolumn('SELECT nums_text FROM ' . tablename('mc_card') . ' WHERE uniacid = :uniacid', array(':uniacid' => $order['uniacid']));
                 $total_num = $member_card['nums'] + $order['tag'];
                 mc_notice_nums_plus($order['openid'], $type, $order['tag'], $total_num);
             }
             if ($order['type'] == 'card_times') {
                 $member_card = pdo_get('mc_card_members', array('uniacid' => $order['uniacid'], 'uid' => $order['uid']));
                 if ($member_card['endtime'] > TIMESTAMP) {
                     $endtime = $member_card['endtime'] + $order['tag'] * 86400;
                 } else {
                     $endtime = strtotime($order['tag'] . 'days');
                 }
                 pdo_update('mc_card_members', array('endtime' => $endtime), array('uniacid' => $order['uniacid'], 'uid' => $order['uid']));
                 $log = array('uniacid' => $order['uniacid'], 'uid' => $order['uid'], 'type' => 'times', 'model' => '1', 'fee' => $params['fee'], 'tag' => $order['tag'], 'note' => date('Y-m-d H:i') . "通过{$paydata[$params['type']]}充值{$params['fee']}元,返{$order['tag']}天,充值后到期时间:" . date('Y-m-d', $endtime), 'addtime' => TIMESTAMP);
                 pdo_insert('mc_card_record', $log);
                 $type = pdo_fetchcolumn('SELECT times_text FROM ' . tablename('mc_card') . ' WHERE uniacid = :uniacid', array(':uniacid' => $order['uniacid']));
                 $endtime = date('Y-m-d', $endtime);
                 mc_notice_times_plus($order['openid'], $member_card['cardsn'], $type, $fee, $order['tag'], $endtime);
             }
         }
     }
     if ($order['type'] == 'credit' || $order['type'] == '') {
         $url = murl('mc/home');
     } else {
         $url = murl('mc/bond/mycard');
     }
     if ($params['from'] == 'return') {
         if ($params['result'] == 'success') {
             message('支付成功!', '../../app/' . $url, 'success');
         } else {
             message('支付失败!', '../../app/' . $url, 'error');
         }
     }
 }
Exemple #26
0
 }
 if (empty($id)) {
     if (!empty($_GPC['keyword'])) {
         pdo_insert('rule', $rule);
         $rid = pdo_insertid();
         $keyword['rid'] = $rid;
         pdo_insert('rule_keyword', $keyword);
         $kid = pdo_insertid();
         $reply['rid'] = $rid;
         pdo_insert('news_reply', $reply);
         $data['rid'] = $rid;
         $data['kid'] = $kid;
     }
     pdo_insert('fineness_article', $data);
     $aid = pdo_insertid();
     pdo_update('news_reply', array('url' => murl('entry/module/detail', array('m' => 'amouse_article', 'id' => $aid))), array('rid' => $rid));
 } else {
     unset($data['createtime']);
     pdo_delete('rule', array('id' => $item['rid'], 'uniacid' => $_W['uniacid']));
     pdo_delete('rule_keyword', array('rid' => $item['rid'], 'uniacid' => $_W['uniacid']));
     pdo_delete('news_reply', array('rid' => $item['rid']));
     if (!empty($_GPC['keyword'])) {
         pdo_insert('rule', $rule);
         $rid = pdo_insertid();
         $keyword['rid'] = $rid;
         pdo_insert('rule_keyword', $keyword);
         $kid = pdo_insertid();
         $reply['rid'] = $rid;
         pdo_insert('news_reply', $reply);
         $data['rid'] = $rid;
         $data['kid'] = $kid;
 protected function createMobileUrl($do, $query = array())
 {
     $query['do'] = $do;
     $query['m'] = strtolower($this->modulename);
     return murl('entry', $query);
 }
Exemple #28
0
load()->model('module');
$modulemenus = array();
$modules = uni_modules();
foreach ($modules as &$module) {
    if ($module['type'] == 'system') {
        continue;
    }
    $entries = module_app_entries($module['name'], array('home', 'profile', 'shortcut', 'function', 'cover'));
    if (empty($entries)) {
        continue;
    }
    $module['cover'] = $entries['cover'];
    $module['home'] = $entries['home'];
    $module['profile'] = $entries['profile'];
    $module['shortcut'] = $entries['shortcut'];
    $module['function'] = $entries['function'];
    if ($module['type'] == '') {
        $module['type'] = 'other';
    }
    $modulemenus[$module['type']][$module['name']] = $module;
}
$modtypes = module_types();
$sysmenus = array(array('title' => '微站首页', 'url' => murl('home')), array('title' => '个人中心', 'url' => murl('mc')));
$multis = pdo_fetchall('SELECT id,title FROM ' . tablename('site_multi') . ' WHERE uniacid = :uniacid AND status != 0', array(':uniacid' => $_W['uniacid']));
if (!empty($multis)) {
    foreach ($multis as $multi) {
        $multimenus[] = array('title' => $multi['title'], 'url' => murl('home', array('t' => $multi['id'])));
    }
}
$linktypes = array('cover' => '封面链接', 'home' => '微站首页导航', 'profile' => '微站个人中心导航', 'shortcut' => '微站快捷功能导航', 'function' => '微站独立功能');
template('utility/link');
Exemple #29
0
function mc_notice_group($openid, $old_group, $now_group, $url = '', $remark = '点击查看详情')
{
    global $_W;
    $acc = mc_notice_init();
    if (is_error($acc)) {
        return error(-1, $acc['message']);
    }
    if (!$acc->noticetpl['group']['switch']) {
        return error(-1, '未开启通知');
    }
    $time = date('Y-m-d H:i');
    if (empty($url)) {
        $url = murl('mc/home', array(), true, true);
    }
    if ($_W['account']['level'] == 4) {
        if ($acc->noticetpl['group']['type'] == 2) {
            $data = array('first' => array('value' => "您好,您的会员组变更为{$now_group}", 'color' => '#ff510'), 'grade1' => array('value' => $old_group, 'color' => '#ff510'), 'grade2' => array('value' => $now_group, 'color' => '#ff510'), 'time' => array('value' => $time, 'color' => '#ff510'), 'remark' => array('value' => "{$remark}", 'color' => '#ff510'));
            $status = $acc->sendTplNotice($openid, $acc->noticetpl['group'], $data, $url);
        } else {
            $content = "您的会员等级在{$time}由{$old_group}变更为{$now_group}。";
            $status = mc_notice_public($openid, '会员组变更通知', $_W['account']['name'], $content, $url);
        }
    }
    if ($_W['account']['level'] == 3) {
        $info = "【{$_W['account']['name']}】会员组变更通知\n";
        $info .= "您的会员等级在{$time}由{$old_group}变更为{$now_group}。\n";
        $info .= !empty($remark) ? "备注:{$remark}\n\n" : '';
        $custom = array('msgtype' => 'text', 'text' => array('content' => urlencode($info)), 'touser' => $openid);
        $status = $acc->sendCustomNotice($custom);
    }
    return $status;
}
Exemple #30
0
						var url = arr[0];
						if(url.slice(-1) != '&') {
							url += '&';
						}
						if(url.indexOf('?') != -1) {
							url += ('s=' + styleid);
						}
						if(arr[1]) {
							url += ('#' + arr[1]);
						}
						if (url.substr(0, 10) == 'javascript' || url.indexOf('?') == -1) {
							url = url.substr(0, url.lastIndexOf('&'));
						}
						$(this).attr('href', url);
					}
				});
			});
			var url = '../app/<?php 
    echo murl('home');
    ?>
&s=' + styleid;
			dialog.find('iframe').attr('src', url);
			dialog.find('.modal-dialog').css({'width': '322px'});
			dialog.find('.modal-body').css({'padding': '0', 'height': '480px'});
			dialog.modal('show');
		});
	}
</script>
<?php 
}
!empty($this) && $this instanceof WeModuleSite || 0 ? include $this->template('common/footer', TEMPLATE_INCLUDEPATH) : (include template('common/footer', TEMPLATE_INCLUDEPATH));