<!--#include file="admin_start.asp" -->
<body topmargin="30" marginwidth="10" marginheight="10">
<%
Set fso = Server.CreateObject("Scripting.FileSystemObject")

'//////////////////////////////////////////////////////////////////////选择导入路径
if request("action")="" then
%>
<form name=data action='admin_template_input.asp?action=list' method=post >
<table cellspacing=0 cellpadding=0 align=center width=98% bgcolor=#F7F7F7 style='border: 1px solid #EBEBEB; '>
<tr>
<td height=30 width='6%' align=center>
<font color=red>导入模版之前请先<a target=_blank href="admin_safe_database.asp"><font color=blue>备份您的数据库</font></a>！！以防导入失败！！</font>
</td>
</tr>
<tr>
<td height=30 width='6%' align=center>模版导入路径：<input name=url value='template/input' size=60> <input type=submit value='导入' ></td>
</tr>
</table>
</form>
<%
end if
'//////////////////////////////////////////////////////////////////////模版列表
if request("action")="list" then
	if request("url")="" then 
		MySys.error.info="请正确填写需要导入的模版的路径！"
		MySys.error.location="back"
		MySys.error.err()
	else
		url=server.MapPath("../"&trim(request("url")))
		if not fso.FileExists(url&"/templates.mdb") then
			MySys.error.info="系统没有找到模版导入数据库[templates.mdb]，请确定导入模版的路径是否正确！"
			MySys.error.location="back"
			MySys.error.err()
		end if
		'打开数据库
		db_t="../"&trim(request("url"))&"/templates.mdb"
		Set conn_t = Server.CreateObject("ADODB.Connection")
		connstr_t="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db_t&"")
		conn_t.Open connstr_t
		'/////////////////////////////////
		rs.open"select sort_id,sort_name,sort_addtime from jins_template_sort where sort_up=0 ",conn_t,1,1
	end if
	
	c="<form name=jins_template_sort action='admin_template_input_handle.asp?url="&trim(request("url"))&"' method=post >"
	c=c+"<table cellspacing=0 cellpadding=0 align=center width=98% bgcolor=#F7F7F7 style='border-top: 1px solid #EBEBEB; '>"
	c=c+"<tr>"
	c=c+"<td height=30 width='6%' align=center>选择</td>"
	c=c+"<td height=30 width='40%' align=left>模版方案名</td>"
	c=c+"<td height=30 width='14%' align=center></td>"
	c=c+"<td height=30 width='20%' align=center>加入日期</td>"
	c=c+"<td height=30 width='20%' align=center>导入模版</td>"
	c=c+"</tr>"
	c=c+"<tr>"
	c=c+"<td height='1' width='100%' colspan='10' background='images/dot03.gif'></td>"
	c=c+"</tr>"
	c=c+"</table>"
	
	c=c+"<table cellspacing=0 cellpadding=0 width=98% align=center >"
	
	do while not rs.eof
	
		c=c+"<tr onmouseover=this.style.background='#ebebeb'; onmouseout=this.style.background='#ffffff';>"
		c=c+"<td height=30  width='6%' align=center>"
		c=c+"<input type=checkbox name=ids value='"&rs("sort_id")&"'> "
		c=c+"</td>"
		
		c=c+"<td height=30  width='40%' align=left>"
		c=c+"<font color=green style='font-size:10pt'>"&rs("sort_name")&"</font> "
		c=c+"</td>"
		
		c=c+"<td height=30 width='14%' align=center>"
		if not conn.execute("select sort_id from jins_template_sort where sort_name='"&rs("sort_name")&"' ").eof then c=c+ "<font color=red>已存在，重名！</font>"
		c=c+"</td>"
	
		c=c+"<td height=30  width='20%' align=center>"
		c=c&rs("sort_addtime")
		c=c+"</td>"
		
		c=c+"<td height=30  width='20%' align=center>"
		c=c+"<a title='点击导入此模版！' href='admin_template_input_handle.asp?ids="&rs("sort_id")&"&url="&trim(request("url"))&"'>"
		c=c+"<img border='0' src='Images/icon07.gif' align='bottom' alt='点击导入此模版！'></a>"
		c=c+"</td>"
		
		c=c+"</tr><tr>"
		c=c+"<td height='1' width='100%' colspan='10' background='images/dot03.gif'></td>"
		c=c+"</tr>"
		
		rs.movenext
	loop
	
	c=c+"</table>"
	c=c+"<br>"
	dim ins(2)
	sql=" where sort_sys=1 and sort_up=0 "
	c_order=""
	c_h=c
	c=""
	MySys.ListThings c_order,c_h,c,sql,"jins_template_sort","sort_id",ins
	
end if
%>
<!--#include file="admin_end.asp" -->