-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPayment_Success2.jsp
129 lines (123 loc) · 3.08 KB
/
Payment_Success2.jsp
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
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page
import="java.sql.*"
import = "java.io.*"
import = "java.util.*"
import = "javax.sql.*"
import = "java.sql.ResultSet"
import = "java.sql.Statement"
import = "java.sql.Connection"
import = "java.sql.DriverManager"
import = "java.sql.SQLException"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Payment Successful</title>
</head>
<body>
<%
Connection con= null;
PreparedStatement ps = null;
PreparedStatement psu1=null;
PreparedStatement psu2=null;
PreparedStatement psu3=null;
PreparedStatement psu4=null;
String driverName = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/project";
String user = "root";
String password = "robert8472";
try
{
java.lang.Class.forName(driverName + "");
con = DriverManager.getConnection(url, user, password);
psu1=con.prepareStatement("update tuit_fee set status = ? where ref_id="+session.getAttribute("id"));
psu2=con.prepareStatement("update hostel_fee set status = ? where ref_id="+session.getAttribute("id"));
psu3=con.prepareStatement("update trans_fee set status = ? where ref_id="+session.getAttribute("id"));
psu4=con.prepareStatement("update sship set status = ? where ref_id="+session.getAttribute("id"));
}
catch (SQLException e)
{
out.println(e);
}
%>
<%
String[] billname=(String[])session.getAttribute("BillName");
if(billname!=null){ %>
<p style="font-family: verdana; color: crimson;"> Congratulations, your payment is complete.
You have paid for </p>
<%
for(int i=0;i<billname.length-1;i++)
{
%> <ul>
<li><p style="font-family: trebuchet; font-size:20px; color: indigo;"> <%=billname[i]%> </p></li>
</ul>
<%
}
for(int j=0;j<billname.length-1;j++)
{
if(billname[j].equals("Tuition"))
{
try
{
psu1.setString(1,"paid");
psu1.executeUpdate();
}
catch (SQLException e)
{
out.println(e);
}
}
if(billname[j].equals("Hostel"))
{
try
{
psu2.setString(1,"paid");
psu2.executeUpdate();
}
catch (SQLException e)
{
out.println(e);
}
}
if(billname[j].equals("Transport"))
{
try
{
psu3.setString(1,"paid");
psu3.executeUpdate();
}
catch (SQLException e)
{
out.println(e);
}
}
if(billname[j].equals("Scholarship"))
{
try{
psu4.setString(1,"yes");
psu4.executeUpdate();
}
catch (SQLException e)
{
out.println(e);
}
}
}
psu1.close();
psu2.close();
psu3.close();
psu4.close();
}
%>
<center>
<p style="font-family: tahoma; color: saddlebrown;">Thanks for using SBI Payment Portal
<br> Hope you were satisfied with our service
<br> Click <a href="school.jsp">here</a> to see your changes
<br> Click <a href="logout.jsp">here</a> to log out
</p>
</center>
</body>
</html>