USE [xnzyradius]
GO
/****** 对象:  Table [dbo].[user_through]    脚本日期: 09/16/2011 22:16:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[user_through](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[pppoe_user] [int] NULL,
	[begin_time] [datetime] NULL,
	[end_time] [datetime] NULL,
	[rate] [nvarchar](20) NULL,
	[manager] [nvarchar](20) NULL
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[user_inform]    脚本日期: 09/16/2011 22:16:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[user_inform](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[user_name] [nvarchar](20) NOT NULL,
	[user_address] [nvarchar](255) NULL,
	[user_department] [nvarchar](255) NULL,
	[user_telephone] [nvarchar](20) NULL,
	[user_age] [int] NULL,
	[user_sex] [nvarchar](4) NULL,
	[user_date] [datetime] NULL,
	[user_pppoed] [nvarchar](20) NOT NULL,
	[user_password] [nvarchar](20) NULL,
	[user_count] [float] NULL,
	[user_manger] [nvarchar](20) NULL,
	[user_memo] [nvarchar](200) NULL,
 CONSTRAINT [PK_user_inform_1] PRIMARY KEY CLUSTERED 
(
	[user_pppoed] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[user_order]    脚本日期: 09/16/2011 22:16:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[user_order](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[user_name] [nvarchar](20) NULL,
	[begin_date] [datetime] NULL,
	[day] [int] NULL,
	[count] [float] NULL,
	[Rate] [nvarchar](20) NULL
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[product]    脚本日期: 09/16/2011 22:16:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[product](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[product_name] [nvarchar](20) NULL,
	[product_rate] [nvarchar](20) NULL,
	[product_count] [float] NULL,
	[product_content] [nvarchar](255) NULL,
	[product_images] [nvarchar](255) NULL,
	[product_time] [int] NULL
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[rate]    脚本日期: 09/16/2011 22:16:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[rate](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[daikuan] [nvarchar](20) NOT NULL,
	[pool] [nvarchar](20) NULL,
	[ratedown] [nvarchar](40) NULL,
 CONSTRAINT [PK_rate] PRIMARY KEY CLUSTERED 
(
	[daikuan] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[user_pppoe]    脚本日期: 09/16/2011 22:16:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[user_pppoe](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[user_name] [nvarchar](20) NULL,
	[user_password] [nvarchar](20) NULL,
	[user_begindate] [datetime] NULL,
	[user_enddate] [datetime] NULL,
	[user_Stat] [nvarchar](10) NULL,
	[FramedIPAddress] [nvarchar](20) NULL,
	[UserMac] [nvarchar](20) NULL,
	[Rate] [nvarchar](20) NULL,
	[count] [float] NULL,
	[mac] [bit] NULL,
	[NasIP] [nvarchar](20) NULL,
	[userother] [nvarchar](32) NULL,
	[order_manager] [nchar](10) NULL,
	[order_time] [datetime] NULL,
	[Nasport] [int] NULL,
	[Nasportid] [nvarchar](50) NULL
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[user_countlog]    脚本日期: 09/16/2011 22:16:05 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[user_countlog](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[username] [nvarchar](50) NULL,
	[indate] [datetime] NULL,
	[manager] [nvarchar](50) NULL,
	[count] [float] NULL,
	[action] [nvarchar](50) NULL
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[datecontrol]    脚本日期: 09/16/2011 22:15:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[datecontrol](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[x1] [nvarchar](11) NULL,
	[x2] [nvarchar](11) NULL,
	[x3] [nvarchar](11) NULL,
	[x4] [nvarchar](11) NULL,
	[x5] [nvarchar](11) NULL,
	[x6] [nvarchar](11) NULL,
	[x7] [nvarchar](11) NULL
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[nas]    脚本日期: 09/16/2011 22:16:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[nas](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[ipaddress] [nvarchar](20) NULL,
	[address] [nvarchar](100) NULL,
	[admin] [nvarchar](50) NULL,
	[password] [nvarchar](50) NULL
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[log]    脚本日期: 09/16/2011 22:15:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[log](
	[log_id] [int] IDENTITY(1,1) NOT NULL,
	[log_user] [nvarchar](20) NULL,
	[log_time] [nvarchar](20) NULL,
	[log_endtime] [nvarchar](20) NULL,
	[session_time] [nvarchar](20) NULL,
	[log_ip] [nvarchar](20) NULL,
	[log_mac] [nvarchar](20) NULL,
	[log_inputpacket] [nvarchar](20) NULL,
	[log_outputpacket] [nvarchar](20) NULL,
	[log_reason] [nvarchar](20) NULL
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[blackmac]    脚本日期: 09/16/2011 22:15:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[blackmac](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[blackmacaddress] [nvarchar](20) NOT NULL,
 CONSTRAINT [PK_blackmac] PRIMARY KEY CLUSTERED 
(
	[blackmacaddress] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[admin]    脚本日期: 09/16/2011 22:15:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[admin](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[user_name] [nvarchar](20) NOT NULL,
	[user_password] [nvarchar](20) NULL,
	[user_level] [int] NULL,
 CONSTRAINT [PK_admin] PRIMARY KEY CLUSTERED 
(
	[user_name] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** 对象:  Table [dbo].[count_card]    脚本日期: 09/16/2011 22:15:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[count_card](
	[card_id] [int] IDENTITY(1,1) NOT NULL,
	[card_number] [nvarchar](60) NOT NULL,
	[card_pass] [nvarchar](60) NULL,
	[card_count] [float] NULL,
	[card_begindate] [datetime] NULL,
	[card_enddate] [datetime] NULL,
	[card_stat] [nvarchar](12) NULL,
	[card_user] [nvarchar](20) NULL,
	[card_usedate] [datetime] NULL,
 CONSTRAINT [PK_count_card] PRIMARY KEY CLUSTERED 
(
	[card_number] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
