-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsupport.html
More file actions
355 lines (319 loc) · 17.7 KB
/
Copy pathsupport.html
File metadata and controls
355 lines (319 loc) · 17.7 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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Support Center | IPEC Consulting</title>
<link rel="icon" type="image/png" sizes="32x32" href="assets/images/cropped-ipec-logo-32x32.png">
<link rel="apple-touch-icon" href="assets/images/ipec.jpg">
<!-- SEO & Metadata -->
<meta name="description" content="Submit a support ticket for IPEC Consulting issues.">
<meta name="robots" content="index, follow">
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: { sans: ['Inter', 'sans-serif'] },
colors: {
ipec: { green: '#1E8E3E', red: '#D93025' }
}
}
}
}
</script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script src="js/theme.js"></script>
<link rel="stylesheet" href="css/common.css">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "IPEC Consulting",
"url": "https://i.fouralpha.org",
"logo": "https://i.fouralpha.org/assets/images/cropped-ipec-logo-32x32.png",
"sameAs": [
"https://ipecconsulting.org/",
"https://www.linkedin.com/company/ipec-consulting/",
"https://twitter.com/ipecconsulting"
],
"@id": "https://i.fouralpha.org/#organization"
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "IPEC Expense Manager",
"url": "https://i.fouralpha.org",
"publisher": {
"@id": "https://i.fouralpha.org/#organization"
},
"potentialAction": {
"@type": "SearchAction",
"target": "https://i.fouralpha.org/search?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
</head>
<body class="bg-slate-50 dark:bg-slate-900 text-slate-800 dark:text-white transition-colors duration-300 font-sans">
<!-- Navigation -->
<nav class="bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 sticky top-0 z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center gap-3">
<a href="index.html" class="flex items-center gap-2">
<img src="assets/images/ipec.jpg" alt="IPEC" class="h-8 w-8 rounded">
<span class="font-bold text-lg tracking-tight">IPEC Support</span>
</a>
</div>
<div class="flex items-center gap-4">
<a href="index.html" class="text-sm font-medium hover:text-green-600 transition">Back to Home</a>
<button onclick="toggleTheme()"
class="p-2 rounded-full hover:bg-slate-100 dark:hover:bg-slate-700 transition">
<i class="fa-solid fa-moon"></i>
</button>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="max-w-3xl mx-auto px-4 py-12">
<div class="text-center mb-10">
<h1 class="text-3xl font-bold mb-4">How can we help you?</h1>
<p class="text-slate-500 dark:text-slate-400">Fill out the form below to create a support ticket. Our team
usually responds within 24 hours.</p>
</div>
<div
class="bg-white dark:bg-slate-800 rounded-xl shadow-lg border border-slate-100 dark:border-slate-700 overflow-hidden">
<div class="p-8">
<form id="supportForm" class="space-y-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium mb-2">Full Name</label>
<input type="text" id="name" required
class="w-full px-4 py-3 rounded-lg bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 focus:outline-none focus:ring-2 focus:ring-green-500 transition">
</div>
<div>
<label class="block text-sm font-medium mb-2">Email Address</label>
<input type="email" id="email" required
class="w-full px-4 py-3 rounded-lg bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 focus:outline-none focus:ring-2 focus:ring-green-500 transition">
</div>
</div>
<div>
<label class="block text-sm font-medium mb-2">Issue Category</label>
<select id="category" required
class="w-full px-4 py-3 rounded-lg bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 focus:outline-none focus:ring-2 focus:ring-green-500 transition">
<option value="General Inquiry">General Inquiry</option>
<option value="Login Issue">Login / Account Issue</option>
<option value="Expense Claim">Expense Claim Problem</option>
<option value="Technical Bug">Technical Bug</option>
<option value="Feature Request">Feature Request</option>
</select>
</div>
<div>
<label class="block text-sm font-medium mb-2">Priority</label>
<div class="flex gap-4">
<label class="flex items-center gap-2 cursor-pointer">
<input type="radio" name="priority" value="Low"
class="text-green-600 focus:ring-green-500" checked>
<span
class="bg-green-100 text-green-800 text-xs font-semibold px-2.5 py-0.5 rounded dark:bg-green-200 dark:text-green-800">Low</span>
</label>
<label class="flex items-center gap-2 cursor-pointer">
<input type="radio" name="priority" value="Medium"
class="text-yellow-600 focus:ring-yellow-500">
<span
class="bg-yellow-100 text-yellow-800 text-xs font-semibold px-2.5 py-0.5 rounded dark:bg-yellow-200 dark:text-yellow-900">Medium</span>
</label>
<label class="flex items-center gap-2 cursor-pointer">
<input type="radio" name="priority" value="High"
class="text-red-600 focus:ring-red-500">
<span
class="bg-red-100 text-red-800 text-xs font-semibold px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-red-900">High</span>
</label>
</div>
</div>
<div>
<label class="block text-sm font-medium mb-2">Description</label>
<textarea id="message" rows="5" required
class="w-full px-4 py-3 rounded-lg bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 focus:outline-none focus:ring-2 focus:ring-green-500 transition"
placeholder="Please describe your issue in detail..."></textarea>
</div>
<button type="submit" id="submitBtn"
class="w-full bg-green-600 hover:bg-green-700 text-white font-bold py-3 px-4 rounded-lg transition transform active:scale-95 flex items-center justify-center gap-2">
<span>Submit Ticket</span>
<i class="fa-solid fa-paper-plane"></i>
</button>
</form>
</div>
</div>
</main>
<!-- Tracking Section -->
<section class="max-w-3xl mx-auto px-4 pb-12">
<div
class="bg-white dark:bg-slate-800 rounded-xl shadow-lg border border-slate-100 dark:border-slate-700 overflow-hidden">
<div class="p-8">
<h2 class="text-xl font-bold mb-4">Track Existing Ticket</h2>
<form id="trackForm" class="flex flex-col sm:flex-row gap-4">
<input type="text" id="trackId" required placeholder="Enter Ticket Reference ID"
class="flex-1 px-4 py-3 rounded-lg bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 focus:outline-none focus:ring-2 focus:ring-green-500 transition">
<button type="submit" id="trackBtn"
class="bg-gray-800 hover:bg-gray-900 dark:bg-slate-700 dark:hover:bg-slate-600 text-white font-bold py-3 px-6 rounded-lg transition shadow-sm">
Track Ticket
</button>
</form>
<div id="trackResult"
class="mt-6 hidden p-6 rounded-lg border border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-900/50">
<div class="flex justify-between items-start mb-4">
<div>
<span id="resStatus"
class="inline-block px-3 py-1 text-xs font-bold uppercase rounded-full bg-green-100 text-green-700">Open</span>
</div>
<span id="resPriority"
class="text-xs font-bold text-gray-500 bg-gray-200 dark:bg-slate-700 px-2 py-1 rounded">Medium</span>
</div>
<h3 class="font-bold text-lg mb-1" id="resCategory">Category</h3>
<p class="text-sm text-slate-500 dark:text-slate-400 mb-4" id="resDate">Submitted on ...</p>
<div
class="p-4 bg-white dark:bg-slate-800 border border-slate-100 dark:border-slate-700 rounded-lg text-sm text-slate-700 dark:text-slate-300">
<p id="resMessage">Message description goes here...</p>
</div>
</div>
</div>
</div>
</section>
<!-- Success Modal -->
<div id="successModal"
class="fixed inset-0 bg-black/50 z-[60] hidden flex items-center justify-center backdrop-blur-sm">
<div class="bg-white dark:bg-slate-800 rounded-2xl p-8 max-w-sm w-full mx-4 text-center shadow-2xl transform scale-95 opacity-0 transition-all duration-300"
id="modalContent">
<div
class="w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center mx-auto mb-4 text-green-600">
<i class="fa-solid fa-check text-2xl"></i>
</div>
<h3 class="text-xl font-bold mb-2">Ticket Created!</h3>
<p class="text-slate-500 dark:text-slate-400 mb-6 text-sm">Your support request has been recorded. Reference
ID: <span id="ticketRef" class="font-mono text-green-500"></span></p>
<button onclick="window.location.reload()"
class="w-full bg-slate-900 dark:bg-slate-700 text-white py-2 rounded-lg hover:opacity-90 transition">Close</button>
</div>
</div>
<!-- Firebase Logic -->
<script type="module">
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.22.0/firebase-app.js";
import { getFirestore, collection, addDoc, serverTimestamp, getDocs } from "https://www.gstatic.com/firebasejs/9.22.0/firebase-firestore.js";
// Reuse existing config logic or check localStorage
// For this implementation we'll assume a standard config or fetch it
// Since I cannot read the user's FULL config from here securely, I will use a placeholder
// that matches the project structure. EXPECTING ADMIN-HELPER OR UTILS TO HAVE CONFIG.
// However, standard practice here:
const firebaseConfig = {
apiKey: "AIzaSyBHQF5cUBujrCJqOqybEUIeanTCbHYpMWU",
authDomain: "expense-manager-ec149.firebaseapp.com",
projectId: "expense-manager-ec149",
storageBucket: "expense-manager-ec149.firebasestorage.app",
messagingSenderId: "868468480650",
appId: "1:868468480650:web:484a4e831724a8112feb73"
};
// Try to get config from window if defined in other scripts, else fallback
// We'll rely on the user having disjointed files so we'll init freshly with what we know is likely the project ID from context
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
document.getElementById('supportForm').addEventListener('submit', async (e) => {
e.preventDefault();
const btn = document.getElementById('submitBtn');
const originalText = btn.innerHTML;
btn.disabled = true;
btn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i> Processing...';
try {
const ticket = {
name: document.getElementById('name').value,
email: document.getElementById('email').value,
category: document.getElementById('category').value,
priority: document.querySelector('input[name="priority"]:checked').value,
message: document.getElementById('message').value,
status: 'Open',
createdAt: serverTimestamp()
};
const docRef = await addDoc(collection(db, "support_tickets"), ticket);
// Show Success
const modal = document.getElementById('successModal');
const content = document.getElementById('modalContent');
document.getElementById('ticketRef').textContent = docRef.id.slice(0, 8).toUpperCase();
modal.classList.remove('hidden');
// Small delay for animation
setTimeout(() => {
content.classList.remove('scale-95', 'opacity-0');
content.classList.add('scale-100', 'opacity-100');
}, 10);
} catch (error) {
console.error("Error adding ticket: ", error);
alert("Error submitting ticket: " + error.message);
btn.disabled = false;
btn.innerHTML = originalText;
}
});
// Tracking Logic
document.getElementById('trackForm').addEventListener('submit', async (e) => {
e.preventDefault();
const trackId = document.getElementById('trackId').value.trim().toUpperCase();
if (!trackId) return;
const btn = document.getElementById('trackBtn');
const originalText = btn.innerText;
btn.disabled = true;
btn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i>';
try {
const querySnapshot = await getDocs(collection(db, "support_tickets"));
let foundDoc = null;
querySnapshot.forEach((doc) => {
if (doc.id.toUpperCase().startsWith(trackId)) {
foundDoc = doc.data();
}
});
const resDiv = document.getElementById('trackResult');
if (foundDoc) {
document.getElementById('resStatus').textContent = foundDoc.status || 'Open';
// simple color coding for status
const st = (foundDoc.status || '').toLowerCase();
const statusEl = document.getElementById('resStatus');
statusEl.className = 'inline-block px-3 py-1 text-xs font-bold uppercase rounded-full ' +
(st === 'closed' ? 'bg-gray-100 text-gray-700' :
st === 'in progress' ? 'bg-orange-100 text-orange-700' :
'bg-green-100 text-green-700');
document.getElementById('resPriority').textContent = foundDoc.priority || 'Normal';
document.getElementById('resCategory').textContent = foundDoc.category || 'General';
document.getElementById('resMessage').textContent = foundDoc.message || 'No description provided.';
const dateObj = foundDoc.createdAt ? new Date(foundDoc.createdAt.seconds * 1000) : new Date();
document.getElementById('resDate').textContent = 'Submitted on ' + dateObj.toLocaleDateString();
resDiv.classList.remove('hidden');
} else {
resDiv.classList.add('hidden');
alert('No ticket found matching that ID.');
}
} catch (error) {
console.error("Error fetching tickets: ", error);
alert("Error searching for ticket.");
} finally {
btn.disabled = false;
btn.innerText = originalText;
}
});
</script>
<script type="module">
import { AISupport } from './js/ai-support.js';
window.addEventListener('load', () => {
setTimeout(() => {
new AISupport({
name: 'Guest',
role: 'Visitor',
department: 'Support'
});
}, 5000);
});
</script>
</body>
</html>