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() && ( +