-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbidcrops.jsp
191 lines (162 loc) · 3.83 KB
/
bidcrops.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
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: green;
}
body, html {
font-family: 'Averia Gruesa Libre';
height: 100%;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
.bg-modal {
background-color: rgba(0, 0, 0, 0.8);
width: 100%;
height: 100%;
position: absolute;
top: 0;
display: none;
justify-content: center;
align-items: center;
}
.modal-contents {
height: 300px;
width: 500px;
background-color: white;
text-align: center;
padding: 20px;
position: relative;
border-radius: 4px;
margin:auto;
top:25%;
}
.input1 {
margin: 15px auto;
display: block;
width: 50%;
padding: 8px;
border: 1px solid gray;
}
.close {
position: absolute;
top: 0;
right: 10px;
font-size: 42px;
color: #333;
transform: rotate(45deg);
cursor: pointer;
&:hover {
color: #666;
}
}</style>
<script>
var cropId,currentBidAmount;
function close() {
document.getElementById('bg').style.display='none';
}
function doSubmit(){
var amount=document.getElementsByName('bidamount')[0].value;
var y= amount%100;
if(amount < currentBidAmount || y!=0)
{
var p1=document.getElementById('p1').style.display="block";
return false;}
else{
return true;
}
}
function myTest() {
var ele = document.getElementsByName('bidthiscrop');
for(i = 0; i < ele.length; i++) {
if(ele[i].checked)
cropId = ele[i].value;
}
alert(cropId);
currentBidAmount = document.getElementById(cropId).value;
alert(currentBidAmount);
document.getElementById('bg').style.display = 'block';
document.getElementById('b1').style.display = 'none';
}
</script>
<style>
table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
border: 1px solid #ddd;
}
th, td {
text-align: left;
padding: 8px;
}
</style>
</head>
<body>
<ul>
<li><a href="bidderdashboard.jsp">Home</a></li>
<li><a href="fetchallcrops.rsvp">Bid Crops</a></li>
<li><a href="viewyourbids.jsp">View Your Biddings</a></li>
<li><a href="logoutbidder.rsvp">Logout </a></li>
</ul>
<h3>${ successfullbidmsg }</h3>
<h4 style="margin-left: 45%">List Of Crops To Bid</h4>
<form action="bidding.rsvp" onsubmit="return doSubmit()">
<table>
<tr>
<th>Select To Bid</th>
<th>Crop Type</th>
<th>Crop Name</th>
<th>Base Price</th>
<th>Current Bid</th>
<th>Last Day Of Bid</th>
</tr>
<c:forEach items="${ cropsList }" var="crop">
<tr>
<td><input type="radio" name="bidthiscrop"
value="${ crop.cropId }" /></td>
<td>${ crop.cropType }</td>
<td>${ crop.cropName }</td>
<td>${ crop.cropBasicPrice }</td>
<td>${ crop.cropCurrentBid }</td>
<td>${ crop.cropLastDateForBid }</td>
<input type="hidden" id="${ crop.cropId }" value="${ crop.cropCurrentBid }" />
</tr>
</c:forEach>
</table>
<div class="bg-modal" id="bg">
<div class="modal-contents">
<button type="button" class="close" value="+"></button>
<h2>Enter Amount greater than the Current Bid</h2>
<input class="input1" type="number" name="bidamount"/>
<p style="display: none;" id="p1">Please enter amount greater than the current bid amount and in multiples of 100..</p>
<input type="submit" value="Submit" />
</div>
</div>
<input
style="position: absolute; margin-top: 50px; margin-left: 47%; background-color: #336600 width:300px; border-radius: 5px"
type="button" id="b1" onclick="myTest()" value="CLICK TO BID" />
</form>
</body>
</html>