listing data kelainan
This commit is contained in:
@@ -2,7 +2,9 @@ package dev_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
"cpone/component/customtextfieldsearch"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
"cpone/component/pagination"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
globalservices "cpone/services"
|
||||
@@ -17,6 +19,7 @@ import (
|
||||
|
||||
type MasterKelainanService interface {
|
||||
GetListBreadCrumb(title string) (models.BreadCrumbV1, error)
|
||||
GetListMasterKelainan(search string, currentPage int, rowPerPage int) ([]models.Kelainan, int, error)
|
||||
}
|
||||
|
||||
func NewMasterKelainanHandler(us MasterKelainanService) *MasterKelainanHandler {
|
||||
@@ -57,6 +60,21 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
return err
|
||||
}
|
||||
|
||||
dataKelainan, totalpage, err := lh.MasterKelainanService.GetListMasterKelainan("", 1, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET KELAINAN",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataKelainan)
|
||||
return err
|
||||
}
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("LOAD KELAINAN",
|
||||
zap.Any("data", dataKelainan),
|
||||
)
|
||||
|
||||
tableID := utils.GenerateRandomID("tablebody")
|
||||
paginationID := utils.GenerateRandomID("paginationid")
|
||||
searchID := utils.GenerateRandomID("searchid")
|
||||
@@ -89,11 +107,33 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
// sidebar
|
||||
sidebaruserprofileComponent := sidebaruserprofile.Navbaruserprofile(dataUser)
|
||||
|
||||
contentKelainanComponent := masterkelainan.TableKelainan(
|
||||
dataKelainan, tableID)
|
||||
|
||||
kelainanFilterComponent := customtextfieldsearch.MainCustomTextFieldSearchV2(searchID,
|
||||
"search",
|
||||
"Cari Grup Kelainan",
|
||||
"text",
|
||||
"/dev/searchkelainan",
|
||||
"input changed delay:500ms, search",
|
||||
"#"+paginationID, "", "", "outerHTML", "#tableID, #paginationID")
|
||||
|
||||
kelainanPaginationComponent := pagination.PaginationV2(
|
||||
totalpage,
|
||||
1,
|
||||
"/dev/kelainanpagination",
|
||||
paginationID,
|
||||
"#tableID, #searchID, #paginationID", "#"+paginationID, "outerHTML", "",
|
||||
)
|
||||
|
||||
si := masterkelainan.ShowKelainan(
|
||||
"Master Kelainan",
|
||||
masterkelainan.ContentMasterKelainan(
|
||||
tableID, paginationID, searchID,
|
||||
breadcrumadmin.MainBreadcrumbAdminV1(dataBreadCrumb),
|
||||
contentKelainanComponent,
|
||||
kelainanFilterComponent,
|
||||
kelainanPaginationComponent,
|
||||
),
|
||||
|
||||
masterkelainan.CssKelainan(),
|
||||
|
||||
10
models/kelainan.models.go
Normal file
10
models/kelainan.models.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package models
|
||||
|
||||
type Kelainan struct {
|
||||
Nomor string `db:"nomor"`
|
||||
Mcu_KelainanGroupID int `db:"Mcu_KelainanGroupID"`
|
||||
Mcu_KelainanGroupName string `db:"Mcu_KelainanGroupName"`
|
||||
Mcu_KelainanGroupIsActive string `db:"Mcu_KelainanGroupIsActive"`
|
||||
Mcu_KelainanGroupCreated string `db:"Mcu_KelainanGroupCreated"`
|
||||
Mcu_KelainanGroupLastUpdated string `db:"Mcu_KelainanGroupLastUpdated"`
|
||||
}
|
||||
@@ -3,6 +3,10 @@ package dev_services
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"fmt"
|
||||
"math"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func NewServicesMasterKelainan(uStore db.AppStore) *ServicesMasterKelainan {
|
||||
@@ -71,3 +75,42 @@ func (su *ServicesMasterKelainan) GetListBreadCrumb(title string) (models.BreadC
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (su *ServicesMasterKelainan) GetListMasterKelainan(search string, currentPage int, rowPerPage int) ([]models.Kelainan, int, error) {
|
||||
var kelainanList []models.Kelainan
|
||||
var totalData int
|
||||
offset := (currentPage - 1) * rowPerPage
|
||||
prm := "%" + strings.TrimSpace(search) + "%"
|
||||
|
||||
querytotal := `
|
||||
SELECT COUNT(*)
|
||||
FROM mcu_kelainangroup
|
||||
WHERE Mcu_KelainanGroupIsActive = 'Y'
|
||||
AND (Mcu_KelainanGroupName LIKE ?)
|
||||
`
|
||||
if err := dbx.Handlex.Get(&totalData, querytotal, prm); err != nil {
|
||||
return nil, 0, fmt.Errorf("error query database: %v", err)
|
||||
}
|
||||
|
||||
query := `
|
||||
SELECT
|
||||
ROW_NUMBER() OVER () AS nomor,
|
||||
Mcu_KelainanGroupID,
|
||||
Mcu_KelainanGroupName,
|
||||
Mcu_KelainanGroupIsActive,
|
||||
Mcu_KelainanGroupCreated,
|
||||
Mcu_KelainanGroupLastUpdated
|
||||
FROM mcu_kelainangroup
|
||||
WHERE Mcu_KelainanGroupIsActive = 'Y'
|
||||
AND (Mcu_KelainanGroupName LIKE ?)
|
||||
order by Mcu_KelainanGroupID ASC
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
|
||||
if err := dbx.Handlex.Select(&kelainanList, query, prm, rowPerPage, offset); err != nil {
|
||||
return nil, 0, fmt.Errorf("error query database: %v", err)
|
||||
}
|
||||
totalPage := int(math.Ceil(float64(totalData) / float64(rowPerPage)))
|
||||
|
||||
return kelainanList, totalPage, nil
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
"cpone/layout"
|
||||
"cpone/models"
|
||||
"cpone/component/customtextfield"
|
||||
"strconv"
|
||||
"cpone/component/table"
|
||||
)
|
||||
|
||||
templ ContentMasterKelainan(
|
||||
@@ -11,6 +13,9 @@ templ ContentMasterKelainan(
|
||||
paginationID string,
|
||||
searchID string,
|
||||
breadcrumb templ.Component,
|
||||
tablecontent templ.Component,
|
||||
filterKelainan templ.Component,
|
||||
paginationKelainan templ.Component,
|
||||
) {
|
||||
<div class="container-fluid">
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
|
||||
@@ -43,6 +48,10 @@ templ ContentMasterKelainan(
|
||||
<button type="button" class="btn btn-primary btn-block">Add New</button>
|
||||
</div>
|
||||
</div>
|
||||
@filterKelainan
|
||||
// table content
|
||||
@tablecontent
|
||||
@paginationKelainan
|
||||
<div class="d-flex justify-content-center text-primary">
|
||||
<div class="htmx-indicator spinner-border" role="status" id="indicator">
|
||||
<span class="sr-only"></span>
|
||||
@@ -52,6 +61,50 @@ templ ContentMasterKelainan(
|
||||
</div>
|
||||
}
|
||||
|
||||
templ TableRowV1(data []models.Kelainan) {
|
||||
if len(data) == 0 {
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Data Tidak Ditemukan</td>
|
||||
</tr>
|
||||
}
|
||||
for _, v := range data {
|
||||
<tr>
|
||||
<td>{ v.Nomor }</td>
|
||||
<td>{ v.Mcu_KelainanGroupName }</td>
|
||||
<td>
|
||||
<div class="row px-5 d-flex justify-content-around">
|
||||
<a
|
||||
id="btneditug"
|
||||
type="button"
|
||||
class="btneditug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2"
|
||||
data-toggle="modal"
|
||||
data-target={ "#dialogEdit" + strconv.Itoa(v.Mcu_KelainanGroupID) }
|
||||
>
|
||||
Edit
|
||||
</a>
|
||||
<a
|
||||
id="btndeleteug"
|
||||
type="button"
|
||||
class=" btndeleteug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2"
|
||||
data-toggle="modal"
|
||||
data-target={ "#dialogDelete" + strconv.Itoa(v.Mcu_KelainanGroupID) }
|
||||
>Hapus</a>
|
||||
// @modalcomponent.Modal("dialogEdit"+strconv.Itoa(v.Mcu_KelainanGroupID),
|
||||
// "Edit - User Group",
|
||||
// DialogEditBody(v.M_UserGroupCode, v.M_UserGroupName),
|
||||
// DialogEditAction(),
|
||||
// BtnCloseNew())
|
||||
// @modalcomponent.ModalConfirmation(
|
||||
// "dialogDelete"+strconv.Itoa(v.Mcu_KelainanGroupID),
|
||||
// "Konfirmasi",
|
||||
// "Apakah anda yakin menghapus user group berikut ?", BtnCloseDelete(),
|
||||
// []string{"Kode", "User Group"}, []string{v.M_UserGroupCode, v.M_UserGroupName}, DialogDeleteAction())
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
|
||||
templ JSku() {
|
||||
<script>
|
||||
function ShowLoading(evt) {
|
||||
@@ -120,3 +173,11 @@ templ ShowKelainan(
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
|
||||
templ TableKelainan(data []models.Kelainan, tableID string) {
|
||||
<div id={ tableID } hx-swap-oob={ "#" + tableID }>
|
||||
@tablecomponent.TableV3([]string{"NO", "GRUP KELAINAN", "AKSI"},
|
||||
[]string{"15%", "65%", "20%"},
|
||||
TableRowV1(data))
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -12,8 +12,10 @@ import "bytes"
|
||||
|
||||
import (
|
||||
"cpone/component/customtextfield"
|
||||
"cpone/component/table"
|
||||
"cpone/layout"
|
||||
"cpone/models"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func ContentMasterKelainan(
|
||||
@@ -21,6 +23,9 @@ func ContentMasterKelainan(
|
||||
paginationID string,
|
||||
searchID string,
|
||||
breadcrumb templ.Component,
|
||||
tablecontent templ.Component,
|
||||
filterKelainan templ.Component,
|
||||
paginationKelainan templ.Component,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
@@ -67,7 +72,23 @@ func ContentMasterKelainan(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"col-md-2 d-none d-lg-block d-xl-block d-md-block d-sm-none\"><div class=\"d-flex justify-content-end\"><button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#dialogNew\">Add New</button></div></div><div class=\"col-md-2 d-block d-lg-none d-xl-none d-md-none d-sm-block justify-content-center px-5\"><button type=\"button\" class=\"btn btn-primary btn-block\">Add New</button></div></div><div class=\"d-flex justify-content-center text-primary\"><div class=\"htmx-indicator spinner-border\" role=\"status\" id=\"indicator\"><span class=\"sr-only\"></span></div></div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"col-md-2 d-none d-lg-block d-xl-block d-md-block d-sm-none\"><div class=\"d-flex justify-content-end\"><button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#dialogNew\">Add New</button></div></div><div class=\"col-md-2 d-block d-lg-none d-xl-none d-md-none d-sm-block justify-content-center px-5\"><button type=\"button\" class=\"btn btn-primary btn-block\">Add New</button></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = filterKelainan.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = paginationKelainan.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-center text-primary\"><div class=\"htmx-indicator spinner-border\" role=\"status\" id=\"indicator\"><span class=\"sr-only\"></span></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -86,7 +107,7 @@ func ContentMasterKelainan(
|
||||
})
|
||||
}
|
||||
|
||||
func JSku() templ.Component {
|
||||
func TableRowV1(data []models.Kelainan) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
@@ -99,6 +120,90 @@ func JSku() templ.Component {
|
||||
templ_7745c5c3_Var2 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if len(data) == 0 {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td colspan=\"3\" class=\"text-center\">Data Tidak Ditemukan</td></tr>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
for _, v := range data {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(v.Nomor)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\masterkelainan.templ`, Line: 72, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.Mcu_KelainanGroupName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\masterkelainan.templ`, Line: 73, Col: 32}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td><div class=\"row px-5 d-flex justify-content-around\"><a id=\"btneditug\" type=\"button\" class=\"btneditug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2\" data-toggle=\"modal\" data-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs("#dialogEdit" + strconv.Itoa(v.Mcu_KelainanGroupID))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\masterkelainan.templ`, Line: 81, Col: 71}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">Edit\r</a> <a id=\"btndeleteug\" type=\"button\" class=\" btndeleteug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2\" data-toggle=\"modal\" data-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("#dialogDelete" + strconv.Itoa(v.Mcu_KelainanGroupID))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\masterkelainan.templ`, Line: 90, Col: 73}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">Hapus</a></div></td></tr>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func JSku() templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var7 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var7 == nil {
|
||||
templ_7745c5c3_Var7 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>\r\n\t\t function ShowLoading(evt) {\r\n document\r\n .getElementById(\"modalLoadEdit\")\r\n .setAttribute(\"style\", \"display:block !important;\");\r\n document\r\n .getElementById(\"modalbdyEdit\")\r\n .setAttribute(\"style\", \"display:none !important;\");\r\n\t\t console.log(evt);\r\n }\r\n function ShowForm() {\r\n document\r\n .getElementById(\"modalLoadEdit\")\r\n .setAttribute(\"style\", \"display:none !important;\");\r\n document\r\n .getElementById(\"modalbdyEdit\")\r\n .setAttribute(\"style\", \"display:block !important;;\");\r\n }\r\n\t</script>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -118,9 +223,9 @@ func CssKelainan() templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var3 == nil {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
templ_7745c5c3_Var8 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var8 == nil {
|
||||
templ_7745c5c3_Var8 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><style>\r\n body {\r\n background-color: white;\r\n /* padding-right: 100px;\r\n padding-left: 100px; */\r\n }\r\n #div-chart {\r\n /* overflow-x: scroll; */\r\n margin: 40px 10vw 40px 10vw;\r\n }\r\n .title {\r\n font-size:20px;\r\n font-weight: bold;\r\n }\r\n #title {\r\n font-weight: 600;\r\n }\r\n \r\n</style>")
|
||||
@@ -149,12 +254,12 @@ func ShowKelainan(
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var4 == nil {
|
||||
templ_7745c5c3_Var4 = templ.NopComponent
|
||||
templ_7745c5c3_Var9 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var9 == nil {
|
||||
templ_7745c5c3_Var9 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Var5 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Var10 := templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
@@ -169,7 +274,67 @@ func ShowKelainan(
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func TableKelainan(data []models.Kelainan, tableID string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var11 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var11 == nil {
|
||||
templ_7745c5c3_Var11 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(tableID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\masterkelainan.templ`, Line: 178, Col: 18}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap-oob=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs("#" + tableID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\masterkelainan\masterkelainan.templ`, Line: 178, Col: 48}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NO", "GRUP KELAINAN", "AKSI"},
|
||||
[]string{"15%", "65%", "20%"},
|
||||
TableRowV1(data)).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user