Exemplo n.º 1
0
/**
 * 获取结伴标签代码
 *
 * @version        $Id: getjieban.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2015, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_getjieban(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|6,flag|new,limit|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    if ($flag == 'new') {
        $sql = "select * from sline_jieban where status=1 order by addtime desc limit {$limit},{$row}";
    } else {
        if ($flag == 'finish') {
            $sql = "select * from sline_jieban where status=2 order by addtime desc limit {$limit},{$row}";
        } else {
            if ($flag == 'join') {
                $jiebanid = $refObj->Fields['id'];
                $sql = "select * from sline_jieban_join  where jiebanid='{$jiebanid}' group by memberid order by addtime desc";
            }
        }
    }
    $arr = $dsql->getAll($sql);
    foreach ($arr as $row) {
        $GLOBALS['autoindex']++;
        if ($flag != 'join') {
            $row['title'] = TagJB::getJiebanTitle($row);
            $row['kindnamelist'] = TagJB::getKindnameList($row, '-');
            $row['posttime'] = TagJB::formatViewTime($row['addtime']);
            $row['membername'] = TagJB::getMemberName($row['memberid']);
            $row['url'] = $GLOBALS['cfg_cmsurl'] . '/jieban/show_' . $row['id'] . '.html';
            $row['attrlist'] = TagJB::getAttrList($row['attrid']);
            $row['joinnum'] = TagJB::getJoinNumber($row['id']);
        } else {
            $memberinfo = Helper_Archive::getMemberInfo($row['memberid']);
            $row['membername'] = $memberinfo['nickname'];
            $row['litpic'] = $memberinfo['litpic'] ? $memberinfo['litpic'] : '/templets/smore/images/member_default.gif';
            $row['joinnum'] = TagJB::getSingleJoinNumber($row['jiebanid'], $row['memberid']);
        }
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                } else {
                    $ctp->Assign($tagid, '');
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
Exemplo n.º 2
0
require_once SLINEROOT . '/jieban/func.php';
require_once dirname(__FILE__) . '/config.php';
require_once SLINEINC . "/view.class.php";
$pv = new View($typeid);
if (!isset($id)) {
    exit('Wrong Id');
}
$id = RemoveXSS($id);
//防止跨站攻击
$row = JieBan::getProductInfo($id);
if (empty($row['id'])) {
    head404();
}
if (is_array($row)) {
    JieBan::updateVisit($row['id']);
    $memberinfo = Helper_Archive::getMemberInfo($row['memberid']);
    $row['title'] = JieBan::getJiebanTitle($row);
    $row['kindnamelist'] = JieBan::getKindnameList($row, '-');
    $row['membername'] = $memberinfo['nickname'];
    $row['memberlitpic'] = $memberinfo['litpic'] ? $memberinfo['litpic'] : $GLOBALS['cfg_templets_skin'] . '/images/member_default.gif';
    $row['url'] = $GLOBALS['cfg_cmsurl'] . '/jieban/show_' . $row['id'] . '.html';
    $row['attrlist'] = JieBan::getAttrList($row['attrid']);
    $row['joinnum'] = JieBan::getJoinNumber($row['id']);
    $row['memo'] = $row['memo'] == 'null' ? '' : $row['memo'];
    $row['vartime'] = empty($row['vartime']) ? 0 : $row['vartime'];
    $row['pkname'] = get_par_value($row['kindlist'], $typeid);
    $row['destid'] = array_remove_value($row['kindlist']);
    $row['pinyin'] = Helper_Archive::getDestPinyin($row['destid']);
    $row['kindid'] = $row['destid'];
    if (!empty($row['lineid'])) {
        $row['lineinfo'] = JieBan::getLineInfo($row['lineid']);
Exemplo n.º 3
0
 //logResult('spotid:'.$arr['spotid']);
 //  if(!$arr)exit();
 if (substr($ordersn, 0, 2) == 'dz') {
     $updatesql = "update sline_dzorder set status=2 where ordersn='{$ordersn}'";
     $ordertype = 'sys';
 } else {
     $updatesql = "update #@__member_order set ispay=1,status=2 where ordersn='{$ordersn}'";
     //付款标志置为1,交易成功
     $ordertype = 'sys';
 }
 $sql = "select * from #@__member_order where ordersn='{$ordersn}'";
 $arr = $dsql->GetOne($sql);
 $dsql->ExecuteNoneQuery($updatesql);
 if ($ordertype != 'dz') {
     $msgInfo = Helper_Archive::getDefineMsgInfo($arr['typeid'], 3);
     $memberInfo = Helper_Archive::getMemberInfo($arr['memberid']);
     $nickname = !empty($memberInfo['nickname']) ? $memberInfo['nickname'] : $memberInfo['mobile'];
     if (isset($msgInfo['isopen'])) {
         $content = $msgInfo['msg'];
         $totalprice = $arr['price'] * $arr['dingnum'];
         $content = str_replace('{#MEMBERNAME#}', $memberinfo['nickname'], $content);
         $content = str_replace('{#PRODUCTNAME#}', $arr['productname'], $content);
         $content = str_replace('{#PRICE#}', $arr['PRICE'], $content);
         $content = str_replace('{#NUMBER#}', $arr['dingnum'], $content);
         $content = str_replace('{#TOTALPRICE#}', $totalPrice, $content);
         Helper_Archive::sendMsg($memberInfo['mobile'], $nickname, $content);
         //发送短信.
     }
     //支付成功后添加预订送积分
     if (!empty($arr['jifenbook'])) {
         $addjifen = intval($arr['jifenbook']);
Exemplo n.º 4
0
    if ($id) {
        $status = 1;
    }
    echo json_encode(array('status' => $status));
    exit;
}
//加入结伴
if ($action == 'addjoin') {
    $status = 0;
    //手机号码验证
    $preg = '/13[1-9]{1}\\d{8}|15[1-9]\\d{8}|1\\d{10}/';
    if (!preg_match($preg, $mobile)) {
        exit('wrong mobile');
    }
    $memberid = Helper_Archive::autoReg($mobile);
    $memberinfo = Helper_Archive::getMemberInfo($memberid);
    Helper_Archive::loadModule('common');
    $join = new CommonModule('#@__jieban_join');
    $arr = array('jiebanid' => $jiebanid, 'linkman' => $memberinfo['nickname'], 'mobile' => $mobile, 'memberid' => $memberid, 'adultnum' => $adultnum, 'childnum' => $childnum, 'addtime' => time());
    $id = $join->add($arr);
    if ($id) {
        $status = 1;
    }
    echo json_encode(array('status' => $status));
}
//保存session信息
if ($action == 'savesession') {
    @session_start();
    $_SESSION[$key] = $value;
}
if ($action == 'getsession') {
Exemplo n.º 5
0
//发送短信
if ($step == 'sendcheckcode') {
    @session_start();
    $ip = GetIP();
    $ip_list = $_SESSION['findpwdipnum'];
    if (isset($ip_list[$ip]) && intval($ip_list[$ip]) <= 3) {
        $num = intval($ip_list[$ip]) + 1;
        $_SESSION['findpwdipnum'][$ip] = $num;
    } else {
        if (!isset($ip_list[$ip])) {
            $_SESSION['findpwdipnum'][$ip] = 1;
        } else {
            exit;
        }
    }
    $userinfo = Helper_Archive::getMemberInfo($_GET['uid']);
    $status = 'false';
    if (!empty($userinfo)) {
        $code = getRandCode(5);
        //验证码
        $msgInfo = Helper_Archive::getDefineMsgInfo2('reg_findpwd');
        //$content = "尊敬的会员,请您在{$GLOBALS['cfg_webname']}中输入以下验证码:{$code},完成密码找回验证.";
        $content = $msgInfo['msg'];
        $content = str_replace('{#CODE#}', $code, $content);
        $content = str_replace('{#WEBNAME#}', $GLOBALS['cfg_webname'], $content);
        $content = str_replace('{#PHONE#}', $GLOBALS['cfg_phone'], $content);
        $flag = Helper_Archive::sendMsg($userinfo['mobile'], '', $content);
        if ($flag->Success) {
            $status = 'ok';
        }
        $status = 'ok';