<%@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="AS01" class="com.csc.library.system.Task" scope="page"/>
<%
AS01.setChannel(request,response);
UIManager screen = (UIManager) AS01.process("SingleEntry","AS01");
screen.referLangOff();
CscCalendar cs=new CscCalendar();
ReportUDF rp=new ReportUDF();
%>
<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">
<!--
function linkHelp(help,input){
	with(document.cscform){
	var fixcon="";
	if((__asgid.value.length>0)&&(input=="__asid")){
	     fixcon="asgid='"+__asgid.value+"'";
	}
	var param="AS000.jsp?__helpName="+help+"&__fieldSearch="+input+"&__pageCall="+__screen.value+"&__fixCon="+fixcon;
	window.open(param,"Help","left=150,top=150,width=700,height=440,resizable=yes,scrollbars=yes,toolbar=no,status=yes");
 }
}

function setmAstype(){
	with(document.cscform){
       for(i=0;i<astype.length;i++){
       if(astype[i].checked){
           _astype=astype[i].value;
           __astype.value=_astype;
		   break;
         }//if
       }//for
	}
}

function setmAsnecessary(){
		with(document.cscform){
		   for(i=0;i<asnecessary.length;i++){
		   if(asnecessary[i].checked){
			   _asnecessary=asnecessary[i].value;
			   __asnecessary.value=_asnecessary;
			   break;
			 }//if
		   }//for
		}
}

function setmAsstatus(){
	with(document.cscform){
			   for(i=0;i<asstatus.length;i++){
			   if(asstatus[i].checked){
				   _asstatus=asstatus[i].value;
				   __asstatus.value=_asstatus;
				   break;
				 }//if
			   }//for
			   if(__asstatus.value=="0"){
					 __asststart.value="2443-01-01";
					 __asstend.value="2443-01-01";
			   }
		}
}

function beforeAction(){
		setmAstype();
		setmAsnecessary();
		setmAsstatus();
}

function showAnswer(page,asid){
    var page=page+"?_asid="+asid;
	window.open(page,"Help2","left=150,top=150,width=700,height=500,toolbar=no,status=yes,scrollbars=yes");
}

function gotoAnswer(){
     beforeAction();
	 var page="";
	if(nullCheck()){
	with(document.cscform){
					if(__astype.value=="2"){
						page="AS17_2.jsp";
					}else{
						 page="AS17_1.jsp";
					}
					alert(__confirm.value);
	if(__confirm.value=="0"){
		    	aCon=confirm(MyCode[1]);// จะบันทึกหรือไม่
				if (aCon==true)	{
						if(__astype.value!="0"){
							showAnswer(page,__asid.value)
							}				
				__cmd.value = "save";
				submit();
				}
	}else{
				bCon=confirm(MyCode[3]);
				if (bCon==true)	{
						if(__astype.value!="0"){
							showAnswer(page,__asid.value)
							}
				__cmd.value = "save";
				__confirm.value="2";
					submit();
				}
		}
	  }//with
   }
}

function GoSave() {
     beforeAction();
	confirmSave();
}
function GoDelete(){ edelete(); }
function GoSearch(){ search(); }
function GoUpdate(){
     beforeAction();
     update();
 }
 function loadiframe(){
       var fixcon="";
	   with(document.cscform){
			   if(__asid.value!=""){
					 fixcon="asid='"+__asid.value+"'";
				   var   vframe=document.getElementById("viewframe");
					   vframe.src="AS01HELP2.jsp?__fixCon="+fixcon;
			   }
	   }
 }
 
function getInputFormatTimestamp(){
		document.write("<input type='hidden' name='__dateformat' value='DD/MM/YYYY  00:00:00.000000'>");
}
 
   function goHelp(helpName,inputName){
	var helpReturn="";
	var fcon="";
			if(inputName=="__asgid")
				helpReturn=inputName+":asgid,MASGROUP@TDESC";
			else if(inputName=="__kasid")
				helpReturn=inputName+":kasid,MKEYASS@TDESC";
			
		if(fcon.length==0)
	     linkHelp_Return(helpName,helpReturn);
		else
		helpPageCon(helpName,helpReturn,fcon);
}

//-->

</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="AS01">
  <input type="hidden" name="__help" value="">
  <input type="hidden" name="__cmd"  value="">
	<input type="hidden" name="__calendar">
  	<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="__ascreateby" value="<%=screen.getUProfile().get("userid")%>" >
  <input type="hidden" name="__ascreatedate" value="<%=cs.getYYYYMMDDHHMMSS()%>">
  <script language="javascript">getInputFormatTimestamp();</script>
  <input type="hidden" name="__astype" value="">
  <input type="hidden" name="__asnecessary" value="">
  <input type="hidden" name="__asstatus" value="">
  <script language="JavaScript">document.write(Icons());</script>
  <br>
  <div align="center">
    <table  cellpadding="0"  cellspacing="0">
      <tr >
        <td  class="header">AS01,
          <script language="javascript">swapLang('Assess Table Record');</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  class="columnlabel"><%=screen.getLabel("asid")%></td>
                <td colspan="3" > <%=screen.getInput("asid")%></td>
              </tr>
              <tr>
                <td width="150"  class="columnlabel"><%=screen.getLabel("asgid")%></td>
                <td colspan="3" ><%=screen.getInput("asgid")%>
                  <input type="text" name="MASGROUP@TDESC" value="<%=screen.getDataLabel("masgroup","tdesc")%>" size="35" disabled> </td>
              </tr>
              <tr>
                <td  class="columnlabel"><%=screen.getLabel("kasid")%></td>
                <td colspan="3" ><%=screen.getInput("kasid")%>
                <input type="text" name="MKEYASS@TDESC" value="<%=screen.getDataLabel("mkeyass","tdesc")%>" size="35" disabled></td>
              </tr>
              <tr>
                <td  class="columnlabel"><%=screen.getLabel("tdesc")%></td>
                <td colspan="3" ><%=screen.getInput("tdesc")%>
                </td>
              </tr>
              <tr>
                <td  class="columnlabel"><%=screen.getLabel("edesc")%></td>
                <td colspan="3" ><%=screen.getInput("edesc")%>
                </td>
              </tr>
              <tr>
                <td nowrap  class="columnlabel"><%=screen.getLabel("asobject")%></td>
                <td colspan="3" ><%=screen.getInput("asobject")%>
                </td>
              </tr>
              <tr class="14b">
                <td nowrap  class="columnlabel"><%=screen.getLabel("assuggest")%>
                </td>
                <td colspan="3" ><%=screen.getInput("assuggest")%>
                </td>
              </tr>
              <tr >
                <td  class="columnlabel"><%=screen.getLabel("astype")%></td>
                <td colspan="3" ><input name="astype" type="radio" value="0" checked>
                 <%=rp.getSystemCode("Asstype",screen.getUProfile().get("lang"),"0")%>
                  <input type="radio" name="astype" value="1">
                  <%=rp.getSystemCode("Asstype",screen.getUProfile().get("lang"),"1")%>
                  <input type="radio" name="astype" value="2">
                  <%=rp.getSystemCode("Asstype",screen.getUProfile().get("lang"),"2")%>
                  <input type="radio" name="astype" value="3">
                  <%=rp.getSystemCode("Asstype",screen.getUProfile().get("lang"),"3")%></td>
              </tr>
              <tr >
                <td  class="columnlabel"><%=screen.getLabel("asnecessary")%></td>
                <td colspan="3" ><input name="asnecessary" type="radio" value="0" checked>
                 <%=rp.getSystemCode("Assnec",screen.getUProfile().get("lang"),"0")%>
                  <input name="asnecessary" type="radio" value="1">
                 <%=rp.getSystemCode("Assnec",screen.getUProfile().get("lang"),"1")%></td>
              </tr>
              <tr >
                <td  class="columnlabel"><%=screen.getLabel("asanswer")%></td>
                <td colspan="3" ><%=screen.getInput("asanswer")%></td>
              </tr>
              <tr >
                <td  class="columnlabel"><%=screen.getLabel("ascondition")%></td>
                <td colspan="3" ><%=screen.getInput("ascondition")%></td>
              </tr>
              <tr >
                <td  class="columnlabel"><%=screen.getLabel("asweight")%>
                </td>
                <td colspan="3" ><%=screen.getInput("asweight")%>
                </td>
              </tr>
              <tr >
                <td  class="columnlabel"><%=screen.getLabel("asdefaultscore")%></td>
                <td colspan="3" ><%=screen.getInput("asdefaultscore")%></td>
              </tr>
              <tr >
                <td  class="columnlabel"><%=screen.getLabel("asmaxscore")%></td>
                <td width="148" ><%=screen.getInput("asmaxscore")%>
                </td>
                <td width="79"  class="columnlabel"><%=screen.getLabel("asminscore")%></td>
                <td width="261" ><%=screen.getInput("asminscore")%></td>
              </tr>
              <tr >
                <td  class="columnlabel"><%=screen.getLabel("asstatus")%></td>
                <td colspan="3" ><input name="asstatus" type="radio" value="0" checked>
                  <%=rp.getSystemCode("Assstatus",screen.getUProfile().get("lang"),"0")%>
<input type="radio" name="asstatus" value="1">
                  <%=rp.getSystemCode("Assstatus",screen.getUProfile().get("lang"),"1")%>
                  <%=screen.getInput("asststart")%> <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image411','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)"><img SRC="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Search" name="Image1111" width="20" height="20" border="0" align="absmiddle" onClick="viewCal('__asststart')"></a>
                  -<%=screen.getInput("asstend")%> <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image412','','../IMAGES/BUTTON/SWAP/CALENDAR_SWAP20.gif',1)"><img SRC="../IMAGES/BUTTON/MAIN/CALENDAR20.gif" alt="Search" name="Image1111" width="20" height="20" border="0" align="absmiddle" onClick="viewCal('__asstend')"></a></td>
              </tr>
              <tr >
                <td colspan="4" class="blankspace"></td>
              </tr>
              <tr >
                <td colspan="4"><dd/>                                
                  <script language="javascript">swapLang('Answer of Assess');</script>
                 <a href="javascript:gotoAnswer()"> <img SRC="../IMAGES/BUTTON/ADD.gif" border="0"></a> </td>
              </tr>
              <tr >
                <td colspan="4"><div align="center">
                    <iframe id="viewframe" src="" width="85%"></iframe>
                  </div></td>
              </tr>
              <tr >
                <td colspan="4" class="blankspace"></td>
              </tr>
              <TR>
                <TD colspan="4"><div align="center"></div></TD>
              </TR>
              <tr >
                <td colspan="4" class="blankspace"></td>
              </tr>
            </table>
          </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>
