<%@page contentType="text/html; charset=windows-874"%>
<%@page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*"%>
<%@ page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*"  %>
<jsp:useBean id="TAGENROUT" class="com.csc.library.system.Task" scope="page"/>
<%
	TAGENROUT.setChannel(request ,response);
   	ProcessEntry screen = (ProcessEntry)TAGENROUT.process("ProcessEntry","Process");
   	screen.process();
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='../JS/SCREEN.js'></script>
<script language="javascript" src='../JS/DATEINPUT.js'></script>
<script language="javascript" src='../JS/VIEWCALENDAR.js'></script>
<script language="javascript" src='./JS/PROCESS.js'></script>
<script language="javascript">setLang('<%=screen.getUProfile().get("lang")%>');</script>
<script language="JavaScript" type="text/JavaScript">
<!--
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_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_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 process(pValue) {
	with(document.cscform){
		__condition$cmdValue.value = "transfer";
		__ptype.value="TA2";
		__prclass.value="GenWFRouting";

		setWorkflowList();

		bCon = confirm("Confirm Process "+pValue);
		if (bCon == true){
			__cmd.value = "save";							
			submit();
		}else {
			alert(MyCode[101]);
		}
	}
}

function setWorkflowList(){
	var wfl = document.getElementsByName("wflist");
	var wfid = document.getElementsByName("__condition$wf_id");
	var ls = "";

	for(var i=0; i < wfl.length ; i++){
		if(wfl[i].checked){
			if(ls.length > 0) ls += ",";
			ls += wfl[i].value ;
		}
	}

	wfid[0].value = ls ;
}

//-->
</script>
</head>
<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<form name="cscform" method="post" action="">


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

<%=screen.InitialVariable()%>

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

<input type="hidden" name="__screen"  value="TAGENROUT">
	<input type="hidden" name="__fixCon"  value="">
	<input type="hidden" name="__cmd"  value="">
	<input type="hidden" name="__help"  value="">
	<input type="hidden" name="__user" value="<%=screen.getUProfile().getUserId()%>">
	<input type="hidden" name="__companyid" value='<%=screen.getUProfile().get("companyid")%>'>
	<input type="hidden" name="__tname" value="�к����ҡ�÷ӧҹ">
	<input type="hidden" name="__ename" value="Time Attendance">
	<input type="hidden" name="__ptype" value="">
	<input type="hidden" name="__prclass" value="GenWFRouting">
	<input type="hidden" name="__calendar" value="">
	<script language="javascript">getInputFormatDate();</script>
	<input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>">		
	<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
  	<script language="javascript">initToolTips();</script>
	<input type="hidden" name="__condition$employeeProcess" value='<%=screen.getUProfile().get("employeeid")%>'>
	<input type="hidden" name="__condition$employeeBetween" value="">
	<input type="hidden" name="__condition$employeeSelect" value="">
	<input type="hidden" name="__condition$positionSelect" value="">
	<input type="hidden" name="__condition$bu1Select" value="">
	<input type="hidden" name="__condition$bu2Select" value="">
	<input type="hidden" name="__condition$bu3Select" value="">
	<input type="hidden" name="__condition$bu4Select" value="">
	<input type="hidden" name="__condition$bu5Select" value="">
	<input type="hidden" name="__condition$branchSelect" value="">
	<input type="hidden" name="__condition$salatypeSelect" value="">
	<input type="hidden" name="__condition$workareaSelect" value="">
	<input type="hidden" name="__condition$emp_levelSelect" value="">
	<input type="hidden" name="__condition$time0Select" value="">
	<input type="hidden" name="__condition$cmdValue" value="">
	<input type="hidden" name="__condition$delStatus" value="">

	<input type="hidden" name="__condition$wf_id" value="">

 	<br>
  	<div align="center">
    <table  cellpadding="0"  cellspacing="0">
		<tr >
			<td  class="header" colspan="2"> TAGENROUT,&nbsp;<script language="javascript">swapLang("Process Time Attendance");</script>&nbsp;</td>
		</tr>
		<tr>
			<td colspan="2" class="blankspace"  ></td>
		</tr>
		<tr>
			<td class="columnlabel">Workflow List</td>
			<td align="left">&nbsp;</td>
		</tr>
		<%
			DbInquiry inq = new InitialInquiry(screen.getUProfile()).getDbInquiry("workflow_definition");
			inq.setColumn("wf_id,companyid,ename");
			inq.setOrderBy("wf_id");
			inq.refresh();

			while(inq.next()){
		%>
		<tr>
			<td class="columnlabel">
				<input type="checkbox" name="wflist" value="<%=inq.getString("wf_id")%>">&nbsp;[<%=inq.getString("wf_id")%>]
			</td>
			<td align="left">&nbsp;&nbsp;<%=inq.getString("ename")%></td>
		</tr>
		<%	}%>
		<tr>
			<td colspan="2" class="blankspace">&nbsp;</td>
		</tr>
		<tr>
			<td class="columnlabel">Conditions</td>
			<td align="left">&nbsp;*(on Memployee table)</td>
		</tr>

		<tr>
			<td colspan="2" align="center">
				<textarea name="__condition$myquery" id="__condition$myquery" cols="70" rows="4"></textarea>
			</td>
		</tr>
		<tr>
			<td colspan="2" class="blankspace">
				<div align="center">
					<a href="javascript:process('Transfer Time');"><img src="../IMAGES/BUTTON/PROCESS.gif" border="0"></a>                   
				</div>
			</td>
		</tr>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
	  	<tr>
			<td  class="bottom" colspan="2"></td>
		</tr>
	</table>
  </div>
</form>
</body>
</html>