<!--#include file="../Inc/Consts.inc" -->
<!--#include file="CheckAdmin.Asp"-->
<!--#include file="../Inc/common.Asp" -->
<%If InStr(SsMasterPurview, "|8,") = 0 Then
    response.Write ("<br /><br /><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
    response.End
End If%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="Images/Admin_style.css">
<script src="../tqeditor/TQEditor.js" type="text/javascript"></script>
<script language=javascript>
ie = (document.all)? true:false
if (ie){
function ctlent(eventobject){if(event.ctrlKey && window.event.keyCode==13){this.document.editForm.submit();}}
}
</script>
<%
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com

Dim Result,rs,sql
Result = request.QueryString("Result")
Dim ID, LabelName, LabelMark, LabelContent
ID = request.QueryString("ID")
Call LabelEdit()
%>
<br />
<table class="tableBorder" width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
  <form name="editForm" id="editForm" method="post" action="Ss_LabelEdit.Asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
    <tr>
      <th height="22" colspan="2" sytle="line-height:150%">【<%If Result = "Add" then%>添加<%ElseIf Result = "Modify" then%>修改<%End If%>标签】</th>
    </tr>
    <tr>
      <td width="10%" align="right" class="forumRow">标签代码：</td>
      <td class="forumRowHighlight"><input name="LabelName" type="text" id="LabelName" style="width:100" value="<%=LabelName%>" maxlength="30"  onkeyup="this.value=this.value.replace(/[^\w]/g,'')" onpaste="this.value=this.value.replace(/[^\w]/g,'')">        
        <font color="red">*只能使用字母或数字，必须以字母开头，如：Newtag_01</font></td>
    </tr>
    <tr>
      <td width="10%" nowrap align="right" class="forumRow">标签说明：</td>
      <td width="90%" class="forumRowHighlight"><input name="LabelMark" type="text" id="LabelMark" style="width: 500" value="<%=LabelMark%>" maxlength="250"></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">标签内容：</td>
      <td class="forumRowHighlight">
       <textarea id="labelcontent" rows="18" cols="100"  name="labelcontent"><% = LabelContent%></textarea>
<script type="text/javascript" defer> 
 new tqEditor('labelcontent', {toolbar:'full', uploadFieldName:'filedata',imageUploadUrl:'./upload.asp', imageFileTypes:'*.jpg;*.gif;*.png;*.jpeg',directInsertUploadImage:'true'}); 
</script>
      </td>
    </tr>
    <tr>
      <td align="right" class="forumRow"></td>
      <td class="forumRowHighlight"><input accessKey="s" name="submitSaveEdit" type="submit" id="submitSaveEdit" value="(Alt+S)提交"> <input type="button" value="返回前页" onclick="history.back(-1)"></td>
    </tr>
  </form>
</table>
<%
Sub LabelEdit()
    Dim Action, rsRepeat
	Dim Sorts,tempSort
    Action = request.QueryString("Action")
    If Action = "SaveEdit" Then        
        If Len(Trim(request.Form("LabelName")))<3 Then
            response.Write ("<script language='javascript'>alert('请填写标签名称！');history.back(-1);</script>")
            response.End
        End If
        If Result = "Add" Then
            sql = "select ID,LabelName,LabelMark,LabelContent,UpdateTime from ["&Datapre&"_Labels]"
            set rs=db(sql,3)
            rs.addnew
            call savedatas()
            
            rs.update
			ID = rs("ID")
            rs.Close
            Set rs = Nothing
            
        End If
        If Result = "Modify" Then
            sql = "select LabelName,LabelMark,LabelContent,UpdateTime from ["&Datapre&"_Labels] where ID="&ID
            set rs=db(sql,3)
            call savedatas()
            rs.update
            rs.Close
            Set rs = Nothing
            
        End If
        
            call Alert( "提交成功！","Ss_Labels.Asp")

    Else
        If Result = "Modify" Then
            
            sql = "select ID,LabelName,LabelMark,LabelContent,UpdateTime from ["&Datapre&"_Labels] where ID="& ID
            Set rs = db(sql,2)
            If rs.bof And rs.EOF Then
                response.Write ("<center>数据库记录读取错误！</center>")
                response.End
            End If
            LabelName = rs("LabelName")
            LabelMark = rs("LabelMark")
           LabelContent = rs("LabelContent")
            
            rs.Close:Set rs = Nothing
        End If
    End If
End Sub

sub savedatas()
rs("LabelName") = Trim(Request.Form("LabelName"))
rs("LabelMark") = Trim(Request.Form("LabelMark"))
rs("LabelContent") = Request.Form("LabelContent")
rs("UpdateTime")= Now()
end sub

' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
%>