-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreceive-reg.ejs
231 lines (214 loc) · 13 KB
/
receive-reg.ejs
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Receiver Registration - Sharing Surplus</title>
<link rel="stylesheet" href="receive-reg.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lucide/0.263.1/lucide.min.js"></script>
</head>
<body class="min-h-screen bg-gray-50">
<!-- Fixed Navigation Bar -->
<header class="fixed top-0 left-0 w-full bg-white shadow-md z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex justify-between items-center py-4">
<div class="text-lg font-semibold text-blue-600">
<a href="/"><img src="logo.jpg">Sharing Surplus</a>
</div>
<nav class="space-x-4">
<a href="/" class="text-gray-600 hover:text-blue-600">Home</a>
<a href="/about" class="text-gray-600 hover:text-blue-600">About</a>
<a href="/service" class="text-gray-600 hover:text-blue-600">Services</a>
<a href="/contact" class="text-gray-600 hover:text-blue-600">Contact</a>
</nav>
</div>
</header>
<!-- Content Section -->
<div class="pt-24 pb-12">
<div class="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8">
<!-- Header -->
<div class="text-center mb-8">
<h1 class="text-3xl font-bold text-gray-900">Register as a Food Receiver</h1>
<p class="mt-2 text-gray-600">Join us to distribute excess food to those in need</p>
</div>
<!-- Progress Steps -->
<div class="mb-8">
<div class="flex justify-between relative">
<div class="step flex-1 text-center relative active">
<div
class="step-circle w-8 h-8 mx-auto rounded-full flex items-center justify-center bg-blue-600 text-white font-medium">
1</div>
<div class="step-line"></div>
<div class="mt-2 text-sm text-gray-600">Receiver Info</div>
</div>
<div class="step flex-1 text-center relative">
<div
class="step-circle w-8 h-8 mx-auto rounded-full flex items-center justify-center bg-gray-200 text-gray-600 font-medium">
2</div>
<div class="step-line"></div>
<div class="mt-2 text-sm text-gray-600">Location Details</div>
</div>
<div class="step flex-1 text-center">
<div
class="step-circle w-8 h-8 mx-auto rounded-full flex items-center justify-center bg-gray-200 text-gray-600 font-medium">
3</div>
<div class="mt-2 text-sm text-gray-600">Needs & Safety</div>
</div>
</div>
</div>
<!-- Registration Form -->
<form action="/submit/receive" method="post" id="receiverRegistrationForm"
class="bg-white shadow-lg rounded-lg p-8">
<!-- Step 1: Receiver Info -->
<div id="step1" class="step-content">
<div class="space-y-6">
<div class="relative">
<label class="block text-sm font-medium text-gray-700 mb-1">Organization Name</label>
<div class="relative rounded-md">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-lucide="building" class="h-5 w-5 text-gray-400"></i>
</div>
<input type="text" name="receiverOrgName" required=""
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
</div>
<div class="relative">
<label class="block text-sm font-medium text-gray-700 mb-1">Contact Person Name</label>
<div class="relative rounded-md">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-lucide="user" class="h-5 w-5 text-gray-400"></i>
</div>
<input type="text" name="receiverContactPerson" required=""
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div class="relative">
<label class="block text-sm font-medium text-gray-700 mb-1">Email Address</label>
<div class="relative rounded-md">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-lucide="mail" class="h-5 w-5 text-gray-400"></i>
</div>
<input type="email" name="receiverEmail" required=""
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
</div>
<div class="relative">
<label class="block text-sm font-medium text-gray-700 mb-1">Phone Number</label>
<div class="relative rounded-md">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-lucide="phone" class="h-5 w-5 text-gray-400"></i>
</div>
<input type="tel" name="receiverPhone" required=""
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
</div>
</div>
</div>
</div>
<!-- Step 2: Location Details -->
<div id="step2" class="step-content hidden">
<div class="space-y-6">
<div class="relative">
<label class="block text-sm font-medium text-gray-700 mb-1">Complete Address</label>
<div class="relative rounded-md">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-lucide="map-pin" class="h-5 w-5 text-gray-400"></i>
</div>
<input type="text" name="receiverAddress" required=""
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
</div>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">City</label>
<input type="text" name="receiverCity" required=""
class="block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">State</label>
<input type="text" name="receiverState" required=""
class="block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
</div>
</div>
</div>
<!-- Step 3: Needs & Safety -->
<div id="step3" class="step-content hidden">
<div class="space-y-6">
<div class="space-y-4">
<label class="block text-sm font-medium text-gray-700">Type of Food Needed</label>
<div class="grid grid-cols-2 gap-4">
<label class="flex items-center space-x-3">
<input type="checkbox" name="foodNeeded" value="cooked"
class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500">
<span class="text-sm text-gray-700">Cooked Meals</span>
</label>
<label class="flex items-center space-x-3">
<input type="checkbox" name="foodNeeded" value="vegetables"
class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500">
<span class="text-sm text-gray-700">Raw Vegetables</span>
</label>
</div>
</div>
<div class="relative">
<label class="block text-sm font-medium text-gray-700 mb-1">Password</label>
<input type="password" name="receiverPassword" required=""
class="block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
</div>
</div>
<!-- Form Navigation Buttons -->
<div class="mt-8 flex justify-between">
<button type="button" id="prevStep" class="bg-gray-300 text-gray-800 px-4 py-2 rounded-md hidden">
Previous
</button>
<button type="button" id="nextStep" class="bg-blue-600 text-white px-4 py-2 rounded-md">
Next
</button>
<a href="/"><button type="submit" id="submitForm"
class="bg-green-600 text-white px-4 py-2 rounded-md hidden">
Submit
</button>
</a>
</div>
</form>
</div>
</div>
<script>
const steps = document.querySelectorAll('.step');
const stepContents = document.querySelectorAll('.step-content');
let currentStep = 0;
// Event listener for the "Next" button
document.getElementById('nextStep').addEventListener('click', () => {
if (currentStep < steps.length - 1) {
steps[currentStep].classList.remove('active');
steps[currentStep].classList.add('completed');
stepContents[currentStep].classList.add('hidden');
currentStep++;
steps[currentStep].classList.add('active');
stepContents[currentStep].classList.remove('hidden');
updateButtons();
}
});
// Event listener for the "Previous" button
document.getElementById('prevStep').addEventListener('click', () => {
if (currentStep > 0) {
steps[currentStep].classList.remove('active');
steps[currentStep - 1].classList.remove('completed');
stepContents[currentStep].classList.add('hidden');
currentStep--;
steps[currentStep].classList.add('active');
stepContents[currentStep].classList.remove('hidden');
updateButtons();
}
});
// Update button visibility based on the current step
function updateButtons() {
document.getElementById('prevStep').classList.toggle('hidden', currentStep === 0);
document.getElementById('nextStep').classList.toggle('hidden', currentStep === steps.length - 1);
document.getElementById('submitForm').classList.toggle('hidden', currentStep !== steps.length - 1);
}
</script>
</body>
</html>