<!--#include file="ljconn.asp"-->
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../img/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-size: 12px}
-->
</style>
</head>

<body>
<script language="JavaScript">
<!--
<%
'二级数据保存到数组
Dim count2,rsClass2,sqlClass2
set rsClass2=server.createobject("adodb.recordset")
sqlClass2="select * from aa" 
rsClass2.open sqlClass2,conn,1,1
%>
var subval2 = new Array();
//数组结构：一级根值,二级根值,二级显示值
<%
count2 = 0
do while not rsClass2.eof
%>
subval2[<%=count2%>] = new Array('<%=rsClass2("aID")%>','<%=rsClass2("ID")%>','<%=rsClass2("Name")%>')
<%
count2 = count2 + 1
rsClass2.movenext
loop
rsClass2.close
%>

<%
'三级数据保存到数组
Dim count3,rsClass3,sqlClass3
set rsClass3=server.createobject("adodb.recordset")
sqlClass3="select * from aaa" 
rsClass3.open sqlClass3,conn,1,1
%>
var subval3 = new Array();
//数组结构：二级根值,三级根值,三级显示值
<%
count3 = 0
do while not rsClass3.eof
%>
subval3[<%=count3%>] = new Array('<%=rsClass3("aaID")%>','<%=rsClass3("ID")%>','<%=rsClass3("Name")%>')
<%
count3 = count3 + 1
rsClass3.movenext
loop
rsClass3.close
%>

function changeselect1(locationid)
{
document.form1.s2.length = 0;
document.form1.s2.options[0] = new Option('==二级分类==','');
document.form1.s3.length = 0;
document.form1.s3.options[0] = new Option('==三级分类==','');
for (i=0; i<subval2.length; i++)
{
if (subval2[i][0] == locationid)
{document.form1.s2.options[document.form1.s2.length] = new Option(subval2[i][2],subval2[i][1]);}
}
}

function changeselect2(locationid)
{
document.form1.s3.length = 0;
document.form1.s3.options[0] = new Option('==三级分类==','');
for (i=0; i<subval3.length; i++)
{
if (subval3[i][0] == locationid)
{document.form1.s3.options[document.form1.s3.length] = new Option(subval3[i][2],subval3[i][1]);}
}
}
//-->
</script>
<table class="tableBorder" width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#E8F1FF"> 
<td height="25" align="center" background="img/admin_bg_1.gif"><span class="style1"><b><font color="#ffffff">添加信息</font></b> </span></td>
</tr>
<tr bgcolor="#E8F1FF"> 
<form name="form1" method="post" action="saveaddbook.asp?action=add" OnSubmit="return checkkk()" >
<td> 
                                <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#ffffff">
          <tr bgcolor="#E8F1FF"> 
            <td width="12%" align="right"><span class="style1">信息分类：</span></td>
            <td colspan="3"><%
Dim count1,rsClass1,sqlClass1
set rsClass1=server.createobject("adodb.recordset")
sqlClass1="select * from a" 
rsClass1.open sqlClass1,conn,1,1
%>
<select name="s1" onChange="changeselect1(this.value)">
<option>==一级分类==</option>
<%
count1 = 0
do while not rsClass1.eof
response.write"<option value="&rsClass1("ID")&">"&rsClass1("Name")&"</option>"
count1 = count1 + 1
rsClass1.movenext
loop
rsClass1.close
%>
</select>

<select name="s2" onChange="changeselect2(this.value)">
  <option>==二级分类==</option>
</select>

<select name="s3" style="display:none;">
  <option>==三级分类==</option>
</select>
<span class="style1" style="display:none;">权限：
<select name="userid" id="userid">
  <option value="0" selected>普通会员</option>
  <option value="1">中级会员</option>
  <option value="2">高级会员</option>
</select>
</span><label></label></td>
            </tr>
<tr bgcolor="#E8F1FF" style="display:none;"> 
            <td align="right">&nbsp;</td>
            <td width="26%"><label class="style1">
              <input type="radio" name="zxtj" value="1">
              是
              <input name="zxtj" type="radio" value="0" checked>
              否
            </label></td>
            <td width="9%" align="center" class="style1">热门文章<span class="style1">：</span></td>
            <td width="47%" class="style1"><input type="radio" name="rmwz" value="1">
是
  <input name="rmwz" type="radio" value="0" checked>
否</td>
</tr>          <tr bgcolor="#E8F1FF"> 
            <td align="right"><span class="style1">信息标题：</span> </td>
            <td><input name="title" type="text" id="title" size="30" maxlength="100"><span style="display:none;"><span class="style1">排序：</span> <input name="px" type="text" id="px" size="5" onKeyUp="this.value=this.value.replace(/\D/g,'')" onpaste = "return false"></span></td>
            <td align="center" class="style1">发布时间：</td>
            <td align="left"><input name="fbsj" type="text" id="fbsj" size="30" maxlength="50" value="<%=year(now())%>-<%if len(month(now()))<2 then%>0<%end if%><%=month(now())%>-<%if len(day(now()))<2 then%>0<%end if%><%=day(now())%>"> 
              <span class="style1">格式：2009-11-16</span></td>
</tr>
		  
		  
		  		  <tr bgcolor="#E8F1FF" style="display:none;"> 
            <td align="right"><span class="style1">关键字：</span> </td>
            <td colspan="3"><input name="gjz" type="text" id="gjz" size="30" maxlength="50">
              <span class="style1">(有助于搜索引擎优化，请以“|”分隔，如“上海|南京路步行街”。) </span></td>
            </tr>
		  <tr bgcolor="#E8F1FF" style="display:;"> 
            <td align="right"><span class="style1">新闻快递图片：</span> </td>
            <td><input name="img" type="text" id="img" size="30" maxlength="150">
              <input class="button" type="button" name="Submit2" value="上传图片" onClick="window.open('../jobtc.asp?formname=form1&editname=img&uppath=bookpic&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"></td>
            <td align="center"><span class="style1">最新推荐：</span></td>
            <td><span class="style1">
              <input type="radio" name="zxtj" value="1">
是
<input name="zxtj" type="radio" value="0" checked>
否</span></td>
		  </tr>
          <tr bgcolor="#E8F1FF"> 
            <td valign="top" align="right"><span class="style1">信息内容： 
            </span></td>
            <td colspan="3">
			<textarea name="content" style="display:none"></textarea>
            <IFRAME ID="eWebEditor1" src="xuexiao/editor.html" frameborder="0" scrolling="no" width="98%" height="350"></IFRAME>
			<br>
	  <div class="style1" style="magin:5px; padding:5px; display:none;">需要分页时可使用分页标志符：<span class="style2">$Page_Split$</span>,即在需要分页的地方点击按钮<img src="xuexiao/ButtonImage/standard/about.gif" width="20" height="20" align="absmiddle">即可。</div></td>
          </tr>
          <tr bgcolor="#E8F1FF"> 
            <td></td>
            <td height="30" colspan="3"> <input type="submit" name="Submit" value=" 添加保存 "> 
              <input onClick="ClearReset()" type=reset name="Clear" value=" 重新填写 ">            </td>
          </tr>
        </table>
</td>
</form>
</tr>
</table>
<!--#include file="copyright.asp"-->
</body>
</html>

<SCRIPT LANGUAGE="JavaScript">
<!--
function checkkk()
{
    if(checkspace(document.form1.s1.value)) {
	document.form1.s1.focus();
    alert("请选择一级分类！");
	return false;
  }
	 
	 if(checkspace(document.form1.s2.value)) {
	document.form1.s2.focus();
    alert("请选择二级分类！");
	return false;
  }
  
  	 if(checkspace(document.form1.title.value)) {
	document.form1.title.focus();
    alert("请填写信息标题！");
	return false;
  }


  	 if(checkspace(document.form1.fbsj.value)) {
	document.form1.fbsj.focus();
    alert("请填写发布时间！");
	return false;
  }


}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
//-->
</script>
