Current Path : /www/users/H10079900/sysadm/news/
Url:
Current File : /www/users/H10079900/sysadm/news/initNews.php

<?
	include "../inc/config.php";
include "../../inc/inc.php";
	$id=$_GET['id'];
	$ctid=$_GET['ctid'];
	$typeid =$_GET['typeid'];
	$result02=mysql_query("select * from news where id=$id");
	$rs=mysql_fetch_array($result02);
	//-----------------------------------无限制分级分类--------------------------------
	//$parent 是我们要查看的子节点的父节点
	//$level 会随着我们深入树的结构而不断增加
	function display_children($parent,$level,$ctid)
	{
	//获取$parent的全部子节点
	$result = mysql_query("select * from newstype where fid='$parent' Order by sortid,id desc;");
	//显示每个节点
	while($row=mysql_fetch_array($result))
	{
		//显示的内容
		$typeid =$_GET['typeid'];
		if($typeid==$row['id'])
		{
	?>
    <option value="<?=$row['id']?>"  selected="selected"><?=str_repeat('&nbsp;&nbsp;',$level)."|----".$row['name']?></option>
	<?
		}
		else
		{
	?>
	<option value="<?=$row['id']?>"><?=str_repeat('&nbsp;&nbsp;',$level)."|----".$row['name']?></option>
	<?
		}
		//再次调用这个函数来显着这个子节点
		display_children($row['id'],$level+1,$ctid);
	}
	}
	//-------------------------------------无限制分级分类END--------------------------------
	//设置新闻属性
	$result_property=mysql_query("select * from newsproperty where ctid=$ctid");
	$property=mysql_fetch_array($result_property);
?>	
<html>
<head>
<meta name="robots" content="noindex, nofollow">
<title>新闻信息</title>
<link href="../css/main.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" media="all" href="../skin/aqua/theme.css" title="Aqua" />
<style type="text/css">
<!--
.style1 {color: #FF0000}
.STYLE3 {color: #FF0000; font-weight: bold; }
-->
</style>
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/cal.js"></script>
<link href="../../js/calendar.css" rel="stylesheet" type="text/css">
<script>
jQuery(document).ready(function () {
	$('input.date').simpleDatepicker(); //定义日历基于input的显示位置
});
</script>

<script type="text/javascript" charset="utf-8" src="./../kindeditor/test/kindeditor.js"></script>
<script language="Javascript" type="text/Javascript">
function checkForm(form1){
 if(form1.title.value==""){
  alert("请填写新闻标题");
  
  form1.title.focus();
  return false; 
 }
}
function uploadIsPic(PicPath){
/*
初步判定上传图片是否为图片格式
*/
	var PicPathLen = PicPath.length;
	var index1 = PicPath.lastIndexOf(".");
	var PicType = PicPath.substring(index1+1,PicPathLen);

	var UploadResult = true;
	if(PicType != "jpg"&&PicType != "jpeg"&&PicType != "bmp"&&PicType != "gif"&&PicType != "png"){
		UploadResult = confirm("你的图片格式不对,如果你一定上传可能会产生错误");
		return UploadResult;
	}
}
function changetype()
{
	 var temp=document.getElementsByName("iscommend");
	if(temp[1].checked)
	{
 
		document.getElementById("pic2").style.display="none";
	}
	else
	{
 
		document.getElementById("pic2").style.display="block";
	}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- jinhaobi.com Baidu tongji analytics -->
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?a9f67843137ac498d8fea7cdfbab9eaa";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body class="iframe-right-body">
<font color="#FF0000"></font>
<form action="saveinitNews.php" method="post" enctype="multipart/form-data" name="newsActionForm" onSubmit="return checkForm(this);">
<table border="0" align="center" cellpadding="6" cellspacing="0" class="table-width">
  <tr class="h-dashed">
    <td>当前位置:<a href="../right.jsp">桌面</a> &gt; 新闻中心&gt;新闻中心 </td>

    <td align="right" nowrap><a href="../thirdhtml/fendy.html"><img src="../images/icon-help.gif" width="20" height="20" border="0" align="absmiddle">&nbsp;寻求帮助</a></td>
  </tr>
</table>
<br>
<table width="100%" border="0" class="table-width">
  <tr>
    <td class="title2">【修改新闻】</td>
  </tr>
</table>
<div align="left">
  <input name="submit" type="submit" class="enter_bg"  value="保存">
  &nbsp;
  <input name="submit" type="reset" class="enter_bg"  value="重置">
  &nbsp;
  <input name="back" type="button" onClick="window.history.back();" id="back" value="返 回">
</div>
<table width="99%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td align="right" class="table-list-title" >标题:</td>
          <td class="table-list-style">
		  <input name="title" type="text" class="text_bg" id="title" value="<?=$rs['title']?>" size="35" maxlength="250">
		  &nbsp;
<?
		if($property['colordisplay']==1)
		{
		?>
		    <select name="title_color" id="title_color">
            <option value="" selected>颜色</option>
            <option value="#000000"  style="background-color:#000000"></option>
            <option value="#FFFFFF"  style="background-color:#FFFFFF"></option>
            <option value="#008000"  style="background-color:#008000"></option>
            <option value="#800000"  style="background-color:#800000"></option>
            <option value="#808000"  style="background-color:#808000"></option>
            <option value="#000080"  style="background-color:#000080"></option>
            <option value="#800080"  style="background-color:#800080"></option>
            <option value="#808080"  style="background-color:#808080"></option>
            <option value="#FFFF00"  style="background-color:#FFFF00"></option>
            <option value="#00FF00"  style="background-color:#00FF00"></option>
            <option value="#00FFFF"  style="background-color:#00FFFF"></option>
            <option value="#FF00FF"  style="background-color:#FF00FF"></option>
            <option value="#FF0000"  style="background-color:#FF0000"></option>
            <option value="#0000FF"  style="background-color:#0000FF"></option>
            <option value="#008080"  style="background-color:#008080"></option>
            </select>
		<?
			}
			if($property['fonttypedisplay']==1)
			{
		?>	
		
            <select name="title_fonttype" id="title_fonttype">
            <option value="" selected>字体</option>
			<option value="2" >粗体</option>
          	<option value="4" >斜体</option>
		    <option value="6" >粗斜体</option>
            </select>
		<?
			}
			if($property['fontsizedisplay']==1)
			{
		?>	
            <select name="title_fontsize" id="title_fontsize">
              <option value="" selected>大小</option>
			  <option value="1" >七号</option>
			  <option value="2" >六号</option>
			  <option value="3" >五号</option>
			  <option value="4" >四号</option>
			  <option value="5" >三号</option>
			  <option value="6" >二号</option>
			  <option value="7" >一号</option>
             </select>	
		<?
				}
		?>	 		</td>
	    </tr>
		<tr>
		<td width="136" align="right" class="table-list-title">
			   所属类别:		</td>
<td class="table-list-style"><select name="typeid">
  <?
			$result=mysql_query("select * from newstype where fid=0 AND ctid='$ctid' Order by id desc;");
		    while($date=mysql_fetch_array($result))
	  		{
			if($typeid==$date['id'])
			{
			?>
  <option value="<?=$date['id']?>" selected="selected">
  <?=$date['name']?>
  </option>
  <?
			}
			else
			{
			?>
  <option value="<?=$date['id']?>">
  <?=$date['name']?>
  </option>
  <?
			}
			display_children($date['id'],1,$ctid);
			}
	       ?>
</select></td>
		</tr>




		  <tr>
		<td align="right" class="table-list-title">
日期:		</td>
		<td class="table-list-style"> 
		<input name="date" type="text" id="date" class="date" value="<?=$rs['date']?>" size="17"></td>
	</tr>
	  <?
		if($property['keyworddisplay']==1)
		{
	  ?>
		<tr>
		<td align="right" class="table-list-title">
关键字:		</td>
<td class="table-list-style"><input name="keyword" type="text" class="text_bg" id="keyword" value="<?=$rs['keyword']?>" size="35" maxlength="40"><span class="style1">(相关新闻根据关键字,多个关键字之间用“,”(英文状态下的逗号)隔开)</span></td>
		  </tr>
		<?
			}
		if($property['ifsearchdisplay']==1)
		{
	  ?>
<tr>
		<td align="right" class="table-list-title">是否列入搜索范围 : </td>
		<td class="table-list-style"><?
		if($rs['ifsearch']==1)
		{
	?>
		  <input type="radio" name="ifsearch" value="1" checked="checked">是 <input type="radio" name="ifsearch" value="0">否 
		  <?
		}
		else
		{
	?>
		  <input type="radio" name="ifsearch" value="1">
		  是
          <input name="ifsearch" type="radio" value="0" checked>
          否
          <?
		}
	?></td>
</tr>
		<?
		}
		if($property['isnewlydisplay']==1)
		{
	  ?>
		<tr>
		<td align="right" class="table-list-title">是否最新:</td>
		<td class="table-list-style"><?
		if($rs['isnewly']==1)
		{
	?>
		  <input name="isnewly" type="radio" value="1" checked>
		  是 <input type="radio" name="isnewly" value="0">否 
		  <?
		}
		else
		{
	?>
		  <input type="radio" name="isnewly" value="1">
是
<input type="radio" name="isnewly" value="0" checked="checked">
否
<?
		}
	?></td>
		</tr>
		<?
		}
		if($property['ishotdisplay']==1)
		{
	  ?>
<tr>
		<td align="right" class="table-list-title">是否热点:</td>
		<td class="table-list-style"><?
		if($rs['ishot']==1)
		{
	?>
		  <input name="ishot" type="radio" value="1" checked>是 <input type="radio" name="ishot" value="0">否 
		  <?
		}
		else
		{
	?>
		  <input type="radio" name="ishot" value="1">
		  是
          <input type="radio" name="ishot" value="0" checked="checked">
          否
          <?
		}
	?></td>
		</tr>
		<?
		}
		if($property['iscommenddisplay']==1)
		{
			$dis="display:none";
			$da="<span class=\"style1\">*建议大小 196px*164px</span>";
			$da1="<span class=\"style1\">*建议大小 210px*70px</span>";
	  ?>
		<td align="right" class="table-list-title">是否推荐:</td>
		<td class="table-list-style"><?
		if($rs['iscommend']==1)
		{
	?>
		  <input name="iscommend" id="iscommend" type="radio" value="1" checked>是 <input type="radio" name="iscommend" id="iscommend" value="0">否<?
		}
		else
		{
	?>
		  <input type="radio" name="iscommend" id="iscommend" value="1">
		  是
          <input type="radio" name="iscommend" id="iscommend" value="0" checked="checked">
          否
          <?
		}
	?></td>
		</tr>
  <tr id="pic2">
    <td width="136" height="37" align="center" class="table-list-title">图片上传:</td>
    <td class="table-list-style"><input name="pic" type="file">
      <input name="tmppic" type="hidden" id="tmppic" value="<?=$rs['uploadname1']?>">
      <? if($rs['uploadname1']!="&nbsp;" and  $rs['uploadname1']!=""){?>
      <a href="../uploadfiles/<?=$rs['uploadname1']?>" target="_blank"><font color="#FF0000">图</font></a>
      &nbsp;&nbsp;<a href="delNewsPic.php?typeid=<?=$typeid?>&rs=uploadname1&id=<?=$id?>&ctid=<?=$ctid?>">删?</a>
      <? }?>
      <?=$da1?></td>
  </tr>
	<?
	}		 
		if($property['fromdisplay']==1)
		{
	  ?>
				<tr>
		<td align="right" class="table-list-title">信息来源:</td>
		<td class="table-list-style"><input name="comefrom" type="text" class="text_bg" id="comefrom" value="<?=$rs['comefrom']?>" size="30" maxlength="250"></td>
		</tr>
		
		<?
		}
		if($property['name1display']==1)
		{
	 	 ?>
	<tr>
		<td align="right" class="table-list-title"><?=$property['name1']?>:</td>
		<td class="table-list-style"><input name="name1" type="text" class="text_bg" id="name1" value="<?=$rs['name1']?>" size="30" maxlength="250">				</td>
		</tr>

		<?
		}
		if($property['name2display']==1)
		{
	 	 ?>
				<tr>
		<td align="right" class="table-list-title"><?=$property['name2']?>:</td>
		<td class="table-list-style"><input name="name2" type="text" class="text_bg" id="name2" value="<?=$rs['name2']?>" size="30" maxlength="250">				</td>
		</tr>

		<?
		}
		if($property['name3display']==1)
		{
	 	 ?>
				<tr>
		<td align="right" class="table-list-title"><?=$property['name3']?>:</td>
		<td class="table-list-style"><input name="name3" type="text" class="text_bg" id="name3" value="<?=$rs['name3']?>" size="30" maxlength="250">				</td>
		</tr>

		<?
		}
		if($property['name4display']==1)
		{
	 	 ?>
				<tr>
		<td align="right" class="table-list-title"><?=$property['name4']?>:</td>
		<td class="table-list-style"><input name="name4" type="text" class="text_bg" id="name4" value="<?=$rs['name4']?>" size="30" maxlength="250">				</td>
		</tr>
		<?
		}
		if($property['name5display']==1)
		{
	 	 ?>

				<tr>
		<td align="right" class="table-list-title"><?=$property['name5']?>:</td>
		<td class="table-list-style"><input name="name5" type="text" class="text_bg" id="name5" value="<?=$rs['name5']?>" size="30" maxlength="250">				</td>
		</tr>

		<?
		}
		if($property['name6display']==1)
		{
	 	 ?>
				<tr>
		<td align="right" class="table-list-title"><?=$property['name6']?>:</td>
		<td class="table-list-style"><input name="name6" type="text" class="text_bg" id="name6" value="<?=$rs['name6']?>" size="30" maxlength="250">				</td>
		</tr>

		<?
		}
		if($property['name7display']==1)
		{
	 	 ?>
				<tr>
		<td align="right" class="table-list-title"><?=$property['name7']?>:</td>
		<td class="table-list-style"><input name="name7" type="text" class="text_bg" id="name7" value="<?=$rs['name7']?>" size="30" maxlength="250">				</td>
		</tr>
	<?
		}
		if($property['name8display']==1)
		{
	 	 ?>

		<tr id="pic3">
		<td align="right" class="table-list-title"><?=$property['name8']?>:</td>
		<td class="table-list-style"><textarea name="name8" id="name8" class="textarea" style="width:96%;height:100px;"><?=$rs['name8']?></textarea>
        </td>
		</tr>
        
	<?
		}
		if($property['uploadname1display']==1)
		{
	 	 ?>
	      <tr id="pic" >
    <td width="136" height="37" align="center" class="table-list-title"><?=$property['uploadname1']?>:</td>
    <td class="table-list-style"><input name="pic" type="file"><span class="style1">*建议大小 180px*118px</span></td>
  </tr>
	<?
		}
		if($property['contentdisplay']==1)
		{
	 	 ?>
		<tr>
		  <td align="right" class="table-list-title">信息内容:</td>
		  <td class="table-list-style">
		  
		  <div>
		      <textarea name="content" id="note" class="textarea" style="width:96%;height:260px;visibility:hidden"><?=$rs['content']?></textarea>
        <script>
	var editor;
	KindEditor.ready(function(K) {
	editor = K.create('textarea[name="content"]', {
	allowFileManager : true
	});
	});
	</script></div></td>
	    </tr>
		<?
		}
		?>
<!--===============================新加的字段==================================================-->          
            <?
  if(file_exists('field.xml'))
  {
  	$doc  = new DOMDocument();
	$doc->load('field.xml');
	$root   =   $doc-> getElementsByTagName("news");
	$num=$root -> item(0)->childNodes->length;
	if($num>0)
	{
		$field  =   $root -> item(0)-> getElementsByTagName("field");
		foreach($field as $list)
		{
			$name=$list->getElementsByTagName("name");
			$field=$name->item(0)->nodeValue;
			$type=$list->getElementsByTagName("type");
			$cate=$type->item(0)->nodeValue;
			
			switch($cate)
			{
				case "varchar(18)":
				$cate_con="<input name=".$field." value=".$rs[$field]." type=text>";
				break;
				case "varchar(64)":
				$cate_con="<input name=".$field." type=file><input name='tmp".$field."' type=hidden value='".$rs[$field]."'>";
				break;
				case "int(5)":
				if($rs[$field]==1){$checked="checked";}
				$cate_con="<input name=".$field." type=radio value=1 ".$checked.">是<input name=".$field." type=radio value=0 ".$checked.">否";
				break;
				case "text":
				$cate_con="<textarea name=".$field." cols=110 rows=12 class=textarea id=".$field." style=visibility:hidden>".$rs[$field]."</textarea>
    <script type=text/javascript>
    KE.show({
        id : '".$field."',
		resizeMode : 1,
        cssPath : '',
		allowFileManager : true,
        items : [
        'fontname', 'fontsize', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
        'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
        'insertunorderedlist', 'emoticons', 'image', 'link']
    });
  </script>";
  				break;
  				case "date":
				$cate_con="<input name=".$field." value=".$rs[$field]." type=text>";
				break;
			}
			
			echo "<tr  class=table-list-link onMouseOver=this.className='table-list-hover' onMouseOut=this.className='table-list-link'>";
			echo "<td align=center class=table-list-style>".$field."</td>";
			echo "<td colspan=2 class=table-list-style>".$cate_con."</td>";
			echo "</tr>";
		}
	}
  }
  ?>
 <!--===============================新加的字段end==================================================-->         
          <?  $result=mysql_query("select * from popedom Order by id desc;");
	if(mysql_num_rows($result)>0)
	{
?>
<tr>
		  <td align="right" class="table-list-title">权限:</td>
		  <td class="table-list-style" id="popedom">
          <?
	     while($date1=mysql_fetch_array($result))
		 {
		 if($rs['popedom']==$date1['level'])
		 {
	?>
	<input name="popedomid" type="radio" value="<?=$date1['level']?>" checked>
	<? }else{?>
	<input name="popedomid" type="radio" value="<?=$date1['level']?>">
	<? }?>
	<?=$date1['name']?>&nbsp;&nbsp;&nbsp;&nbsp;
	  <?
	  }
	  ?> 
          </td>
	    </tr>
		<? }?>
    </table>
</td>
  </tr>
  <tr>
    <td>
	</td>
  </tr>
</table>
          <input name="ctid" type="hidden" id="ctid" value="<?=$_GET['ctid']?>">
          <input name="id" type="hidden" id="id" value="<?=$rs['id']?>">
</form>

</body>
</html>