Commit 83e3fe76 authored by prumde's avatar prumde

Updated

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@211363 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b9f009c9
......@@ -14,6 +14,8 @@
body{
background-color: #efefef;
padding: 0;
margin: 0;
}
.input-field label{
......@@ -46,6 +48,10 @@ body{
.input-form{
padding: 10px;
}
.sales-container{
max-width: 1024px;
margin: auto;
}
</style>
</head>
<body>
......@@ -92,28 +98,29 @@ body{
}
}
%>
<div style="padding: 10px 0 10px 10px;">
<div class="ang-dbtitle">
Current Sales Summary
</div>
</div>
<form method="POST" action="executeSaleTrends.jsp">
<div class="input-form">
<div class="input-field">
<label>Employee Code : </label>
<input type="text" name="empCode" id="empCode" value="<%=empCode%>"/>
</div>
<div class="input-field">
<label>Site Code : </label>
<input type="text" name="siteCode" id="siteCode" value="<%=siteCode%>"/>
<div class="sales-container">
<div style="padding: 10px 0 10px 10px;">
<div class="ang-dbtitle">
Sales Information
</div>
</div>
<div class="input-field">
<label>Month : </label>
<input type="text" placeholder="MM/YYYY" name="month" id="month" value="<%=monthStr%>"/>
</div>
<button class="view-button" type="submit">View Data</button>
</div>
</form>
<form method="POST" action="executeSaleTrends.jsp">
<div class="input-form">
<div class="input-field">
<label>Employee Code : </label>
<input type="text" name="empCode" id="empCode" value="<%=empCode%>"/>
</div>
<div class="input-field">
<label>Site Code : </label>
<input type="text" name="siteCode" id="siteCode" value="<%=siteCode%>"/>
</div>
<div class="input-field">
<label>Month : </label>
<input type="text" placeholder="MM/YYYY" name="month" id="month" value="<%=monthStr%>"/>
</div>
<button class="view-button" type="submit">View Data</button>
</div>
</form>
</div>
</body>
</html>
......@@ -6,94 +6,6 @@
<%@page import="ibase.utility.UserInfoBean"%>
<%@page import="java.io.*,java.util.*,java.util.zip.*"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.*"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.SQLException"%>
<%@page import="ibase.system.config.ConnDriver"%>
<%!
public HashMap getSQLResultData(String sqlStr, String transDB)
{
HashMap sqlDataMap = null;
Connection con = null;
Statement stmt=null;;
ResultSet rs = null;
try
{
System.out.println("Inside SaleTrendsDetails::getSQLResultData transDB [" +transDB + "] SQL Exection done ! SQL => \n " + sqlStr);
ConnDriver mConnDriver = new ConnDriver();
con = mConnDriver.getConnectDB(transDB);
if( con == null ) {
System.out.println("Unable to get connection for [" + transDB + "]");
throw new Exception("Unable to get connection for [" + transDB + "]");
}
ArrayList<HashMap<String, String>> dataRows = new ArrayList<HashMap<String, String>>();
HashMap<Integer, String> dataCols = new HashMap<Integer, String>();
sqlDataMap = new HashMap();
int noOfRows = 0;
int noOfColumns = 0;
stmt = con.createStatement();
rs = stmt.executeQuery(sqlStr);
ResultSetMetaData rsmd = rs.getMetaData();
while(rs.next())
{
//System.out.println("Result iteration !");
HashMap<String, String> rowDataMap = new HashMap<String, String>();
noOfColumns = rsmd.getColumnCount();
//System.out.println("Result noOfColumns !" + noOfColumns);
for(int ctr = 1; ctr <= noOfColumns; ctr++)
{
if( noOfRows == 0 )
{
dataCols.put(ctr, rsmd.getColumnName(ctr));
}
rowDataMap.put(rsmd.getColumnName(ctr), rs.getString(ctr));
}
//System.out.println("Result dataMap !" + dataMap);
dataRows.add(rowDataMap);
noOfRows++;
}
//System.out.println("Result dataArray !" + dataArray);
sqlDataMap.put("COLS", dataCols);
sqlDataMap.put("ROWS", dataRows);
}
catch(Exception e)
{
sqlDataMap = null;
System.out.println("Inside SaleTrendsDetails::getSQLResultData Exception : " + e.getMessage());
e.printStackTrace();
}
finally
{
try
{
if( stmt != null )
{
stmt.close();
stmt = null;
}
if( con != null )
{
con.close();
con = null;
}
}
catch( Exception eI )
{
eI.printStackTrace();
}
}
return sqlDataMap;
}
%>
<html>
<head>
......@@ -272,9 +184,6 @@ public HashMap getSQLResultData(String sqlStr, String transDB)
int totalRows = noOfRows > 100 ? 100 : noOfRows;
int noOfColumns = dataCols.size();
htmlStrBuff.append("<TABLE id =\"dataTable\">");
htmlStrBuff.append("<tr>");
for( int ctr = 1; ctr <= noOfColumns; ctr++ ) {
......
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