<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
	Dim DBC,Conn
	Set DBC = New DataBaseClass
	Set Conn = DBC.OpenConnection()
	Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0302") then Call ReturnError()
	Dim RsBackObj,RsLableObj,LableID,SQLStr
	LableID = Request("LableID")
	SQLStr = "Select * From Lable Where ID=" &LableID
	Set RsLableObj = Server.CreateObject("ADODB.recordset")
	RsLableObj.Open SQLStr,Conn,1,1
	Set RsBackObj = Server.CreateObject("ADODB.recordset")
	RsBackObj.Open "Select * From LableBackUp Where ID="&LableID,conn,3,3
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改标签</title>
</head>
<link href="../Inc/ModeWindow.css" rel="stylesheet">
<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0">
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<form name=form method=post action="" >
	<% if RsBackObj.eof  then %>
	<tr>
	<td width="25%" height="60">
		<div align="center"><img src="../Images/Question.gif" width="39" height="37"></div></td>
	<td align="center" height="30"><font size=2.5>是否备份这项？</font></td></tr>
	<tr>
   	   <td height="30" align="center" colspan="2"> 
	   	<input type=hidden name=operation value=Modify>
	    <input type="submit" value="  确定  " class=Anbutc> 
		<input type="reset" value="  取消  " onclick="window.close()" class=Anbutc> </td>
	</tr>
	<% else %>
	<tr>
	<td width="25%" height="60">
		<div align="center"><img src="../Images/Question.gif" width="39" height="37"></div></td>
	<td align="center" height="30"><font size=2.5>此标签备份存在，确定覆盖？</font></td></tr>
	<tr>
   	   <td height="30" align="center" colspan="2"> 
	   	<input type=hidden name=operationChild value=ModifyChild>
	    <input type="submit" value="  确定  " class=Anbutc> 
		<input type="reset" value="  取消  " onclick="window.close()" class=Anbutc> </td>
	</tr>
	<% end if %>
</form>
</table>
</body>
</html>
<%
	if Request.Form("operation") = "Modify" then
		RsBackObj.AddNew
		RsBackObj("ID") = RsLableObj("ID")
		Back()
	end if		
	if Request.Form("operationChild") = "ModifyChild" then
		Back()
	end if
Function Back()
	'On Error Resume Next
	RsBackObj("LableName") = RsLableObj("LableName")
	RsBackObj("LableContent") = RsLableObj("LableContent")
	RsBackObj("Description") = RsLableObj("Description")
	RsBackObj("Type") = RsLableObj("Type")
	RsBackObj("BackUpTime") = now()
	RsBackObj.Update
	RsBackObj.Close
	RsLableObj.Close
	Set RsLableObj = Nothing
	Set conn = Nothing
	if err>0 then
		%>
		<script language="javascript">
			alert('备份失败');
			window.close();
		</script>
		<%
	else
		%>
		<script language="javascript">
			alert('备份成功');
			window.close();
		</script>
		<%
	end if
End Function
%>