<%@page contentType="text/html; charset=UTF-8"%>
<%@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.*,com.csc.library.report.ReportUDF"  %>
<jsp:useBean id="AS12" class="com.csc.library.system.Task" scope="page"/>
<%
AS12.setChannel(request,response);
UIManager screen = (UIManager) AS12.process("SingleEntry","AS12");
screen.referLangOff();
CscCalendar cs=new CscCalendar();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<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">
<script  language="JavaScript" src="../JS/SCREEN.js"></script>

<script type='text/javascript' src='../JS/ICONSMENU.js'></script>
<script language='javascript' src='../JS/HOTKEY.js'></script>
<script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script>

<script language="JavaScript" type="text/JavaScript">
<!--
function checkTypeOf(strfiled){
		      if((typeof strfiled)!="undefined"){
			     return true;
			  }else{
			      return false;
			  }
}

function checkLength(strfiled){
		      if((typeof strfiled.length)!="undefined"){
			     return true;
			  }else{
			      return false;
			  }
}


function beforeGo(){
  with(document.cscform){
            __proplist.value=setProlist();
   }//with
}

function GoSave() {
  beforeGo();
  confirmSave();
  }
function GoDelete(){ }
function GoSearch(){ }
function GoUpdate(){
  beforeGo();
  update();
 }


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 showHelp(page){
	window.open(page,"Help","left=150,top=150,width=700,height=500,toolbar=no,status=yes,scrollbars=yes");
}

function setcframe(source,mframe){
	   var   vframe=document.getElementById(mframe); 
	       vframe.src="AS12HELP1.jsp?__resultSet="+source; 
}

function loadiframe(){
     with(document.cscform){
	          if(__apsourceclass.value.length>0){
				setcframe(__apsourceclass.value,"viewframe");
				//setcframe(__apsasysourceclass.value,"viewframe2");
				}
		}
}

function loadiframe2(source,indexs){
     with(document.cscform){
				setcframe(eval(source+".value"),"viewframe"+indexs);
		}
}

function setEmpty(){
	with(frmDocument.document.forms[0]){
		for(i=0;i < elements.length;i++){
			if(elements[i].type == "text"){
				elements[i].value = "";
			}
		}//for
	}//with
}

function showHelp(page,objid,objname,objclass,objtype){
     var _help="";
	 with(document.cscform){
	         _help=page+"?objid="+objid+"&objname="+objname+"&objclass="+objclass+"&objtype="+objtype;
	 }
	window.open(_help,"Help","left=150,top=150,width=700,height=500,toolbar=no,status=yes,scrollbars=yes");
}

function showHelp2(page,objid,objname,objsource,obj){
     var _help="";
	 var _fixcon="";
	 with(document.cscform){
	         if(__apsid.value.length>0){
			     _fixcon="apsid='"+__apsid.value+"'";
				 if(__assessor.value.length>0){
				 _fixcon+=" and apsassessor='"+__assessor.value+"'";
				 }
				 if(__assessy.value.length>0){
				 _fixcon+=" and apsassessy='"+__assessy.value+"'";
				 }
 	         _help=page+"?objid="+objid+"&objname="+objname+"&__assess="+objsource+"&__assessby="+obj+"&__orderBy=tapstran.apsid,tapstran."+obj;
			window.open(_help,"Help","left=150,top=150,width=700,height=500,toolbar=no,status=yes,scrollbars=yes");
			 }
	 }
}

function goHelp(helpName,inputName){
	var helpReturn;
		 if(inputName=="__apsid" )
		 	helpReturn="__apsid:apsid,TAPSTRAN0@tdesc,";			
	     linkHelp_Return(helpName,helpReturn);
}

function searchIframe(){
var fixcon;
		with(document.cscform){
		            if(__apsid.value.length>0){
					         fixcon="apsid='"+__apsid.value+"'";							 
							 if(__assessor.value.length>0){
							     fixcon+="and apsassessor='"+__assessor.value+"'";
							 }
							 if(__assessy.value.length>0){
							     fixcon+="and apsassessy='"+__assessy.value+"'";
							 }
						   var   vframe=document.getElementById("viewframe2"); 
							   vframe.src="AS12HELP2.jsp?__fixCon="+fixcon; 
					}
		}
}

function checkNullApprove(obj){
var tmp="_";
               if(obj.length>0){
			          tmp=obj; 
			   }
			   return tmp;
}

function setProlist(){
		var prolist="";
		var k=0;
		var ap1="";
		var ap2="";
		var ap3="";
		var ap4="";

		var ds1="";
		var ds2="";
		var ds3="";
		var ds4="";

		var desc1="";
		var desc2="";
		var desc3="";
		var desc4="";

	with(document.viewframe2.document.forms[0]){
         if(checkTypeOf(__assessor)){
  		     if(checkLength(__assessor)){						
					for(i=0;i < __assessor.length;i++){
							 k=i+1;
							 ap1=checkNullApprove(eval("approve1_"+k+"txt.value"));  
							 ap2=checkNullApprove(eval("approve2_"+k+"txt.value"));  
							 ap3=checkNullApprove(eval("approve3_"+k+"txt.value"));  
							 ap4=checkNullApprove(eval("approve4_"+k+"txt.value"));  							 							 							 

							 ds1=checkNullApprove(eval("approve1_"+k+"ds.value"));  
							 ds2=checkNullApprove(eval("approve2_"+k+"ds.value"));  
							 ds3=checkNullApprove(eval("approve3_"+k+"ds.value"));  
							 ds4=checkNullApprove(eval("approve4_"+k+"ds.value"));  							 							 							 
							 
							 desc1=checkNullApprove(eval("approve1_"+k+"desc.value"));  
							 desc2=checkNullApprove(eval("approve2_"+k+"desc.value"));  
							 desc3=checkNullApprove(eval("approve3_"+k+"desc.value"));  
							 desc4=checkNullApprove(eval("approve4_"+k+"desc.value"));  							 							 							 

							prolist+=__assessor[i].value+"#"+__assessy[i].value+"#"+__asssource[i].value+"#"+__asysource[i].value+"#"+ap1+"#"+ap2+"#"+ap3+"#"+ap4+"#"+ds1+"#"+ds2+"#"+ds3+"#"+ds4+"#"+desc1+"#"+desc2+"#"+desc3+"#"+desc4+",";
					}
		    	}else{
							 ap1=checkNullApprove(eval("approve1_1txt.value"));  
							 ap2=checkNullApprove(eval("approve2_1txt.value"));  
							 ap3=checkNullApprove(eval("approve3_1txt.value"));  
							 ap4=checkNullApprove(eval("approve4_1txt.value"));  

							 ds1=checkNullApprove(eval("approve1_1ds.value"));  
							 ds2=checkNullApprove(eval("approve2_1ds.value"));  
							 ds3=checkNullApprove(eval("approve3_1ds.value"));  
							 ds4=checkNullApprove(eval("approve4_1ds.value"));  							 							 							 
							 
							 desc1=checkNullApprove(eval("approve1_1desc.value"));  
							 desc2=checkNullApprove(eval("approve2_1desc.value"));  
							 desc3=checkNullApprove(eval("approve3_1desc.value"));  
							 desc4=checkNullApprove(eval("approve4_1desc.value"));  							 							 							 
							 							 							 							 				
	                  prolist+=__assessor.value+"#"+__assessy.value+"#"+__asssource.value+"#"+__asysource.value+"#"+ap1+"#"+ap2+"#"+ap3+"#"+ap4+"#"+ds1+"#"+ds2+"#"+ds3+"#"+ds4+"#"+desc1+"#"+desc2+"#"+desc3+"#"+desc4+",";
			   }
	     }
	}
	return prolist;
}

//-->
</script>

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

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

<%=screen.InitialVariable()%>

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

   <input type="hidden"name="__screen"  value="AS12">
  <input type="hidden" name="__help" value="">
  <input type="hidden" name="__cmd"  value="">
  <input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>"> 
  <input type="hidden" name="__fixCon" value="">
  <input name="__notNull" type="hidden" value="<%=screen.getRequire()%>" >
  <input name="__companyid" type="hidden" value="<%=screen.getUProfile().get("companyid")%>">
  <input type="hidden" name="__apscreateby" value="<%=screen.getUProfile().get("userid")%>" >
  <input type="hidden" name="__apscreatedate" value="<%=cs.getYYYYMMDDHHMMSS()%>">
  <input type="hidden" name="__proplist" value="">
  <script language="JavaScript">document.write(Icons());</script>
  <br>
  <div align="center">
    <table  cellpadding="0"  cellspacing="0">
      <tr > 
        <td  class="header">AS12
          <script language="JavaScript">
swapLang('Approvor');
</script>
          &nbsp;</td>
      </tr>
      <tr > 
        <td  colspan="2"> 
          <div align="center"> 
            <table align="center" cellpadding="0" cellspacing="0"  class="largest" >
              <tr> 
                <td  class="blankspace" colspan="2">&nbsp;</td>
              </tr>
              <tr> 
                <td width="86">&nbsp;
                  <script language="JavaScript">
swapLang('Approvor_Data');
</script></td>
                <td width="540"><input name="__apsourcedesc" type="text"  value="" size="15"> 
                  <input name="__apsource" type="hidden" value=""> <input name="__apsourceclass" type="hidden" value="">
                  <a href="javascript:showHelp('AS09_1HELP.jsp','__apsource','__apsourcedesc','__apsourceclass','');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image43','','../IMAGES/BUTTON/SWAP/HELP_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/HELP20.gif" alt="รายการหัวข้อประเมินผล" name="Image43" width="20" height="20" border="0" align="absmiddle" id="Image43"></a> 
                </td>
              </tr>
              <tr> 
                <td colspan="2"  class="blankspace"></td>
              </tr>
            </table>
			<iframe name="viewframe" src="" height="100" width="600"></iframe>
            <table align="center" cellpadding="0" cellspacing="0"  class="largest" >
              <tr> 
                <td  class="blankspace" colspan="2">&nbsp;</td>
              </tr>
              <tr> 
                <td ><strong>&nbsp;
                  <script language="JavaScript">
swapLang('Docno');
</script>
                  </strong></td>
                <td><input name="__apsid" type="text" value="" size="15">
                  <a href="javascript:goHelp('AS09HELP','__apsid');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image42','','../IMAGES/BUTTON/SWAP/HELP_SWAP20.gif',1)"><img SRC="../IMAGES/BUTTON/MAIN/HELP20.gif" alt="รายการเอกสารประเมินผล" name="Image42" width="20" height="20" border="0" align="absmiddle" id="Image42"></a> 
                  <input name="TAPSTRAN0@tdesc" type="text" value="" size="50"> 
                </td>
              </tr>
              <tr> 
                <td width="86"><div align="left">&nbsp;
                    <script language="JavaScript">
swapLang('assessor');
</script>
                  </div></td>
                <td width="540"><input name="__assessor" type="text" value="" size="15">
                  <a href="javascript:showHelp2('AS12_2HELP.jsp','__assessor','__assessorname','apsassdesc','apsassessor');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image431','','../IMAGES/BUTTON/SWAP/HELP_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/HELP20.gif" alt="รายการหัวข้อประเมินผล" name="Image431" width="20" height="20" border="0" align="absmiddle" id="Image43"></a> 
                  <input name="__assessorname" type="text" value="" size="30"></td>
              </tr>
              <tr> 
                <td>&nbsp;
                  <script language="JavaScript">
swapLang('assessy');
</script></td>
                <td><input name="__assessy" type="text" value="" size="15">
                   <a href="javascript:showHelp2('AS12_2HELP.jsp','__assessy','__assessyname','apsasydesc','apsassessy');"  onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4311','','../IMAGES/BUTTON/SWAP/HELP_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/HELP20.gif" alt="รายการหัวข้อประเมินผล" name="Image4311" width="20" height="20" border="0" align="absmiddle" id="Image43"></a> 
                  <input name="__assessyname" type="text" value="" size="30">
                  <a href="javascript:searchIframe();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41111','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img SRC="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="ค้นหา" name="Image41111" width="20" height="20" border="0" align="absmiddle" id="Image41"></a></td>
              </tr>
              <tr> 
                <td colspan="2"  class="blankspace"></td>
              </tr>
            </table>
			<iframe name="viewframe2" id="viewframe2" src="" height="100" width="600"></iframe>
            <div align="right"> 
              <table align="center" cellpadding="0" cellspacing="0"  class="largest" >
                <tr>
                  <td class="blankspace">&nbsp;</td>
                </tr>
                <tr> 
                  <td> <div align="center"></div></td>
                </tr>
              </table>
              &nbsp;&nbsp; </div>
          </div></td>
      </tr>
      <tr bordercolor="0069B3"> 
        <td  class="bottom"></td>
      </tr>
    </table>
  </div>


<!----------BEGIN CSC ENDING ZONE ------------------------>

<%=screen.endJSP()%>

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

</form>
</body>
</html>
