public function index() { |
header( "Content-Type:text/html; charset=utf-8" ); |
|
$M_User = new UserModel(); |
|
$User_List = $M_User ->select(); |
|
$this ->assign( 'Title' , '用户管理' ); |
|
$this ->assign( 'UserList' , $User_List ); |
|
$this ->display(); |
} |
|
//添加用户提交处理 |
public function Create_Post() { |
$M_User = new UserModel(); |
$data [ 'username' ] = $this ->_post( 'username' ); |
$data [ 'password' ] = md5( $this ->_post( 'pwd' )); |
|
if ( $M_User ->create()) { |
$Query_Result = $M_User ->add( $data ); |
if (false !== $Query_Result ) { |
$this ->success( '用户添加成功' ); |
} else { |
$this ->error( '用户添加错误' ); |
} |
} else { |
header( "Content-Type:text/html; charset=utf-8" ); |
exit ( $M_User ->getError() . ' [ <a href="javascript:history.back()">返 回</a> ]' ); |
} |
} |