www.gusucode.com > 云枫工作室企业网站源代码第五版 1.0 > docc/admin/newsmod.asp

    <%@LANGUAGE="VBSCRIPT"%>
<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="include.asp"-->
<%
	Dim MM_FindSql             '查询执行语句
	
	Dim MM_TableName           '表名
	Dim MM_ReturnPath          '执行成功后返回的路径
	Dim MM_DatabaseStr         '数据库各项
	Dim MM_FormStr             '表单各项
	Dim MM_SqlQuery            '最终执行语句
	
	MM_TableName = "news"
	MM_FindSql = "select * from " & MM_TableName & " where sqlindex=" & request.querystring("id")
	set rs = conn.Execute(MM_FindSql)
	
	MM_ReturnPath = "news.asp"

	if Request.Form("MM_update") <> "" then
		MM_DatabaseStr  = "ftitle|value|fetitle|value|ftext|value|fetext|value|fimage|value|fcount|value|fadmin|value|fyuang|value|fshow|value|fdate|value"
	    MM_FormStr = "sqltitle|',none,''|sqletitle|',none,''|sqltext|',none,''|sqletext|',none,''|sqlimage|',none,''|sqlcount|',none,''|sqladmin|',none,''|sqlyuang|',none,''|sqlshow|',none,''|sqldate|',none,''"
		MM_SqlKey = "sqlindex"
		MM_SqlValue = Request.Form("fid")
		if Request.Form("MM_update") <> "" then
			MM_SqlQuery = GetUpdateSql(MM_TableName,MM_DatabaseStr,MM_FormStr,MM_SqlKey,MM_SqlValue)
			'response.Write(MM_SqlQuery)
			'response.End()
			conn.Execute(MM_SqlQuery)
			response.redirect(MM_ReturnPath)
		end if
	end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改新闻</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script language="javascript">
function check()
{
	if(form1.ftitle.value == "")
	{
		alert("中文标题不能为空!")
		form1.ftitle.focus()
		return(false)
	}
	if(form1.fetitle.value == "")
	{
		alert("英文标题不能为空!")
		form1.fetitle.focus()
		return(false)
	}
	if(form1.fyuang.value == "")
	{
		alert("新闻来源不能为空!")
		form1.fyuang.focus()
		return(false)
	}
	if(form1.fdate.value == "")
	{
		alert("请正确填写发布日期!")
		form1.fdate.focus()
		return(false)
	}
}
</script>
</head>

<body topmargin="0" bgcolor="#799AE1">

  
<table width="100%" height="100%" border="0" align="center" bgcolor="#668ED4">
  <tr> 
      
    <td height="103" colspan="2" align="center"> <img src="images/toplogo.gif" height="60"> 
    </td>
    </tr>
	<tr> 
      <td colspan="2">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" background="images/menu_bk.gif">
        <tr> 
          <td height="23" valign="bottom" background="images/menu_bk.gif"><font color="#FFFFFF">新闻发布-&gt;修改新闻</font></td>
          <td valign="bottom" background="images/menu_bk.gif"><a href="<%=MM_ReturnPath%>">返回</a></td>
        </tr>
      </table>
	 </td>
	 </tr>
	 <tr> 
      <td colspan="2">
		<form ACTION="#" METHOD="POST" name="form1" onSubmit="javascript:return check()">
        <table width="100%" height="100%" align="center" cellpadding="1" cellspacing="1" bordercolor="#ADADC9" bgcolor="#666699">
          <tr bgcolor="#799AE1"> 
            <td>中文标题:</td>
            <td colspan="-2"><input name="ftitle" type="text" id="ftitle2" size="50" value="<%=rs.Fields.Item("sqltitle")%>"> 
              <script language="javascript">
				form1.ftitle.focus();
			</script> </td>
          </tr>
          <!--<tr bgcolor="#799AE1"> 
            <td>英文标题:</td>
            <td colspan="-2"><input name="fetitle" type="text" id="fetitle" size="50" value="<%=rs.Fields.Item("sqletitle")%>"></td>
          </tr>-->
          <tr bgcolor="#799AE1"> 
            <td>内容:</td>
            <td colspan="-2"> <div align="left"> 
                <textarea name="ftext" style="display:none"><%=rs.Fields.Item("sqltext")%></textarea>
                <iframe id="eWebEditor1" src="editor/ewebeditor.asp?id=ftext&style=s_popup" frameborder="0" scrolling="no" width="580" height="400"></iframe>
              </div></td>
          </tr>
          <tr bgcolor="#799AE1">
            <td>英文内容:</td>
            <td colspan="-2">
			<div align="left"> 
                <textarea name="fetext" style="display:none"><%=rs.Fields.Item("sqletext")%></textarea>
                <iframe id="eWebEditor1" src="editor/ewebeditor.asp?id=fetext&style=s_popup" frameborder="0" scrolling="no" width="580" height="200"></iframe>
              </div>
			</td>
          </tr>
          <tr bgcolor="#799AE1"> 
            <td>图片:(可不要)</td>
            <td colspan="-2"><input name="fimage" type="text" id="fimage" size="40" value="<%=rs.Fields.Item("sqlimage")%>"> 
              <input type="button" name="Submit22" value="上传图片" onClick="window.open('upload_image.asp?formname=form1&editname=fimage&uppath=userimages&filelx=jpg','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"></td>
          </tr>
		  <!--
          <tr bgcolor="#799AE1"> 
            <td>来源:</td>
            <td colspan="-2"><input name="fyuang" type="text" id="fsrou2" value="<%=rs.Fields.Item("sqlyuang")%>" size="50"></td>
          </tr>-->
          <tr bgcolor="#799AE1"> 
            <td>日期:</td>
            <td width="90%" colspan="-2"><input name="fdate" type="text" id="fdate2" size="20" value="<%=rs.Fields.Item("sqldate")%>"> 
              &nbsp;&nbsp;&nbsp;格式如:2005-01-01</td>
          </tr>
          <tr bgcolor="#799AE1"> 
            <td>显示/隐藏:</td>
            <script language="javascript">
				function checkshow()
				{
					if (form1.fshow.value != 0)
					{
						form1.fshow.value = 0;
					}
					else
					{
						form1.fshow.value = 1;
					}
				}
			</script>
            <td colspan="-2"><input name="fclick" type="checkbox" id="fshow2" value="checkbox"
			<%
				if rs.Fields.Item("sqlshow") then
					response.write("checked")
				end if
			%>
			 onclick="javascript:checkshow();"></td>
          </tr>
          <tr bgcolor="#799AE1"> 
            <td height="20" colspan="2"> <input name="MM_update" type="hidden" id="MM_update" value="form1"> 
              <input name="fshow" type="hidden" id="fshow" value="
			  <%
			  	if rs.Fields.Item("sqlshow") then
					response.Write("1")
				else
					response.Write("0")
				end if
			  %>
			  " onClick="javascript:checkshow()"> <input name="fid" type="hidden" id="fshow3" value="<%=rs.Fields.Item("sqlindex")%>"> 
              <input name="fadmin" type="hidden" id="fadmin" value="<%=session("lyj_admin")%>"> 
              <input name="fcount" type="hidden" id="fcount" value="<%=rs.Fields.Item("sqlcount")%>"> 
            </td>
          </tr>
          <tr bgcolor="#4272D5"> 
            <td bgcolor="#648BDD">&nbsp;</td>
            <td colspan="-2" bgcolor="#648BDD"> <input type="submit" name="Submit2" value=" 修 改 "> 
              <input type="reset" name="Submit3" value=" 清 除 "> </td>
          </tr>
        </table>
        </form>
		</td>
	 </tr>
	 <tr> 
      <td colspan="2">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td><div align="left">注意:请正确对以上内容进行修改!</div></td>
          </tr>
        </table>
        
      </td>
    </tr>
  </table>
</body>
</html>
<%
	set rs = nothing
%>