📄 diaryitemset.jsp
字号:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="cn.com.aheadsoft.util.StringFormat" %>
<%@ page import="cn.com.aheadsoft.recordset.DiaryItemRecordSet"%>
<%@ page import="cn.com.aheadsoft.util.UserInfo"%>
<jsp:useBean id="userinfo" scope="session" class="cn.com.aheadsoft.util.UserInfo"/>
<jsp:useBean id="upm" scope="session" class="cn.com.aheadsoft.manage.UserPurviewManage"/>
<jsp:useBean id="diaryItemRecordSet" scope="page" class="cn.com.aheadsoft.recordset.DiaryItemRecordSet"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" type="text/css" href="/krm/jsp/css/css.css">
<title>工作日记项目设置界面</title>
<%
userinfo=(UserInfo)session.getAttribute("userinfo") ;
//工作日记参数设置权限
/*int u2=upm.getUserPopInt(userinfo,"5","2","u");
int d2 = upm.getUserPopInt(userinfo,"5","1","d");*/
int u4=upm.getUserPopInt(userinfo,"5","4","u");
int d4 = upm.getUserPopInt(userinfo,"5","4","d");
String existRecordSet;
//权限校验
existRecordSet=(String)request.getAttribute("existRecordSet");//是否存在项目设置记录
if(null==existRecordSet){
/* 如果为空,则进行提示,以防止用户刷新页面时进行报错显示!*/
response.sendRedirect("/krm/jsp/diamanage/diaryItem/tip.htm");
return;
}
if(existRecordSet.equals("1")){
diaryItemRecordSet=(DiaryItemRecordSet)request.getAttribute("type");
}else {
diaryItemRecordSet=null;
}
%>
<script>
<!--
function update(id,key,val) {
document.form1.DIM_ID.value = id;
document.form1.ItemType.value=key;
if(val=="") {
val = " ";
}
document.form1.ItemName.value=val;
document.form1.status.value = "u";
document.form1.ItemName.focus();
}
function atSubmit(obj){
isOK=false;
lab="";
for(i=0;i<obj.length;i++){
if(obj.elements[i].value!=null && obj.elements[i].value!=""){
isOK=true;
}else{
isOK=false;
lab=obj.elements[i].alt;
obj.elements[i].focus();
break;
}
}
if(!isOK){
alert("您没有填写"+lab+"!请填写后提交。");
return false;
}else{
// obj.submit();
}
}
function atDelete() {
return confirm("您确定要删除吗?");
}
-->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" >
<tr height="8">
<td class="trA"> 您的位置:工作日记 >> 参数设置 >> <font class="fontcolor">日记项目设置</font></td>
</tr>
<tr height="8">
<td></td>
</tr>
<tr>
<td align="center" >
<table border="0" width="98%" align="center" height="30%" class="collapse">
<tr >
<td class="tdA" colspan="9" >
工作日记项目设置</td>
</tr>
<form action="/krm/servlet/DiaryItemSetServlet" method="post" name="form1" onsubmit="return atSubmit(this)">
<tr>
<td width="15%" height="24" align="center" class="common bgcolor">项目类别</td>
<td class="common"> <select name="ItemType" size=1 alt="项目类型">
<option value='A' selected >工作</option>
<option value='B'>学习</option>
<option value='C'>运动</option>
<option value='D'>休息</option>
</select>
</td>
</tr>
<tr>
<td width="10%" class="common bgcolor" align="center" >项目名称</td>
<td class="common"> <input type="text" class="long" name="ItemName" alt="项目名称" value=""></td>
</tr>
<input type="Hidden" name="status" value="i">
<input type="Hidden" name="DIM_ID" value="0">
<tr>
<td colspan="2" align="center" height="20" class="tdC"><input name="imageField" type="submit" onmouseover="this.className='button2'" onmouseout="this.className='button1'" class="button1" value="提 交">
</td>
</tr>
</form>
</table>
<br>
<table border="0" width="98%" align="center" height="30%" class="collapse">
<tr>
<td width="10%" class="tdB" align="center" height="20" >序号</td>
<td width="20%" class="tdB" align="center" >项目类别</td>
<td width="40%" class="tdB" align="center" >项目名称</td>
<td width="15%" class="tdB" align="center" >修改</td>
<td width="15%" class="tdB" align="center" >删除</td>
</tr>
<%
String strType=null;
if(diaryItemRecordSet!= null && diaryItemRecordSet.size() > 0) {
for(int i=0;i<diaryItemRecordSet.size();i++){
diaryItemRecordSet.next();
if(diaryItemRecordSet.getDIM_Type().trim().equals("A"))
strType="工作";
else if(diaryItemRecordSet.getDIM_Type().trim().equals("B"))
strType="学习";
else if(diaryItemRecordSet.getDIM_Type().trim().equals("C"))
strType="运动";
else //if(diaryItemRecordSet.getDIM_Type().trim().equals("D"))
strType="休息";
%>
<tr <%if((i+1)%2==0){%> class="bgcolor" <%}%>>
<td width="10%" class="common" align="center" ><%= i+1 %></td>
<td width="20%" class="common" align="center" ><%= StringFormat.Source2GB(/*diaryItemRecordSet.getDIM_Type()*/strType) %></td>
<td width="40%" class="common" align="center" ><%= StringFormat.Source2GB(diaryItemRecordSet.getDIM_Name()) %></td>
<td width="15%" class="common" align="center" >
<%
//if(/*u1 == 9*/u2==9) {
if(u4>0) {
%>
<a href="javascript:update("<%= StringFormat.Source2GB(diaryItemRecordSet.getDIM_ID()) %>","<%= StringFormat.Source2GB(diaryItemRecordSet.getDIM_Type()) %>","<%= StringFormat.Source2GB(diaryItemRecordSet.getDIM_Name()) %>");">修改</a>
<%
}else {
out.print("修改");
}
%>
</td>
<td width="15%" class="common" align="center" >
<%
//if(/*d1 == 9*/d2==9) {
if(d4>0) {
%>
<a href="/krm/servlet/DiaryItemSetServlet?status=d&DIM_ID=<%= diaryItemRecordSet.getDIM_ID() %>" onclick="return atDelete()">删除
</a>
<%
}else {
out.print("删除");
}
%>
</td>
</tr>
<%
}
}
%>
<tr><td class="tdC" colspan="5"></td></tr>
</table>
</table>
<br>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -