Browse Source

简单建立了管理员系统页面

sanaaaa 1 year ago
parent
commit
9137855601

+ 6 - 0
.idea/jsLibraryMappings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="JavaScriptLibraryMappings">
+    <file url="file://$PROJECT_DIR$" libraries="{element-ui, vue}" />
+  </component>
+</project>

+ 0 - 1
.idea/misc.xml

@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ExternalStorageConfigurationManager" enabled="true" />
   <component name="MavenProjectsManager">

+ 15 - 0
pom.xml

@@ -27,9 +27,24 @@
       <artifactId>mysql-connector-java</artifactId>
       <version>8.0.23</version> <!-- 根据您要使用的MySQL版本选择合适的版本号 -->
     </dependency>
+      <dependency>
+          <groupId>javax.servlet</groupId>
+          <artifactId>jstl</artifactId>
+          <version>1.2</version>
+      </dependency>
   </dependencies>
 
   <build>
     <finalName>untitled</finalName>
+      <plugins>
+          <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-compiler-plugin</artifactId>
+              <configuration>
+                  <source>8</source>
+                  <target>8</target>
+              </configuration>
+          </plugin>
+      </plugins>
   </build>
 </project>

+ 60 - 0
src/main/java/com/bing/bean/Semester.java

@@ -0,0 +1,60 @@
+package com.bing.bean;
+
+import sun.util.calendar.LocalGregorianCalendar;
+
+import java.util.Date;
+
+public class Semester {
+    private int smid;
+    private String semester;
+    private Date semesterStart;
+    private Date semesterEnd;
+
+    public Semester(int smid, Date semesterstart, Date semesterend) {
+        this.smid = smid;
+        this.semesterStart = semesterstart;
+        this.semesterEnd = semesterend;
+    }
+
+    public int getSmid() {
+        return smid;
+    }
+
+    public void setSmid(int smid) {
+        this.smid = smid;
+    }
+
+    public String getSemester() {
+        return semester;
+    }
+
+    public void setSemester(String semester) {
+        this.semester = semester;
+    }
+
+    public Date getSemesterStart() {
+        return semesterStart;
+    }
+
+    public void setSemesterStart(Date semesterStart) {
+        this.semesterStart = semesterStart;
+    }
+
+    public Date getSemesterEnd() {
+        return semesterEnd;
+    }
+
+    public void setSemesterEnd(Date semesterEnd) {
+        this.semesterEnd = semesterEnd;
+    }
+
+    @Override
+    public String toString() {
+        return "Semester{" +
+                "smid=" + smid +
+                ", semester='" + semester + '\'' +
+                ", semesterStart=" + semesterStart +
+                ", semesterEnd=" + semesterEnd +
+                '}';
+    }
+}

+ 3 - 0
src/main/java/com/bing/bean/User.java

@@ -5,6 +5,9 @@ public class User {
     public String pwd;
     public String email;
 
+
+
+
     public Integer getUid() {
         return uid;
     }

+ 2 - 7
src/main/java/com/bing/controller/LoginServlet.java

@@ -30,14 +30,9 @@ public class LoginServlet extends HttpServlet {
     protected void doPost(HttpServletRequest request, HttpServletResponse response)
             throws ServletException, IOException {
         request.setCharacterEncoding("utf-8");
-        String imageText = request.getParameter("image");
-        // 图片的验证码
-        String text = (String) request.getSession().getAttribute("text");
 
-        if (!text.equalsIgnoreCase(imageText)) {
-            request.setAttribute("imageMess", "验证码输入错误!");
-            // request.getRequestDispatcher("calendar1.jsp").forward(request, response);
-        }
+
+
 
         String email = request.getParameter("email");
         String pwd = request.getParameter("pwd");

+ 1 - 7
src/main/java/com/bing/controller/RegisterServlet.java

@@ -30,7 +30,6 @@ public class RegisterServlet extends HttpServlet {
 
     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
         request.setCharacterEncoding("UTF-8");
-        response.setContentType("text/html;charset=utf-8");
         String email = request.getParameter("email");
         String pwd = request.getParameter("pwd");
         String userRePwd = request.getParameter("userRePwd");
@@ -43,11 +42,6 @@ public class RegisterServlet extends HttpServlet {
         } else {
             request.getRequestDispatcher("user-register.jsp").forward(request, response);
         }
-        if (email.equals(email)) {
-            PrintWriter out = response.getWriter();
-            out.write("此账号已经存在");
-            out.flush();
-            out.close();
-        }
+
     }
 }

+ 31 - 0
src/main/java/com/bing/controller/SemesterServlet.java

@@ -0,0 +1,31 @@
+package com.bing.controller;
+
+import com.bing.bean.Semester;
+import com.bing.bean.User;
+import com.bing.dao.SemesterDAO;
+import com.bing.util.ConnectionUtil;
+
+import javax.jws.WebService;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.sql.*;
+import java.util.ArrayList;
+import java.util.List;
+
+
+@WebServlet("/semester")
+public class SemesterServlet extends HttpServlet {
+//    private SemesterDAO semesterDAO = new SemesterDAO();
+//
+//    @Override
+//    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+//        List<Semester> semesters = semesterDAO.getSemester();
+//        request.setAttribute("semesters", semesters);
+//        request.getRequestDispatcher("/semester.jsp").forward(request, response);
+//    }
+}

+ 34 - 0
src/main/java/com/bing/dao/SemesterDAO.java

@@ -0,0 +1,34 @@
+package com.bing.dao;
+
+import com.bing.bean.Semester;
+import com.bing.util.ConnectionUtil;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class SemesterDAO {
+
+    public Semester getSemester(int smid) {
+        String sql = "SELECT semesterstart, semesterend FROM semester WHERE smid = ?";
+
+        try (Connection conn = ConnectionUtil.getConnection();
+             PreparedStatement stmt = conn.prepareStatement(sql);
+             ) {
+            stmt.setInt(1, smid);
+            ResultSet rs = stmt.executeQuery();
+            if (rs.next()) {
+                Date start = rs.getDate("semesterstart");
+                Date end = rs.getDate("semesterend");
+                return new Semester(smid, start, end);
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+}

+ 3 - 0
src/main/java/com/bing/dao/UserDao.java

@@ -2,9 +2,12 @@ package com.bing.dao;
 
 import com.bing.bean.User;
 
+import java.sql.SQLException;
+
 public interface UserDao {
     int insert(String email,String pwd);
      User selectByName(String email);
 
 
+
 }

+ 2 - 0
src/main/java/com/bing/dao/UserDaoImpl.java

@@ -47,4 +47,6 @@ public class UserDaoImpl implements UserDao {
         }
         return null;
     }
+
+
 }

+ 2 - 1
src/main/java/com/bing/util/ConnectionUtil.java

@@ -9,7 +9,7 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 
 public class ConnectionUtil {
-    private static final String url = "jdbc:mysql://10.248.44.131/apple?allowPublicKeyRetrieval=true&useSSL=false";
+    private static final String url = "jdbc:mysql://localhost/apple?allowPublicKeyRetrieval=true&useSSL=false";
     private static final String rootName = "zhangsan";
     private static final String rootPwd = "123456";
 
@@ -75,4 +75,5 @@ public class ConnectionUtil {
             }
         }
     }
+
 }

+ 23 - 0
src/main/java/com/bing/util/DateUtils.java

@@ -0,0 +1,23 @@
+package com.bing.util;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+public class DateUtils {
+    public static List<String> getWeeklyDates(Date start, Date end) {
+        List<String> dates = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(start);
+
+        while (!calendar.getTime().after(end)) {
+            dates.add(sdf.format(calendar.getTime()));
+            calendar.add(Calendar.WEEK_OF_YEAR, 1); // 增加一周
+        }
+
+        return dates;
+    }
+}

+ 41 - 547
src/main/webapp/calendar.jsp

@@ -11,553 +11,47 @@
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>深圳信息职业技术学院22-23校历</title>
-    <style>
-        body {
-            font-family: Arial, sans-serif;
-            color: #333;
-            background-color: #f4f4f9;
-            padding: 20px;
-        }
-
-        h1, h2 {
-            text-align: center;
-            color: #444;
-        }
-
-        h1 {
-            font-size: 2.5em;
-        }
-
-        h2 {
-            margin-top: 40px;
-            font-size: 1.8em;
-        }
-
-        table {
-            width: 100%;
-            margin: 20px auto;
-            border-collapse: collapse;
-            background-color: rgba(255, 255, 255, 1);
-            border-radius: 10px;
-            overflow: hidden;
-            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
-            table-layout: fixed;
-        }
-
-        th, td {
-            border: 1px solid #ddd;
-            padding: 10px;
-            text-align: center;
-            height: 60px;
-        }
-
-        th {
-            background-color: #f7f7f7;
-            font-weight: bold;
-        }
-
-        .week {
-            background-color: #e0e0e0;
-            font-weight: bold;
-        }
-
-        .holiday {
-            background-color: #ffcccc;
-        }
-
-        .current-month {
-            background-color: #e9f5ff;
-            font-weight: bold;
-        }
-
-        .other-month {
-            color: #999;
-        }
-
-        .calendar {
-            margin-bottom: 40px;
-        }
-    </style>
+    <title>管理员系统</title>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>管理员界面</title>
+    <link rel="stylesheet" href="css/a003.css">
+    <script src="js/Jquery.js"></script>
+    <script src="js/a003.js"></script>
 </head>
 <body>
-<h1>管理员系统</h1>
-
-<!-- 2022年8月 -->
-<div class="calendar">
-    <h2>2022年8月</h2>
-    <table>
-        <tr>
-            <th class="week">周数</th>
-            <th>星期一</th>
-            <th>星期二</th>
-            <th>星期三</th>
-            <th>星期四</th>
-            <th>星期五</th>
-            <th>星期六</th>
-            <th>星期日</th>
-            <th colspan="2">备注</th>
-        </tr>
-        <tr>
-            <td class="week"></td>
-            <td></td>
-            <td></td>
-            <td></td>
-            <td></td>
-            <td class="current-month">26</td>
-            <td class="current-month">27</td>
-            <td class="current-month">28</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">1</td>
-            <td class="current-month">29</td>
-            <td class="current-month">30</td>
-            <td class="current-month">31</td>
-            <td class="other-month">1</td>
-            <td class="other-month">2</td>
-            <td class="other-month">3</td>
-            <td class="other-month">4</td>
-            <td colspan="2"></td>
-        </tr>
-    </table>
-</div>
-
-<!-- 2022年9月 -->
-<div class="calendar">
-    <h2>2022年9月</h2>
-    <table>
-        <tr>
-            <th class="week">周数</th>
-            <th>星期一</th>
-            <th>星期二</th>
-            <th>星期三</th>
-            <th>星期四</th>
-            <th>星期五</th>
-            <th>星期六</th>
-            <th>星期日</th>
-            <th colspan="2">备注</th>
-        </tr>
-        <tr>
-            <td class="week">1</td>
-            <td class="other-month">29</td>
-            <td class="other-month">30</td>
-            <td class="other-month">31</td>
-            <td class="current-month">1</td>
-            <td class="current-month">2</td>
-            <td class="current-month">3</td>
-            <td class="current-month">4</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">2</td>
-            <td class="current-month">5</td>
-            <td class="current-month">6</td>
-            <td class="current-month">7</td>
-            <td class="current-month">8</td>
-            <td class="current-month">9</td>
-            <td class="holiday">10</td>
-            <td class="holiday">11</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">3</td>
-            <td class="holiday">12</td>
-            <td class="current-month">13</td>
-            <td class="current-month">14</td>
-            <td class="current-month">15</td>
-            <td class="current-month">16</td>
-            <td class="current-month">17</td>
-            <td class="current-month">18</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">4</td>
-            <td class="current-month">19</td>
-            <td class="current-month">20</td>
-            <td class="current-month">21</td>
-            <td class="current-month">22</td>
-            <td class="current-month">23</td>
-            <td class="current-month">24</td>
-            <td class="current-month">25</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">5</td>
-            <td class="current-month">26</td>
-            <td class="current-month">27</td>
-            <td class="current-month">28</td>
-            <td class="current-month">29</td>
-            <td class="current-month">30</td>
-            <td class="other-month">1</td>
-            <td class="other-month">2</td>
-            <td colspan="2"></td>
-        </tr>
-    </table>
-</div>
-
-<!-- 2022年10月 -->
-<div class="calendar">
-    <h2>2022年10月</h2>
-    <table>
-        <tr>
-            <th class="week">周数</th>
-            <th>星期一</th>
-            <th>星期二</th>
-            <th>星期三</th>
-            <th>星期四</th>
-            <th>星期五</th>
-            <th>星期六</th>
-            <th>星期日</th>
-            <th colspan="2">备注</th>
-        </tr>
-        <tr>
-            <td class="week">6</td>
-            <td class="other-month">26</td>
-            <td class="other-month">27</td>
-            <td class="other-month">28</td>
-            <td class="other-month">29</td>
-            <td class="other-month">30</td>
-            <td class="holiday">1</td>
-            <td class="holiday">2</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">6</td>
-            <td class="holiday">3</td>
-            <td class="holiday">4</td>
-            <td class="holiday">5</td>
-            <td class="holiday">6</td>
-            <td class="holiday">7</td>
-            <td class="current-month">8</td>
-            <td class="current-month">9</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">7</td>
-            <td class="current-month">10</td>
-            <td class="current-month">11</td>
-            <td class="current-month">12</td>
-            <td class="current-month">13</td>
-            <td class="current-month">14</td>
-            <td class="current-month">15</td>
-            <td class="current-month">16</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">8</td>
-            <td class="current-month">17</td>
-            <td class="current-month">18</td>
-            <td class="current-month">19</td>
-            <td class="current-month">20</td>
-            <td class="current-month">21</td>
-            <td class="current-month">22</td>
-            <td class="current-month">23</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">9</td>
-            <td class="current-month">24</td>
-            <td class="current-month">25</td>
-            <td class="current-month">26</td>
-            <td class="current-month">27</td>
-            <td class="current-month">28</td>
-            <td class="current-month">29</td>
-            <td class="current-month">30</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">10</td>
-            <td class="current-month">31</td>
-            <td class="other-month">1</td>
-            <td class="other-month">2</td>
-            <td class="other-month">3</td>
-            <td class="other-month">4</td>
-            <td class="other-month">5</td>
-            <td class="other-month">6</td>
-            <td colspan="2"></td>
-        </tr>
-    </table>
-</div>
-
-<!-- 2022年11月 -->
-<div class="calendar">
-    <h2>2022年11月</h2>
-    <table>
-        <tr>
-            <th class="week">周数</th>
-            <th>星期一</th>
-            <th>星期二</th>
-            <th>星期三</th>
-            <th>星期四</th>
-            <th>星期五</th>
-            <th>星期六</th>
-            <th>星期日</th>
-            <th colspan="2">备注</th>
-        </tr>
-        <tr>
-            <td class="week">10</td>
-            <td class="other-month">31</td>
-            <td class="current-month">1</td>
-            <td class="current-month">2</td>
-            <td class="current-month">3</td>
-            <td class="current-month">4</td>
-            <td class="current-month">5</td>
-            <td class="current-month">6</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">11</td>
-            <td class="current-month">7</td>
-            <td class="current-month">8</td>
-            <td class="current-month">9</td>
-            <td class="current-month">10</td>
-            <td class="current-month">11</td>
-            <td class="current-month">12</td>
-            <td class="current-month">13</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">12</td>
-            <td class="current-month">14</td>
-            <td class="current-month">15</td>
-            <td class="current-month">16</td>
-            <td class="current-month">17</td>
-            <td class="current-month">18</td>
-            <td class="current-month">19</td>
-            <td class="current-month">20</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">13</td>
-            <td class="current-month">21</td>
-            <td class="current-month">22</td>
-            <td class="current-month">23</td>
-            <td class="current-month">24</td>
-            <td class="current-month">25</td>
-            <td class="current-month">26</td>
-            <td class="current-month">27</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">14</td>
-            <td class="current-month">28</td>
-            <td class="current-month">29</td>
-            <td class="current-month">30</td>
-            <td class="other-month">1</td>
-            <td class="other-month">2</td>
-            <td class="other-month">3</td>
-            <td class="other-month">4</td>
-            <td colspan="2"></td>
-        </tr>
-    </table>
-</div>
-
-<!-- 2022年12月 -->
-<div class="calendar">
-    <h2>2022年12月</h2>
-    <table>
-        <tr>
-            <th class="week">周数</th>
-            <th>星期一</th>
-            <th>星期二</th>
-            <th>星期三</th>
-            <th>星期四</th>
-            <th>星期五</th>
-            <th>星期六</th>
-            <th>星期日</th>
-            <th colspan="2">备注</th>
-        </tr>
-        <tr>
-            <td class="week">14</td>
-            <td class="other-month">28</td>
-            <td class="other-month">29</td>
-            <td class="other-month">30</td>
-            <td class="current-month">1</td>
-            <td class="current-month">2</td>
-            <td class="current-month">3</td>
-            <td class="current-month">4</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">15</td>
-            <td class="current-month">5</td>
-            <td class="current-month">6</td>
-            <td class="current-month">7</td>
-            <td class="current-month">8</td>
-            <td class="current-month">9</td>
-            <td class="current-month">10</td>
-            <td class="current-month">11</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">16</td>
-            <td class="current-month">12</td>
-            <td class="current-month">13</td>
-            <td class="current-month">14</td>
-            <td class="current-month">15</td>
-            <td class="current-month">16</td>
-            <td class="current-month">17</td>
-            <td class="current-month">18</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">17</td>
-            <td class="current-month">19</td>
-            <td class="current-month">20</td>
-            <td class="current-month">21</td>
-            <td class="current-month">22</td>
-            <td class="current-month">23</td>
-            <td class="current-month">24</td>
-            <td class="current-month">25</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">18</td>
-            <td class="current-month">26</td>
-            <td class="current-month">27</td>
-            <td class="current-month">28</td>
-            <td class="current-month">29</td>
-            <td class="current-month">30</td>
-            <td class="current-month">31</td>
-            <td class="other-month">1</td>
-            <td colspan="2"></td>
-        </tr>
-    </table>
-</div>
-
-<!-- 2022年1月 -->
-<div class="calendar">
-    <h2>2022年1月</h2>
-    <table>
-        <tr>
-            <th class="week">周数</th>
-            <th>星期一</th>
-            <th>星期二</th>
-            <th>星期三</th>
-            <th>星期四</th>
-            <th>星期五</th>
-            <th>星期六</th>
-            <th>星期日</th>
-            <th colspan="2">备注</th>
-        </tr>
-        <tr>
-            <td class="week">18</td>
-            <td class="other-month">26</td>
-            <td class="other-month">27</td>
-            <td class="other-month">28</td>
-            <td class="other-month">29</td>
-            <td class="other-month">30</td>
-            <td class="other-month">31</td>
-            <td class="current-month">1</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">19</td>
-            <td class="current-month">2</td>
-            <td class="current-month">3</td>
-            <td class="current-month">4</td>
-            <td class="current-month">5</td>
-            <td class="current-month">6</td>
-            <td class="current-month">7</td>
-            <td class="current-month">8</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">20</td>
-            <td class="current-month">9</td>
-            <td class="current-month">10</td>
-            <td class="current-month">11</td>
-            <td class="holiday">12</td>
-            <td class="holiday">13</td>
-            <td class="holiday">14</td>
-            <td class="holiday">15</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">寒假</td>
-            <td class="holiday">16</td>
-            <td class="holiday">17</td>
-            <td class="holiday">18</td>
-            <td class="holiday">19</td>
-            <td class="holiday">20</td>
-            <td class="holiday">21</td>
-            <td class="holiday">22</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">寒假</td>
-            <td class="holiday">23</td>
-            <td class="holiday">24</td>
-            <td class="holiday">25</td>
-            <td class="holiday">26</td>
-            <td class="holiday">27</td>
-            <td class="holiday">28</td>
-            <td class="holiday">29</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">寒假</td>
-            <td class="holiday">30</td>
-            <td class="holiday">31</td>
-            <td class="other-month">1</td>
-            <td class="other-month">2</td>
-            <td class="other-month">3</td>
-            <td class="other-month">4</td>
-            <td class="other-month">5</td>
-            <td colspan="2"></td>
-        </tr>
-    </table>
-</div>
-
-
-<!-- 2022年2月 -->
-<div class="calendar">
-    <h2>2022年2月</h2>
-    <table>
-        <tr>
-            <th class="week">寒假</th>
-            <th>星期一</th>
-            <th>星期二</th>
-            <th>星期三</th>
-            <th>星期四</th>
-            <th>星期五</th>
-            <th>星期六</th>
-            <th>星期日</th>
-            <th colspan="2">备注</th>
-        </tr>
-        <tr>
-            <td class="week">寒假</td>
-            <td class="other-month">30</td>
-            <td class="other-month">31</td>
-            <td class="holiday">1</td>
-            <td class="holiday">2</td>
-            <td class="holiday">3</td>
-            <td class="holiday">4</td>
-            <td class="holiday">5</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">寒假</td>
-            <td class="holiday">6</td>
-            <td class="holiday">7</td>
-            <td class="holiday">8</td>
-            <td class="holiday">9</td>
-            <td class="holiday">10</td>
-            <td class="holiday">11</td>
-            <td class="holiday">12</td>
-            <td colspan="2"></td>
-        </tr>
-        <tr>
-            <td class="week">寒假</td>
-            <td class="holiday">13</td>
-            <td class="holiday">14</td>
-            <td class="holiday">15</td>
-            <td class="holiday">16</td>
-            <td class="current-month">17</td>
-            <td class="current-month">18</td>
-            <td class="current-month">19</td>
-            <td colspan="2"></td>
-        </tr>
-    </table>
+<div class="admin-main">
+    <!-- 导航栏 -->
+    <div class="navigation-bar">
+        <!-- 管理员信息 -->
+        <div class="admin-information">
+            <span class="adminName">Hello admin</span>
+        </div>
+        <div class="list-information">
+            <ul class="nav-ul">
+                <li>
+                    <div class="nav-li-div">用户管理</div>
+                    <ul class="div-ul">
+                        <li>用户信息</li>
+                    </ul>
+                </li>
+                <li>
+                    <div class="nav-li-div">校历管理</div>
+                    <ul class="div-ul">
+                        <li>学期管理</li>
+                        <li>学年管理</li>
+                    </ul>
+                </li>
+            </ul>
+        </div>
+    </div>
+    <div class="function-module">
+        <div class="module-index">
+            <div id="mIndex"></div>
+            <div class="admin-permiss">深圳信息职业技术学院</div>
+        </div>
+    </div>
 </div>
+</body>
+</html>

+ 31 - 0
src/main/webapp/controller.jsp

@@ -0,0 +1,31 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: 86180
+  Date: 2024/6/5
+  Time: 21:31
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<html>
+
+<head>
+    <title>Title</title>
+</head>
+<body>
+<table>
+    <tr>
+        <th>UID</th>
+        <th>Email</th>
+        <th>PWD</th>
+    </tr>
+    <c:forEach items="${requestScope.users}" var="user">
+        <tr>
+            <td>${user.uid}</td>
+            <td>${user.email}</td>
+            <td>${user.pwd}</td>
+        </tr>
+    </c:forEach>
+</table>
+</body>
+</html>

+ 93 - 0
src/main/webapp/css/a003.css

@@ -0,0 +1,93 @@
+body {
+    background-color: black;
+    padding: 0px;
+    margin: 0px;
+}
+
+.admin-main {
+    width: 98%;
+    height: 96%;
+    position: absolute;
+    top: 0px;
+    bottom: 0px;
+    /* 取消块限制 */
+    display: flex;
+    margin: 1%;
+}
+
+
+/* 导航栏 */
+
+.navigation-bar {
+    width: 20%;
+    height: 100%;
+    background-color: #FFFFFF;
+}
+
+.admin-information {
+    background-color: pink;
+    height: 50px;
+}
+
+.admin-information>.adminName {
+    background-color: ivory;
+    position: absolute;
+    padding: 10px;
+    top: 4px;
+    border-radius: 0 20px 20px 0;
+}
+
+.nav-li-div {
+    padding: 8px;
+}
+
+.nav-ul,
+.div-ul {
+    list-style-type: none;
+    padding: 0px;
+    cursor: pointer;
+}
+
+.nav-ul>li {
+    margin: 5px;
+}
+
+.div-ul>li {
+    padding: 10px;
+    margin-left: 10px;
+    /* 子菜单弧度 */
+    border-radius: 0 20px 20px 0;
+}
+
+
+/* 功能模块 */
+
+.function-module {
+    width: 80%;
+    height: 100%;
+    background-color: #F2F2F2;
+}
+
+.module-index {
+    /* 功能模块索引 */
+    background-color: #FFFFFF;
+    height: 50px;
+}
+
+#mIndex {
+    float: left;
+    position: relative;
+    padding: 10px;
+    top: 4px;
+}
+
+.admin-permiss {
+    /* 权限div */
+    float: right;
+    position: relative;
+    padding: 10px;
+    top: 4px;
+    /* 设置弧度 */
+    border-radius: 20px 0 0 20px;
+    background-color: pink;
+}

+ 0 - 44
src/main/webapp/index.jsp

@@ -291,50 +291,6 @@
 
 <body>
 <div class="shell">
-<%--    <div class="container a-container" id="a-container">--%>
-<%--        <form action="" method="post" class="form" id="a-form">--%>
-<%--            <h2 class="form_title title">Create new account</h2>--%>
-<%--            <div class="form_icons">--%>
-
-<%--            </div>--%>
-<%--            <span class="form_span">It¡¯s quick and easy. </span>--%>
-<%--            <input type="text" class="form_input" placeholder="id" name="uid">--%>
-<%--            <input type="text" class="form_input" placeholder="Name" name="username">--%>
-<%--            <input type="text" class="form_input" placeholder="Email" name="email">--%>
-<%--            <input type="text" class="form_input" placeholder="Password" name="pwd">--%>
-<%--&lt;%&ndash;            <input type="text" class="form_input" placeholder="catptcha">&ndash;%&gt;--%>
-<%--&lt;%&ndash;            <%   //'A~Z' 65-90&ndash;%&gt;--%>
-<%--&lt;%&ndash;                //'0~9'  48-57&ndash;%&gt;--%>
-<%--&lt;%&ndash;                char[] c = {'0','1','2','3','4','5','6','7','8','9','Q','W','E','R','T','Y','U','I','O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M'};&ndash;%&gt;--%>
-<%--&lt;%&ndash;                int n;&ndash;%&gt;--%>
-<%--&lt;%&ndash;                for(int i=0;i<4;i++){&ndash;%&gt;--%>
-<%--&lt;%&ndash;                    n  = (int)(Math.random()*36);&ndash;%&gt;--%>
-<%--&lt;%&ndash;            %>&ndash;%&gt;--%>
-<%--&lt;%&ndash;            <%=c[n] %>&ndash;%&gt;--%>
-<%--&lt;%&ndash;            &lt;%&ndash;%>--%>
-<%--&lt;%&ndash;                }&ndash;%&gt;--%>
-
-<%--&lt;%&ndash;            %>&ndash;%&gt;--%>
-<%--            <br/>--%>
-<%--            <button class="form_button button submit">SIGN UP</button>--%>
-<%--        </form>--%>
-<%--    </div>--%>
-
-
-<%--    <div class="switch" id="switch-cnt">--%>
-<%--        <div class="switch_circle"></div>--%>
-<%--        <div class="switch_circle switch_circle-t"></div>--%>
-<%--        <div class="switch_container" id="a">--%>
-<%--            <h2 class="switch_title title" style="letter-spacing: 0;">Welcome Back£¡</h2>--%>
-<%--            <p class="switch_description description">Ready set?Let's Go!</p>--%>
-<%--        </div>--%>
-
-<%--        <div class="switch_container is-hidden" id="b">--%>
-<%--            <h2 class="switch_title title" style="letter-spacing: 0;">Hello Friend£¡</h2>--%>
-<%--            <p class="switch_description description">Crate a new account become on of us£¡</p>--%>
-<%--            <button class="switch_button button switch-btn">SIGN UP</button>--%>
-<%--        </div>--%>
-<%--    </div>--%>
 
     <h1 class="switch_title title" style="letter-spacing: 0;">choose your position</h1></br>
     <button class="form_button button submit" style="display:block;margin:0 auto"  onclick="location.href='userlogin.jsp'">user</button></br>

File diff suppressed because it is too large
+ 1 - 0
src/main/webapp/js/Jquery.js


+ 96 - 0
src/main/webapp/js/a003.js

@@ -0,0 +1,96 @@
+// 参数
+var indexText; //功能模块索引文本变量
+
+$(document).ready(main)
+
+function main() {
+    $(".div-ul").hide();
+    navUl();
+    divUl();
+    listClick();
+}
+
+/* -----------导航栏子菜单事件处理函数集------------ */
+function navUl() {
+    var navUl = $(".nav-ul").children(); //导航栏元素数组
+    for (var i = 0; i < navUl.length; i++) {
+        /* 弹出处理 */
+        navUlClick(navUl.eq(i));
+        /* 触摸处理 */
+        navUlHover(navUl.eq(i));
+    }
+}
+
+// 导航栏点击事件
+function navUlClick(navUiThis) {
+    $(".nav-li-div", navUiThis).click(function() {
+        listClick($(this));
+        if ($(".div-ul", navUiThis).is(':hidden')) {
+            $(".div-ul", navUiThis).show();
+        } else {
+            $(".div-ul", navUiThis).hide();
+        }
+        indexVal($(this), 1);
+    });
+}
+
+// 导航栏触摸事件
+function navUlHover(navUiThis) {
+    $(".nav-li-div", navUiThis).hover(function() {
+        $(this).css("background", "pink");
+    }, function() {
+        $(this).css("background", "#FFFFFF");
+    });
+}
+
+//子菜单处理函数
+function divUl() {
+    var divUl = $(".div-ul").children(); //子菜单元素数组
+    for (var i = 0; i < divUl.length; i++) {
+        //触摸事件
+        divUlHover(divUl.eq(i));
+        //点击事件
+        divUlClick(divUl.eq(i));
+    }
+}
+
+//子菜单触摸事件
+function divUlHover(divUlThis) {
+    divUlThis.hover(function() {
+        $(this).css("background", "pink");
+    }, function() {
+        $(this).css("background", "#FFFFFF")
+    })
+}
+
+//子菜单点击事件
+function divUlClick(divUlThis) {
+    divUlThis.click(function() {
+        indexVal(divUlThis, 2);
+    })
+}
+
+/* -----------功能模块处理函数集------------ */
+//索引html文本逻辑处理
+function indexVal(valThis, i) {
+    switch (i) {
+        case 1:
+            indexText = valThis.html();
+            break;
+        case 2:
+            var a = valThis.parents("li").children().eq(0).html();
+            indexText = a + ">" + valThis.html();
+            break;
+    }
+    $("#mIndex").html(indexText);
+}
+
+//ul点击切换list-style-type
+function listClick(listThis) {
+    var a = listThis.parents("li");
+    if (a.css("list-style-type") == "disclosure-closed") {
+        a.css("list-style-type", "disclosure-open");
+    } else {
+        a.css("list-style-type", "disclosure-closed");
+    }
+}

+ 82 - 0
src/main/webapp/semester.jsp

@@ -0,0 +1,82 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ page import="java.util.List" %>
+<%@ page import="com.bing.util.DateUtils" %>
+<%@ page import="com.bing.bean.Semester" %>
+<%@ page import="com.bing.dao.SemesterDAO" %>
+<%@ page import="java.util.ArrayList" %>
+<%@ page import="java.text.SimpleDateFormat" %>
+<%@ page import="java.util.Calendar" %>
+
+<%
+    int smid = 1; // 假设 smid 是 1,这个可以从请求参数中获取
+    SemesterDAO semesterDAO = new SemesterDAO();
+    Semester semester = semesterDAO.getSemester(smid);
+    List<String> dates = DateUtils.getWeeklyDates(semester.getSemesterStart(), semester.getSemesterEnd());
+    SimpleDateFormat sdf = new SimpleDateFormat("dd");
+    Calendar calendar = Calendar.getInstance();;
+%>
+
+<html>
+<head>
+    <title>学期表</title>
+</head>
+<body>
+
+<h1>学期表</h1>
+<table border="1">
+    <thead>
+    <tr>
+        <th>周数</th>
+        <th>星期一</th>
+        <th>星期二</th>
+        <th>星期三</th>
+        <th>星期四</th>
+        <th>星期五</th>
+        <th>星期六</th>
+        <th>星期日</th>
+    </tr>
+    </thead>
+    <tbody>
+    <%
+        int weekNumber = 1;
+        int dayOfWeek;
+        for (int i = 0; weekNumber <= dates.size(); weekNumber++) {
+    %>
+    <tr>
+        <td><%= weekNumber %></td>
+        <%
+            for (int j = 1; j <= 7 && i < dates.size(); j++) {
+                if (i < dates.size()) {
+                    String date = dates.get(i);
+                    System.out.println(date);
+                    
+                    calendar.setTime(new SimpleDateFormat("yyyy-MM-dd").parse(date));
+                    dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+                    // Adjust dayOfWeek to match Monday to Sunday (1 to 7)
+                    dayOfWeek = (dayOfWeek == Calendar.SUNDAY) ? 7 : dayOfWeek - 1;
+                    if (dayOfWeek == j) {
+                        String day = sdf.format(calendar.getTime());
+                        i++;
+        %>
+        <td><%= day %></td>
+        <%
+        } else {
+        %>
+        <td></td>
+        <%
+            }
+        } else {
+        %>
+        <td></td>
+        <%
+                }
+            }
+        %>
+    </tr>
+    <%
+        }
+    %>
+    </tbody>
+</table>
+</body>
+</html>

+ 22 - 34
src/main/webapp/user-register.jsp

@@ -284,45 +284,33 @@
         }
     </style>
     <script type="text/javascript">
-        /* 获取引擎对象(兼容IE6之前的游览器) */
-        function getXhr() {
-            var xhr;
-            try {
-                xhr = new XMLHttpRequest();
-            } catch (e) {
-                xhr = new ActiveObject("Microsoft.XMLHTTP");
-            }
-            return xhr;
-        }
-
-        /* 检查账号是否被注册 */
-        function checkName() {
-            var email = document.getElementById("email");
-            var value = email.value;
-            var emailtip = document.getElementById("emailtip");
-            //创建异步引擎对象
-            var xhr = getXhr();
-
-            //步骤一:打开引擎,method用于设置请求的方式:get或者post
-            /* url设置请求的路径,async设置是同步操作还是异步操作,默认是ture(异步) */
-            xhr.open("post", "RegisterServlet");
-            /* post方式提交需要设置请求头 */
-            xhr.setRequestHeader("Content-Type",
-                "application/x-www-form-urlencoded");
-            /* 步骤二:发送 */
-            xhr.send("email=" + value);
-            /* 步骤三:检测引擎的状态改变 */
-            xhr.onreadystatechange = function() {
-                /* 判断响应是否已经接收完成和判断是否正常响应 */
-                if (xhr.readyState == 4 && xhr.status == 200) {
-                    /* 接收响应的字符串信息 */
-                    emailtip.innerText = xhr.responseText;
+        function fun1() {
+            //1、创建一个异步请求对象
+            var xmlHttp = new XMLHttpRequest();
+            //2、为异步请求对象身上绑定【工作状态监听器】
+            xmlHttp.onreadystatechange = function () {
+                if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
+                    var data = xmlHttp.responseText;
+                    callBack(data);
                 }
-
+            };
+            //3、初始化异步请求对象
+            var param = document.getElementById("email").value;
+            xmlHttp.open("get","check?email=" + param,true);
+            //4、通知异步请求对象代替浏览器发送请求协议包
+            xmlHttp.send();
+        }
+        //局部刷新函数
+        function callBack(param) {
+            if(param == 0){
+                document.getElementById("myFont").innerText='用户名可以使用';
+            } else {
+                document.getElementById("myFont").innerText='亲,用户名已被占用';
             }
         }
     </script>
 
+
 </head>
 
 <body>

+ 2 - 2
target/untitled/META-INF/MANIFEST.MF

@@ -1,5 +1,5 @@
 Manifest-Version: 1.0
 Created-By: IntelliJ IDEA
-Built-By: 20344
-Build-Jdk: Oracle OpenJDK version 17.0.10
+Built-By: 86180
+Build-Jdk: Oracle OpenJDK version 1.8.0_261
 

Some files were not shown because too many files changed in this diff