จัด colume layout เพิ่มเงื่อนไขตรวจสอบ
This commit is contained in:
parent
e1b9118443
commit
c4546055d2
2 changed files with 73 additions and 38 deletions
|
|
@ -23,7 +23,7 @@ export const load: PageServerLoad = async ({ fetch }) => {
|
||||||
}
|
}
|
||||||
if (ex.payment_startDate) {
|
if (ex.payment_startDate) {
|
||||||
const start = ex.payment_startDate;
|
const start = ex.payment_startDate;
|
||||||
const end = ex.payment_endDate;
|
const end = dayjs(ex.payment_endDate).add(1, 'day').format('YYYY-MM-DD');
|
||||||
events.push({ id, title: 'ชำระเงิน:' + title, start, end, url, backgroundColor: '#D2B4DE' });
|
events.push({ id, title: 'ชำระเงิน:' + title, start, end, url, backgroundColor: '#D2B4DE' });
|
||||||
}
|
}
|
||||||
if (ex.examDate) {
|
if (ex.examDate) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
let date = new Date().getFullYear();
|
||||||
import { env } from '$env/dynamic/public';
|
import { env } from '$env/dynamic/public';
|
||||||
const positions_base_url = env.PUBLIC_URL_REGISTER_QUALIFY_EXAM + '/exam/';
|
const positions_base_url = env.PUBLIC_URL_REGISTER_QUALIFY_EXAM + '/exam/';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
@ -9,6 +10,14 @@
|
||||||
if (!end) return dayjs(start).format('DD MMM BBBB');
|
if (!end) return dayjs(start).format('DD MMM BBBB');
|
||||||
return dayjs(start).format('DD MMM BBBB') + ' - ' + dayjs(end).format('DD MMM BBBB');
|
return dayjs(start).format('DD MMM BBBB') + ' - ' + dayjs(end).format('DD MMM BBBB');
|
||||||
}
|
}
|
||||||
|
function isEndDatePassed(endDate: string | undefined) {
|
||||||
|
if (endDate) {
|
||||||
|
const today = new Date();
|
||||||
|
const endDateDate = new Date(endDate);
|
||||||
|
return endDateDate.getTime() < today.getTime();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
|
@ -85,47 +94,73 @@
|
||||||
<div class="w-12/12 text-lg font-medium pt-6">สมัครสอบ</div>
|
<div class="w-12/12 text-lg font-medium pt-6">สมัครสอบ</div>
|
||||||
|
|
||||||
<hr class="border-blueGray-200 my-2" />
|
<hr class="border-blueGray-200 my-2" />
|
||||||
<div class="grid grid-flow-col justify-stretch ...">
|
<div class="grid grid-cols-2 justify-stretch ... gap-4">
|
||||||
{#if data.positionsTrue}
|
<div>
|
||||||
{#each data.positionsTrue as p}
|
{#if data.positionsTrue}
|
||||||
<div class="text-lg py-1">
|
<div class="w-12/12 text-lg font-medium pt-6">ปริญญาบัตรขึ้นไป</div>
|
||||||
<div class="w-12/12 text-lg font-medium pt-6">ปริญญาบัตรขึ้นไป</div>
|
{#each data.positionsTrue as p}
|
||||||
<div class="flex flex-wrap items-center">
|
<div class="text-lg py-1">
|
||||||
<a
|
<div class="flex flex-wrap items-center">
|
||||||
class="btn btn-sm btn-outline btn-info cursor-pointe"
|
{#if 'register_endDate' in data && isEndDatePassed(data.register_endDate)}
|
||||||
href={positions_base_url + p.path}
|
<a
|
||||||
target="_blank"
|
class="btn btn-sm btn-outline btn-info cursor-pointe"
|
||||||
>
|
href={positions_base_url + p.path}
|
||||||
<i class="fa-solid fa-pen-to-square text-sm pr-2" />
|
target="_blank"
|
||||||
สมัครสอบ
|
>
|
||||||
</a>
|
<i class="fa-solid fa-pen-to-square text-sm pr-2" />
|
||||||
<div class="pl-4">
|
ตรวจสอบ
|
||||||
<span>{p.title}</span>
|
</a>
|
||||||
|
{:else}
|
||||||
|
<a
|
||||||
|
class="btn btn-sm btn-outline btn-info cursor-pointe"
|
||||||
|
href={positions_base_url + p.path}
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-pen-to-square text-sm pr-2" />
|
||||||
|
สมัครสอบ
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
|
<div class="pl-2">
|
||||||
|
<span>{p.title}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/each}
|
||||||
{/each}
|
{/if}
|
||||||
{/if}
|
</div>
|
||||||
{#if data.positionsFalse}
|
<div>
|
||||||
{#each data.positionsFalse as a}
|
{#if data.positionsFalse}
|
||||||
<div class="text-lg py-1">
|
<div class="w-12/12 text-lg font-medium pt-6">ต่ำกว่าปริญญาบัตร</div>
|
||||||
<div class="w-12/12 text-lg font-medium pt-6">ต่ำกว่าปริญญาบัตร</div>
|
{#each data.positionsFalse as a}
|
||||||
<div class="flex flex-wrap items-center">
|
<div class="text-lg py-1">
|
||||||
<a
|
<div class="flex flex-wrap items-center">
|
||||||
class="btn btn-sm btn-outline btn-info cursor-pointe"
|
{#if 'register_endDate' in data && isEndDatePassed(data.register_endDate)}
|
||||||
href={positions_base_url + a.path}
|
<a
|
||||||
target="_blank"
|
class="btn btn-sm btn-outline btn-info cursor-pointe"
|
||||||
>
|
href={positions_base_url + a.path}
|
||||||
<i class="fa-solid fa-pen-to-square text-sm pr-2" />
|
target="_blank"
|
||||||
สมัครสอบ
|
>
|
||||||
</a>
|
<i class="fa-solid fa-pen-to-square text-sm pr-2" />
|
||||||
<div class="pl-4">
|
ตรวจสอบ
|
||||||
<span>{a.title}</span>
|
</a>
|
||||||
|
{:else}
|
||||||
|
<a
|
||||||
|
class="btn btn-sm btn-outline btn-info cursor-pointe"
|
||||||
|
href={positions_base_url + a.path}
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-pen-to-square text-sm pr-2" />
|
||||||
|
สมัครสอบ
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
|
<div class="pl-2">
|
||||||
|
<span>{a.title}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/each}
|
||||||
{/each}
|
{/if}
|
||||||
{/if}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pb-7" />
|
<div class="pb-7" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue