PSP002.jsp 5.13 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
<%@page contentType="text/html; charset=UTF-8" %>
<%@page import="com.csc.library.utilities.UProfile,com.csc.library.entry.ProcessEntry" %>
<%@page import="com.csc.library.session.InitialEnvironment" %>
<%@page import="java.io.*,org.apache.commons.lang.StringUtils,org.apache.commons.io.FileUtils" %>
<jsp:useBean id="PSP001" class="com.csc.library.system.Task" scope="page" />
<%
	
	PSP001.setChannel(request, response);
	ProcessEntry screen=(ProcessEntry)PSP001.process("ProcessEntry","Process");
	
	if (screen == null)  {
		return;
	}


	screen.process();
	
	String filename = StringUtils.trimToEmpty(request.getParameter("__condition$filename"));

%>
<html ng-app="myHR">
<head>
<title> </title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="../CSS/TISCO.css" >
<link href="../CSS/bootstrap.css" rel="stylesheet"  type="text/css">
<link href="../CSS/bootstrap_csc_backend.css" rel="stylesheet"  type="text/css">
<script type="text/javascript" src="../JS/jquery-2.1.3.min.js"></script>
<script type='text/javascript' src="../JS/bootstrap.js"></script>
<script language="JavaScript" type="text/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" type="text/javascript">setLang("<%=screen.getUProfile().get("lang")%>");</script>
<script language="JavaScript" type="text/JavaScript">

	var message = {
							};

function process() {
	with(document.cscform){
		bCon=confirm("Import Movement Transaction");
		if (bCon==true)	{			
			__cmd .value = "save";							
			submit();
		}
	}
}

</script>
</head>

<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
  <form method="post" name="cscform">
	<input type="hidden" name="__cmd" value="">	
	<input type="hidden" name="__screen" value="PSP002"> 
	<input type="hidden" name="__companyid" value="<%=screen.getUProfile().get("companyid")%>"> 
	<input type="hidden" name="__language" value="<%=screen.getUProfile().get("lang")%>">
	<input type="hidden" name="__process" value="">
	<input type="hidden" name="__ptype" value="">
	<input type="hidden" name="__tname" value="Import Movement Trasaction">
	<input type="hidden" name="__ename" value="Import Movement Trasaction">
	<input type="hidden" name="__prclass" value="ImportMovementTransaction">
	<input type="hidden" name="__condition$filename"  value="<%=filename %>">
	<br>
  <div align="center">
    <table align="center" cellpadding="0"  cellspacing="0" >
    <tr>
      <td class="header">PSP002, <!-- <script type="text/javascript">swapLang("Import Movement Transaction");</script> -->
	  <span swlang code="SW005204">Import Movement Transaction</span>&nbsp;</td>
    </tr>
	<tr>
		 <td class="blankspace">&nbsp;</td>
	  </tr>
    <tr>
      <td>
<%
	
		if( ("refresh").equalsIgnoreCase(request.getParameter("__cmd")) && !StringUtils.isBlank(filename) ) {
			final InitialEnvironment env = new InitialEnvironment("GLOBAL");
			String uploadpath = env.getValue( "PERSONAL_UPLOAD-dir"  ) +"IMPORT/";
			final File file = new File(uploadpath, filename);
				
			
			if( file != null  && file.isFile() && file.exists() ) {

%>        
        <table border="0" cellpadding="10" cellspacing="0" class="maxsize" align="center">
		  <tr>
            <td><table border="0" cellpadding="0" cellspacing="1" class="inframe">
                <tr>
                  <td class="columnlabel"><label><!-- <script type="text/javascript">swapLang("Filename");</script> -->
				  <span swlang code="SW011962">Filename</span></label>&nbsp;</td>
                  <td class="columndata"><%=filename %></td>
                </tr>
                 <tr>
                  <td class="columnlabel"><label><!-- <script type="text/javascript">swapLang("Size");</script> -->
				  <span swlang code="SW001117">Size</span></label>&nbsp;</td>
                  <td class="columndata"><%=FileUtils.byteCountToDisplaySize(file.length())%></td>
                </tr>
                 <tr>
                   <td colspan="2" class="blankspace">&nbsp;</td>
                  </tr>
                 <tr>
                   <td class="columnlabel">&nbsp;</td>
                   <td><a href="javaScript:process();"><img src="../IMAGES/BUTTON/PROCESS.gif" width="73" height="23" border="0" align="absmiddle"></a></td>
                 </tr>
                 
            </table></td>
          </tr>
        </table>

<%		} else { %> 
 
          <div align="center" ><script type="text/javascript">swapLang("Could not get Import file.");</script></div>

<%		} %>       
          
<%  } else {%>

<%  }  %>

      <tr>
        <td  class="buttonline" colspan="7"><div align="center">
          <button type="button" class="btn btn-primary width100" swlang code="SW013181" onClick="uploadFile('personal.import', '__condition$filename');">Submit</button>
        </div>
        </td>
      </tr>
	<tr>
     <td class="blankspace">&nbsp;</td>
  </tr>
	<tr>
      <td class="bottom"></td>
    </tr>
  </table>
</div>
    </form>
</body>
</html>