📄 addtrainstep1.jsp
字号:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="../incoming/Common.jsp"%>
<%@ include file="../Check.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<title><%=title%></title>
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../css/calendar-win2k-1.css" type="text/css" media="screen">
<script type="text/javascript" src="../js/calendar.js"></script>
<script type="text/javascript" src="../js/calendar-en.js"></script>
<script type="text/javascript" src="../js/calendar-setup.js"></script>
<script Language="JavaScript">
function check_input(theForm)
{
if (theForm.trainname.value == "")
{
alert("请输入培训名称。");
theForm.trainname.focus();
return (false);
}
if (theForm.trainwhat.value == "")
{
alert("请输入培训内容。");
theForm.trainwhat.focus();
return (false);
}
if (theForm.startdate.value == "")
{
alert("请输入开始日期。");
theForm.startdate.focus();
return (false);
}
if (theForm.enddate.value == "")
{
alert("请输入结束日期。");
theForm.enddate.focus();
return (false);
}
if (theForm.trainorgan.value == "")
{
alert("请输入培训单位。");
theForm.trainorgan.focus();
return (false);
}
if (theForm.trainresult.value == "")
{
alert("请输入培训结果。");
theForm.trainresult.focus();
return (false);
}
return (true);
}
var curRowSource=null;
var curRowTarget=null;
function selectRow(obj){
if(curRowSource){
curRowSource.style.backgroundColor="#FFFFFF";
curRowSource.style.color="#000000";
}
obj.style.backgroundColor="#3366FF";
obj.style.color="#FFFFFF";
curRowSource=obj;
var btns=document.getElementsByName("btn");
alert("a");
btns[0].disabled=false;
}
function selectRow1(obj){
if(curRowTarget){
curRowTarget.style.backgroundColor="#FFFFFF";
curRowTarget.style.color="#000000";
}
obj.style.backgroundColor="#3366FF";
obj.style.color="#FFFFFF";
curRowTarget=obj;
alert("b");
var btns=document.getElementsByName("btn");
btns[2].disabled=false;
}
function Add(tbSou,tbTar){
var rowSou=null;
var newRow=tbTar.insertRow();
if(tbSou.id=="tbSource"){
rowSou=curRowSource;
newRow.attachEvent("onclick",function(){selectRow1(newRow);});
}
else{
rowSou=curRowTarget;
newRow.attachEvent("onclick",function(){selectRow(newRow);});
}
for(var i=0;i<rowSou.cells.length;i++){
var newCell=newRow.insertCell();
newCell.innerHTML=rowSou.cells[i].innerHTML;
}
tbSou.deleteRow(rowSou.rowIndex);
var btns=document.getElementsByName("btn");
btns[0].disabled=true;
btns[2].disabled=true;
}
function AddAll(tbSource,tbTarget){
for(var i=1;;i++){
if(tbSource.rows.length==1) return;
tbSource.rows[1].click();
Add(tbSource,tbTarget);
}
}
function doSubmit(){
if(tbTarget.rows.length<2)
{
alert("请选择参加培训的人员.");
return ;
}
if(!check_input(form1))
return;
var employeeid = new Array(tbTarget.cells.length/2-1);
for(var i=0;i<(tbTarget.cells.length/2-1);i++)
{
employeeid[i]=tbTarget.cells[i*2+2].innerText;
}
self.location="AddTrainStep2.jsp?employeeid="+employeeid+"&trainname="+form1.trainname.value+"&trainwhat="+form1.trainwhat.value+"&startdate="+form1.startdate.value+"&enddate="+form1.enddate.value+"&trainorgan="+form1.trainorgan.value+"&trainresult="+form1.trainresult.value+"&remark="+form1.remark.value;
}
</script>
</head>
<%@ include file="../incoming/Header.jsp"%>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="120" valign="top" background="../images/in_left_bg.gif"><%@ include file="TrainLeft.jsp"%></td>
<td width="660" align="top">
<p align="center" class="title1">添加培训记录</p>
<form name="form1" method="post" >
<table width="640" height="315" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC">
<tr>
<td height="33" colspan="2"><div align="center">
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse:collapse ">
<tr>
<td width="255" height="29" valign="middle"><div align="center">待选择的培训人员</div></td>
<td width="76" valign="middle"><br>
</td>
<td width="247" valign="middle"><div align="center">参加培训的人员</div></td>
</tr>
<tr>
<td height="218" valign="top"><table id="tbSource" cellpadding="0" cellspacing="0" border="1" style="border-collapse:collapse;cursor:default" bordercolor="#CCCCCC" width="100%">
<tr>
<td align="center" width="43%">员工编号</td>
<td align="center" width="57%">姓名</td>
</tr>
<%
Vector listemployee = Employee.ListAll();
for(int i=0;i<listemployee.size();i++) {
Employee employee = (Employee)listemployee.elementAt(i);
%>
<tr onclick="selectRow(this)">
<td><%=employee.getEmployeeID()%></td>
<td><%=employee.getUserName()%></td>
</tr>
<%}%>
</table></td>
<td valign="middle"><br>
<p style="width:100%" align="center">
<input name="btn" type="button" value="->" onClick="Add(document.all.tbSource,tbTarget)" title="选择" disabled>
</p>
<p style="width:100%" align="center">
<input name="btn" type="button" value="=>" onClick="AddAll(document.all.tbSource,tbTarget)" title="全部选择">
</p>
<p style="width:100%" align="center">
<input name="btn" type="button" value="<-" onClick="Add(tbTarget,document.all.tbSource)" title="取消" disabled>
</p>
<p style="width:100%" align="center">
<input name="btn" type="button" value="<=" onClick="AddAll(tbTarget,document.all.tbSource)" title="全部取消">
</p></td>
<td valign="top"><table id="tbTarget" cellpadding="0" cellspacing="0" border="1" style="border-collapse:collapse" bordercolor="#CCCCCC" width="100%">
<tr>
<td align="center" width="61%">员工编号</td>
<td align="center" width="39%">姓名</td>
</tr>
</table></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td width="122" height="33"><div align="right"> 培训名称:</div></td>
<td width="500"><input name="trainname" type="text" class="data" id="trainname" size="20" maxlength="20" >
*</td>
</tr>
<tr>
<td height="33"><div align="right">培训内容
:</div></td>
<td><input name="trainwhat" type="text" class="data" id="trainwhat" size="40" maxlength="40" >
*</td>
</tr>
<tr>
<td height="33"><div align="right">开始日期: </div></td>
<td><input name="startdate" type="text" class="data" id="startdate" value="<%=DataConvert.getStringDate()%>" size="10" maxlength="8" readonly="true">
<input name="start" type="button" id="start" value="...">
*</td>
</tr>
<tr>
<td height="33"><div align="right"> 结束日期:</div></td>
<td><input name="enddate" type="text" class="data" id="enddate" value="<%=DataConvert.getStringDate()%>" size="10" maxlength="8" readonly="true">
<input name="end" type="button" id="end" value="...">
* </td>
</tr>
<tr>
<td height="33"><div align="right">培训单位: </div></td>
<td><input name="trainorgan" type="text" class="data" id="trainorgan" size="40" maxlength="40">
*</td>
</tr>
<tr>
<td height="33"><div align="right">培训结果: </div></td>
<td>
<select name="trainresult" id="trainresult">
<option value="差" selected>差</option>
<option value="中">中</option>
<option value="良">良</option>
<option value="优">优</option>
</select>
*</td>
</tr>
<tr>
<td height="33"><div align="right">备注:</div></td>
<td><textarea name="remark" cols="60" rows="4" id="remark"></textarea></td>
</tr>
<tr>
<td height="49" colspan="2"><div align="center">
<input type="button" name="Submit" value="添加" onClick="doSubmit()">
<input type="reset" name="Submit2" value="取消">
</div></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%@ include file="../incoming/Footer.jsp"%>
<script language="JavaScript" type="text/JavaScript">
Calendar.setup(
{
inputField : "startdate", // ID of the input field
ifFormat : "%Y-%m-%d", // the date format
button : "start" // ID of the button
}
);
Calendar.setup(
{
inputField : "enddate", // ID of the input field
ifFormat : "%Y-%m-%d", // the date format
button : "end" // ID of the button
}
);
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -