import './Assessor.sass' 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, 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 export default () => { const navigate = useNavigate() const [totalOp, setTotalOp] = createSignal(0) const [assessor, setAssessor] = createSignal('') const [dateOp, setDateOp] = createSignal('') const [location, setLocation] = createSignal('') const [type, setType] = createSignal('') const [applicationId, setApplicationId] = createSignal(0) const [assessorId, setAssessorId] = createSignal(0) const [gflgu, setGflgu] = createSignal([]) const [gfdpwh, setGfdpwh] = createSignal([]) const [tfbo, setTfbo] = createSignal([]) const [descriptionList, setDescriptionList] = createSignal([]) const [amountList, setAmountList] = createSignal([]) const [dateOpList, setDateOpList] = createSignal([]) const [applicationList, setApplicationList] = createSignal([]) const [nameList, setNameList] = createSignal([]) const [errorMessage, setErrorMessage] = createSignal('') const [connected, setConnected] = createSignal(true) 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 ( <>

OCBO e-Sign

{employeeName()} Logout
Building Occupancy Electrical

List of Ready to Approve and Sign Building Order of Payments

{/* */}
Application Number Name Show Details

List of Ready to Approve and Sign Occupancy Order of Payments

{/* */}
Application Number Name Show Details

List of Ready to Print in Electrical Order of Payments

{applicationList().map((item, index) => ( ))}
Application Number Name Show Details
{item} {nameList()[index]} { // await getopdetails(item) // }} > {item} Click anywhere to cancel
) }