ModData.jsp
7.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<%@ page import="weaver.general.Util" %>
<%@ page language="java" contentType="text/html; charset=GBK" %> <%@ include file="/systeminfo/init.jsp" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs1" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs2" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs3" class="weaver.conn.RecordSet" scope="page" />
<HTML><HEAD>
<LINK href="/css/Weaver.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="/js/weaver.js"></script>
</head>
<%
int inprepid = Util.getIntValue(request.getParameter("inprepid"),0);
String type = Util.null2String(request.getParameter("type"));
String crmid = Util.null2String(request.getParameter("crmid"));
String inprepname = Util.fromScreen(request.getParameter("inprepname"),user.getLanguage());
String inpreptablename = Util.null2String(request.getParameter("inpreptablename"));
String inprepbugtablename = Util.null2String(request.getParameter("inprepbugtablename"));
String inprepfrequence = Util.null2String(request.getParameter("inprepfrequence"));
String inprepbudget = Util.null2String(request.getParameter("inprepbudget"));
String currentyear = Util.null2String(request.getParameter("currentyear"));
String currentmonth = Util.null2String(request.getParameter("currentmonth"));
String currentday = Util.null2String(request.getParameter("currentday"));
String currentdate = Util.null2String(request.getParameter("currentdate"));
String year = Util.null2String(request.getParameter("year"));
String month = Util.null2String(request.getParameter("month"));
String modtype = "" ;
String thedate = "" ;
String dspdate = year ;
if(type.equals("1")) {
dspdate += "-"+month ;
thedate = dspdate+"-31" ;
modtype= "2" ;
}
else {
thedate = dspdate+"-12-31" ;
modtype= "3" ;
}
String thetable = "" ;
String inputid = "" ;
boolean canedit = true ;
boolean hasvalue = false ;
if(inprepbudget.equals("1")) thetable = inprepbugtablename ;
else thetable = inpreptablename ;
String sql = "select * from "+ thetable +
" where reportdate ='" +thedate+"' and crmid ="+crmid+" and modtype='"+modtype +"' " ;
rs2.executeSql(sql) ;
if(rs2.next()) {
inputid = Util.null2String(rs2.getString("inputid")) ;
hasvalue = true ;
}
String imagefilename = "/images/hdHRMCard.gif";
String titlename = Util.toScreen("",user.getLanguage(),"0") + inprepname;
String needfav ="1";
String needhelp ="";
%>
<BODY>
<%@ include file="/systeminfo/TopTitle.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent.jsp" %>
<% if(canedit) {%>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(86,user.getLanguage())+",javascript:frmMain.submit(),_self} " ;
RCMenuHeight += RCMenuHeightStep;
%>
<%}%>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(1290,user.getLanguage())+",javascript:history.back(-1),_self} " ;
RCMenuHeight += RCMenuHeightStep;
%>
<%@ include file="/systeminfo/RightClickMenu.jsp" %>
<FORM id=weaver name=frmMain action="ModDataOperation.jsp" method=post>
<input type="hidden" name="inprepid" value="<%=inprepid%>">
<input type="hidden" name="inprepname" value="<%=inprepname%>">
<input type="hidden" name="thetable" value="<%=thetable%>">
<input type="hidden" name="thedate" value="<%=thedate%>">
<input type="hidden" name="currentdate" value="<%=currentdate%>">
<input type="hidden" name="dspdate" value="<%=dspdate%>">
<input type="hidden" name="hasvalue" value="<%=hasvalue%>">
<input type="hidden" name="inputid" value="<%=inputid%>">
<input type="hidden" name="inprepbudget" value="<%=inprepbudget%>">
<input type="hidden" name="crmid" value="<%=crmid%>">
<input type="hidden" name="type" value="<%=type%>">
<table width=100% height=100% border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="10">
<col width="">
<col width="10">
<tr>
<td height="10" colspan="3"></td>
</tr>
<tr>
<td ></td>
<td valign="top">
<TABLE class=Shadow>
<tr>
<td valign="top">
<table class=liststyle cellspacing=1 >
<COLGROUP>
<COL width="15%">
<COL width="85%">
<tbody>
<tr class=header>
<td><nobr><b><%=inprepname%> : <font color=red><%=dspdate%></font></b></td>
<td align=right></td>
</tr>
<%
rs.executeProc("T_IRItemtype_SelectByInprepid",""+inprepid);
while(rs.next()) {
String itemtypeid = Util.null2String(rs.getString("itemtypeid")) ;
String itemtypename = Util.toScreen(rs.getString("itemtypename"),user.getLanguage()) ;
%>
<tr class=header>
<td colspan=2><%=itemtypename%></td>
</tr>
<tr class=line>
<td colspan=2></td>
</tr>
<%
int i = 0 ;
rs1.executeProc("T_IRItem_SelectByItemtypeid",""+itemtypeid);
while(rs1.next()) {
String itemid = Util.null2String(rs1.getString("itemid")) ;
String itemdspname = Util.toScreen(rs1.getString("itemdspname"),user.getLanguage()) ;
String itemfieldname = Util.null2String(rs1.getString("itemfieldname")) ;
String itemfieldtype = Util.null2String(rs1.getString("itemfieldtype")) ;
String itemfieldscale = Util.null2String(rs1.getString("itemfieldscale")) ;
String itemexcelsheet = Util.toScreen(rs1.getString("itemexcelsheet"),user.getLanguage()) ;
String itemexcelrow = Util.null2String(rs1.getString("itemexcelrow")) ;
String itemexcelcolumn = Util.null2String(rs1.getString("itemexcelcolumn")) ;
String itemfieldunit = Util.toScreen(rs1.getString("itemfieldunit"),user.getLanguage()) ;
String modfieldname = itemfieldname + "_mod" ;
if(!itemfieldtype.equals("2") && !itemfieldtype.equals("3")) continue ;
if(i==0){
i=1;
%>
<tr class=datalight>
<%}else{
i=0;
%>
<tr class=datadark>
<% }%>
<td><%=itemdspname%>()</td>
<td>
<%if(itemfieldtype.equals("2")) {%>
<input type=text class="InputStyle" size=30 name=<%=modfieldname%> <% if(hasvalue && Util.getIntValue(rs2.getString(itemfieldname),0) != 0 ) {%> value="<%=Util.toScreenToEdit(rs2.getString(itemfieldname),user.getLanguage())%>" <%}%> onKeyPress="ItemCount_KeyPress()" onBlur='checkcount1(this)'><%=itemfieldunit%>
<%} else if(itemfieldtype.equals("3")) { %>
<input type=text class="InputStyle" size=30 name=<%=modfieldname%> <% if(hasvalue && Util.getDoubleValue(rs2.getString(itemfieldname),0) != 0 ) {%> value="<%=Util.toScreenToEdit(rs2.getString(itemfieldname),user.getLanguage())%>" <%}%> onKeyPress="ItemNum_KeyPress()" onBlur='checknumber1(this)'><%=itemfieldunit%>
<%}%>
</td>
</tr>
<%}}%>
</tbody>
</table>
</td>
</tr>
</TABLE>
</td>
<td></td>
</tr>
<tr>
<td height="10" colspan="3"></td>
</tr>
</table>
</form>
<script language=javascript>
function onSave(){
if(check_form(document.frmMain,'inprepname')){
document.frmMain.operation.value="edit";
document.frmMain.submit();
}
}
function onDelete(){
if(confirm("<%=SystemEnv.getHtmlNoteName(7,user.getLanguage())%>")) {
document.frmMain.operation.value="delete";
document.frmMain.submit();
}
}
</script>
<script language=vbs>
sub onShowCustomer()
id = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/CRM/data/CustomerBrowser.jsp")
if (Not IsEmpty(id)) then
if id(0)<> "" then
window.location = "InputReportOperation.jsp?operation=addcrm&inprepid=<%=inprepid%>&crmid=" & id(0)
end if
end if
end sub
</script>
</BODY></HTML>