diff --git a/backend/main.go b/backend/main.go index ad6bb32..0177a75 100644 --- a/backend/main.go +++ b/backend/main.go @@ -98,22 +98,47 @@ func connect() { case "get-listopapproval-electrical": array := []string{} - results, err := db.Query("SELECT DISTINCT electricalid FROM electricaldocflowtxn WHERE remarks = 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL'") + results, err := db.Query("SELECT DISTINCT electricalid as result FROM electricaldocflowtxn WHERE remarks = 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL'") if err != nil { c.AbortWithError(http.StatusBadRequest, err) c.String(http.StatusBadRequest, err.Error()) } for results.Next() { - err = results.Scan(&result) - if err != nil { - c.AbortWithError(http.StatusBadRequest, err) - c.String(http.StatusBadRequest, err.Error()) - } - array = append(array, result) - } - c.JSON(http.StatusOK, gin.H{ - "result": array, - }) + err = results.Scan(&result) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + } + c.JSON(http.StatusOK, gin.H{ + "result": array, + }) + + case "get-list-assessors": + var result2 string + + array := []string{} + array2 := []string{} + + results, err := db.Query("SELECT employeeid as result, employeename as result2 FROM employee WHERE is_assessment = 1") + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + for results.Next() { + err = results.Scan(&result, &result2) + if err != nil { + c.AbortWithError(http.StatusBadRequest, err) + c.String(http.StatusBadRequest, err.Error()) + } + array = append(array, result) + array2 = append(array2, result2) + } + c.JSON(http.StatusOK, gin.H{ + "result": array, + "result2": array2, + }) } }) @@ -336,6 +361,7 @@ func connect() { "result4": array4, }) + case "get-laststatus-building": err := db.QueryRow(`SELECT IFNULL(remarks, '') AS result FROM docflowtxn WHERE docflowtxnid = (SELECT MAX(docflowtxnid) FROM docflowtxn WHERE receivingid = ?)`, data).Scan(&result) if err != nil { @@ -397,6 +423,8 @@ func connect() { "result": result, }) + + case "GetFeesBuilding": var result2, result3 string array := []string{} diff --git a/fwt/images/background.avif b/fwt/images/background.avif index e40c88f..c3a3fad 100644 Binary files a/fwt/images/background.avif and b/fwt/images/background.avif differ diff --git a/fwt/images/background.webp b/fwt/images/background.webp index d82c586..da9ba89 100644 Binary files a/fwt/images/background.webp and b/fwt/images/background.webp differ diff --git a/src/components/Combobox/Combobox.tsx b/src/components/Combobox/Combobox.tsx new file mode 100644 index 0000000..dae1cf6 --- /dev/null +++ b/src/components/Combobox/Combobox.tsx @@ -0,0 +1,41 @@ +import Input from '../../../fwt/components/Input' +import { createSignal } from 'solid-js' + +interface Props { + placeholder?: string + value?: string + onChange?: (value: string) => void + options: string[] +} + +export default (props: Props) => { + const [sample, setSample] = createSignal(props.value || '') + const [isOpen, setIsOpen] = createSignal(false) + const [selectedOption, setSelectedOption] = createSignal('') + + const handleInputChange = (val: string) => { + setSample(val) + setSelectedOption('') + setIsOpen(true) + } + + const handleSelectOption = (option: string) => { + setSelectedOption(option) + setSample(option) + setIsOpen(false) + props.onChange?.(option) + } + + return ( + <> + + {isOpen() && ( + + )} + + ) +} diff --git a/src/components/RegistrationForm/RegistrantionForm.tsx b/src/components/RegistrationForm/RegistrantionForm.tsx new file mode 100644 index 0000000..d908d27 --- /dev/null +++ b/src/components/RegistrationForm/RegistrantionForm.tsx @@ -0,0 +1,26 @@ +import { Button, Logo, Link, Box, Page, Form, Row, Column, Image, Copyright, OptimizeLogo, Display, Padding } from '../../../fwt/' +import Input from '../../components/Input/Input' +import Combobox from '../../components/Combobox/Combobox' +import { ofetch } from 'ofetch' +import { createSignal } from 'solid-js' + +const api = import.meta.env.BACKEND +const assessors = await ofetch(api + 'get-list-assessors', { parseResponse: JSON.parse }) +const assessorsIDList = assessors.result +const assessorsNameList = assessors.result2 + +const [sample, setSample] = createSignal('') + +export default () => { + return ( + <> + +
+ Name + {/* console.log(1)} /> */} + {assessorsNameList} + +
+ + ) +} diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index 3433dfd..b6982e3 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -20,8 +20,6 @@ export default () => { const response = await ofetch(api + 'get-laststatus-electrical/' + list[i], { parseResponse: JSON.parse }) if (response.result === 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL') { newList.push(list[i]) - } else { - // console.log(response.result) } } @@ -43,8 +41,6 @@ export default () => { const listOfReadyForApproval = await getListOfReadyForApproval() const listOfReadyForApprovalFiltered = await getListOfReadyForApprovalFiltered(listOfReadyForApproval) await getApplicationById(listOfReadyForApprovalFiltered) - - console.log(updatedList()) } load() diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 267b077..e32867c 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -8,6 +8,6 @@ import { Background, HTML } from '../../fwt' --- - + diff --git a/src/pages/main.astro b/src/pages/main.astro index c5849d2..3959837 100644 --- a/src/pages/main.astro +++ b/src/pages/main.astro @@ -33,69 +33,50 @@ import Table from '../components/Table/Table' - - -

OCBO e-Sign

+ + + +

OCBO e-Sign

+
+ + + + Patrick Alvin Alcala +
- - Patrick Alvin Alcala - + +

List of Ready to Approve and Sign OP (Order of Payments)

+ + - - -

List of Ready to Approve and Sign OP (Order of Payments)

-
- -
- - + + - + - - diff --git a/src/pages/register.astro b/src/pages/register.astro index 46399fa..50e0241 100644 --- a/src/pages/register.astro +++ b/src/pages/register.astro @@ -1,6 +1,7 @@ --- import Layout from '../layouts/Layout.astro' -import { Button, Logo, Link, Page, Footer, Row, Column, Image, Copyright, OptimizeLogo, Display, Padding } from '../../fwt/' +import { Button, Logo, Link, Box, Page, Form, Row, Column, Image, Copyright, OptimizeLogo, Display, Padding } from '../../fwt/' +import RegistrationForm from '../components/RegistrationForm/RegistrantionForm' --- @@ -8,38 +9,44 @@ import { Button, Logo, Link, Page, Footer, Row, Column, Image, Copyright, Optimi - - -

OCBO e-Sign

-
+ + + +

OCBO e-Sign

+
+