<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#include file="Connections/conn_news.asp" -->
<!--#include file="yns_config.asp" -->

<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="2,3"
MM_authFailedURL="../default.htm"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>

<%
Dim rst
Dim rst_numRows

Set rst = Server.CreateObject("ADODB.Recordset")
rst.ActiveConnection = MM_conn_news_STRING
rst.Source = "SELECT * FROM t_type"
rst.CursorType = 0
rst.CursorLocation = 2
rst.LockType = 1
rst.Open()

rst_numRows = 0
%>
<%
Dim rss
Dim rss_numRows

Set rss = Server.CreateObject("ADODB.Recordset")
rss.ActiveConnection = MM_conn_news_STRING
rss.Source = "SELECT * FROM t_stype"
rss.CursorType = 0
rss.CursorLocation = 2
rss.LockType = 1
rss.Open()

rss_numRows = 0
%>
<%
Dim rsm
Dim rsm_numRows

Set rsm = Server.CreateObject("ADODB.Recordset")
rsm.ActiveConnection = MM_conn_news_STRING
rsm.Source = "SELECT m_id, m_name FROM t_mob"
rsm.CursorType = 0
rsm.CursorLocation = 2
rsm.LockType = 1
rsm.Open()

rsm_numRows = 0
%>
<%
Dim rsn__MMColParam
rsn__MMColParam = "1"
If (Request.QueryString("n_id") <> "") Then
  rsn__MMColParam = Request.QueryString("n_id")
End If
%>
<%
Dim rsn
Dim rsn_numRows

Set rsn = Server.CreateObject("ADODB.Recordset")
rsn.ActiveConnection = MM_conn_news_STRING
rsn.Source = "SELECT * FROM t_news WHERE n_id = " + Replace(rsn__MMColParam, "'", "''") + ""
rsn.CursorType = 0
rsn.CursorLocation = 2
rsn.LockType = 1
rsn.Open()

rsn_numRows = 0
%>
<%
function makefilename(fname)
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
makefilename=fname & ".htm"
end function
%>
<%
Dim fname
Dim filepath
fname = makefilename(now())
filepath=(rst.Fields.Item("t_id").Value)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>湖南百润医药有限公司-------康曼德www.hnicp.com</title>
<script language="javascript">
<!--
function checkdata()
{
if (document.form1.n_title.value=="") {
alert ("请输入新闻标题 ！")
return false
}
if (document.form1.n_author.value=="") {
alert ("请输入新闻作者 ！")
return false
}
return true
}
//-->
</script>
<script>
<!--


function showimg(){
if (document.form1.n_index.checked == true) {
	img.style.display = "";
	advance.innerText="取消首页新闻:"
}else{
	img.style.display = "none";
	advance.innerText="设为首页新闻:"
}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
<link href="style/css.css" rel="stylesheet" type="text/css">
</head>

<body>
<form ACTION="yns_upsave.asp" METHOD="POST"   name="form1" id="form1" OnSubmit="return checkdata()">
  <table width="575" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr bgcolor="#CCCCCC">
      <td height="3" colspan="3" align="center" nowrap></td>
    </tr>
    <tr>
      <td height="7" colspan="3" align="center" nowrap class="bg"></td>
    </tr>
    <tr>
      <td width="18%" height="20" align="center" nowrap>新闻类别:</td>
      <td height="20" colspan="2"> <select style="font-family: 宋体; font-size: 9pt" name="n_tid" class="input">
          <%
While (NOT rst.EOF)
%>
          <option value="<%=(rst.Fields.Item("t_id").Value)%>" <%If (Not isNull((rsn.Fields.Item("n_tid").Value))) Then If (CStr(rst.Fields.Item("t_id").Value) = CStr((rsn.Fields.Item("n_tid").Value))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rst.Fields.Item("t_name").Value)%></option>
          <%
  rst.MoveNext()
Wend
If (rst.CursorType > 0) Then
  rst.MoveFirst
Else
  rst.Requery
End If
%>
        </select> </td>
    </tr>
    <tr class="bg">
      <td width="18%" height="20" align="center" nowrap>专题类别:</td>
      <td height="20" colspan="2"> <select style="font-family: 宋体; font-size: 9pt" name="n_sid" class="input">
          <option value="">不属于专题</option>
          <%
While (NOT rss.EOF)
%>
          <option value="<%=(rss.Fields.Item("s_id").Value)%>"><%=(rss.Fields.Item("s_name").Value)%></option>
          <%
  rss.MoveNext()
Wend
If (rss.CursorType > 0) Then
  rss.MoveFirst
Else
  rss.Requery
End If
%>
        </select> </td>
    </tr>
    <tr>
      <td width="18%" height="20" align="center" nowrap>新闻模板:</td>
      <td height="20" colspan="2"> <select style="font-family: 宋体; font-size: 9pt" name="n_mid" class="input">
          <%
While (NOT rsm.EOF)
%>
          <option value="<%=(rsm.Fields.Item("m_id").Value)%>"><%=(rsm.Fields.Item("m_name").Value)%></option>
          <%
  rsm.MoveNext()
Wend
If (rsm.CursorType > 0) Then
  rsm.MoveFirst
Else
  rsm.Requery
End If
%>
        </select> </td>
    </tr>
    <tr class="bg">
      <td width="18%" height="20" align="center" nowrap>是否推荐:</td>
      <td height="20" colspan="2"> <input type="checkbox" name="n_commend" value=true >
      </td>
    </tr>
    <tr>
      <td width="18%" height="20" align="center" nowrap><span id=advance>设为首页新闻:</span></td>
      <td height="20" colspan="2"> <input type="checkbox" name="n_index" value=true onclick=showimg()>
      </td>
    </tr>
    <tr class="bg">
      <td width="18%" height="20" align="center" nowrap>新闻标题:</td>
      <td height="20" colspan="2"> <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_title" value="<%=(rsn.Fields.Item("n_title").Value)%>" size="32">
      </td>
    </tr>
    <tr>
      <td width="18%" height="20" align="center" nowrap>新闻作者:</td>
      <td height="20" colspan="2"> <font color="#F6F6F6">
        <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_author" value="<%=(rsn.Fields.Item("n_author").Value)%>" size="15">
        </font></td>
    </tr>
  </table>
  <table width="575" border="0" align="center" cellpadding="0" cellspacing="0" id="img" style="display: none">
    <tr class="bg">
      <td width="18%" height="20" align="center" nowrap>缩略图:</td>
      <td width="50%" height="20">
        <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_mpic" value="<%=(rsn.Fields.Item("n_mpic").Value)%>" size="32">
      </td>
      <td width="32%" height="20"> <a href="#" onClick="MM_openBrWindow('yns_upload.asp?m=1','上传图片','width=300,height=100')">上传缩略图</a></td>
    </tr>
    <tr>
      <td width="18%" height="20" align="center" nowrap>真实图:</td>
      <td width="50%" height="20"> <input style="font-family: 宋体; font-size: 9pt" type="text" name="n_rpic" value="<%=(rsn.Fields.Item("n_rpic").Value)%>" size="32">
      </td>
      <td width="32%" height="20"> <a href="#" onClick="MM_openBrWindow('yns_upload.asp?m=2','上传图片','width=300,height=100')">上传真实图</a></td>
    </tr>
  </table>
  <table width="575" border="0" align="center" cellpadding="0" cellspacing="4" bgcolor="#CCCCCC">
    <tr>
      <td bgcolor="#FFFFFF">
<iframe ID="eWebEditor1" src="editor/ewebeditor.asp?id=n_content&style=standard" frameborder="0" scrolling="no" width="100%" HEIGHT="350"></iframe></td>
    </tr>
  </table>
  <div align="center">
    <input type="hidden" name="MM_update" value="form1">
    <input type="hidden" name="MM_recordId" value="<%= rsn.Fields.Item("n_id").Value %>">
    <input id=Submit1 type=submit name=Submit1 value="更新新闻">
    <input name="n_fname" type="hidden" id="n_fname3" value="<%=(rsn.Fields.Item("n_fname").Value)%>">
    <input name="n_date" type="hidden" id="n_date2" value="<%=(rsn.Fields.Item("n_date").Value)%>">
    <input name="n_content" type="hidden" id="n_content" value="<%=Server.HTMLEncode(rsn.Fields.Item("n_content").Value)%>">
    <input name="mmtid" type="hidden" id="mmtid" value="<%=(rsn.Fields.Item("n_tid").Value)%>">
  </div>
</form>
</body>
</html>
<%
rst.Close()
Set rst = Nothing
%>
<%
rss.Close()
Set rss = Nothing
%>
<%
rsm.Close()
Set rsm = Nothing
%>
<%
rsn.Close()
Set rsn = Nothing
%>