student
<%-- Created by IntelliJ IDEA. User: 绿波亭 Date: 2023/5/29 Time: 14:24 To change this template use File | Settings | File Templates. --%> <%@ page import="wangzhan.*" %> <%@ page import="java.util.ArrayList" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <!DOCTYPE html> <html> <head> <title> 学生功能页 </title> <style> body{ background-color: #f2f2f2; font-family: Arial, sans-serif; } .container{ max-width: 800px; margin: 0 auto; text-align: center; padding: 20px 0; } h1{ font-size: 36px; color: #333; margin-bottom: 20px; } table{ font-family: Arial, sans-serif; border-collapse: collapse; width: 100%; margin-bottom: 20px; } td, th{ border: 1px solid #ddd; text-align: center; padding: 8px; } th{ background-color: #4caf50; color: white; } input[type="text"]{ width: 100%; padding: 12px 20px; margin: 8px 0; display: inline-block; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } label{ display: block; text-align: left; font-size: 18px; margin-bottom: 5px; color: #333; } input[type="submit"]{ background-color: #4caf50; color: white; font-size: 18px; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; } input[type="submit"]:hover{ background-color: #37a047; } .cout{ margin-right: 7%; } </style> </head> <body> <%HttpSession httpSession= request.getSession(); String username= (String) httpSession.getAttribute("username"); String role= (String) httpSession.getAttribute("role"); Thesql thesql=new Thesql(); request.setCharacterEncoding("UTF-8"); String date=request.getParameter("date"); int n = 0; ArrayList<score> scores = null; if(date==null){ n=0; } else{ scores=thesql.get_score(username,date); n=scores.size(); } %> <div class="container"> <h1> 学生功能 </h1> <label class="cout">姓名:<%out.print(thesql.get_name(username,role));%></label> <label class="cout">学号:<%out.print(username);%></label> <h2>考试成绩 <form action="student.jsp" method="post"> <input type="date" name="date"> <input type="submit" value="查询" style="font-size: 2px;"> <a href="ex.jsp"><button>修改</button></a> </form> </h2> <table> <tr> <th>科目</th> <th>成绩</th> </tr> <%for(int i=0;i<n;i++){%> <tr> <td><%out.print(scores.get(i).sub);%></td> <td><%out.print(scores.get(i).sco);%></td> </tr> <%}%> </table> </div> </body> </html>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· winform 绘制太阳,地球,月球 运作规律
· 上周热点回顾(3.3-3.9)