<?php
/**
* @author moufer<moufer@163.com>
* @copyright www.modoer.com
*/
(!defined('IN_ADMIN') || !defined('IN_MUDDER')) && exit('Access Denied');
if(!$dosubmit) {

    $result = $db->get_one("SELECT COUNT(*) as c FROM {$dbpre}reviews WHERE status=2");
    $total = $result['c'];
    if($total > 0) {
        $query = $db->query("SELECT a.rid,a.uid,a.shopid,a.content,a.posttime,a.status,b.shopname,b.subname,c.username FROM {$dbpre}reviews a LEFT JOIN {$dbpre}shops b ON(a.shopid=b.sid) LEFT JOIN {$dbpre}members c ON(a.uid=c.uid) WHERE a.status=2 ORDER BY a.posttime DESC LIMIT $limit");
        while($review = $db->fetch_array($query)) {
            $review['posttime'] = date('Y-m-d H:i:s', $review['posttime']);
            $review['content'] = trimmed_title(html_special_chars(str_replace("\n", ".", $review['content'])), 20);
            $reviews[] = $review;
        }
        unset($review);
        $multipage = multi($total, $offset, $page, "admincp.php?action=$action&file=$file");
    }

    include cptpl('checkreviews', MOD_ROOT.'./admin/templates/');

} else {
    
        if($reviewid && is_array($reviewid)) {
            if($operation != 0 && $operation != 1) cpmsg('未选择操作方式，请返回修改。');
            if($operation == 1) {
                checkupReview($reviewid);
            } elseif($operation == 0) {
                deleteReview($reviewid,'rid');
            }
        }
        cpmsg('新增商铺更新完毕。',"admincp.php?action=$action&file=$file");

}
?>