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

    $total = $db->get_one("SELECT COUNT(*) as count FROM {$dbpre}responds WHERE status=2");
    if($total['count'] > 0) {
        $offset = 20;
        $limit = get_limit($page, $offset);
        $query = $db->query("SELECT a.rid,a.uid,a.reviewid,a.content,a.posttime,a.status,b.username AS susername,(SELECT username FROM {$dbpre}members WHERE uid=c.uid) as dusername, d.shopname,d.subname FROM {$dbpre}responds a LEFT JOIN {$dbpre}members b ON(a.uid=b.uid) LEFT JOIN {$dbpre}reviews c ON(a.reviewid=c.rid) LEFT JOIN {$dbpre}shops d ON(c.shopid=d.sid) WHERE a.status=2 LIMIT $limit");
        while($respond = $db->fetch_array($query)) {
            $respond['posttime'] = date('Y-m-d H:i:s', $respond['posttime']);
            $responds[] = $respond;
        }
        $multiurl = "admincp.php?action=$action&file=$file";
        $multipage = multi($total['count'], $offset, $page, $multiurl);
    }
    include cptpl('checkresponds', MOD_ROOT.'./admin/templates/');

} else {

    if($respondid && is_array($respondid)) {
        if(empty($operation)) cpmsg('未选择操作方式，请返回修改。');
        if($operation == 'check') {
            checkupRespond($respondid);
        } elseif($operation == 'delete') {
            deleteRespond($respondid);
        }
    }
    cpmsg('回应处理完毕。',"admincp.php?action=$action&file=$file");
}
?>