-
Notifications
You must be signed in to change notification settings - Fork 0
/
manageStock.jsp
116 lines (111 loc) · 2.55 KB
/
manageStock.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
<%@page import="com.mysql.cj.protocol.Resultset"%>
<%@page import="Project.ConnectionProvider" %>
<%@page import="java.sql.*" %>
<%@include file="header.html"%>
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css" media="screen">
<style>
input[type="text"], input[type="password"], input[type="submit"],select
{
border: none;
background:silver;
height: 50px;
font-size: 16px;
margin-left:35%;
padding:15px;
width:33%;
border-radius: 25px;
}
#customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 55%;
}
#customers td, #customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
</style>
</head>
<body>
<div class="container">
<br>
<%
String msg=request.getParameter("msg");
if("invalid".equals(msg)){
%>
<center><font color="red" size="5">Somethong went wrong! Try Again!</font></center>
<% }%>
<%
if("valid".equals(msg)){
%>
<center><font color="red" size="5">Successfully Updated.</font></center>
<% }%>
<form action="manageStockAction.jsp" method="post">
<div class="form-group">
<center><h2>Select Blood Group</h2></center>
<select name= "bloodGroup">
<option value="A+">A+</option>
<option value="A-">A-</option>
<option value="B+">B+</option>
<option value="B-">B-</option>
<option value="O+">O+</option>
<option value="O-">O-</option>
<option value="AB+">AB+</option>
<option value="AB-">AB-</option>
</select>
<center><h2>Select Increase/Decrese</h2></center>
<select name= "incdec">
<option value="inc">Increase</option>
<option value="dec">Decrease</option>
</select>
<center><h2>Units</h2></center>
<input type="text" placeholder="Enter Units" name="units">
<center><button type="submit" class="button">Save</button></center>
</div>
</form>
<br>
<center>
<table id="customers">
<tr>
<th>Blood Group</th>
<th>Units</th>
</tr>
<tr>
<%
try{
Connection con=ConnectionProvider.getCon();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("Select * from stock");
while(rs.next())
{
%>
<td><%=rs.getString(1) %></td>
<td><%=rs.getString(2) %></td>
</tr>
<%
}
}
catch(Exception e){
System.out.println(e);
}
%>
</table>
</center>
<br>
<br>
<br>
<br>
<h3><center>All Right Reserved @Arish :: 2020-2024 </center></h3>
</body>
</html>