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

📄 addcard.jsp

📁 在线教育平台: 从小学
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=GB18030"
    pageEncoding="GB18030"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<jsp:useBean id="card" scope="page" class="edu.CardBean" />
<title>添加新卡</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 12px}
.STYLE2 {color: #FF0000}
-->
</style>
</head>
<script language=JavaScript>
function check(){
var no,day;
no=document.form1.no.value;
day=document.form1.day.value;
if(no==""){
alert("卡的数目不能为空!");
return false;
}
if(day==""){
alert("卡的面值不能为空!");
return false;
}
if(no.replace(/^[0-9]*/g,'')){
alert("卡的数目必须为数字!");
return false;}
if(day.replace(/^[0-9]*/g,'')){
alert("卡的面值必须为数字!");
return false;}
}
</script>
<body>
<%

int cardnumberall=0;
int cardnumber_unuse=0;
String name=null,sort="";
try{
	name=session.getAttribute("name").toString();
	sort=session.getAttribute("sort").toString();
	}catch(NullPointerException e){}
	if(name==null||name.equalsIgnoreCase("null")||!sort.equalsIgnoreCase("admin"))
		response.sendRedirect("error_ad.jsp");
	cardnumberall=card.cardCount();
	cardnumber_unuse=card.cardCount_unuse();
%>
<form name="form1" method="post" action="ServletCards">
<input  name="action" type="hidden" value="new">
  <table width="100%" border="0">
      <tr>
      <td width="31%">&nbsp;</td>
      <td width="69%">&nbsp;</td>
    </tr>
  <tr>
      <td><div align="right" class="STYLE1">现共有<span class="STYLE2"><%=cardnumberall %></span>张卡</div></td>
      <td><span class="STYLE1">未使用<span class="STYLE2"><%=cardnumber_unuse %></span>张卡</span></td>
    </tr>
    <tr>
      <td><div align="right" class="STYLE1">卡的数目</div></td>
      <td><label>
        <input type="text" name="no">
      </label></td>
    </tr>
    <tr>
      <td><div align="right" class="STYLE1">卡的面值</div></td>
      <td><label>
        <input type="text" name="day">
      </label></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
        <input type="submit" name="Submit" onClick="return check()" value="生成">
        <input type="reset" name="Submit2" value="重置">
      </label></td>
    </tr>
  </table>
</form>
</body>
</html>

⌨️ 快捷键说明

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