📄 admin_mn_test.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*"%>
<%@ page import="jinghua.*"%>
<jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
</jsp:useBean>
<%!
Connection con=null;
PreparedStatement pstmt=null;
ResultSet rs=null;
%>
<%
try{
con=DBCon.getConnection();
String sql="SELECT `mn_test`.`id`, `mn_test`.`name`, `grade`.`Name` AS `gn` "+
"FROM `mn_test` INNER JOIN `grade` ON (`mn_test`.`grade_note` = `grade`.`note`) "+
"ORDER BY `mn_test`.`grade_note`, `mn_test`.`id`";
pstmt=con.prepareStatement(sql);
rs=pstmt.executeQuery();
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系统管理 |增加模拟考试</title>
<link rel="stylesheet" type="text/css" href="../css.css">
<style type="text/css">
<!--td { text-decoration: none; font-size: 10pt}
a { text-decoration: none; color: #000000}
a:hover { text-decoration: underline; color: #336699}
.font14 {
font-size: 14px;
line-height: 18px;
}
.l20 { line-height: 20px; font-size: 13px}
boder2 { border-color: black #6B90C5 #6B90C5; border-style: solid; border-top-width: 0px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px}
.boder2 {
border-top-width: 0px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: black;
border-right-color: #000000;
border-bottom-color: #000000;
border-left-color: #000000;
}
.boder1 { border: 1px solid #000000}
.font12 { font-size: 12px; line-height: 18px}
-->
</style>
</head>
<script language="javaScript">
<!--
Now = new Date();
NowDay = Now.getDate();
NowMonth = Now.getMonth();
NowYear = Now.getYear();
if (NowYear < 2000) NowYear += 1900; //for Netscape
//function for returning how many days there are in a month including leap years
function DaysInMonth(WhichMonth, WhichYear)
{
var DaysInMonth = 31;
if (WhichMonth == "04" || WhichMonth == "06" || WhichMonth == "09" || WhichMonth == "11") DaysInMonth = 30;
if (WhichMonth == "02") {
DaysInMonth = 28;
if (WhichMonth == "02" && (WhichYear/4) == Math.floor(WhichYear/4)) {
if ((WhichYear/100) != Math.floor(WhichYear/100)) {
DaysInMonth = 29;
}else{
if ((WhichYear/400) == Math.floor(WhichYear/400)) {
DaysInMonth = 29;
}
}
}
}
return DaysInMonth;
}
//function to change the available days in a months
function ChangeOptionDays(Which)
{
DaysObject = eval("document.forms['myform']." + Which + "day");
MonthObject = eval("document.forms['myform']." + Which + "month");
YearObject = eval("document.forms['myform']." + Which + "year");
Month = MonthObject[MonthObject.selectedIndex].text;
Year = YearObject[YearObject.selectedIndex].text;
DaysForThisSelection = DaysInMonth(Month, Year);
CurrentDaysInSelection = DaysObject.length;
if (CurrentDaysInSelection > DaysForThisSelection)
{
for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
{
DaysObject.options[DaysObject.options.length - 1] = null
}
}
if (DaysForThisSelection > CurrentDaysInSelection)
{
for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++)
{
NewOption = new Option(DaysObject.options.length + 1);
DaysObject.add(NewOption);
}
}
if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;
}
function ChangeOptionDays1(Which)
{
DaysObject = eval("document.forms['myform']." + Which + "day1");
MonthObject = eval("document.forms['myform']." + Which + "month1");
YearObject = eval("document.forms['myform']." + Which + "year1");
Month = MonthObject[MonthObject.selectedIndex].text;
Year = YearObject[YearObject.selectedIndex].text;
DaysForThisSelection = DaysInMonth(Month, Year);
CurrentDaysInSelection = DaysObject.length;
if (CurrentDaysInSelection > DaysForThisSelection)
{
for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
{
DaysObject.options[DaysObject.options.length - 1] = null
}
}
if (DaysForThisSelection > CurrentDaysInSelection)
{
for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++)
{
NewOption = new Option(DaysObject.options.length + 1);
DaysObject.add(NewOption);
}
}
if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;
}
//function to set options to today
function SetToToday(Which)
{
DaysObject = eval("document.forms['myform']." + Which + "Day");
MonthObject = eval("document.forms['myform']." + Which + "Month");
YearObject = eval("document.forms['myform']." + Which + "Year");
YearObject[0].selected = true;
MonthObject[NowMonth].selected = true;
ChangeOptionDays(Which);
DaysObject[NowDay-1].selected = true;
}
function checkdata(){
if( myform.selgrade.selectedIndex == 0) {
alert("请选择模拟考试的年级信息!")
return false;
}
if(myform.testname.value==""){
alert("请输入模拟考试的名称!");
return false;
}
return true;
}
function submitit(myform)
{
}
function saveit(myform)
{
if (confirm("是否保存所有修改?"))
{
myform.action="adminnianjisaveedit.asp";
myform.submit();
}
}
function delit(myform)
{
if (confirm("将删除所有选择的模拟考试数据?"))
{
myform.action="admin_mn_test_del.jsp";
myform.submit();
}
}
//-->
</script>
<body>
<div align="center">
<center>
<p align="left">当前位置: 系统管理 > 增加模拟考试</p>
<table cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="68%" id="AutoNumber2" border="1">
<form method="POST" action="admin_mn_test_add.jsp" name="myform" onSubmit="return checkdata()">
<tr class="trh">
<td width="100%" height="25" >
<p align="center"><b> <font color="#FFFFFF">增加模拟考试</font></b></td>
</tr>
<tr class="trh1">
<td width="100%" height="160" >
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -