Compare commits
2 commits
634bb6a209
...
327c3b60a4
| Author | SHA1 | Date | |
|---|---|---|---|
| 327c3b60a4 | |||
| 2fd63b86c8 |
3 changed files with 49 additions and 13 deletions
|
|
@ -94,23 +94,29 @@ func connect() {
|
|||
})
|
||||
|
||||
case "get-listopapproval-electrical":
|
||||
array := []string{}
|
||||
var result2 string
|
||||
|
||||
results, err := db.Query("SELECT DISTINCT IFNULL(electricalid, 0) AS result FROM electricaldocflowtxn WHERE remarks = ?", "FOR ELECTRICAL ORDER OF PAYMENT APPROVAL")
|
||||
array := []string{}
|
||||
array2 := []string{}
|
||||
|
||||
results, err := db.Query(`SELECT IFNULL(e.electricalno, '') AS result, IF(c.firstName IS NULL OR c.firstName = '', c.lastName, CONCAT(c.firstName, ' ', IF(c.middleInitial IS NULL OR c.middleInitial = '', '', CONCAT(c.middleInitial, '. ')), c.lastName) ) AS result2
|
||||
FROM iips.electrical e JOIN iips.customer c ON e.customerid = c.customerid JOIN iips.ref_elec_occupancy ec ON e.ref_elec_occupancyid = ec.ref_elec_occupancyid JOIN iips.electricaldocflowtxn ed ON e.electricalid = ed.electricalid JOIN (SELECT electricalid, MAX(electricaldocflowtxnid) AS latest_electricaldocflowtxnid FROM electricaldocflowtxn GROUP BY electricalid) latest_doc ON ed.electricalid = latest_doc.electricalid AND ed.electricaldocflowtxnid = latest_doc.latest_electricaldocflowtxnid WHERE remarks = ? ORDER BY e.electricalno ASC`, "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)
|
||||
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,
|
||||
"result": array,
|
||||
"result2": array2,
|
||||
})
|
||||
|
||||
case "get-list-assessors":
|
||||
|
|
@ -182,7 +188,7 @@ func connect() {
|
|||
var status string
|
||||
array := []string{}
|
||||
|
||||
results, err := db.Query("SELECT DISTINCT IFNULL(electricalid, 0) AS result FROM electricaldocflowtxn WHERE remarks = ? LIMIT 20", "FOR ELECTRICAL ORDER OF PAYMENT APPROVAL")
|
||||
results, err := db.Query("SELECT DISTINCT IFNULL(electricalid, 0) 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())
|
||||
|
|
@ -561,7 +567,7 @@ func connect() {
|
|||
array10 := []string{}
|
||||
|
||||
results, err := db.Query(`SELECT IFNULL(e.electricalNo, '') AS result, IFNULL(c.firstName, '') AS result2, IFNULL(c.middleInitial, '') AS result3, IFNULL(c.lastName, '') AS result4, IFNULL(e.locationofinstallation, '') AS result5, IFNULL(re.type, '') AS result6, IFNULL(em.employeename, '') AS result7, IFNULL(rb.accountdescription, '') AS result8, IFNULL(o.amount, '') AS result9, IFNULL(o.opDate, '') AS result10
|
||||
FROM electrical e, customer c, electrical_orderofpayment_new o, ref_electrical_type re, ref_bldgcomputationsheet rb, employee em WHERE e.customerid = c.customerid AND e.electricalid = o.electricalid AND e.ref_electrical_typeid = re.ref_electrical_typeid AND o.ref_bldgcomputationsheetid = rb.ref_bldgcomputationsheetid AND o.assessedbyid = em.employeeid AND e.electricalid = ?`, data)
|
||||
FROM electrical e, customer c, electrical_orderofpayment_new o, ref_electrical_type re, ref_bldgcomputationsheet rb, employee em WHERE e.customerid = c.customerid AND e.electricalid = o.electricalid AND e.ref_electrical_typeid = re.ref_electrical_typeid AND o.ref_bldgcomputationsheetid = rb.ref_bldgcomputationsheetid AND o.assessedbyid = em.employeeid AND e.electricalNo = ?`, data)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
c.String(http.StatusBadRequest, err.Error())
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import './Table.sass'
|
||||
import { Modal } from '../../components'
|
||||
import { createSignal } from 'solid-js'
|
||||
import { ofetch } from 'ofetch'
|
||||
// import { Button } from '../../components'
|
||||
|
|
@ -78,12 +77,6 @@ export default () => {
|
|||
</tr> */}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="modal" style="display: none">
|
||||
<Modal background="rgba(0,0,0,0.5)">
|
||||
<h1>SAMPLE</h1>
|
||||
</Modal>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
37
src/components/Tabs/Tabs.tsx
Normal file
37
src/components/Tabs/Tabs.tsx
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import { Tabs } from '@kobalte/core/tabs'
|
||||
|
||||
export default () => {
|
||||
return (
|
||||
<>
|
||||
<Tabs aria-label="Main navigation" class="tabs">
|
||||
<Tabs.List class="tabs__list">
|
||||
<Tabs.Trigger class="tabs__trigger" value="profile">
|
||||
Profile
|
||||
</Tabs.Trigger>
|
||||
<Tabs.Trigger class="tabs__trigger" value="dashboard">
|
||||
Dashboard
|
||||
</Tabs.Trigger>
|
||||
<Tabs.Trigger class="tabs__trigger" value="settings">
|
||||
Settings
|
||||
</Tabs.Trigger>
|
||||
<Tabs.Trigger class="tabs__trigger" value="contact">
|
||||
Contact
|
||||
</Tabs.Trigger>
|
||||
<Tabs.Indicator class="tabs__indicator" />
|
||||
</Tabs.List>
|
||||
<Tabs.Content class="tabs__content" value="profile">
|
||||
Profile details
|
||||
</Tabs.Content>
|
||||
<Tabs.Content class="tabs__content" value="dashboard">
|
||||
Dashboard details
|
||||
</Tabs.Content>
|
||||
<Tabs.Content class="tabs__content" value="settings">
|
||||
Settings details
|
||||
</Tabs.Content>
|
||||
<Tabs.Content class="tabs__content" value="contact">
|
||||
Contact details
|
||||
</Tabs.Content>
|
||||
</Tabs>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue