<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import="java.sql.*"%> 
<%@ page import="java.util.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.*"%>
<%@ include file="../inc/conn.jsp"%>
<%
String layer_1 = request.getParameter("layer_1");
String layer_2 = request.getParameter("layer_2");
String bbsname = (String)session.getAttribute("name");

String str,strsql;
ResultSet rs1,rs2,rs3,rsr;
int j;
%>
<link href="../css/xmwuye.css" rel="stylesheet" type="text/css">
<%if(bbsname==null||bbsname.equals("")){%>
<script language="javascript">
<!--
	function check(form)
	{
    if (form.bbsuser.value=="")
    	{
    		alert("请填写用户名！");
    		form.bbsuser.focus();
    		return false;
  	}
    if (form.password.value=="")
    	{
    		alert("请填写密码！");
    		form.password.focus();
    		return false;
  	}
    if (form.useryz.value=="")
    	{
    		alert("请输入验证码！");
    		form.useryz.focus();
    		return false;
  	}
return true;
	}
//-->
</script>
<body leftmargin="0" topmargin="2">
<FORM METHOD=POST ACTION="userlogin.jsp" onsubmit="return check(this)" style="MARGIN-BOTTOM: 0px">
  <br>
  <br>
  <br>
  <br>
  <br>
  <br>
  <table width="35%" border="0" align="center" bgcolor="#333333" cellspacing="1" cellpadding="0">
    <tr bgcolor="#9999cc"> 
      <td colspan="2" height="20"> 
        <div align="center"><font color="#FFFFFF">要发布话题，请先登录</font></div>
      </td>
    </tr>

    <tr bgcolor="#F8F8F8" height=25> 
	  <TD> 
        <div align="right">用户名：</div>
      </TD>
	<TD>
	&nbsp;
        <INPUT TYPE="text" NAME="bbsuser" class="input" size="15">
      </TD>
</TR>
    <tr bgcolor="#F8F8F8" height=25> 
	  <TD> 
        <div align="right">密　码：</div>
      </TD>
	<TD>
	&nbsp;
        <INPUT TYPE="password" NAME="password" class="input" size="15">
      </TD>
</TR>
    <tr bgcolor="#F8F8F8" height=25> 
	  <TD height="22"> 
        <div align="right">验证码：</div>
      </TD>
	<TD>
	&nbsp;
        <INPUT NAME="useryz" TYPE="text" class="input" id="useryz" size="4">
		<img src="image.jsp" border=0 align="absmiddle">
      </TD>
</TR>
    <tr bgcolor="#F8F8F8" align=center> 
	  <TD colspan=2 height="30"> 
        <INPUT TYPE="submit" value="登录" name="" class="button">
        <A HREF="register.asp"><FONT COLOR="blue">[注册新用户]</FONT></A> </TD>
</TR>
</TABLE>
</FORM>
<%}else{%>
<form name="form1" method="POST" ENCTYPE="multipart/form-data" action="check.jsp" onSubmit="return CheckForm(this)" style="MARGIN-BOTTOM: 0px">
  <table border="0" width="99%" align="center" cellpadding="2" cellspacing="1" bgcolor="#A4B6D7">
    <tr> 
      <td width="100%" height="25" class="font10_5" background="../images/bbs_bg1.gif"> 
        <div align="center"><b>论 坛 话 题 发 布 </b></div>
      </td>
  </tr>
</table>
  <table width="99%" border="0" cellspacing="1" cellpadding="2" align="center" bgcolor="#A4B6D7">
    <%if(layer_2==null){%>
<script LANGUAGE="javascript">
var onecount;
onecount=0;
var j;
  
subcat = new Array();
<%
strsql="select BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Name,Initial from BBS_Cate where BBS_Cate_PID<>'0' and deleted=0  order by Initial asc";
Statement stmt2=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
rsr=stmt2.executeQuery(strsql);
j=0;
while(rsr.next()){
%>
subcat[<%=j%>] = new Array("<%=rsr.getString("BBS_Cate_Name")%>","<%=rsr.getString("BBS_Cate_PID")%>","<%=rsr.getString("BBS_Cate_ID")%>");
<%
j=j+1;
}
%>
onecount=<%=j%>;

function changelocation(locationid)
    {
    document.form1.BoardID_2.length = 0; 

    var locationid=locationid;
    var i;
    document.form1.BoardID_2.options[0] = new Option('==请选择==','');
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
            document.form1.BoardID_2.options[document.form1.BoardID_2.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    

//-->
</script>
    <TR bgcolor="#F2F8FF"> 
      <TD width="17%"> <div align="right">主论坛：</div></TD>
      <TD width="83%"> <SELECT NAME="BoardID_1" onChange="changelocation(document.form1.BoardID_1.options[document.form1.BoardID_1.selectedIndex].value)">
          <option value="">==请选择==</option>
<%
str="select BBS_Cate_ID,BBS_Cate_Name from BBS_CATE Where BBS_Cate_PID='0' and deleted=0 order by BBS_ID asc";
Statement stmt3=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs2=stmt3.executeQuery(str);
while(rs2.next()){
%>
          <option value="<%=rs2.getString("BBS_Cate_ID")%>"><%=rs2.getString("BBS_Cate_Name")%></option>
<%
}
%>
        </SELECT> </TD>
    </TR>
    <TR bgcolor="#F2F8FF"> 
      <TD width="17%"> <div align="right">分论坛：</div></TD>
      <TD width="83%"><SELECT NAME="BoardID_2">
          <option value="">==请选择==</option>
        </SELECT> </TD>
    </TR>
<%}else{%>
    <TR bgcolor="#F2F8FF"> 
      <TD width="17%"> 
        <div align="right"></div></TD>
      <TD width="83%"> <INPUT TYPE="hidden" name="BoardID_1" value="<%=layer_1%>"> 
        <INPUT TYPE="hidden" name="BoardID_2" value="<%=layer_2%>"> </TD>
    </TR>
<%}%>
    <TR bgcolor="#F2F8FF"> 
      <TD width="17%"> <div align="right">主　题：</div></TD>
      <TD width="83%"> <input type="text" name="title" size="60" > </TD>
    </TR>
    <TR bgcolor="#F2F8FF">
      <TD width="17%"><div align="right">投　票：</div></TD>
      <TD> <input name=tptype type=radio value=1 checked>
        单选&nbsp;&nbsp;
        <input name=tptype type=radio value=2>
        多选<br> &nbsp;选项1&nbsp;
        <INPUT class=fminpt name=tpnl1 type=text size=50>
        <br> &nbsp;选项2&nbsp;
        <INPUT class=fminpt name=tpnl2 type=text size=50>
        <br> &nbsp;选项3&nbsp;
        <INPUT class=fminpt name=tpnl3 type=text size=50>
        <br> &nbsp;选项4&nbsp;
        <INPUT class=fminpt name=tpnl4 type=text size=50>
        <br> &nbsp;选项5&nbsp;
        <INPUT class=fminpt name=tpnl5 type=text size=50>
        <br> &nbsp;选项6&nbsp;
        <INPUT class=fminpt name=tpnl6 type=text size=50>
        <br> &nbsp;选项7&nbsp;
        <INPUT class=fminpt name=tpnl7 type=text size=50>
        <br> &nbsp;选项8&nbsp;
        <INPUT class=fminpt name=tpnl8 type=text size=50>
        <br> &nbsp;选项9&nbsp;
        <INPUT class=fminpt name=tpnl9 type=text size=50>
        <br> &nbsp;选项10
        <INPUT class=fminpt name=tpnl10 type=text size=50>
		<br>
        &nbsp;<font color="#FF0000">有效期</font> 
        <input name="daynum" type="text" id="daynum" size="8">
        天(注:从发布之日起过了输入的天数后就失效)
		</TD>
    </TR>
    <TR bgcolor="#F2F8FF"> 
      <TD width="17%"> <div align="right">内　容：</div></TD>
      <TD width="83%" height="250">
        <TEXTAREA type="hidden" rows=1 cols=1 name="menu" style="position:absolute;left:0;visibility:hidden;"></textarea> 
        <SCRIPT src="../htmledit/wbTextBox/ftbbsedit.js"></SCRIPT>
      </TD>
    </TR>
    <TR bgcolor="#F2F8FF"> 
      <TD width="17%"> <div align="right">表　情：</div></TD>
      <TD width="83%"> <input type=radio name=ticon value=0.gif checked> <img src=../images/0.gif width=19 height=19 > 
        <input type=radio name=ticon value=1.gif> <img src=../images/1.gif width=19 height=19 > 
        <input type=radio name=ticon value=2.gif> <img src=../images/2.gif width=19 height=19> 
        <input type=radio name=ticon value=3.gif> <img src=../images/3.gif width=19 height=19> 
        <input type=radio name=ticon value=4.gif> <img src=../images/4.gif width=19 height=19> 
        <input type=radio name=ticon value=5.gif> <img src=../images/5.gif width=19 height=19> 
        <input type=radio name=ticon value=6.gif> <img src=../images/6.gif width=19 height=19> 
        <input type=radio name=ticon value=7.gif> <img src=../images/7.gif width=19 height=19><br> 
        <input type=radio name=ticon value=8.gif> <img src=../images/8.gif width=19 height=19> 
        <input type=radio name=ticon value=9.gif> <img src=../images/9.gif width=19 height=19> 
        <input type=radio name=ticon value=10.gif> <img src=../images/10.gif width=19 height=19> 
        <input type=radio name=ticon value=11.gif> <img src=../images/11.gif width=19 height=19> 
        <input type=radio name=ticon value=12.gif> <img src=../images/12.gif width=19 height=19> 
        <input type=radio name=ticon value=13.gif> <img src=../images/13.gif width=19 height=19> 
        <input type=radio name=ticon value=14.gif> <img src=../images/14.gif width=19 height=19> 
        <input type=radio name=ticon value=15.gif> <img src=../images/15.gif width=19 height=19> 
        <br> <input type=radio name=ticon value=16.gif> <img src=../images/16.gif width=19 height=19> 
        <input type=radio name=ticon value=17.gif> <img src=../images/17.gif width=19 height=19> 
        <input type=radio name=ticon value=18.gif> <img src=../images/18.gif width=19 height=19> 
        <input type=radio name=ticon value=19.gif> <img src=../images/19.gif width=19 height=19> 
        <input type=radio name=ticon value=20.gif> <img src=../images/20.gif width=19 height=19> 
        <input type=radio name=ticon value=21.gif> <img src=../images/21.gif width=19 height=19> 
        <input type=radio name=ticon value=22.gif> <img src=../images/22.gif width=19 height=19> 
        <input type=radio name=ticon value=23.gif> <img src=../images/23.gif width=19 height=19> 
        <br> <input type=radio name=ticon value=24.gif> <img src=../images/24.gif width=19 height=19> 
        <input type=radio name=ticon value=25.gif> <img src=../images/25.gif width=19 height=19> 
        <input type=radio name=ticon value=26.gif> <img src=../images/26.gif width=19 height=19> 
        <input type=radio name=ticon value=27.gif> <img src=../images/27.gif width=19 height=19> 
        <input type=radio name=ticon value=28.gif> <img src=../images/28.gif width=19 height=19> 
        <input type=radio name=ticon value=29.gif> <img src=../images/29.gif width=19 height=19> 
        <input type=radio name=ticon value=30.gif> <img src=../images/30.gif width=19 height=19> 
        <input type=radio name=ticon value=31.gif> <img src=../images/31.gif width=19 height=19> 
        <br> <input type=radio name=ticon value=32.gif> <img src=../images/32.gif width=19 height=19> 
        <input type=radio name=ticon value=33.gif> <img src=../images/33.gif width=19 height=19> 
        <input type=radio name=ticon value=34.gif> <img src=../images/34.gif width=19 height=19> 
        <input type=radio name=ticon value=35.gif> <img src=../images/35.gif width=19 height=19> 
        <input type=radio name=ticon value=36.gif> <img src=../images/36.gif width=19 height=19> 
        <input type=radio name=ticon value=37.gif> <img src=../images/37.gif width=19 height=19> 
        <input type=radio name=ticon value=38.gif> <img src=../images/38.gif width=19 height=19> 
        <input type=radio name=ticon value=39.gif> <img src=../images/39.gif width=19 height=19> 
        <br> <input type=radio name=ticon value=40.gif> <img src=../images/40.gif width=19 height=19> 
        <input type=radio name=ticon value=41.gif> <img src=../images/41.gif width=19 height=19> 
        <input type=radio name=ticon value=42.gif> <img src=../images/42.gif width=19 height=19> 
        <input type=radio name=ticon value=43.gif> <img src=../images/43.gif width=19 height=19> 
        <font color="#FF0000"> 
        <input type=radio name=ticon value=44.gif>
        <img src="../images/44.gif" width="17" height="16"> 点击图标，加入表情符号</font> 
        <!--<input type="text" name="tel" size="20" maxlength="20">-->
      </TD>
    </TR>
    <TR bgcolor="#F2F8FF"> 
      <TD width="17%"> <div align="right">图　片：</div></TD>
      <TD width="83%"><input TYPE="file" NAME="bbs_img">
        <FONT  COLOR="#990000">(允许上传gif,jpg类型的图片)</FONT></TD>
    </TR>
    <TR bgcolor="#F2F8FF"> 
      <TD width="17%"> <div align="right">图片说明：</div></TD>
      <TD width="83%"> <input TYPE="text" NAME="bbs_img_text" size="60" maxlength="100"> 
      </TD>
    </TR>
<!--
    <TR bgcolor="#F2F8FF"> 
      <TD width="22%"></TD>
      <TD width="78%" height="25">&nbsp;<FONT  COLOR="#990000">说明：您上传的图片需经过网站的审核通过后，才能在论坛显示。</FONT></TD>
    </TR>
-->
    <TR bgcolor="#F2F8FF"> 
      <TD height="35" colspan=2 align=center><input name="pollpost" type="hidden" id="pollpost" value="Y"> 
        <input type="submit" value="发布投票" name="submit1"> &nbsp; <input type="reset" value="全部重写" name="B2"> 
      </TD>
    </TR>
  </TABLE>
</form>
<%@ include file="../inc/bbstail.jsp"%>
<%}%>