<?php
/**
 * 会员模块
 * @copyright reginx.com
 * $Id$
 */
class user_mod extends admin_mod {
    
    /**
     * 列表页
     *
     */
    public function listAct(){
        $obj = OBJ('user_tab');
        $pobj = new page_lib($obj->count() , 'pn' , intval($this->get('pn')) , 16);
        $obj->limit($pobj->limit)->order($pobj->rev ? "id asc" : 'id desc');
        $this->assign('pobj' , $pobj->toarray());
        $this->assign('list' , $pobj->rev ? array_reverse($obj->getall()) : $obj->getall());
        $this->assign('atitle' , '会员管理');
        $this->display('user/list.html');
    }
    
    public function delAct(){
        $id = intval($this->get('id'));
        if($id > 0){
            OBJ('user_tab')->where('id = ' . $id)->del();
            OBJ('reply_tab')->where('uid = ' . $id)->del();
        }
        $this->redirect('user-list');
    }
    
} // End Class
?>