From 2f651cba3daeb90d3161f496f9a44b47b3168122 Mon Sep 17 00:00:00 2001 From: adibwp Date: Thu, 13 Jun 2024 23:06:55 +0700 Subject: [PATCH] add tab kesimpulan --- README.md | 10 +- handlers/corporate/mcudetail.handlers.go | 10 +- .../mcudetail/tabkesimpulan.handlers.go | 76 +++++ handlers/dev/detailmcu.handlers.go | 5 +- handlers/routes.go | 6 + .../mcudetail/tabkesimpulan.services.go | 232 +++++++++++++++ views/corporate/mcu/mcudetail.templ | 5 +- views/corporate/mcu/mcudetail_templ.go | 8 +- .../corporate/mcu/mcutab/tabkesimpulan.templ | 275 ++++++++++++++++++ .../mcu/mcutab/tabkesimpulan_templ.go | 116 ++++++++ .../mcu/mcutab/tabkesimpulantable.templ | 46 +++ .../mcu/mcutab/tabkesimpulantable_templ.go | 181 ++++++++++++ views/corporate/mcu/mcutabview.templ | 9 +- views/corporate/mcu/mcutabview_templ.go | 19 +- views/dev/kesimpulan/tableKesimpulan.templ | 2 +- views/dev/kesimpulan/tableKesimpulan_templ.go | 2 +- views/dev/mcu/tabviewdetailmcu.templ | 9 +- views/dev/mcu/tabviewdetailmcu_templ.go | 19 +- 18 files changed, 1012 insertions(+), 18 deletions(-) create mode 100644 handlers/corporate/mcudetail/tabkesimpulan.handlers.go create mode 100644 services/corporate/mcudetail/tabkesimpulan.services.go create mode 100644 views/corporate/mcu/mcutab/tabkesimpulan.templ create mode 100644 views/corporate/mcu/mcutab/tabkesimpulan_templ.go create mode 100644 views/corporate/mcu/mcutab/tabkesimpulantable.templ create mode 100644 views/corporate/mcu/mcutab/tabkesimpulantable_templ.go diff --git a/README.md b/README.md index ea01524..1d3fdcb 100644 --- a/README.md +++ b/README.md @@ -56,4 +56,12 @@ $ templ generate --watch ### Happy coding 😀!! # LINK ODOO DAN TUTORIAL INIT -http://odoo.sismedika.com/web#id=6282&cids=1&menu_id=225&action=342&active_id=3&model=project.task&view_type=form \ No newline at end of file +http://odoo.sismedika.com/web#id=6282&cids=1&menu_id=225&action=342&active_id=3&model=project.task&view_type=form + + +## BUILD WEB LINUX +Run di Bash command line + +``` +GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ./bin/main ./cmd/main.go +``` diff --git a/handlers/corporate/mcudetail.handlers.go b/handlers/corporate/mcudetail.handlers.go index 7783c8f..e517822 100644 --- a/handlers/corporate/mcudetail.handlers.go +++ b/handlers/corporate/mcudetail.handlers.go @@ -8,6 +8,7 @@ import ( "cpone/services" "cpone/utils" corporate_mcudetail "cpone/views/corporate/mcu" + corporate_tabmcudetail "cpone/views/corporate/mcu/mcutab" "github.com/labstack/echo/v4" "go.uber.org/zap" @@ -31,6 +32,9 @@ func (mcud *McuDetailHandler) HandlerShowMcuDetailScreen(c echo.Context) error { logger, _ := zap.NewProduction() title := "PT. Sadhana Abiyasa Sampoerna" + id := c.Param("id") + logger.Info("params", zap.Any("id", id)) + user, err := services.GetUserLogin() if err != nil { defer logger.Sync() @@ -51,9 +55,11 @@ func (mcud *McuDetailHandler) HandlerShowMcuDetailScreen(c echo.Context) error { content := corporate_mcudetail.McuDetailScreen( breadcrumb, - corporate_mcudetail.TabViewMcuDetail(), + corporate_mcudetail.TabViewMcuDetail(id), + ) + css := corporate_mcudetail.CSSMcuDetail( + corporate_tabmcudetail.CssKesimpulan(), ) - css := corporate_mcudetail.CSSMcuDetail() js := corporate_mcudetail.JSMcuDetail() view := corporate_mcudetail.ShowMcuDetail( diff --git a/handlers/corporate/mcudetail/tabkesimpulan.handlers.go b/handlers/corporate/mcudetail/tabkesimpulan.handlers.go new file mode 100644 index 0000000..d1f0895 --- /dev/null +++ b/handlers/corporate/mcudetail/tabkesimpulan.handlers.go @@ -0,0 +1,76 @@ +package mcu_corporate_handlers + +import ( + "cpone/models" + "cpone/utils" + corporate_mcudetail "cpone/views/corporate/mcu/mcutab" + "fmt" + + "github.com/labstack/echo/v4" + "go.uber.org/zap" +) + +type TabKesimpulanServices interface { + GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error) + GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error) + GetListKesimpulanFisik(id string) ([]models.ModelKesimpulanLab, error) +} + +type TabKesimpulanHandler struct { + TabKesimpulanServices TabKesimpulanServices +} + +func NewTabKesimpulanHandler(us TabKesimpulanServices) *TabKesimpulanHandler { + return &TabKesimpulanHandler{ + TabKesimpulanServices: us, + } +} + +func (tkh *TabKesimpulanHandler) HandleShowTabKesimpulanScreen(c echo.Context) error { + logger, _ := zap.NewProduction() + + tableID := utils.GenerateRandomID("tablebody") + id := c.Param("id") + + dataLab, err := tkh.TabKesimpulanServices.GetListKesimpulanLab(id) + if err != nil { + defer logger.Sync() + logger.Info("ERROR GET LIST LAB", + zap.Any("error", err), + ) + fmt.Println(dataLab) + return err + } + tableComponentLab := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID) + + dataNonLab, err := tkh.TabKesimpulanServices.GetListKesimpulanNonLab(id) + if err != nil { + defer logger.Sync() + logger.Info("ERROR GET LIST NON LAB", + zap.Any("error", err), + ) + fmt.Println(dataNonLab) + return err + } + tableComponentNonLab := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableID) + + dataFisik, err := tkh.TabKesimpulanServices.GetListKesimpulanFisik(id) + if err != nil { + defer logger.Sync() + logger.Info("ERROR GET LIST FISIK", + zap.Any("error", err), + ) + fmt.Println(dataFisik) + return err + } + tableComponentFisik := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Fisik terbesar :", dataFisik, tableID) + + content := corporate_mcudetail.MainKesimpulan( + tableID, + tableComponentLab, + tableComponentNonLab, + tableComponentFisik, + ) + + return utils.View(c, content) +} diff --git a/handlers/dev/detailmcu.handlers.go b/handlers/dev/detailmcu.handlers.go index ff4d5d5..2d4a26c 100644 --- a/handlers/dev/detailmcu.handlers.go +++ b/handlers/dev/detailmcu.handlers.go @@ -31,6 +31,9 @@ func (dmcu *DetailMcuHandler) HandleShowDetailMcuScreen(c echo.Context) error { logger, _ := zap.NewProduction() title := "PT. Sadhana Abiyasa Sampoerna" + id := c.Param("id") + logger.Info("params", zap.Any("id", id)) + user, err := services.GetUserLogin() if err != nil { defer logger.Sync() @@ -51,7 +54,7 @@ func (dmcu *DetailMcuHandler) HandleShowDetailMcuScreen(c echo.Context) error { content := dev_detailmcu.DetailMcuScreen( breadcrumb, - dev_detailmcu.TabViewDetailMcu(), + dev_detailmcu.TabViewDetailMcu(id), ) css := dev_detailmcu.CSSDetailMcu() js := dev_detailmcu.JSDetailMcu() diff --git a/handlers/routes.go b/handlers/routes.go index 918bd93..27819b5 100644 --- a/handlers/routes.go +++ b/handlers/routes.go @@ -3,10 +3,12 @@ package handlers import ( client_handlers "cpone/handlers/client" corporate_handlers "cpone/handlers/corporate" + mcu_corporate_handlers "cpone/handlers/corporate/mcudetail" dev_handlers "cpone/handlers/dev" public_handlers "cpone/handlers/public" client_services "cpone/services/client" corporate_services "cpone/services/corporate" + mcu_corporate_services "cpone/services/corporate/mcudetail" dev_services "cpone/services/dev" public_services "cpone/services/public" @@ -115,6 +117,10 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) { mcudHandr := corporate_handlers.NewMcuDetailHandler(mcudServ) corp.GET("/dashboard_pic/detail/:id", mcudHandr.HandlerShowMcuDetailScreen) + kesimpulanSrv := mcu_corporate_services.NewTabKesimpulanServices(appStore) + kesimpulanHdr := mcu_corporate_handlers.NewTabKesimpulanHandler(kesimpulanSrv) + corp.GET("/dashboard_pic/detail/:id/tabkesimpulan", kesimpulanHdr.HandleShowTabKesimpulanScreen) + patientHandler := corporate_handlers.NewPatientHandler(l) corp.GET("/patient", patientHandler.ShowPatient) } diff --git a/services/corporate/mcudetail/tabkesimpulan.services.go b/services/corporate/mcudetail/tabkesimpulan.services.go new file mode 100644 index 0000000..bd09202 --- /dev/null +++ b/services/corporate/mcudetail/tabkesimpulan.services.go @@ -0,0 +1,232 @@ +package mcu_corporate_services + +import ( + "cpone/db" + "cpone/models" + dbx "cpone/package/database" + "fmt" + + "go.uber.org/zap" +) + +type TabKesimpulanServices struct { + TabKesimpulanStore db.AppStore +} + +func NewTabKesimpulanServices(uStore db.AppStore) *TabKesimpulanServices { + return &TabKesimpulanServices{ + TabKesimpulanStore: uStore, + } +} + +func (tks *TabKesimpulanServices) GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error) { + logger, _ := zap.NewProduction() + var listLab []models.ModelKesimpulanLab + var dataTot []models.ModelKesimpulanLab + + qryTot := `select '' as nomor, + '' as Test, sum(total) as total + from( + select count(*) as total + FROM mgm_header + join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y' + join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID + join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID + left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode + + where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'L' + and Mgm_HeaderIsNormal = 'N' + group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ) x` + + err := dbx.Handlex.Select(&dataTot, qryTot, id) + if err != nil { + defer logger.Sync() + logger.Error("Error get total", + zap.Any("id", id), + zap.Any("total data", dataTot), + ) + // return dataTot, fmt.Errorf("QUERY_FAILED") + } + + // Extracting the Total value + var totalLab string + if len(dataTot) > 0 { + totalLab = dataTot[0].Total + } + + logger.Info("data", + zap.Any("id", id), + zap.Any("cek total", totalLab), + ) + query := `SELECT ROW_NUMBER() OVER (ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC) AS nomor, + ifnull(Nat_TestName ,Mcu_KelainanGroupName) as Test, + cast(count(Mgm_HeaderT_OrderHeaderID)/?*100 as decimal(2,0)) as total + + FROM mgm_header + join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y' + join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID + join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID + left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode + + where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'L' + and Mgm_HeaderIsNormal = 'N' + group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC + LIMIT 3` + + err = dbx.Handlex.Select(&listLab, query, totalLab, id) + + if err != nil { + defer logger.Sync() + logger.Error("Error get data lab", + zap.Any("id", id), + zap.Any("list data", listLab), + ) + return listLab, fmt.Errorf("QUERY_FAILED") + } + + logger.Info("data", + zap.Any("id", id), + zap.Any("cekkkk", listLab), + ) + return listLab, nil +} + +func (tks *TabKesimpulanServices) GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error) { + logger, _ := zap.NewProduction() + var listNonLab []models.ModelKesimpulanLab + var dataTot []models.ModelKesimpulanLab + + qryTot := `select '' as nomor, + '' as Test, sum(total) as total + from( + select count(*) as total + FROM mgm_header + join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y' + join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID + join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID + left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode + + where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'NL' + and Mgm_HeaderIsNormal = 'N' + group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ) x` + + err := dbx.Handlex.Select(&dataTot, qryTot, id) + if err != nil { + defer logger.Sync() + logger.Error("Error get total", + zap.Any("id", id), + zap.Any("total data", dataTot), + ) + // return dataTot, fmt.Errorf("QUERY_FAILED") + } + + // Extracting the Total value + var totalLab string + if len(dataTot) > 0 { + totalLab = dataTot[0].Total + } + + logger.Info("data", + zap.Any("id", id), + zap.Any("cek total", totalLab), + ) + query := `SELECT ROW_NUMBER() OVER (ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC) AS nomor, + ifnull(Nat_TestName ,Mcu_KelainanGroupName) as Test, + cast(count(Mgm_HeaderT_OrderHeaderID)/?*100 as decimal(2,0)) as total + + FROM mgm_header + join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y' + join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID + join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID + left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode + + where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'NL' + and Mgm_HeaderIsNormal = 'N' + group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC + LIMIT 3` + + err = dbx.Handlex.Select(&listNonLab, query, totalLab, id) + + if err != nil { + defer logger.Sync() + logger.Error("Error get data NON lab", + zap.Any("id", id), + zap.Any("list data", listNonLab), + ) + return listNonLab, fmt.Errorf("QUERY_FAILED") + } + + logger.Info("data", + zap.Any("id", id), + zap.Any("cekkkk", listNonLab), + ) + return listNonLab, nil +} + +func (tks *TabKesimpulanServices) GetListKesimpulanFisik(id string) ([]models.ModelKesimpulanLab, error) { + logger, _ := zap.NewProduction() + var listFisik []models.ModelKesimpulanLab + var dataTot []models.ModelKesimpulanLab + + qryTot := `select '' as nomor, + '' as Test, sum(total) as total + from( + select count(*) as total + FROM mgm_header + join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y' + join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID + join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID + left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode + + where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'F' + and Mgm_HeaderIsNormal = 'N' + group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ) x` + + err := dbx.Handlex.Select(&dataTot, qryTot, id) + if err != nil { + defer logger.Sync() + logger.Error("Error get total", + zap.Any("id", id), + zap.Any("total data", dataTot), + ) + // return dataTot, fmt.Errorf("QUERY_FAILED") + } + + // Extracting the Total value + var totalFisik string + if len(dataTot) > 0 { + totalFisik = dataTot[0].Total + } + + logger.Info("data", + zap.Any("id", id), + zap.Any("cek total", totalFisik), + ) + query := `SELECT ROW_NUMBER() OVER (ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC) AS nomor, + ifnull(Nat_TestName ,Mcu_KelainanGroupName) as Test, + cast(count(Mgm_HeaderT_OrderHeaderID)/?*100 as decimal(2,0)) as total + + FROM mgm_header + join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y' + join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID + join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID + left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode + + where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'F' + and Mgm_HeaderIsNormal = 'N' + group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC + LIMIT 3` + + err = dbx.Handlex.Select(&listFisik, query, totalFisik, id) + + if err != nil { + defer logger.Sync() + logger.Error("Error get data fisik", + zap.Any("id", id), + zap.Any("list data", listFisik), + ) + return listFisik, fmt.Errorf("QUERY_FAILED") + } + + return listFisik, nil +} diff --git a/views/corporate/mcu/mcudetail.templ b/views/corporate/mcu/mcudetail.templ index a4a7155..f835ab0 100644 --- a/views/corporate/mcu/mcudetail.templ +++ b/views/corporate/mcu/mcudetail.templ @@ -24,7 +24,9 @@ templ McuDetailScreen( } -templ CSSMcuDetail() { +templ CSSMcuDetail( + CssKesimpulan templ.Component, +) { + @CssKesimpulan } templ JSMcuDetail() { diff --git a/views/corporate/mcu/mcudetail_templ.go b/views/corporate/mcu/mcudetail_templ.go index 1e32e4d..ea0aaa3 100644 --- a/views/corporate/mcu/mcudetail_templ.go +++ b/views/corporate/mcu/mcudetail_templ.go @@ -55,7 +55,9 @@ func McuDetailScreen( }) } -func CSSMcuDetail() templ.Component { +func CSSMcuDetail( + CssKesimpulan 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) if !templ_7745c5c3_IsBuffer { @@ -72,6 +74,10 @@ func CSSMcuDetail() templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } + templ_7745c5c3_Err = CssKesimpulan.Render(ctx, 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) } diff --git a/views/corporate/mcu/mcutab/tabkesimpulan.templ b/views/corporate/mcu/mcutab/tabkesimpulan.templ new file mode 100644 index 0000000..1022320 --- /dev/null +++ b/views/corporate/mcu/mcutab/tabkesimpulan.templ @@ -0,0 +1,275 @@ +package corporate_mcudetail + +import ( + "cpone/component/customtextfield" + "cpone/models" +) + +templ MainKesimpulan( + tableID string, + tablecontent templ.Component, + tablecontentnonlab templ.Component, + tablecontentfisik templ.Component, +) { +
+ @customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID", + Name: "tableID", + Type: "hidden", + Value: tableID}) +
+

Kesimpulan

+
+ @tablecontent + @tablecontentnonlab + @tablecontentfisik +
+} + +templ CssKesimpulan() { + + + + +} + +templ JsKesimpulan() { +} \ No newline at end of file diff --git a/views/corporate/mcu/mcutab/tabkesimpulan_templ.go b/views/corporate/mcu/mcutab/tabkesimpulan_templ.go new file mode 100644 index 0000000..273763b --- /dev/null +++ b/views/corporate/mcu/mcutab/tabkesimpulan_templ.go @@ -0,0 +1,116 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package corporate_mcudetail + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/customtextfield" + "cpone/models" +) + +func MainKesimpulan( + tableID string, + tablecontent templ.Component, + tablecontentnonlab templ.Component, + tablecontentfisik 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) + if !templ_7745c5c3_IsBuffer { + templ_7745c5c3_Buffer = templ.GetBuffer() + defer templ.ReleaseBuffer(templ_7745c5c3_Buffer) + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID", + Name: "tableID", + Type: "hidden", + Value: tableID}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

Kesimpulan

") + 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 = tablecontentnonlab.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = tablecontentfisik.Render(ctx, templ_7745c5c3_Buffer) + 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 + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func CssKesimpulan() 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_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + 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 JsKesimpulan() 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_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/views/corporate/mcu/mcutab/tabkesimpulantable.templ b/views/corporate/mcu/mcutab/tabkesimpulantable.templ new file mode 100644 index 0000000..69ed1ad --- /dev/null +++ b/views/corporate/mcu/mcutab/tabkesimpulantable.templ @@ -0,0 +1,46 @@ +package corporate_mcudetail + +import ( + "cpone/component/table" + "cpone/models" +) + +templ CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID string) { +
+
+

+ { title } +

+
+
+
+ @TableKesimpulan(data, tableID) +
+
+
+} + +templ TableKesimpulan(data []models.ModelKesimpulanLab, + tableID string) { +
+ @tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"}, + []string{"5%", "70%", "25%"}, + RowKesimpulan(data), + ) +
+} + +templ RowKesimpulan(data []models.ModelKesimpulanLab) { + if len(data) == 0 { + + Data Tidak Ditemukan + + } + for _, v := range data { + + { v.Nomor } + { v.Test } + { v.Total } + + } +} \ No newline at end of file diff --git a/views/corporate/mcu/mcutab/tabkesimpulantable_templ.go b/views/corporate/mcu/mcutab/tabkesimpulantable_templ.go new file mode 100644 index 0000000..66b0e25 --- /dev/null +++ b/views/corporate/mcu/mcutab/tabkesimpulantable_templ.go @@ -0,0 +1,181 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.2.663 +package corporate_mcudetail + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import "context" +import "io" +import "bytes" + +import ( + "cpone/component/table" + "cpone/models" +) + +func CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, 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_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var2 string + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 12, Col: 11} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) + 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 = TableKesimpulan(data, tableID).Render(ctx, templ_7745c5c3_Buffer) + 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 + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func TableKesimpulan(data []models.ModelKesimpulanLab, + 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_Var3 := templ.GetChildren(ctx) + if templ_7745c5c3_Var3 == nil { + templ_7745c5c3_Var3 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"}, + []string{"5%", "70%", "25%"}, + RowKesimpulan(data), + ).Render(ctx, templ_7745c5c3_Buffer) + 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 + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} + +func RowKesimpulan(data []models.ModelKesimpulanLab) 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_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + if len(data) == 0 { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("Data Tidak Ditemukan") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + for _, v := range data { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.Nomor) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 41, Col: 16} + } + _, 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("") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.Test) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 42, Col: 15} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + 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 + } + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(v.Total) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 43, Col: 16} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) + 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 + } + } + if !templ_7745c5c3_IsBuffer { + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W) + } + return templ_7745c5c3_Err + }) +} diff --git a/views/corporate/mcu/mcutabview.templ b/views/corporate/mcu/mcutabview.templ index 6de40a1..5f69f8e 100644 --- a/views/corporate/mcu/mcutabview.templ +++ b/views/corporate/mcu/mcutabview.templ @@ -1,6 +1,8 @@ package corporate_mcudetail -templ TabViewMcuDetail() { +templ TabViewMcuDetail( + id string, +) {
- tab 6 +
+
tab 7 diff --git a/views/corporate/mcu/mcutabview_templ.go b/views/corporate/mcu/mcutabview_templ.go index c3e1f1b..2418d0c 100644 --- a/views/corporate/mcu/mcutabview_templ.go +++ b/views/corporate/mcu/mcutabview_templ.go @@ -10,7 +10,9 @@ import "context" import "io" import "bytes" -func TabViewMcuDetail() templ.Component { +func TabViewMcuDetail( + id 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 { @@ -23,7 +25,20 @@ func TabViewMcuDetail() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
tab 6\r
tab 7\r
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
tab 7\r
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/dev/kesimpulan/tableKesimpulan.templ b/views/dev/kesimpulan/tableKesimpulan.templ index 0bedd75..8361626 100644 --- a/views/dev/kesimpulan/tableKesimpulan.templ +++ b/views/dev/kesimpulan/tableKesimpulan.templ @@ -22,7 +22,7 @@ templ CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableI templ TableKesimpulan(data []models.ModelKesimpulanLab, tableID string) { -
+
@tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"}, []string{"5%", "70%", "25%"}, RowKesimpulan(data), diff --git a/views/dev/kesimpulan/tableKesimpulan_templ.go b/views/dev/kesimpulan/tableKesimpulan_templ.go index fcba519..53d4666 100644 --- a/views/dev/kesimpulan/tableKesimpulan_templ.go +++ b/views/dev/kesimpulan/tableKesimpulan_templ.go @@ -87,7 +87,7 @@ func TableKesimpulan(data []models.ModelKesimpulanLab, if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap-oob=\"true\">") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/views/dev/mcu/tabviewdetailmcu.templ b/views/dev/mcu/tabviewdetailmcu.templ index cdec098..0ee89ff 100644 --- a/views/dev/mcu/tabviewdetailmcu.templ +++ b/views/dev/mcu/tabviewdetailmcu.templ @@ -1,6 +1,8 @@ package dev_detailmcu -templ TabViewDetailMcu() { +templ TabViewDetailMcu( + id string, +) {
- tab 6 +
+
tab 7 diff --git a/views/dev/mcu/tabviewdetailmcu_templ.go b/views/dev/mcu/tabviewdetailmcu_templ.go index 9cfa4c0..c6161ea 100644 --- a/views/dev/mcu/tabviewdetailmcu_templ.go +++ b/views/dev/mcu/tabviewdetailmcu_templ.go @@ -10,7 +10,9 @@ import "context" import "io" import "bytes" -func TabViewDetailMcu() templ.Component { +func TabViewDetailMcu( + id 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 { @@ -23,7 +25,20 @@ func TabViewDetailMcu() templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
tab 6\r
tab 7\r
") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("
tab 7\r
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err }