Monday, 27 July 2015

Postgresql

CURRENT TRANSACTIONS CODE:



<%
     if(session.getAttribute("authData")==null || "2".equalsIgnoreCase(session.getAttribute("authData")+"")){
response.sendRedirect("/adminconsole/login.jsp");
return;
}

String date = DbUtil.getVal("select to_char(now(),'Mon DD YYYY, HH:MI:ss AM')",null);

%>
<html>
<head>
<%@ include file="../general/styles.css"%>
<%@ include file="../general/header.jsp"%>
</head>
<style type="text/css">
.odd{
background-color:#E4FAE6;
}
.even{
background-color:#F1FCF2;
}
.head{
background-color:silver;
}
</style>
<body>

<form id="currenttransactionform" name="currenttransactionform" method="POST">
<table><tr>
<td><h2>Time Now:</h2></td><br/>
<td><h2><%=date%></h2></td>
<td valign="top"><input type="submit" value="Reload"></td>
</tr></table>
<table align="center" >
<%
//eventidval=request.getParameter("eventidval");
DBManager db =new DBManager();
StatusObj statobj =null;
String base="";
String cls="";
String query="select current_action,status,selectedpaytype,transactiondate,tid,eventid from event_reg_details_temp order by transactiondate desc limit 20";
statobj=db.executeSelectQuery(query,new String[]{});
if(statobj!=null && statobj.getStatus()){
%>


<table align="center" border="1" cellpadding="5" cellspacing="5"
style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%">
<tr class="head">
<th>Event ID</th>
<th>Selected Paytype</th>
<th>Transaction Date</th>
<th>Current Action</th>
<th>Status</th>
<th>Transaction ID</th>
</tr>

<%
for(int i=0;i<statobj.getCount();i++){
if(i%2==0){
cls="even";
}
   else{
cls="odd";
    }
String eid=db.getValue(i,"eventid","");
String paytype=db.getValue(i,"selectedpaytype","");
String tdate=db.getValue(i,"transactiondate","");
String curractn=db.getValue(i,"current_action","");
String status=db.getValue(i,"status","");
String tid=db.getValue(i,"tid","");
%>

<tr class="<%=cls%>">
<td><%=eid%></td>
<td><%=paytype%></td>
<td><%=tdate%></td>
<td><%=curractn%></td>
<td><%=status%></td>
<td><%=tid%></td>
<tr>
<%}}%>
</table>
</table>
</form>
<table><tr><td height="30px"></td></tr></table>
<%@ include file="../../general/footer.jsp"%>
</body>
</html>