Esempio n. 1
0
function lib_getcommentlist(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|5,flag|all,type|comment,level|0,limit|0,isproduct|0";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    //$commenthomeid=$refObj->Fields['commenthomeid'];
    //根据aid来获取当前aid的评论
    //$commenthomeid=$refObj->Fields['aid'];
    //获取全部评论
    if ($flag == 'all') {
        $where = 'where typeid!=4 and typeid !=6';
    } else {
        if ($flag == 'line') {
            $where = 'where typeid = 1';
            $commenthomeid = $refObj->Fields['id'];
        } else {
            if ($flag == 'hotel') {
                $where = 'where typeid = 2';
                $commenthomeid = $refObj->Fields['id'];
            } else {
                if ($flag == 'car') {
                    $where = 'where typeid = 3';
                    $commenthomeid = $refObj->Fields['id'];
                } else {
                    if ($flag == 'spot') {
                        $where = 'where typeid = 5';
                        $commenthomeid = $refObj->Fields['id'];
                    } else {
                        if ($flag == 'visa') {
                            $where = 'where typeid = 8';
                            $commenthomeid = $refObj->Fields['id'];
                        } else {
                            if ($flag == 'tuan') {
                                $where = 'where typeid = 13';
                                $commenthomeid = $refObj->Fields['aid'];
                            } else {
                                if ($flag == 'tongyong') {
                                    $typeid = $refObj->Fields['typeid'];
                                    if (empty($typeid)) {
                                        return '';
                                    }
                                    $where = "where typeid = {$typeid}";
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    if ($level != 0) {
        $where .= " and level={$level}";
    }
    if (!empty($commenthomeid)) {
        $where .= ' and articleid=' . $commenthomeid;
    }
    $where .= " and isshow=1 ";
    $sql = "select * from #@__comment {$where}  order by addtime  desc limit {$limit},{$row}";
    if ($isproduct == 1) {
        $sql = "select * from #@__comment {$where} group by typeid,articleid order by addtime desc limit {$limit},{$row}";
    }
    $innertext = trim($ctag->GetInnertext());
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $revalue = '';
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $awardinfo = getAwardInfo($row['orderid']);
        $row['jifentprice'] = $awardinfo['jifentprice'];
        $row['jifencomment'] = $awardinfo['jifencomment'];
        $row['jifenbook'] = $awardinfo['jifenbook'];
        $row['score'] = getScore($row);
        //分数
        $row['nickname'] = getMemberName($row['memberid']);
        //昵称
        $row['litpic'] = getMemberPic($row['memberid']);
        $row['pltime'] = Helper_Archive::formatAddTime($row['addtime']);
        //评论时间
        $row['percent'] = 20 * $row['score'] . '%';
        $row['percent1'] = 20 * $row['score1'] . '%';
        $row['percent2'] = 20 * $row['score2'] . '%';
        $row['percent3'] = 20 * $row['score3'] . '%';
        $row['percent4'] = 20 * $row['score4'] . '%';
        $row['productname'] = $row['typeid'] != '4' && $row['typeid'] != '6' ? getOrderName2($row['articleid'], $row['typeid'], '', $row['id']) : '';
        if ($row['productname'] == '') {
            continue;
        }
        $row['sellnum'] = getSellNum($row['productautoid']);
        //销售数量
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if ($row[$ctag->GetName()]) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
Esempio n. 2
0
    header('Content-Type: application/json');
    blockMemberWithWarning();
}
if ($job == "deleteRules") {
    header('Content-Type: application/json');
    deleteRules();
}
if ($job == "showMemberWarnings") {
    header('Content-Type: application/json');
    showMemberWarnings();
}
if ($job == "unblockProject") {
    header('Content-Type: application/json');
    unblockProject();
}
if ($job == "getMemberProjectList") {
    header('Content-Type: application/json');
    getMemberProjectList();
}
if ($job == "getMemberName") {
    header('Content-Type: application/json');
    getMemberName();
}
if ($job == "getProjectName") {
    header('Content-Type: application/json');
    getProjectName();
}
if ($job == "addNewWarning") {
    header('Content-Type: application/json');
    addNewWarning();
}
<?php

include "header-member.php";
require 'controller/session.php';
$memberId = checkSession();
require 'controller/controller.php';
$memberName = getMemberName($memberId);
if (!(checkSession() == "admin")) {
    ?>
    <!--/#header-->
    <div class="container">
        <h2>Membership Renewal Extension <h4>(Membership expired on : <?php 
    echo $memberName[0]["expiry"];
    ?>
)</h4></h2>
        <form name="login" method="post" action="controller/submit_member_renew_membership.php" onsubmit="return submitForm();">
            <div class="form-group" id="mem_id_label">
                <label >Member Id </label>
                <input type="text" class="form-control" id="memId" value="<?php 
    echo $memberId;
    ?>
" readonly/>
                <span></span>
            </div>
            <div class="form-group" id="mem_name_label">
                <label  >Member name </label>
                <input type="text" class="form-control" id="memname" value="<?php 
    echo $memberName[0]["mem_name"];
    ?>
" readonly/>
                <span></span>