📄 classs.jsp
字号:
<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html>
<head>
<link rel="STYLESHEET" type="text/css" href="css/shared.css">
<title>
classes
</title>
<script language="javascript">
var selectedTr = null;
function setTrColor(colorTr,color)
{
if(colorTr.tagName=="TR")
{
for(var i=0;i<colorTr.childNodes.length;i++)
{
colorTr.childNodes(i).style.backgroundColor = color;
colorTr.childNodes(i).children(0).style.backgroundColor = color;
}
}
}
function addclass()
{
document.classActionForm.operation.value = "add";
//alert(document.classActionForm.operation.value);
document.classActionForm.submit();
}
function deleteclass()
{
if(selectedTr!=null)
{ //alert(selectedTr.childNodes(0).children(1).value);
if(selectedTr.childNodes(0).children(1).value!=0&&selectedTr.childNodes(0).children(1).value!=null)
{
document.classActionForm.deleteUID.value = selectedTr.childNodes(0).children(1).value;
document.classActionForm.operation.value="delete";
classRows.removeChild(selectedTr);
selectedTr = null;
document.classActionForm.submit();
}else
{
classRows.removeChild(selectedTr);
selectedTr = null;
}
}
}
function saveclass()
{
document.classActionForm.operation.value = "save";
document.classActionForm.submit();
}
function onClickedCell()
{
var clickedcell = event.srcElement;
if(selectedTr!=null)
{
setTrColor(selectedTr,"#FFFFFF");
}
while(clickedcell.tagName!="TR")
{
clickedcell = clickedcell.parentElement;
}
selectedTr = clickedcell;
setTrColor(selectedTr,"#FFDDFF");
}
</script>
</head>
<body bgcolor="#ffffff">
<br>
<hr height=1 />
<h2 align="center">
课程管理
</h2>
<html:form method="post" action="classAction.do">
<html:hidden name="classActionForm" property="deleteUID" />
<html:hidden name="classActionForm" property="operation"/>
<table >
<tr>
<td class="tdframe">
<table class="table1">
<thead class="tdsectionbar">
<td align="center" class="tdsectionbar">课程名</td>
<td align="center" class="tdsectionbar">教师</td>
<td align="center" class="tdsectionbar" width="200">教室</td>
<td align="center" class="tdsectionbar" width="200">上课时间</td>
<td align="center" class="tdsectionbar" width="200">学分</td>
</thead>
<tbody id="classRows" onclick="onClickedCell()">
<logic:iterate name="classActionForm" property="classes" id="classes">
<tr class="tdsectionbar">
<td class="tdbg0">
<html:text indexed="true" name="classes" property="className" />
<html:hidden indexed="true" name="classes" property="classUID" />
</td>
<td class="tdbg0">
<html:text indexed="true" name="classes" property="classTeacher" />
</td>
<td class="tdbg0">
<html:text indexed="true" name="classes" property="classRoom" />
</td>
<td class="tdbg0">
<html:text indexed="true" name="classes" property="classTime" />
</td>
<td class="tdbg0">
<html:text indexed="true" name="classes" property="classCredit" />
</td>
<tr>
</logic:iterate>
</tbody>
</table>
</td>
</tr>
</table>
<br><br>
<input type="button" value="添加课程" class="button" onclick="addclass();"/>
<input type="button" value="删除课程" class="button" onclick="deleteclass();"/>
<input type="button" value="保存课程" class="button" onclick="saveclass();"/>
</html:form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -