Begin PIS Finder page
This commit is contained in:
parent
f5302b58d8
commit
a754c9d051
@ -21,6 +21,9 @@
|
||||
|
||||
async function processData(data) {
|
||||
//console.log("data",JSON.stringify(data))
|
||||
if (data.ERROR == "Offline") {
|
||||
return;
|
||||
};
|
||||
val = {
|
||||
crs: data[0]['3ALPHA'] || "None",
|
||||
tiploc: data[0]['TIPLOC'] || "None",
|
||||
|
@ -3,10 +3,51 @@
|
||||
import Nav from '$lib/navigation/nav.svelte'
|
||||
|
||||
const title = "PIS Finder"
|
||||
</script>
|
||||
let entryPIS;
|
||||
let entryStartCRS = "";
|
||||
let entryEndCRS = "";
|
||||
let data = [];
|
||||
|
||||
async function findByStartEnd() {
|
||||
return;
|
||||
}
|
||||
|
||||
async function findByPis() {
|
||||
data = [
|
||||
{"one": 1},
|
||||
{"two": 2}
|
||||
]
|
||||
return;
|
||||
}
|
||||
</script>
|
||||
|
||||
<Header {title} />
|
||||
<Header {title} />
|
||||
|
||||
<p></p>
|
||||
|
||||
<Nav />
|
||||
<p>To search by headcode use the Train Finder on the homepage</p>
|
||||
<p class="label">Find By Start/End CRS:</p>
|
||||
<form on:submit={findByStartEnd}>
|
||||
<input type="text" maxlength="3" autocomplete="off" placeholder="Start" bind:value={entryStartCRS}>
|
||||
<input type="text" maxlength="3" autocomplete="off" placeholder="End" bind:value={entryEndCRS}>
|
||||
<br>
|
||||
<button type="submit">Search</button><button type="reset">Reset</button>
|
||||
</form>
|
||||
|
||||
<p class="label">Find By PIS Code:</p>
|
||||
<form on:submit={findByPis}>
|
||||
<input type="number" max="9999" autocomplete="off" placeholder="PIS" bind:value={entryPIS}>
|
||||
<br>
|
||||
<button type="submit">Search</button>
|
||||
</form>
|
||||
|
||||
{#if data.length}
|
||||
{#each data as entry}
|
||||
<p>{JSON.stringify(entry)}</p>
|
||||
{/each}
|
||||
{/if}
|
||||
<Nav />
|
||||
|
||||
<style>
|
||||
.label {
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user