<?php
#------------------------------------------------------#
#               本程序为zChain.net提供                 #
#                zChain论坛(ZBB)v2.00                  #
#------------------------------------------------------#
# INPUT[$FORM{}] : $cmd

if(!$cmd){_printFrame('welcome');exit;}

switch ($cmd) {
	case 'setup': _printFrame('config_form'); exit;

	case 'menu': include('admin/adm_menu.php'); exit;
	case 'info': include('admin/adm_info.php'); exit;
	case 'phpinfo': phpinfo(); exit;
	case 'user': include('admin/adm_user.php'); exit;
	case 'user_form': include('admin/adm_user_form.php'); exit;
	case 'user_submit': include('admin/adm_user_submit.php'); exit;
	case 'welcome':
	case 'logon': include('admin/adm_logon.php'); exit;
	case 'config_form': include('admin/adm_config_form.php'); exit;
	case 'config_submit': include('admin/adm_config_submit.php'); exit;
	case 'board': include('admin/adm_board.php'); exit;
	case 'board_form': include('admin/adm_board_form.php'); exit;
	case 'board_submit': include('admin/adm_board_submit.php'); exit;
	case 'board_reindex': include('admin/adm_board_reindex.php'); exit;
	case 'blist_resync': include('admin/adm_blist_resync.php'); exit;
	case 'permission': include('admin/adm_permission.php'); exit;
	case 'permission_1': include('admin/adm_permission_1.php'); exit;
	case 'permission_add': include('admin/adm_permission_add.php'); exit;
	case 'permission_remove': include('admin/adm_permission_remove.php'); exit;
	case 'rank': include('admin/adm_rank.php'); exit;
	case 'rank_add': include('admin/adm_rank_add.php'); exit;
	case 'rank_remove': include('admin/adm_rank_remove.php'); exit;
	case 'log': include('admin/adm_log.php'); exit;
	case 'log_view': include('admin/adm_log_view.php'); exit;
	case 'list': include('admin/adm_list.php'); exit;
	case 'list_submit': include('admin/adm_list_submit.php'); exit;
	case 'backup': include('admin/adm_backup.php'); exit;
	case 'backup_submit': include('admin/adm_backup_submit.php'); exit;
	case 'restore': include('admin/adm_restore.php'); exit;
	case 'restore_confirm': include('admin/adm_restore_confirm.php'); exit;
	case 'restore_submit': include('admin/adm_restore_submit.php'); exit;
	default: include('admin/adm_noimpl.php');exit;
}

function _printFrame($code)
{
	#--- Generate framework ---
	print <<<EOT
<HTML><HEAD><TITLE>ZBB 管理中心</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"></HEAD>
<FRAMESET border=2 frameSpacing=0 rows=* frameBorder=yes cols=150,*>
<FRAME name=nav marginWdth=3 marginHeight=3 src="admin.php?cmd=menu">
<FRAME name=main marginWidth=10 marginHeight=10 src="admin.php?cmd=$code">
</FRAMESET></HTML>
EOT;
}

?>