tom_magazine.jsp
12.1 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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ page import="weaver.conn.*" %>
<%@ page import="oracle.sql.CLOB" %>
<%@ page import="java.io.BufferedReader" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="RecordSet2" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="RecordSet3" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="dci" class="weaver.docs.docs.DocComInfo" scope="page"/>
<jsp:useBean id="hpes" class="weaver.homepage.HomepageExtShow" scope="page"/>
<jsp:useBean id="oDocManager" class="weaver.docs.docs.DocManager" scope="page"/>
<HTML><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
</HEAD>
<%
String typeID = ""+Util.getIntValue(request.getParameter("typeID"),0);
String name="";
RecordSet.executeSql("select name from WebMagazineType where id="+typeID);
if(RecordSet.next()) name=Util.null2String(RecordSet.getString("name"));
%>
<BODY>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="40" align="center" style="color:#008000;font-size:18pt"><strong>《<%=name%>》</strong></td>
<td width="5"> </td>
</tr>
<tr>
<td>
<FORM name="Magazine" action="tom_magazine.jsp" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" width="54%"><input type="hidden" name="typeID" value="<%=typeID%>"><input type="hidden" name="name" value="<%=name%>"></td>
<td width="21%"><img src="images/tom/mail3_wev8.gif" width="117" height="20"></td>
<td width="14%">
<select name="id">
<%
String id = ""+Util.getIntValue(request.getParameter("id"),0);
RecordSet.executeSql("select id , releaseYear , name from WebMagazine where typeID = " + typeID + " order by id desc");
while (RecordSet.next()){
if(id.equals("0")) id = RecordSet.getString("id");
%>
<option value='<%=RecordSet.getString("id")%>' <%if (id.equals(RecordSet.getString("id"))){%>selected<%}%>><%=RecordSet.getString("releaseYear")%>年
<%=RecordSet.getString("name")%>
</option>
<%}%>
</select>
</td>
<td width="11%"><img src="images/tom/search_wev8.gif" width="56" style="cursor:hand" onclick="Magazine.submit()"></td>
</tr>
</table>
</FORM>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="4" height="1" bgcolor="#63A80E"></td>
</tr>
<tr bgcolor="#C9E19F">
<td colspan="4" height="4"></td>
</tr>
<tr>
<td width="4%" height="30" bgcolor="#F3FFE4"> </td>
<td width="58%" height="30" bgcolor="#F3FFE4"> </td>
<td width="13%" height="30" bgcolor="#F3FFE4"><img src="images/tom/icon_news_wev8.gif" width="63" height="42"></td>
<td width="25%" height="30" bgcolor="#F3FFE4" style="font-size:9pt">
<div align="center"><b>
<%
String headDoc = "";
RecordSet.executeSql("select releaseYear , name , docID from WebMagazine where id = " + id);
if (RecordSet.next()){
headDoc = Util.null2String(RecordSet.getString("docID"));
%>
<%=RecordSet.getString("releaseYear")%>年
<%=RecordSet.getString("name")%>
<%}%>
</b></div>
</td>
</tr>
<tr>
<td colspan="4" height="1" bgcolor="#63A80E"></td>
</tr>
<tr>
<td colspan="4" height="1" bgcolor="#bbbbbb"></td>
</tr>
<tr>
<td colspan="4" height="30">
<table width="100%" border="0" cellspacing="0" cellpadding="8">
<%
String docsubject="";
String doccontent="";
String doclastmoddate="";
String docid="";
ConnStatement statement = null;
try{
if (!headDoc.equals("")) {
statement = new ConnStatement();
String tempSql = "";
headDoc = oDocManager.getNewDocids(headDoc);
if ((statement.getDBType()).equals("oracle")) {
tempSql = "select id , docsubject , d2.doccontent , doclastmoddate from DocDetail d1,DocDetailcontent d2 where d1.id=d2.docid and id in (" + headDoc + ")";
} else {
tempSql = "select id , docsubject , doccontent , doclastmoddate from DocDetail where id in (" + headDoc + ")";
}
statement.setStatementSql(tempSql);
statement.executeQuery();
while (statement.next()) {
//获取文档标题docsubject
docid = Util.null2String(statement.getString("id"));
docsubject = Util.null2String(statement.getString("docsubject"));
//获取文档内容doccontent
if ((statement.getDBType()).equals("oracle") &&Util.null2String(statement.getOrgindbtype()).equals("oracle")) {
CLOB theclob = statement.getClob("doccontent");
String readline = "";
StringBuffer clobStrBuff = new StringBuffer("");
BufferedReader clobin = new BufferedReader(theclob.getCharacterStream());
while ((readline = clobin.readLine()) != null)
clobStrBuff = clobStrBuff.append(readline);
clobin.close();
doccontent = clobStrBuff.toString();
} else {
doccontent = Util.null2String(statement.getString("doccontent"));
}
}
}
%>
<tr>
<td width="30%">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="100%" height="115" background="images/tom/bg_wev8.gif">
<%
String strImgSrc="";
String temppics="/images/homepage/noimgdefault_wev8.gif";
String links="/images/homepage/noimgdefault_wev8.gif";
int curpos = doccontent.indexOf("/weaver/weaver.file.FileDownload?fileid=");
if(curpos!=-1){
curpos = doccontent.indexOf("?fileid=",curpos);
int endpos = doccontent.indexOf("\"",curpos);
String tmppicid="";
if(endpos!=-1) tmppicid = doccontent.substring(curpos+8,endpos);
if(!tmppicid.equals("")) {
ArrayList imgidList=new ArrayList();
imgidList.add(tmppicid);
ArrayList docidList=new ArrayList();
docidList.add(docid);
//String servername = request.getHeader("Host");
//String servername ="127.0.0.1:"+request.getServerPort();
String servername="127.0.0.1";
String realSeaver=request.getHeader("Host");
int posPort=realSeaver.indexOf(":");
if(posPort!=-1) servername=servername+":"+realSeaver.substring(posPort+1);
strImgSrc=hpes.getPicImgs(docidList,servername,imgidList,"120","108");
if(strImgSrc.indexOf("$")!=-1)
{
strImgSrc = strImgSrc.substring(0,strImgSrc.indexOf("$"));
}
if(!"#".equals(strImgSrc)){
ArrayList picList=Util.TokenizerString(strImgSrc,"#");
if(picList.size()==2) {
temppics=(String)picList.get(0);
links=(String)picList.get(1);
}
} else {
temppics="/images/homepage/noimgdefault_wev8.gif";
links="/images/homepage/noimgdefault_wev8.gif";
}
} else{
strImgSrc="/images/homepage/noimgdefault_wev8.gif";
}
%>
<%}%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height="6" colspan="2"></td></tr>
<tr>
<td width="12"> </td>
<td height="99">
<a href="<%=links%>" target="_blank"><img border=0 src="<%=temppics%>" > </a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="70%" valign="top" style="font-size:9pt"><a href="/docs/docs/DocDsp.jsp?id=<%=docid%>" target="_blank"><%=docsubject%></a>
<br>
<br>
<a href="/docs/docs/DocDsp.jsp?id=<%=docid%>" target="_blank">
<%
String disptmp = "";
int tmppos = doccontent.indexOf("!@#$%^&*");
if(tmppos!=-1) disptmp = doccontent.substring(0,tmppos);
out.print(disptmp);
%>
</a>
</td>
</tr>
<%}
}
}finally{
try{
if(statement != null){
statement.close();
}
}catch(Exception e){}
}
%>
</table>
</td>
</tr>
<tr>
<td colspan="4" height="1" background="images/r_title_bg2_wev8.gif"></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="10"> </td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
String isView = "" ;
String groupName = "" ;
String groupDoc = "" ;
int magazineDetailId = 0 ;
RecordSet.executeSql("select * from WebMagazineDetail where mainID = " + id +" order by id asc");
while(RecordSet.next()){
isView = RecordSet.getString("isView");
groupName = RecordSet.getString("name");
groupDoc = RecordSet.getString("docID");
magazineDetailId = Util.getIntValue(RecordSet.getString("id"),0) ;
if(isView.equals("1")){
%>
<tr>
<td width="4%" height="30" bgcolor="#F3FFE4"> </td>
<td width="58%" height="30" bgcolor="#F3FFE4" style="font-size:9pt"><b><%=groupName%></b></td>
<td width="13%" height="30" bgcolor="#F3FFE4"> </td>
<td width="25%" height="30" bgcolor="#F3FFE4">
<div align="center"></div>
</td>
</tr>
<tr>
<td colspan="4" height="1" bgcolor="#63A80E"></td>
</tr>
<tr>
<td colspan="4" height="1" bgcolor="#bbbbbb"></td>
</tr>
<%}
ArrayList docIdList=new ArrayList();
if(!"".equals(groupDoc)) docIdList=Util.TokenizerString(groupDoc,",");
for(int k=0;k<docIdList.size();k++){
int docId=Util.getIntValue((String)docIdList.get(k));
RecordSet3.executeSql("select id from docdetail where id ="+docId);
if(!RecordSet3.next())
continue;
int readCount_int = 0 ;
docsubject=dci.getDocname(""+docId);
doclastmoddate=dci.getDocLastModDate(""+docId);
readCount_int = 0 ;
String sql_readCount ="select sum(readCount) from docreadtag where docid =" + docId;
RecordSet3.execute(sql_readCount);
if(RecordSet3.next()) readCount_int = Util.getIntValue(RecordSet3.getString(1),0) ;
%>
<tr>
<td width="4%" height="30">
<div align="center"><img src="images/icon3_wev8.gif" width="6" height="9"></div>
</td>
<td width="58%" height="30" style="font-size:9pt"><a href="/docs/docs/DocDsp.jsp?id=<%=docId%>" target="_blank"><%=docsubject%></a></td>
<td width="13%" height="30" style="font-size:9pt">
<div align="center"><font face="Verdana" ><%=readCount_int%></font></div>
</td>
<td width="25%" height="30" style="font-size:9pt">
<div align="center"><font face="Verdana" ><%=doclastmoddate%></font></div>
</td>
</tr>
<tr>
<td colspan="4" height="1" background="images/r_title_bg2_wev8.gif"></td>
</tr>
<%}}%>
<tr>
<td colspan="4" height="3" bgcolor="#E6E6E6"></td>
</tr>
<tr>
<td colspan="4" height="1" bgcolor="#63A80E"></td>
</tr>
</table>
</td>
<td width="5"> </td>
</tr>
</table>
</body>
</html>
<script language="javaScript">
function imgSet(obj) {
var imgWidth = obj.width;
var imgHeight = obj.height;
if(155*imgHeight>=115*imgWidth)
obj.width = imgWidth*115/imgHeight;
else if(155*imgHeight<115*imgWidth)
obj.width = 155;
}
</script>