HrmTrainTypeEdit.jsp 15 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
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.conn.*" %>

<%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="SubCategoryComInfo" class="weaver.docs.category.SubCategoryComInfo" scope="page" />
<jsp:useBean id="SecCategoryComInfo" class="weaver.docs.category.SecCategoryComInfo" scope="page" />
<jsp:useBean id="MainCategoryComInfo" class="weaver.docs.category.MainCategoryComInfo" scope="page" />

<HTML><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
</head>
<%
int id = Util.getIntValue(request.getParameter("id"),0);
 rs.executeProc("HrmTrainType_SelectById",""+id);
 
	String name = "";
	String description = "";
	String typecontent = "";
	String typeaim = "";
	String typedocurl ="";
	String typetesturl = "";
	String typeoperator ="";
 while(rs.next()){
	name = Util.toScreenToEdit(rs.getString("name"),user.getLanguage());
	description = Util.toScreenToEdit(rs.getString("description"),user.getLanguage());
	typecontent = Util.toScreenToEdit(rs.getString("typecontent"),user.getLanguage());	
	typeaim = Util.toScreenToEdit(rs.getString("typeaim"),user.getLanguage());
	typedocurl = Util.toScreenToEdit(rs.getString("typedocurl"),user.getLanguage());
	typetesturl = Util.toScreenToEdit(rs.getString("typetesturl"),user.getLanguage());
	typeoperator = Util.toScreenToEdit(rs.getString("typeoperator"),user.getLanguage());
	}
	
String namepar=Util.null2String(request.getParameter("name"));
if(!namepar.equals("")){
  name = namepar;
}

String descriptionpar=Util.null2String(request.getParameter("description"));
if(!descriptionpar.equals("")){
  description = descriptionpar;
}

 

String typecontentpar=Util.null2String(request.getParameter("typecontent"));
if(!typecontentpar.equals("")){
  typecontent = typecontentpar;
}

String typeaimpar=Util.null2String(request.getParameter("typeaim"));
if(!typeaimpar.equals("")){
  typeaim = typeaimpar;
}

String typeoperatorpar=Util.null2String(request.getParameter("typeoperator"));
if(!typeoperatorpar.equals("")){
  typeoperator = typeoperatorpar;
}

String mainid=Util.null2String(request.getParameter("mainid"));
String subid=Util.null2String(request.getParameter("subid"));
int secid = Util.getIntValue(request.getParameter("typedocurl"),0);
if(secid != 0){
  typedocurl = ""+secid;
}

if(mainid.equals("")){
  mainid = SubCategoryComInfo.getMainCategoryid(SecCategoryComInfo.getSubCategoryid(typedocurl));
}
if(subid.equals("")){
  subid = SecCategoryComInfo.getSubCategoryid(typedocurl);
}

String categoryname="";
String subcategoryid="";
String cusertype="";

ArrayList mainids=new ArrayList();
ArrayList subids=new ArrayList();
ArrayList secids=new ArrayList();
char flag = 2;
String tempsubcategoryid="";

if(user.getType()==0)
{
    RecordSet.executeProc("DocUserCategory_SMainByUser",""+user.getUID()+flag+user.getType());
    while(RecordSet.next()){
      mainids.add(RecordSet.getString("mainid"));
    }
    RecordSet.executeProc("DocUserCategory_SSubByUser",""+user.getUID()+flag+user.getType());
    while(RecordSet.next()){
      subids.add(RecordSet.getString("subid"));
    }    

    RecordSet.executeProc("DocUserCategory_SSecByUser",""+user.getUID()+flag+user.getType());
    while(RecordSet.next()){
      secids.add(RecordSet.getString("secid"));
    }    
}else{
    String subid2="";
    RecordSet.executeProc("DocSecCategory_SByCustomerType",""+user.getType()+flag+user.getSeclevel());
    
    while(RecordSet.next()){
        secids.add(RecordSet.getString("id"));
        if(!tempsubcategoryid.equals(RecordSet.getString("subcategoryid"))){
            subids.add(RecordSet.getString("subcategoryid"));
        }
        tempsubcategoryid=RecordSet.getString("subcategoryid");
    }
    for(int m=0;m<subids.size();m++){
        if(m<subids.size()-1)
        subid2 += (String)subids.get(m)+",";
        else 
        subid2 += (String)subids.get(m);
    }

    String sql="select distinct(maincategoryid) from DocSubCategory where id in ("+subid2+")  order by maincategoryid";
    RecordSet.executeSql(sql);
    while(RecordSet.next()){
        mainids.add(RecordSet.getString("maincategoryid"));
    }
}

if(secid!=0){
	RecordSet.executeProc("Doc_SecCategory_SelectByID",secid+"");
	RecordSet.next();
	 categoryname=Util.toScreenToEdit(RecordSet.getString("categoryname"),user.getLanguage());
	 subcategoryid=Util.null2String(""+RecordSet.getString("subcategoryid"));	 	 	 
	 cusertype=Util.null2String(""+RecordSet.getString("cusertype"));
	 cusertype = cusertype.trim();	 
}


String testmainid=Util.null2String(request.getParameter("testmainid"));
String testsubid=Util.null2String(request.getParameter("testsubid"));
int testsecid = Util.getIntValue(request.getParameter("typetesturl"),0);
if(testsecid != 0){
  typetesturl = ""+testsecid;
}
if(testmainid.equals("")){
  testmainid = SubCategoryComInfo.getMainCategoryid(SecCategoryComInfo.getSubCategoryid(typetesturl));
}
if(testsubid.equals("")){
  testsubid = SecCategoryComInfo.getSubCategoryid(typetesturl);
}

String testcategoryname="";
String testsubcategoryid="";
String testcusertype="";

ArrayList testmainids=new ArrayList();
ArrayList testsubids=new ArrayList();
ArrayList testsecids=new ArrayList();
char testflag = 2;
String testtempsubcategoryid="";

if(user.getType()==0)
{
    RecordSet.executeProc("DocUserCategory_SMainByUser",""+user.getUID()+testflag+user.getType());
    while(RecordSet.next()){
      testmainids.add(RecordSet.getString("mainid"));
    }
    RecordSet.executeProc("DocUserCategory_SSubByUser",""+user.getUID()+testflag+user.getType());
    while(RecordSet.next()){
      testsubids.add(RecordSet.getString("subid"));
    }    

    RecordSet.executeProc("DocUserCategory_SSecByUser",""+user.getUID()+testflag+user.getType());
    while(RecordSet.next()){
      testsecids.add(RecordSet.getString("secid"));
    }    
}else{
    String testsubid2="";
    RecordSet.executeProc("DocSecCategory_SByCustomerType",""+user.getType()+testflag+user.getSeclevel());
    
    while(RecordSet.next()){
        testsecids.add(RecordSet.getString("id"));
        if(!tempsubcategoryid.equals(RecordSet.getString("subcategoryid"))){
            testsubids.add(RecordSet.getString("subcategoryid"));
        }
        testtempsubcategoryid=RecordSet.getString("subcategoryid");
    }
    for(int m=0;m<testsubids.size();m++){
        if(m<testsubids.size()-1)
        testsubid2 += (String)testsubids.get(m)+",";
        else 
        testsubid2 += (String)testsubids.get(m);
    }

    String sql="select distinct(maincategoryid) from DocSubCategory where id in ("+testsubid2+")  order by maincategoryid";
    RecordSet.executeSql(sql);
    while(RecordSet.next()){
        testmainids.add(RecordSet.getString("maincategoryid"));
    }
}

if(testsecid!=0){
	RecordSet.executeProc("Doc_SecCategory_SelectByID",testsecid+"");
	RecordSet.next();
	 testcategoryname=Util.toScreenToEdit(RecordSet.getString("categoryname"),user.getLanguage());
	 testsubcategoryid=Util.null2String(""+RecordSet.getString("subcategoryid"));	 	 	 
	 testcusertype=Util.null2String(""+RecordSet.getString("cusertype"));
	 testcusertype = cusertype.trim();	 
}

String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename =SystemEnv.getHtmlLabelName(89,user.getLanguage())+":"+SystemEnv.getHtmlLabelName(6130,user.getLanguage());

String needfav ="1";
String needhelp ="";
boolean canEdit = false;
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
if(HrmUserVarify.checkUserRight("HrmTrainTypeEdit:Edit", user)){
	canEdit = true;
RCMenu += "{"+SystemEnv.getHtmlLabelName(93,user.getLanguage())+",javascript:onSave(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
if(HrmUserVarify.checkUserRight("HrmTrainType:Log", user)){
RCMenu += "{"+SystemEnv.getHtmlLabelName(83,user.getLanguage())+",/systeminfo/SysMaintenanceLog.jsp?sqlwhere=where operateitem="+66+" and relatedid="+id+",_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
RCMenu += "{"+SystemEnv.getHtmlLabelName(1290,user.getLanguage())+",/hrm/train/traintype/HrmTrainType.jsp,_self} " ;
RCMenuHeight += RCMenuHeightStep ;
%>	
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<table width=100% height=100% border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="10">
<col width="">
<col width="10">
<tr>
<td height="0" colspan="3"></td>
</tr>
<tr>
<td ></td>
<td valign="top">
<TABLE class=Shadow>
<tr>
<td valign="top">

<FORM id=weaver name=frmMain action="TrainTypeOperation.jsp" method=post onSubmit="return check_form(this,'name,description')">
<TABLE class=viewform>
  <COLGROUP>
  <COL width="20%">
  <COL width="80%">
  <TBODY>
  <TR class=Title>
    <TH colSpan=2><%=SystemEnv.getHtmlLabelName(807,user.getLanguage())%></TH>
  </TR>
  <TR class= Spacing style="height:2px">
    <TD class=line1 colSpan=2 ></TD>
  </TR>
        <TR>
          <TD><%=SystemEnv.getHtmlLabelName(195,user.getLanguage())%></TD>
          <TD class=Field><%=name%></TD>
        </TR>
        <TR style="height:1px"><TD class=Line colSpan=2></TD></TR> 
        <TR>
          <TD><%=SystemEnv.getHtmlLabelName(433,user.getLanguage())%></TD>
          <TD class=Field><%=description%></TD>
        </TR>
        <TR style="height:1px"><TD class=Line colSpan=2></TD></TR> 
        <tr>
          <td><%=SystemEnv.getHtmlLabelName(345,user.getLanguage())%> </td>
          <td class=field><%=rs.getString("typecontent")%></td>
        </tr>  
        <TR style="height:1px"><TD class=Line colSpan=2></TD></TR> 
        <tr>
          <td><%=SystemEnv.getHtmlLabelName(16142,user.getLanguage())%> </td>
          <td class=field><%=rs.getString("typeaim")%></td>
        </tr>  
        <TR style="height:1px"><TD class=Line colSpan=2></TD></TR> 
<!--        
        <tr>
          <td>试卷文档目录 </td>
          <td>
            <input type=text name=typedocurl value="<%=typedocurl%>">
          </td>
        </tr>  
        <tr>
          <td>试卷存放目录 </td>
          <td>
            <input type=text name=typetesturl value="<%=typetesturl%>">
          </td>
        </tr>  
-->                
        <tr>
          <td><%=SystemEnv.getHtmlLabelName(16167,user.getLanguage())%> </td>
          <td class=Field><%=ResourceComInfo.getMulResourcename(typeoperator)%></td>          
        </tr>  
        <TR style="height:1px"><TD class=Line colSpan=2></TD></TR> 
<!--  
 <tr>
  <td>试卷文档存放主目录</td>
  <td class=field>  
  <%
    for(int j=0;j<mainids.size();j++){
	String isselect = "";
 	String curid = (String)mainids.get(j);
 	String curname=MainCategoryComInfo.getMainCategoryname(curid);
	if(!mainid.equals(curid)) continue;
  %>
  <%=curname%>  
  <%}%>  
  </td>
</tr>
  
  <tr>
  <td>试卷文档存放分目录</td>
  <td class=field>
  
  <%for(int m=0;m<subids.size();m++){  
	  	String isselect = "";
		String curid = (String)subids.get(m);
		String curname=SubCategoryComInfo.getSubCategoryname(curid);
	 	String curmainid = SubCategoryComInfo.getMainCategoryid(curid);
	 	if(!curmainid.equals(mainid)) continue;
		if(!subid.equals(curid)) continue;
  %>
  <%=curname%>  
  <%
  }  
  %>
  
  </td>
  </tr>
  
  <tr>
  <td>试卷文档存放子目录</td>
  <td class=field>
  
  <%for(int n=0;n<secids.size();n++){
	    String isselect = "";
   		String curid = (String)secids.get(n);
		String curname=SecCategoryComInfo.getSecCategoryname(curid);
	 	String cursubid = SecCategoryComInfo.getSubCategoryid(curid);
	 	if(!cursubid.equals(subid)) continue;
  		if(!typedocurl.equals(curid)) continue;
  %>
  <%=curname%>  
  <%}  
%>
  
  </td>
  </tr>

<tr>
  <td>培训试卷存放主目录</td>
  <td class=field>
  
  <%
    for(int j=0;j<testmainids.size();j++){
	String isselect = "";
 	String curid = (String)testmainids.get(j);
 	String curname=MainCategoryComInfo.getMainCategoryname(curid);
	if(!testmainid.equals(curid)) continue;
  %>
  <%=curname%>  
  <%}%>
  
  </td>
</tr>
  
  <tr>
  <td>培训试卷存放分目录</td>
  <td class=field>
  
  <%for(int m=0;m<testsubids.size();m++){  
	  	String isselect = "";
		String curid = (String)testsubids.get(m);
		String curname=SubCategoryComInfo.getSubCategoryname(curid);
	 	String curmainid = SubCategoryComInfo.getMainCategoryid(curid);
	 	if(!curmainid.equals(testmainid)) continue;
		if(!testsubid.equals(curid)) continue;
  %>
  <%=curname%>
  <%
  }  
  %>
  
  </td>
  </tr>
  
  <tr>
  <td>培训试卷存放子目录</td>
  <td class=field>  
  <%for(int n=0;n<testsecids.size();n++){
	    String isselect = "";
   		String curid = (String)testsecids.get(n);
		String curname=SecCategoryComInfo.getSecCategoryname(curid);
	 	String cursubid = SecCategoryComInfo.getSubCategoryid(curid);
	 	if(!cursubid.equals(testsubid)) continue;
  		if(!typetesturl.equals(curid)) continue;
  %>
  <%=curname%> 
  <%}  
%>
  
  </td>
  </tr>
-->
        
 </TBODY>
</TABLE>
 
 <input class=inputstyle type=hidden name=operation>
 <input class=inputstyle type=hidden name=id value="<%=id%>">
 </form> 
</td>
</tr>
</TABLE>
</td>
<td></td>
</tr>
<tr>
<td height="0" colspan="3"></td>
</tr>
</table>
  <script language=vbs>
sub onShowResource(inputname,spanname)
	id = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/resource/MutiResourceBrowser.jsp")
	if (Not IsEmpty(id)) then
	if id(0)<> "" then
	    resourceids = id(0)
		resourcename = id(1)
		sHtml = ""
		resourceids = Mid(resourceids,2,len(resourceids))
		resourcename = Mid(resourcename,2,len(resourcename))
		inputname.value= resourceids
		while InStr(resourceids,",") <> 0
			curid = Mid(resourceids,1,InStr(resourceids,",")-1)
			curname = Mid(resourcename,1,InStr(resourcename,",")-1)
			resourceids = Mid(resourceids,InStr(resourceids,",")+1,Len(resourceids))
			resourcename = Mid(resourcename,InStr(resourcename,",")+1,Len(resourcename))
			sHtml = sHtml&"<a href="&linkurl&curid&">"&curname&"</a>&nbsp"
		wend
		sHtml = sHtml&"<a href="&linkurl&resourceids&">"&resourcename&"</a>&nbsp"
		spanname.innerHtml = sHtml
	else	
    	spanname.innerHtml = "<IMG src='/images/BacoError_wev8.gif' align=absMiddle>"
    	inputname.value="0"
	end if
	end if
end sub
</script>

 <script language=javascript>
 function onSave(){
	location="HrmTrainTypeEditDo.jsp?id=<%=id%>";
 }
 function onDelete(){
		if(confirm("<%=SystemEnv.getHtmlNoteName(7,user.getLanguage())%>")) {
			document.frmMain.operation.value="delete";
			document.frmMain.submit();
		}
}
function mainchange(){
    document.frmMain.action="HrmTrainTypeEdit.jsp";
    document.frmMain.submit();
  }
  function subchange(){
    document.frmMain.action="HrmTrainTypeEdit.jsp";
    document.frmMain.submit();
  }
  function testmainchange(){
    document.frmMain.action="HrmTrainTypeEdit.jsp";
    document.frmMain.submit();
  }
  function testsubchange(){
    document.frmMain.action="HrmTrainTypeEdit.jsp";
    document.frmMain.submit();
  }
 </script>
</BODY></HTML>