(add): Sheet printing form and compiler corrections
This commit is contained in:
@@ -1,33 +1,53 @@
|
||||
<script>
|
||||
import { env } from '$env/dynamic/public';
|
||||
import { browser } from '$app/environment';
|
||||
import { env } from "$env/dynamic/public";
|
||||
import { browser } from "$app/environment";
|
||||
|
||||
const { data } = $props();
|
||||
const prefix = {...data.prefix};
|
||||
const report_data = data.report;
|
||||
let show_data = $state([...report_data]);
|
||||
let report_subject = $state("All Preferences");
|
||||
|
||||
if (browser) {
|
||||
document.title = `${prefix.name} Report By Basket ID`
|
||||
const prefix = $derived(data.prefix);
|
||||
const report_data = $derived(data.report);
|
||||
function copyReportData() {
|
||||
return [...report_data];
|
||||
}
|
||||
let show_data = $state(copyReportData());
|
||||
let report_subject = $state("All Preferences");
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{prefix.name} Report By Basket ID</title>
|
||||
</svelte:head>
|
||||
|
||||
<div id="reportheader">
|
||||
<div class="flex-row-space {prefix.color}">
|
||||
<div class="flex-row">
|
||||
<button class="styled" onclick={() => {
|
||||
show_data = [...report_data];
|
||||
report_subject = "All Preferences";
|
||||
}}>All Preferences</button>
|
||||
<button class="styled" onclick={() => {
|
||||
show_data = [...report_data.filter((entry) => entry.preference === "CALL")];
|
||||
report_subject = "CALL Preference"
|
||||
}}>Call</button>
|
||||
<button class="styled" onclick={() => {
|
||||
show_data = [...report_data.filter((entry) => entry.preference === "TEXT")];
|
||||
report_subject = "TEXT Preference";
|
||||
}}>Text</button>
|
||||
<button
|
||||
class="styled"
|
||||
onclick={() => {
|
||||
show_data = copyReportData();
|
||||
report_subject = "All Preferences";
|
||||
}}>All Preferences</button
|
||||
>
|
||||
<button
|
||||
class="styled"
|
||||
onclick={() => {
|
||||
show_data = [
|
||||
...report_data.filter(
|
||||
(entry) => entry.preference === "CALL",
|
||||
),
|
||||
];
|
||||
report_subject = "CALL Preference";
|
||||
}}>Call</button
|
||||
>
|
||||
<button
|
||||
class="styled"
|
||||
onclick={() => {
|
||||
show_data = [
|
||||
...report_data.filter(
|
||||
(entry) => entry.preference === "TEXT",
|
||||
),
|
||||
];
|
||||
report_subject = "TEXT Preference";
|
||||
}}>Text</button
|
||||
>
|
||||
</div>
|
||||
<div class="flex-row">
|
||||
<button class="styled" onclick={() => window.print()}>Print</button>
|
||||
@@ -35,35 +55,37 @@
|
||||
</div>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="90"><h1>{prefix.name} - Report - {report_subject}</h1></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Basket ID</th>
|
||||
<th>Description</th>
|
||||
<th>Ticket #</th>
|
||||
<th>Winner Name</th>
|
||||
<th>Phone Number</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each show_data as report_entry}
|
||||
<tr>
|
||||
<td>{report_entry.b_id}</td>
|
||||
<td>{report_entry.description}</td>
|
||||
<td>{report_entry.winning_ticket}</td>
|
||||
<td>{report_entry.winner_name}</td>
|
||||
<td>{report_entry.phone_number}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="3">{env.PUBLIC_TAM3_VENUE || ""}</td>
|
||||
<td colspan="2" style="text-align: right">TAM3 by Dilan Gilluly</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="90"
|
||||
><h1>{prefix.name} - Report - {report_subject}</h1></th
|
||||
>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Basket ID</th>
|
||||
<th>Description</th>
|
||||
<th>Ticket #</th>
|
||||
<th>Winner Name</th>
|
||||
<th>Phone Number</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each show_data as report_entry}
|
||||
<tr>
|
||||
<td>{report_entry.b_id}</td>
|
||||
<td>{report_entry.description}</td>
|
||||
<td>{report_entry.winning_ticket}</td>
|
||||
<td>{report_entry.winner_name}</td>
|
||||
<td>{report_entry.phone_number}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="3">{env.PUBLIC_TAM3_VENUE || ""}</td>
|
||||
<td colspan="2" style="text-align: right">TAM3 by Dilan Gilluly</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<style>
|
||||
@@ -76,7 +98,6 @@
|
||||
border: solid 1px black;
|
||||
padding: 0.2rem;
|
||||
}
|
||||
|
||||
}
|
||||
table tbody tr:nth-child(2n) {
|
||||
background-color: #dddddd;
|
||||
@@ -92,4 +113,4 @@
|
||||
margin: 0.25in;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user