<!--#include file="../../SQLconn.asp"-->
<html>

<head>

<title>修改文件</title>

<link rel="stylesheet" type="text/css" href="../../css/style.css" />

<script type="text/javascript" charset="utf-8" src="../../kindeditor3/kindeditor.js"></script><!--免费编辑器引用-->
  <script type="text/javascript">
    KE.show({
        id : 'content1',
        cssPath : './index.css',
     	imageUploadJson : '../../asp/upload_json.asp', 
        fileManagerJson : '../../asp/file_manager_json.asp'

    });
  </script>



<script Language="JavaScript">
function right(mainStr,lngLen) {
// alert(mainStr.length)
if (mainStr.length-lngLen>=0 && mainStr.length>=0 && mainStr.length-lngLen<=mainStr.length) {
return mainStr.substring(mainStr.length-lngLen,mainStr.length)}
else{return null}
}


function form_check(){
if(right(document.form3.file1.value,3)=="exe"){window.alert("不能直接诶发送EXE文件，请压缩后在发送");document.form3.file1.focus();return (false);}
if(document.form3.bumen.value.length<1){window.alert("请选择部门");document.form3.bumen.focus();return (false);}
if(document.form3.ftype.value.length<1){window.alert("请选择类别");document.form3.ftype.focus();return (false);}
if(document.form3.file1.value.length<1){window.alert("请选择文件");document.form3.file1.focus();return (false);}

}

</script>

</head>
<body topmargin="5" leftmargin="5">
      
<!--//////////////////////////////////	 --> 
<script language="javascript" type="text/javascript">
 var classlist=new Array(); //定义js数组
<%
i=1
Set rs = Conn.Execute("SELECT   * from  varSet where  name='学校网站菜单设置'")
			While NOT rs.EOF %>
			//使用asp循环填充js数组,三维数组,分别保存栏目的父ID,栏目名称,栏目ID
			
 classlist[<%=i-1%>]=new Array(<%=rs("vid")%>,"<%=rs("vname2")%>","<%=rs("vname1")%>");

 
 <%  i=i+1
 
 rs.MoveNext 
   
			Wend
			rs.Close%>

//一级栏目选择变动触发函数

function getSmallClass()
{
 var parentid=document.all.vname1.value;  //获取父栏目的ID
 document.all.vname2.length=0;   //将二级栏目下拉清空
 document.all.vname2.options.add(new Option("","0"))  //添加一个自定义的下拉选项
 for(i=0;i<classlist.length;i++)   //遍历js数组
 {
  
  if(classlist[i][2]==parentid)   //js数组里的选项符合条件(父栏目ID来判断)
  {
     document.all.vname2.options.add(new Option(classlist[i][1],classlist[i][1]))  //添加到二级栏目的下拉选项里
  }
 }
}
</script>

<!--//////////////////////////////////	 --> 




<%
curpage=Request.QueryString("curpage") 
dim strID
strId=request("id")

Set rs=Server.CreateObject("Adodb.Recordset")
sql="Select * from SchoolWeb where  ID='"&strID& "'"
rs.open sql,conn,1,1
%>

<BR>

			<form method="post" ENCTYPE="multipart/form-data" name="form3" action="saveModify.asp" onSubmit="return form_check();">
			
			
			<div align="center">
			<table width="767" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#F7FCFF" style="border-collapse:collapse">
			<tr>
			<td width="763"><p>&nbsp;</p>
			<table width="694" border="0" align="center">
			<tr>
			<td width="86" height="28" class="STYLE1"><div align="center">类&nbsp;&nbsp;别</div></td>
			<td colspan="3" class="STYLE1">
			<select name="vname1" id="vname1" style= "width:130px " onChange="getSmallClass();">
			<option selected value=<%=rs("类别")%>><%=rs("类别")%></option>
			<%
			'一级栏目通过asp代码的方式加载
			Set RSsel = Conn.Execute("select avg(vid) as 序号, vname1 from  varset where name='学校网站菜单设置' group  by  vname1 order by 序号")
			While NOT RSsel.EOF %>
			<option value=<%=RSsel( "vname1" )%>><%=RSsel( "vname1" )%></option>
			<% RSsel.MoveNext
			Wend
			RSsel.Close%>
			</select>
			<input type="hidden" name="curpage" value='<%=curpage%>'>
			<input type="hidden" name="id" value='<%=rs("id")%>'>	</td>
			</tr>
			<tr>
			<td height="28" class="STYLE1"><div align="center">二级类别</div></td>
			<td colspan="3" class="STYLE1"><select name="vname2" id="vname2" style= "width:130px ">
			<option selected value=<%=rs("二级类别")%>><%=rs("二级类别")%></option>
			
			</select></td>
			</tr>
			<tr>
			<td height="28" class="STYLE1"><div align="center">发布者</div></td>
			<td width="163" class="STYLE1"><input name="tname" type="text" class="text" id="tname"  size="16"   value=<%=rs("发布者")%>>></td>
			<td width="94" class="STYLE1"><div align="center">发布时间</div></td>
			<td width="333" class="STYLE1"><input
			name=dateandtime class="text" style="WIDTH:100px" onBlur='this.style.backgroundColor="#FFFFFF"' 
			onFocus='this.style.backgroundColor="#FFFADF"'  value=<%=rs("发布日期")%>>					  </td>
			</tr>
			<tr>
			<td height="28" class="STYLE1"><div align="center">标&nbsp;&nbsp;题</div></td>
			<td colspan="3" class="STYLE1"><input name="title" class="text" style="WIDTH: 96%" 
			onFocus='this.style.backgroundColor="#FFFADF"'  onBlur='this.style.backgroundColor="#FFFFFF"' maxlength="50"  value=<%=rs("标题")%>>					  </td>
			</tr>
			<tr>
			<td height="58" class="STYLE1"><div align="center">网页内容</div></td>
			<td colspan="3" class="STYLE1"><label>
			<textarea id="content1" name="content" style="width:600px;height:250px;visibility:hidden;">
			<p>
			<%=rs("内容")%>
			</p>
			</textarea>
			</label></td>
			</tr>
			<tr>
			<td height="3" colspan="4" class="STYLE1">
			
			<table width="515" height="24" border="0" align="center" cellpadding="0"   cellspacing="0"  bordercolor="#6D8DD8"  class="mtable">
			<% set Rsfujian = Conn.Execute("select * from  SchoolWebFile where  fID='"&strId& "' order by id")
			While NOT Rsfujian.EOF %>
			<tr>
			<td width="84" height="24" class="STYLE1"><div align="center">已有附件</div></td>
			<td width="480" class="STYLE1"><div align="center">
			<a href="newFile.asp?id=<%=Rsfujian("id")%>"  target="_blank"><%=Rsfujian("文件名")%></a> </td>
			<td width="118" class="STYLE1"><div align="center">
			
			<a href="deleteFuJian.asp?Fid=<%=strId%>&id=<%=Rsfujian("id")%>"  target="main" class="STYLE1"> 删除</a>
			</div></td>
			</tr>
			<% Rsfujian.MoveNext 
			Wend
			Rsfujian.Close
			%>
			</table>
			
			
			
			</td>
			</tr>
			<tr>
			<td height="39" class="STYLE1"><div align="center">附&nbsp;&nbsp;件</div></td>
			<td colspan="3" class="STYLE1"><input name="file1" type="file" class="text" size=50 ></td>
			</tr>
			<tr>
			<td height="53" class="STYLE1"><div align="center"></div></td>
			<td colspan="3" class="STYLE1"><div align="center">
			<input name="submit" type="submit" class="topanniu" value="保存"  >
			&nbsp;&nbsp;&nbsp;&nbsp;
			<input name="button" type="button" class="topanniu" onClick="location='manage.asp?curpage=<%=curpage%>'"  value="返回" />
			</div>
			<div align="left"></div></td>
			</tr>
			</table>
			</td>
			</tr>
			</table>
			</div>
			</form>

</body>  
</html>  


