<?php
header("Content-Type: text/html; charset=utf-8");
include ("../database/human.php");
session_start();
?>
<link rel="stylesheet" href="css/main.css" type="text/css" />
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TR height=28>
<TD background=images/title_bg1.jpg>当前位置: BBS论坛</TD>
<TD align=right><A href="main_right6-1.php" class="one"> 返回 </A></TD>
</TR>
<TR>
<TD bgColor=#b1ceef height=1 colspan="2"></TD></TR>
<TR height=10>
<TD background=images/shadow_bg.jpg colspan="2"></TD></TR>
</TABLE>
<!-- PHP数据库中获取内容 -->
<?php
//查询BBS
$hgi=new HttpPostInf();
$result=$hgi->doquery('2',"select * from BBS_Post where BP_Pid='".$_GET['bbsid']."';");
//解析json
$dj=json_decode($result,true);
$jcount=count($dj);
for($i=0; $i<$jcount; $i++){
$_SESSION['bbsid']=$dj[$i]['BP_Pid'];
?>
<div class="middle">
<div class="wrap">
<div class="wrap_left">
<div class="wenda-head">
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0 bgcolor="blue">
<TR height=10>
<TD></TD></TR>
<TR height=22>
<TD style="PADDING-LEFT: 10px; FONT-WEIGHT: bold; COLOR: #ffffff"
align=left>[贴] <?php echo $dj[$i]['BP_Ptitle']; ?></TD></TR>
<TR height=10>
<TD></TD></TR>
</TABLE>
</div>
<!-- 楼主内容 -->
<TABLE cellSpacing=0 cellPadding=0 width="95%" align=center border=0>
<tr>
<td valign="top"><div align="middle" width=150><BR /><BR /><img
src='images/tx.jpg' width='60' height='60' />
<BR /><BR />楼主 1# <BR />
<?php echo $dj[$i]['BP_Puserid']; ?>
<BR />身份
<?php
if($dj[$i]['BP_Ptype']==0) echo "教师";
if($dj[$i]['BP_Ptype']==1) echo "学生";
?><BR /><?php echo $dj[$i]['BP_Ptime']; ?></div></td>
<!-- 多行文本输入控件 disabled="disabled"不可编辑 -->
<td ><textarea rows="15" type="text" width="400px" style="resize:none;font-size:16px;"
maxlength="2000" name="content" cols="60" disabled="disabled"><?php echo $dj[$i]['BP_Cont']; ?></textarea></td>
</tr>
<TR height=4>
<TD colspan="3"></TD>
</TR>
<tr>
<td colspan="2"><hr width="100%" size="2" color="#FF0000"></td>
</tr>
</TABLE>
<!--上面的php中while循环并没有结束,还有右括号-->
<?php
}
//查询BBS
$hgi=new HttpPostInf();
$result=$hgi->doquery('2',"select * from BBS_Reply where BR_Pid='".$_GET['bbsid']."';");
//解析json
$dj=json_decode($result,true);
$jcount=count($dj);
for($i=0; $i<$jcount; $i++){
?>
<!-- 楼层回复内容 -->
<TABLE cellSpacing=0 cellPadding=0 width="95%" align=center border=0>
<tr>
<td valign="top"><div align="middle" width=150><BR /><BR />
<img src='images/tx.jpg' width='60' height='60' />
<BR /><BR />楼层 <?php $_SESSION['bbshfid']=time(); echo $i+2;?># <BR />
<?php echo $dj[$i]['BR_Ruserid']; ?>
<BR />身份
<?php
if($dj[$i]['BR_Rtype']==0) echo "教师";
if($dj[$i]['BR_Rtype']==1) echo "学生";
?>
<BR /><?php echo $dj[$i]['BR_Ptime']; ?>
<BR />回复楼层<?php echo $dj[$i]['BR_Pfloor']; ?>#</div></td>
<!-- 多行文本输入控件 disabled="disabled"不可编辑 -->
<td ><textarea rows="15" type="text" width="400px" style="resize:none;font-size:16px;"
maxlength="2000" name="content" cols="60" disabled="disabled"><?php echo $dj[$i]['BR_Cont']; ?></textarea></td>
</tr>
<TR height=4>
<TD colspan="3">
</TD>
</TR>
<tr>
<td colspan="2"><hr width="100%" size="2" color="#FF0000"></td>
</tr>
</TABLE>
<?php
}
?>
<!-- 回复内容 -->
<form id="form1" name="form1" method="post" action="main_right3-1-content.php">
<TABLE cellSpacing=0 cellPadding=0 width="95%" align=center border=0>
<tr>
<td colspan="2"> 回复楼层
<input type="text" name="lc" id="lc" value="" style=width:150pt; maxlength="50"/>
</td>
</tr>
<tr>
<td valign="top"><div align="middle" width=150>
<BR /><BR /> 回复 <BR /></div></td>
<!-- 多行文本输入控件 disabled="disabled"不可编辑 -->
<td ><textarea rows="10" type="text" width="400px" style="resize:none;font-size:16px;" maxlength="2000"
name="bbscontent" cols="60" ></textarea></td>
</tr>
<tr>
<td colspan="2" align="middle">
<input type="submit" style='font-size:22px' name="Submit" value="提交回复"/>
</td>
</tr>
<TR height=4><TD colspan="3"></TD></TR>
<tr>
<td colspan="2"><hr width="100%" size="2" color="#FF0000"></td>
</tr>
</TABLE>
</form>
</div><!--wrap-->
</div><!--wrap_right-->
</div><!--middle-->
<TABLE cellSpacing=0 cellPadding=2 width="95%" align=center border=0>
<TR height=20>
<TD></TD></TR>
</TABLE>
<!-- 提交当前页面POST数据库表单处理 -->
<?php
if (!empty($_POST['bbscontent']))
{
if($_SESSION['radio']==1) $a=1; //学生
if($_SESSION['radio']==2) $a=0; //老师
//SQL更新
$sql = "INSERT INTO BBS_Reply (BR_Rid,BR_Pid,BR_Ruserid,BR_Rtype,BR_Ptime,BR_Pfloor,BR_Cont) VALUES (";
$sql .= "'".$_SESSION['bbshfid']."',";
$sql .= "'".$_SESSION['bbsid']."',";
$sql .= "'".$_SESSION['number']."',";
$sql .= "'".$a."',";
$sql .= "'".date('Y-m-d')."',";
$sql .= "'".$_POST['lc']."',";
$sql .= "'".$_POST['bbscontent']."'";
$sql .= ");";
//更新信息
//echo $sql;
$hgi=new HttpPostInf();
$result=$hgi->doquery('1',$sql);
//echo "<script>alert('恭喜你修改成功!');</script>";
header('Location:main_right3-1.php');
}
?>
- 1
- 2
- 3
前往页