fis kesimpulan

This commit is contained in:
Hanan Askarim
2024-06-13 19:11:14 +07:00
parent ac1547699e
commit c4ba3fbd5e
10 changed files with 17 additions and 501 deletions

View File

@@ -30,8 +30,6 @@ func (h *KesimpulanHandler) HandleShowKesimpulanScreen(c echo.Context) error {
logger, _ := zap.NewProduction()
tableID := utils.GenerateRandomID("tablebody")
tableIDNonLab := utils.GenerateRandomID("tablebody")
tableIDFisik := utils.GenerateRandomID("tablebody")
id := c.Param("id")
// table component
@@ -63,7 +61,7 @@ func (h *KesimpulanHandler) HandleShowKesimpulanScreen(c echo.Context) error {
logger.Info("CEK DATA",
zap.Any("data lab", dataNonLab))
tableComponentNonLab := dev_kesimpulan.CardTableKesimpulanNonLab("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableIDNonLab)
tableComponentNonLab := dev_kesimpulan.CardTableKesimpulan("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableID)
// table component fisik
dataFisik, err := h.KesimpulanService.GetListKesimpulanFisik(id)
@@ -78,11 +76,9 @@ func (h *KesimpulanHandler) HandleShowKesimpulanScreen(c echo.Context) error {
logger.Info("CEK DATA",
zap.Any("data lab", dataFisik))
tableComponentFisik := dev_kesimpulan.CardTableKesimpulanFisik("3 Kelainan Pemeriksaan Fisik terbesar :", dataFisik, tableIDFisik)
tableComponentFisik := dev_kesimpulan.CardTableKesimpulan("3 Kelainan Pemeriksaan Fisik terbesar :", dataFisik, tableID)
content := dev_kesimpulan.MainKesimpulan(tableID,
tableIDNonLab,
tableIDFisik,
tableComponentLab,
tableComponentNonLab,
tableComponentFisik)

View File

@@ -58,7 +58,7 @@ func (k *KesimpulanServices) GetListKesimpulanLab(id string) ([]models.ModelKesi
zap.Any("id", id),
zap.Any("cek total", totalLab),
)
query := `SELECT ROW_NUMBER() OVER () AS nomor,
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
@@ -130,7 +130,7 @@ func (k *KesimpulanServices) GetListKesimpulanNonLab(id string) ([]models.ModelK
zap.Any("id", id),
zap.Any("cek total", totalLab),
)
query := `SELECT ROW_NUMBER() OVER () AS nomor,
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
@@ -202,7 +202,7 @@ func (k *KesimpulanServices) GetListKesimpulanFisik(id string) ([]models.ModelKe
zap.Any("id", id),
zap.Any("cek total", totalFisik),
)
query := `SELECT ROW_NUMBER() OVER () AS nomor,
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

View File

@@ -8,8 +8,6 @@ import (
templ MainKesimpulan(
tableID string,
tableIDNonLab string,
tableIDFisik string,
tablecontent templ.Component,
tablecontentnonlab templ.Component,
tablecontentfisik templ.Component,
@@ -19,16 +17,8 @@ templ MainKesimpulan(
Name: "tableID",
Type: "hidden",
Value: tableID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableIDNonLab",
Name: "tableIDNonLab",
Type: "hidden",
Value: tableIDNonLab})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableIDFisik",
Name: "tableIDFisik",
Type: "hidden",
Value: tableIDFisik})
<div class="d-flex justify-content-center pt-10 pb-10">
<h2 class="title" style="margin-bottom: 0">Kesimpulan</h2>
<h2 class="title text-black" style="margin-bottom: 0">Kesimpulan</h2>
</div>
@tablecontent
@tablecontentnonlab

View File

@@ -18,8 +18,6 @@ import (
func MainKesimpulan(
tableID string,
tableIDNonLab string,
tableIDFisik string,
tablecontent templ.Component,
tablecontentnonlab templ.Component,
tablecontentfisik templ.Component,
@@ -47,21 +45,7 @@ func MainKesimpulan(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableIDNonLab",
Name: "tableIDNonLab",
Type: "hidden",
Value: tableIDNonLab}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableIDFisik",
Name: "tableIDFisik",
Type: "hidden",
Value: tableIDFisik}).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 pt-10 pb-10\"><h2 class=\"title\" style=\"margin-bottom: 0\">Kesimpulan</h2></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-center pt-10 pb-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0\">Kesimpulan</h2></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -14,23 +14,23 @@ templ CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableI
</div>
<div class="card-body">
<div>
@TableKesimpulanLab(data, tableID)
@TableKesimpulan(data, tableID)
</div>
</div>
</div>
}
templ TableKesimpulanLab(data []models.ModelKesimpulanLab,
templ TableKesimpulan(data []models.ModelKesimpulanLab,
tableID string) {
<div id={ tableID } hx-swap-oob="true">
@tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"},
[]string{"5%", "70%", "25%"},
RowKesimpulanLab(data),
RowKesimpulan(data),
)
</div>
}
templ RowKesimpulanLab(data []models.ModelKesimpulanLab) {
templ RowKesimpulan(data []models.ModelKesimpulanLab) {
if len(data) == 0 {
<tr>
<td colspan="3" class="text-center">Data Tidak Ditemukan</td>
@@ -40,7 +40,7 @@ templ RowKesimpulanLab(data []models.ModelKesimpulanLab) {
<tr>
<td>{ v.Nomor }</td>
<td>{ v.Test }</td>
<td>{ v.Total } %</td>
<td>{ v.Total }</td>
</tr>
}
}

View File

@@ -45,7 +45,7 @@ func CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = TableKesimpulanLab(data, tableID).Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = TableKesimpulan(data, tableID).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -60,7 +60,7 @@ func CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID
})
}
func TableKesimpulanLab(data []models.ModelKesimpulanLab,
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)
@@ -93,7 +93,7 @@ func TableKesimpulanLab(data []models.ModelKesimpulanLab,
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"},
[]string{"5%", "70%", "25%"},
RowKesimpulanLab(data),
RowKesimpulan(data),
).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@@ -109,7 +109,7 @@ func TableKesimpulanLab(data []models.ModelKesimpulanLab,
})
}
func RowKesimpulanLab(data []models.ModelKesimpulanLab) templ.Component {
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 {
@@ -168,7 +168,7 @@ func RowKesimpulanLab(data []models.ModelKesimpulanLab) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" %</td></tr>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -1,46 +0,0 @@
package dev_kesimpulan
import (
"cpone/component/table"
"cpone/models"
)
templ CardTableKesimpulanFisik(title string, data []models.ModelKesimpulanLab, tableIDFisik string) {
<div class="card card-custom gutter-b" style="border-radius: 20px">
<div style="padding-top: 12px">
<h3 class="card-label dot-text text-black">
{ title }
</h3>
</div>
<div class="card-body">
<div>
@TableKesimpulanFisik(data, tableIDFisik)
</div>
</div>
</div>
}
templ TableKesimpulanFisik(data []models.ModelKesimpulanLab,
tableIDFisik string) {
<div id={ tableIDFisik } hx-swap-oob="true">
@tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"},
[]string{"5%", "70%", "25%"},
RowKesimpulanFisik(data),
)
</div>
}
templ RowKesimpulanFisik(data []models.ModelKesimpulanLab) {
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.Test }</td>
<td>{ v.Total } %</td>
</tr>
}
}

View File

@@ -1,181 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_kesimpulan
//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 CardTableKesimpulanFisik(title string, data []models.ModelKesimpulanLab, tableIDFisik 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("<div class=\"card card-custom gutter-b\" style=\"border-radius: 20px\"><div style=\"padding-top: 12px\"><h3 class=\"card-label dot-text text-black\">")
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\dev\kesimpulan\tablekesimpulanfisik.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("</h3></div><div class=\"card-body\"><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = TableKesimpulanFisik(data, tableIDFisik).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
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 TableKesimpulanFisik(data []models.ModelKesimpulanLab,
tableIDFisik 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("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(tableIDFisik)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\kesimpulan\tablekesimpulanfisik.templ`, Line: 25, Col: 23}
}
_, 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("\" hx-swap-oob=\"true\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"},
[]string{"5%", "70%", "25%"},
RowKesimpulanFisik(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
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func RowKesimpulanFisik(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("<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_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\dev\kesimpulan\tablekesimpulanfisik.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("</td><td>")
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\dev\kesimpulan\tablekesimpulanfisik.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("</td><td>")
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\dev\kesimpulan\tablekesimpulanfisik.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(" %</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
})
}

View File

@@ -1,46 +0,0 @@
package dev_kesimpulan
import (
"cpone/component/table"
"cpone/models"
)
templ CardTableKesimpulanNonLab(title string, data []models.ModelKesimpulanLab, tableIDNonLab string) {
<div class="card card-custom gutter-b" style="border-radius: 20px">
<div style="padding-top: 12px">
<h3 class="card-label dot-text text-black">
{ title }
</h3>
</div>
<div class="card-body">
<div>
@TableKesimpulanNonLab(data, tableIDNonLab)
</div>
</div>
</div>
}
templ TableKesimpulanNonLab(data []models.ModelKesimpulanLab,
tableIDNonLab string) {
<div id={ tableIDNonLab } hx-swap-oob="true">
@tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"},
[]string{"5%", "70%", "25%"},
RowKesimpulanNonLab(data),
)
</div>
}
templ RowKesimpulanNonLab(data []models.ModelKesimpulanLab) {
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.Test }</td>
<td>{ v.Total } %</td>
</tr>
}
}

View File

@@ -1,181 +0,0 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_kesimpulan
//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 CardTableKesimpulanNonLab(title string, data []models.ModelKesimpulanLab, tableIDNonLab 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("<div class=\"card card-custom gutter-b\" style=\"border-radius: 20px\"><div style=\"padding-top: 12px\"><h3 class=\"card-label dot-text text-black\">")
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\dev\kesimpulan\tablekesimpulannonlab.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("</h3></div><div class=\"card-body\"><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = TableKesimpulanNonLab(data, tableIDNonLab).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
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 TableKesimpulanNonLab(data []models.ModelKesimpulanLab,
tableIDNonLab 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("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(tableIDNonLab)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\kesimpulan\tablekesimpulannonlab.templ`, Line: 25, Col: 24}
}
_, 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("\" hx-swap-oob=\"true\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"},
[]string{"5%", "70%", "25%"},
RowKesimpulanNonLab(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
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func RowKesimpulanNonLab(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("<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_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\dev\kesimpulan\tablekesimpulannonlab.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("</td><td>")
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\dev\kesimpulan\tablekesimpulannonlab.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("</td><td>")
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\dev\kesimpulan\tablekesimpulannonlab.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(" %</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
})
}