<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn.asp"-->
<!--#include file="session.asp"-->
<%
dim id,act,catalogname,votestatus,expiresTime
act=request.QueryString("act")
id=Clng(request.QueryString("id"))
%>
<!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=gb2312" />
<title>修改分类</title>
<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
	font-size: 14px;
}
-->
</style>
<LINK media=screen href="js/dhtmlgoodies_calendar.css" rel=stylesheet></LINK>
<SCRIPT src="js/dhtmlgoodies_calendar.js" type="text/javascript" ></SCRIPT>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<%
if(act="mod") then
	if not isempty(request.Form("title")) then
		title=replace(trim(request.Form("title")),"'","")
	else
		response.Write("<script>alert(""分类名不能为空!"");history.back();</script>")
		response.End()
	end if
	votestatus=Cint(request.Form("status"))
	expiresTime=trim(request.Form("expiresTime"))
	if(title<>"") then
		set rs=server.CreateObject("adodb.recordset")
		rs.open "select * from t_survey_catalog where id="&id,conn,3,3
		if not rs.eof and not rs.bof then
			rs("title")=title			
			rs("status")=votestatus
			rs("expiresTime")=expiresTime
			rs.update
			rs.close
			set rs=nothing
			response.Write("<script>alert(""成功修改!"");location.href=""catalog_manage.asp"";</script>")			
			call connclose()
			response.End()			
		else			
			response.Write("<script>alert(""没有找到记录!"");location.href=""catalog_manage.asp"";</script>")
			call connclose()
			response.End()
		end if
	else
		response.Write("<script>alert(""分类不能为空!"");history.back();</script>")
		call connclose()
		response.End()
	end if
else
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from t_survey_catalog where id="&id,conn,3,1
	if not rs.eof and not rs.bof then
%>
<body onload="document.form1.title.focus();">
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="45%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#EEFAFF">
  <tr>
    <td><form id="form1" name="form1" method="post" action="?act=mod&id=<%=id%>">
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="40" colspan="2" bgcolor="#006699"><div align="center" class="style1">修改投票项目</div></td>
          </tr>
        <tr>
          <td height="50"><div align="right">用户名：</div></td>
          <td>
            <div align="left">
              <input name="title" type="text" id="title" size="15" value="<%=rs("title")%>" />          
            </div></td>
        </tr>
        <tr>
          <td height="50"><div align="right">过期：</div></td>
          <td height="50">
					<INPUT name=expiresTime type=text id=expiresTime size="25" value="<%=rs("expiresTime")%>" onchange="return checkDate(this)">
            <input name="button2" type="button" onclick="displayCalendar(document.forms[0].expiresTime,'yyyy-mm-dd',this)" value="..." />
            
					</td>
        </tr>
				<TR bgcolor="#F5F5F5">
  <TD><div align="right">投票状态：</div></TD>
  <TD><div align="left">
    <input name="status" type="radio" value="0" <%if(rs("status")=0) then response.Write("checked")%>>
  关闭 
  <input name="status" type="radio" value="1"  <%if(rs("status")=1) then response.Write("checked")%>>
  开启 
  <input name="status" type="radio" value="2" <%if(rs("status")=2) then response.Write("checked")%>>
  过期</div></TD>
</TR>
        <tr>
          <td height="50" colspan="2"><div align="center">		  	
            <input type="submit" name="Submit" value="修改" />&nbsp;&nbsp;
            <input type="reset" name="Submit2" value="重写" />
          </div></td>
          </tr>
      </table>
        </form>
    </td>
  </tr>
</table>
<%
	end if
	rs.close
	set rs=nothing
end if
%>
</body>
</html>
<%
call connclose()
%>