<%@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="AS09" class="com.csc.library.system.Task" scope="page"/>
<%
AS09.setChannel(request,response);
UIManager screen = (UIManager) AS09.process("SingleEntry","AS09");
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 src="../JS/VIEWCALENDAR.js"></script>
<script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script>

<script language="JavaScript" type="text/JavaScript">
<!--
function setGenflag(){
     var tmpstr="";
		with(document.cscform){
		     for(k=0;k<__flage.length;k++){
						if(__flage[k].checked){
						            if(__flage[k].value=="2"){
								                  	 return  setGenflagcheck(__flagecheck);
									}else{
									     return "1";
									}  
									break;
						}			 
			 }
		}
}

function chkmyFlage(){
		with(document.cscform){
		     for(k=0;k<__flage.length;k++){
						if(__flage[k].checked){
                                return  __flage[k].value;
						}			 
			 }
		}
}

function setGenflagcheck(objvalue){
     var tmpstr=0;
	 for(j=0;j<objvalue.length;j++){
	          if(objvalue[j].checked){
	                  tmpstr|=parseInt(objvalue[j].value);
			  }
	 }
	 		return tmpstr;
}
 
function setAslist(){
var tmp="";
    with(document.cscform){
	  for ( var j = 0 ; j < __asformlist.length; j++ )
		    {
				tmp+=__asformlist.options[j].value+",";
     		}	//for
		}
		return tmp;
}
 
 function setAssessor(){
        if(document.cscform.__apsasssourceclass.value.length>0){
				return viewframe.setAssessor();
		}
}
 function setAssessy(){
	if(document.cscform.__apsasssourceclass.value.length>0){ 
			return viewframe2.setAssessy();
	 }
}

function Goreset(){
		document.cscform.reset();
}

function beforeGo(){
var flage="";
  with(document.cscform){
     	     flage= chkmyFlage();
         __asfidlist.value=setAslist();
		 __apsassessor.value=setAssessor();
		 __apsassessy.value=setAssessy();
		 __apsgenflag.value=setGenflag();
		 if(flage=="1"){
		         if(__apsasysourceclass.value.length==0){				           
				           return false;
				 }
		 }
        if(__apsasssourceclass.value.length==0){
		       return false
		 }
		 return true;
    }//with
}

function GoSave() {
			if(beforeGo()){;
						confirmSave();
			}else{
					  alert(MyCode[0]);
			}
  }
function GoDelete(){ edelete(); }
function GoSearch(){ search(); }
function GoUpdate(){
  beforeGo();
  update();
 }

function goHelp(helpName,inputName){
	var helpReturn;
		 if(inputName=="__ggid" )
		 	helpReturn="__ggid:ggid,MGROUPGRADE@TDESC";			
		 if(inputName=="__astid" )
		 	helpReturn="__astid:astid,MASTYPE@TDESC";
	     linkHelp_Return(helpName,helpReturn);
}


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

function setAsform(asform){
	with(document.forms[0]){
		asformlist.options[asformlist.options.length] = new Option(asform,asform);
	}
}

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

function loadiframe(){
     with(document.cscform){
				setcframe(__apsasssourceclass.value,"viewframe");
				setcframe(__apsasysourceclass.value,"viewframe2");
		}
}

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

//------------------------ add to select

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 document.forms[0].__asformlist;
}

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){
		  for ( var j = 0; j < newDestList.length; j++ )
		  {
			if ( newDestList[ j ] != null )
			{
			  destList.options[ j ] =new Option(newDestList[ j ].text,newDestList[ j ].value);
			}
		  }
}

function setflag(flag){
		with(document.cscform){
  				      for(i=0;i<__flagecheck.length;i++){
					         __flagecheck[i].disabled=flag;
					  }
		}
}

function setmDisable(objname){
		with(document.cscform){
		         if(objname.value=="1"){
				       setflag(true);
				 }else{
				       setflag(false);
				 }
		}
}

//-----------------------------------------


//-->
</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"  onLoad="loadiframe();">
<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="AS09">
  <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 type="hidden" name="__calendar">
  <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="__apsgenflag" value="">
  <input type="hidden" name="__apsassessor" value="">
  <input type="hidden" name="__apsassessy" value="">
  <input type="hidden" name="__asfidlist" value="">
  <input type="hidden" name="__optionflag" value="0">  
  <input type="hidden" name="ptName"  value="สร้างแบบฟอร์มใบประเมิน">
  <input type="hidden" name="peName"  value="Generate evaluate">
  <script language="javascript"> getInputFormatDate()</script>
  <script language="JavaScript">document.write(Icons());</script>  
  
  <br>
  <div align="center">
    <table cellpadding="0"  cellspacing="0">
      <tr > 
        <td width="640"  class="header">AS09
          <script language="JavaScript">
swapLang('Create Document');
</script>
        &nbsp;</td></tr>
      <tr > 
        <td  colspan="2"> 
          <div align="center"> 
            <table  class="inframe" cellpadding="0" cellspacing="0" >
              <tr> 
                <td colspan="4"  class="blankspace"></td>
              </tr>
              <tr> 
                <td width="29%" nowrap  ><div align="right">
                    <script language="JavaScript">
swapLang('Docno');
</script>
                    &nbsp;</div></td>
                <td width="21%" nowrap ><%=screen.getInput("apsid")%> </td>
                <td width="17%" nowrap ><div align="right">
                    <script language="JavaScript">
swapLang('ReferenceKey');
</script>
                    &nbsp;</div></td>
                <td width="33%" nowrap ><%=screen.getInput("apsreference")%></td>
              </tr>
              <tr> 
                <td nowrap  ><div align="right">
                  <%=screen.getLabel("tdesc")%>
                    &nbsp;</div></td>
                <td colspan="3" nowrap > <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image113','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> 
                  </a> <%=screen.getInput("tdesc")%> </td>
              </tr>
              <tr>
                <td nowrap  ><div align="right">
                     <%=screen.getLabel("edesc")%>
&nbsp;</div></td>
                <td colspan="3" nowrap > <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image113','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"> </a> <%=screen.getInput("edesc")%> </td>
              </tr>
              <tr > 
                <td nowrap  ><div align="right">
                    <script language="JavaScript">
swapLang('Objective');
</script>
                    &nbsp;</div></td>
                <td colspan="3" nowrap ><%=screen.getInput("apsobjective")%></td>
              </tr>
              <tr > 
                <td nowrap  ><div align="right">
                    <script language="JavaScript">
swapLang('Asform_Table_Table');
</script>
                    &nbsp;</div></td>
                <td colspan="3" nowrap > <select name="__asformlist" style="width:310px" size="2">
                  </select>
                  <a href="javascript:showHelp('AS09HELP2.jsp');" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image421','','../IMAGES/BUTTON/SWAP/HELP_SWAP20.gif',1)"><img SRC="../IMAGES/BUTTON/MAIN/HELP20.gif" alt="รายการกลุ่มหัวข้อประเมินผล" name="Image421" width="20" height="20" border="0" align="absmiddle" id="Image42"></a> 
                </td>
              </tr>
              <tr > 
                <td nowrap  ><div align="right">
                    <script language="JavaScript">
swapLang('Type');
</script>
                    &nbsp;</div></td>
                <td colspan="3" nowrap ><%=screen.getInput("astid")%><input type="text" name="MASTYPE@TDESC" value="" disable></td>
              </tr>
              <tr > 
                <td nowrap  ><div align="right">
                    <script language="JavaScript">
swapLang('Group Grade');
</script>
                    &nbsp;</div></td>
                <td colspan="3" nowrap ><%=screen.getInput("ggid")%>
                  <input type="text" name="MGROUPGRADE@TDESC" value="" disable></td>
              </tr>
              <tr > 
                <td nowrap  ><div align="right">
                    <script language="JavaScript">
swapLang('start date');
</script>
                    &nbsp;</div></td>
                <td nowrap ><%=screen.getInput("apsstartdate")%> <a href="#"><img SRC="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Search" name="Image1111" width="20" height="20" border="0" align="absmiddle" onClick="viewCal('__apsstartdate')"></a>
                </td>
                <td nowrap   ><div align="right">
                    <script language="JavaScript">
swapLang('end date');
</script>
                    &nbsp;</div></td>
                <td nowrap ><%=screen.getInput("apsenddate")%> <a href="#"> <img SRC="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Search" name="Image1111" width="20" height="20" border="0" align="absmiddle" onClick="viewCal('__apsenddate')"></a></td>
              </tr>
              <tr > 
                <td nowrap  ><div align="right">
                    <script language="JavaScript">
swapLang('period start date');
</script>
                    &nbsp;</div></td>
                <td nowrap ><%=screen.getInput("apsperiodstart")%><a  href="#"> 
                  <img SRC="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Search" name="Image1111" width="20" height="20" border="0" align="absmiddle" onClick="viewCal('__apsperiodstart')"></a></td>
                <td nowrap   ><div align="right"> 
                    <script language="JavaScript">
swapLang('period end date');
</script>
                    &nbsp;</div></td>
                <td nowrap ><%=screen.getInput("apsperiodend")%> <a  href="#"><img SRC="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Search" name="Image1111" width="20" height="20" border="0" align="absmiddle" onClick="viewCal('__apsperiodend')"></a></td>
              </tr>
              <tr > 
                <td nowrap  ><div align="right">
                    <script language="JavaScript">
swapLang('involver');
</script>
                    &nbsp;</div></td>
                <td colspan="3" nowrap ><input name="__flage" type="radio" value="1" checked onClick="setmDisable(this);">
                  <script language="JavaScript">
swapLang('your_self');
</script></td>
              </tr>
              <tr > 
                <td nowrap  >&nbsp;</td>
                <td colspan="3" nowrap ><input type="radio" name="__flage" value="2" onClick="setmDisable(this);">
                  <script language="JavaScript">
swapLang('Job Description');
</script></td>
              </tr>
              <tr > 
                <td nowrap  >&nbsp;</td>
                <td nowrap >&nbsp;&nbsp;&nbsp;&nbsp; <input type="checkbox" name="__flagecheck" value="2" disabled>
                  <script language="JavaScript">
swapLang('subordinate');
</script></td>
                <td nowrap ><input type="checkbox" name="__flagecheck" value="4" disabled>
                  <script language="JavaScript">
swapLang('Colleague');
</script></td>
                <td nowrap >&nbsp;</td>
              </tr>
              <tr > 
                <td nowrap  >&nbsp;</td>
                <td nowrap >&nbsp;&nbsp;&nbsp;&nbsp; <input type="checkbox" name="__flagecheck" value="8" disabled>
                  <script language="JavaScript">
swapLang('Director');
</script></td>
                <td nowrap ><input type="checkbox" name="__flagecheck" value="16" disabled>
                  <script language="JavaScript">
swapLang('My self');
</script></td>
                <td nowrap >&nbsp;</td>
              </tr>
              <tr > 
                <td class="blankspace" colspan="4" nowrap  >&nbsp;</td>
              </tr>
              <tr > 
                <td valign="baseline" nowrap  ><div align="right">
                    <script language="JavaScript">
swapLang('Assessor_Scoure');
</script>
                    &nbsp; </div></td>
                <td nowrap ><input name="__apsasssourcedesc" type="text"  value="" size="15"> 
				<input name="__apsasssource" type="hidden" value="">
				<input name="__apsasssourceclass" type="hidden" value="">
                  <a href="javascript:showHelp('AS09_1HELP.jsp','__apsasssource','__apsasssourcedesc','__apsasssourceclass','');" 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>
                <td nowrap   >&nbsp;</td>
                <td nowrap >&nbsp;</td>
              </tr>
              <tr > 
                <td colspan="4" class="blankspace"></td>
              </tr>
              <tr > 
                <td colspan="4"><div align="center"> 
                    <iframe id="viewframe" src="" width="85%" height="100px"></iframe>
                  </div></td>
              </tr>
              <tr > 
                <td class="blankspace" colspan="4" nowrap  >&nbsp;</td>
              </tr>
              <tr > 
                <td valign="baseline" nowrap  ><div align="right">
                    <script language="JavaScript">
swapLang('Assessy_Scoure');
</script>
                    &nbsp; </div></td>
                <td nowrap ><input name="__apsasysourcedesc" type="text" id="__apsasysourcedesc" value="" size="15">
				<input name="__apsasysourceclass" type="hidden" value="">
				<input name="__apsasysource" type="hidden" value="">				
                  <a href="javascript:showHelp('AS09_1HELP.jsp','__apsasysource','__apsasysourcedesc','__apsasysourceclass','');" 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> 
                </td>
                <td nowrap   >&nbsp;</td>
                <td nowrap >&nbsp;</td>
              </tr>
              <tr > 
                <td colspan="4" class="blankspace"></td>
              </tr>
              <tr > 
                <td colspan="4"><div align="center"> 
                    <iframe id="viewframe2" src="" width="85%" height="100px"></iframe>
                  </div></td>
              </tr>
              <tr > 
                <td colspan="4" class="blankspace"></td>
              </tr>
              <TR> 
                <TD colspan="4"><div align="center"><a href="javascript:GoSave()"><img SRC="../IMAGES/BUTTON/GENDATA.gif" border="0"></a>
                    &nbsp; <a href="javascript:Goreset()"><img SRC="../IMAGES/BUTTON/CLEAR.gif" border="0"></a></div></TD>
              </TR>
              <tr > 
                <td colspan="4" class="blankspace"></td>
              </tr>
            </table>
          </div></td>
      </tr>
      <tr bordercolor="0069B3"> 
        <td  class="bottom"></td>
      </tr>
    </table>
    <br>
  </div>


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

<%=screen.endJSP()%>

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

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