<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<HTML>
<HEAD>
<TITLE>添加幻灯片</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style>
body,td,input,textarea {font-size:9pt}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
</style>
<script language="JavaScript" src="../JS/PublicJS.js"></script>
<script type="text/javascript">
function check(obj){
	if(obj.title.value==""){
		alert("幻灯片名称不能为空");
		obj.title.focus();
		return false;
	}
	return true;
}
</script>
</HEAD>
<BODY>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p05")
'''''''''''''''''''''''''''''''''''''''''''''''
%>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<%
dim act
act=request.QueryString("act")
if(act="do") then
	dim catalogid,nums,rowtemp,pic,links,texts,i
	title=request.Form("title")
	if isnumeric(request.Form("catalogid")) then
		catalogid=cint(request.Form("catalogid"))
	else
		response.Write("<script>alert('类别不能为空！');history.back();</script>")
		response.End()
	end if	
	ischild=cint(request.Form("ischild"))
	if isnumeric(request.Form("nums")) then
		nums=Cint(request.Form("nums"))
	else
		response.Write("<script>alert('数量设置错误！');history.back();</script>")
		response.End()
	end if
	s_w=Cint(request.Form("s_w"))
	s_h=Cint(request.Form("s_h"))
	'''''''''''''''''''''''''''''''''添加到库''''''''''''''''''''''''''''
	set rs=server.createobject("adodb.recordset")
	sql="select top 1 * from t_slide where 1=0 order by id desc "
	rs.open sql,conn,3,3
	rs.addnew
	rs("title")=title
	rs("catalog_id")=catalogid	
	rs("ischilds")=ischild
	rs("s_num")=nums
	rs("s_width")=s_w
	rs("s_height")=s_h
	rs.update
	rs.close
	set rs=nothing

	''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	response.Write("成功添加幻灯片~!")
	response.Write("<br><a href="""&request.ServerVariables("HTTP_REFERER")&""">返回-></a><br>")
else
%>
<FORM method="POST" name="form1" action="?act=do" style="margin:0 0 0 0;" onSubmit="return check(this)">
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#666666">
<TR bgcolor="#FF9900">
  <TD height="22" colspan="2"><div align="center" class="style1">添加幻灯片</div></TD>
  </TR>
<TR bgcolor="#F5F5F5">
  <TD><div align="right">幻灯片名称：</div></TD>
  <TD><input name="title" type="text" id="title"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD width="18%"><div align="right">所 属 类 别：</div></TD>
  <TD width="82%">
  <select name="catalogid" >
  <option value="0">点击右边＋号选择栏目</option>  	     
    </select>&nbsp;&nbsp;<a href="#" onClick="addParentOption();">＋</a></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD><div align="right">是否包括子栏目：</div></TD>
  <TD><select name="ischild">
    <option value="1">是</option>
    <option value="0">否</option>
  </select>  </TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD><div align="right">数量：</div></TD>
  <TD><input name="nums" type="text" id="nums" value="4" size="10"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD align=right><div align="right">幻灯片宽度：</div></TD>
  <TD align=right><div align="left">
    <input name="s_w" type="text" id="s_w" value="254" size="10" maxlength="10">
  </div></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD align=right><div align="right">幻灯片高度：</div></TD>
  <TD align=right><div align="left">
    <input name="s_h" type="text" id="s_h" value="176" size="10" maxlength="10">
  </div></TD>
</TR>
<TR bgcolor="#F5F5F5">
	<TD align=right>&nbsp;	  </TD>
    <TD align=right><div align="left"> 
        <input type=submit name=b1 value="提 交">&nbsp;&nbsp;
        <input type=reset name=b2 value="重 填">       
    </div></TD>
</TR>
</TABLE>
</FORM>
<script>
function addParentOption()
{
	var arr = showModalDialog("tree_container.asp", "", "dialogWidth:410px; dialogHeight:420px; status:0");
  	if (arr != null){  
   		document.form1.catalogid.options[0]=new Option(arr[1],arr[0]);
  	}
	
}
</script>
<%
end if
%>
</BODY>
</HTML>
<%
call connclose()
%>