<?php 
include("qs.php");
require( '../data/config.php');
$conn=mysql_connect($db_host,$db_user,$db_pass);
mysql_query("set names 'utf8'");
mysql_select_db($db_name);
if (PHP_VERSION >= '5.1' && !empty($timezone))
{
    date_default_timezone_set($timezone);
}
$action=_get('action');
if($action=="")
$action=_post('action');
$id=_get('id');
if($id=="")
$id=_post('id');
$qs=explode(",",$_SESSION["tm_qs"]);
if($qs[0]==0)
   {
   echo "<script>location.href='main.php';</script>";
   exit();
   }
 if($action=="del")
 {
 
if(isset($_POST['chkkindid']) && is_array($_POST['chkkindid'])){
foreach($_POST['chkkindid'] as $tempid){
$exec="delete from tm_art_re where re_id=".$tempid;
mysql_query($exec);
}
}
 echo "<script>location.href='ret.php';</script>";
 exit();
 }
elseif($action=="sh")
{

if(isset($_POST['chkkindid']) && is_array($_POST['chkkindid'])){
foreach($_POST['chkkindid'] as $tempid){
$exec="update tm_art_re set show1=1 where re_id=".$tempid;
mysql_query($exec);
}
}

 echo "<script>location.href='ret.php';</script>";
 exit();
}
elseif($action=="ush")
{

if(isset($_POST['chkkindid']) && is_array($_POST['chkkindid'])){
foreach($_POST['chkkindid'] as $tempid){
$exec="update tm_art_re set show1=0 where re_id=".$tempid;
mysql_query($exec);
}
}

 echo "<script>location.href='ret.php';</script>";
 exit();
}
elseif($action=="edit")
{
$cont=_post('cont');
mysql_query("update tm_art_re set re_cont ='$cont' where re_id='$id'");
echo "<script>location.href='ret.php';</script>";
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<META http-equiv="Pragma" content="no-cache" />
<LINK href="css/general.css" rel="stylesheet" type="text/css" />
<LINK href="css/main.css" rel="stylesheet" type="text/css" /> 
</HEAD><BODY>
<div class="h2">系统管理 >> 日志评论管理</div>
<div class="list-div">

<table cellspacing='1' cellpadding='3'>
<tr>
  <th align='left'><table width="100" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><div align="left">&nbsp;&nbsp;日志评论管理</div></td>
        <td width="150">&nbsp;</td>
      </tr>
    </table></th>
</tr>
<tr><td align="left" valign="top" style="background:#F5F5F5;padding-bottom:8px;">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0  CALLPADDING="0">			                
<?php 			  
if($action=="" and $id=="")
{
exit();
 }
if($action=="" and $id<>"")
{
$sql="select * from tm_art_re where re_id='$id'";
$rsql=mysql_query($sql);
$rs=mysql_fetch_object($rsql);
 ?>
 <form id="join" name="join" method="post" action="ret_w.php">
			<TR BORDER="0" WIDTH="100%">
              <TD height="30"><span style="PADDING-LEFT: 8px; PADDING-TOP: 8px">评论内容：
                  
			                      </span></TD>
    </TR>
<TR BORDER="0" WIDTH="100%">
              <TD height="30"><textarea name="cont" id="cont" style="width:100%; height:150px;"><?php echo $rs->re_cont;?></textarea></TD>
    </TR>

			<TR BORDER="0" WIDTH="100%">
                <TD style="PADDING-LEFT: 8px; PADDING-TOP: 8px" vAlign=top 
                align=left bgColor=#ffffff height=30><span class="help">
                  <input type="image" 
                        src="images/submit.gif" align="absmiddle" border="0" 
                        name="submit" onclick="return checkform(this.form)" />
                  <input name="action" type="hidden" id="action" value="edit" />
                  <input name="id" type="hidden" id="id" value="<?php echo $id;?>" />
                </span></TD>
    </TR>
 </form>
 <?PHP }
 ?>
</TABLE>
</td>
</tr></table></div>

<?php include "boot.php";?>
</body></html>