<%@page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*,com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*,com.csc.library.report.ReportUDF"  %>
<jsp:useBean id="AS21SAVE" class="com.csc.library.system.Task" scope="page"/>
<%
AS21SAVE.setChannel(request,response);
UIManager screen = (UIManager) AS21SAVE.process("SingleEntry","AS21SAVE");
screen.referLangOff();
CheckNull chk =new CheckNull();
ThaiUtilities th =new ThaiUtilities();
%>
<jsp:useBean id="AS21" class="com.csc.library.system.Task" scope="page" />
<%AS21.setChannel(request, response);%>
<%HelpEntry screen1 = (HelpEntry) AS21.process("HelpEntry","AS21");%>
<%
        String tdesc="";
		if((request.getParameter("TAPSTRAN0@tdesc")!=null)&&(request.getParameter("TAPSTRAN0@tdesc").length()>0)){
			tdesc=request.getParameter("TAPSTRAN0@tdesc");
		}else{
		   tdesc=request.getParameter("__tdesc");
		}
         screen1.process();

%>
<!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  language="JavaScript" src="../JS/APSSCREEN.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 goNextpage(param){}
function GoSave() { }
function GoDelete(){
     beforeDelete();
	if(document.cscform.__delasslist.value.length>0){
	      eedelete(); 
	 }
	 }
function eedelete(){
	with(document.cscform){
		bCon=confirm(MyCode[4]);
		if (bCon==true)	{
			__cmd.value="save";
			submit();
		}
	}
}
function GoSearch(){ }
function GoUpdate(){ }


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 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 setMyfixcon(){
		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+"'";
				 }
				return _fixcon; 
			}else{
						alert(MyCode[0]);
						return "";
			}	
						 
		}
}

function showHelp2(page,objid,objname,objsource,obj){
     var _help="";
	 var _fixcon="";
	 with(document.cscform){
			     _fixcon=setMyfixcon();
				 if(_fixcon.length>0){
 	         _help=page+"?objid="+objid+"&objname="+objname+"&__assess="+objsource+"&__assessby="+obj+"&__orderBy=tapstran.apsid,tapstran."+obj+"&__fixCon="+_fixcon;
			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 beforeDelete(){
		with(document.cscform){
				setMycheckbox();
		}
}

function setMycheckbox(){
			with(document.cscform){
          if(checkTypeOf(__box)){			
					if(checkLength(__box)){
							   for(i=0;i<__box.length;i++){
                                                 if(__box[i].checked){
												        __delasslist.value+=__box[i].value;
												 }
										}							   
							   }else{
											 if(__box.checked){
													__delasslist.value+=__box.value;
											 }							   							   
							   }
			}
		}
}

function setEvenclick(obj){
		with(document.cscform){
		        if(obj.checked){
							setkSelectAll(__box,"__box");
			}else{
			           setkDisselectAll(__box,"__box");
			}
		}
}

function edelete(){
	with(document.cscform){
		bCon=confirm(MyCode[4]);
		if (bCon==true)	{
			__cmd.value="delete";
			submit();
		}
	}
}

function searchData(){
         var  _fixcon="";
		with(document.cscform){
		        _fixcon=setMyfixcon();
				if(_fixcon.length>0){
				        __fixCon.value=_fixcon;
				       __cmd.value="search";
					   submit();
				} 
		}
}

function backPage(){
        with(document.cscform){
		      __fixCon.value="";
		      action="AS20.jsp";
			  submit();
		}
}

//-->
</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../IMAGES/BUTTON/SWAP/BACK_SWAP20.gif')" >
  <form name="cscform" method="post" action="AS21.jsp">
 

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

<%=screen.InitialVariable()%>

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

<input type="hidden" name="__confirm" value="0">
  <!-- script language="JavaScript">checkConfirm();</script-->
  <input type="hidden"name="__screen"  value="AS21">
  <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="<%=request.getParameter("__fixCon")%>">
  <input name="__notNull" type="hidden" value="<%=screen.getRequire()%>">
  <input name="__companyid" type="hidden" value="<%=screen.getUProfile().get("companyid")%>">
  <input type="hidden" name="__delasslist" value="">
  <input type="hidden" name="ptName"  value="ลบข้อมูลบางเร็คคอร์ด">
  <input type="hidden" name="peName"  value="Delete some record">
   <script language="JavaScript">document.write(Icons());</script>
  <br>
  <div align="center">
    <table width="591"  cellpadding="0"  cellspacing="0">
      <tr > 
        <td  class="header">AS21,
          <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 ><strong>&nbsp;
                  <script language="JavaScript">
swapLang('Docno');
</script>
                  </strong></td>
                <td><input name="__apsid" type="text" value="<%=request.getParameter("__apsid")%>" 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="<%=th.ASCII2Unicode(tdesc)%>" 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="<%=th.ASCII2Unicode(request.getParameter("__assessor"))%>" 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="<%=th.ASCII2Unicode(request.getParameter("__assessorname"))%>" 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:searchData();" 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>
			<br>
<table width="517" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#666666" class="largest">
              <tr> 
                <td class="title1" width="20"><input type="checkbox" name="checkbox" value="checkbox" onClick="setEvenclick(this);"></td>
                <td width="120" class="title1"><div align="center"> 
                    <script language="javascript">swapLang('Docno');</script>
                  </div></td>
                <td class="title1" width="169"><div align="center"> 
                    <script language="javascript">swapLang('assessor');</script>
                  </div></td>
                <td class="title1" width="239"><div align="center"> 
                    <script language="javascript">swapLang('assessy');</script>
                  </div></td>
              </tr>
              <%
			  			while(screen1.nextRec()){
			  %>
              <tr> 
                <td><div align="center"> 
                    <input type="checkbox" name="__box" value="<%=screen1.getString("apsid")%>#<%=screen1.getString("apsassessor")%>#<%=screen1.getString("apsassessy")%>#<%=screen1.getString("apsasssource")%>#<%=screen1.getString("apsasysource")%>,">
                  </div></td>
                <td><div align="center"><%=screen1.getString("apsid")%></div></td>
                <td><%=screen1.getString("apsassessor")%>&nbsp;<%=screen1.getString("apsassdesc")%></td>
                <td nowrap>
                  <%=screen1.getString("apsassessy")%>&nbsp;<%=screen1.getString("apsasydesc")%></td>
              </tr>
              <%
			  }
			  %>
            </table>
			<br>
			<div align="right"> <a href="javascript:backPage();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','../IMAGES/BUTTON/SWAP/BACK_SWAP20.gif',1)"> 
              <img SRC="../IMAGES/BUTTON/MAIN/BACK20.gif" alt="กลับไปหน้าที่แล้ว" name="Image4" width="20" height="20" border="0" align="absmiddle"></a>&nbsp;&nbsp; 
            </div>
          </div></td>
      </tr>
      <tr bordercolor="0069B3"> 
        <td  class="bottom"></td>
      </tr>
    </table>
  </div>
</form>
</body>
</html>
