<html>
<head>
<title>材料网 - 慈溪东方科技后台系统2.0版</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../../css/main_css.css" type="text/css">
<!--#include file="../inc/checklogin.asp"-->
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../../../inc/charfunction.asp"-->
<!--#include file="../../../inc/function.asp"-->
<script language="javascript" src="../../../inc/function.js"></script>
<script language="javascript">
function ShowImage()
{
	var newstype=document.myform.newstype;
	if(newstype.value==1)
	{
		window.show1.style.display='';
		window.show2.style.display='';
	}
	else
	{
		window.show1.style.display='none';
		window.show2.style.display='none';
	}
}

function CheckForm()
{
	var title=document.myform.title;
	var keyword=document.myform.keyword;
	var newstype=document.myform.newstype;
	var file=document.myform.file1;
	var content=document.myform.content;
	if(isEmpty(title.value,"新闻标题"))
	{
		title.focus();
		return false;
	}
	if(newstype.value==1)
	{
		if(document.myform.newsimage.value=="")
		{
			if(isEmpty(file.value,"图片地址"))
			{
				return false;
			}
			return ChangeImage(file.value);
		}
		else
		{
			if(file.value!="")
			{
				return ChangeImage(file.value);
			}
		}
	}
	if(isEmpty(keyword.value,"新闻关键词"))
	{
		keyword.focus();
		return false;
	}
	return true;
}
</script>
</head>
<%on error resume next%>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0" height="100%">
  <tr> 
    <td width="100%" height="107" valign="top"> 
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="100%" height="107" valign="top"> 
            <!--#include file="../inc/top.asp"-->
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td valign="top" height="100%"> 
      <table width="100%" border="0" cellpadding="0" cellspacing="0" height="100%">
        <tr> 
          <td valign="top" height="100%"> 
            <!--#include file="../inc/left.asp"-->
          </td>
          <td valign="top" width="100%"> 
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="32" width="100%" valign="top" class="weizi"> 
                  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="px12_01">
                    <tr> 
                      <td width="14" height="32" valign="top"><img src="../../images/yan_11.gif" width="14" height="32"></td>
                      <td width="789" valign="bottom" class="px12">修改新闻</td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr> 
                <td valign="top" height="560"><br>
				<%
					newsid=chkstr(request("id"))
					if isnumeric(newsid)=false then
						response.Write"<script language='javascript'>alert('参数错误！');history.back();</script>"
						response.End()
					end if
					set rs=server.CreateObject("adodb.recordset")
					sql="select * from web_news where id="&newsid
					rs.open sql,conn,1,1
					if not rs.eof then
						newstype=rs("newstype")
						newsimage=rs("newsimage")
						content=rs("content")
						keyword=rs("keyword")
						titlefontcolor=rs("titlefontcolor")
						topinfo=rs("topinfo")
						title=rs("title")
						sendpost=rs("sendpost")
					else
						response.Write"<script language='javascript'>alert('参数错误！');history.back();</script>"
						response.End()
					end if
					rs.close
					set rs=nothing
					call closeconn()
				%>
				<form method="POST" name="myform" onSubmit="return CheckForm();" action="edit_save.asp" target="_self" enctype="multipart/form-data">
                  <table width="95%" border="1" align="center" cellpadding="0" cellspacing="1" bordercolordark="#FFFFFF" bordercolorlight="#CCCCCC">
                    <tr bgcolor="#FFFFFF" class="tdbg">
                      <td width="91" align="right"><strong>新闻类别：</strong></td>
                      <td width="679"><table width="100%" border="0">
                        <tr>
                          <td width="15%"><select name="newstype" onChange="ShowImage()">
                              <option value="0" <%if newstype=0 then response.Write"selected" end if%>>文字新闻</option>
                              <option value="1" <%if newstype=1 then response.Write"selected" end if%>>图片新闻</option>
                          </select></td>
                          <td width="26%" align="right" id="show1" <%if newstype=0 then%> style="display:none;padding-top:3px" <%end if%>><a href="../upload/<%=newsimage%>" target="_blank" style="color:red;cursor:hand;<%if newstype=0 then response.Write"display:none" end if%>">点此查看图片</a>&nbsp;&nbsp;<strong>新闻图片：</strong></td>
                          <td width="59%" id="show2" <%if newstype=0 then%> style="display:none" <%end if%>><input type="file" name="file1" onChange="javascript:ChangeImage(this.value)" style="background-color:#FFFFFF;color:#CCCCCC;border:1 double;width:170px"><font style="color:red;<%if newstype=0 then response.Write"display:none" end if%>">若为空，则视为图片不做修改！</font>
                          </td>
                        </tr>
                      </table></td>
                    </tr>
                    <tr bgcolor="#FFFFFF" class="tdbg">
                      <td width="91" align="right"><strong>新闻标题：</strong></td>
                      <td colspan="2"><input name="Title" type="text" id="title" size="45" value="<%=title%>" maxlength="255">
                          <font color="#FF0000">*</font>                          <select name="TitleFontColor" id="TitleFontColor">
                            <option value="" <%if titlefontcolor="" then response.Write"selected" end if%>>默认</option>
                            <option value="#000000" style="background-color:#000000" <%if titlefontcolor="#000000" then response.Write"selected" end if%>></option>
                            <option value="#FFFFFF" style="background-color:#FFFFFF" <%if titlefontcolor="#FFFFFF" then response.Write"selected" end if%>></option>
                            <option value="#008000" style="background-color:#008000" <%if titlefontcolor="#008000" then response.Write"selected" end if%>></option>
                            <option value="#800000" style="background-color:#800000" <%if titlefontcolor="#800000" then response.Write"selected" end if%>></option>
                            <option value="#808000" style="background-color:#808000" <%if titlefontcolor="#808000" then response.Write"selected" end if%>></option>
                            <option value="#000080" style="background-color:#000080" <%if titlefontcolor="#000080" then response.Write"selected" end if%>></option>
                            <option value="#800080" style="background-color:#800080" <%if titlefontcolor="#800080" then response.Write"selected" end if%>></option>
                            <option value="#808080" style="background-color:#808080" <%if titlefontcolor="#808080" then response.Write"selected" end if%>></option>
                            <option value="#FFFF00" style="background-color:#FFFF00" <%if titlefontcolor="#FFFF00" then response.Write"selected" end if%>></option>
                            <option value="#00FF00" style="background-color:#00FF00" <%if titlefontcolor="#00FF00" then response.Write"selected" end if%>></option>
                            <option value="#00FFFF" style="background-color:#00FFFF" <%if titlefontcolor="#00FFFF" then response.Write"selected" end if%>></option>
                            <option value="#FF00FF" style="background-color:#FF00FF" <%if titlefontcolor="#FF00FF" then response.Write"selected" end if%>></option>
                            <option value="#FF0000" style="background-color:#FF0000" <%if titlefontcolor="#FF0000" then response.Write"selected" end if%>></option>
                            <option value="#0000FF" style="background-color:#0000FF" <%if titlefontcolor="#0000FF" then response.Write"selected" end if%>></option>
                            <option value="#008080" style="background-color:#008080" <%if titlefontcolor="#008080" then response.Write"selected" end if%>></option>
                                                </select></td>
                      </tr>
                    <tr bgcolor="#FFFFFF" class="tdbg">
                      <td width="91" align="right"><strong>关键字：</strong></td>
                      <td><input name="keyword" type="text" id="keyword" value="<%=keyword%>" size="30" maxlength="255"></td>
                    </tr>
                    <input name="sendper" type="hidden" id="sendper" value="<%=session("adminname")%>" size="50" maxlength="100" >
                    <tr bgcolor="#FFFFFF" class="tdbg">
                      <td width="91" align="right"><strong>新闻来源：</strong></td>
                      <td><input name="sendpost" type="text" id="sendpost" value="<%=sendpost%>"  size="40" maxlength="255"></td>
                    </tr>
                    <tr bgcolor="#FFFFFF" class="tdbg">
                      <td width="91" align="right" valign="middle"><p><strong>内容：</strong></p>
                          <p align="left"> &middot;　如果是从其它网站上复制内容，并且内容中包含有图片，本系统将会把图片复制到本站服务器上，系统会因复制图片的大小而影响速度，请稍候（此功能需要服务器安装了IE5.5以上版本才有效）。 <br>
                              <br>
&middot;　换行请按Shift+Enter<br>
        <font color="#006600">&middot;　</font>另起一段请按Enter<br>
                        </p></td>
                      <td><textarea name="content" style="display:none"><%=content%></textarea>
                          <iframe id="Editor" src="../editor\ewebeditor.asp?id=content&style=s_light" frameborder="0" scrolling="no" width="600" height="400"></iframe>
                      </td>
                      <input type="hidden" name="newsid" value="<%=newsid%>">
					  <input type="hidden" name="newsimage" value="<%=newsimage%>">
					  <input type="hidden" name="linkurl" value="<%=request.ServerVariables("HTTP_REFERER")%>">
                    <tr bgcolor="#FFFFFF" class="tdbg">
                      <td width="91" align="right"><strong>是否固顶：</strong></td>
                      <td><input type="radio" name="topinfo" value="1"<%if topinfo=1 then response.Write"checked" end if%>>
      是
        <input name="topinfo" type="radio" value="0"<%if topinfo=0 then response.Write"checked" end if%>>
      否</td>
                    </tr>
                    <tr bgcolor="#FFFFFF" class="tdbg" style="display:none">
                      <td width="91" align="right"><strong>开放评论：</strong></td>
                      <td><input type="radio" name="OpenComment" value="1">
                        是
                          <input name="OpenComment" type="radio" value="0" checked>
                          否
                      </td>
                    </tr>
                    <tr class="tdbg">
                      <td width="91" align="right"></td>
                      <td></td>
                    </tr>
                  </table>
                  <center><input
  name="Add" type="submit"  id="Add" value=" 确 定 " style="cursor:hand;">
&nbsp;      &nbsp; 
      <input name="Cancel" type="reset" id="Cancel" value=" 重 置 " style="cursor:hand;"></center>

  </form>
				</td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td height="29" valign="top"> 
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="100%" height="29" valign="top"><!--#include file="../inc/bottom.asp"--></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
