-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreceipt.html
More file actions
227 lines (199 loc) · 9.88 KB
/
Copy pathreceipt.html
File metadata and controls
227 lines (199 loc) · 9.88 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Reservation Receipt</title>
<link rel="stylesheet" href="styles.css" />
<link href="https://fonts.googleapis.com/css2?family=Lobster&display=swap" rel="stylesheet" />
<link rel="icon" type="image/x-icon" href="sourcefiles/logo.ico" />
<style>
:root {
--bg: #fff9f2;
--panel: #fffefb;
--accent: #4CAF50;
--accent-600: #43a047;
--text: #2f2f2f;
--muted: #6b6b6b;
--ring: rgba(76, 175, 80, 0.35);
--table-border: #e9e9e9;
--row-alt: #fafafa;
}
body {
background:
radial-gradient(1200px 500px at 80% -50%, rgba(76,175,80,0.08), transparent 40%),
radial-gradient(800px 400px at -10% 110%, rgba(255,193,7,0.08), transparent 40%),
var(--bg);
margin: 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.page { max-width: 980px; margin: 56px auto; padding: 0 16px 56px; }
.card {
background: var(--panel);
border: 1px solid rgba(0,0,0,0.06);
border-radius: 16px;
box-shadow: 0 10px 30px rgba(0,0,0,0.08);
padding: 24px;
animation: fadeUp 420ms ease both;
}
h1 { text-align: center; color: var(--text); margin: 0; font-family: 'Lobster', cursive; font-size: 40px; }
.h1-underline { width: 72px; height: 4px; margin: 10px auto 26px; background: linear-gradient(90deg, var(--accent), var(--accent-600)); border-radius: 999px; }
.kv {
display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin-top: 8px; color: var(--text);
}
.kv .label { font-weight: 700; color: var(--muted); }
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--table-border); margin-top: 18px; }
table { width: 100%; border-collapse: collapse; min-width: 560px; background: white; }
thead th { text-align: left; font-weight: 700; font-size: 14px; background: #f6fff7; color: #245a2a; border-bottom: 1px solid var(--table-border); padding: 14px 16px; }
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--table-border); font-size: 15px; color: var(--text); }
tbody tr:nth-child(even) { background: var(--row-alt); }
.price { white-space: nowrap; text-align: right; font-weight: 700; color: #205a25; }
.muted { color: var(--muted); }
.totals {
display: flex; justify-content: flex-end; margin-top: 12px; align-items: center; gap: 12px;
}
.totals .label { font-weight: 800; color: var(--text); }
.totals .amount {
background: linear-gradient(180deg, var(--accent), var(--accent-600));
color: #fff; padding: 8px 16px; border-radius: 999px; font-weight: 800; min-width: 140px; text-align: center; box-shadow: 0 6px 20px rgba(76, 175, 80, 0.35);
}
.actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
.btn {
padding: 12px 18px; background: linear-gradient(180deg, var(--accent), var(--accent-600)); color: white; border: none; border-radius: 999px; cursor: pointer; font-size: 16px; font-weight: 700; box-shadow: 0 6px 20px rgba(76, 175, 80, 0.35);
}
.btn:hover { filter: brightness(1.05); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }
</style>
</head>
<body>
<div id="navbar"></div>
<div class="page">
<div id="receipt-card" class="card">
<h1>Reservation Receipt</h1>
<div class="h1-underline" aria-hidden="true"></div>
<div class="kv">
<div class="label">Name</div><div id="receipt-name"></div>
<div class="label">Phone</div><div id="receipt-phone"></div>
<div class="label">Event Type</div><div id="receipt-event-type"></div>
<div class="label">Date</div><div id="receipt-date"></div>
</div>
<div class="table-wrap">
<table aria-label="Receipt line items">
<thead>
<tr>
<th style="width:65%;">Item</th>
<th class="price" style="width:35%;">Amount</th>
</tr>
</thead>
<tbody id="charges-body"></tbody>
</table>
</div>
<div class="totals">
<div class="label">Total</div>
<div id="receipt-price" class="amount">$0</div>
</div>
<div class="actions">
<button class="btn" onclick="window.print()">Print Receipt</button>
<button class="btn" onclick="window.location.href='reserve.html'">Back to Reservation</button>
</div>
</div>
</div>
<div id="footer"></div>
<script>
// Load Navbar / Footer
fetch('sourcefiles/navbar.html')
.then(r => r.text())
.then(html => document.getElementById('navbar').innerHTML = html);
fetch('sourcefiles/footer.html')
.then(r => r.text())
.then(html => document.getElementById('footer').innerHTML = html);
// Read reservation data
const receiptData = JSON.parse(localStorage.getItem('reservationData')) || {};
// Populate core fields
document.getElementById('receipt-name').textContent = receiptData.name || 'N/A';
document.getElementById('receipt-phone').textContent = receiptData.phone || 'N/A';
const eventTypeDisplay = receiptData.eventType || 'N/A';
document.getElementById('receipt-event-type').textContent = eventTypeDisplay;
document.getElementById('receipt-date').textContent = receiptData.date || 'N/A';
// Pricing maps (synced with pricing.html)
const eventTypePrices = {
'Party': 650,
'Company Meeting': 500,
'Company Get Together': 550,
'Quinceañera': 1200,
'Wedding': 2200,
'Birthday': 450,
'Conference': 1000,
'Other': 1500,
};
const optionMap = {
'italian': { label: 'Italian Cuisine (per 50 guests)', price: 1250 },
'bbq': { label: 'BBQ (per 50 guests)', price: 1050 },
'vegan': { label: 'Vegan Options (per 50 guests)', price: 1350 },
'desserts': { label: 'Desserts (per 50 guests)', price: 550 },
'basic-decorations': { label: 'Standard Decorations', price: 250 },
'enhanced-decorations': { label: 'Enhanced Decorations', price: 600 },
'lighting': { label: 'Lighting', price: 300 },
'sound': { label: 'Sound System', price: 350 },
'basic-photography': { label: 'Event Photography (Basic)', price: 500 },
'premium-photography': { label: 'Event Photography (Premium)', price: 1100 },
};
// Build line items
const tbody = document.getElementById('charges-body');
const opts = Array.isArray(receiptData.options) ? receiptData.options : [];
function addRow(label, amount) {
const tr = document.createElement('tr');
const tdL = document.createElement('td');
const tdR = document.createElement('td');
tdL.textContent = label;
tdR.textContent = `$${amount}`;
tdR.className = 'price';
tr.appendChild(tdL); tr.appendChild(tdR);
tbody.appendChild(tr);
}
// Base event price
if (eventTypePrices[eventTypeDisplay]) {
addRow(`${eventTypeDisplay} (Base)`, eventTypePrices[eventTypeDisplay]);
}
// Options
opts.forEach(o => {
if (typeof o === 'string' && o.startsWith('theme-color:')) return; // handle later
if (optionMap[o]) {
addRow(optionMap[o].label, optionMap[o].price);
}
});
// Theme color add-on (only if Standard decorations selected and Enhanced not selected)
const hasTheme = opts.some(o => typeof o === 'string' && o.startsWith('theme-color:'));
const hasBasicDecor = opts.includes('basic-decorations');
const hasEnhancedDecor = opts.includes('enhanced-decorations');
if (hasTheme && hasBasicDecor && !hasEnhancedDecor) {
// extract color for display
const color = (opts.find(o => o.startsWith('theme-color:')) || '').split(':')[1] || '';
const colorCap = color ? (color.charAt(0).toUpperCase() + color.slice(1)) : '';
addRow(`Theme Color Add-on (Standard)${colorCap ? ` - ${colorCap}` : ''}`, 100);
}
// Set total to saved price for fidelity
const savedTotal = Number(receiptData.price || 0);
document.getElementById('receipt-price').textContent = `$${savedTotal}`;
// Carry over theme to receipt card background
const card = document.getElementById('receipt-card');
const themeEntry = opts.find(o => typeof o === 'string' && o.startsWith('theme-color:'));
if (themeEntry) {
const theme = themeEntry.split(':')[1];
const themeMap = {
red: 'rgb(255, 235, 238)',
blue: 'rgb(227, 242, 253)',
green: 'rgb(232, 245, 233)',
gold: 'rgb(255, 249, 231)'
};
if (themeMap[theme]) {
card.style.backgroundColor = themeMap[theme];
}
} else if (hasBasicDecor && !hasEnhancedDecor) {
// Default gold for Standard decorations without an explicit theme selection
card.style.backgroundColor = 'rgb(253, 245, 236)';
}
</script>
</body>
</html>