<?php 
require_once '../../Config.php';
if (intval ( BLL_Admin::isLogin () ) === 0) {
	header ( 'Location:../index.html' );
	die ();
}
$sortObj = BLL_NewsSort::getOne ( intval ( $_GET ['theId'] ), 'id,pid,sortName' );
$findId = $sortObj ['id'];
$findpid = $sortObj ['pid'];
?>
<!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" />
<title>后台管理系统</title>
<link rel="stylesheet" type="text/css" href="../Css/RightFrm.css" />
<script type="text/javascript" src="../jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../Comm.js"></script>
<script type="text/javascript" src="ThisJs.js"></script>
</head>
<body>
<table  border="0" cellpadding="0" cellspacing="1" class="headTable">
  <tr>
    <th width="80%">新增信息(<?php echo $sortObj['sortName']; ?>)</th>
    <th width="20%" class="links"><a href="<?php COM_OftenFunction::getListPageUrl ( "NewsList$sortObj[id]", "News_List.php?theId=$sortObj[id]" ); ?>">【返回】</a></th>
  </tr>
</table>
<form name="theForm" method="post" action="TheAction.php" onsubmit="return ckTheNewsForm(this);">
  <input type="hidden" name="action" value="addnews" />
  <input type="hidden" name="theId" value="<?php echo $sortObj['id']; ?>" />
  <table border="0" cellpadding="0" cellspacing="1" class="formTable">
    <tr>
      <th width="10%">标题：</th>
      <td width="90%"><input type="text" name="title_txt" value="" size="40" />
        <input type="submit" value=" 提 交 " class='btn' />
        &nbsp;&nbsp;
        <input type="reset" value=" 重 填 " class='btn' />
      </td>
    </tr>
    <?php if(in_array($findpid, array(1,2,3))){//判断是否需要该字段?>
     <tr>
      <th width="10%">图片：</th>
      <td width="90%">
        <input type="text" name="picture_txt" value="" size="40" />        
        <input type="button" onclick="showUploadDialog('image','theForm.picture_txt')" value="图片上传" class="btn" />
        <span>&nbsp;&nbsp;图片尺寸：640*478  可略大或略小但所有图片尺寸必须一致</span>
       </td>
    </tr>
    <tr>
      <th width="10%">设计概况：</th>
      <td width="90%">
      <textarea name="gaikuang_txt" rows="10" cols="70"></textarea>
        
      </td>
    </tr>
    <tr>
      <th width="10%">设计说明：</th>
      <td width="90%">
      <textarea name="shuoming_txt" rows="7" cols="100"></textarea>
        
      </td>
    </tr>
    <?php }?>
    <?php if(in_array($findId, array(0))){//判断是否需要该字段?>
     <tr>
      <th width="10%">文件：</th>
      <td width="90%">
        <input type="text" name="file_txt" value="" size="40" />        
        <input type="button" onclick="showUploadDialog('file','theForm.file_txt')" value="文件上传" class="btn" />
       </td>
    </tr>
    <?php }?> 
	
    <?php if(in_array($findpid, array(1,2,3))){//判断是否需要该字段?>
	<tr>
      <th width="10%" style="vertical-align: top">图片编辑框：<br/>(未保持格式美观,请整体居中,若需添加文字,请在图片正上方或正下方添加)</th>
      <td width="90%"><textarea name="content_noreplace" id="content_noreplace"></textarea></td>
    </tr>
    <?php }?>
    <?php if(!in_array($findpid, array(1,2,3))){//判断是否需要该字段?>
    <tr>
      <td colspan="2"><textarea name="content_noreplace" id="content_noreplace"></textarea></td>
    </tr>
    <?php }?>
    <tr>
      <td colspan="2">&nbsp;</td>
    </tr>
  </table>
</form>
<?php echo COM_OftenFunction::GetXhEditor ( "content_noreplace" ); ?>
<script type="text/javascript">$(function(){setTableColor('no');});</script>
</body>
</html>