2020.2.22 宿舍信息管理系统基本功能大体完成,暂时完结

main
ppdxzz 6 years ago
parent 32642d49d9
commit 584d62cd5b

@ -8,11 +8,87 @@
<component name="ChangeListManager">
<list default="true" id="8033210d-c341-4f39-a328-95fe94016f00" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/artifacts/hellossm_war2/hellossm_war.war" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/AdminController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/AdminController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/BasicController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/BasicController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/DormController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/DormController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/StudentController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/StudentController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/VisitorController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/controller/VisitorController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/dao/AdminDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/dao/AdminDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/dao/DormDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/dao/DormDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/dao/StudentDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/dao/StudentDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/domain/Admin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/domain/Admin.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/AdminService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/AdminService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/DormService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/DormService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/StudentService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/StudentService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/VisitorService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/VisitorService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/impl/AdminServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/impl/AdminServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/impl/DormServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/impl/DormServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/impl/StudentServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/impl/StudentServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/impl/VisitorServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/cn/ppdxzz/service/impl/VisitorServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-add.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-add.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-edit.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-edit.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/admin-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/dorm-add.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/dorm-add.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/dorm-edit.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/dorm-edit.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/dorm-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/dorm-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/look-dorm.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/look-dorm.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/main.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/main.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-add.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-add.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-edit.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-edit.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/student-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/visitor-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/visitor-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/visitor-success.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/visitor-success.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/welcome.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/jsp/welcome.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/webapp/error.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/error.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/AdminController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/AdminController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/BasicController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/BasicController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/DormController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/DormController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/StudentController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/StudentController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/VisitorController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/controller/VisitorController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/dao/AdminDao.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/dao/AdminDao.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/dao/DormDao.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/dao/DormDao.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/dao/StudentDao.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/dao/StudentDao.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/domain/Admin.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/domain/Admin.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/AdminService.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/AdminService.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/DormService.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/DormService.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/StudentService.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/StudentService.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/VisitorService.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/VisitorService.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/impl/AdminServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/impl/AdminServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/impl/DormServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/impl/DormServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/impl/StudentServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/impl/StudentServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/impl/VisitorServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/cn/ppdxzz/service/impl/VisitorServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/AdminController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/AdminController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/BasicController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/BasicController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/DormController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/DormController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/StudentController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/StudentController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/VisitorController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/controller/VisitorController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/dao/AdminDao.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/dao/AdminDao.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/dao/DormDao.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/dao/DormDao.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/dao/StudentDao.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/dao/StudentDao.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/domain/Admin.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/domain/Admin.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/AdminService.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/AdminService.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/DormService.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/DormService.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/StudentService.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/StudentService.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/VisitorService.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/VisitorService.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/impl/AdminServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/impl/AdminServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/impl/DormServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/impl/DormServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/impl/StudentServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/impl/StudentServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/impl/VisitorServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/classes/cn/ppdxzz/service/impl/VisitorServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/admin-add.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/admin-add.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/admin-edit.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/admin-edit.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/admin-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/admin-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/dorm-add.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/dorm-add.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/dorm-edit.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/dorm-edit.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/dorm-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/dorm-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/look-dorm.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/look-dorm.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/main.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/main.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/宿管系统SSM框架日进度.md" beforeDir="false" afterPath="$PROJECT_DIR$/宿管系统SSM框架日进度.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/student-add.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/student-add.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/student-edit.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/student-edit.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/student-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/student-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/visitor-list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/visitor-list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/visitor-success.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/visitor-success.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/welcome.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/WEB-INF/jsp/welcome.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/hellossm/error.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/target/hellossm/error.jsp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -275,7 +351,9 @@
<workItem from="1582099866858" duration="20535000" />
<workItem from="1582160800313" duration="3118000" />
<workItem from="1582163957936" duration="3456000" />
<workItem from="1582178854250" duration="13561000" />
<workItem from="1582178854250" duration="20605000" />
<workItem from="1582252359056" duration="41760000" />
<workItem from="1582339247647" duration="7825000" />
</task>
<servers />
</component>
@ -295,94 +373,94 @@
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="137" y="23" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1366.728@0.0.1366.728" timestamp="1582163405246" />
<state x="488" y="84" key="#com.intellij.ide.util.MemberChooser" timestamp="1582120640500">
<state x="488" y="84" key="#com.intellij.ide.util.MemberChooser" timestamp="1582292819498">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="488" y="84" key="#com.intellij.ide.util.MemberChooser/0.0.1366.728@0.0.1366.728" timestamp="1582120640500" />
<state x="488" y="84" key="#com.intellij.ide.util.MemberChooser/0.0.1366.728@0.0.1366.728" timestamp="1582292819498" />
<state x="435" y="110" key="FileChooserDialogImpl" timestamp="1582098741224">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="435" y="110" key="FileChooserDialogImpl/0.0.1366.728@0.0.1366.728" timestamp="1582098741224" />
<state width="1024" height="144" key="GridCell.Tab.0.bottom" timestamp="1582191789740">
<state width="1024" height="165" key="GridCell.Tab.0.bottom" timestamp="1582345277337">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582191789740" />
<state width="1024" height="144" key="GridCell.Tab.0.center" timestamp="1582191789740">
<state width="1024" height="165" key="GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582345277337" />
<state width="1024" height="165" key="GridCell.Tab.0.center" timestamp="1582345277337">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728" timestamp="1582191789740" />
<state width="1024" height="144" key="GridCell.Tab.0.left" timestamp="1582191789739">
<state width="1024" height="165" key="GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728" timestamp="1582345277337" />
<state width="1024" height="165" key="GridCell.Tab.0.left" timestamp="1582345277337">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728" timestamp="1582191789739" />
<state width="1024" height="144" key="GridCell.Tab.0.right" timestamp="1582191789740">
<state width="1024" height="165" key="GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728" timestamp="1582345277337" />
<state width="1024" height="165" key="GridCell.Tab.0.right" timestamp="1582345277337">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728" timestamp="1582191789740" />
<state width="1024" height="144" key="GridCell.Tab.1.bottom" timestamp="1582191789663">
<state width="1024" height="165" key="GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728" timestamp="1582345277337" />
<state width="1024" height="165" key="GridCell.Tab.1.bottom" timestamp="1582345277265">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.1.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582191789663" />
<state width="1024" height="144" key="GridCell.Tab.1.center" timestamp="1582191789663">
<state width="1024" height="165" key="GridCell.Tab.1.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582345277265" />
<state width="1024" height="165" key="GridCell.Tab.1.center" timestamp="1582345277265">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.1.center/0.0.1366.728@0.0.1366.728" timestamp="1582191789663" />
<state width="1024" height="144" key="GridCell.Tab.1.left" timestamp="1582191789663">
<state width="1024" height="165" key="GridCell.Tab.1.center/0.0.1366.728@0.0.1366.728" timestamp="1582345277265" />
<state width="1024" height="165" key="GridCell.Tab.1.left" timestamp="1582345277265">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.1.left/0.0.1366.728@0.0.1366.728" timestamp="1582191789663" />
<state width="1024" height="144" key="GridCell.Tab.1.right" timestamp="1582191789663">
<state width="1024" height="165" key="GridCell.Tab.1.left/0.0.1366.728@0.0.1366.728" timestamp="1582345277265" />
<state width="1024" height="165" key="GridCell.Tab.1.right" timestamp="1582345277265">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.1.right/0.0.1366.728@0.0.1366.728" timestamp="1582191789663" />
<state width="1024" height="144" key="GridCell.Tab.2.bottom" timestamp="1582191789664">
<state width="1024" height="165" key="GridCell.Tab.1.right/0.0.1366.728@0.0.1366.728" timestamp="1582345277265" />
<state width="1024" height="165" key="GridCell.Tab.2.bottom" timestamp="1582345277265">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.2.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582191789664" />
<state width="1024" height="144" key="GridCell.Tab.2.center" timestamp="1582191789664">
<state width="1024" height="165" key="GridCell.Tab.2.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582345277265" />
<state width="1024" height="165" key="GridCell.Tab.2.center" timestamp="1582345277265">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.2.center/0.0.1366.728@0.0.1366.728" timestamp="1582191789664" />
<state width="1024" height="144" key="GridCell.Tab.2.left" timestamp="1582191789663">
<state width="1024" height="165" key="GridCell.Tab.2.center/0.0.1366.728@0.0.1366.728" timestamp="1582345277265" />
<state width="1024" height="165" key="GridCell.Tab.2.left" timestamp="1582345277265">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.2.left/0.0.1366.728@0.0.1366.728" timestamp="1582191789663" />
<state width="1024" height="144" key="GridCell.Tab.2.right" timestamp="1582191789664">
<state width="1024" height="165" key="GridCell.Tab.2.left/0.0.1366.728@0.0.1366.728" timestamp="1582345277265" />
<state width="1024" height="165" key="GridCell.Tab.2.right" timestamp="1582345277265">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="144" key="GridCell.Tab.2.right/0.0.1366.728@0.0.1366.728" timestamp="1582191789664" />
<state width="1024" height="421" key="GridCell.Tab.3.bottom" timestamp="1582162174434">
<state width="1024" height="165" key="GridCell.Tab.2.right/0.0.1366.728@0.0.1366.728" timestamp="1582345277265" />
<state width="1024" height="261" key="GridCell.Tab.3.bottom" timestamp="1582341016030">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="421" key="GridCell.Tab.3.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582162174434" />
<state width="1024" height="421" key="GridCell.Tab.3.center" timestamp="1582162174434">
<state width="1024" height="261" key="GridCell.Tab.3.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582341016030" />
<state width="1024" height="261" key="GridCell.Tab.3.center" timestamp="1582341016030">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="421" key="GridCell.Tab.3.center/0.0.1366.728@0.0.1366.728" timestamp="1582162174434" />
<state width="1024" height="421" key="GridCell.Tab.3.left" timestamp="1582162174434">
<state width="1024" height="261" key="GridCell.Tab.3.center/0.0.1366.728@0.0.1366.728" timestamp="1582341016030" />
<state width="1024" height="261" key="GridCell.Tab.3.left" timestamp="1582341016030">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="421" key="GridCell.Tab.3.left/0.0.1366.728@0.0.1366.728" timestamp="1582162174434" />
<state width="1024" height="421" key="GridCell.Tab.3.right" timestamp="1582162174434">
<state width="1024" height="261" key="GridCell.Tab.3.left/0.0.1366.728@0.0.1366.728" timestamp="1582341016030" />
<state width="1024" height="261" key="GridCell.Tab.3.right" timestamp="1582341016030">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="421" key="GridCell.Tab.3.right/0.0.1366.728@0.0.1366.728" timestamp="1582162174434" />
<state width="1024" height="137" key="GridCell.Tab.4.bottom" timestamp="1581990081733">
<state width="1024" height="261" key="GridCell.Tab.3.right/0.0.1366.728@0.0.1366.728" timestamp="1582341016030" />
<state width="1024" height="261" key="GridCell.Tab.4.bottom" timestamp="1582341016031">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="137" key="GridCell.Tab.4.bottom/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1024" height="137" key="GridCell.Tab.4.center" timestamp="1581990081733">
<state width="1024" height="261" key="GridCell.Tab.4.bottom/0.0.1366.728@0.0.1366.728" timestamp="1582341016031" />
<state width="1024" height="261" key="GridCell.Tab.4.center" timestamp="1582341016030">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="137" key="GridCell.Tab.4.center/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1024" height="137" key="GridCell.Tab.4.left" timestamp="1581990081733">
<state width="1024" height="261" key="GridCell.Tab.4.center/0.0.1366.728@0.0.1366.728" timestamp="1582341016030" />
<state width="1024" height="261" key="GridCell.Tab.4.left" timestamp="1582341016030">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="137" key="GridCell.Tab.4.left/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1024" height="137" key="GridCell.Tab.4.right" timestamp="1581990081733">
<state width="1024" height="261" key="GridCell.Tab.4.left/0.0.1366.728@0.0.1366.728" timestamp="1582341016030" />
<state width="1024" height="261" key="GridCell.Tab.4.right" timestamp="1582341016030">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state width="1024" height="137" key="GridCell.Tab.4.right/0.0.1366.728@0.0.1366.728" timestamp="1581990081733" />
<state width="1024" height="261" key="GridCell.Tab.4.right/0.0.1366.728@0.0.1366.728" timestamp="1582341016030" />
<state width="1059" height="415" key="GridCell.Tab.5.bottom" timestamp="1581939297473">
<screen x="0" y="0" width="1366" height="728" />
</state>
@ -407,6 +485,10 @@
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="150" y="0" key="SettingsEditor/0.0.1366.728@0.0.1366.728" timestamp="1582098900996" />
<state x="404" y="105" width="540" height="524" key="StructurePopup" timestamp="1582342667910">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="404" y="105" width="540" height="524" key="StructurePopup/0.0.1366.728@0.0.1366.728" timestamp="1582342667910" />
<state x="253" y="13" key="com.intellij.javaee.view.ServerArtifactsDialog" timestamp="1581988671572">
<screen x="0" y="0" width="1366" height="728" />
</state>

@ -3,6 +3,7 @@ package cn.ppdxzz.controller;
import cn.ppdxzz.domain.Admin;
import cn.ppdxzz.service.AdminService;
import cn.ppdxzz.utils.MD5Util;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.github.pagehelper.PageInfo;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -88,7 +89,7 @@ public class AdminController {
*
*/
@RequestMapping(value = "/findAllAdmin")
public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size,HttpServletRequest request,HttpServletResponse response) throws Exception {
public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "5") int size,HttpServletRequest request,HttpServletResponse response) throws Exception {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
ModelAndView mv = new ModelAndView();
@ -165,12 +166,18 @@ public class AdminController {
if(admin.getUsername() == null || "".trim().equals(admin.getUsername())
|| admin.getPassword() == null ||"".trim().equals(admin.getPassword())
|| admin.getName() == null || "".trim().equals(admin.getName())
|| admin.getUid() == null || "".trim().equals(admin.getUid())
|| admin.getPhone() == null || "".trim().equals(admin.getPhone())
|| admin.getDescription() == null || "".trim().equals(admin.getDescription())) {
writer.write("false");
return;
}
}
Admin isNull = adminService.checkUid(admin.getUid());
if (isNull != null) {
writer.write("false");
return;
}
admin.setPassword(MD5Util.MD5EncodeUtf8(admin.getPassword()));
adminService.addAdmin(admin);
writer.write("true");
@ -196,6 +203,7 @@ public class AdminController {
}else {
if(admin.getUsername() == null || "".trim().equals(admin.getUsername())
|| admin.getName() == null || "".trim().equals(admin.getName())
|| admin.getUid() == null || "".trim().equals(admin.getUid())
|| admin.getPhone() == null || "".trim().equals(admin.getPhone())
|| admin.getDescription() == null || "".trim().equals(admin.getDescription())) {
writer.write("false");
@ -241,4 +249,24 @@ public class AdminController {
}
/**
*
* @param request
* @param response
* @throws Exception
*/
@RequestMapping("/checkUid")
public void checkUid(HttpServletRequest request,HttpServletResponse response) throws Exception {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
PrintWriter writer = response.getWriter();
String uid = request.getParameter("uid");
Admin admin = adminService.checkUid(uid);
if (admin != null) {
writer.write("true");//uid已被注册
return;
}
}
}

@ -1,10 +1,14 @@
package cn.ppdxzz.controller;
import org.springframework.stereotype.Controller;
/**
* Description:
*
* @Date: 2020/2/14 18:50
* @Author: PeiChen
*/
@Controller
public class BasicController {
}

@ -1,7 +1,11 @@
package cn.ppdxzz.controller;
import cn.ppdxzz.domain.Admin;
import cn.ppdxzz.domain.Dorm;
import cn.ppdxzz.domain.Student;
import cn.ppdxzz.service.AdminService;
import cn.ppdxzz.service.DormService;
import cn.ppdxzz.service.StudentService;
import com.github.pagehelper.PageInfo;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -13,10 +17,8 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.List;
/**
@ -30,12 +32,24 @@ import java.util.List;
public class DormController {
private DormService dormService;
private StudentService studentService;
private AdminService adminService;
@Autowired
public void setStudentService(StudentService studentService) {
this.studentService = studentService;
}
@Autowired
public void setDormService(DormService dormService) {
this.dormService = dormService;
}
@Autowired
public void setAdminService(AdminService adminService) {
this.adminService = adminService;
}
/**
* 宿
* @param page
@ -46,7 +60,7 @@ public class DormController {
* @throws Exception
*/
@RequestMapping("/findAll")
public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1")int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size, HttpServletRequest request, HttpServletResponse response) throws Exception {
public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1")int page, @RequestParam(name = "size", required = true, defaultValue = "5") int size, HttpServletRequest request, HttpServletResponse response) throws Exception {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
ModelAndView mv = new ModelAndView();
@ -110,7 +124,7 @@ public class DormController {
PrintWriter writer = response.getWriter();
String dorm_id = request.getParameter("dorm_id");
Dorm isNull = dormService.findByDormId(dorm_id);
if (isNull == null) {
if (isNull != null) {
writer.write("true");
return;
}
@ -179,16 +193,89 @@ public class DormController {
*/
@RequestMapping("/look")
public ModelAndView look(HttpServletRequest request) throws Exception {
String id = request.getParameter("id");
ModelAndView mv = new ModelAndView();
Dorm dorm = dormService.findById(id);
Dorm dorm = null;
String id = request.getParameter("id");
String uid = request.getParameter("uid");
if (id == null && uid != null) {
Student stu = studentService.findBySno(uid);
dorm = dormService.findByDormId(stu.getDorm_id());
}else if (id != null) {
dorm = dormService.findById(id);
}else {
return mv;
}
mv.addObject("dorm",dorm);
mv.setViewName("look-dorm");
return mv;
}
/**
* 宿
* @param request
* @return
* @throws Exception
*/
@RequestMapping("/byDorm_leader")
public ModelAndView find(HttpServletRequest request) throws Exception {
request.setCharacterEncoding("utf-8");
ModelAndView mv = new ModelAndView();
String uid = request.getParameter("uid");
String dorm_id = request.getParameter("dorm_id");
if (dorm_id != null) {
List<Student> studentsInfo = studentService.findByDormId(dorm_id, 1);
mv.addObject("studentsInfo",studentsInfo);
mv.setViewName("dormStudentsInfo");
return mv;
}
Student stu = studentService.findBySno(uid);
// Dorm dormInfo = dormService.findByDormId(stu.getDorm_id());
List<Student> studentsInfo = studentService.findByDormId(stu.getDorm_id(), 1);
// mv.addObject("dormInfo",dormInfo);
mv.addObject("studentsInfo",studentsInfo);
mv.setViewName("dormStudentsInfo");
return mv;
}
@RequestMapping("/byTeacher")
public ModelAndView find1(HttpServletRequest request) throws Exception {
ModelAndView mv = new ModelAndView();
String uid = request.getParameter("uid");
Admin admin = adminService.checkUid(uid);
List<Dorm> dorms = dormService.findByTeacher(admin.getName());
mv.addObject("dorms",dorms);
mv.setViewName("dormsTeacherInfo");
return mv;
}
/**
* teacher
* @param request
* @return
* @throws Exception
*/
@RequestMapping("/findStudent")
public ModelAndView findStudents(@RequestParam(name = "page", required = true, defaultValue = "1")int page, @RequestParam(name = "size", required = true, defaultValue = "5") int size,HttpServletRequest request) throws Exception {
request.setCharacterEncoding("utf-8");
ModelAndView mv = new ModelAndView();
List<Student> students = null;
String teacher = request.getParameter("name");
String keyword = request.getParameter("keyword");
System.out.println(keyword);
if (keyword == null || "".trim().equals(keyword) || keyword.length() == 0) {
students = studentService.findByTeacher(page,size,teacher);
}
if (keyword != null){
students = studentService.searchStudent(page,size,teacher,keyword);
}
PageInfo pageInfo = new PageInfo(students);
mv.addObject("pageInfo",pageInfo);
mv.setViewName("studentsTeacher");
return mv;
}

@ -46,7 +46,7 @@ public class StudentController {
* @throws Exception
*/
@RequestMapping("/findAll")
public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size, HttpServletRequest request, HttpServletResponse response) throws Exception {
public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "5") int size, HttpServletRequest request, HttpServletResponse response) throws Exception {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
ModelAndView mv = new ModelAndView();
@ -107,8 +107,17 @@ public class StudentController {
}
@RequestMapping("/addStudent")
public String addStudent() {
return "student-add";
public ModelAndView addStudent(HttpServletRequest request) throws Exception {
request.setCharacterEncoding("utf-8");
ModelAndView mv = new ModelAndView();
String dorm_id = request.getParameter("dorm_id");
if (dorm_id != null) {
mv.addObject("dorm_id",dorm_id);
mv.setViewName("dormStudent-add");
return mv;
}
mv.setViewName("student-add");
return mv;
}
/**
@ -124,6 +133,12 @@ public class StudentController {
writer.write("false");
return;
}
Student s = studentService.findBySno(student.getSno());
if (s != null) {
writer.write("false");
return;
}
boolean isAdd = studentService.add(student);
if (isAdd) {
writer.write("true");

@ -6,6 +6,7 @@ import com.github.pagehelper.PageInfo;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
@ -126,7 +127,7 @@ public class VisitorController {
* @throws Exception
*/
@RequestMapping("/findAll")
public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size,HttpServletRequest request,HttpServletResponse response) throws Exception {
public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "5") int size,HttpServletRequest request,HttpServletResponse response) throws Exception {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
ModelAndView mv = new ModelAndView();
@ -144,6 +145,21 @@ public class VisitorController {
return mv;
}
/**
* 访`
* @return
* @throws Exception
*/
@RequestMapping("/log")
public ModelAndView log(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "10") int size) throws Exception {
ModelAndView mv = new ModelAndView();
List<Visitor> logs = visitorService.log(page,size);
PageInfo pageInfo = new PageInfo(logs);
mv.addObject("pageInfo",pageInfo);
mv.setViewName("visitor-log");
return mv;
}
/**
* 访
* @param response

@ -57,7 +57,7 @@ public interface AdminDao {
* @param admin
* @throws Exception
*/
@Update("update admins set username= #{username},name = #{name}, phone = #{phone}, description = #{description} where id = #{id}")
@Update("update admins set username= #{username},name = #{name},uid = #{uid}, phone = #{phone}, description = #{description} where id = #{id}")
void updateAdmin(Admin admin) throws Exception;
/**
@ -65,7 +65,7 @@ public interface AdminDao {
* @param admin
* @throws Exception
*/
@Insert("insert into admins(username,password,name,phone,power,description) values (#{username},#{password},#{name},#{phone},#{power},#{description})")
@Insert("insert into admins(username,password,name,uid,phone,power,description) values (#{username},#{password},#{name},#{uid},#{phone},#{power},#{description})")
void addAdmin(Admin admin) throws Exception;
/**
@ -74,6 +74,15 @@ public interface AdminDao {
@Select("select * from admins where username = #{u_name}")
Boolean checkUserName(String u_name) throws Exception;
/**
* /
* @param uid
* @return
* @throws Exception
*/
@Select("select * from admins where uid = #{uid}")
Admin checkUid(String uid) throws Exception;
/**
*
* @param password
@ -85,7 +94,7 @@ public interface AdminDao {
//select * from admins where username like '%p%' or name like '%万%' or power like '%1%' or description like '%管理员%';
//模糊搜索管理员信息查询结果返回一个list集合
@Select("select * from admins where username like '%${keyword}%' or name like '%${keyword}%' or phone like '%${keyword}%' or power like '%${keyword}%' or description like '%${keyword}%' ")
@Select("select * from admins where username like '%${keyword}%' or name like '%${keyword}%' or uid like '%${keyword}%' or phone like '%${keyword}%' or power like '%${keyword}%' or description like '%${keyword}%' ")
List<Admin> serarchInfo(@Param(value="keyword") String keyword) throws Exception;
/**

@ -61,4 +61,8 @@ public interface DormDao {
@Select("select * from dorms where id = #{id}")
Dorm findById(String id) throws Exception;
@Select("select * from dorms where teacher = #{teacher}")
List<Dorm> findByTeacher(String teacher) throws Exception;
}

@ -63,8 +63,32 @@ public interface StudentDao {
@Update("update students set name = #{name},sex = #{sex},sno = #{sno},stu_class = #{stu_class},phone = #{phone},place = #{place},dorm_id = #{dorm_id},teacher = #{teacher},status = #{status} where id = #{id}")
void update(Student student) throws Exception;
/**
* 宿status宿
* @param dorm_id
* @return
* @throws Exception
*/
@Select("select * from students where dorm_id = #{dorm_id} and status = #{status}")
List<Student> findByDormId(@Param(value = "dorm_id") String dorm_id,@Param(value = "status") Integer status) throws Exception;
/**
* teacher
* @param teacher
* @return
* @throws Exception
*/
@Select("select * from students where teacher = #{teacher}")
List<Student> findByTeacher(String teacher) throws Exception;
/**
*
* @param teacher
* @param keyword
* @return
* @throws Exception
*/
@Select("select * from students where teacher = #{teacher} and sno = #{keyword} ")
List<Student> searchStudent(@Param(value = "teacher") String teacher,@Param(value = "keyword") String keyword) throws Exception;
}

@ -13,6 +13,7 @@ public class Admin implements Serializable {
private String username; //用户名
private String password; //密码
private String name; //姓名
private String uid; //学/工号
private String phone; //手机号
private int power; //是否开启权限
private String description; //描述
@ -20,11 +21,12 @@ public class Admin implements Serializable {
public Admin() {
}
public Admin(Integer id, String username, String password, String name, String phone, int power, String description) {
public Admin(Integer id, String username, String password, String name, String uid, String phone, int power, String description) {
this.id = id;
this.username = username;
this.password = password;
this.name = name;
this.uid = uid;
this.phone = phone;
this.power = power;
this.description = description;
@ -62,6 +64,14 @@ public class Admin implements Serializable {
this.name = name;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getPhone() {
return phone;
}
@ -93,6 +103,7 @@ public class Admin implements Serializable {
", username='" + username + '\'' +
", password='" + password + '\'' +
", name='" + name + '\'' +
", uid='" + uid + '\'' +
", phone='" + phone + '\'' +
", power=" + power +
", description='" + description + '\'' +

@ -37,4 +37,7 @@ public interface AdminService {
//返回一个携带所有管理员信息数据的InputStream输入流
InputStream getInputStream() throws Exception;
//校验学工号是否被注册
Admin checkUid(String uid) throws Exception;
}

@ -26,4 +26,6 @@ public interface DormService {
Dorm findByDormId(String dorm_id) throws Exception;
Dorm findById(String id) throws Exception;
List<Dorm> findByTeacher(String teacher) throws Exception;
}

@ -28,5 +28,9 @@ public interface StudentService {
//返回一个携带所有学生信息数据的InputStream输入流
InputStream getInputStream() throws Exception;
List<Student> findByDormId(String dorm_id,Integer status) throws Exception;
List<Student> findByTeacher(int page,int size,String teacher) throws Exception;
List<Student> searchStudent(int page,int size,String teacher,String keyword) throws Exception;
}

@ -23,4 +23,6 @@ public interface VisitorService {
InputStream getInputStream() throws Exception;
List<Visitor> log(int page,int size) throws Exception;
}

@ -119,6 +119,11 @@ public class AdminServiceImpl implements AdminService {
return list;
}
/**
*
* @param admin
* @throws Exception
*/
@Override
public void put_power(Admin admin) throws Exception {
adminDao.put_power(admin);
@ -132,7 +137,7 @@ public class AdminServiceImpl implements AdminService {
@Override
public InputStream getInputStream() throws Exception {
//Excel中的每列列名依次对应数据库的字段
String[] title = new String[]{"ID","用户名","密码","姓名","手机号","权限","描述"};
String[] title = new String[]{"ID","用户名","密码","姓名","学/工号","手机号","权限","描述"};
List<Admin> admins = adminDao.exportAdminInfo();
List<Object[]> dataList = new ArrayList<Object[]>();
for (int i = 0; i < admins.size(); i++) {
@ -141,9 +146,10 @@ public class AdminServiceImpl implements AdminService {
obj[1] = admins.get(i).getUsername();
obj[2] = admins.get(i).getPassword();
obj[3] = admins.get(i).getName();
obj[4] = admins.get(i).getPhone();
obj[5] = admins.get(i).getPower();
obj[6] = admins.get(i).getDescription();
obj[4] = admins.get(i).getUid();
obj[5] = admins.get(i).getPhone();
obj[6] = admins.get(i).getPower();
obj[7] = admins.get(i).getDescription();
dataList.add(obj);
}
WriteExcel ex = new WriteExcel(title, dataList);
@ -152,4 +158,14 @@ public class AdminServiceImpl implements AdminService {
return in;
}
/**
* /
* @param uid
* @return
* @throws Exception
*/
@Override
public Admin checkUid(String uid) throws Exception {
return adminDao.checkUid(uid);
}
}

@ -111,4 +111,9 @@ public class DormServiceImpl implements DormService {
public Dorm findById(String id) throws Exception {
return dormDao.findById(id);
}
@Override
public List<Dorm> findByTeacher(String teacher) throws Exception {
return dormDao.findByTeacher(teacher);
}
}

@ -124,4 +124,34 @@ public class StudentServiceImpl implements StudentService {
return excel.export();
}
/**
* 宿status
* @param dorm_id
* @param status
* @return
* @throws Exception
*/
@Override
public List<Student> findByDormId(String dorm_id, Integer status) throws Exception {
return studentDao.findByDormId(dorm_id, status);
}
/**
* teacher
* @param teacher
* @return
* @throws Exception
*/
@Override
public List<Student> findByTeacher(int page,int size,String teacher) throws Exception {
PageHelper.startPage(page,size);
return studentDao.findByTeacher(teacher);
}
@Override
public List<Student> searchStudent(int page, int size, String teacher, String keyword) throws Exception {
PageHelper.startPage(page,size);
return studentDao.searchStudent(teacher,keyword);
}
}

@ -98,4 +98,17 @@ public class VisitorServiceImpl implements VisitorService {
WriteExcel excel = new WriteExcel(title,datalist);
return excel.export();
}
/**
* 访
* @param page
* @param size
* @return
* @throws Exception
*/
@Override
public List<Visitor> log(int page,int size) throws Exception {
PageHelper.startPage(page,size);
return visitorDao.findAll();
}
}

@ -36,6 +36,12 @@
<input type="text" class="form-control" name="name" id="name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">学/工号:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="uid" id="uid">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">手机号:</label>
<div class="col-sm-8">
@ -96,6 +102,14 @@
});
});
});
$("#uid").change(function () {
var uid = $("#uid").val().trim();
$.get("${pageContext.request.contextPath}/checkUid",{"uid":uid},function (data) {
if (data) {
layer.msg('该学/工号已被注册,请重新输入');
}
});
});
function toValidate(){
var val = new validate({
/*rules里面是检验规则
@ -105,6 +119,7 @@
rules:{
username:"notEmpty",
name:"notEmpty",
uid:"notEmpty",
description:"notEmpty",
phone:"mobile",
password:"notEmpty"
@ -120,6 +135,7 @@
var username = $("#username").val().trim();
var password = $("#password").val().trim();
var name = $("#name").val().trim();
var uid = $("#uid").val().trim();
var phone = $("#phone").val().trim();
var power = $("#power").val().trim();
var description = $("#description").val().trim();
@ -128,12 +144,13 @@
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
username:$("#username").val().trim(),
password:$("#password").val().trim(),
name: $("#name").val().trim(),
phone: $("#phone").val().trim(),
power: $("#power").val().trim(),
description: $("#description").val().trim(),
username:username,
password:password,
name: name,
uid:uid,
phone: phone,
power: power,
description: description
},
type: "POST", //请求方式为POST
dataType: "json", //服务器返回的数据是什么类型

@ -32,38 +32,17 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">手机号:</label>
<label class="col-sm-2 control-label form-label">学/工号:</label>
<div class="col-sm-8">
<input type="text" value="${ad.phone}" class="form-control" name="phone" id="phone">
<input type="text" class="form-control" value="${ad.uid}" name="uid" id="uid">
</div>
</div>
<%--<div class="form-group">
<label class="col-sm-2 control-label form-label">权限:</label>
<div class="form-group">
<label class="col-sm-2 control-label form-label">手机号:</label>
<div class="col-sm-8">
<c:if test="${ad.power == 0}">
<select class="form-control" name="power" id="power">
<option value="0" selected>未授权</option>
<option value="1">授权</option>
<option value="2">超级权限</option>
</select>
</c:if>
<c:if test="${ad.power == 1}">
<select class="form-control" name="power" id="power">
<option value="0">未授权</option>
<option value="1" selected>授权</option>
<option value="2">超级权限</option>
</select>
</c:if>
<c:if test="${ad.power == 2}">
<select class="form-control" name="power" id="power">
<option value="0" selected>未授权</option>
<option value="1">授权</option>
<option value="2" selected>超级权限</option>
</select>
</c:if>
<input type="text" value="${ad.phone}" class="form-control" name="phone" id="phone">
</div>
</div>--%>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">描述:</label>
<div class="col-sm-8">
@ -88,6 +67,7 @@
*/
rules:{
name:"notEmpty",
uid:"notEmpty",
description:"notEmpty",
phone:"mobile",
},
@ -102,6 +82,7 @@
var id = $("#id").val().trim();
var username = $("#username").val().trim();
var name = $("#name").val().trim();
var uid = $("#uid").val().trim();
var phone = $("#phone").val().trim();
var description = $("#description").val().trim();
layer.confirm('确定要修改吗',function (index) {
@ -116,11 +97,12 @@
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
id:$("#id").val().trim(),
username:$("#username").val().trim(),
name: $("#name").val().trim(),
phone: $("#phone").val().trim(),
description: $("#description").val().trim(),
id:id,
username:username,
name:name,
uid:uid,
phone: phone,
description: description
},
type: "POST", //请求方式为POST
dataType: "json", //服务器返回的数据是什么类型

@ -34,11 +34,11 @@
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=4&keyword="+keyword;
location.href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=4";
location.href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=5";
});
</script>
</head>
@ -66,7 +66,7 @@
<button class="layui-btn" id="serarch_btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=4"><i class="layui-icon">&#xe669;</i></a>
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=5"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>
</div>
@ -82,6 +82,7 @@
<th style="text-align: center">ID</th>
<th style="text-align: center">用户名</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">学/工号</th>
<th style="text-align: center">联系方式</th>
<th style="text-align: center">权限</th>
<th style="text-align: center">描述</th>
@ -96,6 +97,7 @@
<td><%=j++%></td>
<td>${admin.username}</td>
<td>${admin.name}</td>
<td>${admin.uid}</td>
<td>${admin.phone}</td>
<td>${admin.power}</td>
<td>${admin.description}</td>
@ -120,8 +122,6 @@
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>

@ -110,13 +110,35 @@
<tr>
<td colspan="4">
<button type="button" id="add-dorm" class="btn btn-primary">确认添加</button>
<a type="button" href="${pageContext.request.contextPath}/dorm/findAll" class="btn btn-default">返回列表</a>
<a href="javascript:window.history.back(-1)" target="_self" class="btn btn-default">返回列表</a>
</td>
</tr>
</tbody>
</table>
</form>
<script>
$("#dorm3").change(function () {
var d1 = $("#dorm1").val();
var d2 = $("#dorm2").val();
var dorm3 = $("#dorm3").val().trim();
var dorm_id = d1+""+d2+""+dorm3;
$.ajax({
url: "${pageContext.request.contextPath}/dorm/isExist",//要请求的服务器url
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
dorm_id:dorm_id
},
type: "POST", //请求方式为POST
dataType: "json",
success:function(result){ //这个方法会在服务器执行成功时被调用 参数data就是服务器返回的值(现在是json类型)
//alert(result);
if(result){
layer.msg('该宿舍已存在,请重新注册!');
}
}
});
});
$("#add-dorm").click(function () {
var dorm3 = $("#dorm3").val().trim();
var dorm_intro = $("#dorm_intro").val().trim();
@ -152,11 +174,19 @@
success:function(result){ //这个方法会在服务器执行成功时被调用 参数data就是服务器返回的值(现在是json类型)
//alert(result);
if(result){
layer.msg('添加成功!');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll?page=1&size=4';},2000);
layer.msg('添加成功');
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byTeacher?uid=${sessionScope.adminInfo.uid}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll';},2000);
}else {
layer.msg('添加失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll?page=1&size=4';},2000);
layer.msg('添加失败,请重新添加');
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byTeacher?uid=${sessionScope.adminInfo.uid}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll';},2000);
}
}
});

@ -183,7 +183,7 @@
<tr>
<td colspan="4">
<button type="button" id="update-dorm" class="btn btn-warning">确认修改</button>
<a type="button" href="${pageContext.request.contextPath}/dorm/findAll" class="btn btn-default">返回列表</a>
<a href="javascript:window.history.back(-1)" target="_self" class="btn btn-default">返回列表</a>
</td>
</tr>
</tbody>
@ -224,10 +224,28 @@
//alert(result);
if(result){
layer.msg('修改成功!');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/look?uid=${sessionScope.adminInfo.uid}';},2000);
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byTeacher?uid=${sessionScope.adminInfo.uid}';},2000);
return flase;
}
if (${sessionScope.adminInfo.power > 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll';},2000);
}
}else {
layer.msg('修改失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/look?uid=${sessionScope.adminInfo.uid}';},2000);
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byTeacher?uid=${sessionScope.adminInfo.uid}';},2000);
return flase;
}
if (${sessionScope.adminInfo.power > 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll';},2000);
}
}
}
});

@ -34,11 +34,11 @@
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=4&keyword="+keyword;
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=4";
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=5";
});
</script>
</head>
@ -66,7 +66,7 @@
<button class="layui-btn" id="serarch_btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=4"><i class="layui-icon">&#xe669;</i></a>
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=5"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>
</div>
@ -109,6 +109,9 @@
<a title="查看详情" onclick="look(${dorm.id})" href="javascript:;">
<i class="layui-icon">&#xe60a;</i>
</a>
<a title="进入宿舍" href="${pageContext.request.contextPath}/dorm/byDorm_leader?dorm_id=${dorm.dorm_id}">
<i class="layui-icon">&#xe857;</i>
</a>
</td>
</c:if>
</c:forEach>
@ -121,8 +124,6 @@
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>

@ -0,0 +1,160 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/17
Time: 12:33
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/layer/layer.js"></script>
</head>
<body>
<form>
<table class="table" style="width: 100%;text-align: center;">
<tbody>
<tr>
<td>
<label for="name">姓名</label>
</td>
<td>
<input type="text" class="form-control" id="name" name="name" maxlength="10" required>
</td>
<td>
<label for="sex">性别</label>
</td>
<td>
<select class="form-control" name="sex" id="sex">
<option value="男" selected>男</option>
<option value="女">女</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="sno">学号</label>
</td>
<td>
<input type="text" name="sno" class="form-control" id="sno" aria-describedby="textHelp" maxlength="20" required>
</td>
<td>
<label for="stu_class">班级</label>
</td>
<td>
<input type="text" name="stu_class" class="form-control" id="stu_class" maxlength="30" required>
</td>
</tr>
<tr>
<td><label for="phone">联系方式</label></td>
<td>
<input type="text" name="phone" class="form-control" id="phone" minlength="11" maxlength="11" required>
</td>
<td><label for="place">家庭住址</label></td>
<td>
<input type="text" placeholder="请输入家庭详细地址" name="place" class="form-control" id="place" maxlength="30" required>
</td>
</tr>
<tr>
<td><label for="dorm_id">宿舍号</label></td>
<td colspan="3">
<input type="text" name="dorm_id" placeholder="" value="${dorm_id}" readonly maxlength="3" class="form-control" id="dorm_id" required>
</td>
</tr>
<tr>
<td><label for="teacher">育人导师</label></td>
<td colspan="3">
<select class="form-control" name="teacher" id="teacher">
<option value="小李" selected>小李</option>
<option value="小王">小王</option>
<option value="小赵">小赵</option>
<option value="小飞">小飞</option>
<option value="小张">小张</option>
</select>
</td>
</tr>
<tr>
<td><label for="status">状态</label></td>
<td colspan="3">
<select class="form-control" name="status" id="status">
<option value="0" disabled>禁用</option>
<option value="1" selected>激活</option>
</select>
</td>
</tr>
<tr>
<td colspan="4">
<button type="button" id="add-student" class="btn btn-primary">确认添加</button>
<a type="button" href="${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}" class="btn btn-default">返回列表</a>
</td>
</tr>
</tbody>
</table>
</form>
<script>
$(function () {
//ajax校验学号已被注册
$("#sno").change(function () {
//取sno的值
var sno = $(this).val();
//ajax异步请求
$.get("${pageContext.request.contextPath}/student/isExist",{"sno":sno},function (date) {
//$(".error").html(msg);
if (date) {
layer.msg('学号已被注册,请重新输入!');
return false;
}
});
});
});
$("#add-student").click(function () {
var name = $("#name").val().trim();
var sex = $("#sex").val().trim();
var sno = $("#sno").val().trim();
var stu_class = $("#stu_class").val().trim();
var phone = $("#phone").val().trim();
var place = $("#place").val().trim();
var dorm_id = $("#dorm_id").val().trim();
var teacher = $("#teacher").val().trim();
var status = $("#status").val().trim();
if (name == 0 || sex == 0 || sno == 0 || stu_class == 0 || phone == 0 || place == 0 || teacher == 0) {
layer.msg('字段不能为空');
return false;
}
$.ajax({
url: "${pageContext.request.contextPath}/student/add",//要请求的服务器url
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
name:name,
sex:sex,
sno: sno,
stu_class:stu_class,
phone: phone,
place: place,
dorm_id:dorm_id,
teacher:teacher,
status:status
},
type: "POST", //请求方式为POST
dataType: "json",
success:function(result){ //这个方法会在服务器执行成功时被调用 参数data就是服务器返回的值(现在是json类型)
//alert(result);
if(result){
layer.msg('添加成功!');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
}else {
layer.msg('添加失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
}
}
});
});
</script>
</body>
</html>

@ -0,0 +1,122 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/10
Time: 21:45
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 class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
function changePageSize() {
//获取下拉框的值
var pageSize = $("#changePageSize").val();
//向服务器发送请求,改变每页显示条数
location.href = "${pageContext.request.contextPath}/student/findAll?page=1&size="+ pageSize;
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=5";
});
</script>
</head>
<body>
<%--<div class="x-nav">
<span class="layui-breadcrumb">
<a href="">首页</a>
<a href="">演示</a>
<a>
<cite>导航元素</cite></a>
</span>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>--%>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<xblock>
<c:if test="${sessionScope.adminInfo.power == 1}">
<a href="${pageContext.request.contextPath}/student/addStudent?dorm_id=${studentsInfo.get(0).dorm_id}" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe654;</i>添加</a>
<a href="${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}" class="layui-btn layui-btn-normal">返回列表</a>
</c:if>
<c:if test="${sessionScope.adminInfo.power > 1}">
<a href="${pageContext.request.contextPath}/student/addStudent" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe654;</i>添加</a>
<a href="javascript:window.history.back(-1)" target="_self" class="layui-btn layui-btn-normal">返回列表</a>
</c:if>
<span class="x-right" style="line-height:40px">共有数据:${studentsInfo.size()} 条</span>
</xblock>
<div class="layui-card-body">
<table class="layui-table layui-form">
<thead>
<tr style="text-align: center">
<th style="text-align: center">ID</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">性别</th>
<th style="text-align: center">学号</th>
<th style="text-align: center">班级</th>
<th style="text-align: center">联系方式</th>
<th style="text-align: center">宿舍号</th>
<th style="text-align: center">育人导师</th>
<th style="text-align: center">状态</th>
<th style="text-align: center">操作</th>
</thead>
<tbody>
<%
int j = 1;
%>
<c:forEach items="${studentsInfo}" var="student">
<tr id="light" style="text-align: center">
<td><%=j++%></td>
<td>${student.name}</td>
<td>${student.sex}</td>
<td>${student.sno}</td>
<td>${student.stu_class}</td>
<td>${student.phone}</td>
<td>${student.dorm_id}</td>
<td>${student.teacher}</td>
<c:if test="${student.status == 1}">
<td><button class="layui-btn layui-btn-normal layui-btn-sm">已激活</button></td>
</c:if>
<c:if test="${student.status == 0}">
<td><button class="layui-btn layui-btn-danger layui-btn-sm">禁用</button></td>
</c:if>
<td class="td-manage">
<a title="编辑" href="${pageContext.request.contextPath}/student/editStudent?sno=${student.sno}">
<i class="layui-icon">&#xe642;</i>
</a>
</td>
</c:forEach>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

@ -0,0 +1,122 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/18
Time: 15:56
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 class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
function changePageSize() {
//获取下拉框的值
var pageSize = $("#changePageSize").val();
//向服务器发送请求,改变每页显示条数
location.href = "${pageContext.request.contextPath}/dorm/findAll?page=1&size="+ pageSize;
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=5";
});
</script>
</head>
<body>
<%--<div class="x-nav">
<span class="layui-breadcrumb">
<a href="">首页</a>
<a href="">演示</a>
<a>
<cite>导航元素</cite></a>
</span>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>--%>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<xblock>
<a href="${pageContext.request.contextPath}/dorm/toAdd" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe654;</i>添加</a>
<span class="x-right" style="line-height:40px">共有数据:${dorms.size()} 条</span>
</xblock>
<div class="layui-card-body">
<table class="layui-table layui-form" style="table-layout: fixed;width: 100%">
<thead>
<tr style="text-align: center">
<th style="text-align: center">ID</th>
<th style="text-align: center">宿舍号</th>
<th style="text-align: center">宿舍简介</th>
<th style="text-align: center">宿舍奖惩</th>
<th style="text-align: center">宿舍长</th>
<th style="text-align: center">育人导师</th>
<th style="text-align: center">操作</th>
</thead>
<tbody>
<%
int j = 1;
%>
<c:forEach items="${dorms}" var="dorm">
<tr id="light" style="text-align: center">
<td><%=j++%></td>
<td>${dorm.dorm_id}</td>
<td style="white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">${dorm.dorm_intro}</td>
<td style="white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">${dorm.dorm_rps}</td>
<td>${dorm.dorm_leader}</td>
<td>${dorm.teacher}</td>
<td class="td-manage">
<a title="更新信息" href="${pageContext.request.contextPath}/dorm/toUpdate?id=${dorm.id}">
<i class="layui-icon">&#xe642;</i>
</a>
<a title="查看详情" onclick="look(${dorm.id})" href="javascript:;">
<i class="layui-icon">&#xe60a;</i>
</a>
<a title="进入宿舍" href="${pageContext.request.contextPath}/dorm/byDorm_leader?dorm_id=${dorm.dorm_id}">
<i class="layui-icon">&#xe857;</i>
</a>
</td>
</c:forEach>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
//查看详情
function look(id) {
layer.open({
type: 2,
title:'宿舍详情',
skin: 'layui-layer-rim', //加上边框
area: ['800px', '430px'], //宽高
content: '${pageContext.request.contextPath}/dorm/look?id='+id
});
}
</script>
</body>
</html>

@ -45,6 +45,11 @@
<td style="text-align: center"><label>育人导师</label></td>
<td colspan="3" style="text-align: center">${dorm.teacher}</td>
</tr>
<c:if test="${sessionScope.adminInfo.power == 1}">
<tr>
<td colspan="4"><a class="btn btn-warning" href="${pageContext.request.contextPath}/dorm/toUpdate?id=${dorm.id}">去修改</a></td>
</tr>
</c:if>
</tbody>
</table>
</form>

@ -1,3 +1,4 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
Created by IntelliJ IDEA.
User: user
@ -25,7 +26,7 @@
<!-- 顶部开始 -->
<div class="container">
<div class="logo">
<a href="http://www.ppdxzz.cn">皮皮的小猪仔</a></div>
<a href="http://ppdxzz.cn">皮皮的小猪仔</a></div>
<div class="left_open">
<a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
</div>
@ -35,13 +36,13 @@
<dl class="layui-nav-child">
<!-- 二级菜单 -->
<dd>
<a onclick="xadmin.add_tab('消息','http://www.baidu.com')">消息</a>
<a onclick="power()">消息</a>
</dd>
<dd>
<a href="${pageContext.request.contextPath}">XXX</a>
<a onclick="power()">XXX</a>
</dd>
<dd>
<a href="${pageContext.request.contextPath}">XXX</a>
<a onclick="power()">XXX</a>
</dd>
</dl>
</li>
@ -50,7 +51,7 @@
<dl class="layui-nav-child">
<!-- 二级菜单 -->
<dd>
<a onclick="xadmin.add_tab('个人信息','http://www.baidu.com')">个人信息</a></dd>
<a onclick="power()">个人信息</a></dd>
<dd>
<a href="${pageContext.request.contextPath}/loginOut">切换帐号</a></dd>
<dd>
@ -58,7 +59,7 @@
</dl>
</li>
<li class="layui-nav-item to-index">
<a href="/">前台首页</a>
<a href="http://ppdxzz.cn"><i class="layui-icon">&#xe64c;</i>友情链接</a>
</li>
</ul>
</div>
@ -68,6 +69,7 @@
<div class="left-nav">
<div id="side-nav">
<ul id="nav">
<c:if test="${sessionScope.adminInfo.power > 2}">
<li>
<a href="javascript:;">
<i class="iconfont left-nav-li" lay-tips="学生管理">&#xe6b8;</i>
@ -76,12 +78,30 @@
</a>
<ul class="sub-menu">
<li>
<a onclick="xadmin.add_tab('学生信息','${pageContext.request.contextPath}/student/findAll?page=1&size=4')">
<a onclick="xadmin.add_tab('学生信息','${pageContext.request.contextPath}/student/findAll')">
<i class="iconfont">&#xe6a7;</i>
<cite>学生信息</cite></a>
</li>
</ul>
</li>
</c:if>
<c:if test="${sessionScope.adminInfo.power == 2}">
<li>
<a href="javascript:;">
<i class="iconfont left-nav-li" lay-tips="学生管理">&#xe6b8;</i>
<cite>学生管理</cite>
<i class="iconfont nav_right">&#xe697;</i>
</a>
<ul class="sub-menu">
<li>
<a onclick="xadmin.add_tab('学生信息','${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}')">
<i class="iconfont">&#xe6a7;</i>
<cite>学生信息</cite></a>
</li>
</ul>
</li>
</c:if>
<c:if test="${sessionScope.adminInfo.power > 2}">
<li>
<a href="javascript:;">
<i class="iconfont left-nav-li" lay-tips="管理员管理">&#xe726;</i>
@ -89,50 +109,55 @@
<i class="iconfont nav_right">&#xe697;</i></a>
<ul class="sub-menu">
<li>
<a onclick="xadmin.add_tab('管理员列表','${pageContext.request.contextPath}/findAllAdmin?page=1&size=4')">
<a onclick="xadmin.add_tab('管理员列表','${pageContext.request.contextPath}/findAllAdmin')">
<i class="iconfont">&#xe6a7;</i>
<cite>管理员列表</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('角色管理','admin-role.html')">
<i class="iconfont">&#xe6a7;</i>
<cite>角色管理</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('权限分类','admin-cate.html')">
<i class="iconfont">&#xe6a7;</i>
<cite>权限分类</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('权限管理','admin-rule.html')">
<a onclick="power()">
<i class="iconfont">&#xe6a7;</i>
<cite>权限管理</cite></a>
</li>
</ul>
</li>
</c:if>
<li>
<a href="javascript:;">
<i class="iconfont left-nav-li" lay-tips="宿舍管理">&#xe6b4;</i>
<cite>宿舍管理</cite>
<i class="iconfont nav_right">&#xe697;</i></a>
<ul class="sub-menu">
<li>
<a onclick="xadmin.add_tab('宿舍列表','${pageContext.request.contextPath}/dorm/findAll?page=1&size=4')">
<i class="iconfont">&#xe6a7;</i>
<cite>宿舍列表</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('人员信息','error.html')">
<i class="iconfont">&#xe6a7;</i>
<cite>人员信息</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('宿舍卫生','demo.html')">
<i class="iconfont">&#xe6a7;</i>
<cite>宿舍卫生</cite></a>
</li>
<c:if test="${sessionScope.adminInfo.power > 2}">
<li>
<a onclick="xadmin.add_tab('宿舍列表','${pageContext.request.contextPath}/dorm/findAll')">
<i class="iconfont">&#xe6a7;</i>
<cite>宿舍列表</cite></a>
</li>
</c:if>
<%--普通管理员只能看到自己所带宿舍的人员信息--%>
<c:if test="${sessionScope.adminInfo.power == 2}">
<li>
<a onclick="xadmin.add_tab('宿舍列表','${pageContext.request.contextPath}/dorm/byTeacher?uid=${sessionScope.adminInfo.uid}')">
<i class="iconfont">&#xe6a7;</i>
<cite>宿舍列表</cite></a>
</li>
</c:if>
<%--宿舍长只能看到自己所在宿舍的人员信息--%>
<c:if test="${sessionScope.adminInfo.power == 1}">
<li>
<a onclick="xadmin.add_tab('宿舍信息','${pageContext.request.contextPath}/dorm/look?uid=${sessionScope.adminInfo.uid}')">
<i class="iconfont">&#xe6a7;</i>
<cite>宿舍信息</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('人员信息','${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}')">
<i class="iconfont">&#xe6a7;</i>
<cite>人员信息</cite></a>
</li>
</c:if>
</ul>
</li>
<c:if test="${sessionScope.adminInfo.power > 2}">
<li>
<a href="javascript:;">
<i class="iconfont left-nav-li" lay-tips="访客管理">&#xe6f5;</i>
@ -152,7 +177,7 @@
</a>
</li>
<li>
<a onclick="xadmin.open('访客日志','unicode.html')">
<a onclick="xadmin.add_tab('访客日志','${pageContext.request.contextPath}/visitor/log?page=1&size=10')">
<i class="iconfont">&#xe6a7;</i>
<cite>访客日志</cite>
</a>
@ -166,17 +191,18 @@
<i class="iconfont nav_right">&#xe697;</i></a>
<ul class="sub-menu">
<li>
<a onclick="xadmin.add_tab('地图','echarts3.html')">
<a onclick="power()">
<i class="iconfont">&#xe6a7;</i>
<cite>地图</cite></a>
<cite>曲线统计</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('饼图','echarts4.html')">
<a onclick="power()">
<i class="iconfont">&#xe6a7;</i>
<cite>饼图</cite></a>
<cite>实时流量统计</cite></a>
</li>
</ul>
</li>
</c:if>
</ul>
</div>
</div>
@ -192,7 +218,9 @@
</ul>
<div class="layui-tab-content"><%--中间的空白面板--%>
<div class="layui-tab-item layui-show o_div" >
<jsp:include page="welcome.jsp"></jsp:include>
<c:if test="${sessionScope.adminInfo.power > 2}">
<jsp:include page="welcome.jsp"></jsp:include>
</c:if>
</div>
</div>
<div id="tab_show"></div>
@ -210,5 +238,9 @@
layer.msg('目前暂不支持网页端登记');
return false;
}
function power() {
layer.msg('该功能暂未开放');
return false;
}
</script>
</html>

@ -99,7 +99,7 @@
<tr>
<td colspan="4">
<button type="button" id="add-student" class="btn btn-primary">确认添加</button>
<a type="button" href="${pageContext.request.contextPath}/student/findAll" class="btn btn-default">返回列表</a>
<a href="javascript:window.history.back(-1)" target="_self" class="btn btn-default">返回列表</a>
</td>
</tr>
</tbody>
@ -165,10 +165,26 @@
//alert(result);
if(result){
layer.msg('添加成功!');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
return false;
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}else {
layer.msg('添加失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
return false;
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}
}
});

@ -101,7 +101,7 @@
</tr>
<tr>
<td><label for="status">状态</label></td>
<td>
<td colspan="3">
<c:if test="${stu.status == 0}">
<select class="form-control" name="status" id="status">
<option value="0" selected>禁用</option>
@ -120,7 +120,12 @@
<tr>
<td colspan="4">
<button type="button" id="edit-btn" class="btn btn-primary">确认修改</button>
<a type="button" class="btn btn-default" href="${pageContext.request.contextPath}/student/findAll?page=1&size=4">返回列表</a>
<c:if test="${sessionScope.adminInfo.power > 2}">
<a type="button" class="btn btn-default" href="${pageContext.request.contextPath}/student/findAll">返回列表</a>
</c:if>
<c:if test="${sessionScope.adminInfo.power == 1}">
<a type="button" class="btn btn-default" href="${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}">返回列表</a>
</c:if>
</td>
</tr>
</tbody>
@ -171,10 +176,26 @@
//alert(result);
if(result){
layer.msg('修改成功');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
return false;
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}else {
layer.msg('修改失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
return false;
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}
}
});

@ -34,11 +34,11 @@
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=4&keyword="+keyword;
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=4";
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=5";
});
</script>
</head>
@ -66,7 +66,7 @@
<button class="layui-btn" id="serarch_btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/student/findAll?page=1&size=4"><i class="layui-icon">&#xe669;</i></a>
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/student/findAll?page=1&size=5"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>
</div>
@ -132,8 +132,6 @@
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
@ -206,11 +204,11 @@
$.get("${pageContext.request.contextPath}/student/delete",{"sno":sno},function (data) {
if(data){
layer.msg('删除成功!',{icon:1,time:2000});
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}else {
layer.msg('删除失败!',{icon:1,time:2000});
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}
});
});

@ -0,0 +1,191 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/10
Time: 21:45
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 class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<%--<div class="x-nav">
<span class="layui-breadcrumb">
<a href="">首页</a>
<a href="">演示</a>
<a>
<cite>导航元素</cite></a>
</span>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>--%>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body ">
<%--<form id="myform" class="layui-form layui-col-space5">
<div class="layui-inline layui-show-xs-block">
<input class="layui-input" type="text" autocomplete="off" placeholder="请输入关键字" name="keyword" id="keyword" value="${param.keyword}">
</div>
<div class="layui-inline layui-show-xs-block">
<button class="layui-btn" id="search_btn" ><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size=5"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>--%>
</div>
<xblock>
<a href="${pageContext.request.contextPath}/student/addStudent" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe654;</i>添加</a>
<span class="x-right" style="line-height:40px">共有数据:${pageInfo.total} 条</span>
</xblock>
<div class="layui-card-body">
<table class="layui-table layui-form">
<thead>
<tr style="text-align: center">
<th style="text-align: center">ID</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">性别</th>
<th style="text-align: center">学号</th>
<th style="text-align: center">班级</th>
<th style="text-align: center">联系方式</th>
<th style="text-align: center">宿舍号</th>
<th style="text-align: center">育人导师</th>
<th style="text-align: center">状态</th>
<th style="text-align: center">操作</th>
</thead>
<tbody>
<%
int j = 1;
%>
<c:forEach items="${pageInfo.list}" var="student">
<tr id="light" style="text-align: center">
<td><%=j++%></td>
<td>${student.name}</td>
<td>${student.sex}</td>
<td>${student.sno}</td>
<td>${student.stu_class}</td>
<td>${student.phone}</td>
<td>${student.dorm_id}</td>
<td>${student.teacher}</td>
<c:if test="${student.status == 1}">
<td><button class="layui-btn layui-btn-normal layui-btn-sm">已激活</button></td>
</c:if>
<c:if test="${student.status == 0}">
<td><button class="layui-btn layui-btn-danger layui-btn-sm">禁用</button></td>
</c:if>
<td class="td-manage">
<a title="编辑" href="${pageContext.request.contextPath}/student/editStudent?sno=${student.sno}">
<i class="layui-icon">&#xe642;</i>
</a>
</td>
</c:forEach>
</tr>
</tbody>
</table>
</div>
<div class="pull-left">
<div class="form-group form-inline">
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
</select> 条
</div>
</div>
<c:choose>
<c:when test="${pageInfo.pages < 5}">
<c:set var="begin" value="1">
</c:set>
<c:set var="end" value="${pageInfo.pages}">
</c:set>
</c:when>
<c:when test="${pageInfo.pageNum <= 3}">
<c:set var="begin" value="1">
</c:set>
<c:set var="end" value="5">
</c:set>
</c:when>
<c:when test="${pageInfo.pageNum > 3 and pageInfo.pageNum <= pageInfo.pages-2}">
<c:set var="begin" value="${pageInfo.pageNum - 2}">
</c:set>
<c:set var="end" value="${pageInfo.pageNum + 2}">
</c:set>
</c:when>
<c:otherwise>
<c:set var="begin" value="${pageInfo.pages - 4}">
</c:set>
<c:set var="end" value="${pageInfo.pages}">
</c:set>
</c:otherwise>
</c:choose>
<div class="layui-card-body x-right" style="height: min-content">
<div class="page">
<div>
<a class="next" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size=${pageInfo.pageSize}&keyword=${param.keyword}">首页</a>
<c:if test="${pageInfo.pageNum > 1}">
<a class="prev" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=${pageInfo.pageNum-1}&size=${pageInfo.pageSize}&keyword=${param.keyword}">上一页</a>
</c:if>
<c:forEach var="i" begin="${begin}" end="${end}" step="1">
<c:if test="${pageInfo.pageNum == i}">
<span class="current">${i}</span>
</c:if>
<c:if test="${pageInfo.pageNum != i}">
<a class="num" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=${i}&size=${pageInfo.pageSize}&keyword=${param.keyword}">${i}</a>
</c:if>
</c:forEach>
<c:if test="${pageInfo.pageNum < pageInfo.pages}">
<a class="next" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=${pageInfo.pageNum+1}&size=${pageInfo.pageSize}&keyword=${param.keyword}">下一页</a>
</c:if>
<a class="next" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=${pageInfo.pages}&size=${pageInfo.pageSize}&keyword=${param.keyword}">尾页</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function changePageSize() {
//获取下拉框的值
var pageSize = $("#changePageSize").val();
//向服务器发送请求,改变每页显示条数
location.href = "${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size="+ pageSize;
}
$("#search_btn").click(function () {
alert(1234);
var keyword = $("#keyword").val();
alert(keyword);
alert("${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size=5&keyword="+keyword);
location.href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size=5";
});
</script>
</body>
</html>

@ -20,7 +20,7 @@
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/layer/layer.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
@ -34,11 +34,11 @@
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4&keyword="+keyword;
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4";
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=5";
});
</script>
</head>
@ -66,7 +66,7 @@
<button class="layui-btn" id="serarch_btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4"><i class="layui-icon">&#xe669;</i></a>
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=5"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>
</div>
@ -111,7 +111,7 @@
<td>${visitor.visit_result}</td>
<c:if test="${sessionScope.adminInfo.power > 2}">
<td class="td-manage">
<a title="注销访客" onclick="update(${visitor.id})" href="javascript:;">
<a title="注销访客" onclick="toUpdate('${visitor.id}');" href="javascript:;">
<i class="layui-icon">&#xe642;</i>
</a>
</td>
@ -126,8 +126,6 @@
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
@ -189,21 +187,6 @@
</div>
<script>
function update(id) {
layer.confirm('确定要注销此访客记录吗',function (index) {
layer.close(index);
$.get("${pageContext.request.contextPath}/visitor/updateStatus",{"id":id},function (data) {
if (data) {
layer.msg('注销成功');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/visitor/findAll?page=1&size=4';},2000);
}else {
layer.msg('系统繁忙,请联系系统管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/visitor/findAll?page=1&size=4';},2000);
}
});
});
}
//导出Excel操作
function exportInfo(power) {
if (power < 3) {
@ -215,6 +198,20 @@
layer.close(index);
});
}
function toUpdate(id) {
layer.confirm('确定要注销此访客记录吗',function (index) {
layer.close(index);
$.get("${pageContext.request.contextPath}/visitor/updateStatus",{"id":id},function (data) {
if (data) {
layer.msg('注销成功');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/visitor/findAll';},2000);
}else {
layer.msg('系统繁忙,请联系系统管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/visitor/findAll';},2000);
}
});
});
}
</script>
</body>
</html>

@ -0,0 +1,70 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/21
Time: 10:33
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>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Title</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui/css/layui.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui/css/modules/layer/default/layer.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
<legend>访客时间线</legend>
</fieldset>
<ul class="layui-timeline">
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<h3 class="layui-timeline-title" id="mytime"></h3>
<p>
访客日志共计:&nbsp;${pageInfo.total}&nbsp;条&emsp;当前显示:${pageInfo.size}&nbsp;条&emsp;&emsp;
<c:if test="${pageInfo.pageNum > 1}">
<a href="${pageContext.request.contextPath}/visitor/log?page=${pageInfo.pageNum - 1}&size=10">上一页</a>&emsp;&emsp;
</c:if>
<c:if test="${pageInfo.pageNum < pageInfo.pages}">
<a href="${pageContext.request.contextPath}/visitor/log?page=${pageInfo.pageNum + 1}&size=10">下一页</a>
</c:if>
</p>
<ul>
<c:forEach items="${pageInfo.list}" var="log">
<c:if test="${log.end_date == ''}">
<li>【${log.name}】于&nbsp;${log.begin_date}&nbsp;访问了${log.place},事因${log.visit_result},目前尚未离开</li>
</c:if>
<c:if test="${log.end_date != ''}">
<li>【${log.name}】于&nbsp;${log.begin_date}&nbsp;访问了${log.place},事因${log.visit_result},并与${log.end_date}离开</li>
</c:if>
</c:forEach>
</ul>
</div>
</li>
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<div class="layui-timeline-title">2020.02.21日志开启</div>
</div>
</li>
</ul>
<script>
function showTime(){
var nowtime =new Date();
var year=nowtime.getFullYear();
var month=nowtime.getMonth()+1;
var date=nowtime.getDate();
document.getElementById("mytime").innerText=year+"年"+month+"月"+date+"日";
}
setInterval("showTime()",1000*60);
</script>
</body>
</html>

@ -14,6 +14,6 @@
<h4 style="text-align: center;">恭喜您,来访登记成功!</h4>
<br>
<a href="${pageContext.request.contextPath}/visitor/login_out?id=${id}">注销登记</a>
<a href="${pageContext.request.contextPath}/visitor/login_out?id=${id}" style="text-align: center;">注销登记</a>
</body>
</html>

@ -9,9 +9,72 @@
<html>
<head>
<title>欢迎页面</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui/css/layui.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
</head>
<body>
<br><br><br>
&emsp;&emsp;&emsp;&emsp;&emsp;<h1>欢迎登录宿舍信息管理系统!</h1>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
<legend>系统时间</legend>
</fieldset>
<blockquote class="layui-elem-quote" id="mytime"></blockquote>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
<legend>控制面板</legend>
</fieldset>
<div style="padding: 20px; background-color: #F2F2F2;">
<div class="layui-row layui-col-space15">
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">CPU利用率</div>
<div class="layui-card-body">
CPU<br/>利用率
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">系统出入流量</div>
<div class="layui-card-body">
系统出入<br>流量
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">模块</div>
<div class="layui-card-body">
模块<br>待更新
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">模块</div>
<div class="layui-card-body">
模块<br>待更新
</div>
</div>
</div>
</div>
</div>
<script>
function showTime(){
var nowtime =new Date();
var year=nowtime.getFullYear();
var month=nowtime.getMonth()+1;
var date=nowtime.getDate();
var h = nowtime.getHours();
var m = nowtime.getMinutes();
var s = nowtime.getSeconds();
document.getElementById("mytime").innerText=year+"年"+month+"月"+date+"日"+" "+h+"时"+m+"分"+s+"秒";
}
setInterval("showTime()",1000);
</script>
</body>
</html>

@ -53,10 +53,10 @@
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
<!--<error-page>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>-->
</error-page>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>

@ -22,7 +22,7 @@
<div class="fly-panel">
<div class="fly-none">
<h2><i class="layui-icon layui-icon-404"></i></h2>
<p>页面或者数据被<a href="${pageContext.request.contextPath}/index.jsp"> 纸飞机 </a>运到火星了,啥都看不到了…</p>
<p>页面或者数据被纸飞机运到火星了,啥都看不到了…</p>
</div>
</div>
</div>

@ -36,6 +36,12 @@
<input type="text" class="form-control" name="name" id="name">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">学/工号:</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="uid" id="uid">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">手机号:</label>
<div class="col-sm-8">
@ -96,6 +102,14 @@
});
});
});
$("#uid").change(function () {
var uid = $("#uid").val().trim();
$.get("${pageContext.request.contextPath}/checkUid",{"uid":uid},function (data) {
if (data) {
layer.msg('该学/工号已被注册,请重新输入');
}
});
});
function toValidate(){
var val = new validate({
/*rules里面是检验规则
@ -105,6 +119,7 @@
rules:{
username:"notEmpty",
name:"notEmpty",
uid:"notEmpty",
description:"notEmpty",
phone:"mobile",
password:"notEmpty"
@ -120,6 +135,7 @@
var username = $("#username").val().trim();
var password = $("#password").val().trim();
var name = $("#name").val().trim();
var uid = $("#uid").val().trim();
var phone = $("#phone").val().trim();
var power = $("#power").val().trim();
var description = $("#description").val().trim();
@ -128,12 +144,13 @@
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
username:$("#username").val().trim(),
password:$("#password").val().trim(),
name: $("#name").val().trim(),
phone: $("#phone").val().trim(),
power: $("#power").val().trim(),
description: $("#description").val().trim(),
username:username,
password:password,
name: name,
uid:uid,
phone: phone,
power: power,
description: description
},
type: "POST", //请求方式为POST
dataType: "json", //服务器返回的数据是什么类型

@ -32,38 +32,17 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">手机号:</label>
<label class="col-sm-2 control-label form-label">学/工号:</label>
<div class="col-sm-8">
<input type="text" value="${ad.phone}" class="form-control" name="phone" id="phone">
<input type="text" class="form-control" value="${ad.uid}" name="uid" id="uid">
</div>
</div>
<%--<div class="form-group">
<label class="col-sm-2 control-label form-label">权限:</label>
<div class="form-group">
<label class="col-sm-2 control-label form-label">手机号:</label>
<div class="col-sm-8">
<c:if test="${ad.power == 0}">
<select class="form-control" name="power" id="power">
<option value="0" selected>未授权</option>
<option value="1">授权</option>
<option value="2">超级权限</option>
</select>
</c:if>
<c:if test="${ad.power == 1}">
<select class="form-control" name="power" id="power">
<option value="0">未授权</option>
<option value="1" selected>授权</option>
<option value="2">超级权限</option>
</select>
</c:if>
<c:if test="${ad.power == 2}">
<select class="form-control" name="power" id="power">
<option value="0" selected>未授权</option>
<option value="1">授权</option>
<option value="2" selected>超级权限</option>
</select>
</c:if>
<input type="text" value="${ad.phone}" class="form-control" name="phone" id="phone">
</div>
</div>--%>
</div>
<div class="form-group">
<label class="col-sm-2 control-label form-label">描述:</label>
<div class="col-sm-8">
@ -88,6 +67,7 @@
*/
rules:{
name:"notEmpty",
uid:"notEmpty",
description:"notEmpty",
phone:"mobile",
},
@ -102,6 +82,7 @@
var id = $("#id").val().trim();
var username = $("#username").val().trim();
var name = $("#name").val().trim();
var uid = $("#uid").val().trim();
var phone = $("#phone").val().trim();
var description = $("#description").val().trim();
layer.confirm('确定要修改吗',function (index) {
@ -116,11 +97,12 @@
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
id:$("#id").val().trim(),
username:$("#username").val().trim(),
name: $("#name").val().trim(),
phone: $("#phone").val().trim(),
description: $("#description").val().trim(),
id:id,
username:username,
name:name,
uid:uid,
phone: phone,
description: description
},
type: "POST", //请求方式为POST
dataType: "json", //服务器返回的数据是什么类型

@ -34,11 +34,11 @@
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=4&keyword="+keyword;
location.href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=4";
location.href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=5";
});
</script>
</head>
@ -66,7 +66,7 @@
<button class="layui-btn" id="serarch_btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=4"><i class="layui-icon">&#xe669;</i></a>
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/findAllAdmin?page=1&size=5"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>
</div>
@ -82,6 +82,7 @@
<th style="text-align: center">ID</th>
<th style="text-align: center">用户名</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">学/工号</th>
<th style="text-align: center">联系方式</th>
<th style="text-align: center">权限</th>
<th style="text-align: center">描述</th>
@ -96,6 +97,7 @@
<td><%=j++%></td>
<td>${admin.username}</td>
<td>${admin.name}</td>
<td>${admin.uid}</td>
<td>${admin.phone}</td>
<td>${admin.power}</td>
<td>${admin.description}</td>
@ -120,8 +122,6 @@
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>

@ -110,13 +110,35 @@
<tr>
<td colspan="4">
<button type="button" id="add-dorm" class="btn btn-primary">确认添加</button>
<a type="button" href="${pageContext.request.contextPath}/dorm/findAll" class="btn btn-default">返回列表</a>
<a href="javascript:window.history.back(-1)" target="_self" class="btn btn-default">返回列表</a>
</td>
</tr>
</tbody>
</table>
</form>
<script>
$("#dorm3").change(function () {
var d1 = $("#dorm1").val();
var d2 = $("#dorm2").val();
var dorm3 = $("#dorm3").val().trim();
var dorm_id = d1+""+d2+""+dorm3;
$.ajax({
url: "${pageContext.request.contextPath}/dorm/isExist",//要请求的服务器url
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
dorm_id:dorm_id
},
type: "POST", //请求方式为POST
dataType: "json",
success:function(result){ //这个方法会在服务器执行成功时被调用 参数data就是服务器返回的值(现在是json类型)
//alert(result);
if(result){
layer.msg('该宿舍已存在,请重新注册!');
}
}
});
});
$("#add-dorm").click(function () {
var dorm3 = $("#dorm3").val().trim();
var dorm_intro = $("#dorm_intro").val().trim();
@ -152,11 +174,19 @@
success:function(result){ //这个方法会在服务器执行成功时被调用 参数data就是服务器返回的值(现在是json类型)
//alert(result);
if(result){
layer.msg('添加成功!');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll?page=1&size=4';},2000);
layer.msg('添加成功');
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byTeacher?uid=${sessionScope.adminInfo.uid}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll';},2000);
}else {
layer.msg('添加失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll?page=1&size=4';},2000);
layer.msg('添加失败,请重新添加');
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byTeacher?uid=${sessionScope.adminInfo.uid}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll';},2000);
}
}
});

@ -183,7 +183,7 @@
<tr>
<td colspan="4">
<button type="button" id="update-dorm" class="btn btn-warning">确认修改</button>
<a type="button" href="${pageContext.request.contextPath}/dorm/findAll" class="btn btn-default">返回列表</a>
<a href="javascript:window.history.back(-1)" target="_self" class="btn btn-default">返回列表</a>
</td>
</tr>
</tbody>
@ -224,10 +224,28 @@
//alert(result);
if(result){
layer.msg('修改成功!');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/look?uid=${sessionScope.adminInfo.uid}';},2000);
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byTeacher?uid=${sessionScope.adminInfo.uid}';},2000);
return flase;
}
if (${sessionScope.adminInfo.power > 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll';},2000);
}
}else {
layer.msg('修改失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/look?uid=${sessionScope.adminInfo.uid}';},2000);
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byTeacher?uid=${sessionScope.adminInfo.uid}';},2000);
return flase;
}
if (${sessionScope.adminInfo.power > 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findAll';},2000);
}
}
}
});

@ -34,11 +34,11 @@
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=4&keyword="+keyword;
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=4";
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=5";
});
</script>
</head>
@ -66,7 +66,7 @@
<button class="layui-btn" id="serarch_btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=4"><i class="layui-icon">&#xe669;</i></a>
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=5"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>
</div>
@ -109,6 +109,9 @@
<a title="查看详情" onclick="look(${dorm.id})" href="javascript:;">
<i class="layui-icon">&#xe60a;</i>
</a>
<a title="进入宿舍" href="${pageContext.request.contextPath}/dorm/byDorm_leader?dorm_id=${dorm.dorm_id}">
<i class="layui-icon">&#xe857;</i>
</a>
</td>
</c:if>
</c:forEach>
@ -121,8 +124,6 @@
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>

@ -0,0 +1,160 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/17
Time: 12:33
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/layer/layer.js"></script>
</head>
<body>
<form>
<table class="table" style="width: 100%;text-align: center;">
<tbody>
<tr>
<td>
<label for="name">姓名</label>
</td>
<td>
<input type="text" class="form-control" id="name" name="name" maxlength="10" required>
</td>
<td>
<label for="sex">性别</label>
</td>
<td>
<select class="form-control" name="sex" id="sex">
<option value="男" selected>男</option>
<option value="女">女</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="sno">学号</label>
</td>
<td>
<input type="text" name="sno" class="form-control" id="sno" aria-describedby="textHelp" maxlength="20" required>
</td>
<td>
<label for="stu_class">班级</label>
</td>
<td>
<input type="text" name="stu_class" class="form-control" id="stu_class" maxlength="30" required>
</td>
</tr>
<tr>
<td><label for="phone">联系方式</label></td>
<td>
<input type="text" name="phone" class="form-control" id="phone" minlength="11" maxlength="11" required>
</td>
<td><label for="place">家庭住址</label></td>
<td>
<input type="text" placeholder="请输入家庭详细地址" name="place" class="form-control" id="place" maxlength="30" required>
</td>
</tr>
<tr>
<td><label for="dorm_id">宿舍号</label></td>
<td colspan="3">
<input type="text" name="dorm_id" placeholder="" value="${dorm_id}" readonly maxlength="3" class="form-control" id="dorm_id" required>
</td>
</tr>
<tr>
<td><label for="teacher">育人导师</label></td>
<td colspan="3">
<select class="form-control" name="teacher" id="teacher">
<option value="小李" selected>小李</option>
<option value="小王">小王</option>
<option value="小赵">小赵</option>
<option value="小飞">小飞</option>
<option value="小张">小张</option>
</select>
</td>
</tr>
<tr>
<td><label for="status">状态</label></td>
<td colspan="3">
<select class="form-control" name="status" id="status">
<option value="0" disabled>禁用</option>
<option value="1" selected>激活</option>
</select>
</td>
</tr>
<tr>
<td colspan="4">
<button type="button" id="add-student" class="btn btn-primary">确认添加</button>
<a type="button" href="${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}" class="btn btn-default">返回列表</a>
</td>
</tr>
</tbody>
</table>
</form>
<script>
$(function () {
//ajax校验学号已被注册
$("#sno").change(function () {
//取sno的值
var sno = $(this).val();
//ajax异步请求
$.get("${pageContext.request.contextPath}/student/isExist",{"sno":sno},function (date) {
//$(".error").html(msg);
if (date) {
layer.msg('学号已被注册,请重新输入!');
return false;
}
});
});
});
$("#add-student").click(function () {
var name = $("#name").val().trim();
var sex = $("#sex").val().trim();
var sno = $("#sno").val().trim();
var stu_class = $("#stu_class").val().trim();
var phone = $("#phone").val().trim();
var place = $("#place").val().trim();
var dorm_id = $("#dorm_id").val().trim();
var teacher = $("#teacher").val().trim();
var status = $("#status").val().trim();
if (name == 0 || sex == 0 || sno == 0 || stu_class == 0 || phone == 0 || place == 0 || teacher == 0) {
layer.msg('字段不能为空');
return false;
}
$.ajax({
url: "${pageContext.request.contextPath}/student/add",//要请求的服务器url
//这是一个对象表示请求的参数两个参数method=ajax&val=xxx服务器可以通过request.getParameter()来获取
//data:{method:"ajaxTest",val:value},
data: {
name:name,
sex:sex,
sno: sno,
stu_class:stu_class,
phone: phone,
place: place,
dorm_id:dorm_id,
teacher:teacher,
status:status
},
type: "POST", //请求方式为POST
dataType: "json",
success:function(result){ //这个方法会在服务器执行成功时被调用 参数data就是服务器返回的值(现在是json类型)
//alert(result);
if(result){
layer.msg('添加成功!');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
}else {
layer.msg('添加失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
}
}
});
});
</script>
</body>
</html>

@ -0,0 +1,122 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/10
Time: 21:45
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 class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
function changePageSize() {
//获取下拉框的值
var pageSize = $("#changePageSize").val();
//向服务器发送请求,改变每页显示条数
location.href = "${pageContext.request.contextPath}/student/findAll?page=1&size="+ pageSize;
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=5";
});
</script>
</head>
<body>
<%--<div class="x-nav">
<span class="layui-breadcrumb">
<a href="">首页</a>
<a href="">演示</a>
<a>
<cite>导航元素</cite></a>
</span>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>--%>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<xblock>
<c:if test="${sessionScope.adminInfo.power == 1}">
<a href="${pageContext.request.contextPath}/student/addStudent?dorm_id=${studentsInfo.get(0).dorm_id}" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe654;</i>添加</a>
<a href="${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}" class="layui-btn layui-btn-normal">返回列表</a>
</c:if>
<c:if test="${sessionScope.adminInfo.power > 1}">
<a href="${pageContext.request.contextPath}/student/addStudent" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe654;</i>添加</a>
<a href="javascript:window.history.back(-1)" target="_self" class="layui-btn layui-btn-normal">返回列表</a>
</c:if>
<span class="x-right" style="line-height:40px">共有数据:${studentsInfo.size()} 条</span>
</xblock>
<div class="layui-card-body">
<table class="layui-table layui-form">
<thead>
<tr style="text-align: center">
<th style="text-align: center">ID</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">性别</th>
<th style="text-align: center">学号</th>
<th style="text-align: center">班级</th>
<th style="text-align: center">联系方式</th>
<th style="text-align: center">宿舍号</th>
<th style="text-align: center">育人导师</th>
<th style="text-align: center">状态</th>
<th style="text-align: center">操作</th>
</thead>
<tbody>
<%
int j = 1;
%>
<c:forEach items="${studentsInfo}" var="student">
<tr id="light" style="text-align: center">
<td><%=j++%></td>
<td>${student.name}</td>
<td>${student.sex}</td>
<td>${student.sno}</td>
<td>${student.stu_class}</td>
<td>${student.phone}</td>
<td>${student.dorm_id}</td>
<td>${student.teacher}</td>
<c:if test="${student.status == 1}">
<td><button class="layui-btn layui-btn-normal layui-btn-sm">已激活</button></td>
</c:if>
<c:if test="${student.status == 0}">
<td><button class="layui-btn layui-btn-danger layui-btn-sm">禁用</button></td>
</c:if>
<td class="td-manage">
<a title="编辑" href="${pageContext.request.contextPath}/student/editStudent?sno=${student.sno}">
<i class="layui-icon">&#xe642;</i>
</a>
</td>
</c:forEach>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

@ -0,0 +1,122 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/18
Time: 15:56
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 class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
function changePageSize() {
//获取下拉框的值
var pageSize = $("#changePageSize").val();
//向服务器发送请求,改变每页显示条数
location.href = "${pageContext.request.contextPath}/dorm/findAll?page=1&size="+ pageSize;
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/dorm/findAll?page=1&size=5";
});
</script>
</head>
<body>
<%--<div class="x-nav">
<span class="layui-breadcrumb">
<a href="">首页</a>
<a href="">演示</a>
<a>
<cite>导航元素</cite></a>
</span>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>--%>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<xblock>
<a href="${pageContext.request.contextPath}/dorm/toAdd" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe654;</i>添加</a>
<span class="x-right" style="line-height:40px">共有数据:${dorms.size()} 条</span>
</xblock>
<div class="layui-card-body">
<table class="layui-table layui-form" style="table-layout: fixed;width: 100%">
<thead>
<tr style="text-align: center">
<th style="text-align: center">ID</th>
<th style="text-align: center">宿舍号</th>
<th style="text-align: center">宿舍简介</th>
<th style="text-align: center">宿舍奖惩</th>
<th style="text-align: center">宿舍长</th>
<th style="text-align: center">育人导师</th>
<th style="text-align: center">操作</th>
</thead>
<tbody>
<%
int j = 1;
%>
<c:forEach items="${dorms}" var="dorm">
<tr id="light" style="text-align: center">
<td><%=j++%></td>
<td>${dorm.dorm_id}</td>
<td style="white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">${dorm.dorm_intro}</td>
<td style="white-space: nowrap;text-overflow: ellipsis;overflow: hidden;">${dorm.dorm_rps}</td>
<td>${dorm.dorm_leader}</td>
<td>${dorm.teacher}</td>
<td class="td-manage">
<a title="更新信息" href="${pageContext.request.contextPath}/dorm/toUpdate?id=${dorm.id}">
<i class="layui-icon">&#xe642;</i>
</a>
<a title="查看详情" onclick="look(${dorm.id})" href="javascript:;">
<i class="layui-icon">&#xe60a;</i>
</a>
<a title="进入宿舍" href="${pageContext.request.contextPath}/dorm/byDorm_leader?dorm_id=${dorm.dorm_id}">
<i class="layui-icon">&#xe857;</i>
</a>
</td>
</c:forEach>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
//查看详情
function look(id) {
layer.open({
type: 2,
title:'宿舍详情',
skin: 'layui-layer-rim', //加上边框
area: ['800px', '430px'], //宽高
content: '${pageContext.request.contextPath}/dorm/look?id='+id
});
}
</script>
</body>
</html>

@ -45,6 +45,11 @@
<td style="text-align: center"><label>育人导师</label></td>
<td colspan="3" style="text-align: center">${dorm.teacher}</td>
</tr>
<c:if test="${sessionScope.adminInfo.power == 1}">
<tr>
<td colspan="4"><a class="btn btn-warning" href="${pageContext.request.contextPath}/dorm/toUpdate?id=${dorm.id}">去修改</a></td>
</tr>
</c:if>
</tbody>
</table>
</form>

@ -1,3 +1,4 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
Created by IntelliJ IDEA.
User: user
@ -25,7 +26,7 @@
<!-- 顶部开始 -->
<div class="container">
<div class="logo">
<a href="http://www.ppdxzz.cn">皮皮的小猪仔</a></div>
<a href="http://ppdxzz.cn">皮皮的小猪仔</a></div>
<div class="left_open">
<a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
</div>
@ -35,13 +36,13 @@
<dl class="layui-nav-child">
<!-- 二级菜单 -->
<dd>
<a onclick="xadmin.add_tab('消息','http://www.baidu.com')">消息</a>
<a onclick="power()">消息</a>
</dd>
<dd>
<a href="${pageContext.request.contextPath}">XXX</a>
<a onclick="power()">XXX</a>
</dd>
<dd>
<a href="${pageContext.request.contextPath}">XXX</a>
<a onclick="power()">XXX</a>
</dd>
</dl>
</li>
@ -50,7 +51,7 @@
<dl class="layui-nav-child">
<!-- 二级菜单 -->
<dd>
<a onclick="xadmin.add_tab('个人信息','http://www.baidu.com')">个人信息</a></dd>
<a onclick="power()">个人信息</a></dd>
<dd>
<a href="${pageContext.request.contextPath}/loginOut">切换帐号</a></dd>
<dd>
@ -58,7 +59,7 @@
</dl>
</li>
<li class="layui-nav-item to-index">
<a href="/">前台首页</a>
<a href="http://ppdxzz.cn"><i class="layui-icon">&#xe64c;</i>友情链接</a>
</li>
</ul>
</div>
@ -68,6 +69,7 @@
<div class="left-nav">
<div id="side-nav">
<ul id="nav">
<c:if test="${sessionScope.adminInfo.power > 2}">
<li>
<a href="javascript:;">
<i class="iconfont left-nav-li" lay-tips="学生管理">&#xe6b8;</i>
@ -76,12 +78,30 @@
</a>
<ul class="sub-menu">
<li>
<a onclick="xadmin.add_tab('学生信息','${pageContext.request.contextPath}/student/findAll?page=1&size=4')">
<a onclick="xadmin.add_tab('学生信息','${pageContext.request.contextPath}/student/findAll')">
<i class="iconfont">&#xe6a7;</i>
<cite>学生信息</cite></a>
</li>
</ul>
</li>
</c:if>
<c:if test="${sessionScope.adminInfo.power == 2}">
<li>
<a href="javascript:;">
<i class="iconfont left-nav-li" lay-tips="学生管理">&#xe6b8;</i>
<cite>学生管理</cite>
<i class="iconfont nav_right">&#xe697;</i>
</a>
<ul class="sub-menu">
<li>
<a onclick="xadmin.add_tab('学生信息','${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}')">
<i class="iconfont">&#xe6a7;</i>
<cite>学生信息</cite></a>
</li>
</ul>
</li>
</c:if>
<c:if test="${sessionScope.adminInfo.power > 2}">
<li>
<a href="javascript:;">
<i class="iconfont left-nav-li" lay-tips="管理员管理">&#xe726;</i>
@ -89,50 +109,55 @@
<i class="iconfont nav_right">&#xe697;</i></a>
<ul class="sub-menu">
<li>
<a onclick="xadmin.add_tab('管理员列表','${pageContext.request.contextPath}/findAllAdmin?page=1&size=4')">
<a onclick="xadmin.add_tab('管理员列表','${pageContext.request.contextPath}/findAllAdmin')">
<i class="iconfont">&#xe6a7;</i>
<cite>管理员列表</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('角色管理','admin-role.html')">
<i class="iconfont">&#xe6a7;</i>
<cite>角色管理</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('权限分类','admin-cate.html')">
<i class="iconfont">&#xe6a7;</i>
<cite>权限分类</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('权限管理','admin-rule.html')">
<a onclick="power()">
<i class="iconfont">&#xe6a7;</i>
<cite>权限管理</cite></a>
</li>
</ul>
</li>
</c:if>
<li>
<a href="javascript:;">
<i class="iconfont left-nav-li" lay-tips="宿舍管理">&#xe6b4;</i>
<cite>宿舍管理</cite>
<i class="iconfont nav_right">&#xe697;</i></a>
<ul class="sub-menu">
<li>
<a onclick="xadmin.add_tab('宿舍列表','${pageContext.request.contextPath}/dorm/findAll?page=1&size=4')">
<i class="iconfont">&#xe6a7;</i>
<cite>宿舍列表</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('人员信息','error.html')">
<i class="iconfont">&#xe6a7;</i>
<cite>人员信息</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('宿舍卫生','demo.html')">
<i class="iconfont">&#xe6a7;</i>
<cite>宿舍卫生</cite></a>
</li>
<c:if test="${sessionScope.adminInfo.power > 2}">
<li>
<a onclick="xadmin.add_tab('宿舍列表','${pageContext.request.contextPath}/dorm/findAll')">
<i class="iconfont">&#xe6a7;</i>
<cite>宿舍列表</cite></a>
</li>
</c:if>
<%--普通管理员只能看到自己所带宿舍的人员信息--%>
<c:if test="${sessionScope.adminInfo.power == 2}">
<li>
<a onclick="xadmin.add_tab('宿舍列表','${pageContext.request.contextPath}/dorm/byTeacher?uid=${sessionScope.adminInfo.uid}')">
<i class="iconfont">&#xe6a7;</i>
<cite>宿舍列表</cite></a>
</li>
</c:if>
<%--宿舍长只能看到自己所在宿舍的人员信息--%>
<c:if test="${sessionScope.adminInfo.power == 1}">
<li>
<a onclick="xadmin.add_tab('宿舍信息','${pageContext.request.contextPath}/dorm/look?uid=${sessionScope.adminInfo.uid}')">
<i class="iconfont">&#xe6a7;</i>
<cite>宿舍信息</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('人员信息','${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}')">
<i class="iconfont">&#xe6a7;</i>
<cite>人员信息</cite></a>
</li>
</c:if>
</ul>
</li>
<c:if test="${sessionScope.adminInfo.power > 2}">
<li>
<a href="javascript:;">
<i class="iconfont left-nav-li" lay-tips="访客管理">&#xe6f5;</i>
@ -152,7 +177,7 @@
</a>
</li>
<li>
<a onclick="xadmin.open('访客日志','unicode.html')">
<a onclick="xadmin.add_tab('访客日志','${pageContext.request.contextPath}/visitor/log?page=1&size=10')">
<i class="iconfont">&#xe6a7;</i>
<cite>访客日志</cite>
</a>
@ -166,17 +191,18 @@
<i class="iconfont nav_right">&#xe697;</i></a>
<ul class="sub-menu">
<li>
<a onclick="xadmin.add_tab('地图','echarts3.html')">
<a onclick="power()">
<i class="iconfont">&#xe6a7;</i>
<cite>地图</cite></a>
<cite>曲线统计</cite></a>
</li>
<li>
<a onclick="xadmin.add_tab('饼图','echarts4.html')">
<a onclick="power()">
<i class="iconfont">&#xe6a7;</i>
<cite>饼图</cite></a>
<cite>实时流量统计</cite></a>
</li>
</ul>
</li>
</c:if>
</ul>
</div>
</div>
@ -192,7 +218,9 @@
</ul>
<div class="layui-tab-content"><%--中间的空白面板--%>
<div class="layui-tab-item layui-show o_div" >
<jsp:include page="welcome.jsp"></jsp:include>
<c:if test="${sessionScope.adminInfo.power > 2}">
<jsp:include page="welcome.jsp"></jsp:include>
</c:if>
</div>
</div>
<div id="tab_show"></div>
@ -210,5 +238,9 @@
layer.msg('目前暂不支持网页端登记');
return false;
}
function power() {
layer.msg('该功能暂未开放');
return false;
}
</script>
</html>

@ -99,7 +99,7 @@
<tr>
<td colspan="4">
<button type="button" id="add-student" class="btn btn-primary">确认添加</button>
<a type="button" href="${pageContext.request.contextPath}/student/findAll" class="btn btn-default">返回列表</a>
<a href="javascript:window.history.back(-1)" target="_self" class="btn btn-default">返回列表</a>
</td>
</tr>
</tbody>
@ -165,10 +165,26 @@
//alert(result);
if(result){
layer.msg('添加成功!');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
return false;
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}else {
layer.msg('添加失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
return false;
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}
}
});

@ -101,7 +101,7 @@
</tr>
<tr>
<td><label for="status">状态</label></td>
<td>
<td colspan="3">
<c:if test="${stu.status == 0}">
<select class="form-control" name="status" id="status">
<option value="0" selected>禁用</option>
@ -120,7 +120,12 @@
<tr>
<td colspan="4">
<button type="button" id="edit-btn" class="btn btn-primary">确认修改</button>
<a type="button" class="btn btn-default" href="${pageContext.request.contextPath}/student/findAll?page=1&size=4">返回列表</a>
<c:if test="${sessionScope.adminInfo.power > 2}">
<a type="button" class="btn btn-default" href="${pageContext.request.contextPath}/student/findAll">返回列表</a>
</c:if>
<c:if test="${sessionScope.adminInfo.power == 1}">
<a type="button" class="btn btn-default" href="${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}">返回列表</a>
</c:if>
</td>
</tr>
</tbody>
@ -171,10 +176,26 @@
//alert(result);
if(result){
layer.msg('修改成功');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
return false;
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}else {
layer.msg('修改失败,请联系管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
if (${sessionScope.adminInfo.power == 1}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/byDorm_leader?uid=${sessionScope.adminInfo.uid}';},2000);
return false;
}
if (${sessionScope.adminInfo.power == 2}) {
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}';},2000);
return flase;
}
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}
}
});

@ -34,11 +34,11 @@
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=4&keyword="+keyword;
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=4";
location.href="${pageContext.request.contextPath}/student/findAll?page=1&size=5";
});
</script>
</head>
@ -66,7 +66,7 @@
<button class="layui-btn" id="serarch_btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/student/findAll?page=1&size=4"><i class="layui-icon">&#xe669;</i></a>
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/student/findAll?page=1&size=5"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>
</div>
@ -132,8 +132,6 @@
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
@ -206,11 +204,11 @@
$.get("${pageContext.request.contextPath}/student/delete",{"sno":sno},function (data) {
if(data){
layer.msg('删除成功!',{icon:1,time:2000});
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}else {
layer.msg('删除失败!',{icon:1,time:2000});
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll?page=1&size=4';},2000);
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/student/findAll';},2000);
}
});
});

@ -0,0 +1,191 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/10
Time: 21:45
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 class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<%--<div class="x-nav">
<span class="layui-breadcrumb">
<a href="">首页</a>
<a href="">演示</a>
<a>
<cite>导航元素</cite></a>
</span>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>--%>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body ">
<%--<form id="myform" class="layui-form layui-col-space5">
<div class="layui-inline layui-show-xs-block">
<input class="layui-input" type="text" autocomplete="off" placeholder="请输入关键字" name="keyword" id="keyword" value="${param.keyword}">
</div>
<div class="layui-inline layui-show-xs-block">
<button class="layui-btn" id="search_btn" ><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size=5"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>--%>
</div>
<xblock>
<a href="${pageContext.request.contextPath}/student/addStudent" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe654;</i>添加</a>
<span class="x-right" style="line-height:40px">共有数据:${pageInfo.total} 条</span>
</xblock>
<div class="layui-card-body">
<table class="layui-table layui-form">
<thead>
<tr style="text-align: center">
<th style="text-align: center">ID</th>
<th style="text-align: center">姓名</th>
<th style="text-align: center">性别</th>
<th style="text-align: center">学号</th>
<th style="text-align: center">班级</th>
<th style="text-align: center">联系方式</th>
<th style="text-align: center">宿舍号</th>
<th style="text-align: center">育人导师</th>
<th style="text-align: center">状态</th>
<th style="text-align: center">操作</th>
</thead>
<tbody>
<%
int j = 1;
%>
<c:forEach items="${pageInfo.list}" var="student">
<tr id="light" style="text-align: center">
<td><%=j++%></td>
<td>${student.name}</td>
<td>${student.sex}</td>
<td>${student.sno}</td>
<td>${student.stu_class}</td>
<td>${student.phone}</td>
<td>${student.dorm_id}</td>
<td>${student.teacher}</td>
<c:if test="${student.status == 1}">
<td><button class="layui-btn layui-btn-normal layui-btn-sm">已激活</button></td>
</c:if>
<c:if test="${student.status == 0}">
<td><button class="layui-btn layui-btn-danger layui-btn-sm">禁用</button></td>
</c:if>
<td class="td-manage">
<a title="编辑" href="${pageContext.request.contextPath}/student/editStudent?sno=${student.sno}">
<i class="layui-icon">&#xe642;</i>
</a>
</td>
</c:forEach>
</tr>
</tbody>
</table>
</div>
<div class="pull-left">
<div class="form-group form-inline">
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
</select> 条
</div>
</div>
<c:choose>
<c:when test="${pageInfo.pages < 5}">
<c:set var="begin" value="1">
</c:set>
<c:set var="end" value="${pageInfo.pages}">
</c:set>
</c:when>
<c:when test="${pageInfo.pageNum <= 3}">
<c:set var="begin" value="1">
</c:set>
<c:set var="end" value="5">
</c:set>
</c:when>
<c:when test="${pageInfo.pageNum > 3 and pageInfo.pageNum <= pageInfo.pages-2}">
<c:set var="begin" value="${pageInfo.pageNum - 2}">
</c:set>
<c:set var="end" value="${pageInfo.pageNum + 2}">
</c:set>
</c:when>
<c:otherwise>
<c:set var="begin" value="${pageInfo.pages - 4}">
</c:set>
<c:set var="end" value="${pageInfo.pages}">
</c:set>
</c:otherwise>
</c:choose>
<div class="layui-card-body x-right" style="height: min-content">
<div class="page">
<div>
<a class="next" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size=${pageInfo.pageSize}&keyword=${param.keyword}">首页</a>
<c:if test="${pageInfo.pageNum > 1}">
<a class="prev" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=${pageInfo.pageNum-1}&size=${pageInfo.pageSize}&keyword=${param.keyword}">上一页</a>
</c:if>
<c:forEach var="i" begin="${begin}" end="${end}" step="1">
<c:if test="${pageInfo.pageNum == i}">
<span class="current">${i}</span>
</c:if>
<c:if test="${pageInfo.pageNum != i}">
<a class="num" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=${i}&size=${pageInfo.pageSize}&keyword=${param.keyword}">${i}</a>
</c:if>
</c:forEach>
<c:if test="${pageInfo.pageNum < pageInfo.pages}">
<a class="next" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=${pageInfo.pageNum+1}&size=${pageInfo.pageSize}&keyword=${param.keyword}">下一页</a>
</c:if>
<a class="next" href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=${pageInfo.pages}&size=${pageInfo.pageSize}&keyword=${param.keyword}">尾页</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function changePageSize() {
//获取下拉框的值
var pageSize = $("#changePageSize").val();
//向服务器发送请求,改变每页显示条数
location.href = "${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size="+ pageSize;
}
$("#search_btn").click(function () {
alert(1234);
var keyword = $("#keyword").val();
alert(keyword);
alert("${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size=5&keyword="+keyword);
location.href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/dorm/findStudent?name=${sessionScope.adminInfo.name}&page=1&size=5";
});
</script>
</body>
</html>

@ -20,7 +20,7 @@
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/layer/layer.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
@ -34,11 +34,11 @@
}
$("#serarch_btn").click(function () {
var keyword = $("#keyword").val();
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4&keyword="+keyword;
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=5&keyword="+keyword;
});
$("#refresh").click(function () {
$("#myform").reset();
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4";
location.href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=5";
});
</script>
</head>
@ -66,7 +66,7 @@
<button class="layui-btn" id="serarch_btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
</div>
<div class="layui-inline layui-show-xs-block x-right">
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=4"><i class="layui-icon">&#xe669;</i></a>
<a class="layui-btn layui-btn-normal" href="${pageContext.request.contextPath}/visitor/findAll?page=1&size=5"><i class="layui-icon">&#xe669;</i></a>
</div>
</form>
</div>
@ -111,7 +111,7 @@
<td>${visitor.visit_result}</td>
<c:if test="${sessionScope.adminInfo.power > 2}">
<td class="td-manage">
<a title="注销访客" onclick="update(${visitor.id})" href="javascript:;">
<a title="注销访客" onclick="toUpdate('${visitor.id}');" href="javascript:;">
<i class="layui-icon">&#xe642;</i>
</a>
</td>
@ -126,8 +126,6 @@
共&nbsp;${pageInfo.pages}&nbsp;页&emsp;当前页:${pageInfo.pageNum}&nbsp;/&nbsp;${pageInfo.pages}&emsp; 每页
<select class="form-control" id="changePageSize" onchange="changePageSize()">
<option value="1">${pageInfo.size}</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
@ -189,21 +187,6 @@
</div>
<script>
function update(id) {
layer.confirm('确定要注销此访客记录吗',function (index) {
layer.close(index);
$.get("${pageContext.request.contextPath}/visitor/updateStatus",{"id":id},function (data) {
if (data) {
layer.msg('注销成功');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/visitor/findAll?page=1&size=4';},2000);
}else {
layer.msg('系统繁忙,请联系系统管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/visitor/findAll?page=1&size=4';},2000);
}
});
});
}
//导出Excel操作
function exportInfo(power) {
if (power < 3) {
@ -215,6 +198,20 @@
layer.close(index);
});
}
function toUpdate(id) {
layer.confirm('确定要注销此访客记录吗',function (index) {
layer.close(index);
$.get("${pageContext.request.contextPath}/visitor/updateStatus",{"id":id},function (data) {
if (data) {
layer.msg('注销成功');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/visitor/findAll';},2000);
}else {
layer.msg('系统繁忙,请联系系统管理员');
setTimeout(function () {window.location.href='${pageContext.request.contextPath}/visitor/findAll';},2000);
}
});
});
}
</script>
</body>
</html>

@ -0,0 +1,70 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2020/2/21
Time: 10:33
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>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Title</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui/css/layui.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui/css/modules/layer/default/layer.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
<legend>访客时间线</legend>
</fieldset>
<ul class="layui-timeline">
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<h3 class="layui-timeline-title" id="mytime"></h3>
<p>
访客日志共计:&nbsp;${pageInfo.total}&nbsp;条&emsp;当前显示:${pageInfo.size}&nbsp;条&emsp;&emsp;
<c:if test="${pageInfo.pageNum > 1}">
<a href="${pageContext.request.contextPath}/visitor/log?page=${pageInfo.pageNum - 1}&size=10">上一页</a>&emsp;&emsp;
</c:if>
<c:if test="${pageInfo.pageNum < pageInfo.pages}">
<a href="${pageContext.request.contextPath}/visitor/log?page=${pageInfo.pageNum + 1}&size=10">下一页</a>
</c:if>
</p>
<ul>
<c:forEach items="${pageInfo.list}" var="log">
<c:if test="${log.end_date == ''}">
<li>【${log.name}】于&nbsp;${log.begin_date}&nbsp;访问了${log.place},事因${log.visit_result},目前尚未离开</li>
</c:if>
<c:if test="${log.end_date != ''}">
<li>【${log.name}】于&nbsp;${log.begin_date}&nbsp;访问了${log.place},事因${log.visit_result},并与${log.end_date}离开</li>
</c:if>
</c:forEach>
</ul>
</div>
</li>
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<div class="layui-timeline-title">2020.02.21日志开启</div>
</div>
</li>
</ul>
<script>
function showTime(){
var nowtime =new Date();
var year=nowtime.getFullYear();
var month=nowtime.getMonth()+1;
var date=nowtime.getDate();
document.getElementById("mytime").innerText=year+"年"+month+"月"+date+"日";
}
setInterval("showTime()",1000*60);
</script>
</body>
</html>

@ -14,6 +14,6 @@
<h4 style="text-align: center;">恭喜您,来访登记成功!</h4>
<br>
<a href="${pageContext.request.contextPath}/visitor/login_out?id=${id}">注销登记</a>
<a href="${pageContext.request.contextPath}/visitor/login_out?id=${id}" style="text-align: center;">注销登记</a>
</body>
</html>

@ -9,9 +9,72 @@
<html>
<head>
<title>欢迎页面</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui/css/layui.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.1.1.js"></script>
</head>
<body>
<br><br><br>
&emsp;&emsp;&emsp;&emsp;&emsp;<h1>欢迎登录宿舍信息管理系统!</h1>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
<legend>系统时间</legend>
</fieldset>
<blockquote class="layui-elem-quote" id="mytime"></blockquote>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
<legend>控制面板</legend>
</fieldset>
<div style="padding: 20px; background-color: #F2F2F2;">
<div class="layui-row layui-col-space15">
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">CPU利用率</div>
<div class="layui-card-body">
CPU<br/>利用率
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">系统出入流量</div>
<div class="layui-card-body">
系统出入<br>流量
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">模块</div>
<div class="layui-card-body">
模块<br>待更新
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-card">
<div class="layui-card-header">模块</div>
<div class="layui-card-body">
模块<br>待更新
</div>
</div>
</div>
</div>
</div>
<script>
function showTime(){
var nowtime =new Date();
var year=nowtime.getFullYear();
var month=nowtime.getMonth()+1;
var date=nowtime.getDate();
var h = nowtime.getHours();
var m = nowtime.getMinutes();
var s = nowtime.getSeconds();
document.getElementById("mytime").innerText=year+"年"+month+"月"+date+"日"+" "+h+"时"+m+"分"+s+"秒";
}
setInterval("showTime()",1000);
</script>
</body>
</html>

@ -53,10 +53,10 @@
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
<!--<error-page>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>-->
</error-page>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>

@ -22,7 +22,7 @@
<div class="fly-panel">
<div class="fly-none">
<h2><i class="layui-icon layui-icon-404"></i></h2>
<p>页面或者数据被<a href="${pageContext.request.contextPath}/index.jsp"> 纸飞机 </a>运到火星了,啥都看不到了…</p>
<p>页面或者数据被纸飞机运到火星了,啥都看不到了…</p>
</div>
</div>
</div>

@ -10,6 +10,7 @@
8. 2020.2.18今天实现学生信息添加的时候使用ajax异步去请求后台的时候后台返回的结果前台接受不到捣鼓了一上午才发现原来是因为一个提交方式为“submit”使用异步应该将其设置为“button”特将其错误记录于此。下午结束了学生模块的基本操作进一步开发访客模块后台均已写好待设计前台访客来访记录表页面。
9. 2020.2.19基本完成了访客的CRUD模块以及导出功能前台实现访客登记但还未实现访客日志的功能后续会增加上此功能。
10. 2020.2.20,完成了宿舍模块的基本功能,同时新增了功能,表格内容过多会显示省略号,需点击详情页才能完整查看宿舍内容过长信息。
11. 2020.2.22,基本的功能实现已经大体完成,此项目就暂时完结。

Loading…
Cancel
Save