📄 alarmamend.jsp
字号:
<%--
模块名称:个人助理
模块功能:提醒修改
版 本:V1.0
著 作 人:蔡静
著作日期:2001-11-13
使用说明:
主要技术说明:
参考文献:法律事务设计书
修改历史:= = = = = = = = = = = = = = = = = = = = = = = = = =
修改日期:
修 改 人:
修改理由:
修改出处:
= = = = = = = = = = = = = = = = = = = = = = = = = =
--%>
<%@ page contentType= "text/html; charset=gb2312" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page import="system.*" %>
<jsp:useBean id="db" class="dbconnection.DbConnection" scope="page" />
<%
Security auth = new Security();
String employee_id = (String)session.getAttribute("employee_id");
if(employee_id == null || employee_id.equals(""))
{
response.sendRedirect(response.encodeRedirectURL("../Error/nonlogin.htm"));
}
String modelid = "Per010";
int authflag = auth.popedom(employee_id, modelid);
if(authflag == 0 || authflag == 2 || authflag == -1)
{
%>
<jsp:forward page="../inc/noauth.jsp" >
</jsp:forward>
<%
}
%>
<%
String flag = request.getParameter("flag");
String alert_id = request.getParameter("alert_id");
String alert_title, alert_thing, alert_fromtime, alert_totime;
String sql = "select alert_title, alert_thing, alert_fromtime, alert_totime";
sql = sql + " from t_alert where alert_id = '" + alert_id + "'";
ResultSet rs = db.executeQuery(sql);
if (rs.next()) {
alert_title = rs.getString("alert_title");
alert_thing = rs.getString("alert_thing");
alert_fromtime = rs.getString("alert_fromtime");
alert_totime = rs.getString("alert_totime");
%>
<html>
<head>
<title>提醒修改</title>
<%@ include file="../inc/config.jsp" %>
<script language="JavaScript">
function copyToList(from,to) //from表示:包含可选择项目的select对象名字 to表示:列出可选择项目的select对象名字 //你可以根据你的具体情况修改
{
fromList = eval("document.forms[0]." + from);
toList = eval("document.forms[0]." + to);
if (toList.options.length > 0 && toList.options[0].value == "temp")
{
toList.options.length = 0;
}
var sel = false;
for (i=0;i<fromList.options.length;i++)
{
var current = fromList.options[i];
if (current.selected)
{
sel = true;
if (current.value == "temp")
{
alert ("你不能选择这个项目!");
return;
}
txt = current.text;
val = current.value;
toList.options[toList.length] = new Option(txt,val);
fromList.options[i] = null;
i--;
}
}
if (!sel) alert ('你还没有选择任何项目');
}
function allSelect() //这是当用户按下提交按钮时,对列出选择的select对象执行全选工作,让递交至的后台程序能取得相关数据
{
List = document.forms[0].chosen;
if (List.length && List.options[0].value == "temp") return;
for (i=0;i<List.length;i++)
{
List.options[i].selected = true;
}
}
</script>
</head>
<body class=page>
<script language="javascript">
function checkForm() {
if (document.form1.alert_title.value == "") {
alert("请输入提醒标题!");
document.form1.alert_title.focus();
return false;
}
if (document.form1.alert_fromtime.value == "") {
alert("请输入提醒开始时间!");
return false;
}
if (document.form1.alert_totime.value == "") {
alert("请输入提醒结束时间!");
return false;
}
if (document.form1.alert_fromtime.value > document.form1.alert_totime.value) {
alert("提醒开始时间要小于提醒结束时间!");
document.form1.alert_fromtime.value = "";
document.form1.alert_totime.value = "";
return false;
}
else {
if (document.form1.alert_fromtime.value == document.form1.alert_totime.value) {
if (document.form1.fromhour.value > document.form1.tohour.value) {
alert("提醒开始时间要小于提醒结束时间!");
return false;
}
else {
if (document.form1.fromhour.value == document.form1.tohour.value) {
if (document.form1.fromminute.value > document.form1.tominute.value) {
alert("提醒开始时间要小于提醒结束时间!");
return false;
}
}
}
}
}
if ((document.form1.chosen.length == 0) ||
(document.form1.chosen.length == 1 && document.form1.chosen.options[0].value == "temp")) {
alert("请选择被提醒人!");
return false;
}
if (document.form1.alert_thing.value == "") {
alert("请输入提醒内容!");
document.form1.alert_thing.focus();
return false;
}
List = document.form1.chosen;
var alertedlist = "";
for (i=0; i<List.length; i++) {
if (alertedlist == "")
alertedlist = List.options[i].value;
else
alertedlist = alertedlist + ";" + List.options[i].value;
}
document.form1.alertedlist.value = alertedlist;
return true;
}
</script>
<!--显示工具条-->
<form name="form1" method="post" action="AlarmAmendRun.jsp">
<table width="98%" align="center" cellspacing="1">
<tr>
<td><a href="Alarm1.jsp"><img src="../images/alarm.gif" width="88" height="22" border="0"></a>
<a href="Alarm1all.jsp"><img src="../images/alarm_all.gif" height="22" border="0" width="88"></a>
<a href="AlarmAdd.jsp"><img src="../images/add.gif" alt="增加内容" width="79" height="22" border="0"></a>
<img src="../images/delete.gif" alt="删除选中的内容" style="cursor:hand" width="79" height="22">
<a href="Alarmall.jsp"><img src="../images/alarm_2.gif" width="88" height="22" border="0"></a></td>
<td align="right"><img src="../images/back.gif" width="50" height="22" onClick="window.history.back()" style="cursor:hand" alt="返回"></td>
</tr>
</table>
<table width="98%" background="../images/line.gif" border="0" cellspacing="0" cellpadding="0" height="12" align="center">
<tr>
<td> </td>
</tr>
</table>
<!--显示工具条结束-->
<table width="98%" border="0" cellspacing="1" cellpadding="5" class="table_bg" align="center">
<tr>
<td width="21%" class="title_bg" align="right"> 提醒标题:</td>
<td width="79%" class="tr_bg1">
<input type="text" name="alert_title" size="70" class="input" maxlength="70" value=<%=alert_title%>>
</td>
</tr>
<tr>
<td width="21%" class="title_bg" height="4" align="right"> 提醒开始时间:</td>
<td width="79%" class="tr_bg1" height="-2">
<input type="text" name="alert_fromtime" maxlength="10" size="10" value=<%=alert_fromtime.substring(0,10)%> class="input" readOnly>
<img src="../images/datetime.gif" border="0" align="absmiddle"
alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(alert_fromtime);return false">
<select name="fromhour" class="select">
<%String temp = "";
String hour = alert_fromtime.substring(11,13);
String minute = alert_fromtime.substring(14,16);
for (int i=0; i<24; i++) {
if (i < 10)
temp = "0" + i;
else
temp = String.valueOf(i);
if (temp.equals(hour))
out.print("<option value=\""+temp+"\" selected>"+temp+"</option>");
else
out.print("<option value=\""+temp+"\">"+temp+"</option>");
}
%>
</select>
:
<select name="fromminute" class="select">
<%
if (minute.equals("00"))
out.print("<option value=\"00\" selected>00</option>");
else
out.print("<option value=\"00\">00</option>");
if (minute.equals("10"))
out.print("<option value=\"10\" selected>10</option>");
else
out.print("<option value=\"10\">10</option>");
if (minute.equals("20"))
out.print("<option value=\"20\" selected>20</option>");
else
out.print("<option value=\"20\">20</option>");
if (minute.equals("30"))
out.print("<option value=\"30\" selected>30</option>");
else
out.print("<option value=\"30\">30</option>");
if (minute.equals("40"))
out.print("<option value=\"40\" selected>40</option>");
else
out.print("<option value=\"40\">40</option>");
if (minute.equals("50"))
out.print("<option value=\"50\" selected>50</option>");
else
out.print("<option value=\"50\">50</option>");
%>
</select>
</td>
</tr>
<tr>
<td width="21%" class="title_bg" height="4" align="right"> 提醒结束时间:</td>
<td width="79%" class="tr_bg1" height="0">
<input type="text" name="alert_totime" maxlength="10" size="10" value=<%=alert_totime.substring(0,10)%> class="input" readOnly>
<img src="../images/datetime.gif" border="0" align="absmiddle"
alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(alert_totime);return false">
<select name="tohour" class="select">
<%
hour = alert_totime.substring(11,13);
minute = alert_totime.substring(14,16);
for (int i=0; i<24; i++) {
if (i < 10)
temp = "0" + i;
else
temp = String.valueOf(i);
if (temp.equals(hour))
out.print("<option value=\""+temp+"\" selected>"+temp+"</option>");
else
out.print("<option value=\""+temp+"\">"+temp+"</option>");
}
%>
</select>
:
<select name="tominute" class="select">
<%
if (minute.equals("00"))
out.print("<option value=\"00\" selected>00</option>");
else
out.print("<option value=\"00\">00</option>");
if (minute.equals("10"))
out.print("<option value=\"10\" selected>10</option>");
else
out.print("<option value=\"10\">10</option>");
if (minute.equals("20"))
out.print("<option value=\"20\" selected>20</option>");
else
out.print("<option value=\"20\">20</option>");
if (minute.equals("30"))
out.print("<option value=\"30\" selected>30</option>");
else
out.print("<option value=\"30\">30</option>");
if (minute.equals("40"))
out.print("<option value=\"40\" selected>40</option>");
else
out.print("<option value=\"40\">40</option>");
if (minute.equals("50"))
out.print("<option value=\"50\" selected>50</option>");
else
out.print("<option value=\"50\">50</option>");
%>
</select>
</td>
</tr>
<tr>
<td width="21%" class="title_bg" height="9" align="right">被提醒人:</td>
<td width="79%" class="tr_bg1" height="9">
<table border="0" width="60%">
<tr>
<td>已经选择</td>
<td> </td>
<td>没有选择</td>
</tr>
<tr>
<td>
<select name="chosen" size="4" multiple
width=200 style="width: 158; height: 100" class="select">
<%
String sql1 = "select a.alerted_person, b.employee_name from t_alerted a,";
sql1 = sql1 + "t_employee b where a.alerted_person = b.employee_id and";
sql1 = sql1 + " a.alert_id = '" + alert_id + "'";
String alerted_person, employee_name;
ResultSet rs1 = db.executeQuery(sql1);
while (rs1.next()) {
alerted_person = rs1.getString("alerted_person");
employee_name = rs1.getString("employee_name");
out.print("<option value=\"" + alerted_person + "\">" + employee_name + "</option>");
}
%>
</select>
</td>
<td>
<input onClick="javascript:copyToList('possible','chosen')" type="button" value="<<添加" name="B5" class="button">
<br>
<input onClick="javascript:copyToList('chosen','possible')" type="button" value="删除>>" name="B6" class="button">
</td>
<td>
<select name="possible" size="4" multiple
width=200 style="width: 148; height: 97" class="select">
<%
sql1 = "select employee_id as alerted_person, employee_name from t_employee";
sql1 = sql1 + " where employee_id not in (select alerted_person from";
sql1 = sql1 + " t_alerted where alert_id = '" + alert_id + "')";
rs1 = db.executeQuery(sql1);
while (rs1.next()) {
alerted_person = rs1.getString("alerted_person");
employee_name = rs1.getString("employee_name");
out.print("<option value=\"" + alerted_person + "\">" + employee_name + "</option>");
}
%>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="21%" class="title_bg" align="right"> 提醒内容:</td>
<td width="79%" class="tr_bg1">
<textarea name="alert_thing" rows="5" cols="70" class="input"><%=alert_thing%></textarea>
</td>
</tr>
</table>
<div align="center">
<input type="submit" name="save" value="保存" class="button" onClick="return checkForm()">
<input type="reset" name="reset" value="重写" class="button">
<br>
</div>
<input type="hidden" name="alert_id" value=<%=alert_id%>>
<input type="hidden" name="alertedlist">
<input type="hidden" name="flag" value=<%=flag%>>
</form>
</body>
</html>
<%}%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -