<?php

require_once(dirname(dirname(__FILE__)) . '/app.php');
need_manager();

$condition['enable'] = 'Y';
if($_GET){
    if($_GET['state']=='manager'){
        $condition['manager'] = 'Y';
    }
    if($_GET['state']=='close'){
        $condition['enable'] = 'N';
    }
}




$count = Table::Count('user', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$users = DB::LimitQuery('user', array(
	'condition' => $condition,
	'order' => 'ORDER BY id ASC',
	'size' => $pagesize,
	'offset' => $offset,
));
if(count($users)==0){
    Session::Set('error','没有查询到符合条件的产品，请检查查询条件，重新查询！');
}else{
    if($_POST)Session::Set('success','查询完成！');
}

include template('manage_account');?>
