<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="com.csc.library.entry.*" %>
<%@ page import="com.csc.library.utilities.*,com.csc.library.session.*" %>
<%@page contentType="text/html; charset=UTF-8"%>
<jsp:useBean id="APSR005" scope="page" class="com.csc.library.system.Task"/>
<%
    APSR005.setChannel(request ,response);
    ReportEntry screen=null;
    screen=(ReportEntry)APSR005.process("ReportEntry",request.getParameter("__screen"));
    UProfile uf=screen.getUProfile();
    CheckNull chkNull = new CheckNull();
    CscCalendar car = new CscCalendar();
%>
<html ng-app="myHR">
    <head>
        <title>ReportOption</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 src="../JS/angular-1.3.15/angular.js" type="text/javascript"></script>
        <script src="../JS/ANGULAR/SCREEN_ANGULAR.js" type="text/javascript"></script>
        <script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script>
        <script type="text/javascript" src="../JS/jquery-2.1.3.min.js"></script>
        <script src="../JS/VIEWCALENDAR.js"></script>

        <script language="JavaScript" type="text/JavaScript">
            function back(){
                var year = $("input[name='year']").val();
                var seq = $("input[name='seq']:checked").val();
                var bu = $("input[name='__bu2id']").val();
                var budesc = $("input[name='budesc']").val();
                var filter = "apsstate='1' and subdata = '"+bu+"' and apsyear ='"+year+"' and sequence = '"+seq+"' and apsgroup='MBU2' and asrscore ='1'";
                if(bu != ""){
                    with(window.opener.document.cscform){
                        __APSYEAR.value = year;
                        __SEQUENCE.value = seq;
                        __BU2ID.value = bu;
                        __BUDESC.value = budesc;
                        __fixfiltertastran_bu.value = filter;
                    }
                    window.close();
                }else{
                    alert("กรุณาเลือกหน่วยงาน");
                }
            }

            function goHelp(helpName,inputName) {
                var year = $("input[name='year']").val();
                var seq = $("input[name='seq']:checked").val();
                var helpReturn;
                var filter = "bu2id in (select subdata from tapstran_bu where apsyear='"+year+"' and sequence='"+seq+"')";
                with(document.cscform){
                    if (inputName=="__bu2id" ){
                        helpReturn="__bu2id:bu2id,budesc:tdesc";
                    }
                }

                linkHelp_Return(helpName, helpReturn, filter);
            }

        </script>
    </head>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif')">
        <form name="cscform" method="post" >
            <input type="hidden" name="__cmd" value="">
            <input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>">
            <script language="javascript">getInputFormatDate();</script>
            <input type="hidden" name="__calendar">
            <input type="hidden" name="__fixCon">
            <input type="hidden" name="__help">
            <center>
                <table  cellpadding="0"  cellspacing="0">
                    <tr >
                        <td  class="header"> APSR008 Option, <span swlang code="SW000128">Report Option</span>&nbsp;</td>
                    </tr>
                    <tr >
                        <td  colspan="2" align="center">
                            <table  cellpadding="0" cellspacing="0" >
                                <tr>
                                    <td height="12" colspan="2"  class="blankspace"></td>
                                </tr>
                                <tr>
                                    <td colspan="2" class="blankspace"></td>
                                </tr>

                                <tr>
                                    <td width="350" align="right">
                                        <span>หน่วยงาน</span>&nbsp;
                                    </td>
                                    <td width="475" align="left">
                                        <input name="__bu2id" size="10" maxlength="10" value="" onkeypress="chkSpecialKey(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="รหัสหน่วยงาน 3" onmousemver="toolTip('รหัสหน่วยงาน 3')" onmouseout="toolTip()" type="text" readonly="true"><a href="javascript:goHelp('MBU2HELP','__bu2id');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('__bu2id_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="http://localhost:8082/hr/IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__bu2id_image" align="absmiddle" height="20" width="20" border="0"></a>
                                        <input type="text" name="budesc" readonly="true"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" class="blankspace"></td>
                                </tr>

                                <tr>
                                    <td width="350" align="right">
                                        <span swlang code="SW000717">Year</span>&nbsp;
                                    </td>
                                    <td width="475" align="left">
                                        <input type="number" name="year" value="<%=car.getYear()%>" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" class="blankspace"></td>
                                </tr>
                                <tr>
                                    <td width="350" align="right">
                                        <span swlang code="SW012559">Period</span>&nbsp;
                                    </td>
                                    <td width="475" align="left">
                                        <label>
                                            <input name="seq" value="1" type="radio"  checked="checked">
                                            รอบที่ 1
                                        </label>
                                        <label>
                                            <input name="seq" value="2" type="radio">
                                            รอบที่ 2
                                        </label>
                                        <label>
                                            <input name="seq" value="3" type="radio">
                                            รอบที่ 3
                                        </label>
                                        <label>
                                            <input name="seq" value="4" type="radio">
                                            รอบที่ 4
                                        </label>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" class="blankspace"></td>
                                </tr>
                                <TR>
                                    <TD colspan="2" align="center">
                                        <img src="../IMAGES/BUTTON/OK.gif" onClick="back()">
                                        &nbsp;&nbsp; <img src="../IMAGES/BUTTON/CANCEL.gif" onClick="window.close()">
                                    </TD>
                                </TR>
                                <tr >
                                    <td colspan="2" class="blankspace"></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr bordercolor="0069B3">
                        <td  class="bottom"></td>
                    </tr>
                </table>
            </center>
            <INPUT TYPE="hidden" NAME="__screen" VALUE="<%=request.getParameter("__screen")%>">
        </form>
    </body>
</html>