⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addgametype.asp

📁 为一网站销售代码
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
if session("loginpass")<>true then Response.Redirect "notlogin.htm"
if session("IsAdmin")<>true then Response.Redirect "notlogin1.htm"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加游戏类型</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="0" topmargin="0">
<table width="103%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="22" align="center" bgcolor="#F7F7F7"><strong>修改、增加游戏类型与点卡类型</strong></td>
  </tr>
  <tr> 
    <td>
	<form action="AddGameType.asp" name="idform" method="post"><input type="hidden" name="typeid" value=""></form>
      <hr width="98%"> <div align="left">
<%
dim add,rs,rs2,sql,sql2,typeid
typeid=request("typeid")
if typeid="" then typeid=1 else typeid=cint(typeid)
sql="select GameType,CardType,Game,CardTime from Type where ID=" & typeid
set rs=conn.execute(sql)
sql2="select ID from Type"
set rs2=server.CreateObject("adodb.recordset")
rs2.open sql2,conn,1,1
add=request("add")
select case add
	case 1:call addGameType
	case else:ShowHtml
end select
%>

<%
sub ShowHtml()
%>
        <form name="form1" method="post" action="<%=Request.ServerVariables("URL")%>">
          <br>
          <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#A5C6F1">
            <tr>
              <td><table width="100%" border="0" cellpadding="3" cellspacing="1">
                  <tr align="center" bgcolor="#FFFDF4"> 
                    <td colspan="2">添加游戏类型 </td>
                  </tr>
                  <tr> 
                    <td width="40%" align="right" bgcolor="#F7F7F7">游戏类型:</td>
                    <td bgcolor="#FFFFFF"> <input name="GameType" type="text" id="GameType3" size="20" maxlength="20"></td>
                  </tr>
                  <tr> 
                    <td align="right" bgcolor="#F7F7F7">卡的类型:</td>
                    <td bgcolor="#FFFFFF"> <input name="CardType" type="text" id="CardType3" size="3" maxlength="3"></td>
                  </tr>
                  <tr> 
                    <td width="40%" align="right" bgcolor="#F7F7F7">所属游戏:</td>
                    <td bgcolor="#FFFFFF"> <input name="Game" type="text" size="20"></td>
                  </tr>
                  <tr> 
                    <td width="40%" align="right" bgcolor="#F7F7F7">游戏卡类型:</td>
                    <td bgcolor="#FFFFFF"> <input type="text" name="yuenian" size="20"></td>
                  </tr>
                  <tr align="center" bgcolor="#FFFDF4"> 
                    <td colspan="2"> <input name="add" type="hidden" id="add3" value="1"> 
                      <input type="submit" name="Submit" value="添 加"> </td>
                  </tr>
                </table></td>
            </tr>
          </table>
          <br>
        </form>
		<form name="mform" method="post" action="modtype.asp">
        <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#A5C6F1">
          <tr> 
            <td><table width="100%" border="0" cellpadding="3" cellspacing="1">
                  <tr align="center" bgcolor="#FFFDF4"> 
                    <td colspan="2">修改游戏类型 </td>
                  </tr>
                  <tr> 
                    <td align="right" bgcolor="#F7F7F7">游戏类型ID:</td>
                    <td bgcolor="#FFFFFF"> <select name="tid" onChange="javascript:jumptoid(options[selectedIndex].value)">
                        <%
				  while not(rs2.eof)
				  if (typeid=rs2(0)) then
				  	response.Write "<option value="&rs2(0)&" selected>"&rs2(0)
				  else
				  	response.Write "<option value="&rs2(0)&">"&rs2(0)	
				  end if
				  rs2.movenext
				  wend
				  rs2.close()
				  set rs2=nothing
				  %>
                      </select> <font color="#ff0000">(选择要修改的游戏类型)</font></td>        
                  </tr>        
                  <tr>         
                    <td width="40%" align="right" bgcolor="#F7F7F7">游戏类型:</td>        
                    <td bgcolor="#FFFFFF"> <input name="GameType" type="text" size="20" maxlength="20" value="<%=rs(0)%>"></td>        
                  </tr>        
                  <tr>         
                    <td width="40%" align="right" bgcolor="#F7F7F7">卡的类型:</td>        
                    <td bgcolor="#FFFFFF"> <input name="CardType" type="text" size="3" maxlength="3" value="<%=rs(1)%>">         
                      &nbsp;是否要删除         
                      <input name="del" type="checkbox" id="del" value="1"></td>        
                  </tr>        
                  <tr>         
                    <td align="right" bgcolor="#F7F7F7">所属游戏:</td>        
                    <td bgcolor="#FFFFFF"> <input name="Game" type="text" size="20" value="<%=rs(2)%>"></td>        
                  </tr>        
                  <tr>         
                    <td align="right" bgcolor="#F7F7F7">游戏卡类型:</td>       
                    <td bgcolor="#FFFFFF"> <input type="text" name="yuenian" size="20" value="<%=rs(3)%>"></td>       
                  </tr>       
                  <tr align="center" bgcolor="#FFFDF4">        
                    <td colspan="2"> <input type="submit" name="Submit2" value="修 改">        
                    </td>       
                  </tr>       
                </table></td>       
          </tr>       
        </table>       
		</form>       
        <p>&nbsp;</p>       
      </div>       
      <hr width="98%">       
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:游戏类型与点卡类型是对应的,请两者都填写。<br>       
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;修改游戏类型如果要删除该ID的请打上钩。</td>       
  </tr>       
</table>       
<%       
end sub       
%>       
<script language="JavaScript">       
function jumptoid(jid){       
	if (jid>0){       
		idform.typeid.value=jid;       
		idform.submit()       
	}       
}       
</script>       
</body>       
</html>       
       
       
<%       
sub addGameType()       
	dim  GameType,CardType,Game,yuenian,sql       
	GameType=Request("GameType")       
	CardType=Request("CardType")       
	Game=Request("Game")       
	yuenian=request("yuenian")     
	if GameType="" or CardType="" then response.Redirect("AddGameType.asp")       
	sql="insert into Type (GameType,CardType,Game,CardTime) values('"&GameType&"','"&CardType&"','"&Game&"','"&yuenian&"')"       
	conn.ExeCute(sql)       
	CloseDatabase       
	Response.Write  "游戏类型:"&GameType&" 卡类型:"&CardType&" 已经成功添加":Response.End        
end sub       
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -