<?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}shops WHERE status=2");
    $total = $result['c'];
    if($total > 0) {
        $offset = 20;
        $limit = get_limit($page, $offset);
        $query = $db->query("SELECT a.sid,a.shopname,a.subname,a.adduid,a.areacode,a.classcode,a.addtime,b.username,c.areaname,d.classname FROM {$dbpre}shops a LEFT JOIN {$dbpre}members b ON(a.adduid=b.uid) LEFT JOIN {$dbpre}areacode c ON(a.areacode=c.areacode) LEFT JOIN {$dbpre}classcode d ON(a.classcode=d.classcode) WHERE a.status=2 ORDER BY a.addtime DESC LIMIT $limit");
        while($shop = $db->fetch_array($query)) {
            $shop['username'] = !$shop['username'] ? 'system' : $shop['username'];
            $shop['addtime'] = date('Y-m-d H:i:s', $shop['addtime']);
            $shops[] = $shop;
        }
        unset($shop);
        $multiurl = "admincp.php?action=$action&file=$file";
        $multipage = multi($total, $offset, $page, $multiurl);
    }

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

} else {

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

}
?>