<?php 
    
    require "../../Run.php";
	echo head("CSS修改");
   if($login==1){              /*如果用户已经登录*/
	if($admin==1){
	
	if($_GET['article_mod'] == 'yes'){ 
    $content = $_POST['content']; 	
	$sql="UPDATE dd_html SET title='{$_POST['title']}',bz='{$_POST['name']}',content='{$content}' WHERE htmlid='{$_GET['id']}'";
    $result=mysql_query($sql);
	echo "<div class=\"tip\">";
	if($result && mysql_affected_rows()>0){
	echo "修改成功";
    }else{
    echo "修改失败";
    }
	echo "<a href=\"mod.php?cid=".$_GET['cid']."&page=".$_GET['page']."&id=".$_GET['id']."&sid=".$sid_info."\">点击返回HTMl代码修改</a></div>";
	}else{
    $sql="SELECT htmlid,userid,title,content,time,bz FROM dd_html WHERE htmlid=
	'{$_GET['id']}'";
	$view=mysql_query($sql);
	  /*数据验证*/
	if($view && mysql_num_rows($view)>0){
	list($htmlid,$userid,$title,$content,$time,$bz)=mysql_fetch_row($view);
	echo '<div class="title">修改标签</div><div class="content">';
	echo "<form method=\"post\" action=\"mod.php?article_mod=yes&id=".$htmlid."&page=".$_GET['page']."&sid=".$sid_info."\">
    <br> <input type=\"text\" name=\"title\" value=\"".$title."\">
    <input type=\"hidden\" name=\"htmlid\" value=\"".$_GET['id']."\">
    <br><input type=\"text\" name=\"name\"  value=\"".$bz."\">
    <br>文章内容<br><textarea name=\"content\">".$content."</textarea><br>";
	echo"
    <br><input type=\"submit\" value=\"HTML代码修改\">
	</form></div><div class=\"mylink\"><a href=\"list.php?cid=".$gro."&sid=".$sid_info."\">返回上级</a><a href=\"../../index.php?sid=".$sid_info."\">网站首页</a></div>";
		}else{
	    echo "抱歉 内容获取失败";
	        }
		   }
        }else{
	    echo "您无权进入此页面，请联系管理员！";
		   }
	    }else{
		echo "登录信息错误";
		  }
  echo footer(1);