<!--#include file="check.asp" -->
<!--#include file="../config/conn.asp"-->
<!--#include file="../config/code.inc"-->
<!--#include file="../config/function.asp"-->
<!--#include file="../config/config.asp"-->
<!--#include file="fckeditor/fckeditor.asp" -->
<%
newsid=0
title=""
url=""
sortid=100
is_index=0
notes=""

mth = month(date)
y = year(date)
d = day(date)
if mth < 10 then
mth = "0"&mth
end if
if d <10 then
d = "0"&d
end if
dates = y&"-"&mth&"-"&d
add_time=dates



if not request("newsid") = "" then
	newsid=request("newsid")
end if

if not newsid=0 then
	sql="select * from news where newsid="&newsid
	set rs=conn.execute(sql)
	title=rs("title")
	url=rs("url")
	sortid=rs("sortid")
	is_index=rs("is_index")
	notes=dvHTMLCode(rs("notes"))
	add_time=rs("add_time")
end if
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加信息</title>
<style type="text/css">
<!--
body {
	margin-top: 10px;
	margin-left: 10px;
}
-->
</style>
<link href="css/admin.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../javascript/calendar1.js"></script>
<script language="javascript">
function checkform()
{
	if (document.form1.title.value == "" )
	{
	alert("标题为必填项！");
	return false;
	}
	else if (document.form1.add_time.value == "" )
	{
	alert("创建日期为必填项！");
	return false;
	}
	
	else if (document.form1.sortid.value == "" )
	{
	alert("排序为必填项！");
	return false;
	}
	else if (isNaN(document.form1.sortid.value))
	{
	alert("排序必须是数字！");
	return false;
	}
}
</script>
</head>

<body>
<table width="100%" border="0" align="left" cellpadding="3" cellspacing="0">
  <form action="save.asp?action=savenews" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <input name="newsid" type="hidden" value="<%= newsid %>">
    <tr>
      <td height="28" colspan="3" align="center" class="toptt">新闻<% if newsid=0 then response.Write("添加") else response.Write("修改") end if %></td>
    </tr>
    
    <tr>
      <td  height="28" align="right"><span class="red">*</span>标题：</td>
      <td colspan="2" align="left"><input name="title" type="text" id="title" value="<%= title %>" size="60">
      <span class="red">*</span>创建日期：<input name="add_time" type="text" id="add_time" value="<%= add_time %>" size="20"><img src="images/icon_02.jpg" width="17" height="17" align="absmiddle" onClick="popUpCalendar(form1.add_time, form1.add_time, 'yyyy-mm-dd')"  /></td>
    </tr>
    
    <tr>
      <td  height="28" align="right">连接url：</td>
      <td colspan="2" align="left"><input name="url" type="text" id="url" value="<%= url %>" size="60"></td>
    </tr>
    <tr>
      <td width="111"  height="28" align="right"><span class="red">*</span>排序：</td>
      <td colspan="2" align="left"><input name="sortid" type="text" id="sortid" value="<%= sortid %>" size="10">
        <span class="red">（如：1排在第一位，以此类推，默认值100）</span></td>
    </tr>
    <tr>
      <td  height="28" align="right" valign="middle">是否推荐到首页：</td>
      <td colspan="2" align="left" valign="middle"><% isindex(is_index) %>
        <span class="red">首页显示（只能推荐6个）</span></td>
    </tr>
    <tr>
      <td  height="21" align="right" valign="top"><span class="red">*</span>详细介绍：</td>
<td colspan="2"><% 
	  fckeditor1 "notes",notes
	   %></td>
    </tr>
    <tr align="center">
      <td height="20" colspan="3"><input name="imageField" type="image" class="input_defult" src="images/submit.jpg" width="49" height="17" onClick="return checkform();" /></td>
    </tr>
  </form>
</table>
</body>
</html>
