-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport-lost.html
More file actions
247 lines (225 loc) · 6.84 KB
/
report-lost.html
File metadata and controls
247 lines (225 loc) · 6.84 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
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Report Lost Item</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f9f9f9;
margin: 0;
padding: 0;
}
header, footer {
background: #000;
color: #fff;
padding: 12px 24px;
display: flex;
justify-content: space-between;
align-items: center;
}
header nav a, footer a {
color: #fff;
margin-left: 20px;
text-decoration: none;
font-weight: bold;
}
.container {
max-width: 800px;
margin: 40px auto;
background: #fff;
padding: 30px;
border-radius: 8px;
box-shadow: 0 0 12px rgba(0,0,0,0.1);
}
h2 {
margin-bottom: 20px;
font-weight: 700;
}
label {
display: block;
margin-top: 15px;
font-weight: bold;
}
input, select, textarea, button {
width: 100%;
padding: 10px;
margin-top: 5px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
button {
margin-top: 20px;
background: black;
color: white;
border: none;
cursor: pointer;
font-weight: bold;
transition: background-color 0.3s ease;
}
button:hover {
background: #444;
}
.row {
display: flex;
gap: 20px;
}
.row > div {
flex: 1;
}
.message {
margin-top: 20px;
padding: 10px;
background: #e0ffe0;
border: 1px solid #8c8;
color: #060;
display: none;
border-radius: 4px;
font-weight: bold;
text-align: center;
}
</style>
</head>
<body>
<header>
<div><strong>Lost & Found IIITDMK</strong></div>
<nav>
<a href="index.html">Home</a>
<a href="report-found.html">Report Found</a>
<a href="report-lost.html">Report Lost</a>
<a href="view-items.html">View Items</a>
<a href="how-we-work.html">How We Work</a>
<a href="about.html">About Us</a>
</nav>
</header>
<div class="container">
<h2>Report a Lost Item</h2>
<form id="lostForm">
<label>Item Name *
<input type="text" required id="itemName" placeholder="e.g., Blue Tumbler" />
</label>
<label>Your Name *
<input type="text" required id="yourName" placeholder="e.g., Jane Smith" />
</label>
<label>College ID *
<input type="text" required id="collegeId" placeholder="e.g., EC22M123" />
</label>
<div class="row">
<div>
<label>Item Type *
<select required id="itemType">
<option value="">-- Select Type --</option>
<option>Water Bottle</option>
<option>ID Card</option>
<option>Notebook</option>
<option>Electronics</option>
<option>Others</option>
</select>
</label>
</div>
<div>
<label>Color *
<select required id="color">
<option value="">-- Select Color --</option>
<option>Black</option>
<option>Blue</option>
<option>Red</option>
<option>Green</option>
<option>Other</option>
</select>
</label>
</div>
</div>
<label>Size
<input type="text" id="size" placeholder="e.g., Medium" />
</label>
<label>Location/Area Lost *
<select required id="location"></select>
<input type="text" id="newLocation" placeholder="+ Add a new location" />
</label>
<label>Date Lost *
<input type="date" required id="dateLost" />
</label>
<label>Photo of Item *
<input type="file" accept="image/*" required id="photo" />
</label>
<label>Bounty (Optional)
<input type="text" id="bounty" placeholder="e.g., ₹100 reward" />
</label>
<label>Description / Notes
<textarea id="description" rows="4" placeholder="Any additional info..."></textarea>
</label>
<button type="submit">Submit</button>
<button type="reset">Reset</button>
<div class="message" id="successMessage">Form submitted successfully!</div>
</form>
</div>
<footer>
<div>© 2025 Lost & Found IIITDM Kancheepuram</div>
<div>
<a href="how-we-work.html">Privacy</a> |
<a href="about.html">About Us</a>
</div>
</footer>
<script>
const locationSelect = document.getElementById('location');
const newLocationInput = document.getElementById('newLocation');
function loadLocations() {
let saved = JSON.parse(localStorage.getItem('locations') || '[]');
locationSelect.innerHTML = '<option value="">-- Select Location --</option>';
saved.forEach(loc => {
let opt = document.createElement('option');
opt.textContent = loc;
locationSelect.appendChild(opt);
});
}
newLocationInput.addEventListener('blur', () => {
const newLoc = newLocationInput.value.trim();
if (newLoc) {
let locs = JSON.parse(localStorage.getItem('locations') || '[]');
if (!locs.includes(newLoc)) {
locs.push(newLoc);
localStorage.setItem('locations', JSON.stringify(locs));
loadLocations();
locationSelect.value = newLoc;
}
newLocationInput.value = '';
}
});
loadLocations();
document.getElementById('lostForm').addEventListener('submit', function(e) {
e.preventDefault();
const reader = new FileReader();
const file = document.getElementById('photo').files[0];
if (!file) return alert('Photo is required.');
reader.onload = function() {
const item = {
type: 'lost',
name: document.getElementById('itemName').value,
person: document.getElementById('yourName').value,
collegeId: document.getElementById('collegeId').value,
itemType: document.getElementById('itemType').value,
color: document.getElementById('color').value,
size: document.getElementById('size').value,
location: document.getElementById('location').value,
date: document.getElementById('dateLost').value,
photo: reader.result,
description: document.getElementById('description').value,
bounty: document.getElementById('bounty').value
};
let items = JSON.parse(localStorage.getItem('lost_found_items') || '[]');
items.unshift(item);
localStorage.setItem('lost_found_items', JSON.stringify(items));
document.getElementById('lostForm').reset();
document.getElementById('successMessage').style.display = 'block';
setTimeout(() => {
document.getElementById('successMessage').style.display = 'none';
}, 3000);
};
reader.readAsDataURL(file);
});
</script>
</body>
</html>