-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProjectList.jsp
122 lines (120 loc) · 3.38 KB
/
ProjectList.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
<%@page import="java.sql.*"%>
<%@page import="oracle.jdbc.driver.*" %>
<%@page import="oracle.sql.*" %>
<%@page import="javax.servlet.http.*" %>
<%@page import="javax.servlet.*" %>
<%@page import="java.io.*" %>
<%@page import="java.util.*" %>
<%@page import="javax.sql.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Student Project Portal</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<div id="header">
<div>
<div class="logo"><a></a></div>
<ul id="navigation">
<li>
<h1>CBIT STUDENT PROJECT PORTAL</h1>
</li>
<li class="active">
<a href="Logout">Logout</a>
</li>
</ul>
</div>
</div>
<div id="search-box">
<div class="clearfix">
<div id="contents">
<h2 style="font-style : Lato-Thin ;">Search by Project Name...</h2>
<div>
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search here !!" title="Type in a name">
<!--<table id="customers">
<tr>
<th>Project-ID</th>
<th>Description</th>
<th>Name</th>
</tr>
<tr>
<td>0001</td>
<td>A proj on web technologies!</td>
<td>stu portal</td>
</tr>
<tr>
<td>0002</td>
<td>A proj on Networks!</td>
<td>chat bot</td>
</tr>
<tr>
<td>0003</td>
<td>A proj on JSP!</td>
<td>some stuff</td>
</tr>
<tr>
<td>0004</td>
<td>A proj in Predictive analysis!</td>
<td>disease predictor</td>
</tr>
</table>-->
<%try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection connection=null;
connection =DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","pranith","pranith");
if (session == null || session.getAttribute("username") == null)
response.sendRedirect("index.html");
Statement st=connection.createStatement();
ResultSet rs=st.executeQuery("select * from MAINT");
out.println("<form method=\"post\" action=\"FileDownload\">");
out.println("<table id='customers'>");
while(rs.next())
{
out.println("<tr><td>"+rs.getString(1)+"</td><td>"+rs.getString(2)+"</td><td>"+rs.getString(5)+"</td><td><button type=\"submit\" name="+rs.getString(2)+">Download File</button></td></tr>");
}
out.println("</table>");
out.println("</form>");
}
catch (Exception e)
{
e.printStackTrace();
}%>
</div>
</div>
</div>
</div>
<div id="footer">
<div class="clearfix">
<div id="connect">
<a href="www.cbit.ac.in" class="cbit"></a>
</div>
<p>
developed by P Jitendra Kalyan, R Pranith Kumar.
</p>
</div>
</div>
<script>
function myFunction() {
var input, filter, table, tr, td, i;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("customers");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[2];
if (td) {
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
}
else {
tr[i].style.display = "none";
}
}
}
}
</script>
</body>
</html>