diff --git a/src/components/Clickable/Clickable.tsx b/src/components/Clickable/Clickable.tsx new file mode 100644 index 0000000..6f11c28 --- /dev/null +++ b/src/components/Clickable/Clickable.tsx @@ -0,0 +1,16 @@ +import type { JSXElement } from 'solid-js' + +interface Props { + children: JSXElement + onClick: () => void +} + +export default (props: Props) => { + return ( + <> +
+ {props.children} +
+ + ) +} diff --git a/src/components/Column/Column.tsx b/src/components/Column/Column.tsx index 7a33aa6..f733abd 100644 --- a/src/components/Column/Column.tsx +++ b/src/components/Column/Column.tsx @@ -6,12 +6,13 @@ interface Props { content?: 'top' | 'center' | 'bottom' | 'split' | 'spaced' gap?: number padding?: string + width?: string } export default (props: Props) => { return ( <> -
+
{props.children}
diff --git a/src/components/Footer/Footer.sass b/src/components/Footer/Footer.sass index f7138dc..0552128 100644 --- a/src/components/Footer/Footer.sass +++ b/src/components/Footer/Footer.sass @@ -2,7 +2,6 @@ .footer padding: 1rem 0 - // margin: 0 2rem 0 0 position: fixed bottom: 0 width: 95vw @@ -11,3 +10,8 @@ @media only screen and (max-width: view.$tablet) font-size: 0.75rem + + @media only screen and (max-width: view.$mobile) + width: auto + text-align: center + position: absolute diff --git a/src/components/index.ts b/src/components/index.ts index 8182ac0..8b43021 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,7 +1,6 @@ export { default as Button } from './Button/Button' export { default as Box } from './Box/Box' export { default as Column } from './Column/Column' -// export { default as Copyright } from './components/Copyright' export { default as Footer } from './Footer/Footer' export { default as Form } from './Form/Form' // export { default as HTML } from './components/HTML' @@ -22,6 +21,7 @@ export { default as QR } from './QR/QR' export { default as Input } from './Input/Input' export { default as Radio } from './Radio/Radio' export { default as Copyright } from './Copyright/Copyright' +export { default as Clickable } from './Clickable/Clickable' // export { default as OptimizeBackground } from './Optimizers/OptimizeBackground' // export { default as OptimizeImage } from './Optimizers/OptimizeImage' // export { default as OptimizeLogo } from './Optimizers/OptimizeLogo' diff --git a/src/pages/AssessorPage/Assessor.sass b/src/pages/AssessorPage/Assessor.sass index 1e0b5bc..66e84ad 100644 --- a/src/pages/AssessorPage/Assessor.sass +++ b/src/pages/AssessorPage/Assessor.sass @@ -1 +1,53 @@ @use '/src/styles/classes.sass' + +.modal + font-weight: 500 + + &__application-number + padding: 1rem 0 + border-radius: 8px + font-size: 1.75rem + font-weight: 800 + display: flex + flex-direction: column + flex-wrap: wrap + align-items: center + background: #16212C + box-shadow: 8px 8px 28px #0d141b, -8px -8px 28px #1f2e3d + + &__name + padding: 1rem 0 0 0 + font-size: 1rem + + &__row + display: flex + flex-direction: column + flex-wrap: wrap + justify-content: flex-start + align-items: flex-start + gap: 0.5rem + padding: 1.25rem 1rem + // box-shadow: 5px 5px 10px #10171f, -5px -5px 10px #1c2b39 + // border: 1px solid white + // border-radius: 8px + // margin: 0.5rem + + &__label + font-size: 0.75rem + + &__detail + font-size: 1rem + + &__price + font-size: 1.75rem + font-weight: 700 + + &__cancel + font-size: 0.75rem + padding: 0.5rem 0 0 0 + font-weight: 400 + +.approval + font-size: 1.75rem + font-weight: 700 + padding: 0.5rem 1rem diff --git a/src/pages/AssessorPage/Assessor.tsx b/src/pages/AssessorPage/Assessor.tsx index be4b469..1c5a406 100644 --- a/src/pages/AssessorPage/Assessor.tsx +++ b/src/pages/AssessorPage/Assessor.tsx @@ -1,19 +1,21 @@ import './Assessor.sass' -import { Logo, Link, Page, Row, Padding, ModalButton, Box, Button, Modal, Column } from '../../components' +import { Logo, Page, Row, Padding, ModalButton, Button, Clickable, Link } from '../../components' import { FiLogOut } from 'solid-icons/fi' import { Tabs } from '@kobalte/core/tabs' import { ofetch } from 'ofetch' -import { onMount, createSignal } from 'solid-js' -import dayjs from 'dayjs' -import { checkConnection, createPdf } from '../../utils/functions' -import { FaSolidThumbsUp } from 'solid-icons/fa' -import { _employeeName } from '../../stores/employee' +import { onMount, createSignal, Show } from 'solid-js' +// import dayjs from 'dayjs' +// import { checkConnection, createPdf } from '../../utils/functions' +// import { FaSolidThumbsUp } from 'solid-icons/fa' +import { _employeeName, _employeeId } from '../../stores/employee' +import { useNavigate } from '@solidjs/router' const API = import.meta.env.VITE_BACKEND const PESO = import.meta.env.VITE_PESO -const ID = import.meta.env.VITE_HEADID export default () => { + const navigate = useNavigate() + const [totalOp, setTotalOp] = createSignal(0) const [assessor, setAssessor] = createSignal('') const [dateOp, setDateOp] = createSignal('') @@ -38,6 +40,69 @@ export default () => { const [approved, setApproved] = createSignal(false) const [approvedApplication, setApprovedApplication] = createSignal('') + const [isBuilding, setIsBuilding] = createSignal(false) + const [isOccupancy, setIsOccupancy] = createSignal(false) + const [isElectrical, setIsElectrical] = createSignal(false) + + const [employeeId, setEmployeeId] = createSignal(0) + const [employeeName, setEmployeeName] = createSignal('') + + const checkAccess = async (access: string) => { + try { + const response = await ofetch(`${API}check-access/${access}/${employeeId()}`) + const result = response.result + if (result > 0) return true + else return false + } catch { + return false + } + } + + const checkDivision = async () => { + const building = await checkAccess('BUILDING ORDER OF PAYMENT') + setIsBuilding(building) + + const occupancy = await checkAccess('OCCUPANCY ORDER OF PAYMENT') + setIsOccupancy(occupancy) + + const electrical = await checkAccess('ELECTRICAL ASSESSMENT') + setIsElectrical(electrical) + } + + const getListForPrinting = async () => { + try { + const response = await ofetch(API + 'get-listopprinting-electrical', { parseResponse: JSON.parse }) + setApplicationList(response.result) + setNameList(response.result2) + } catch (error) { + console.error(error) + } + } + + const removeEmployee = () => { + sessionStorage.removeItem('id') + sessionStorage.removeItem('name') + } + + const checkLogged = async () => { + const idStore = sessionStorage.getItem('id') + const nameStore = sessionStorage.getItem('name') + setEmployeeId(parseInt(idStore!)) + setEmployeeName(nameStore!) + } + + const logout = async () => { + removeEmployee() + navigate('/') + // console.log('yeah') + } + + onMount(async () => { + checkLogged() + await checkDivision() + await getListForPrinting() + }) + return ( <> @@ -51,13 +116,13 @@ export default () => { - {_employeeName.get()} - + {employeeName()} + Logout - + @@ -65,15 +130,21 @@ export default () => { - - Building - - - Occupancy - - - Electrical - + + + Building + + + + + Occupancy + + + + + Electrical + + @@ -116,7 +187,7 @@ export default () => { -

List of Ready to Approve and Sign Electrical Order of Payments

+

List of Ready to Print in Electrical Order of Payments

@@ -183,7 +254,7 @@ export default () => { - + Click anywhere to cancel diff --git a/src/pages/IndexPage/Index.sass b/src/pages/IndexPage/Index.sass index ab1ef30..182e771 100644 --- a/src/pages/IndexPage/Index.sass +++ b/src/pages/IndexPage/Index.sass @@ -53,3 +53,15 @@ h1 @media only screen and (max-width: views.$tablet) padding: 3.25rem 0 0 0 font-size: 1rem + +.mobile-buttons + padding: 2rem 0 0 0 + display: flex + flex-direction: column + flex-wrap: wrap + justify-content: center + align-items: stretch + align-content: stretch + text-align: center + gap: 0.5rem + width: 55vw diff --git a/src/pages/IndexPage/Index.tsx b/src/pages/IndexPage/Index.tsx index 8e48009..180614d 100644 --- a/src/pages/IndexPage/Index.tsx +++ b/src/pages/IndexPage/Index.tsx @@ -1,5 +1,5 @@ import './Index.sass' -import { Button, Page, Padding, Display, Row, Logo, Footer, Image, Copyright, Column } from '../../components' +import { Button, Page, Padding, Display, Row, Logo, Footer, Copyright, Column, Image } from '../../components' import { onMount } from 'solid-js' import { ofetch } from 'ofetch' import ocboAvif from '../../assets/images/optimized/ocbologo.avif' @@ -50,8 +50,8 @@ export default () => { return ( <> - - + + @@ -70,32 +70,15 @@ export default () => { for Office of the City Building Official

A paperless and effortless solution on signing permits

- - - + + + + + + - + - - - -

OCBO e-Sign

- -
-

Secure e-Signature

- for Office of the City Building Official -

A paperless and effortless solution on signing permits

-
- - -