Compare commits
3 commits
cb05cf165e
...
44cde5e63f
| Author | SHA1 | Date | |
|---|---|---|---|
| 44cde5e63f | |||
| 5c74872b04 | |||
| f112475823 |
4 changed files with 66 additions and 21 deletions
|
|
@ -51,7 +51,7 @@ func connect() {
|
|||
//SERVER
|
||||
// router.Use(cors.New(cors.Config{
|
||||
// AllowOrigins: []string{"http://192.168.7.160:8080/inquiry"},
|
||||
// AllowMethods: []string{"GET"},
|
||||
// AllowMethods: []string{"GET", "POST"},
|
||||
// AllowHeaders: []string{"Origin", "OCBO-ShieldConnection"},
|
||||
// ExposeHeaders: []string{"Content-Length"},
|
||||
// AllowCredentials: true,
|
||||
|
|
@ -71,7 +71,7 @@ func connect() {
|
|||
c.Writer.Header().Set("X-Frame-Options", "DENY")
|
||||
c.Writer.Header().Set("X-Download-Options", "noopen")
|
||||
c.Writer.Header().Set("Referrer-Policy", "no-referrer")
|
||||
c.Writer.Header().Set("Server", "Batman")
|
||||
c.Writer.Header().Set("Server", "OCBO Server")
|
||||
|
||||
switch method {
|
||||
case "test":
|
||||
|
|
@ -85,13 +85,14 @@ func connect() {
|
|||
case "check-connection":
|
||||
err = db.QueryRow("SELECT 1 AS result").Scan(&result)
|
||||
if err != nil {
|
||||
c.AbortWithError(http.StatusBadRequest, err)
|
||||
c.String(http.StatusBadRequest, err.Error())
|
||||
}
|
||||
// c.AbortWithError(http.StatusBadRequest, err)
|
||||
// c.String(http.StatusBadRequest, err.Error())
|
||||
// c.String(http.StatusBadGateway, "false")
|
||||
c.JSON(http.StatusBadGateway, gin.H{"result": false})
|
||||
return
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"result": "Connection is OK",
|
||||
})
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"result": true})
|
||||
|
||||
case "get-listopapproval-electrical":
|
||||
var result2 string
|
||||
|
|
@ -642,6 +643,7 @@ func connect() {
|
|||
Data3 string `json:"data3"`
|
||||
Data4 string `json:"data4"`
|
||||
Data5 string `json:"data5"`
|
||||
Data6 int `json:"data6"`
|
||||
}
|
||||
var registrationData RegistrationData
|
||||
if err := c.ShouldBindJSON(®istrationData); err != nil {
|
||||
|
|
@ -657,13 +659,13 @@ func connect() {
|
|||
c.Writer.Header().Set("Referrer-Policy", "no-referrer")
|
||||
|
||||
dbpost, err := db.Prepare(`INSERT INTO electricaldocflowtxn (electricaldocflowtxnid, electricalid, txndate, remarks, comments, is_tag, tagword, is_approve, employeeid, is_delete)
|
||||
VALUES (NULL, ?, ?, NULL, ?, ?, 0, ?, 0)`)
|
||||
VALUES (NULL, ?, ?, ?, NULL, ?, ?, 0, ?, 0)`)
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
defer dbpost.Close()
|
||||
|
||||
exec, err := dbpost.Exec(registrationData.Data, registrationData.Data2, registrationData.Data3, registrationData.Data4, registrationData.Data5)
|
||||
exec, err := dbpost.Exec(registrationData.Data, registrationData.Data2, registrationData.Data3, registrationData.Data4, registrationData.Data5, registrationData.Data6)
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
|
|
@ -674,9 +676,9 @@ func connect() {
|
|||
}
|
||||
|
||||
if affect > 0 {
|
||||
c.String(http.StatusOK, "Success on Registrating e-Sign")
|
||||
c.String(http.StatusOK, "Success on Setting New Status")
|
||||
} else {
|
||||
c.String(http.StatusInternalServerError, "Failed on Registrating e-Sign")
|
||||
c.String(http.StatusInternalServerError, "Failed on Setting New Status")
|
||||
}
|
||||
|
||||
})
|
||||
|
|
|
|||
|
|
@ -128,11 +128,11 @@ export default () => {
|
|||
</Page>
|
||||
|
||||
<div onClick={gotoMain}>
|
||||
<Modal trigger={loggedin() === 2} background="#18412aff" color="#ffffffe4" opacity={0.6}>
|
||||
<Modal trigger={loggedin() === 2} background="#123220ff" color="#cdfbe1f0" opacity={0.8}>
|
||||
<Padding top={1} bottom={1} left={4} right={4}>
|
||||
<Column>
|
||||
<Row>
|
||||
<Box curved thickness={3} color="white" padding="1rem">
|
||||
<Box curved thickness={3} color="#cdfbe1f0" padding="1rem">
|
||||
<h2>Login Successful</h2>
|
||||
</Box>
|
||||
</Row>
|
||||
|
|
@ -146,11 +146,11 @@ export default () => {
|
|||
</div>
|
||||
|
||||
<div onClick={() => setLoggedin(0)}>
|
||||
<Modal trigger={loggedin() === 1} background="#562020ff" color="#ffffffe4" opacity={0.6}>
|
||||
<Modal trigger={loggedin() === 1} background="#562020ff" color="#ffebebe6" opacity={0.8}>
|
||||
<Padding top={1} bottom={1} left={4} right={4}>
|
||||
<Column>
|
||||
<Row>
|
||||
<Box curved thickness={3} color="white" padding="1rem">
|
||||
<Box curved thickness={3} color="#ffebebe6" padding="1rem">
|
||||
<h2>Login Failed</h2>
|
||||
</Box>
|
||||
</Row>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ h1
|
|||
position: relative
|
||||
display: flex
|
||||
gap: 5rem
|
||||
|
||||
|
||||
&__list[data-orientation="horizontal"]
|
||||
align-items: center
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import dayjs from 'dayjs'
|
|||
|
||||
const API = import.meta.env.VITE_BACKEND
|
||||
const PESO = import.meta.env.VITE_PESO
|
||||
const ID = import.meta.env.VITE_ID
|
||||
const ID = import.meta.env.VITE_HEADID
|
||||
|
||||
export default () => {
|
||||
const [totalOp, setTotalOp] = createSignal(0)
|
||||
|
|
@ -81,14 +81,32 @@ export default () => {
|
|||
// }
|
||||
|
||||
const approveHandler = async () => {
|
||||
let signed: boolean = false
|
||||
let forprinting: boolean = false
|
||||
|
||||
signed = await setNewStatus('ELECTRICAL ORDER OF PAYMENT APPROVED AND SIGNED', '170', 'ELECOPAPPROVEDSIGNED')
|
||||
if (signed) {
|
||||
console.log('Signed')
|
||||
forprinting = await setNewStatus('FOR ELECTRICAL ORDER OF PAYMENT PRINTING', '95', 'ELECOPPRINT')
|
||||
}
|
||||
if (forprinting) {
|
||||
console.log('For Printing')
|
||||
}
|
||||
}
|
||||
|
||||
const setNewStatus = async (status: string, tag: string, tagword: string) => {
|
||||
const today = new Date()
|
||||
const formattedDate = dayjs(today).format('YYYY-MM-DD HH:mm:ss')
|
||||
const statusid = parseInt(applicationId().toString())
|
||||
|
||||
for (let i = 0; i < applicationList().length; i++) {
|
||||
try {
|
||||
await ofetch(API + 'post-newstatus-electrical', {
|
||||
method: 'POST',
|
||||
body: { data: applicationId(), data2: formattedDate, data3: ID, data4: descriptionList()[i], data5: 'json' },
|
||||
body: { data: statusid, data2: formattedDate, data3: status, data4: tag, data5: tagword, data6: parseInt(ID) },
|
||||
})
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -161,11 +179,37 @@ export default () => {
|
|||
<Row>
|
||||
<h2>List of Ready to Approve and Sign Building Order of Payments</h2>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<table class="table">
|
||||
<thead>
|
||||
{/* <tr>
|
||||
<th>Application Number</th>
|
||||
<th>Name</th>
|
||||
<th style="text-align: center">Show Details</th>
|
||||
</tr> */}
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</Row>
|
||||
</Tabs.Content>
|
||||
<Tabs.Content class="tabs__content" value="occupancy">
|
||||
<Row>
|
||||
<h2>List of Ready to Approve and Sign Occupancy Order of Payments</h2>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<table class="table">
|
||||
<thead>
|
||||
{/* <tr>
|
||||
<th>Application Number</th>
|
||||
<th>Name</th>
|
||||
<th style="text-align: center">Show Details</th>
|
||||
</tr> */}
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</Row>
|
||||
</Tabs.Content>
|
||||
<Tabs.Content class="tabs__content" value="electrical">
|
||||
<Row>
|
||||
|
|
@ -236,7 +280,7 @@ export default () => {
|
|||
|
||||
<Row gap={12} padding="2rem 0 0 0">
|
||||
<Button label="Cancel" edges="curved" design="bo-danger"></Button>
|
||||
<Button label="Approve" edges="curved" design="bo-primary"></Button>
|
||||
<Button label="Approve" edges="curved" design="bo-primary" onClick={approveHandler}></Button>
|
||||
</Row>
|
||||
</Padding>
|
||||
</ModalButton>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue