diff --git a/backend/main.go b/backend/main.go index 0177a75..ad6bb32 100644 --- a/backend/main.go +++ b/backend/main.go @@ -98,47 +98,22 @@ func connect() { case "get-listopapproval-electrical": array := []string{} - results, err := db.Query("SELECT DISTINCT electricalid as result FROM electricaldocflowtxn WHERE remarks = 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL'") + results, err := db.Query("SELECT DISTINCT electricalid 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, - }) - - 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, - }) + 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, + }) } }) @@ -361,7 +336,6 @@ 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 { @@ -423,8 +397,6 @@ 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 c3a3fad..e40c88f 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 da9ba89..d82c586 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 deleted file mode 100644 index dae1cf6..0000000 --- a/src/components/Combobox/Combobox.tsx +++ /dev/null @@ -1,41 +0,0 @@ -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 deleted file mode 100644 index d908d27..0000000 --- a/src/components/RegistrationForm/RegistrantionForm.tsx +++ /dev/null @@ -1,26 +0,0 @@ -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 b6982e3..3433dfd 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -20,6 +20,8 @@ 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) } } @@ -41,6 +43,8 @@ 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 e32867c..267b077 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 3959837..c5849d2 100644 --- a/src/pages/main.astro +++ b/src/pages/main.astro @@ -33,50 +33,69 @@ import Table from '../components/Table/Table' - - - -

OCBO e-Sign

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

OCBO e-Sign

- -

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

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

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

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

OCBO e-Sign

-
- + + +

OCBO e-Sign

+