www.gusucode.com > 追梦翔飞数字报静态生成版 7.0 体验版码程序 > admin/AddPaper.asp

    <%@language=vbscript codepage=936 %>
<!--#include file="Admin.asp" -->
<!--#include file="cf.asp" -->
<!--#include file="../include/conn.asp" -->
<!--#include file="../include/safe.asp"-->

<%
dim action,bigclassname,smallclassname,rs,founderr,errmsg,banmian
action=trim(request("action"))
banmian=trim(request("banmian"))
bigclassname=trim(request("bigclassname"))
smallclassname=trim(request("smallclassname"))
if action="add" then
		set rs=server.createobject("adodb.recordset")
		rs.open "select * from FangBao_SmallClass where bigclassname='" & bigclassname & "' and smallclassname='" & smallclassname & "'",conn,1,3
		if not rs.eof then
		response.write "<script language='javascript'>alert('对不起,"& bigclassname &"中已经存在该报纸版面" & smallclassname & "');history.back();</script>" 
		response.end
		else
     		rs.addnew
			rs("banmian")=banmian
			rs("bigclassname")=bigclassname
    	 	rs("smallclassname")=smallclassname
     		rs.update
	     	rs.close
    	set rs=nothing
		response.write "<script language='javascript'>" & chr(13)
		response.write "alert('恭喜,期刊版面添加成功!');" & Chr(13)
		response.write "window.document.location.href='HotManage.asp';"&Chr(13)
		response.write "</script>" & Chr(13)
        Response.End
     		call closeconn()
			response.redirect "HotManage.asp"  
		end if
else
%>
<script language="javascript" type="text/javascript">
function checksmall()
{
  if (document.form2.smallclassname.value=="")
  {
    alert("所属版面名称不能为空!");
	document.form2.smallclassname.focus();
	return false;
  }
  if (document.form2.banmian.value=="")
  {
    alert("版面名称不能为空!");
	document.form2.banmian.focus();
	return false;
  }
}
</script>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}
-->
</style>

<link href="images/skin.css" rel="stylesheet" type="text/css" />
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td width="1212" height="29" valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">报刊管理</div></td>
      </tr>
    </table></td>
    <td width="22" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="257" valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table width="100%" height="257" border="0" cellpadding="0" cellspacing="0">
      <tr> <form name="form2" method="post" action="AddPaper.asp" onSubmit="return checksmall()">
        <td height="13" valign="top">&nbsp;</td>
      <tr>
        <td height="244" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable">
              <tr>
                <td class="left_bt2">&nbsp;&nbsp;&nbsp;&nbsp;版面添加</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="122"><table width="100%" border="0" cellspacing="0" cellpadding="0">
		
              <tr>
                <td width="35%" height="30" align="right" bgcolor="#f2f2f2" class="left_txt2">所属期刊:</td>
                <td width="1%" bgcolor="#f2f2f2">&nbsp;</td>
                <td width="19%" height="30" bgcolor="#f2f2f2"> <select name="bigclassname">
                <%
	dim rsbigclass
	set rsbigclass=server.createobject("adodb.recordset")
	rsbigclass.open "select * from FangBao_BigClass",conn,1,1
	if rsbigclass.bof and rsbigclass.bof then
		response.write "<option>请先添加报纸期刊日期</option>"
	else
		do while not rsbigclass.eof
			if rsbigclass("bigclassname")=bigclassname then
				response.write "<option value='"& rsbigclass("bigclassname") & "' selected>" & rsbigclass("bigclassname") & "</option>"
			else
				response.write "<option value='"& rsbigclass("bigclassname") & "'>" & rsbigclass("bigclassname") & "</option>"
			end if
			rsbigclass.movenext
		loop
	end if
	rsbigclass.close
	set rsbigclass=nothing
	%>
            </select></td>
                <td width="45%" height="30" bgcolor="#f2f2f2" class="left_txt"></td>
              </tr>
              <tr>
                <td height="30" align="right" class="left_txt2">所属版面:</td>
                <td>&nbsp;</td>
                <td height="30"><input name="smallclassname" type="text" size="30" maxlength="30"></td>
                <td height="30" class="left_txt">&nbsp;</td>
              </tr>
              <tr>
                <td height="30" align="right" bgcolor="#f2f2f2" class="left_txt2">版面名称:</td>
                <td bgcolor="#f2f2f2">&nbsp;</td>
<td height="30" bgcolor="#f2f2f2"> <input name="banmian" type="text" size="30" maxlength="30"></td>
                <td height="30" bgcolor="#f2f2f2" class="left_txt">&nbsp;</td>
              </tr>  
              
            </table></td>
          </tr>
        </table>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">

            <tr>
              <td width="44%" height="44" align="right"> <input name="action" type="hidden" id="action" value="add">
                <input name="add" type="submit" value=" 添 加 "></td>
              <td width="2%" height="44" align="right">&nbsp;</td>
              <td width="54%" height="44"><input type="reset" value="取  消" name="B12" /></td>
            </tr>
            <tr>
              <td height="13" colspan="3">&nbsp;</td>
            </tr>
          </table></td>
      </tr></form>
    </table><%
end if
%>   </td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
      <td height="17" valign="top" background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>

</body>