Example #1
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $reply = pdo_fetch("SELECT * FROM " . tablename('vote_reply') . " WHERE `rid`=:rid LIMIT 1", array(':rid' => $rid));
     if ($reply == false) {
         return $this->respText('活动已经取消...');
     }
     $nowtime = time();
     $endtime = $reply['endtime'] + 86399;
     if ($reply['status'] == 0) {
         return $this->respText("投票已暂停,请等待...");
     }
     if ($reply['votelimit'] == 1) {
         if ($reply['votetotal'] > 0 && $reply['votenum'] >= $reply['votetotal']) {
             return $this->respText("投票人数已满,活动结束...");
         }
     } else {
         if ($reply['starttime'] > $nowtime) {
             return $this->respText("投票未开始,请等待...");
         } elseif ($endtime < $nowtime) {
             return $this->respText("投票已结束...");
         } else {
             //                if ($reply['status'] != 1) {
             //                     return $this->respText("投票已暂停,请等待...");
             //                }
         }
     }
     return $this->respNews(array('Title' => $reply['title'], 'Description' => $reply['description'], 'PicUrl' => tomedia($reply['thumb']), 'Url' => $this->createMobileUrl("index", array("id" => $rid))));
 }
Example #2
0
 public function setHeader()
 {
     global $_W, $_GPC;
     $_var_0 = m('user')->getOpenid();
     $_var_1 = m('user')->followed($_var_0);
     @session_start();
     if (!$_var_1) {
         $_var_2 = intval($_GPC['mid']);
         $_var_3 = m('common')->getSysset();
         $this->header = array('url' => $_var_3['share']['followurl']);
         $_var_4 = false;
         if (!empty($_var_2)) {
             if (!empty($_SESSION[EWEI_SHOP_PREFIX . '_shareid']) && $_SESSION[EWEI_SHOP_PREFIX . '_shareid'] == $_var_2) {
                 $_var_2 = $_SESSION[EWEI_SHOP_PREFIX . '_shareid'];
             }
             $_var_5 = m('member')->getMember($_var_2);
             if (!empty($_var_5)) {
                 $_SESSION[EWEI_SHOP_PREFIX . '_shareid'] = $_var_2;
                 $_var_4 = true;
                 $this->header['icon'] = $_var_5['avatar'];
                 $this->header['text'] = '来自好友 <span>' . $_var_5['nickname'] . '</span> 的推荐';
             }
         }
         if (!$_var_4) {
             $this->header['icon'] = tomedia($_var_3['shop']['logo']);
             $this->header['text'] = '欢迎进入 <span>' . $_var_3['shop']['name'] . '</span>';
         }
     }
 }
Example #3
0
 public function doMobileIndex()
 {
     global $_W, $_GPC;
     // 分享量
     if ($_W['isajax'] && $_GPC['op'] == 'share') {
         pdo_query("UPDATE " . tablename('qiyue_qiuqian') . " SET sharenum=sharenum+1 WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
         message(array('error_code' => 0), '', 'ajax');
     }
     $qian_r = pdo_fetch("SELECT * FROM " . tablename('qiyue_qiuqian') . " WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
     $morepic = array();
     $imgcount = 0;
     if ($qian_r['morepic']) {
         $f_exp = "::::::";
         $r_exp = PHP_EOL;
         $rr = explode($r_exp, $qian_r['morepic']);
         $imgcount = count($rr);
         for ($i = 0; $i < $imgcount; $i++) {
             $fr = explode($f_exp, $rr[$i]);
             $morepic[] = array('title' => $fr['1'], 'url' => tomedia($fr['0']));
         }
     }
     $_share = $this->module['config'];
     unset($_share['cnzzid']);
     // 去掉CNZZ
     $cnzzid = $this->module['config']['cnzzid'];
     // 增加浏览量
     pdo_query("UPDATE " . tablename('qiyue_qiuqian') . " SET viewnum=viewnum+1 WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
     include $this->template('index');
 }
Example #4
0
 public function respond()
 {
     $rid = $this->rule;
     $fromuser = $this->message['from'];
     if (!empty($rid)) {
         $reply = pdo_fetch("SELECT * FROM " . tablename($this->table_reply) . " WHERE rid = :rid", array(':rid' => $rid));
         if ($reply) {
             if ($reply['starttime'] > time()) {
                 //检测时间是否开始
                 return $this->respText("本次活动尚未开始,敬请期待!");
             } elseif ($reply['endtime'] < time() || $reply['endtime'] == 0) {
                 //检测时间是否结束或者状态是否为结束
                 return $this->respText("本次活动已经结束,请关注我们后续的活动!");
             } elseif ($reply['endtime'] == 2) {
                 //检测状态是否暂停
                 return $this->respText("本次活动暂停中");
             } else {
                 //活动大状态正常 检测每天的时间是否正常
                 $news = array();
                 $news[] = array('title' => $reply['title'], 'description' => $reply['description'], 'picurl' => tomedia($reply['thumb']), 'url' => $this->createMobileUrl('main', array('id' => $reply['id'])));
                 return $this->respNews($news);
             }
         }
     }
     return null;
 }
Example #5
0
 public function fieldsFormDisplay($rid = 0)
 {
     global $_W;
     load()->func('tpl');
     $replies = array();
     $replies = pdo_fetchall("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid AND parent_id = -1 ORDER BY `displayorder` DESC, id ASC", array(':rid' => $rid));
     if (!empty($replies)) {
         $parent_id = $replies[0]['id'];
         pdo_update($this->tablename, array('parent_id' => $parent_id), array('rid' => $rid));
         pdo_update($this->tablename, array('parent_id' => 0), array('rid' => $rid, 'id' => $parent_id));
     }
     $rows = pdo_fetchall("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid ORDER BY `parent_id` ASC, `id` ASC", array(':rid' => $rid));
     $replies = array();
     foreach ($rows as &$row) {
         if (!empty($row['thumb'])) {
             $row['thumb'] = tomedia($row['thumb']);
         }
         if (empty($row['parent_id'])) {
             $replies[$row['id']][] = $row;
         } else {
             $replies[$row['parent_id']][] = $row;
         }
     }
     $replies = array_values($replies);
     include $this->template('display');
 }
Example #6
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('news_reply') . " WHERE rid = :id AND parent_id = -1 ORDER BY displayorder DESC, id ASC LIMIT 8";
     $commends = pdo_fetchall($sql, array(':id' => $rid));
     if (empty($commends)) {
         $sql = "SELECT * FROM " . tablename('news_reply') . " WHERE rid = :id AND parent_id = 0 ORDER BY RAND()";
         $main = pdo_fetch($sql, array(':id' => $rid));
         if (empty($main['id'])) {
             return false;
         }
         $sql = "SELECT * FROM " . tablename('news_reply') . " WHERE id = :id OR parent_id = :parent_id ORDER BY parent_id ASC, displayorder DESC, id ASC LIMIT 8";
         $commends = pdo_fetchall($sql, array(':id' => $main['id'], ':parent_id' => $main['id']));
     }
     if (empty($commends)) {
         return false;
     }
     $news = array();
     foreach ($commends as $c) {
         $row = array();
         $row['title'] = $c['title'];
         $row['description'] = $c['description'];
         !empty($c['thumb']) && ($row['picurl'] = tomedia($c['thumb']));
         $row['url'] = empty($c['url']) ? $this->createMobileUrl('detail', array('id' => $c['id'])) : $c['url'];
         $news[] = $row;
     }
     return $this->respNews($news);
 }
Example #7
0
function tpl_form_field_image($name, $value = '')
{
    $thumb = empty($value) ? 'images/global/nopic.jpg' : $value;
    $thumb = tomedia($thumb);
    $html = <<<EOF

<div class="input-group">
\t<input type="text" name="{$name}" value="{$value}" class="form-control" autocomplete="off" readonly="readonly">
\t<span class="input-group-btn">
\t\t<button class="btn btn-default" onclick="appupload(this)" type="button">上传图片</button>
\t</span>
</div>
<span class="help-block">
\t<img style="max-height:100px;" src="{$thumb}" >
</span>

<script>
window.appupload = window.appupload || function(obj){
\trequire(['jquery', 'util'], function(\$, u){
\t\tu.image(obj, function(url){
\t\t\t\$(obj).parent().prev().val(url.attachment);
\t\t\t\$(obj).parent().parent().next().find('img').attr('src',url.url);
\t\t});
\t});
}
</script>

EOF;
    return $html;
}
Example #8
0
 public function setHeader()
 {
     global $_W, $_GPC;
     $openid = m('user')->getOpenid();
     $followed = m('user')->followed($openid);
     @session_start();
     if (!$followed) {
         $mid = intval($_GPC['mid']);
         $set = m('common')->getSysset();
         $this->header = array('url' => $set['share']['followurl']);
         $friend = false;
         if (!empty($mid)) {
             if (!empty($_SESSION[EWEI_SHOP_PREFIX . '_shareid']) && $_SESSION[EWEI_SHOP_PREFIX . '_shareid'] == $mid) {
                 $mid = $_SESSION[EWEI_SHOP_PREFIX . '_shareid'];
             }
             $member = m('member')->getMember($mid);
             if (!empty($member)) {
                 $_SESSION[EWEI_SHOP_PREFIX . '_shareid'] = $mid;
                 $friend = true;
                 $this->header['icon'] = $member['avatar'];
                 $this->header['text'] = '来自好友 <span>' . $member['nickname'] . '</span> 的推荐';
             }
         }
         if (!$friend) {
             $this->header['icon'] = tomedia($set['shop']['logo']);
             $this->header['text'] = '欢迎进入 <span>' . $set['shop']['name'] . '</span>';
         }
     }
 }
Example #9
0
 public function doWebSetting()
 {
     global $_W, $_GPC;
     checklogin();
     load()->func('tpl');
     $item = pdo_fetch("SELECT * FROM " . tablename($this->modulename . '_setting') . " WHERE weid = :weid", array(':weid' => $_W['uniacid']));
     if (!empty($item)) {
         if (!empty($item['share_image'])) {
             $share_image = tomedia($item['share_image']);
         }
     }
     if (checksubmit('submit')) {
         $data = array('weid' => $_W['weid'], 'share_title' => trim($_GPC['share_title']), 'share_desc' => trim($_GPC['share_desc']), 'share_cancel' => trim($_GPC['share_cancel']), 'share_url' => trim($_GPC['share_url']), 'follow_url' => trim($_GPC['follow_url']));
         if (!empty($_GPC['share_image'])) {
             $data['share_image'] = $_GPC['share_image'];
             load()->func('file');
             file_delete($_GPC['share_image-old']);
         }
         if (!empty($item)) {
             pdo_update($this->modulename . '_setting', $data, array('weid' => $_W['uniacid']));
         } else {
             pdo_insert($this->modulename . '_setting', $data);
         }
         message('更新成功!', $this->createWebUrl('setting'), 'success');
     }
     include $this->template('setting');
 }
Example #10
0
 public function settingsDisplay($settings)
 {
     global $_W, $_GPC;
     load()->func('file');
     $_W['page']['title'] = '签文参数设置';
     if ($_W['isajax'] && $_GPC['op'] == 'delete' && $_GPC['filename']) {
         file_delete($_GPC['filename']);
         exit('ok');
     }
     if (checksubmit()) {
         // 配置
         $dat = $_GPC['add'];
         $dat['imgUrl'] = $_GPC['imgUrl'];
         $this->saveSettings($dat);
         // 签文
         $qian = $_GPC['qian'];
         $f_exp = "::::::";
         $r_exp = PHP_EOL;
         $morepic = "";
         for ($i = 0; $i < count($qian['filename']); $i++) {
             //替换非法字符
             $name = str_replace($f_exp, "", $qian['title'][$i]);
             $name = str_replace($r_exp, "", $name);
             $pic = str_replace($f_exp, "", $qian['filename'][$i]);
             $pic = str_replace($r_exp, "", $pic);
             if ($pic) {
                 $morepic .= $pic . $f_exp . $name . $r_exp;
             }
         }
         // 去掉最后的字符
         // $morepic = substr($morepic,0,strlen($morepic)-2);
         $morepic = trim($morepic);
         $check = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('qiyue_qiuqian') . " WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
         if ($check) {
             pdo_update('qiyue_qiuqian', array('morepic' => $morepic), array('uniacid' => $_W['uniacid']));
         } else {
             $add['uniacid'] = $_W['uniacid'];
             $add['morepic'] = $morepic;
             pdo_insert('qiyue_qiuqian', $add);
         }
         message('设置成功', 'referer', 'success');
     }
     if (empty($settings)) {
         $settings = array('title' => '新年祈福签', 'desc' => '我在' . $_W['account']['name'] . '求了一支新年签,你也来吧!', 'imgUrl' => tomedia('./addons/qiuqian/icon.jpg'));
     }
     $qian_r = pdo_fetch("SELECT * FROM " . tablename('qiyue_qiuqian') . " WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
     $morepic = array();
     if ($qian_r['morepic']) {
         $f_exp = "::::::";
         $r_exp = PHP_EOL;
         $rr = explode($r_exp, $qian_r['morepic']);
         for ($i = 0; $i < count($rr); $i++) {
             $fr = explode($f_exp, $rr[$i]);
             $morepic[] = array('title' => $fr['1'], 'filename' => $fr['0']);
         }
         unset($qian_r['morepic']);
     }
     include $this->template('setting');
 }
Example #11
0
 public function doWebChatlog()
 {
     global $_GPC, $_W;
     load()->func('tpl');
     $acids = uni_accounts($_W['uniacid']);
     if (!empty($acids)) {
         $data = array();
         foreach ($acids as $acid) {
             if (in_array($acid['level'], array(3, 4))) {
                 $data[] = $acid;
             }
         }
     }
     $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 = intval($_GPC['acid']);
         if (!empty($_GPC['nickname']) && empty($_GPC['openid'])) {
             $user = pdo_fetch('SELECT b.openid,a.avatar FROM ' . tablename('mc_members') . ' AS a LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS b ON a.uid = b.uid WHERE a.nickname = :nickname', array(':nickname' => trim($_GPC['nickname'])));
             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,a.nickname FROM ' . tablename('mc_members') . ' AS a LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS b ON a.uid = b.uid WHERE b.openid = :openid', array(':openid' => trim($_GPC['openid'])));
             if (!empty($user['avatar'])) {
                 $avatar = tomedia($user['avatar']);
                 $nickname = $user['nickname'];
             }
         }
         if ($acid > 0 && !empty($starttime) && !empty($endtime) && !empty($openid)) {
             $pindex = max(1, intval($_GPC['page']));
             $acc = WeAccount::create($acid);
             $params = array('openid' => trim($_GPC['openid']), 'starttime' => $starttime, 'endtime' => $endtime, 'pageindex' => $pindex, 'pagesize' => 1000);
             $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');
 }
Example #12
0
 private function getpicurl($url)
 {
     global $_W;
     if ($url) {
         return tomedia($url);
     } else {
         return $_W['siteroot'] . 'addons/lxy_marry/template/img/art_pic.png';
     }
 }
Example #13
0
 private function getpicurl($url)
 {
     global $_W;
     if ($url) {
         return tomedia($url);
     } else {
         return $_W['siteroot'] . 'addons/lxy_buildpro/template/img/build_home.png';
     }
 }
Example #14
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('hl_tug_reply') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if (empty($row['id'])) {
         return array();
     }
     return $this->respNews(array('Title' => $row['title'], 'Description' => $row['description'], 'PicUrl' => tomedia($row['picture']), 'Url' => $this->createMobileUrl('index', array('id' => $rid))));
 }
Example #15
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT title,description,thumb,isshow,starttime,endtime FROM " . tablename('ewei_couplet_reply') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if ($row == false) {
         return $this->respText("活动已取消...");
     }
     return $this->respNews(array('Title' => $row['title'], 'Description' => $row['description'], 'PicUrl' => tomedia($row['thumb']), 'Url' => $this->createMobileUrl('index', array('id' => $rid))));
 }
Example #16
0
 public function getData($page)
 {
     global $_W;
     $data = htmlspecialchars_decode($page['datas']);
     $d = json_decode($data, true);
     $goodsids = array();
     foreach ($d as $k1 => &$dd) {
         if ($dd['temp'] == 'goods') {
             foreach ($dd['data'] as $k2 => $ddd) {
                 $goodsids[] = array('id' => $ddd['goodid'], 'k1' => $k1, 'k2' => $k2);
             }
         } elseif ($dd['temp'] == 'richtext') {
             $dd['content'] = $this->unescape($dd['content']);
         }
     }
     unset($dd);
     $arr = array();
     foreach ($goodsids as $a) {
         $arr[] = $a['id'];
     }
     if (count($arr) > 0) {
         $goodinfos = pdo_fetchall("SELECT id,title,productprice,marketprice,thumb FROM " . tablename('ewei_shop_goods') . " WHERE id in ( " . implode(',', $arr) . ") and uniacid= :uniacid ", array(':uniacid' => $_W['uniacid']), 'id');
         $goodinfos = set_medias($goodinfos, 'thumb');
         foreach ($d as $k1 => &$dd) {
             if ($dd['temp'] == 'goods') {
                 foreach ($dd['data'] as $k2 => &$ddd) {
                     $cdata = $goodinfos[$ddd['goodid']];
                     $ddd['name'] = $cdata['title'];
                     $ddd['priceold'] = $cdata['productprice'];
                     $ddd['pricenow'] = $cdata['marketprice'];
                     $ddd['img'] = $cdata['thumb'];
                 }
                 unset($ddd);
             }
         }
         unset($dd);
     }
     $data = json_encode($d);
     $data = rtrim($data, "]");
     $data = ltrim($data, "[");
     $pageinfo = htmlspecialchars_decode($page['pageinfo']);
     $p = json_decode($pageinfo, true);
     $page_title = empty($p[0]['params']['title']) ? "未设置页面标题" : $p[0]['params']['title'];
     $page_desc = empty($p[0]['params']['desc']) ? "未设置页面简介" : $p[0]['params']['desc'];
     $page_img = empty($p[0]['params']['img']) ? "" : tomedia($p[0]['params']['img']);
     $page_keyword = empty($p[0]['params']['kw']) ? "" : $p[0]['params']['kw'];
     $shopset = m('common')->getSysset(array('shop', 'share'));
     $system = $shopset;
     $system['shop'] = set_medias($system['shop'], 'logo');
     $system = json_encode($system);
     $pageinfo = rtrim($pageinfo, "]");
     $pageinfo = ltrim($pageinfo, "[");
     return array('page' => $page, 'pageinfo' => $pageinfo, 'data' => $data, 'share' => array('title' => $page_title, 'desc' => $page_desc, 'imgUrl' => $page_img), 'footermenu' => intval($p[0]['params']['footer']), 'system' => $system);
 }
Example #17
0
 public function fieldsFormDisplay($rid = 0)
 {
     global $_W;
     load()->func('tpl');
     $replies = pdo_fetchall("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid ORDER BY `displayorder` DESC", array(':rid' => $rid));
     foreach ($replies as &$reply) {
         if (!empty($reply['thumb'])) {
             $reply['src'] = tomedia($reply['thumb']);
         }
     }
     include $this->template('display');
 }
Example #18
0
 private function setbg($bg, $fan)
 {
     global $_W;
     load()->func('communication');
     load()->func('file');
     $bg = tomedia($bg);
     $file = ihttp_get($bg);
     $file = $file['content'];
     $img = '/images/' . $_W['uniacid'] . '/hx_qr/img/' . $fan['id'] . '.jpg';
     file_write($img, $file);
     return $img;
 }
Example #19
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     if ($rid) {
         $reply = pdo_fetch("SELECT * FROM " . tablename('xwz_queue_reply') . " WHERE rid = :rid", array(':rid' => $rid));
         if ($reply) {
             $news = array(array('title' => $reply['title'], 'description' => strip_tags($reply['description']), 'picurl' => tomedia($reply['thumb']), 'url' => $this->createMobileUrl('index', array('rid' => $rid))));
             return $this->respNews($news);
         }
     }
 }
Example #20
0
 public function doMobileView()
 {
     global $_W, $_GPC;
     $weid = $_W['uniacid'];
     $rid = intval($_GPC['rid']);
     $reply = pdo_fetch('select * from ' . tablename('weisrc_pano_reply') . ' where rid=:rid', array(':rid' => $rid));
     $config = $this->module['config']['weisrc_pano'];
     $share_image = tomedia($config['share_image']);
     $share_title = empty($config['share_title']) ? $config['title'] : $config['share_title'];
     $share_desc = empty($config['share_desc']) ? $config['title'] : $config['share_desc'];
     $share_url = empty($setting['share_url']) ? $_W['siteroot'] . 'app/' . $this->createMobileUrl('view', array(), true) : $setting['share_url'];
     include $this->template('view');
 }
Example #21
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     if ($rid) {
         $reply = pdo_fetch("SELECT * FROM " . tablename('research_reply') . " WHERE rid = :rid", array(':rid' => $rid));
         if ($reply) {
             $sql = 'SELECT * FROM ' . tablename('research') . ' WHERE `weid`=:weid AND `reid`=:reid';
             $activity = pdo_fetch($sql, array(':weid' => $_W['uniacid'], ':reid' => $reply['reid']));
             $news = array();
             $news[] = array('title' => $activity['title'], 'description' => strip_tags($activity['description']), 'picurl' => tomedia($activity['thumb']), 'url' => $this->createMobileUrl('research', array('id' => $activity['reid'], 'weid' => $_W['uniacid'])));
             return $this->respNews($news);
         }
     }
     return null;
 }
Example #22
0
 public function fieldsFormDisplay($rid = 0)
 {
     global $_W;
     load()->func('tpl');
     if (!empty($rid)) {
         $reply = pdo_fetch("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
         if (!empty($reply['picture'])) {
             $reply['picture'] = tomedia($reply['picture']);
         }
     } else {
         $reply['start'] = time();
         $reply['end'] = time() + 6 * 86400;
         $reply['status_fighting'] = '0';
         $reply['most_num_times'] = '1';
     }
     include $this->template('form');
 }
Example #23
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('news_reply') . " WHERE rid = :id ORDER BY displayorder DESC, id ASC LIMIT 8";
     $commends = pdo_fetchall($sql, array(':id' => $rid));
     $news = array();
     foreach ($commends as $c) {
         $row = array();
         $row['title'] = formot_content($c['title']);
         $row['description'] = formot_content($c['description']);
         !empty($c['thumb']) && ($row['picurl'] = tomedia($c['thumb']));
         $row['url'] = empty($c['url']) ? $this->createMobileUrl('detail', array('id' => $c['id'])) : $c['url'];
         $news[] = $row;
     }
     return $this->respNews($news);
 }
Example #24
0
 public function doMobileontel()
 {
     global $_W, $_GPC;
     $title = isset($this->module['config']['title']) ? $this->module['config']['title'] : '你有一通来自亲爱的未接电话!';
     $desc = isset($this->module['config']['desc']) ? $this->module['config']['desc'] : '';
     $pic = isset($this->module['config']['pic']) ? $this->module['config']['pic'] : $_W['siteroot'] . 'addons/n1ce_love/template/mobile/images/answer.png';
     $pic = tomedia($pic);
     $pageurl = $_W['siteroot'] . 'app/' . $this->createMobileUrl('tel');
     $s_url = isset($this->module['config']['s_url']) ? $this->module['config']['s_url'] : '';
     $s_botton = isset($this->module['config']['s_botton']) ? $this->module['config']['s_botton'] : '小媳妇';
     $m_url = isset($this->module['config']['m_url']) ? $this->module['config']['m_url'] : $_W['siteroot'] . 'addons/n1ce_love/template/mobile/images/aini.mp3';
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') === false) {
         include $this->template('no_sub');
         exit;
     }
     include $this->template('ontel');
 }
Example #25
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('ewei_money_reply') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if ($row == false) {
         return $this->respText("活动已取消...");
     }
     if ($row['isshow'] == 0) {
         return $this->respText("活动还没开始,请稍后...");
     }
     if (!empty($row['starttime']) && $row['starttime'] > time()) {
         return $this->respText("数钱活动还未开始");
     }
     $news = array(array('title' => $row['title'], 'description' => trim(strip_tags($row['description'])), 'picurl' => tomedia($row['start_picurl']), 'url' => $this->createMobileUrl('index', array('id' => $rid))));
     return $this->respNews($news);
 }
Example #26
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT title,description,start_picurl,isshow,starttime,endtime,end_theme,end_instruction,end_picurl FROM " . tablename('wdl_scratch_reply') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if ($row == false) {
         return $this->respText("活动已取消...");
     }
     if ($row['isshow'] == 0) {
         return $this->respText("活动未开始,请等待...");
     }
     if ($row['endtime'] < time()) {
         return $this->respNews(array('Title' => $row['end_theme'], 'Description' => $row['end_instruction'], 'PicUrl' => tomedia($row['end_picurl']), 'Url' => $this->createMobileUrl('index', array('id' => $rid))));
     } else {
         return $this->respNews(array('Title' => $row['title'], 'Description' => $row['description'], 'PicUrl' => tomedia($row['start_picurl']), 'Url' => $this->createMobileUrl('index', array('id' => $rid))));
     }
 }
Example #27
0
 public function respond()
 {
     //这里定义此模块进行消息处理时的具体过程, 请查看微赞文档来编写你的代码
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('dream_reply') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if ($row == false) {
         return $this->respText("活动已取消...");
     }
     if ($row['isshow'] == 0) {
         return $this->respText("活动未开始,请等待...");
     }
     if ($row['endtime'] > time()) {
         return $this->respNews(array('Title' => $row['title'], 'PicUrl' => tomedia($row['picurl']), 'Url' => $this->createMobileUrl('index', array('id' => $rid))));
     } else {
         return $this->respText("活动已结束,下次再来吧!");
     }
 }
Example #28
0
$style = pdo_fetch("SELECT * FROM " . tablename('site_styles') . " WHERE id = :id", array(':id' => $styleid));
$templates = uni_templates();
$templateid = intval($style['templateid']);
$template = $templates[$templateid];
$_W['template'] = !empty($template) ? $template['name'] : 'default';
$_W['styles'] = array();
if (!empty($template) && !empty($style)) {
    $sql = "SELECT `variable`, `content` FROM " . tablename('site_styles_vars') . " WHERE `uniacid`=:uniacid AND `styleid`=:styleid";
    $params = array();
    $params[':uniacid'] = $_W['uniacid'];
    $params[':styleid'] = $styleid;
    $stylevars = pdo_fetchall($sql, $params);
    if (!empty($stylevars)) {
        foreach ($stylevars as $row) {
            if (strexists($row['variable'], 'img')) {
                $row['content'] = tomedia($row['content']);
            }
            $_W['styles'][$row['variable']] = $row['content'];
        }
    }
    unset($stylevars, $row, $sql, $params);
}
$_W['page'] = array();
$_W['page']['title'] = $multi['title'];
if (is_array($multi['site_info'])) {
    $_W['page'] = array_merge($_W['page'], $multi['site_info']);
}
unset($multi, $styleid, $style, $templateid, $template, $templates);
$controllers = array();
$handle = opendir(IA_ROOT . '/app/source/');
if (!empty($handle)) {
Example #29
0
<?php

defined('IN_IA') or exit('Access Denied');
!empty($this) && $this instanceof WeModuleSite || 0 ? include $this->template('common/header-base', TEMPLATE_INCLUDEPATH) : (include template('common/header-base', TEMPLATE_INCLUDEPATH));
?>

<style type="text/css">
    .app,.app body {
	width:100%;
	height:100%;
	overflow:auto;

}
</style>
<link rel="stylesheet" href="<?php 
echo RES_URL;
?>
css/common1.css" type="text/css" />
<link rel="stylesheet" href="<?php 
echo RES_URL;
?>
css/login.css" type="text/css" />
<?php 
$logo = !empty($_W['setting']['copyright']['flogo']) ? tomedia($_W['setting']['copyright']['flogo']) : './themes/hc_style1/style/images/gw-logo.png';
?>

<div id="wrapper" class='bg-black'  style="background:url(./themes/hc_style1/style/images/11.jpg)">
	<div class="whz-login-box" style="width:600px;" >
		<div class="mod-body clearfix" style="background-color:#FF9900;border-radius:5px;">
                    <div class="content">
				<h1 class="logo"  style="width:600px;"><div class="logo" style="width:600px;height:95px;">
Example #30
0
 public function doWebHotel()
 {
     global $_GPC, $_W;
     $op = $_GPC['op'];
     $weid = $_W['uniacid'];
     $hotel_level_config = $this->_hotel_level_config;
     load()->func('tpl');
     if ($op == 'edit') {
         $id = intval($_GPC['id']);
         if (checksubmit('submit')) {
             $insert = array('weid' => $weid, 'displayorder' => $_GPC['displayorder'], 'title' => $_GPC['title'], 'thumb' => $_GPC['thumb'], 'address' => $_GPC['address'], 'location_p' => $_GPC['district']['province'], 'location_c' => $_GPC['district']['city'], 'location_a' => $_GPC['district']['district'], 'lng' => $_GPC['baidumap']['lng'], 'lat' => $_GPC['baidumap']['lat'], 'phone' => $_GPC['phone'], 'mail' => $_GPC['mail'], 'description' => $_GPC['description'], 'content' => $_GPC['content'], 'traffic' => $_GPC['traffic'], 'sales' => $_GPC['sales'], 'level' => $_GPC['level'], 'status' => $_GPC['status'], 'brandid' => $_GPC['brandid'], 'businessid' => $_GPC['businessid']);
             if ($_GPC['device']) {
                 $devices = array();
                 foreach ($_GPC['device'] as $key => $device) {
                     if ($device != '') {
                         $devices[] = array('value' => $device, 'isshow' => intval($_GPC['show_device'][$key]));
                     }
                 }
                 $insert['device'] = empty($devices) ? '' : iserializer($devices);
             }
             $insert['thumbs'] = empty($_GPC['thumbs']) ? '' : iserializer($_GPC['thumbs']);
             if (empty($id)) {
                 pdo_insert('hotel2', $insert);
             } else {
                 pdo_update('hotel2', $insert, array('id' => $id));
             }
             message("酒店信息保存成功!", $this->createWebUrl('hotel'), "success");
         }
         $sql = 'SELECT * FROM ' . tablename('hotel2') . ' WHERE `id` = :id';
         $item = pdo_fetch($sql, array(':id' => $id));
         if (empty($item['device'])) {
             $devices = array(array('isdel' => 0, 'value' => '有线上网'), array('isdel' => 0, 'isshow' => 0, 'value' => 'WIFI无线上网'), array('isdel' => 0, 'isshow' => 0, 'value' => '可提供早餐'), array('isdel' => 0, 'isshow' => 0, 'value' => '免费停车场'), array('isdel' => 0, 'isshow' => 0, 'value' => '会议室'), array('isdel' => 0, 'isshow' => 0, 'value' => '健身房'), array('isdel' => 0, 'isshow' => 0, 'value' => '游泳池'));
         } else {
             $devices = iunserializer($item['device']);
         }
         //品牌
         $sql = 'SELECT * FROM ' . tablename('hotel2_brand') . ' WHERE `weid` = :weid';
         $params = array(':weid' => $_W['uniacid']);
         $brands = pdo_fetchall($sql, $params);
         $sql = 'SELECT `title` FROM ' . tablename('hotel2_business') . ' WHERE `weid` = :weid AND `id` = :id';
         $params[':id'] = intval($item['businessid']);
         $item['hotelbusinesss'] = pdo_fetchcolumn($sql, $params);
         include $this->template('hotel_form');
     } else {
         if ($op == 'delete') {
             $id = intval($_GPC['id']);
             if (!empty($id)) {
                 $item = pdo_fetch("SELECT id FROM " . tablename('hotel2_order') . " WHERE hotelid = :hotelid LIMIT 1", array(':hotelid' => $id));
                 if (!empty($item)) {
                     message('抱歉,请先删除该酒店的订单,再删除该酒店!', '', 'error');
                 }
             } else {
                 message('抱歉,参数错误!', '', 'error');
             }
             pdo_delete("hotel2_order", array("hotelid" => $id));
             pdo_delete("hotel2_room", array("hotelid" => $id));
             pdo_delete("hotel2", array("id" => $id));
             message("酒店信息删除成功!", referer(), "success");
         } else {
             if ($op == 'deleteall') {
                 foreach ($_GPC['idArr'] as $k => $id) {
                     $id = intval($id);
                     if (!empty($id)) {
                         $item = pdo_fetch("SELECT id FROM " . tablename('hotel2_order') . " WHERE hotelid = :hotelid LIMIT 1", array(':hotelid' => $id));
                         if (!empty($item)) {
                             message('抱歉,请先删除该酒店的订单,再删除该酒店!', '', 'error');
                         }
                     } else {
                         message('抱歉,参数错误!', '', 'error');
                     }
                     pdo_delete("hotel2_order", array("hotelid" => $id));
                     pdo_delete("hotel2_room", array("hotelid" => $id));
                     pdo_delete("hotel2", array("id" => $id));
                 }
                 $this->web_message('酒店信息删除成功!', '', 0);
                 exit;
             } else {
                 if ($op == 'showall') {
                     if ($_GPC['show_name'] == 'showall') {
                         $show_status = 1;
                     } else {
                         $show_status = 0;
                     }
                     foreach ($_GPC['idArr'] as $k => $id) {
                         $id = intval($id);
                         if (!empty($id)) {
                             pdo_update('hotel2', array('status' => $show_status), array('id' => $id));
                         }
                     }
                     $this->web_message('操作成功!', '', 0);
                     exit;
                 } else {
                     if ($op == 'status') {
                         $id = intval($_GPC['id']);
                         if (empty($id)) {
                             message('抱歉,传递的参数错误!', '', 'error');
                         }
                         $temp = pdo_update('hotel2', array('status' => $_GPC['status']), array('id' => $id));
                         if ($temp == false) {
                             message('抱歉,刚才操作数据失败!', '', 'error');
                         } else {
                             message('状态设置成功!', referer(), 'success');
                         }
                     } else {
                         if ($op == 'query') {
                             $kwd = trim($_GPC['keyword']);
                             $sql = 'SELECT id,title,description,thumb FROM ' . tablename('hotel2') . ' WHERE `weid`=:weid';
                             $params = array();
                             $params[':weid'] = $_W['uniacid'];
                             if (!empty($kwd)) {
                                 $sql .= " AND `title` LIKE :title";
                                 $params[':title'] = "%{$kwd}%";
                             }
                             $ds = pdo_fetchall($sql, $params);
                             foreach ($ds as &$value) {
                                 $value['thumb'] = tomedia($value['thumb']);
                             }
                             include $this->template('query');
                         } else {
                             $pindex = max(1, intval($_GPC['page']));
                             $psize = 20;
                             $where = ' WHERE `weid` = :weid';
                             $params = array(':weid' => $_W['uniacid']);
                             if (!empty($_GPC['title'])) {
                                 $where .= ' AND `title` LIKE :keywords';
                                 $params[':keywords'] = "%{$_GPC['title']}%";
                             }
                             if (!empty($_GPC['level'])) {
                                 $where .= ' AND level=:level';
                                 $params[':level'] = intval($_GPC['level']);
                             }
                             $sql = 'SELECT COUNT(*) FROM ' . tablename('hotel2') . $where;
                             $total = pdo_fetchcolumn($sql, $params);
                             if ($total > 0) {
                                 $pindex = max(1, intval($_GPC['page']));
                                 $psize = 10;
                                 $sql = 'SELECT * FROM ' . tablename('hotel2') . $where . ' ORDER BY `displayorder` DESC LIMIT ' . ($pindex - 1) * $psize . ',' . $psize;
                                 $list = pdo_fetchall($sql, $params);
                                 foreach ($list as &$row) {
                                     $row['level'] = $this->_hotel_level_config[$row['level']];
                                 }
                                 $pager = pagination($total, $pindex, $psize);
                             }
                             if (!empty($_GPC['export'])) {
                                 /* 输入到CSV文件 */
                                 $html = "";
                                 /* 输出表头 */
                                 $filter = array('title' => '酒店名称', 'level' => '星级', 'roomcount' => '房间数', 'phone' => '电话', 'status' => '状态');
                                 foreach ($filter as $key => $value) {
                                     $html .= $value . "\t,";
                                 }
                                 $html .= "\n";
                                 if (!empty($list)) {
                                     $status = array('隐藏', '显示');
                                     foreach ($list as $key => $value) {
                                         foreach ($filter as $index => $title) {
                                             if ($index != 'status') {
                                                 $html .= $value[$index] . "\t, ";
                                             } else {
                                                 $html .= $status[$value[$index]] . "\t, ";
                                             }
                                         }
                                         $html .= "\n";
                                     }
                                 }
                                 /* 输出CSV文件 */
                                 header("Content-type:text/csv");
                                 header("Content-Disposition:attachment; filename=全部数据.csv");
                                 echo $html;
                                 exit;
                             }
                             include $this->template('hotel');
                         }
                     }
                 }
             }
         }
     }
 }