<!--#include file="Config.asp" -->
<div class='menu'>&nbsp;编辑 &gt; 单页</div>
<%
eims = "Abaut"
eTable = Prefix&eims
ListUrl = eims&"List.asp?eims="&eims
EditUrl = eims&"Edit.asp?eims="&eims
Mgt("p01") 'Cookies : Permission
'------------------------------------------------
Select Case action
Case "SaveAdd" '保存添加
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.Open "Select * From ["&eTable&"]",Conn,1,3
Rs.AddNew
Rs("Title")=Trim(Request.Form("Title")) 
Rs("Photo")=Trim(Request.Form("Photo"))
Rs("Seq")=Trim(Request.Form("Seq"))
Rs("ItemNote")=Trim(Request.Form("ItemNote"))
Rs("EditDate")=Trim(Request.Form("EditDate"))
Rs("ItemHit")=Trim(Request.Form("ItemHit"))
Rs("ItemRec")=Trim(Request.Form("ItemRec"))
Rs("AddDate")=Now()
Rs.Update
Response.Redirect "Redirect.asp?eims="&eims&"&SortID="&SortID&"&ItemID="&Rs("ItemID")
Rs.Close:Set Rs=Nothing
Response.End
Case "SaveMod" '保存修改
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.Open "Select * From ["&eTable&"] Where ItemID="&ItemID,Conn,1,3
Rs("Title")=Trim(Request.Form("Title")) 
Rs("Photo")=Trim(Request.Form("Photo"))
Rs("Seq")=Trim(Request.Form("Seq"))
Rs("ItemNote")=Trim(Request.Form("ItemNote"))
Rs("EditDate")=Trim(Request.Form("EditDate"))
Rs("ItemHit")=Trim(Request.Form("ItemHit"))
Rs("ItemRec")=Trim(Request.Form("ItemRec"))
Rs.Update
Rs.Close:Set Rs=Nothing
Response.Redirect "Redirect.asp?eims="&eims&"&SortID="&SortID&"&ItemID="&ItemID
Response.End
Case "Edit" '显示数据
SaveStr="SaveMod"
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.Open "Select * From ["&eTable&"] Where ItemID="&ItemID,Conn,1,1
If Not Rs.Eof Then
Title=Trim(Rs("Title")) 
Photo=Trim(Rs("Photo"))
Seq=Int(Rs("Seq"))
ItemNote=Trim(Rs("ItemNote"))
EditDate=Trim(Rs("EditDate"))
ItemHit=Trim(Rs("ItemHit"))
End If
Rs.Close:Set Rs=Nothing
End Select

'------------------------------------------------
if SaveStr="" then SaveStr="SaveAdd"
If ItemHit = "" Then ItemHit=1
if Seq<1 then Seq=CreSeq(eims)
%>
<script language="JavaScript" type="text/javascript">
function ckedit(){
   if (trim(document.eForm.Title.value).length<2){
	  alert("标题不能少于2个字符！");
	  return false;
	  exit;}
   return true;}
</script>
<div class="content">
<Form name='eForm' method='post' action='?action=<%=SaveStr%>&ItemID=<%=ItemID%>'>
  <table width="100%" border="0" cellspacing="1" cellpAdding="1" align="center">
      <tr>
        <td align="center" width="12%">标题</td>
        <td><input name="Title" type="text" value="<%=Title%>" size="60">
            <select name="ItemRec">
			<option value='1'>显示</option>
			<option value='0'>隐藏</option>
            </select>
        </td>
      </tr>
      <tr>
        <td align="center">图片</td>
        <td><iframe src="Upload.asp?eType=pic&fField=Photo" scrolling="no" frameborder="0" width="300" height="25"></iframe><br>
		<input type="text" name="Photo" size="50" value="<%=Photo%>">
		<input type="checkbox" value="1" name="Thumbnail">自动缩小</td>
      </tr>

      <tr>
        <td align="center">说明</td>
        <td><textarea name="ItemNote" style="width:680px;height:300px;visibility:hidden;"><%=ItemNote%></textarea></td>
      </tr>

      <tr>
        <td align="center">排序</td>
        <td><input name="Seq" type="text" value="<%=Seq%>"></td>
      </tr>
      <tr bgcolor="#FFFFFF" valign="middle">
        <td></td>
        <td align="left"><input type="submit" name="Submit" value="保 存" onClick="return ckedit()">
          &nbsp;&nbsp;
          <input type="button" value="返 回" onClick="history.go(-1);"></td>
      </tr>    
  </table>
</Form>
</div>
</body></html>
<%Call CloseConn()%>
