SelectByDec.jsp
22.4 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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<!-- added by wcd 2014-07-08 -->
<%@ page import="weaver.conn.*" %>
<%@ page import="weaver.file.Prop,
weaver.general.GCONST" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page" />
<jsp:useBean id="RoleComInfo" class="weaver.hrm.roles.RolesComInfo" scope="page" />
<jsp:useBean id="JobTitlesComInfo" class="weaver.hrm.job.JobTitlesComInfo" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" />
<jsp:useBean id="adci" class="weaver.hrm.appdetach.AppDetachComInfo" scope="page" />
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<!-- added by wcd 2014-07-08 start -->
<%!
/**
* 取得指定分部下所有分部id(包括指定分部id)
* @param subId
* @return
*/
public String getAllSubId(String subId,String ids){
RecordSet rs_s = new RecordSet();
rs_s.executeSql("select id from HrmSubCompany where id <> " + subId + " and supsubcomid = "+subId);
while(rs_s.next()){
ids += ","+rs_s.getString(1);
ids = this.getAllSubId(rs_s.getString(1), ids);
}
return ids;
}
/**
* 取得指定部门下所有部门id(包括指定部门id)
* @param deptId
* @param ids
* @return
*/
public String getAllDeptId(String deptId,String ids){
RecordSet rs_d = new RecordSet();
rs_d.executeSql("select id from HrmDepartment where id <> " + deptId + " and supdepid = "+deptId);
while(rs_d.next()){
ids += ","+rs_d.getString(1);
ids = this.getAllDeptId(rs_d.getString(1), ids);
}
return ids;
}
%>
<!-- added by wcd 2014-07-08 end -->
<%
String mode=Prop.getPropValue(GCONST.getConfigFile() , "authentic");
String tabid = Util.null2String(request.getParameter("tabid"));
String nodeid = Util.null2String(request.getParameter("nodeid"));
String groupid = Util.null2String(request.getParameter("groupid"));
String companyid = Util.null2String(request.getParameter("companyid"));
String subcompanyid = Util.null2String(request.getParameter("subcompanyid"));
String departmentid = Util.null2String(request.getParameter("departmentid"));
String needsystem = Util.null2String(request.getParameter("needsystem"));
String isNoAccount = Util.null2String(request.getParameter("isNoAccount"));
int uid=user.getUID();
if(tabid.equals("")) tabid="0";
String rem=(String)session.getAttribute("decresourcemulti");
if(rem==null){
Cookie[] cks= request.getCookies();
for(int i=0;i<cks.length;i++){
//System.out.println("ck:"+cks[i].getName()+":"+cks[i].getValue());
if(cks[i].getName().equals("decresourcemulti"+uid)){
rem=cks[i].getValue();
break;
}
}
}
if(rem!=null)
rem=tabid+rem.substring(1);
else
rem=tabid;
if(!nodeid.equals(""))
rem=rem.substring(0,1)+"|"+nodeid;
session.setAttribute("decresourcemulti",rem);
Cookie ck = new Cookie("decresourcemulti"+uid,rem);
ck.setMaxAge(30*24*60*60);
response.addCookie(ck);
String[] atts=Util.TokenizerString2(rem,"|");
if(tabid.equals("0")&&atts.length>1){
nodeid=atts[1];
if(nodeid.indexOf("com")>-1){
//subcompanyid=nodeid.substring(nodeid.indexOf("_")+1);
//System.out.println("subcompanyid"+subcompanyid);
}
else{
//departmentid=nodeid.substring(nodeid.lastIndexOf("_")+1);
//System.out.println("departmentid"+departmentid);
}
}
else if(tabid.equals("1") && atts.length>1) {
groupid=atts[1];
}
Calendar today = Calendar.getInstance();
String currentdate = Util.add0(today.get(Calendar.YEAR), 4) +"-"+
Util.add0(today.get(Calendar.MONTH) + 1, 2) +"-"+
Util.add0(today.get(Calendar.DAY_OF_MONTH), 2) ;
// String lastname = Util.toScreenToEdit(request.getParameter("searchid"),user.getLanguage(),"0");
String lastname = Util.null2String(request.getParameter("lastname"));
String resourcetype = Util.null2String(request.getParameter("resourcetype"));
String resourcestatus = Util.null2String(request.getParameter("resourcestatus"));
String jobtitle = Util.null2String(request.getParameter("jobtitle"));
//String departmentid = Util.null2String(request.getParameter("departmentid"));
String sqlwhere = Util.null2String(request.getParameter("sqlwhere"));
String status = Util.null2String(request.getParameter("status"));
String firstname = Util.null2String(request.getParameter("firstname"));
String seclevelto=Util.fromScreen(request.getParameter("seclevelto"),user.getLanguage());
String roleid = Util.null2String(request.getParameter("roleid"));
boolean isoracle = (RecordSet.getDBType()).equals("oracle") ;
if(tabid.equals("0")&&departmentid.equals("")&&subcompanyid.equals("")&&companyid.equals("")) departmentid=user.getUserDepartment()+"";
if(departmentid.equals("0")) departmentid="";
if(subcompanyid.equals("0")) subcompanyid="";
// added by wcd 2014-07-08 start
RecordSet.executeSql("select detachable from SystemSet");
int detachable=0;
if(RecordSet.next()){
detachable=RecordSet.getInt("detachable");
session.setAttribute("detachable",String.valueOf(detachable));
}
int ishead = 0;
if(!sqlwhere.equals("")){
ishead = 1;
}else{
sqlwhere = " where 1=1 ";
ishead = 1;
}
if(adci.isUseAppDetach()){
String appdetawhere = adci.getScopeSqlByHrmResourceSearch(user.getUID()+"",true,"resource_hrmresource");
String tempstr= (appdetawhere!=null&&!"".equals(appdetawhere)?(" and " + appdetawhere):"");
sqlwhere+=tempstr;
}
String alllevel = Util.null2String(request.getParameter("alllevel"));//是否包含下级分部或部门
String search = Util.null2String(request.getParameter("search"));
if(alllevel.equals("") && search.equals("")){
alllevel = "1";
}
if("0".equals("1")){//判断是否包含下级机构
if(sqlwhere.length() == 0){
if(subcompanyid.trim().length() != 0){
subcompanyid = this.getAllSubId(subcompanyid,subcompanyid);
sqlwhere = " and subcompanyid1 in("+subcompanyid+") ";
}else if(departmentid.trim().length() != 0){
departmentid = this.getAllDeptId(departmentid,departmentid);
sqlwhere = " and departmentid in("+departmentid+") ";
}
}else{
if(sqlwhere.indexOf("subcompanyid1")!=-1){
if(subcompanyid.trim().length() == 0 || detachable == 1){
subcompanyid = sqlwhere.substring(sqlwhere.indexOf("(")+1,sqlwhere.indexOf(")"));
}
if(detachable == 0){
subcompanyid = this.getAllSubId(subcompanyid,subcompanyid);
}
sqlwhere = "";
if(subcompanyid.trim().length() != 0){
sqlwhere += " and subcompanyid1 in("+subcompanyid+") ";
}
if(departmentid.trim().length() != 0){
departmentid = this.getAllDeptId(departmentid,departmentid);
sqlwhere += (subcompanyid.trim().length() != 0?" and ":" and ")+" departmentid in("+departmentid+") ";
}
}else if(sqlwhere.indexOf("departmentid")!=-1){
if(departmentid.trim().length() == 0 || detachable == 1){
departmentid = sqlwhere.substring(sqlwhere.indexOf("(")+1,sqlwhere.indexOf(")"));
}
if(detachable == 0){
departmentid = this.getAllDeptId(departmentid,departmentid);
}
if(departmentid.trim().length() != 0){
sqlwhere = "and departmentid in("+departmentid+") ";
}
}
}
}else {
if(!departmentid.equals("")){
if(alllevel.equals("1"))departmentid = this.getAllDeptId(departmentid,departmentid);
if(ishead==0){
ishead = 1;
sqlwhere += " where departmentid in(" + departmentid +") " ;
}
else
sqlwhere += " and departmentid in(" + departmentid +") " ;
}
if(departmentid.equals("")&&subcompanyid.trim().length() > 0){
//subcompanyid=SubCompanyComInfo.getSubCompanyTreeStr(subcompanyid)+subcompanyid;
if(alllevel.equals("1"))subcompanyid = this.getAllSubId(subcompanyid,subcompanyid);
if(ishead==0){
ishead = 1;
sqlwhere += " where subcompanyid1 in(" + subcompanyid +") " ;
}
else
sqlwhere += " and subcompanyid1 in(" + subcompanyid +") " ;
}
}
// added by wcd 2014-07-08 end
if(!sqlwhere.equals("")) ishead = 1;
if(status.equals("-1")) status = "";
if(!lastname.equals("")){
if(ishead==0){
ishead = 1;
sqlwhere += " where (lastname like '%"+Util.fromScreen2(lastname,user.getLanguage())+"%' or pinyinlastname like '%"+Util.fromScreen2(lastname,user.getLanguage()).toLowerCase()+"%')";
}
else
sqlwhere += " and( lastname like '%" + Util.fromScreen2(lastname,user.getLanguage()) +"%' or pinyinlastname like '%"+Util.fromScreen2(lastname,user.getLanguage()).toLowerCase()+"%')";
}
if(!firstname.equals("")){
if(ishead==0){
ishead = 1;
sqlwhere += " where firstname like '%" + Util.fromScreen2(firstname,user.getLanguage()) +"%' ";
}
else
sqlwhere += " and firstname like '%" + Util.fromScreen2(firstname,user.getLanguage()) +"%' ";
}
if(!seclevelto.equals("")){
if(ishead==0){
ishead = 1;
sqlwhere += " where HrmResource.seclevel <= '"+ seclevelto + "' ";
}
else
sqlwhere += " and HrmResource.seclevel <= '"+ seclevelto + "' ";
}
if(!resourcetype.equals("")){
if(ishead==0){
ishead = 1;
sqlwhere += " where resourcetype = '"+ resourcetype + "' ";
}
else
sqlwhere += " and resourcetype = '"+ resourcetype + "' ";
}
if(!jobtitle.equals("")){
if(ishead==0){
ishead = 1;
sqlwhere += " where jobtitle in(select id from HrmJobTitles where jobtitlename like '%" + Util.fromScreen2(jobtitle,user.getLanguage()) +"%') ";
//sqlwhere += " where jobtitle ="+jobtitle;
}
else
sqlwhere += " and jobtitle in(select id from HrmJobTitles where jobtitlename like '%" + Util.fromScreen2(jobtitle,user.getLanguage()) +"%') ";
//sqlwhere += " and jobtitle ="+jobtitle;
}
if(!status.equals("")&&!status.equals("8")&&!status.equals("9")){
if(ishead==0){
ishead = 1;
sqlwhere += " where status =" + status +" " ;
}
else
sqlwhere += " and status =" + status +" " ;
}
if(status.equals("")||status.equals("8")||status.equals("9")){
if(ishead==0){
ishead = 1;
sqlwhere += " where (status =0 or status = 1 or status = 2 or status = 3) " ;
}
else
sqlwhere += " and (status =0 or status = 1 or status = 2 or status = 3) ";
}
if(!roleid.equals("")){
String roleSql = " SELECT distinct resourceid FROM ( "+
" SELECT a.id AS resourceid, b.roleid , b.rolelevel FROM HrmResource a, HrmRoleMembers b "+
" WHERE (a.id=b.resourceid and b.resourcetype=1) "+
" UNION ALL "+
" SELECT a.id AS resourceid, b.roleid , b.rolelevel FROM HrmResourceManager a, HrmRoleMembers b "+
" WHERE (a.id=b.resourceid and b.resourcetype IN(7,8)) "+
" UNION ALL "+
" SELECT a.id AS resourceid, b.roleid , b.rolelevel FROM HrmResource a, HrmRoleMembers b "+
" WHERE (a.subcompanyid1 = b.resourceid AND a.seclevel>=b.seclevelfrom AND a.seclevel<=b.seclevelto AND b.resourcetype=2) "+
" UNION ALL "+
" SELECT a.id AS resourceid, b.roleid , b.rolelevel FROM HrmResource a, HrmRoleMembers b "+
" WHERE (a.departmentid = b.resourceid AND a.seclevel>=b.seclevelfrom AND a.seclevel<=b.seclevelto AND b.resourcetype=3) "+
" UNION ALL "+
" SELECT a.id AS resourceid, b.roleid , b.rolelevel FROM HrmResource a, HrmRoleMembers b "+
" WHERE (a.jobtitle = b.resourceid AND b.resourcetype=5 AND (b.jobtitlelevel=1 OR (b.jobtitlelevel=2 AND a.subcompanyid1 IN(b.subdepid)) OR (b.jobtitlelevel=3 AND a.departmentid IN(b.subdepid))))) t "+
" WHERE roleid= "+roleid;
if(ishead==0){
ishead = 1;
sqlwhere += " where HrmResource.ID in ("+roleSql+" ) " ;
}
else
sqlwhere += " and HrmResource.ID in ("+roleSql+" ) " ;
}
String noAccountSql="";
if(!isNoAccount.equals("1")){
if(mode==null||!mode.equals("ldap")){
if(ishead==0){
ishead = 1;
noAccountSql=" where loginid is not null "+(RecordSet.getDBType().equals("oracle")?"":" and loginid<>'' ");
}else{
noAccountSql=" and loginid is not null "+(RecordSet.getDBType().equals("oracle")?"":" and loginid<>'' ");
}
}else{
//loginid、account字段整合 qc:128484
//if(ishead==0){
// ishead = 1;
// noAccountSql=" where account is not null "+(RecordSet.getDBType().equals("oracle")?"":" and account<>'' ");
//}else{
// noAccountSql=" and account is not null "+(RecordSet.getDBType().equals("oracle")?"":" and account<>'' ");
//}
if(ishead==0){
ishead = 1;
noAccountSql=" where loginid is not null "+(RecordSet.getDBType().equals("oracle")?"":" and loginid<>'' ");
}else{
noAccountSql=" and loginid is not null "+(RecordSet.getDBType().equals("oracle")?"":" and loginid<>'' ");
}
}
}
sqlwhere=sqlwhere+(isNoAccount.equals("1")?"":noAccountSql); //是否显示无账号人员
/*String sqlstr = "select HrmResource.id,lastname,resourcetype,startdate,enddate,jobtitlename,departmentid "+
"from HrmResource , HrmJobTitles " + sqlwhere ;
if(ishead ==0) sqlstr += "where HrmJobTitles.id = HrmResource.jobtitle " ;
else sqlstr += " and HrmJobTitles.id = HrmResource.jobtitle " ;*/
String sqlstr = "";
if(mode==null||!mode.equals("ldap")){//win
sqlstr = "select HrmResource.id,lastname,departmentid,jobtitle "+
"from HrmResource " + sqlwhere+" order by dsporder,lastname";
if(tabid.equals("1")&&!groupid.equals("")){
if(!sqlwhere.equals("")){
sqlstr="select id,lastname,departmentid,jobtitle from hrmresource "+sqlwhere+" and id in(select userid from HrmGroupMembers where groupid="+groupid+") order by dsporder,lastname";
}else{
sqlstr="select t1.id,t1.lastname,t1.departmentid,t1.jobtitle from hrmresource t1,HrmGroupMembers t2 where t1.id=t2.userid and t2.groupid="+groupid+(isNoAccount.equals("1")?"":noAccountSql)+" order by t1.dsporder,t1.lastname";
}
}
if(tabid.equals("0")&&!companyid.equals("")){
sqlstr="select id,lastname,departmentid,jobtitle from hrmresource ";
sqlstr+=sqlwhere;
if(!isoracle) sqlstr+=" ";
sqlstr+=" order by dsporder,lastname";
}else if(tabid.equals("0")&&!subcompanyid.equals("")){
sqlstr="select id,lastname,departmentid,jobtitle from hrmresource ";
sqlstr+=sqlwhere;
//if(!isoracle) sqlstr+="and loginid<>''";
sqlstr+=" order by dsporder,lastname";
}else if(tabid.equals("0")&&!departmentid.equals("")){
sqlstr="select id,lastname,departmentid,jobtitle from hrmresource ";
sqlstr+=sqlwhere;
if(!isoracle) sqlstr+=" ";
sqlstr+=" order by dsporder,lastname";
}
//add by alan for td:10343
boolean isInit = Util.null2String(request.getParameter("isinit")).equals("");//是否点击过搜索
if((tabid.equals("2") && isInit) ||(tabid.equals("0") && nodeid.equals(""))) sqlstr = "select HrmResource.id,lastname,departmentid,jobtitle from HrmResource WHERE 1=2";
}else{//ldap
sqlstr = "select HrmResource.id,lastname,departmentid,jobtitle "+
"from HrmResource " + sqlwhere+" order by dsporder,lastname"; ;
if(tabid.equals("1")&&!groupid.equals("")){
if(!sqlwhere.equals("")){
sqlstr="select id,lastname,departmentid,jobtitle from hrmresource "+sqlwhere+" and id in(select userid from HrmGroupMembers where groupid="+groupid+") order by dsporder,lastname";
}else{
sqlstr="select t1.id,t1.lastname,t1.departmentid,t1.jobtitle from hrmresource t1,HrmGroupMembers t2 where t1.id=t2.userid and t2.groupid="+groupid+(isNoAccount.equals("1")?"":noAccountSql)+" order by t1.dsporder,t1.lastname";
}
}
if(tabid.equals("0")&&!companyid.equals("")){
sqlstr="select id,lastname,departmentid,jobtitle from hrmresource ";
sqlstr+=sqlwhere;
if(!isoracle) {
sqlstr+=" ";
}
sqlstr+=" order by dsporder,lastname";
}else if(tabid.equals("0")&&!subcompanyid.equals("")){
sqlstr="select id,lastname,departmentid,jobtitle from hrmresource ";
sqlstr+=sqlwhere;
if(!isoracle) {
sqlstr+=" ";
}
sqlstr+=" order by dsporder,lastname";
}else if(tabid.equals("0")&&!departmentid.equals("")){
sqlstr="select id,lastname,departmentid,jobtitle from hrmresource ";
sqlstr+=sqlwhere;
if(!isoracle) {
sqlstr+=" ";
}
sqlstr+=" order by dsporder,lastname";
}
//add by alan for td:10343
boolean isInit = Util.null2String(request.getParameter("isinit")).equals("");//是否点击过搜索
if((tabid.equals("2") && isInit) ||(tabid.equals("0") && nodeid.equals(""))){
sqlstr = "select HrmResource.id,lastname,departmentid,jobtitle from HrmResource WHERE 1=2";
}
}
%>
<HTML><HEAD>
<LINK REL=stylesheet type=text/css HREF=/css/Weaver_wev8.css>
<script type="text/javascript">
try{
parent.parent.setTabObjName("<%=SystemEnv.getHtmlLabelNames("33210",user.getLanguage())%>");
}catch(e){
if(window.console)console.log(e+"-->ResourceBrowserByRight.jsp");
}
var dialog = null;
try{
dialog = parent.parent.parent.getDialog(parent.parent);
}
catch(e){}
</script>
</HEAD>
<BODY style="height: 85%;">
<div class="zDialog_div_content">
<%//@ include file="/systeminfo/RightClickMenuConent.jsp" %>
<%//@ include file="/systeminfo/RightClickMenu.jsp" %>
<!--########Browser Table Start########-->
<TABLE width=100% class="BroswerStyle" cellspacing="0" STYLE="margin-top:0">
<!-- added by wcd 2014-07-08 start -->
<TR>
<TD align="right" colspan="3">
<%if(tabid.equals("0")){ %>
<input type="checkbox" id="alllevel" name="alllevel" value="1" <%=alllevel.equals("1")?"checked='checked'":""%>/><%=SystemEnv.getHtmlLabelName(33454,user.getLanguage())%>
<input class=inputstyle type="hidden" name="search" value="1">
<%} %>
<input type="checkbox" value="1" name="isNoAccount" id="isNoAccount" <%=isNoAccount.equals("1")?"checked='checked'":""%>><%=SystemEnv.getHtmlLabelName(31504,user.getLanguage())%>
</TD>
</TR>
</TABLE>
<!-- <div id="tableList" style="overflow-y:scroll;width:100%;height:295px"> </div> -->
<%
String tableString=""+
"<table instanceid=\"BrowseTable\" pageId=\""+PageIdConst.HRM_SelectByDec+"\" pagesize=\""+PageIdConst.getPageSize(PageIdConst.HRM_SelectByDec,user.getUID(),PageIdConst.HRM)+"\" datasource=\"weaver.hrm.HrmDataSource.getHrmResourceList\" sourceparams=\"sqlstr:"+Util.toHtmlForSplitPage(sqlstr)+"\" tabletype=\"none\">"+
"<sql backfields=\"*\" sqlform=\"temp\" sqlorderby=\"id\" sqlprimarykey=\"id\" sqlsortway=\"desc\" />"+
"<head>";
tableString+= "<col width=\"0%\" hide=\"true\" text=\""+SystemEnv.getHtmlLabelName(413,user.getLanguage())+"\" column=\"ids\" orderkey=\"ids\"/>";
tableString+= "<col width=\"30%\" text=\""+SystemEnv.getHtmlLabelName(413,user.getLanguage())+"\" column=\"lastnames\" orderkey=\"lastnames\"/>";
tableString += "<col width=\"30%\" text=\""+SystemEnv.getHtmlLabelName(6086,user.getLanguage())+"\" column=\"jobtitlenames\" orderkey=\"jobtitlenames\"/>";
tableString += "<col width=\"30%\" text=\""+SystemEnv.getHtmlLabelName(124,user.getLanguage())+"\" column=\"departmentids\" orderkey=\"departmentids\" transmethod=\"weaver.hrm.company.DepartmentComInfo.getDepartmentname\"/>"+
"</head>"+
"</table>";
%>
<input type="hidden" name="pageId" id="pageId" value="<%=PageIdConst.HRM_SelectByDec %>"/>
<wea:SplitPageTag tableString="<%=tableString%>" isShowTopInfo="false" mode="run"/>
<div id="zDialog_div_bottom" class="zDialog_div_bottom" style="padding:1px !important;height: 15%;">
<wea:layout type="2col" needImportDefaultJsAndCss="false">
<wea:group context="">
<wea:item type="toolbar">
<input type="button" class=zd_btn_submit onclick="btnclear_onclick();" id=btnclear value="<%=SystemEnv.getHtmlLabelName(311,user.getLanguage())%>">
<input type="button" class=zd_btn_cancle onclick="btncancel_onclick();" id=btncancel value="<%=SystemEnv.getHtmlLabelName(201,user.getLanguage())%>">
</wea:item>
</wea:group>
</wea:layout>
<script type="text/javascript">
jQuery(document).ready(function(){
resizeDialog(document);
});
</script>
</div>
<!--########//Select Table End########-->
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
var objid = <%=tabid%>;
if(objid == 0 || objid ==1){
$("#btnsub").next().css("display","none");
}else{
$("#btnsub").next().css("display","inline");
}
})
function BrowseTable_onmouseover(e){
e=e||event;
var target=e.srcElement||e.target;
if("TD"==target.nodeName){
jQuery(target).parents("tr")[0].className = "Selected";
}else if("A"==target.nodeName){
jQuery(target).parents("tr")[0].className = "Selected";
}
}
function BrowseTable_onmouseout(e){
var e=e||event;
var target=e.srcElement||e.target;
var p;
if(target.nodeName == "TD" || target.nodeName == "A" ){
p=jQuery(target).parents("tr")[0];
if( p.rowIndex % 2 ==0){
p.className = "DataDark"
}else{
p.className = "DataLight"
}
}
}
function BrowseTable_onclick(e){
var e=e||event;
var target=e.srcElement||e.target;
if( target.nodeName =="TD"||target.nodeName =="A" ){
var curTr=jQuery(target).parents("tr")[0];
var returnjson = {
id:jQuery(curTr.cells[0]).text(),
name:jQuery(curTr.cells[1]).text(),
a1:jQuery(curTr.cells[3]).text(),
a2:jQuery(curTr.cells[4]).text()};
if(dialog){
try{
dialog.callback(returnjson);
}catch(e){}
try{
dialog.close(returnjson);
}catch(e){}
}else{
window.parent.parent.returnValue = returnjson;
window.parent.parent.close();
}
}
}
function btnclear_onclick(){
var returnjson = {id:"",name:""};
if(dialog){
try{
dialog.callback(returnjson);
}catch(e){}
try{
dialog.close(returnjson);
}catch(e){}
}else{
window.parent.parent.returnValue = returnjson;
window.parent.parent.close();
}
}
function btnsub_onclick(){
window.parent.frame1.SearchForm.btnsub.click();
}
function btncancel_onclick(){
if(dialog){
dialog.close();
}else{
window.parent.parent.close();
}
}
function afterDoWhenLoaded(){
$("#_xTable").find("table.ListStyle tbody").children("tr[class!='Spacing']").each(function(){
var tr = jQuery(this);
tr.bind("click",function(){
var id = tr.children("td:first").next().text();
var name = tr.children("td:first").next().next().text();
var a1 = tr.children("td:first").next().next().next().text();
var a2 = tr.children("td:first").next().next().next().next().text();
var returnjson = {'id':id,'name':name,'a1':a1,'a2':a2};
if(dialog){
try{
dialog.callback(returnjson);
}catch(e){}
try{
dialog.close(returnjson);
}catch(e){}
}else{
window.parent.parent.returnValue = returnjson;
window.parent.parent.close();
}
});
});
}
$(function(){
//$("#BrowseTable").mouseover(BrowseTable_onmouseover);
//$("#BrowseTable").mouseout(BrowseTable_onmouseout);
//$("#BrowseTable").click(BrowseTable_onclick);
//$("#btncancel").click(btncancel_onclick);
//$("#btnsub").click(btnsub_onclick);
//$("#btnclear").click(btnclear_onclick);
});
</script>
</BODY>
</HTML>