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

📄 addmoney.asp

📁 图书馆模拟管理系统,对里面的功能简单容易懂,一看就会,是学习asp的好东西!
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asp"-->
<% 
if NOT isempty(request("moneysub")) then
dim sno,money

  sno=trim(request("stuno"))
  money=trim(request("moneyno"))

set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [user] where id='"&sno&"'" ,conn,1,3
if not(rs.bof and rs.eof) then
	if sno=rs("id") then
	     rs("money") = rs("money")+money
		rs.Update
		rs.Close
		set rs=nothing
		response.redirect "user.asp"

	'else
		'call MsgBox("对不起,您的用户名或密码有误!","Back","None")
	end if
	'else
	'call MsgBox("对不起,您的用户名或密码有误!","Back","None")
end if
end if
 %>
<html>
<head>
<style type="text/css">
<!--
body {
	font-size:10pt;
	
}
td {font-size:9pt}
table{font-size:9pt}
.style4 {color: #E8A477}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<!--#include file="head.asp"-->

<table width="980" border="0" cellpadding="0" cellspacing="0" align="center">
  <!--DWLayoutTable-->
  <tr>
    <td height="14" colspan="4" valign="top">
	
	  <table width="100%" border="0" cellpadding="0" cellspacing="0">
	    <!--DWLayoutTable-->
	    <tr>
	      <td width="980" height="14">&nbsp;</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td width="228" rowspan="2" valign="top">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="141" height="215"><!--#include file="left1.htm"--></td>
      </tr>
    </table></td>
    <td height="43" colspan="3" valign="top">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="100%" ><span class="style4"><font size="+2"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;学生帐号充值</strong></font></span></td>
      </tr>
	  <tr><td width="100%"><hr></td></tr>
    </table></td>
  </tr>
  <tr>
    <td width="139" height="205">&nbsp;</td>
    <td width="304" valign="top">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="389" height="205">
		  <form name="addmoney" method="post" action="" id="addmoney">
		    <table>
			   <tr>
			      <td bgcolor="#E8E8E8">学生学号:</td>
				  <td><input type="text" name="stuno" id="stuno"></td>
			   </tr>
			   <tr><td height="8"></td></tr>
			   <tr>
			     <td bgcolor="#E8E8E8">充值钱额:</td>
				 <td><input type="text" name="moneyno" id="moneyno"></td>
			   </tr>
			   <tr><TD height="8"></TD></tr>
			   <tr>
			     <td></td>
				 <td><input type="submit" name="moneysub" id="moneysub" value="提交" onClick="return checkmoney()">&nbsp;&nbsp;&nbsp;<input type="reset" value="重写"></td>
			   </tr>
			</table>
		  </form>
		
		
		</td>
      </tr>
    </table></td>
    <td width="309">&nbsp;</td>
  </tr>
</table>
<!--#include file="foot.htm"-->
<script language="JavaScript">
<!--
function checkmoney()
{
    if(checkspace(document.addmoney.stuno.value)) {
	document.addmoney.stuno.focus();
    alert("请输入学生的学号!");
	return false;
  }

	if(checkspace(document.addmoney.moneyno.value)) {
	document.addmoney.moneyno.focus();
    alert("请输入要加入的金额!");
	return false;
  }
	
  
  return true;
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}
//-->
</script>
</body>
</html>

⌨️ 快捷键说明

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