CI_01_21.jsp 15.7 KB
Newer Older
Thitichaipun Wutthisak committed
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
<!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.*"%>
<jsp:useBean id="CI_01_21" class="com.csc.library.system.Task" scope="page" />
<%CI_01_21.setChannel(request, response);%>
<%UIManager screen = (UIManager) CI_01_21.process("SingleEntry", "CI_01_21");%>
<%
 String isSaved=request.getParameter("__cmd");
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<link href="../CSS/bootstrap.css" rel="stylesheet"  type="text/css">
<link href="../CSS/bootstrap_csc_backend.css" rel="stylesheet"  type="text/css">
<script type="text/javascript" src="../JS/jquery-2.1.3.min.js"></script>
<script type='text/javascript' src="../JS/bootstrap.js"></script>
<link href="../CSS/bootstrap.css" rel="stylesheet"  type="text/css">
<link href="../CSS/bootstrap_csc_backend.css" rel="stylesheet"  type="text/css">
<script type="text/javascript" src="../JS/jquery-2.1.3.min.js"></script>
<script type='text/javascript' src="../JS/bootstrap.js"></script>
<script type='text/javascript' src='../JS/SCREEN.js'></script>
<script type='text/javascript' src='../JS/ICONSMENU.js'></script>
<script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script>

<SCRIPT LANGUAGE="JavaScript">
var tmpwin;
function GoClean(){
	alert(MyCode[150]);
}

function GoSave(){
	setSubRight();
	with(document.cscform){
			bCon=confirm(MyCode[1]);
			if(bCon){
				__confirm.value="s";
				__cmd.value="save";
				submit();
		 }
	}
}
function GoUpdate(){GoSave();}
function GoDelete(){
	alert(MyCode[150]);

}
function GoSearch(){
	with(document.cscform){
			if (__language.value="tha")
					alert("ไม่สามารถใช้งานในหน้าจอนี้ได้");
			else
					alert("ไม่สามารถใช้งานในหน้าจอนี้ได้");
	}
}
function checkCF() {checkConfirm();}

function setSubRight(){
	  var objmyList=document.cscform.listRight;
        	for(i=objmyList.length;i > 0;i--){
			document.cscform.__subEmp.value+=objmyList.options[i-1].value+",";
			}
}

function checkConfirm(){
	var conCode="";
	var conDesc="";
	with(document.cscform){
	 conCode=getConfirmIndex(__confirm.value,"0");
	 conDesc=getConfirmIndex(__confirm.value,"1");
	 if(__confirm.value=="4")alert(MyCode[19]);
	 if(__confirm.value=="1" || __confirm.value=="2")alert(MyCode[18]);
	 //if(__confirm.value=="-1" || __confirm.value=="-2")alert(MyCode[17]);
		if(conCode=="-99"){
			updateRecord();
		}
	}
}

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original:  Fred P -->
<!-- Begin
// Compare two options within a list by VALUES
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;
}
// Compare two options within a list by TEXT

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

// Dual list move function
function moveDualList( srcList, destList, moveAll )
{
//if(srcList.name=="listRight")alert(srcList.name);

  // Do nothing if nothing is selected
  if (  ( srcList.selectedIndex == -1 ) && ( moveAll == false )   )
  {
    return;
  }
  /*
   if(srcList.name=="listRight")
  {

  for(var z=0;z<destList.length;z++)
  {
  			for(var y=0;y<srcList.length;y++)
			{
						alert(srcList.options[y].value+"***"+destList.options[z].value);
						if(srcList.options[y].value==destList.options[z].value)return true;
			}
  }
  }*/
  newDestList = new Array( destList.options.length );
  var len = 0;
  for( len = 0; len < destList.options.length; len++ )
  {
  //alert(destList.options[len].value);
    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 );
    }
  }
  for( var i = 0; i < srcList.options.length; i++ )
  {
    if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
    {
       // Statements to perform if option is selected
       // Incorporate into new list
       newDestList[ len ] = new Option( srcList.options[i].text, srcList.options[i].value, srcList.options[i].defaultSelected, srcList.options[i].selected );

       len++;
    }
  }
  // Sort out the new destination list
  newDestList.sort( compareOptionValues );   // BY VALUES
  //newDestList.sort( compareOptionText );   // BY TEXT
  // Populate the destination with the items from the new array
  for ( var j = 0; j < newDestList.length; j++ )
  {
    if ( newDestList[ j ] != null )
    {
      destList.options[ j ] = newDestList[ j ];
    }
  }
  // Erase source list selected elements
  for( var i = srcList.options.length - 1; i >= 0; i-- )
  {
    if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
    {
       // Erase Source
       //srcList.options[i].value = "";
       //srcList.options[i].text  = "";
       srcList.options[i]       = null;
    }
  }
} // End of moveDualList()
//  End -->

function showHelp(page){
	window.open(page,"Help","left=150,top=150,width=700,height=500,toolbar=no,status=yes,scrollbars=no");
}

function addOption(objOption)
{
   addToOption(objOption,document.cscform.listRight) ;
} // End of addOption()

function findKey(objOption,myList){
	 for ( var j = 0 ; j < objOption.length; j++ )
		  {

			for(var i=0;i < myList.length;i++){
				if(objOption[j].value == myList.options[i].value){
					alert(myList.options[i].value+" "+MyCode[151]);
					tmpwin.focus();
					return true;
				}//if
			}//for

			//alert(window.document.cscform.listLeft.length);
			for(var i=0;i < window.document.cscform.listLeft.length;i++){
				if(objOption[j].value == window.document.cscform.listLeft.options[i].value){
				    //alert("???? " + myList.options[i].value + " ??????????????????\n??????????????????????");
					alert(window.document.cscform.listLeft.options[i].value+" มีข้อมูลแล้ว");
					return true;
				}//if
			}//for
		}	//for
		return false;
}

function delteOption(objmyList){
			for(i=objmyList.length;i > 0;i--){
				if(objmyList.options[i-1].selected == true){
					objmyList.options[i-1]  = null;
				}
			}
}


function addToOption(objOption,destList)
{
     var lengthAll=parseInt(objOption.length)+parseInt(destList.options.length);
		newDestList = new Array( lengthAll );
		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 );
		  for( var i = destList.options.length - 1; i >= 0; i-- )
		  {
			if ( destList.options[i] != null  )
			{
			   destList.options[i]       = null;
			}
		  }

		  for ( var j = 0; j < newDestList.length; j++ )
		  {
			if ( newDestList[ j ] != null )
			{
			  destList.options[ j ] =new Option(newDestList[ j ].text,newDestList[ j ].value);
			}
		  }
} // End of addToOption()

function onmyDblClick(objmyList){
			for(i=objmyList.length;i > 0;i--){
				if(objmyList.options[i-1].selected == true){
					alert(objmyList.options[i-1].text);
				}
			}
}

<!--



function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function showHelp(page){
	window.open(page,"Help","left=150,top=150,width=700,height=500,toolbar=no,status=no,scrollbars=yes");
}
//-->
function goHelp(helpName,inputName){
	var helpReturn;

	//if(inputName=="empid" )helpReturn="abc";
	if(inputName=="employeeid" )helpReturn="__employeeid:employeeid";

	//alert(helpName+"*****"+helpReturn);
	 with(document.cscform){
		if (__fixCon.value!="") __fixCon.value=__fixCon.value;
		var param="PRU085.jsp?__helpName="+helpName+"&__helpReturn="+helpReturn+"&__pageCall="+__screen.value+"&__fixCon="+__fixCon.value+"&__checkVerify=off";
		tmpwin = window.open(param,"Help","left=150,top=150,width=600,height=400,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
	}
}
function saveAndSearch(){
       var isSave='<%=isSaved%>';
		   if(isSave=="save"){
	           with (document.cscform){
			  //    __cmd.value="search";
			//	  submit();
			   }
	   }
}

function showEmp(jsp){
        with(document.cscform){
		       action = jsp+".jsp";
		       __fixCon.value = "job='"+__jobcode.value+"'";
			   __jobcode.value = __jobcode.value;
			    submit();
			   }

}

</script>

<style>
  .td-nospace{
    height: 0px !important;
  }
  .full-size{
    width: 100% !important;
    height: 110px !important;
  }
</style>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<form  METHOD="POST" name="cscform" action="CI_01_21.jsp">


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

<%=screen.InitialVariable()%>

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

<input type="hidden" name="__cmd" value="">

 <input type="hidden" name="__help" value="<%=request.getParameter("__help")%>">
 <input type="hidden" name="__employeeid" value="<%=request.getParameter("__employeeid")%>">
 <input type="hidden" name="__jobcode" value="<%=request.getParameter("__jobcode")%>">
 <input type="hidden" name="__notNull" value="">
 <input type="hidden" name="__subEmp" value="">
 <input type="hidden" name="__fixCon" value=" status<>'Y' "">
 <input type="hidden" name="__screen" value="CI_01_21">
 <input type="hidden" name="__language" value="<%=screen.getUProfile().get("lang")%>">
  <script language="JavaScript" src="../JS/HOTKEY.js">
	   </script>
		   <script language="javascript">
			 var titlename=swap2String('Command Line Definition');
			 document.write(Icons("CI_01_21,"+titlename));
		  </script>
<table width="683" align="center"  cellpadding="0"  cellspacing="0">
	   <tr><td colspan="3" class="blankspacenocolor"></td></tr>
	   <br>
  <tr >
    <td colspan="3" class="header"><script language="javascript">swapLang("Command Line Definition");</script> &nbsp;</td>
  </tr>
  <tr >
    <td  colspan="3"> <div align="center"><br>
        <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" class="largest">
		  <tr>
            <td " colspan="3"><div align="left">&nbsp;<strong><script language="javascript">swapLang("Name");</script> - <script language="javascript">swapLang("Lastname");</script></strong> &nbsp;<%=screen.getDataLabel("employeeid")%> &nbsp;
			<%screen.referLangOn();%>
			<%=screen.getDataLabel("efname")%> <%=screen.getDataLabel("elname")%>
			<% screen.referLangOff();%>
			</div></td>
          </tr>
		  <tr>
            <td " colspan="3"><div align="left">&nbsp;<strong><script language="javascript">swapLang('Job Description');</script></strong>&nbsp;<%=screen.getDataLabel("job")%>&nbsp;:&nbsp;<%=screen.getDataLabel("mjobcode","tdesc")%></div></td>
          </tr>
		  <tr>
            <td " colspan="3"><div align="left">&nbsp;<strong><%=screen.getLabel("mbu2","bu2id")%></strong>&nbsp;&nbsp;<%=screen.getDataLabel("bu2")%>&nbsp;:&nbsp;<%=screen.getDataLabel("mbu2","tdesc")%></div></td>
          </tr>
		   <tr>
            <td " colspan="3"><div align="left">&nbsp;<strong><%=screen.getLabel("mbu3","bu3id")%></strong>&nbsp;&nbsp;<%=screen.getDataLabel("bu3")%>&nbsp;:&nbsp;<%=screen.getDataLabel("mbu3","tdesc")%></div></td>
          </tr>
		   <tr>
            <td " colspan="3"><div align="left">&nbsp;<strong><%=screen.getLabel("mbu4","bu4id")%></strong>&nbsp;&nbsp;<%=screen.getDataLabel("bu4")%>&nbsp;:&nbsp;<%=screen.getDataLabel("mbu4","tdesc")%></div></td>
          </tr>
		  <tr>
            <td " colspan="3"><div align="left">&nbsp; </div></td>
          </tr>
		  <tr>
            <td " colspan="3"><div align="left">&nbsp; <strong><script language="javascript">swapLang("Employee List");</script></strong></div></td>
          </tr>
          <tr>
            <td class="title1" width="247"><div align="center"><script language="javascript">swapLang("Employee In Job");</script></div></td>
            <td class="title1" width="56"> <div align="center">&nbsp;</div></td>
            <td width="301" bgcolor="#666666" class="title1"><div align="center"><script language="javascript">swapLang("Employee In Command Line");</script></div></td>
          </tr>

<tr>
  <td class='td-nospace'>
    <!-- Multiple Select List with 20 rows size and 70 pixels wide -->
    <!-- Using   for SPACING and alignment -->
    <select multiple class='full-size' size="20" name="listLeft" onDblClick="onmyDblClick(this.form.listLeft);">
           <%=screen.getRecord().getString("EMP_SUB_JOB")%>
	</select>
  </td>
  <td><NOBR>
  <NOBR>  <BR>
  <NOBR>
    <a href="javascript:moveDualList( this.cscform.listLeft,  this.cscform.listRight, false );"><button type="button" class="btn btn-primary width120" swlang code="SW013165" >ADD ></button></a><BR>
    <NOBR>
    <a href="javascript:moveDualList( this.cscform.listRight, this.cscform.listLeft,  false );"> <button type="button" class="btn btn-primary width120" swlang code="SW000123" >REMOVE <</button></a><BR>
        <NOBR>
    <a href="javascript:moveDualList( this.cscform.listLeft,  this.cscform.listRight, true  );"><button type="button" class="btn btn-primary width120" swlang code="SW013165" >ADD ALL >></button></a><BR>
      <NOBR>
      <a href="javascript:moveDualList( this.cscform.listRight, this.cscform.listLeft,  true  );"> <button type="button" class="btn btn-primary width120" swlang code="SW000124" >REMOVE ALL <<</button></a><BR>
    </NOBR>
  </td>
  <NOBR>




  <td class='td-nospace'>
    <select multiple class='full-size' size="20" name="listRight" onDblClick="onmyDblClick(this.form.listRight);">
        <%=screen.getRecord().getString("SUB_EMP")%>
    </select>
  </td>
</tr>
</table>

        <div align="center">&nbsp; &nbsp;&nbsp;</div>
      </div></td>
  </tr>
  <td align="right">
    <button type="button" class="btn btn-primary width100" swlang code="SW000119" onClick="showEmp('CI_01_20');">BACK</button>&nbsp;
    <button type="button" class="btn btn-primary width100" swlang code="SW013168" onClick="goHelp('MEMPLOYEEHELP','employeeid');">SEARCH ALL</button>
		  &nbsp;
  </td>


  <tr bordercolor="0069B3">
    <td  class="bottom"></td>
  </tr>
</table>
<!----------BEGIN CSC ENDING ZONE ------------------------>

<%=screen.endJSP()%>

<!----------END CSC ENDING ZONE -------------------------->
</form>
</body>
</html>