<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<%
Dim SqlItem,RsItem,FoundErr,ErrMsg
Dim ItemID,ItemName,ChannelID,strChannelDir,Websen_infoClassID,expoClassID,ClassID,SpecialID,PaginationType,MaxCharPerPage,ReadLevel
Dim Stars,ReadPoint,Hits,UpDateType,UpDateTime,IncludePicYn,DefaultPicYn,OnTop,Elite,Hot,SkinID,TemplateID
Dim Script_Iframe,Script_Object,Script_Script,Script_Div,Script_Class,Script_Span,Script_Img,Script_Font,Script_A,Script_Html,Script_Table,Script_Tr,Script_Td
Dim CollecListNum,CollecNewsNum,Passed,SaveFiles,CollecOrder,LinkUrlYn,InputerType,Inputer,EditorType,Editor,ShowCommentLink
Dim tClass,tSpecial
FoundErr=False
ItemID=Request("ItemID")

If ItemID="" Then
   FoundErr=True
   ErrMsg=ErrMsg & "<br><li>参数错误，请从有效链接进入</li>"
Else
   ItemID=Clng(ItemID)
End If

If FoundErr<>True Then
   ItemName=Trim(Request.Form("ItemName"))
   ChannelID=Request.Form("ChannelID")
   Websen_infoClassID=Request.Form("infoClassID")
   expoClassID=Request.Form("expoClassID")
   SpecialID=Trim(Request.Form("SpecialID"))
   PaginationType=Trim(Request.Form("PaginationType"))
   MaxCharPerPage=Trim(Request.Form("MaxCharPerPage"))
   ReadLevel=Trim(Request.Form("ReadLevel"))
   Stars=Trim(Request.Form("Stars"))
   ReadPoint=Trim(Request.Form("ReadPoint"))
   Hits=Trim(Request.Form("Hits"))
   UpdateType=Trim(Request.Form("UpdateType"))
   UpDateTime=Trim(Request.Form("UpDateTime"))
   IncludePicYn=Trim(Request.Form("IncludePicYn"))
   DefaultPicYn=Trim(Request.Form("DefaultPicYn"))
   OnTop=Trim(Request.Form("OnTop"))
   Elite=Trim(Request.Form("Elite"))
   Hot=Trim(Request.Form("Hot"))
   SkinID=Trim(Request.Form("SkinID"))
   TemplateID=Trim(Request.Form("TemplateID"))
   Script_Iframe=Trim(Request.Form("Script_Iframe"))
   Script_Object=Trim(Request.Form("Script_Object"))
   Script_Script=Trim(Request.Form("Script_Script"))
   Script_Div=Trim(Request.Form("Script_Div"))
   Script_Class=Trim(Request.Form("Script_Class"))
   Script_Span=Trim(Request.Form("Script_Span"))
   Script_Img=Trim(Request.Form("Script_Img"))
   Script_Font=Trim(Request.Form("Script_Font"))
   Script_A=Trim(Request.Form("Script_A"))
   Script_Html=Trim(Request.Form("Script_Html"))
   CollecListNum=Trim(Request.Form("CollecListNum"))
   CollecNewsNum=Trim(Request.Form("CollecNewsNum"))
   Passed=Trim(Request.Form("Passed"))
   SaveFiles=Trim(Request.Form("SaveFiles"))
   CollecOrder=Trim(Request.Form("CollecOrder"))
   LinkUrlYn=Trim(Request.Form("LinkUrlYn"))
   InputerType=Trim(Request.Form("InputerType"))
   Inputer=Trim(Request.Form("Inputer"))
   EditorType=Trim(Request.Form("EditorType"))
   Editor=Trim(Request.Form("Editor"))
   ShowCommentLink=Trim(Request.Form("ShowCommentLink"))
   Script_Table=Trim(Request.Form("Script_Table"))
   Script_Tr=Trim(Request.Form("Script_Tr"))
   Script_Td=Trim(Request.Form("Script_Td"))

   If ItemName="" Then
      FoundErr=True
      ErrMsg=ErrMsg & "<br><li>项目名称不能为空！</li>"
   End If
   If ChannelID="" Then
      FoundErr=True
      ErrMsg=ErrMsg & "<br><li>请选择项目所属频道！</li>"
   Else
      ChannelID=Clng(ChannelID)
   End If

if ChannelID=1 then
If Websen_infoClassID=""  Then
   FoundErr=True
   ErrMsg=ErrMsg & "<br><li>未指定商业资讯栏目</li>"
else
ClassID=Websen_infoClassID
End if
end if

if ChannelID=2 then
If expoClassID=""  Then
   FoundErr=True
   ErrMsg=ErrMsg & "<br><li>未指定展会资讯栏目</li>"
else
ClassID=expoClassID
End if
end if

   If SpecialID="" Then
      SpecialID=0
   end if

   If PaginationType="" Then
      FoundErr=True
      ErrMsg=ErrMsg & "<br><li>请选择分页类型！</li>"
   Else
      PaginationType=Clng(PaginationType)
   End If
   If MaxCharPerPage="" and PaginationType=1 Then
      FoundErr=True
      ErrMsg=ErrMsg & "<br><li>请输入每页字符数！</li>"
   Else
      MaxCharPerPage=Clng(MaxCharPerPage)
   End If
   If ReadPoint="" Then
      ReadPoint=0
   Else
      ReadPoint=Clng(ReadPoint)
   End if
   If Hits="" Then
      Hits=0
   Else
      Hits=Clng(Hits)
   End if
   If UpdateType="" Then
      FoundErr=True
      ErrMsg=ErrMsg & "<br><li>请选择信息录入时间类型！</li>"
   Else
      UpdateType=Clng(UpdateType)
      If UpDateType=2 Then
         If IsDate(UpdateTime)=False Then
            FoundErr=True
            ErrMsg=ErrMsg & "<br><li>信息录入时间格式不正确！</li>"
         Else
            UpDateTime=CDate(UpDateTime)
         End If
      End If
   End if
   If CollecListNum="" Then
      FoundErr=True
      ErrMsg=ErrMsg & "<br><li>请填写信息列表深度！</li>" 
   Else
      CollecListNum=Clng(CollecListNum)
   End If
   If CollecNewsNum="" Then
      FoundErr=True
      ErrMsg=ErrMsg & "<br><li>请填写信息采集数量！</li>" 
   Else
      CollecNewsNum=Clng(CollecNewsNum)
   End If

   If InputerType="" Then
      FoundErr=True
      ErrMsg=ErrMsg & "<br><li>请选择信息录入者类型！</li>" 
   Else
      InputerType=Clng(InputerType)
      If InputerType=1 And Inputer="" Then
         FoundErr=True
         ErrMsg=ErrMsg & "<br><li>请填写信息录入者！</li>" 
      End If
   End If

   If ShowCommentLink="Yes" Then
      ShowCommentLink=True
   Else
      ShowCommentLink=False
   End If
End If
If FoundErr<>True Then
   SqlItem="Select * from Item Where ItemID=" & ItemID
   Set RsItem=server.CreateObject("adodb.recordset")
   RsItem.Open SqlItem,ConnItem,2,3
   If RsItem.Eof And RsItem.Bof Then
      FoundErr=True
      ErrMsg=ErrMsg & "<br><li>参数错误，没有找该项目</li>"
   Else
      RsItem("ItemName")=ItemName
      RsItem("ChannelID")=ChannelID
      RsItem("ChannelDir")=strChannelDir
      RsItem("ClassID")=ClassID
      RsItem("SpecialID")=SpecialID
      RsItem("PaginationType")=PaginationType
      RsItem("MaxCharPerPage")=MaxCharPerPage
      RsItem("ReadPoint")=ReadPoint
      RsItem("Hits")=Hits
      RsItem("UpdateType")=UpdateType
      If UpdateType=2 Then
         RsItem("UpDateTime")=UpDateTime
      End If
      If IncludePicYn="yes" Then
         RsItem("IncludePicYn")=-1
      Else
         RsItem("IncludePicYn")=0
      End If
      If DefaultPicYn="yes" Then
         RsItem("DefaultPicYn")=-1
      Else
         RsItem("DefaultPicYn")=0
      End If
      If OnTop="yes" Then
         RsItem("OnTop")=-1
      Else
         RsItem("OnTop")=0
      End If
      If Elite="yes" Then
         RsItem("Elite")=-1
      Else
         RsItem("Elite")=0
      End If
      If Hot="yes" Then
         RsItem("Hot")=-1
      Else
         RsItem("Hot")=0
      End If
      If Script_Iframe="yes" Then
         RsItem("Script_Iframe")=-1
      Else
         RsItem("Script_Iframe")=0
      End If
      If Script_Object="yes" Then
         RsItem("Script_Object")=-1
      Else
         RsItem("Script_Object")=0
      End If
      If Script_Script="yes" Then
         RsItem("Script_Script")=-1
      Else
         RsItem("Script_Script")=0
      End If
      If Script_Div="yes" Then
         RsItem("Script_Div")=-1
      Else
         RsItem("Script_Div")=0
      End If
      If Script_Class="yes" Then
         RsItem("Script_Class")=-1
      Else
         RsItem("Script_Class")=0
      End If
      If Script_Span="yes" Then
         RsItem("Script_Span")=-1
      Else
         RsItem("Script_Span")=0
      End If
      If Script_Img="yes" Then
         RsItem("Script_Img")=-1
      Else
         RsItem("Script_Img")=0
      End If

      If Script_Font="yes" Then
         RsItem("Script_Font")=-1
      Else
         RsItem("Script_Font")=0
      End If
      If Script_A="yes" Then
         RsItem("Script_A")=-1
      Else
         RsItem("Script_A")=0
      End If

      If Script_Html="yes" Then
         RsItem("Script_Html")=-1
      Else
         RsItem("Script_Html")=0
      End If
      RsItem("CollecListNum")=CollecListNum
      RsItem("CollecNewsNum")=CollecNewsNum

      If Passed="yes" Then
         RsItem("Passed")=-1
      Else
         RsItem("Passed")=0
      End If
      If SaveFiles="yes" Then
         RsItem("SaveFiles")=-1
      Else
         RsItem("SaveFiles")=0
      End If
      If CollecOrder="yes" Then
         RsItem("CollecOrder")=-1
      Else
         RsItem("CollecOrder")=0
      End If
      If LinkUrlYn="yes" Then
         RsItem("LinkUrlYn")=-1
      Else
         RsItem("LinkUrlYn")=0
      End If
      RsItem("InputerType")=InputerType
      If InputerType=1 Then
         RsItem("Inputer")=Inputer
      End If
      RsItem("ShowCommentLink")=ShowCommentLink
      RsItem("Flag")=True
      If Script_Table="yes" Then
         RsItem("Script_Table")=-1
      Else
         RsItem("Script_Table")=0
      End If
      If Script_Tr="yes" Then
         RsItem("Script_Tr")=-1
      Else
         RsItem("Script_Tr")=0
      End If
      If Script_Td="yes" Then
         RsItem("Script_Td")=-1
      Else
         RsItem("Script_Td")=0
      End If

   End If
   ErrMsg="<br><li>" & ItemName & " 项目设置完成！</li>"
   RsItem.UpDate
   RsItem.Close
   Set RsItem=Nothing 
End If

If FoundErr=True Then
   Call WriteErrMsg(ErrMsg)
Else
   Call WriteSucced(ErrMsg)
End If
'关闭数据库链接
Call CloseConn()
Call CloseConnItem()
%>
