JSP

<%@ page contentType="text/html; charset=euc-kr" %>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.*,
                 frw.common.lib.*,
                 frw.common.dto.*,
                 com.common.lib.jrlib.*"
          errorPage="/Error.jsp"
%>
<%@ include file="/select_common.jsp"%>
<%@ include file="/session.jsp"%>
<%@ include file="/authority.jsp"%>
<%@ include file="/url_check.jsp"%>
<%@ taglib uri="/WEB-INF/hrms.tld" prefix="hrm" %>
<% request.setCharacterEncoding("ksc5601"); %>
<jsp:useBean id="SysCodeCommand" class="sys.command.SysCodeCommand" scope="page" />
<jsp:useBean id="frwDac_commonCommand" class="frw.command.FrwDac_commonCommand" scope="page" />
<%
 /***********************************************************
 * 프로그램의 기본내용을 입력합니다.
 ************************************************************
 * JSP Name  : hrm0107_l_p01.jsp
 * Description :  리스트를 만들기 위한 JSP
 * Author  :
 * Create Date : 2011.10.00
 * History  : 2011.10.00 Initial create by
 ***********************************************************/
 /***********************************************************1
 * JSP Source를 밑의 부분에 입력합니다.
 ***********************************************************/
    String menu_type  = jrTools.getString(request.getParameter("menu_type"));
    String mod_emp_id = (String) session.getAttribute("emp_id");
   
    Date nowDate = new Date();
    SimpleDateFormat format = new SimpleDateFormat ("yyyy.MM.dd");
    String tempDate  = format.format(nowDate);
    String search_ym = "";
    String work_ym   = "";
    String note      =  new String("");
    String check_yn  = "Y";
   
// System.out.println ("--------------------- hrm0107_lp01.jsp ---------------------");

%>
<HTML>
<HEAD>
<script language="javascript" src="/hrmweb/com/js/hrm.js"></script>
<script language="javascript" src="/hrmweb/com/js/module.js"></script>
<script language="javascript" src="/hrmweb/win/grid/IBSheetInfo.js"></script>
<link href="/hrmweb/com/css/dymos.css" rel=stylesheet type=text/css>
<script>
    var rowidx = 0;
 var objidx = 0;
 var validSubmit = false;
 function goThere(str) {
  switch (str) {
   case 'search':
      //mySheet.ShowDebugMsg=true;
         query = "org_id="+document.form1.org_id.value +
                 "&org_nm="+document.form1.org_nm.value +
                 "&search_id="+document.form1.search_id.value +
                 "&search_nm="+document.form1.search_nm.value +
                 "&search_ym="+document.form1.search_ym.value;
         mySheet.DoSearch("hrm0107_l_x01.jsp",query);
      //mySheet.ShowDebugMsg=false;
    break;
   case 'update':
       var DelCount = mySheet.RowCount("D");
       if (DelCount > 0){
           var Del_Cal_Ymd = new Array(DelCount);
      
          
           var AllCount = mySheet.RowCount;   
           var index = 0;
           for (var i=1; i < AllCount + 1; i++){
           
              if (mySheet.CellValue(i,1) == "D"){
                  index++;
                  Del_Cal_Ymd[index] = mySheet.CellValue(i,3) + "|" + mySheet.CellValue(i,4) + "|" + "";
              }
           }
          
          if (document.form1.flag.value == "D" && confirm("삭제하시겠습니까 ?")){
            document.form1.del_cal_ymd.value = Del_Cal_Ymd.join(",");
            document.form1.target="save";
                     document.form1.method="POST";
                     document.form1.action='hrm01071_lu_c03.jsp?gGroup_id=<%=gGroup_id%>&gMenu_id=<%=gMenu_id%>';
                     document.form1.submit();
                     }
          break;
       }  
      
   

       if (document.form1.flag.value == "D") confirm("삭제하시겠습니까 ?");
       if (checkform() && confirm("저장하시겠습니까?"))
                {
               
                   document.form1.target = "save";
                   document.form1.method="POST";
                //   document.form1.flag.value = "I";
                   document.form1.action='hrm0107_lu_c01.jsp?gGroup_id=<%=gGroup_id%>&gMenu_id=<%=gMenu_id%>';
                   document.form1.submit();
               }
                break;
   case 'save':
    break;
   case 'new':
       var iRow = mySheet.DataInsert(true);
      
       mySheet.CellValue2(iRow,mySheet.SaveNameCol("check_yn"))    = "Y";
       mySheet.CellValue2(iRow,mySheet.SaveNameCol("cal_ymd"))     = "<%=tempDate%>";
          mySheet.CellValue2(iRow,mySheet.SaveNameCol("note"))        = "<%=note%>";


       var i = mySheet.RowCount;
    break;
   case 'print':
    this.print();
    break;
   case 'excel':
      mySheet.SpeedDown2Excel(true);
    break;

  }
 }
</script>
<script language="javascript">
 function LoadPage(){
        /************************************************************
        // Grid Width 정의 : 그리드의 넓이를 말한다.(수정해야 될 것)
  mySheet.SheetWidth=800;
        *************************************************************/
  mySheet.SheetWidth = autowidth.clientWidth;
        /************************************************************
        // host와 Port를 Grid로 리턴 [필수]   
        *************************************************************/
  mySheet.InitHostInfo(location.hostname,location.port,page_path);
        /************************************************************
        // 병합(Merge) 허용 여부 [필수] msHeaderOnly , msPrevColumnMerge
        *************************************************************/
        // mySheet.MergeSheet = msAll;
          mySheet.MergeSheet = msHeaderOnly;
        /************************************************************
        //Edit 허용 여부 [필수]
        *************************************************************/
        mySheet.Editable = true;
        /************************************************************
        //InitRowInfo(int HeadRows,int DataRows, Long ViewRows,Long OnePageRows)
        //InitRowInfo(해더 행의 개수, 단위 데이터행의 개수, 한번 보여지는 행의 개수, 한번 조회해 오는 개수 default =100)
        *************************************************************/
        mySheet.InitRowInfo(1,1,25);
        /************************************************************
        // InitColumnInfo(int,int,int,Boolean)
        // InitColumnInfo(컬럼의 개수,좌우로 스크롤되지 않는 컬럼위치,0,true)-수정해야 될 것
        *************************************************************/
        mySheet.InitColumnInfo(8,0,0,true);
        /************************************************************
        // 컬럼을 헤더부분을 추가시에 한글로 추가한다.(수정해야 될 것)
        *************************************************************/
        mySheet.InitHeadRow(0,"No|상태|삭제|날짜|사번|성명|신청여부|비고",true);

        /**************************************************************************************************************************************************************************************************
        // InitDataProperty(     ROW,   COL,    DATATYPE,    WIDTH,  DATAALIGN, COLMERGE,   SAVENAME,    KEYFIELD,  CALCULOGIC,  DATAFORMAT, POINTCOUNT,    UPDATEEDIT,    INSERTEDIT,    EDITLEN)
        ***************************************************************************************************************************************************************************************************/
  mySheet.InitDataProperty(0, rowidx++, dtSeq,      40,  daCenter, true,    "no");
  mySheet.InitDataProperty(0, rowidx++, dtStatus,  45,  daCenter, false,    "flag");
  mySheet.InitDataProperty(0, rowidx++, dtDelCheck,  45,  daCenter, true,    "sDelete");

  mySheet.InitDataProperty(0, rowidx++, dtData,      80,  daCenter, false,    "cal_ymd",   false, "",     dfDateYmd,    0, false, true, 60);
  mySheet.InitDataProperty(0, rowidx++, dtData,      80,  daCenter, false,    "emp_id",      false, "",     dfNone,       0, false, true, 60);
  mySheet.InitDataProperty(0, rowidx++, dtData,      80,  daCenter, false,    "emp_nm",      false, "",     dfNone,       0, false, true, 60);

  mySheet.InitDataProperty(0, rowidx++, dtCombo,  80,  daCenter, false,    "check_yn",    false, "",     dfNone,       0, false, true, 60);
  mySheet.InitDataProperty(0, rowidx++, dtData,      80,  daCenter, false,    "note",        false, "",     dfNone,       0, false, true, 60);

  mySheet.InitDataCombo (0,6, "|신청|미신청|","|Y|N|");
   goThere('search');
    }
</script>

<!-- 자료조회 후에 발생하는 Event -->
<script language="javascript" for="mySheet" event="OnSearchEnd(sErr)">
 if (sErr != "") alert("조회중에 오류가 발생했습니다.!!!");

</script>
<!-- 데이터가 변경될때 발생하는 Event -->
<script language="javascript" for="mySheet" event="OnChange(Row,Col,Value)">

       document.form1.flag.value       = mySheet.CellValue(Row,1);
      
/*      
       document.form1.sDelete.value    = mySheet.CellValue(Row,2);
       document.form1.cal_ymd.value    = mySheet.CellValue(Row,3);
       document.form1.emp_id.value     = mySheet.CellValue(Row,4);
       document.form1.emp_nm.value     = mySheet.CellValue(Row,5);
       document.form1.check_yn.value   = mySheet.CellValue(Row,6);
       document.form1.note.value       = mySheet.CellValue(Row,7);
*/      
</script>
<!-- 팝업윈도우를 띄우고자 할때 사용하는 Event -->
<script language="javascript" for="mySheet" event="OnPopupClick(Row, Col)">
</script>
<!-- Click시 발생하는 Event -->
<script language="javascript" for="mySheet" event="OnClick(Row,Col,Value)">
       document.form1.flag.value       = mySheet.CellValue(Row,1);
       document.form1.sDelete.value    = mySheet.CellValue(Row,2);
       document.form1.cal_ymd.value    = mySheet.CellValue(Row,3);
       document.form1.emp_id.value     = mySheet.CellValue(Row,4);
       document.form1.emp_nm.value     = mySheet.CellValue(Row,5);
       document.form1.check_yn.value   = mySheet.CellValue(Row,6);
       document.form1.note.value       = mySheet.CellValue(Row,7);
</script>
<!--  더블클릭을 사용하여  -->
<Script language="javascript" for="mySheet" event="OnDblClick(Row,Col,Value)">

   if (mySheet.CellValue(Row,1) == "I"){
         
       //   alert (Row + ":" + Col);
          switch (Col){
             case 1:
             break;
             case 2:
             break;
             case 3:
             break;
             case 4:
                emp_id = mySheet.CellValue(Row,4);
                emp_nm = mySheet.CellValue(Row,5);
                  document.form1.sheet_row.value = Row;
                searchSawon(emp_id, emp_nm);
             break;
             case 5:
                emp_id = mySheet.CellValue(Row,4);
                emp_nm = mySheet.CellValue(Row,5);
                   document.form1.sheet_row.value = Row;
                searchSawon(emp_id, emp_nm);
             break;
             case 6:
             break;
             case 7:
             break;
          }         
       }
</script>
<!-- 데이터베이스에 저장하기 직전에 발행하는 Event(저장전에 체크로직을 기술한다) -->
<script language="javascript" for="mySheet" event="OnValidation(Row, Col, Value)">
    alert ("저장 직전 이벤트");
</script>

<!-- 데이터베이스에 저장된 직후 발생하는 Event -->
<script language="javascript" for="mySheet" event="OnSaveEnd(sErr)">
 if (sErr=="") {
  alert("저장되었습니다.");
  goThere('Search');
 }
 else {
  alert("입력된 자료중 중복된 자료가 있거나 예외상황이 발생했습니다.");
 }
</script>
<script type="text/javascript">
    /************************************************************
    // 저장을 위한 폼체크
    ************************************************************/
  
    function checkform(){
      
       if (document.form1.cal_ymd.value == "") {
         alert ("날짜 을 입력하세요 !");
         document.form1.cal_ymd.focus();
         return false;
       }     
      
       if (document.form1.emp_id.value == "") {
         alert ("사번을 입력하세요 !");
         document.form1.emp_id.focus();
         return false;
       }
   
       if (document.form1.check_yn.value == "") {
         alert ("신청여부를 선택하세요 !");
         document.form1.check_yn.focus();
         return false;
       }
      
       if (document.form1.note.value.length > 10 || document.form1.note.value == null) {
         alert ("메모 길이가 너무 큽니다 ! or Null ");
         document.form1.note.focus();
         return false;
       }
      
   
       if (document.form1.mod_emp_id.value == "") {
         alert ("사번이 없읍니다 !");
         document.form1.mod_emp_id.focus();
         return false;
       }
      
                      
       return true;
    }
   
     function searchCode(searchType,srcObj){
  if(srcObj.value == srcObj.defaultValue) srcObj.value = '';
  if(searchType=='emp_id'){
   if (event.keyCode == 13){
    document.frames['myFrame'].location.href = '/hrms/com/web/com914r_p01.jsp?searchEmp_id='+srcObj.value+'&gGroup_id=<%=gGroup_id%>&gMenu_id=<%=gMenu_id%>';
   }
  } else if(searchType=='emp_nm'){
   if (event.keyCode == 13){
    document.frames['myFrame'].location.href = '/hrms/com/web/com914r_p01.jsp?searchEmp_nm='+srcObj.value+'&gGroup_id=<%=gGroup_id%>&gMenu_id=<%=gMenu_id%>';
   }
  }  else if(searchType=='org_id'){
   if (event.keyCode == 13){
    document.frames['myFrame'].location.href = '/hrms/com/web/com907r_p01.jsp?ret_method=applyOrganization&searchOrg_id='+srcObj.value+'&gGroup_id=<%=gGroup_id%>&gMenu_id=<%=gMenu_id%>';
   }
  } else if(searchType=='org_nm'){
   if (event.keyCode == 13){
    document.frames['myFrame'].location.href = '/hrms/com/web/com907r_p01.jsp?ret_method=applyOrganization&searchOrg_nm='+srcObj.value+'&gGroup_id=<%=gGroup_id%>&gMenu_id=<%=gMenu_id%>';
   }
  }
 }
   
   
   
       //부서 찾기
 function openOrgWin(){
  var win2 = window.open("/hrms/com/web/com902r_p01.jsp?gGroup_id=<%=gGroup_id%>&gMenu_id=<%=gMenu_id%>" ,"openOrgWin",'status=yes,resizable=no,scrollbars=yes,height=400,width=400,top='+(screen.height-400)/2+',left='+(screen.width-400)/2);
  win2.focus();
 }
 function applyOrganization(org_id, org_nm, org_full_nm, org_sta_ymd){
  document.form1.org_id.value = org_id;
  document.form1.org_nm.value = org_nm;
  document.form1.org_sta_ymd.value = org_sta_ymd;
 }

 function applyTreeCode(org_id, org_nm, org_full_nm, org_sta_ymd){

  applyOrganization(org_id, org_nm, org_full_nm, org_sta_ymd)
 }
   
        // 사원찾기
 function searchSawon(emp_id, emp_nm){
  var win1 = window.open("/hrms/com/web/com914f_p01.jsp?searchEmp_id="+emp_id+"&searchEmp_nm="+emp_nm+"&gGroup_id=<%=gGroup_id%>&gMenu_id=<%=gMenu_id%>" ,"win1",'status=yes,resizable=no,scrollbars=no,height=500,width=600,top='+(screen.height-500)/2+',left='+(screen.width-600)/2);
  win1.focus();
 }
 function applySawon(){
     if (document.form1.sheet_row.value >= 1){
     document.form1.emp_id.value = sawon.emp_id;
     document.form1.emp_nm.value = sawon.emp_nm;

     mySheet.CellValue (document.form1.sheet_row.value,4) = document.form1.emp_id.value;
     mySheet.CellValue (document.form1.sheet_row.value,5) = document.form1.emp_nm.value;
  } else {
     document.form1.search_id.value = sawon.emp_id;
     document.form1.search_nm.value = sawon.emp_nm;

  }

 
 //    alert ("\n사원검색 " +
 //           "\nsawon_emp_id    : " + sawon.emp_id +
 //           "\nsawon_emp_nm    : " + sawon.emp_nm +
 //           "\ndocument.emp_id : " + document.form1.emp_id.value +
 //           "\ndocument.emp_nm : " + document.form1.emp_nm.value);

 }

   
   
   
</script>
</HEAD>
<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"  bgcolor="#FFFFFF" onload="LoadPage()" <%=application.getInitParameter("body-tag") %> >


<form name="form1">
<table class="cs_bg01"width="100%" border="0" cellpadding="0" cellspacing="4">
   <tr>  
     <td class="cs_bg02" height="26">
       <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="1">
       <tr>
       <td height="24" class="cs_bg03">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
               
                <td class="td_button" widht="5%" >
                  <img src="/hrmweb/com/img/nbsp.gif" width="8" >부서코드<img src="/hrmweb/com/img/nbsp.gif" width="8" height="8">
                  <input type="text" class="inp01" name="org_id" size="8" onkeydown="searchCode('org_id',this)"  onblur="searchCode('org_id',this)">
               
                </td>
                <td class="td_button" widht="5%" >
                  <img src="/hrmweb/com/img/nbsp.gif" width="8" >부서명<img src="/hrmweb/com/img/nbsp.gif" width="8" height="8">
                  <input type="text" class="inp01" name="org_nm" size="8" onkeydown="searchCode('org_nm',this)"  onblur="searchCode('org_nm',this)">
                  <img src="/hrmweb/com/img/b_search.gif " align="absmiddle"  onClick="openOrgWin()" style="cursor:hand;">
                </td>
               
               
                <td class="td_button" widht="5%" >
                                                성명<img src="/hrmweb/com/img/nbsp.gif" width="8" >
                  <input type="text" class="inp01" name="search_nm" size="10" onkeydown="searchCode('emp_nm',this)" >
                </td>
               
                <td class="td_button" widht="5%" >
                  <img src="/hrmweb/com/img/nbsp.gif" width="8" >사번<img src="/hrmweb/com/img/nbsp.gif" width="8" height="8">
                  <input type="text" class="inp01" name="search_id" size="10"      onkeydown="searchCode('emp_id',this)" >
                  <img src="/hrmweb/com/img/b_search.gif " align="absmiddle"    style="cursor:hand;" onClick="searchSawon('', '')">
                  <img src="/hrmweb/com/img/nbsp.gif" width="8" height="8">
                </td>
               
                <td class="td_bg01"> 검색년월<img src="/hrmweb/com/img/subCon/po_icon.gif" align="absmiddle">
                </td>
               
    <td class="td_bg_sell">
       <input type="text" class="inp01" name="search_ym" size="10" maxlength="10" style="ime-mode:inactive" errname="년월"  value="<%=tempDate%>" domain="date"  mandatory="yes" />
       <img src=/hrmweb/com/img/b_calender.gif border=0  onClick="OpenCal(document.form1.search_ym)" class="Tab" align="absmiddle" alt="날짜는 년월까지만 계산">
    </td>
              </tr>
            </table>
          </td>
         </tr>
       </table>
     </td>
   </tr>
</table> 
<table class="cs_bg01" width="100%" border="0" cellpadding="0" cellspacing="1" >
   <tr>
      <td class="td_bg03"><img src="/hrmweb/com/img/blank.gif" align="absmiddle">
            석식관리  내역
    </td>
 
      <!-- Search -->
      <td class="td_button" width="4%" class="td_button">
          <a href="#">
            <img src="/hrmweb/com/img/b_inquiry.gif" border="0" align="absmiddle" class="Tab" onclick="goThere('search')"  style="cursor:hand">
          </a> 
      </td>
    
      <!-- New -->
      <td class="td_button" width="4%" class="td_button">
          <a href="#">
            <img src="/hrmweb/com/img/b_new.gif"     border="0" align="absmiddle" onclick="goThere('new')"    class="Tab" style="cursor:hand">
          </a> 
      </td>
     
      <!-- Save -->
      <td class="td_button" width="4%" class="td_button">
          <a href="#">
            <img src="/hrmweb/com/img/b_save.gif"    border="0" align="absmiddle" onclick="goThere('update')" class="Tab" style="cursor:hand">
          </a> 
      </td>
      
      <!--  Excel -->
      <td class="td_button" width="4%" class="td_button">
          <a href="#">
            <img src="/hrmweb/com/img/b_excel.gif"   border="0" align="absmiddle" class="Tab" onClick="goThere('excel');"  style=cursor:hand;>
          </a>
      </td>   
           
   </tr>
 </table>

    <input type="hidden" name="flag"       value="">
    <input type="hidden" name="sDelete"    value="">
    <input type="hidden" name="cal_ymd"    value="">
 
    <input type="hidden" name="emp_id"     value="">
    <input type="hidden" name="emp_nm"     value="">
    <input type="hidden" name="check_yn"   value="">
    <input type="hidden" name="note"       value="<%=note%>">
    <input type="hidden" name="mod_emp_id" value="<%=mod_emp_id%>">
    <input type="hidden" name="mod_date"   value="<%=tempDate%>">
   
    <input type="hidden" name="org_sta_ymd" value="">
    <input type="hidden" name="sheet_row">
    <input type="hidden" name="del_cal_ymd" value="">
</form>
<table id="autowidth" cellspacing="0" cellpadding="0" width="100%" border="0" onresize="ChangeSize(mySheet,this.clientWidth,0);">
<tr height="0"></tr>
</table>

<table>
   <tr>
      <td style="height: 14px; width: 150px; ">       
      </td>
   </tr>
 </table>
<iframe src="/hrmweb/null.html" width=0 height=0 id="myFrame"></iframe>
<iframe src="/hrmweb/null.html" width=0 height=0 id="testFrame" name="testFrame"></iframe>
</body>
</HTML>

댓글

이 블로그의 인기 게시물

jquery css

Struts2의 작동 원리

JSP/Servlet 한글 깨짐 처리 ?