<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.entry.*,com.csc.library.system.*,com.csc.library.utilities.*"%>

<jsp:useBean id="TAB01" class="com.csc.library.system.Task" scope="page" />

<%TAB01.setChannel(request, response);%>
<%UIManager screen = (UIManager) TAB01.process("SingleEntry", "TAB01");
screen.referLangOff();
	//screen.getRecord("mprefix").referLangOff();
CheckNull chk =new CheckNull();
ThaiUtilities th=new ThaiUtilities();
%>
<html ng-app="myHR">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="../JS/SCREEN.js"></script>
 <script language="javascript" src="../JS/EMPLOYEE.js"></script>
<script language="javascript" src="../JS/PSNSCREEN.js"></script>
<script src="../JS/angular-1.3.15/angular.js" type="text/javascript"></script>	
<script src="../JS/ANGULAR/SCREEN_ANGULAR.js" type="text/javascript"></script>
<script type="text/javascript" src="../JS/ICONSMENU.js"></script>
 <script language="JavaScript"  type="text/javascript" src="../JS/UTILITIES.js"></script>
<script language="javascript">setLang("<%=screen.getUProfile().get("lang")%>");</script>
<script language="JavaScript" type="text/JavaScript">
function GoSave(){confirmSave();}
function GoUpdate(){update();}
function GoDelete(){edelete();}
function GoSearch(){search();}


function goHelp(helpName,inputName){
	var helpReturn;
	var msg = (getLang() ==="tha")?"tdesc":"edesc"
		 if (inputName=="__upper_boxid0" ) {
		 	helpReturn="__upper_boxid0:boxid,V1boxname:"+msg;
		 }else if(inputName=="__upper_boxid1"){
			helpReturn="__upper_boxid1:boxid,V2boxname:"+msg;
		 }else if (inputName=="__upper_boxid2"){
		 	helpReturn="__upper_boxid2:boxid,V3boxname:"+msg;
		 }
	     linkHelp_Return(helpName,helpReturn);
}

function listDblClick(objmyList,mode){
	var str="";
	var text="";
	for(j=objmyList.length;j>0;j--){
		if(objmyList.options[j-1].selected==true){
		text+=objmyList.options[j-1].text+",";
		}
	}
		bCon=confirm("ต้องการลบ "+text+" หรือไม่ ?");
		if(bCon == true){
			for(i=objmyList.length;i > 0;i--){
				if(objmyList.options[i-1].selected==true){
				
				objmyList.options[i-1]  = null;
		
				}else{
				str += objmyList.options[i-1].value+",";
			}
		}
	}
	

 if(mode == '1'){
	setMplText(str);
 }else{
	setMpositionText(str);
 }

}

//------------------------ add to select
function setMplText(str){
 with(document.cscform){ 
		__valid_pl.value = str;
}

}

function setMpositionText(str){
 with(document.cscform){ 
		__valid_position.value = str;
}

}


function compareOptionValues(a, b)
{
  // Radix 10: for numeric values
  // Radix 36: for alphanumeric values
  var sA = parseInt( a.value, 36 );
  var sB = parseInt( b.value, 36 );
  return sA - sB;
}

function addOption(objOption) 
{
   addToOption(objOption,getMyoption()) ;
} // End of addOption()

function getMyoption(){
		return eval("document.forms[0].valid_positionlst");
}

function getGroupListHdden(){
		return eval("document.forms[0].__valid_position");
}

function getGroupNoHdden(){
		return eval("document.forms[0].__groupNo");
}

function addToOption(objOption,destList)
{
     var lengthAll=parseInt(objOption.length)+parseInt(destList.options.length);
		newDestList = new Array( lengthAll );
		  for( var i = destList.options.length - 1; i >= 0; i-- )
		  {
			if ( destList.options[i] != null  )
			{
			   destList.options[i]  = null;
			}
		  }		
		var clen=0;
		  for( len = 0; len <destList.options.length; len++ )
		  {
			if ( destList.options[ len ] != null )
			{
			  newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );
			  clen++;
			}
		  }

		  for ( var j = 0 ; j < objOption.length; j++ )
		  {
			if ( objOption[ j ] != null )
			{
			  newDestList[ clen ] = objOption[ j ];
			  clen++;
			}
		  }

		  //newDestList.sort( compareOptionValues );
		  writeToOption(newDestList,destList);
} // End of addToOption()


function writeToOption(newDestList,destList){
			  var  grphidden=getGroupListHdden();
			  var  grpno=getGroupNoHdden();
			  grphidden.value="";
		  for ( var j = 0; j < newDestList.length; j++ )
		  {
			if ( newDestList[ j ] != null )
			{
			  destList.options[ j ] =new Option(newDestList[ j ].text,newDestList[ j ].value);
			  grphidden.value+=newDestList[ j ].value+",";
			  grpno.value+=newDestList[ j ].value+"#"+newDestList[ j ].text+",";
			}
		  }
}
	function checkAll(){
		with(document.cscform){ 
			for(i=0;i<elements.length;i++){
					if((elements[i].type=="checkbox")&&(elements[i].name.indexOf("mdocument")>0))
							elements[i].checked=true;
			}//end for
		}//end with
	}//end function





// Begin Method of MPERSANELLEVL

	function addOption2(objOption) 
{
   addToOption2(objOption,getMyoption2()) ;
} // End of addOption()

function getMyoption2(){
		return eval("document.forms[0].valid_positionlstPL");
}

function getGroupListHdden2(){
		return eval("document.forms[0].__valid_pl");
}

function getGroupNoHdden2(){
		return eval("document.forms[0].__groupNoPL");
}

function addToOption2(objOption,destList)
{
     var lengthAll=parseInt(objOption.length)+parseInt(destList.options.length);
		newDestList = new Array( lengthAll );
		  for( var i = destList.options.length - 1; i >= 0; i-- )
		  {
			if ( destList.options[i] != null  )
			{
			   destList.options[i]  = null;
			}
		  }		
		var clen=0;
		  for( len = 0; len <destList.options.length; len++ )
		  {
			if ( destList.options[ len ] != null )
			{
			  newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );
			  clen++;
			}
		  }

		  for ( var j = 0 ; j < objOption.length; j++ )
		  {
			if ( objOption[ j ] != null )
			{
			  newDestList[ clen ] = objOption[ j ];
			  clen++;
			}
		  }

		  //newDestList.sort( compareOptionValues );
		  writeToOption2(newDestList,destList);
} // End of addToOption()


function writeToOption2(newDestList,destList){
			  var  grphidden=getGroupListHdden2();
			  var  grpno=getGroupNoHdden2();
			  grphidden.value="";
		  for ( var j = 0; j < newDestList.length; j++ )
		  {
			if ( newDestList[ j ] != null )
			{
			  destList.options[ j ] =new Option(newDestList[ j ].text,newDestList[ j ].value);
			  grphidden.value+=newDestList[ j ].value+",";
			  grpno.value+=newDestList[ j ].value+"#"+newDestList[ j ].text+",";
			}
		  }
}
	function checkAll(){
		with(document.cscform){ 
			for(i=0;i<elements.length;i++){
					if((elements[i].type=="checkbox")&&(elements[i].name.indexOf("mdocument")>0))
							elements[i].checked=true;
			}//end for
		}//end with
	}//end function




	// END Method of MPERSANELLEVL

	function decheckAll(){
		with(document.cscform){
			for(i=0;i<elements.length;i++){
					if((elements[i].type=="checkbox")&&(elements[i].name.indexOf("mdocument")>0))
							elements[i].checked=false;
			}//end for
		}//end with
	}//end function
//-->

/*function addChild(){
	with(document.cscform){
		if(__boxid.value!=""){
			var win = window.open(__childMulti.value+".jsp?__cmd=&__gorec="+
				"&__ack=add"+
				"&__RecNo="+__maxrec.value+"&__headMulti="+__headMulti.value 
				+"&__employeeid="+__employeeid.value
				+"&__StrfixCon="+__StrfixCon.value,
				"Child","left=150,top=20,width=700,height=160,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
			win.focus();
		}else{
			alert(MyCode[0]);
			__employeeid.focus();
			__employeeid.select();
		}
	}
}
*/

function showHelp(page){
     var _help="";
	 _help = page;
	window.open(_help+"?grouplist=,"+document.cscform.__valid_position.value,"Help","left=150,top=150,width=700,height=500,toolbar=no,status=yes,scrollbars=yes");
}

function showHelp2(page){
     var _help="";
	 _help = page;
	window.open(_help+"?grouplist=,"+document.cscform.__valid_pl.value,"Help","left=150,top=150,width=700,height=500,toolbar=no,status=yes,scrollbars=yes");
}

function removeItem(selectbox)
{
 var i;
 for(i=selectbox.options.length-1;i>=0;i--)
 {
 if(selectbox.options[i].selected)
 selectbox.remove(i);
 }
}

function showpic(pic) {
                var param="SHOWPIC.jsp?pic=" +escape(pic);
                window.open(param,"","left=150,top=150,width=350,height=350,toolbar=no,scrollbars=yes");
            }



function GoClean(){
	with(document.cscform){
		if(((typeof __cmd)!="undefined")&&((typeof __confirm)!="undefined")){
			__cmd.value="save";
			__confirm.value="c";
			if((typeof window.parent.leftFrame)!="undefined"){
				with(window.parent.leftFrame.document.cscform){		
					__sysisedit.value="";
				}
			}

			V1boxname.value="";
			V2boxname.value="";
			V3boxname.value="";
			submit();
		}
	}
}

</script>

</head>
<body leftmargin="0" topmargin="0"
	onLoad="MM_preloadImages('../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif')">
  <form name="cscform" method="post" action="?">
<div id="toolTipLayer" style="position: absolute; visibility: hidden"></div>
<script language="javascript">initToolTips();</script>
<div class="centered"> 
 

<!----------BEGIN CSC INITIAL ZONE ------------------------>

<%=screen.InitialVariable()%>

<!----------END CSC INITIAL ZONE -------------------------->

<input type="hidden"name="__screen"  value="TAB01"> 
<input type="hidden" name="__help" value="">
<input type="hidden" name="__fixCon" value="">
<input type="hidden" name="__notNull" value="<%=screen.getRequire()%>">
<input type="hidden" name="__cmd"  value="">
<input type="hidden" name="__calendar" value="">
<script language="javascript">getInputFormatDate();</script>
<input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>"> 
 <input type="hidden" name="__temp" value="">
<div align="center">
<script language="JavaScript" src="../JS/HOTKEY.js"></script>
		<script language="javascript">
			 var titlename=swap2String('SW001758');
			 document.write(Icons("TAB01,"+titlename));
		 </script>
		 <br>
<table width="640" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td class="header">TAB01,<span swlang code="SW001758">Tab01</span>&nbsp;</td>
	</tr>
	<tr>
		<td>
		<table cellpadding="0" cellspacing="0" class="maxsize">
              <tr> 
                <td class="blankspace"></td>
              </tr>
	
              <tr> 
                <td class="blankspace"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td  class="columnlabel"><%=screen.getLabel("BOXID")%>&nbsp;</td>
                      <td ><%=screen.getInput("BOXID")%>&nbsp;</td>
                    </tr>
                    <tr> 
                      <td class="columnlabel"> <%=screen.getLabel("TDESC")%>&nbsp;</td>
                      <td><%=screen.getInput("TDESC")%></td>
                    </tr>
					<tr> 
                      <td class="columnlabel"> <%=screen.getLabel("EDESC")%>&nbsp;</td>
                      <td><%=screen.getInput("EDESC")%></td>
                    </tr>
					<tr> 
                      <td class="columnlabel"> <%=screen.getLabel("UPPER_BOXID0")%>&nbsp;</td>
                      <td><%=screen.getInput("UPPER_BOXID0")%><input type="text" name="V1boxname" size="20" readonly="true" value="<%=chk.chkNullString(screen.getDataLabel("V1MAPPROVE_BOX","TDESC"))%>">
					  </td>
                    </tr>
					<tr> 
                      <td class="columnlabel"> <%=screen.getLabel("UPPER_BOXID1")%>&nbsp;</td>
                      <td><%=screen.getInput("UPPER_BOXID1")%><input type="text" name="V2boxname" size="20" readonly="true" value="<%=chk.chkNullString(screen.getDataLabel("V2MAPPROVE_BOX","TDESC"))%>">
					  </td>
                    </tr>
					<tr> 
                      <td class="columnlabel"> <%=screen.getLabel("UPPER_BOXID2")%>&nbsp;</td>
                      <td><%=screen.getInput("UPPER_BOXID2")%><input type="text" name="V3boxname" size="20" readonly="true" value="<%=chk.chkNullString(screen.getDataLabel("V3MAPPROVE_BOX","TDESC"))%>">
					  </td>
                    </tr>

					<tr> 
                      <td class="columnlabel"> <%=screen.getLabel("BOX_LEVEL")%>&nbsp;</td>
                      <td><%=screen.getInput("BOX_LEVEL")%></td>
                    </tr>
					<tr>

						<tr> 
                      <td class="columnlabel"> <%=screen.getLabel("APPROVE_STATUS")%>&nbsp;</td>
                      <td><%=screen.getInput("APPROVE_STATUS")%></td>
                    </tr>
					<tr>
					<tr>
						<td class="columnlabel"><b><span swlang code="SW012323">BOX PERMISSION ACCESS BY POSITION</span></b></td>
						<td class="columnlabel"></td>
					<tr>
					<tr>
						
						
					</tr>
					<tr> 
                      <td class="columnlabel"> <%=screen.getLabel("VALID_POSITION")%>&nbsp;</td>
                      <td><select name ="valid_positionlst" style="width: 350px; height: 70px;" size="20" align="absmiddle" multiple><%=screen.getRecord().getString("groupOption")%></select>
			  <input type="hidden" name="__valid_position"  value="<%=chk.chkNullString(screen.getDataLabel("VALID_POSITION"))%>">
			  <input type="hidden" name="__groupNo"  value="<%=chk.chkNullString(th.ASCII2Unicode(request.getParameter("__groupNo")))%>">
                <a href="javascript:showHelp('TAB011.jsp');" ><img SRC="../IMAGES/BUTTON/SWAP/NEW_SWAP24.gif" alt="รายการกลุ่มหัวข้อประเมินผล" name="Image44" width="20" height="20" border="0" align="absmiddle" id="Image44" ></a>
				 <a href="javascript:listDblClick(this.cscform.valid_positionlst,2);" ><img SRC="../IMAGES/BUTTON/SWAP/DEL_SWAP24.gif" alt="รายการกลุ่มหัวข้อประเมินผล" name="Image44" width="20" height="20" border="0" align="absmiddle" id="Image44" ></a>
				</td>

						<br >

					 </td>
					
                    </tr>
					
					<tr>
					
                      <td class="columnlabel"> <%=screen.getLabel("VALID_PL")%>&nbsp;</td>
                      <td><select name="valid_positionlstPL"  style="width: 350px; height: 70px;" size="20" align="absmiddle" multiple><%=screen.getRecord().getString("groupOptionPL")%></select>
			 
			  
			  <input type="hidden" name="__valid_pl"  value="<%=chk.chkNullString(screen.getDataLabel("VALID_PL"))%>">
			 <input type="hidden" name="__groupNoPL"  value="<%=chk.chkNullString(th.ASCII2Unicode(request.getParameter("__groupNoPL")))%>">
                <a href="javascript:showHelp2('TAB012.jsp');" ><img SRC="../IMAGES/BUTTON/SWAP/NEW_SWAP24.gif" alt="รายการกลุ่มหัวข้อประเมินผล" name="Image44" width="20" height="20" border="0" align="absmiddle" id="Image44" ></a>
				 <a href="javascript:listDblClick(this.cscform.valid_positionlstPL,1);" ><img SRC="../IMAGES/BUTTON/SWAP/DEL_SWAP24.gif" alt="รายการกลุ่มหัวข้อประเมินผล" name="Image44" width="20" height="20" border="0" align="absmiddle" id="Image44"></a> 

				 </td>
					
                    </tr>


					
                </table></td>
              </tr>
              <tr>
                <td class="blankspace"></td>
              </tr>
              <tr> 
                <td ><table cellpadding="0" cellspacing="0" >
                    <tr> 
                      <td width="488" align="right"><%=screen.getEditCheck()%>&nbsp;</td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td class="blankspace"></td>
              </tr>
            </table>
		</td>
	</tr>
	<tr>
		<td class="bottom"></td>
	</tr>
</table>
</div>
<!----------BEGIN CSC ENDING ZONE ------------------------>

<%=screen.endJSP()%>

<!----------END CSC ENDING ZONE -------------------------->

</FORM>
</div>
</body>
</html>
<%screen.referLangOff();%>