<html>
<head>
<META content=ywnt,云网互动影视管理系统 name=keywords>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>云网互动影视6.0--幻灯管理</title>
<LINK href="css/css.css" type=text/css rel=stylesheet>
</head>
<BODY leftMargin=0 topMargin=0 scroll=yes MARGINHEIGHT="0" MARGINWIDTH="0">
<script language="JavaScript" type="text/javascript" src="YWNT_TMS_inc/YWNT_TMS_Common.js"></script>
<!--#include file="../Conn.asp" -->
<!--#include file="YWNT_TMS_inc/YWNT_TMS_Function.asp" -->
<!--#include file="YWNT_TMS_inc/YWNT_TMS_Page.asp" -->
<%
'===================================================================================================================
'软件名称：云网影视管理系统
'Copyright (C) 2002-2007 ywnt.net  All rights reserved.
'产品咨询QQ：489234,2813712
'程序版权：云网互动科技有限公司
'程序开发：云网互动科技有限公司
'官方网站：http://www.ywnt.net 
'郑重声明:
'    1、免费版本请在程序首页保留版权信息，并做上本站LOGO友情连接,商业版本无此要求;
'    2、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息；
'    3、云网互动科技有限公司保留此软件的法律追究权利
'===================================================================================================================
Call CheckLogin("Slide")
CurrPath=GetConfig("PhotoUpDir")
sub EditSave()
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_Slide where ID="&NoSqlHack(Request.Form("ID"))
		Rs.open sql,Conn,1,3
		RS("SlideType")=NoSqlHack(Request.Form("ClassID"))
		RS("SlideIndex")=NoSqlHack(Request.Form("SlideIndex"))
		RS("SlideName")=NoSqlHack(Request.Form("SlideName"))
		RS("SlidePic")=NoSqlHack(Request.Form("SlidePic"))
		RS("SlideUrl")=NoSqlHack(Request.Form("SlideUrl"))
		RS("SlideContent")=NoSqlHack(Request.Form("SlideContent"))
		RS("SlideWith")=NoSqlHack(Request.Form("SlideWith"))
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Call AddLog("修改幻灯"&Request.Form("SlideName"),3)
		call Admin_ShowErr("<li>修改幻灯成功</li>","Admin_Slide.asp",1)
end sub
sub AddSave()
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_Slide"
		Rs.open sql,Conn,1,3
		Rs.addnew
		RS("SlideType")=NoSqlHack(Request.Form("ClassID"))
		RS("SlideIndex")=NoSqlHack(Request.Form("SlideIndex"))
		RS("SlideName")=NoSqlHack(Request.Form("SlideName"))
		RS("SlidePic")=NoSqlHack(Request.Form("SlidePic"))
		RS("SlideUrl")=NoSqlHack(Request.Form("SlideUrl"))
		RS("SlideContent")=NoSqlHack(Request.Form("SlideContent"))
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		Call AddLog("添加幻灯"&Request.Form("SlideName"),3)
		call Admin_ShowErr("<li>添加幻灯成功</li>","Admin_Slide.asp",1)
end sub
sub Del()
	conn.execute "delete from YWNT_TMS_Slide WHERE ID in ("&NoSqlHack(Request("ID"))&")"
	Call AddLog("删除幻灯",3)
	call Admin_ShowErr("<li>删除幻灯成功！</li>","Admin_Slide.asp",1)
end sub%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td class=xingmu>幻灯管理</td>
    </tr>
    <tr>
      <td class="hback"><a href="Admin_Slide.asp">幻灯管理首页</a> | <a href="Admin_Slide.asp?Action=Add">添加幻灯</a> </td>
    </tr>
  </tbody>
</table>
<% Action=Trim(request("Action"))
Select Case Action
Case "Add"
	call Add()
Case "AddSave"
	call AddSave()
Case "Edit"
		Set Rs=Server.CreateObject(YWNT_TMS_RS)
		sql="select * from YWNT_TMS_Slide where ID="&NoSqlHack(Request.QueryString("ID"))
		Rs.open sql,Conn,1,1
		YWNT_TMS_ID=RS("ID")
		YWNT_TMS_SlideType=RS("SlideType")
		YWNT_TMS_SlideIndex=RS("SlideIndex")
		YWNT_TMS_SlideName=RS("SlideName")
		YWNT_TMS_SlidePic=RS("SlidePic")
		YWNT_TMS_SlideUrl=RS("SlideUrl")
		YWNT_TMS_SlideContent=RS("SlideContent")
		YWNT_TMS_SlideWith=RS("SlideWith")
		RS.close   
      	set RS=nothing
	call Edit()
Case "EditSave"
	call EditSave()
Case "Del"
	call Del()
Case else
	call List()
End Select
sub List()
Dim int_RPP
	int_RPP=GetConfig("PageNumber") '设置每页显示数目%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td class=xingmu>幻灯分类管理</td>
    </tr>
    <tr>
      <td class="hback"><a href="Admin_Slide.asp">所有影片</a> | <% Classtop(Request.QueryString("ParentId")) %></td>
    </tr>
  </tbody>
</table> 
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <tbody>
    <tr>
      <td width="4%" align="center" class=xingmu>ID</td>
      <td width="33%" align="center" class=xingmu>幻灯名称</td>
      <td width="15%" align="center" class=xingmu>幻灯图片</td>
      <td width="10%" align="center" class=xingmu>幻灯栏目</td>
      <td width="10%" align="center" class=xingmu>首页推荐</td>
      <td width="10%" align="center" class=xingmu>显示排序</td>
      <td width="9%" align="center" class=xingmu>操作</td>
    </tr>
	<%  Set Rs = server.CreateObject(YWNT_TMS_RS)
		sql="Select ID,SlideName,SlidePic,SlideWith,SlideType,SlideIndex from YWNT_TMS_Slide "
		if Request.QueryString("ID")<>"" then
			sql=sql&"where SlideType="&NoSqlHack(Request.QueryString("ID"))&" Order by SlideWith asc,ID asc"
		else
		    sql=sql&"Order by SlideWith asc,ID asc"
		end if
		Rs.open sql,Conn,1,1
	if Rs.eof then
	   Response.Write"<TR  class=""hback""><TD colspan=""7"" class=""hback"" height=""40"">没有记录。</TD></TR>"
	else
		Rs.PageSize=int_RPP
		cPageNo=NoSqlHack(Request.QueryString("Page"))
		If cPageNo="" Then cPageNo = 1
		If not isnumeric(cPageNo) Then cPageNo = 1
		cPageNo = Clng(cPageNo)
		If cPageNo>Rs.PageCount Then cPageNo=Rs.PageCount 
		If cPageNo<=0 Then cPageNo=1
		Rs.AbsolutePage=cPageNo 
	for i=1 to int_RPP
	 if Rs.eof Then exit For %>
    <tr>
      <td height=32 align="center" class="hback"><%=RS("ID")%></td>
      <td height=32 class="hback"><%=RS("SlideName")%></td>
      <td align="center" class="hback"><img src="<%=RS("SlidePic")%>" width="60" height="40"></td>
      <td height=32 align="center" class="hback"><%ClassName(RS("SlideType"))%></td>
      <td height=32 align="center" class="hback"><%if RS("SlideIndex")=1 then Response.Write"首页显示" else Response.Write"栏目显示" end if%></td>
      <td height=32 align="center" class="hback"><%=RS("SlideWith")%></td>
      <td align="center" class="hback"><A href="Admin_Slide.asp?Action=Edit&ID=<%=RS("ID")%>">修改</A>｜<A href="Admin_Slide.asp?Action=Del&ID=<%=RS("ID")%>">删除</A></td>
    </tr>
	<%Rs.MoveNext
	next 
	end if%>
    <tr>
      <td height=32 colspan="7" align="right" class="hback"><% response.Write fPageCount(Rs,cPageNo) %></td>
    </tr>
  </tbody>
</table>
<%end sub
sub Add()%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
<form action="Admin_Slide.asp?Action=AddSave" method="post" name="PicForm">
  <tbody>
    <tr>
      <td colspan="2" class=xingmu>添加幻灯</td>
    </tr>
    <tr>
      <td width="21%" height=32 align="right" class="hback">选择栏目：</td>
      <td height=15 class="hback"><input name="ClassName" type="text" id="ClassName" size="40" readonly>
	  	<input name="ClassID" type="hidden" id="ClassID" value="">
          <input type="button" name="Submit2" value="选择栏目" onClick="SelectClass();">
          <input type="button" name="Submit22" value="添加栏目" onClick="window.location.href='Admin_Type.asp?Action=Add'">
	    </td>
    </tr>
	   <tr>
      <td height=32 align="right" class="hback">首页推荐：</td>
      <td height=32 class="hback">        <input type="radio" name="SlideIndex" value="1">
        是
&nbsp;&nbsp;<input name="SlideIndex" type="radio" value="0" checked>
        否</td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">幻灯名称：</td>
      <td height=32 class="hback"><input name="SlideName" type="text" id="SlideName" size="40">
        &nbsp;&nbsp;</td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">幻灯图片：</td>
      <td height=32 class="hback"><input name="SlidePic" id="SlidePic" value='http://' size=30 maxlength="200"> 
	<input type="button" name="Button" value="选择图片" onClick="var TempReturnValue=OpenWindow('Dialog/SelectPic.asp?CurrPath=<% = CurrPath %>',500,290,window);if (TempReturnValue!='') document.PicForm.SlidePic.value=TempReturnValue;" class=Anbutc></td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">连接地址：</td>
      <td height=32 class="hback"><input name="SlideUrl" type="text" id="SlideUrl" size="40"></td>
    </tr>
    <tr>
      <td height=32 align="right" class="hback">幻灯备注：</td>
      <td height=32 class="hback"><textarea name="SlideContent" cols="50" rows="5" id="SlideContent"></textarea></td>
    </tr>
    <tr>
      <td height=32 colspan="2" align="center" class="hback"><input type="submit" name="Submit" value="添 加"></td>
    </tr>
  </tbody>
  </form>
</table>
<%end sub
sub Edit()%>
<table class=table cellspacing=1 cellpadding=3 width="98%" align=center border=0>
  <form action="Admin_Slide.asp?Action=EditSave" method="post" name="PicForm">
    <tbody>
      <tr>
        <td colspan="2" class=xingmu>修改幻灯</td>
      </tr>
      <tr>
        <td width="21%" height=32 align="right" class="hback">选择栏目：</td>
        <td height=15 class="hback"><input name="ClassName" type="text" value="<% ClassName(YWNT_TMS_SlideType) %>" size="40" readonly>
            <input name="ClassID" type="hidden" id="ClassID" value="<%= YWNT_TMS_SlideType %>">
            <input type="button" name="Submit2" value="选择栏目" onClick="SelectClass();">
            <input type="button" name="Submit22" value="添加栏目" onClick="window.location.href='Admin_Type.asp?Action=Add'">
        </td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">首页推荐：</td>
        <td height=32 class="hback"><input type="radio" name="SlideIndex" value="1" <%if YWNT_TMS_SlideIndex=1 then Response.Write("checked")%>>
          是 &nbsp;&nbsp;
          <input name="SlideIndex" type="radio" value="0" <%if YWNT_TMS_SlideIndex=0 then Response.Write("checked")%>>
          否</td>
      </tr>
	  <tr>
      <td height=32 align="right" class="hback">显示顺序：</td>
      <td height=32 class="hback"><input name="SlideWith" type="text" id="SlideWith" value="<%= YWNT_TMS_SlideWith %>" size="8"></td>
    </tr>
      <tr>
        <td height=32 align="right" class="hback">幻灯名称：</td>
        <td height=32 class="hback"><input name="SlideName" type="text" value="<%= YWNT_TMS_SlideName %>" size="40">
&nbsp;&nbsp;</td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">幻灯图片：</td>
        <td height=32 class="hback"><input name="SlidePic" id="SlidePic" value='<%= YWNT_TMS_SlidePic %>' size=30 maxlength="200">
            <input type="button" name="Button" value="选择图片" onClick="var TempReturnValue=OpenWindow('Dialog/SelectPic.asp?CurrPath=<% = CurrPath %>',500,290,window);if (TempReturnValue!='') document.PicForm.SlidePic.value=TempReturnValue;" class=Anbutc></td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">连接地址：</td>
        <td height=32 class="hback"><input name="SlideUrl" type="text" id="SlideUrl" value="<%= YWNT_TMS_SlideUrl %>" size="40"></td>
      </tr>
      <tr>
        <td height=32 align="right" class="hback">幻灯备注：</td>
        <td height=32 class="hback"><textarea name="SlideContent" cols="50" rows="5" id="SlideContent"><%= YWNT_TMS_SlideContent %></textarea></td>
      </tr>
      <tr>
        <td height=32 colspan="2" align="center" class="hback"><input name="ID" type="hidden" value="<%= YWNT_TMS_ID %>"><input type="submit" name="Submit" value="修 改"></td>
      </tr>
    </tbody>
  </form>
</table>
<%end sub
call connclose()%>
</BODY></HTML>
