-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventManagerForm.jsp
More file actions
98 lines (86 loc) · 3.99 KB
/
Copy pathEventManagerForm.jsp
File metadata and controls
98 lines (86 loc) · 3.99 KB
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
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.*" %>
<%@ include file="header.jsp" %>
<title>Event Manager Assignment</title>
</head>
<body>
<div class="container">
<h1>Event Manager Assignment</h1>
<form action="EventManagerServlet" method="POST">
<div class="form-group">
<label for="clientName">Client Name:</label>
<input type="text" id="clientName" name="clientName" required>
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="eventName">Event Name:</label>
<input type="text" id="eventName" name="eventName" required>
</div>
<div class="form-group">
<label for="eventManager">Event Manager:</label>
<select id="eventManager" name="eventManager" required>
<option value="">Select Event Manager</option>
<%
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/eventdb",
"root",
""
);
String query = "SELECT id, name FROM event_managers";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
%>
<option value="<%= rs.getInt("id") %>"><%= rs.getString("name") %></option>
<%
}
rs.close();
stmt.close();
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
%>
</select>
</div>
<div class="form-group">
<label for="hall">Hall:</label>
<select id="hall" name="hall" required>
<option value="">Select Hall</option>
<%
try {
Class.forName("com.mysql.cj.jdbc.Driver");
Connection conn = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/eventdb",
"root",
""
);
String query = "SELECT id, name, capacity FROM halls";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
%>
<option value="<%= rs.getInt("id") %>">
<%= rs.getString("name") %> (Capacity: <%= rs.getInt("capacity") %>)
</option>
<%
}
rs.close();
stmt.close();
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
%>
</select>
</div>
<button type="submit" class="submit-btn">Assign Event Manager</button>
</form>
</div>
</body>
</html>