Commit 0d9e07a0 authored by chavanp's avatar chavanp

Upload GstExcelTemplate.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106388 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1221b2bd
<% System.out.println("---------calling uploadGstTemplate.jsp"); %>
<%@ page import = "java.util.ArrayList"%>
<%@ page import = "java.util.Set"%>
<%@ page import = "java.util.Iterator"%>
<%@ page import= "java.util.*" %>
<%@ page import = "java.util.HashMap"%>
<%@ page import = "java.util.Collection"%>
<%@ page import = "java.io.File"%>
<%@ page import = "com.oreilly.servlet.multipart.Part"%>
<%@ page import = "com.oreilly.servlet.multipart.FilePart"%>
<%@ page import = "com.oreilly.servlet.multipart.MultipartParser"%>
<%-- <%@ page import="ibase.webitm.ejb.wsfa.masters.test.GSTExcel"%> --%>
<%@page import = "java.lang.*,java.util.*, ibase.webitm.ejb.gst.GSTExcel"%>
<%-- <%GSTExcel Ec = new GSTExcel();%> --%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/ibase/webitm/css/theme/galaxy-theme.css" media="screen"/>
<%
response.setHeader("Cache-Control", "no-store, no-cache,must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean)session.getAttribute("USER_INFO");
String url = "/jsp/UploadGstTemplate.jsp";
session.setAttribute("REFERER",url);
if( userInfo == null || ! "true".equals( session.getAttribute( "IS_EMP_INFO_SET" ) ) )
{
%>
<jsp:forward page="/jsp/DirectAccess.jsp">
<jsp:param name="REFERER" value="<%=url%>"/>
</jsp:forward>
<%
}
%>
<script>
function validateData()
{
<%-- var fileType = <%= session.getAttribute("fileType") %>";
var tempName = document.getElementById("existingTemplate").value;
var submitValue = document.UploadGstTemplate.submitValue[count-1].value;
document.getElementById("submitAction").value = submitValue;
String name = request.getParameter("inputFile");--%>
var isSubmit = true;
if(isSubmit)
{
//document.getElementById("submitValue").disabled = true;
//document.getElementById("upload").disabled = true;
document.getElementById("UploadGstTemplate").submit();
document.UploadGstTemplate.submit();
}
}
function getFileType()
{
var inputVal=document.getElementById("inputFile").value
if(document.getElementById("two").style.display != "none")
{
inputVal = document.getElementById("fileText").value
}
var ext = inputVal.substring(inputVal.lastIndexOf('.') + 1);
if(!(ext == "xls" || ext == "csv" || ext =="xlsx") )
{
alert("Please select file with .xls and .xlsx extension only ");
window.location.reload();
}
if(ext == "xls")
{
document.getElementById("fileType").value = "excel";
document.getElementById("fileFormat").innerHTML = "excel";
}
if(ext == "xlsx")
{
document.getElementById("fileType").value = "excel";
document.getElementById("fileFormat").innerHTML = "excel";
}
if(ext == "csv")
{
document.getElementById("fileType").value = "csv";
document.getElementById("fileFormat").innerHTML = "csv";
}
}
</script>
<%-- Validation on Browse Button --%>
<body>
<form name ="UploadGstTemplate" id="UploadGstTemplate" method = "post" enctype="multipart/form-data" action ="/ibase/UploadGstExcelServlet?action=GET_DATA">
<div class="headerDiv" style="border-left: #E7E1E1 1px solid; border-right: #E7E1E1 1px solid; border-bottom: #E7E1E1 1px solid;">
<table style="width: 60%; table-layout: fixed;" align="center" border="0" >
<!-- <tr>
<td id="header" class="header" colspan= "5" align ="left" >Select File</td>
</tr> -->
<tr>
<td class = "detail1" align="right" style="font-size:14px">File : &nbsp;</td>
<td colspan="3" class = "detail2">
<b id="one" style="margin-left: -1px;">
<input type="file" name= "inputFile" id="inputFile" onChange = "getFileType()" style="font-size: 13px; width: 81.8%" ></input>
</b>
<b id="two" style="display:none; margin-left: -1px;">
<input type="text" name= "fileText" id="fileText" size="32" onblur = "getFileType()" style="width: 81.8%" /></td>
</b>
</tr>
<tr>
<td>
<b id="one" style="margin-left: -1px;">
<%-- This list is hidden on page as File Type would be determined logically with file's Extenstion --%>
<select name = "fileType" id="fileType" width ="85%" class="dropdownlist">
<option value = "" >Select a file</option>
<option value = "csv">CSV</option>
<option value = "excel">EXCEL</option>
<option value = "xml" >XML</option>
</select>
</b>
<!-- <input type="button" value="Upload" class="button" /></td> -->
<input type ="submit" name = "submitValue" id ="upload" value= "Upload" class="button" onClick = "validateData()"/>
<input type ="hidden" id = "submitAction" name = "submitAction"/>
</form>
</td>
</tr>
</table>
</div>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment