-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEdgeDetails.jsp
199 lines (151 loc) · 4.43 KB
/
EdgeDetails.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!DOCTYPE html>
<%@include file="connectionString.jsp"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Connection"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Edge Details</title>
<!-- CSS -->
<style>
body {
background-image: url("formbg.jpg");
background-repeat: no-repeat;
}
.myForm {
background-opacity: 0.2;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size: 0.8em;
padding: 1em;
border: 1px solid #ccc;
border-radius: 3px;
}
.myForm * {
box-sizing: border-box;
}
.myForm label {
font-size: 0.9em;
}
.myForm .audioOnly {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.myForm input {
border-color: brown;
border: 1px solid /* #ccc */;
border-radius: 3px;
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-size: 0.9em;
padding: 0.5em;
}
div {
align: centre;
padding: 5px;
}
.myForm input {
width: 12em;
}
h6 {
font-size: 10px;
color: white;
font-family: Verdana;
}
.myForm button {
padding: 0.7em;
border-radius: 0.5em;
background: #eee;
border: none;
font-weight: bold;
margin-left: 1.5em;
}
.myForm button:hover {
background: #ccc;
cursor: pointer;
}
</style>
</head>
<body>
<%
String var = request.getParameter("param");
//////////////////////// var has the id of the edge
connectionString cs = new connectionString();
String url = cs.url;
String username = cs.username;
String password = cs.password;
try {
Class.forName("org.postgresql.Driver");
} catch (ClassNotFoundException e) {
System.out.println("Where is your PostgreSQL JDBC Driver? " + "Include in your library path!");
e.printStackTrace();
return;
}
System.out.println("PostgreSQL JDBC Driver Registered!");
java.sql.Connection connection = null;
try {
connection = DriverManager.getConnection(url, username, password);
} catch (Exception e) {
System.out.println("Connection Failed! Check output console");
e.printStackTrace();
return;
}
if (connection != null) {
// System.out.println("Before table");
Statement s = connection.createStatement();
String ins = "SELECT * FROM edge WHERE edge_id='"+var+"'";
ResultSet ra = s.executeQuery(ins);
System.out.println("done done ");
} else {
System.out.println("Failed to make connection!");
}
%>
<form role="form" class="myForm" method="get"
enctype="application/x-www-form-urlencoded" action="EdgeAddition.jsp">
<!-- <div ><h6>EDGE DETAILS</h6> </div> -->
<div class="form-group">
<label class="audioOnly" for="edge_id">Edge ID</label> <input
type="text" name="edge_id" required placeholder="Edge ID">
</div>
<div class="form-group">
<label class="audioOnly" for="edge_name">Edge Name</label> <input
type="text" name="edge_name" required placeholder="Edge Name">
</div>
<div class="form-group">
<label class="audioOnly" for="building_name">Building Name</label> <input
type="text" name="building_name" value ="lib" required
placeholder="Building Name">
</div>
<div class="form-group">
<label class="audioOnly" for="floor">Floor Number</label> <input
type="number" name="floor" required placeholder="Floor Number">
</div>
<div class="form-group">
<label class="audioOnly" for="start_node">Start Node</label> <input
type="text" name="start_node" required placeholder="Start Node">
</div>
<div class="form-group">
<label class="audioOnly" for="end_node">End Node</label> <input
type="text" name="end_node" required placeholder="End Node">
</div>
<div class="form-group">
<label class="audioOnly" for="capacity">Capacity</label> <input
type="number" name="capacity" required placeholder="Capacity">
</div>
<div class="form-group">
<label class="audioOnly" for="edge_length">Edge Length</label> <input
type="number" name="edge_length" required placeholder="Edge Length">
</div>
<button>Save</button>
</form>
</body>