Compare commits

...

36 Commits

Author SHA1 Message Date
f8ad467b3d edit model respone api login 2025-10-24 10:10:25 +07:00
ce4ff29591 disable dev routes and add .vscode to gitignore 2025-10-23 17:10:31 +07:00
8094de70cc release version 2025-10-08 08:26:22 +07:00
fc2d9292c2 change typo label 2024-08-22 17:25:43 +07:00
74d564e303 edit query and graph component 2024-08-22 16:08:05 +07:00
d1b04676a7 add split string func 2024-08-15 16:18:55 +07:00
31b2d6c793 edit graphic bar title, order, color 2024-08-15 15:50:59 +07:00
72c7e714f5 add detail pemeriksaan 2024-08-14 13:59:15 +07:00
35dd1b18fc add ganti password pic / pat 2024-08-13 13:48:59 +07:00
b9930f5662 add change password pic and pat service and handler 2024-08-12 15:43:22 +07:00
4d80bf4ca8 v4 list rpt pat & pic 2024-08-09 17:36:04 +07:00
fcaa4d7858 change login be, edit query listing mcu 2024-08-09 11:35:30 +07:00
19e3269a6a add nama paket di tabel daftar peserta 2024-08-08 16:20:53 +07:00
02d5f2e39e add label data tidak ditemukan 2024-08-07 16:56:25 +07:00
55a2e1bbfd change query data graph tab 2024-08-07 14:56:07 +07:00
a729d6ab67 revice tab ordering service 2024-07-16 13:18:58 +07:00
938e6d60f1 add autologon, + generate password btn peserta dashboard pic 2024-07-13 15:37:44 +07:00
57d160b62a edit query 2024-07-10 14:04:46 +07:00
e4364f0c4f add xs layout echarts 2024-07-08 08:47:56 +07:00
f2d8207f25 add echart barchart 2024-07-05 10:55:47 +07:00
eb7343117b add echart kelainan lab 2024-07-03 10:47:43 +07:00
7a22f5e4d0 add tab kelainan fisik echarts 2024-07-01 15:58:35 +07:00
1c7e223195 add chart tab kepesertaan 2024-06-27 15:56:43 +07:00
2a25c60cc2 add piechart dummy tab peserta 2024-06-26 18:13:48 +07:00
9008cac97d add tabview kepersetaan 2024-06-26 18:13:48 +07:00
91a157b023 add tab view kepesertaan 2024-06-26 18:13:48 +07:00
54de2a0ece add tabchartkepesertaan 2024-06-26 18:13:48 +07:00
9af95cfd9f update url spirometri 2024-06-26 17:16:00 +07:00
0e7f438c6a add corporate name 2024-06-26 14:59:01 +07:00
78af5abdf0 add resume individu rpt 2024-06-26 13:20:26 +07:00
2179017556 fix ulr rpt audiometri 2024-06-26 11:19:59 +07:00
accd8d57d9 add audiometry rpt 2024-06-26 09:56:58 +07:00
dbad97d0f2 add formating ribuan keuangan + alert salah login 2024-06-25 16:49:21 +07:00
322a70b582 add tab keuangan table 2024-06-24 16:35:03 +07:00
2cb5ceac47 slicing form-keuangan 2024-06-24 16:35:03 +07:00
fdc8c54eed add blank tab keuangan 2024-06-22 11:15:50 +07:00
109 changed files with 12392 additions and 2262 deletions

1
.gitignore vendored
View File

@@ -4,3 +4,4 @@ config.yaml
restapi.rest
cpone.db
coba.Http
.vscode/

View File

@@ -1,3 +0,0 @@
{
"liveServer.settings.port": 5501
}

View File

@@ -0,0 +1,273 @@
<!DOCTYPE html>
<html lang="en">
<!--begin::Head-->
<head>
<base href="../" />
<meta charset="utf-8" />
<title>Company Portal | { title }</title>
<meta name="description" content="Company Portal" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<!--begin::Fonts-->
<link rel="stylesheet" href="assets/css/googlefont/poppins.css" />
<!--end::Fonts-->
<!--begin::Page Custom Styles(used by this page)-->
<link
href="assets/css/pages/login/login-1.css"
rel="stylesheet"
type="text/css"
/>
<!--end::Page Custom Styles-->
<!--begin::Global Theme Styles(used by all pages)-->
<link
href="assets/plugins/global/plugins.bundle.css"
rel="stylesheet"
type="text/css"
/>
<link
href="assets/plugins/custom/prismjs/prismjs.bundle.css"
rel="stylesheet"
type="text/css"
/>
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
<!--end::Global Theme Styles-->
<!--begin::Layout Themes(used by all pages)-->
<link
href="assets/css/themes/layout/header/base/light.css"
rel="stylesheet"
type="text/css"
/>
<link
href="assets/css/themes/layout/header/menu/light.css"
rel="stylesheet"
type="text/css"
/>
<link
href="assets/css/themes/layout/brand/dark.css"
rel="stylesheet"
type="text/css"
/>
<link
href="assets/css/themes/layout/aside/dark.css"
rel="stylesheet"
type="text/css"
/>
<!--end::Layout Themes-->
<link
rel="shortcut icon"
href="asset-corporate-portal/media/logo/logo-small.jpg"
/>
<!--end::Layout Themes SAS-->
<link
href="asset-corporate-portal/css/sas.bundle.css"
rel="stylesheet"
type="text/css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css"
/>
<style>
.filter-option-inner-inner {
margin-top: 1.2vh;
color: var(--text-disabled);
}
.bootstrap-select > .dropdown-toggle.bs-placeholder.btn {
color: var(--text-disabled);
}
.bootstrap-select.btn-group .dropdown-menu {
min-width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: sticky;
}
.dropdown-menu {
transform: translate3d(0px, 0px, 0px) !important;
}
/* mik */
.input-container {
position: relative;
}
.input-label {
position: absolute;
right: 20px;
transform: translateY(-50%);
pointer-events: none;
transition: all 0.2s ease;
}
.input-field:not(:placeholder-shown) + .input-label {
top: 50%;
font-size: 12px;
color: var(--secondary-hover);
}
</style>
</head>
<!--end::Head-->
<!--begin::Body-->
<body
id="kt_body"
class="bg-white header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading"
>
<!--begin::Main-->
<div class="wrapperx p-5 h-100">
<!--begin::Row 1-->
<div class="form-row">
<div class="col-3">
<div class="container px-15">
<div
class="d-flex flex-column bg-primary-transparent rounded p-4 m-2 shadow"
>
<h4>Orders</h4>
<h1 class="font-weight-bolder ml-auto">120.000.000</h1>
</div>
</div>
</div>
<div class="col-3">
<div class="container px-15">
<div
class="d-flex flex-column bg-warning-transparent rounded p-4 m-2 shadow"
>
<h4>Tagihan</h4>
<h1 class="font-weight-bolder ml-auto">85.000.000</h1>
</div>
</div>
</div>
<div class="col-3">
<div class="container px-15">
<div
class="d-flex flex-column bg-success-transparent rounded p-4 m-2 shadow"
>
<h4>Pelunasan</h4>
<h1 class="font-weight-bolder ml-auto">55.000.000</h1>
</div>
</div>
</div>
<div class="col-3">
<div class="container px-15">
<div
class="d-flex flex-column bg-danger-transparent rounded p-4 m-2 shadow"
>
<h4>Hutang</h4>
<h1 class="font-weight-bolder ml-auto">55.000.000</h1>
</div>
</div>
</div>
<!--end::Row 1-->
</div>
<!-- begin::Row 2 -->
<div class="form-row mt-15">
<div class="col">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr >
<th scope="col" class="text-center text-black col-5" colspan="3">Tagihan</th>
<th scope="col" class="text-center text-black col-4" colspan="2">Pelunasan</th>
<th scope="col" class="text-center text-black col-3" rowspan="2">
<div class="d-flex justify-content-center align-items-center h-100">
<h3>Sisa</h3>
</div>
</th>
</tr>
<tr>
<th scope="col" class="text-center text-black">No/Tgl</th>
<th scope="col" class="text-center text-black">Tgl Jatuh Tempo</th>
<th scope="col" class="text-center text-black">Jumlah</th>
<th scope="col" class="text-center text-black">No/Tgl</th>
<th scope="col" class="text-center text-black">Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center" rowspan="2">T/103/200/XYZ 20 MARET 2024</td>
<td class="text-center" rowspan="2">20 MARET 2024</td>
<td class="text-center" rowspan="2">20.000.000</td>
<td class="text-center">T/103/200/XYZ 20 MARET 2024</td>
<td class="text-center">10.000.000</td>
<td class="text-center" rowspan="2">5.000.000</td>
</tr>
<tr>
<td class="text-center">T/103/200/XYZ 20 MARET 2024</td>
<td class="text-center">5.000.000</td>
</tr>
<tr>
<td class="text-center" rowspan="2">T/103/200/XYZ 20 MARET 2024</td>
<td class="text-center" rowspan="2">20 MARET 2024</td>
<td class="text-center" rowspan="2">20.000.000</td>
<td class="text-center">T/103/200/XYZ 20 MARET 2024</td>
<td class="text-center">10.000.000</td>
<td class="text-center" rowspan="2">5.000.000</td>
</tr>
<tr>
<td class="text-center">T/103/200/XYZ 20 MARET 2024</td>
<td class="text-center">5.000.000</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- end::Row 2 -->
<!--end::Main-->
<script src="asset-corporate-portal/js/ktappsetting.js"></script>
<!-- iconify -->
<script src="assets/js/iconify/iconify.min.js"></script>
<!--end::Global Config-->
<!--begin::Global Theme Bundle(used by all pages)-->
<script src="assets/plugins/global/plugins.bundle.js"></script>
<script src="assets/plugins/custom/prismjs/prismjs.bundle.js"></script>
<script src="assets/js/scripts.bundle.js"></script>
<script src="assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js"></script>
<script>
function ShowLoading() {
document
.getElementById("demo")
.setAttribute("style", "display:block !important;");
document
.getElementById("a")
.setAttribute("style", "display:none !important;");
}
function ShowForm() {
document
.getElementById("demo")
.setAttribute("style", "display:none !important;");
document
.getElementById("a")
.setAttribute("style", "display:block !important;;");
}
$(document).ready(function () {
// $(".selectpicker").selectpicker();
$(".selectpicker").selectpicker({
dropupAuto: false,
});
$("#datepicker").datepicker({
format: "dd/mm/yyyy",
});
$("#calendar-icon").click(function () {
$("#datepicker").datepicker("show");
});
});
</script>
<!--end::Global Theme Bundle-->
<!--end::Page Scripts-->
</body>
<!--end::Body-->
</html>

View File

@@ -15,6 +15,13 @@ var IsLoggedIn = echojwt.WithConfig(
},
)
var IsAlreadyLogin = echojwt.WithConfig(
echojwt.Config{
SigningKey: []byte("--one_api-secret-2019-04-01"),
ErrorHandler: JWTErrorChecker,
},
)
func JWTErrorChecker(c echo.Context, err error) error {
return c.Redirect(http.StatusTemporaryRedirect, "/login")
}

View File

@@ -60,8 +60,10 @@ func main() {
handlers.SetupRoutesCorporate(app, appStore)
// SETUP ROUT CLIENT
handlers.SetupRoutesClient(app, appStore)
// SETUP ROUT DEV
handlers.SetupRoutesDev(app, appStore)
// handlers.SetupRoutesDev(app, appStore)
app.Logger.Fatal(app.Start(":5000"))
}

View File

@@ -11,7 +11,7 @@ script GenerateChart(idDiv string, udata string) {
var element = document.getElementById(idDiv);
console.log("element ",element)
if (element) {
element.style.height = "400px";
element.style.height = "450px";
element.style.width = "100%";
}
@@ -27,4 +27,73 @@ script GenerateChart(idDiv string, udata string) {
// myChart_001.setOption(option_001);
myChart[idDiv].setOption(option[idDiv]);
});
}
templ ShowChartFixed(idDiv string, udata string, width string, height string) {
<div id={ idDiv } class="mx-auto"></div>
@GenerateChartFixed(idDiv, udata, width, height)
}
script GenerateChartFixed(idDiv string, udata string, width string, height string) {
htmx.onLoad(function(elt) {
// console.log("elt ",elt)
var element = document.getElementById(idDiv);
// console.log("element ",element)
if (element) {
element.style.height = height;
element.style.width = width;
}
var myChart = {};
var option = {};
// var myChart_001 = echarts.init(document.getElementById(idDiv));
myChart[idDiv] = echarts.init(element);
// var option_001 = JSON.parse(udata);
option[idDiv] = JSON.parse(udata);
// console.log("option ", option)
// myChart_001.setOption(option_001);
myChart[idDiv].setOption(option[idDiv]);
});
}
templ ShowChartResponsiveWidth(idDiv string, udata string, height string) {
<div id={ idDiv } class="mx-auto" style="width: 100%;"></div>
@GenerateChartResponsive(idDiv, udata, height)
}
script GenerateChartResponsive(idDiv string, udata string, height string) {
htmx.onLoad(function(elt) {
// console.log("elt ",elt)
var element = document.getElementById(idDiv);
// console.log("element ",element)
if (element) {
element.style.height = height;
}
var myChart = {};
var option = {};
// var myChart_001 = echarts.init(document.getElementById(idDiv));
myChart[idDiv] = echarts.init(element);
// var option_001 = JSON.parse(udata);
option[idDiv] = JSON.parse(udata);
// console.log("option ", option)
// myChart_001.setOption(option_001);
if (option[idDiv]['series']['radius']) {
option[idDiv]['series']['radius'] = ['30%', '55%'];
} else {
option[idDiv]['series'][0]['radius'] = ['30%', '55%'];
}
myChart[idDiv].setOption(option[idDiv]);
var resizeObserver = new ResizeObserver(function() {
myChart[idDiv].resize();
});
resizeObserver.observe(element);
});
}

View File

@@ -53,13 +53,13 @@ func ShowChart(idDiv string, udata string) templ.Component {
func GenerateChart(idDiv string, udata string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_GenerateChart_4c73`,
Function: `function __templ_GenerateChart_4c73(idDiv, udata){htmx.onLoad(function(elt) {
Name: `__templ_GenerateChart_906c`,
Function: `function __templ_GenerateChart_906c(idDiv, udata){htmx.onLoad(function(elt) {
console.log("elt ",elt)
var element = document.getElementById(idDiv);
console.log("element ",element)
if (element) {
element.style.height = "400px";
element.style.height = "450px";
element.style.width = "100%";
}
@@ -76,7 +76,160 @@ func GenerateChart(idDiv string, udata string) templ.ComponentScript {
myChart[idDiv].setOption(option[idDiv]);
});
}`,
Call: templ.SafeScript(`__templ_GenerateChart_4c73`, idDiv, udata),
CallInline: templ.SafeScriptInline(`__templ_GenerateChart_4c73`, idDiv, udata),
Call: templ.SafeScript(`__templ_GenerateChart_906c`, idDiv, udata),
CallInline: templ.SafeScriptInline(`__templ_GenerateChart_906c`, idDiv, udata),
}
}
func ShowChartFixed(idDiv string, udata string, width string, height 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(idDiv)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\chart\chart.templ`, Line: 33, Col: 19}
}
_, 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("\" class=\"mx-auto\"></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = GenerateChartFixed(idDiv, udata, width, height).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)
}
return templ_7745c5c3_Err
})
}
func GenerateChartFixed(idDiv string, udata string, width string, height string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_GenerateChartFixed_c5bf`,
Function: `function __templ_GenerateChartFixed_c5bf(idDiv, udata, width, height){htmx.onLoad(function(elt) {
// console.log("elt ",elt)
var element = document.getElementById(idDiv);
// console.log("element ",element)
if (element) {
element.style.height = height;
element.style.width = width;
}
var myChart = {};
var option = {};
// var myChart_001 = echarts.init(document.getElementById(idDiv));
myChart[idDiv] = echarts.init(element);
// var option_001 = JSON.parse(udata);
option[idDiv] = JSON.parse(udata);
// console.log("option ", option)
// myChart_001.setOption(option_001);
myChart[idDiv].setOption(option[idDiv]);
});
}`,
Call: templ.SafeScript(`__templ_GenerateChartFixed_c5bf`, idDiv, udata, width, height),
CallInline: templ.SafeScriptInline(`__templ_GenerateChartFixed_c5bf`, idDiv, udata, width, height),
}
}
func ShowChartResponsiveWidth(idDiv string, udata string, height 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_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = 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_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(idDiv)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\chart\chart.templ`, Line: 62, Col: 19}
}
_, 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("\" class=\"mx-auto\" style=\"width: 100%;\"></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = GenerateChartResponsive(idDiv, udata, height).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)
}
return templ_7745c5c3_Err
})
}
func GenerateChartResponsive(idDiv string, udata string, height string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_GenerateChartResponsive_fa78`,
Function: `function __templ_GenerateChartResponsive_fa78(idDiv, udata, height){htmx.onLoad(function(elt) {
// console.log("elt ",elt)
var element = document.getElementById(idDiv);
// console.log("element ",element)
if (element) {
element.style.height = height;
}
var myChart = {};
var option = {};
// var myChart_001 = echarts.init(document.getElementById(idDiv));
myChart[idDiv] = echarts.init(element);
// var option_001 = JSON.parse(udata);
option[idDiv] = JSON.parse(udata);
// console.log("option ", option)
// myChart_001.setOption(option_001);
if (option[idDiv]['series']['radius']) {
option[idDiv]['series']['radius'] = ['30%', '55%'];
} else {
option[idDiv]['series'][0]['radius'] = ['30%', '55%'];
}
myChart[idDiv].setOption(option[idDiv]);
var resizeObserver = new ResizeObserver(function() {
myChart[idDiv].resize();
});
resizeObserver.observe(element);
});
}`,
Call: templ.SafeScript(`__templ_GenerateChartResponsive_fa78`, idDiv, udata, height),
CallInline: templ.SafeScriptInline(`__templ_GenerateChartResponsive_fa78`, idDiv, udata, height),
}
}

View File

@@ -0,0 +1,157 @@
package sidebaruserprofile
import (
"cpone/component/customtextfield"
"cpone/models"
"cpone/component/modal"
)
templ SidebarForm() {
<div>
<form
id="form-ganti-password"
class="form"
hx-post="/corp/dashboard_pic/gantipassword"
hx-target="#body-ganti-pass"
hx-swap="outerHTML"
hx-indicator=".formloading"
hx-on::before-request={ HandleFormBeforeRequest() }
hx-on::after-request={ HandleFormAfterGantiPass() }
>
@modalcomponent.Modal("modal-ganti-pass",
"Ganti Password",
ModalGantiPassword(),
ActionFormGantiPassword(),
CloseFormGantiPassword(),
)
</form>
</div>
}
templ ModalGantiPassword() {
<div id="body-ganti-pass">
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "oldPassID",
Name: "oldpassid",
Type: "password",
Placeholder: "Masukan password lama",
Label: "Password Lama",
})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "newPassID",
Name: "newpassid",
Type: "password",
Placeholder: "Masukan password baru",
Label: "Password Baru",
})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "reNewPassID",
Name: "renewpassid",
Type: "password",
Placeholder: "Masukan ulang password baru",
Label: "Ulangi Password Baru",
})
</div>
<script>
document.addEventListener('htmx:afterSwap', function(event) {
$('.selectpicker').selectpicker('refresh');
})
</script>
}
templ RetModalGantiPassword(
oldPass models.CustomTextFieldv2Prm,
newPass models.CustomTextFieldv2Prm,
renewPass models.CustomTextFieldv2Prm,
hxOnLoad templ.ComponentScript,
) {
<div id="body-ganti-pass" hx-on::load={ hxOnLoad }>
@customtextfield.CustomTextFieldv2(oldPass)
@customtextfield.CustomTextFieldv2(newPass)
@customtextfield.CustomTextFieldv2(renewPass)
</div>
<script>
document.addEventListener('htmx:afterSwap', function(event) {
$('.selectpicker').selectpicker('refresh');
})
</script>
}
templ ActionFormGantiPassword() {
<div>
<button
hx-on::after-request={ JSHideModal("#modal-ganti-pass") }
hx-post="/corp/dashboard_pic/tutupgantipassword"
hx-target="#body-ganti-pass"
hx-swap="outerHTML"
hx-indicator=".cancelloading"
type="button"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel"
data-dismiss="modal"
>
<span class="htmx-indicator spinner-border spinner-border-sm cancelloading" role="status" aria-hidden="true"></span>
Batal
</button>
<button
type="submit"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata"
>
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
Simpan
</button>
</div>
}
templ CloseFormGantiPassword() {
<button
type="button"
hx-on::after-request={ JSHideModal("#modal-ganti-pass") }
hx-post="/corp/dashboard_pic/tutupgantipassword"
hx-target="#body-ganti-pass"
hx-swap="outerHTML"
class="close btnactcancel"
data-dismiss="modal"
aria-label="Close"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}
script JSHideModal(modalID string) {
$(modalID).modal('hide')
}
script JSShowModal(modalID string) {
$(modalID).modal('show')
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].removeAttribute('disabled');
}
}
script HandleFormBeforeRequest() {
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].setAttribute('disabled', 'true');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].setAttribute('disabled', 'true');
}
}
script HandleFormAfterGantiPass() {
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].removeAttribute('disabled');
}
}

View File

@@ -0,0 +1,336 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package sidebaruserprofile
//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/component/modal"
"cpone/models"
)
func SidebarForm() 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>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleFormBeforeRequest(), HandleFormAfterGantiPass())
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form id=\"form-ganti-password\" class=\"form\" hx-post=\"/corp/dashboard_pic/gantipassword\" hx-target=\"#body-ganti-pass\" hx-swap=\"outerHTML\" hx-indicator=\".formloading\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 templ.ComponentScript = HandleFormBeforeRequest()
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 templ.ComponentScript = HandleFormAfterGantiPass()
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3.Call)
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 = modalcomponent.Modal("modal-ganti-pass",
"Ganti Password",
ModalGantiPassword(),
ActionFormGantiPassword(),
CloseFormGantiPassword(),
).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</form></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 ModalGantiPassword() 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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"body-ganti-pass\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "oldPassID",
Name: "oldpassid",
Type: "password",
Placeholder: "Masukan password lama",
Label: "Password Lama",
}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "newPassID",
Name: "newpassid",
Type: "password",
Placeholder: "Masukan password baru",
Label: "Password Baru",
}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "reNewPassID",
Name: "renewpassid",
Type: "password",
Placeholder: "Masukan ulang password baru",
Label: "Ulangi Password Baru",
}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><script>\r\n document.addEventListener('htmx:afterSwap', function(event) {\r\n $('.selectpicker').selectpicker('refresh');\r\n })\r\n </script>")
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 RetModalGantiPassword(
oldPass models.CustomTextFieldv2Prm,
newPass models.CustomTextFieldv2Prm,
renewPass models.CustomTextFieldv2Prm,
hxOnLoad templ.ComponentScript,
) 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)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"body-ganti-pass\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6.Call)
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 = customtextfield.CustomTextFieldv2(oldPass).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(newPass).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(renewPass).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><script>\r\n document.addEventListener('htmx:afterSwap', function(event) {\r\n $('.selectpicker').selectpicker('refresh');\r\n })\r\n </script>")
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 ActionFormGantiPassword() 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("<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal("#modal-ganti-pass"))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 templ.ComponentScript = JSHideModal("#modal-ganti-pass")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"/corp/dashboard_pic/tutupgantipassword\" hx-target=\"#body-ganti-pass\" hx-swap=\"outerHTML\" hx-indicator=\".cancelloading\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel\" data-dismiss=\"modal\"><span class=\"htmx-indicator spinner-border spinner-border-sm cancelloading\" role=\"status\" aria-hidden=\"true\"></span> Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata\"><span class=\"htmx-indicator spinner-border spinner-border-sm formloading\" role=\"status\" aria-hidden=\"true\"></span> Simpan\r</button></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 CloseFormGantiPassword() 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_Var9 := templ.GetChildren(ctx)
if templ_7745c5c3_Var9 == nil {
templ_7745c5c3_Var9 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal("#modal-ganti-pass"))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button type=\"button\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 templ.ComponentScript = JSHideModal("#modal-ganti-pass")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"/corp/dashboard_pic/tutupgantipassword\" hx-target=\"#body-ganti-pass\" hx-swap=\"outerHTML\" class=\"close btnactcancel\" data-dismiss=\"modal\" aria-label=\"Close\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
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 JSHideModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JSHideModal_4530`,
Function: `function __templ_JSHideModal_4530(modalID){$(modalID).modal('hide')
}`,
Call: templ.SafeScript(`__templ_JSHideModal_4530`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JSHideModal_4530`, modalID),
}
}
func JSShowModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JSShowModal_658d`,
Function: `function __templ_JSShowModal_658d(modalID){$(modalID).modal('show')
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_JSShowModal_658d`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JSShowModal_658d`, modalID),
}
}
func HandleFormBeforeRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormBeforeRequest_7bdf`,
Function: `function __templ_HandleFormBeforeRequest_7bdf(){const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].setAttribute('disabled', 'true');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].setAttribute('disabled', 'true');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_7bdf`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_7bdf`),
}
}
func HandleFormAfterGantiPass() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormAfterGantiPass_cc6f`,
Function: `function __templ_HandleFormAfterGantiPass_cc6f(){const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormAfterGantiPass_cc6f`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterGantiPass_cc6f`),
}
}

View File

@@ -22,26 +22,35 @@ templ Navbaruserprofile(dataUser models.User) {
<!--end::Header-->
<!--begin::Separator-->
<div class="separator separator-dashed my-7"></div>
<!--end::Separator-->
<!--begin::Notifications-->
// <div>
// <!--begin:Heading-->
// <h5 class="mb-5">
// Recent Notifications
// </h5>
// <!--end:Heading-->
// <!--begin::Item-->
// @NotificationCard()
// <!--end::Item-->
// </div>
<!--end::Notifications-->
<div class="navi mt-2">
<a
class="btn btn-sm btn-light-primary font-weight-bolder py-2 px-5 block"
style="width: 100%"
data-toggle="modal"
data-target="#modal-ganti-pass"
>
Change Password
</a>
</div>
<div class="navi mt-2">
<a
class="btn btn-sm btn-light-primary font-weight-bolder py-2 px-5 block"
hx-get="/login/signout"
hx-indicator=".logoutloading"
style="width: 100%"
>
<span class="htmx-indicator spinner-border spinner-border-sm logoutloading" role="status" aria-hidden="true"></span>
Sign Out
</a>
</div>
</div>
<!--end::Content-->
</div>
@SidebarForm()
}
templ ProfileHeader(dataUser models.User) {
<div class="d-flex align-items-center mt-5">
<div class="d-flex mt-5">
<div class="symbol symbol-100 mr-5 p-2 bg-primary-transparent">
// <div class="symbol-label" style="background-image:url('/assets/media/users/300_21.jpg')"></div>
// <i class="symbol-badge bg-success"></i>
@@ -54,14 +63,6 @@ templ ProfileHeader(dataUser models.User) {
<div class="text-muted mt-1">
{ dataUser.UserPosition }
</div>
<div class="navi mt-2">
<a
class="btn btn-sm btn-light-primary font-weight-bolder py-2 px-5"
hx-get="/login/signout"
>
Sign Out
</a>
</div>
</div>
</div>
}

View File

@@ -33,7 +33,11 @@ func Navbaruserprofile(dataUser models.User) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--end::Header--><!--begin::Separator--><div class=\"separator separator-dashed my-7\"></div><!--end::Separator--><!--begin::Notifications--><!--end::Notifications--></div><!--end::Content--></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--end::Header--><!--begin::Separator--><div class=\"separator separator-dashed my-7\"></div><div class=\"navi mt-2\"><a class=\"btn btn-sm btn-light-primary font-weight-bolder py-2 px-5 block\" style=\"width: 100%\" data-toggle=\"modal\" data-target=\"#modal-ganti-pass\">Change Password\r</a></div><div class=\"navi mt-2\"><a class=\"btn btn-sm btn-light-primary font-weight-bolder py-2 px-5 block\" hx-get=\"/login/signout\" hx-indicator=\".logoutloading\" style=\"width: 100%\"><span class=\"htmx-indicator spinner-border spinner-border-sm logoutloading\" role=\"status\" aria-hidden=\"true\"></span> Sign Out\r</a></div></div><!--end::Content--></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = SidebarForm().Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -57,14 +61,14 @@ func ProfileHeader(dataUser models.User) templ.Component {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex align-items-center mt-5\"><div class=\"symbol symbol-100 mr-5 p-2 bg-primary-transparent\"><span class=\"iconify symbol-label bg-primary-transparent text-primary\" data-icon=\"gravity-ui:person\"></span></div><div class=\"d-flex flex-column\"><a href=\"#\" class=\"font-weight-bold font-size-h5 text-dark-75 text-hover-primary\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex mt-5\"><div class=\"symbol symbol-100 mr-5 p-2 bg-primary-transparent\"><span class=\"iconify symbol-label bg-primary-transparent text-primary\" data-icon=\"gravity-ui:person\"></span></div><div class=\"d-flex flex-column\"><a href=\"#\" class=\"font-weight-bold font-size-h5 text-dark-75 text-hover-primary\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.UserFullName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\sidebar_user_profile\sidebar_user_profile.templ`, Line: 52, Col: 27}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\sidebar_user_profile\sidebar_user_profile.templ`, Line: 61, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
@@ -77,13 +81,13 @@ func ProfileHeader(dataUser models.User) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.UserPosition)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\sidebar_user_profile\sidebar_user_profile.templ`, Line: 55, Col: 27}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\sidebar_user_profile\sidebar_user_profile.templ`, Line: 64, Col: 27}
}
_, 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("</div><div class=\"navi mt-2\"><a class=\"btn btn-sm btn-light-primary font-weight-bolder py-2 px-5\" hx-get=\"/login/signout\">Sign Out\r</a></div></div></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -41,7 +41,7 @@ templ CustomToastV2Show(title string, message string, typeToast string) {
aria-atomic="true"
id="notification-001"
hx-swap-oob="true"
hx-get="/dev/hidetoast"
hx-get="/home/hidetoast"
hx-trigger="load delay:3s"
hx-target="this"
style="border-radius: 8px 8px 8px 8px;"

View File

@@ -56,7 +56,7 @@ func CustomToastV2Show(title string, message string, typeToast string) templ.Com
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"toast toast-top-right fade show\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" id=\"notification-001\" hx-swap-oob=\"true\" hx-get=\"/dev/hidetoast\" hx-trigger=\"load delay:3s\" hx-target=\"this\" style=\"border-radius: 8px 8px 8px 8px;\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"toast toast-top-right fade show\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" id=\"notification-001\" hx-swap-oob=\"true\" hx-get=\"/home/hidetoast\" hx-trigger=\"load delay:3s\" hx-target=\"this\" style=\"border-radius: 8px 8px 8px 8px;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -0,0 +1,156 @@
package corporate_handlers
import (
sidebaruserprofile "cpone/component/sidebar_user_profile"
customtoastv2 "cpone/component/toastbootstrap"
"cpone/models"
"cpone/utils"
"net/http"
"strings"
"time"
"github.com/a-h/templ"
"github.com/golang-jwt/jwt/v5"
"github.com/labstack/echo/v4"
)
type AccountService interface {
ChangePasswordPIC(host string, token string, currPassword string, newPassword string) (models.ResponseStatus, error)
ChangePasswordPAT(token string, currPassword string, newPassword string) (models.ResponseStatus, error)
}
func NewAccountHandler(as AccountService) *AccountHandler {
return &AccountHandler{
AccountService: as,
}
}
type AccountHandler struct {
AccountService AccountService
}
func (as *AccountHandler) HandleChangePassword(c echo.Context) error {
var response models.ResponseStatus
userToken := c.Get("user").(*jwt.Token)
token := userToken.Raw
claims := userToken.Claims.(jwt.MapClaims)
userGroup := claims["M_UserGroupDashboard"].(string)
h := c.Request().Host
old_pass := c.FormValue("oldpassid")
new_pass := c.FormValue("newpassid")
re_new_pass := c.FormValue("renewpassid")
// logger.Info("params", zap.Any("old", old_pass), zap.Any("new", new_pass), zap.Any("re-new", re_new_pass))
old_validation := ""
new_validation := ""
renew_validation := ""
errorPop := ""
if strings.TrimSpace(old_pass) == "" {
old_validation = "Tidak boleh kosong"
errorPop = "Tidak boleh kosong"
}
if strings.TrimSpace(new_pass) == "" {
new_validation = "Tidak boleh kosong"
errorPop = "Tidak boleh kosong"
}
if strings.TrimSpace(re_new_pass) == "" {
renew_validation = "Tidak boleh kosong"
errorPop = "Tidak boleh kosong"
}
if strings.TrimSpace(new_pass) != strings.TrimSpace(re_new_pass) {
new_validation = "Password tidak sama"
renew_validation = "Password tidak sama"
errorPop = "Password tidak sama"
}
if old_validation != "" || new_validation != "" || renew_validation != "" {
newBody := sidebaruserprofile.RetModalGantiPassword(
models.CustomTextFieldv2Prm{
ID: "oldPassID",
Name: "oldpassid",
Type: "password",
Placeholder: "Masukan password lama",
Label: "Password Lama",
ErrorMsg: old_validation,
},
models.CustomTextFieldv2Prm{
ID: "newPassID",
Name: "newpassid",
Type: "password",
Placeholder: "Masukan password baru",
Label: "Password Baru",
ErrorMsg: new_validation,
},
models.CustomTextFieldv2Prm{
ID: "reNewPassID",
Name: "renewpassid",
Type: "password",
Placeholder: "Masukan ulang password baru",
Label: "Ulangi Password Baru",
ErrorMsg: renew_validation,
},
sidebaruserprofile.JSHideModal(""),
)
toast := customtoastv2.CustomToastV2Show("Warning", errorPop, "warning")
return utils.ViewMulti(c, []templ.Component{toast, newBody})
}
if userGroup == "pic" {
resp, err := as.AccountService.ChangePasswordPIC(h, token, old_pass, new_pass)
if err != nil {
newBody := sidebaruserprofile.ModalGantiPassword()
toast := customtoastv2.CustomToastV2Show("Warning", err.Error(), "warning")
return utils.ViewMulti(c, []templ.Component{toast, newBody})
}
response = resp
}
if userGroup == "patient" {
resp, err := as.AccountService.ChangePasswordPAT(token, old_pass, new_pass)
if err != nil {
newBody := sidebaruserprofile.ModalGantiPassword()
toast := customtoastv2.CustomToastV2Show("Warning", "Error ganti password pat", "warning")
return utils.ViewMulti(c, []templ.Component{toast, newBody})
}
response = resp
}
if response.Status == "ERR" {
newBody := sidebaruserprofile.ModalGantiPassword()
toast := customtoastv2.CustomToastV2Show("Warning", response.Message, "warning")
return utils.ViewMulti(c, []templ.Component{toast, newBody})
}
expire := time.Now().Add(-7 * 24 * time.Hour)
cookie := new(http.Cookie)
cookie.Name = "token"
cookie.Value = ""
cookie.Path = "/"
cookie.Expires = expire
cookie.HttpOnly = true
c.SetCookie(cookie)
ret := `
<script>
$("#body-ganti-pass").modal('hide')
console.log("signout")
localStorage.removeItem("token")
localStorage.removeItem("user")
setTimeout(() => {
window.location.replace("/login");
}, 200)
</script>
`
c.Response().Header().Set("HX-Trigger", "script")
return c.String(http.StatusOK, ret)
}
func (as *AccountHandler) HandleCloseChangePassword(c echo.Context) error {
newBody := sidebaruserprofile.ModalGantiPassword()
return utils.View(c, newBody)
}

View File

@@ -19,8 +19,9 @@ import (
type DashboardPicServices interface {
GetEmployeeAnalyticBreadcrumb(title string) (models.BreadCrumbV1, error)
GetCorporateName(userID string) (string, error)
DummyDataTest() ([]models.DashboardPic, error)
ListingDashboardPic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.DashboardPic, int, error)
ListingDashboardPic(email string, search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.DashboardPic, int, error)
}
type DashboardPicHandler struct {
@@ -35,19 +36,28 @@ func NewDashboardPicHandler(ea DashboardPicServices) *DashboardPicHandler {
func (ea *DashboardPicHandler) HandleShowEmployeeAnalyticScreen(c echo.Context) error {
logger, _ := zap.NewProduction()
title := "PT. ABC"
listID := utils.GenerateRandomID("listid")
paginationID := utils.GenerateRandomID("paginationid")
userCok := c.Get("user").(*jwt.Token)
claims := userCok.Claims.(jwt.MapClaims)
userID := claims["M_UserID"].(string)
name := claims["M_StaffName"].(string)
position := claims["M_UserGroupDashboard"].(string)
logger.Info("jwt", zap.Any("name", name))
email := claims["M_UserEmail"].(string)
title, err := ea.DashboardPicServices.GetCorporateName(userID)
if err != nil {
defer logger.Sync()
logger.Info("error get corporate name", zap.Any("error", err))
return err
}
convr, _ := strconv.Atoi(userID)
user := models.User{
UserID: 1,
UserID: convr,
Username: name,
UserFullName: name,
UserPosition: position,
@@ -65,7 +75,7 @@ func (ea *DashboardPicHandler) HandleShowEmployeeAnalyticScreen(c echo.Context)
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
listingData, totalPage, err := ea.DashboardPicServices.ListingDashboardPic("", "", "", 1, 10)
listingData, totalPage, err := ea.DashboardPicServices.ListingDashboardPic(email, "", "", "", 1, 10)
if err != nil {
defer logger.Sync()
logger.Info("Error get listing data", zap.Any("error", err), zap.Any("total", totalPage))
@@ -119,6 +129,10 @@ func (ea *DashboardPicHandler) HandlePagination(c echo.Context) error {
startdate := c.QueryParam("startdate")
enddate := c.QueryParam("enddate")
userCok := c.Get("user").(*jwt.Token)
claims := userCok.Claims.(jwt.MapClaims)
email := claims["M_UserEmail"].(string)
var retVal []templ.Component
logger, _ := zap.NewProduction()
page, err := strconv.Atoi(pageparam)
@@ -128,7 +142,7 @@ func (ea *DashboardPicHandler) HandlePagination(c echo.Context) error {
return err
}
listdata, totalPage, err := ea.DashboardPicServices.ListingDashboardPic(search, startdate, enddate, page, 10)
listdata, totalPage, err := ea.DashboardPicServices.ListingDashboardPic(email, search, startdate, enddate, page, 10)
if err != nil {
defer logger.Sync()
logger.Info("Error convert page param")
@@ -162,7 +176,11 @@ func (ea *DashboardPicHandler) HandleFilter(c echo.Context) error {
listID := c.QueryParam("listID")
paginationID := c.QueryParam("paginationID")
dataList, totalPage, err := ea.DashboardPicServices.ListingDashboardPic(search, startdate, enddate, 1, 5)
userCok := c.Get("user").(*jwt.Token)
claims := userCok.Claims.(jwt.MapClaims)
email := claims["M_UserEmail"].(string)
dataList, totalPage, err := ea.DashboardPicServices.ListingDashboardPic(email, search, startdate, enddate, 1, 10)
if err != nil {
defer logger.Sync()
logger.Info("Error Get Listing Data", zap.Any("error", err))

View File

@@ -7,7 +7,7 @@ import (
"cpone/models"
"cpone/utils"
corporate_mcudetail "cpone/views/corporate/mcu"
corporate_tabmcudetail "cpone/views/corporate/mcu/mcutab"
corporate_kesimpulan "cpone/views/corporate/mcu/mcutab/kesimpulan"
"github.com/golang-jwt/jwt/v5"
"github.com/labstack/echo/v4"
@@ -16,6 +16,7 @@ import (
type McuDetailServices interface {
GetBreadcrumb(id string) (models.BreadCrumbV1, error)
GetTabNameList(id string) ([]models.McuTabModels, error)
}
type McuDetailHandler struct {
@@ -38,7 +39,7 @@ func (mcud *McuDetailHandler) HandlerShowMcuDetailScreen(c echo.Context) error {
claims := userCok.Claims.(jwt.MapClaims)
name := claims["M_StaffName"].(string)
position := claims["M_UserGroupDashboard"].(string)
logger.Info("jwt", zap.Any("name", name))
// logger.Info("jwt", zap.Any("name", name))
user := models.User{
UserID: 1,
@@ -58,12 +59,20 @@ func (mcud *McuDetailHandler) HandlerShowMcuDetailScreen(c echo.Context) error {
navbaruser := navbarmenu.NavbarWithLogo(user)
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
// test := []models.McuTabModels{}
// tabname, err := mcud.McuDetailServices.GetTabNameList(id)
// if err != nil {
// return err
// }
// logger.Info("List tab name", zap.Any("tav", tabname))
content := corporate_mcudetail.McuDetailScreen(
breadcrumb,
corporate_mcudetail.TabViewMcuDetail(id),
// corporate_mcudetail.McuDetailTabView(id, tabname),
)
css := corporate_mcudetail.CSSMcuDetail(
corporate_tabmcudetail.CssKesimpulan(),
corporate_kesimpulan.CSSKesimpulan(),
)
js := corporate_mcudetail.JSMcuDetail()

View File

@@ -0,0 +1,748 @@
package mcu_corporate_handlers
import (
"cpone/component/pagination"
customtoastv2 "cpone/component/toastbootstrap"
"cpone/models"
"cpone/utils"
corporate_daftarpeserta "cpone/views/corporate/mcu/mcutab/daftarpeserta"
"strconv"
"strings"
"github.com/a-h/templ"
"github.com/golang-jwt/jwt/v5"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
type TabDaftarPesertaServices interface {
SearchDaftarPesertaMCU(mcuID string, keyword string, page int, perPage int) ([]models.ModelMcuDaftarPeserta, int, error)
GenerataPasswordMCU(mgmMCUID string, host string) (models.GeneratePasswordResponse, error)
GetAkunPeserta(patientID string) (models.AuthPatient, error)
GetListReportPesertaV4(orderheaderID string, staffname string) ([]models.TabViewReportMcu, error)
GetListReportPesertaV5(orderheaderID string, mcuid string, staffname string) ([]models.TabViewReportMcu, error)
ResetPasswordPeserta(token string, newPassword string, email string, authuserid string) (models.ResponseStatus, error)
DetailTestdanPaket(orderheaderID string) ([]models.TableTestPaket, error)
GetListAttachmentFile(orderheaderID string) ([]models.AttachmentFIle, error)
}
type TabDaftarPesertaHandlers struct {
TabDaftarPesertaServices TabDaftarPesertaServices
}
func NewTabDaftarPesertaHandlers(tdp TabDaftarPesertaServices) *TabDaftarPesertaHandlers {
return &TabDaftarPesertaHandlers{TabDaftarPesertaServices: tdp}
}
func (tdp *TabDaftarPesertaHandlers) HandleShowTabDaftarPeserta(c echo.Context) error {
logger, _ := zap.NewProduction()
table_id := utils.GenerateRandomID("table-id")
pagination_id := utils.GenerateRandomID("pagination-id")
dialog_rpt_id := utils.GenerateRandomID("dialog-rpt-id")
dialog_rptbody_id := utils.GenerateRandomID("dialog-rptbody-id")
dialog_akun_id := utils.GenerateRandomID("dialog-akun-id")
dialog_akunbody_id := utils.GenerateRandomID("dialog-akunbody-id")
dialog_password_id := utils.GenerateRandomID("dialog-password-id")
dialog_passbody_id := utils.GenerateRandomID("dialog-passbody-id")
dialog_attach_id := utils.GenerateRandomID("dialog-attach-id")
dialog_attachbody_id := utils.GenerateRandomID("dialog-attachbody-id")
dialog_paket_id := utils.GenerateRandomID("dialog-paket-id")
dialog_paketbody_id := utils.GenerateRandomID("dialog-paketbody-id")
id := c.Param("id")
logger.Info("mgm_mcu", zap.Any("id", id))
data_peserta, total_peserta, err := tdp.TabDaftarPesertaServices.SearchDaftarPesertaMCU(id, "", 1, 10)
if err != nil {
return err
}
hxinclude := "#search-daftar-peserta, #table-id, #pagination-id, #dialog-rpt-id, #dialog-rptbody-id, #dialog-akun-id, #dialog-akunbody-id, #dialog-password-id, #dialog-passbody-id, #dialog-attach-id, #dialog-attachbody-id, #dialog-paket-id, #dialog-paketbody-id"
table := corporate_daftarpeserta.Table_DaftarPeserta(
data_peserta, table_id,
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openreport",
"#"+dialog_rptbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/opendetail",
"#"+dialog_paketbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openviewakun",
"#"+dialog_akunbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openattachment",
"#"+dialog_attachbody_id, hxinclude, "outerHTML",
)
page := pagination.PaginationV3(
total_peserta, 1, "/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/changepage", pagination_id,
"#search-daftar-peserta, #loading-parent, #loading-child, #loading-spinner, #loadingcontent"+hxinclude,
"#content-dp", "outerHTML", "", "", corporate_daftarpeserta.BeforeRequestContent(), corporate_daftarpeserta.AfterRequestContent(),
)
dp_layout := corporate_daftarpeserta.Content(table, page)
filtercomp := corporate_daftarpeserta.Filter_DaftarPeserta(
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/filter",
"#content-dp",
"#search-daftar-peserta, #loading-parent, #loading-child, #loading-spinner, #loadingcontent"+hxinclude,
"outerHTML", "input changed delay:500ms", corporate_daftarpeserta.BeforeRequestContent(), corporate_daftarpeserta.AfterRequestContent(),
)
// dialog rpt peserta
l_rpt := []models.TabViewReportMcu{}
t_rpt := corporate_daftarpeserta.Tab_RPT(l_rpt)
body_rpt := corporate_daftarpeserta.Body_RPT(dialog_rptbody_id, t_rpt, corporate_daftarpeserta.JSShowModal(""))
close_rpt := corporate_daftarpeserta.Close_Modal("#" + dialog_rpt_id)
aksi_rpt := corporate_daftarpeserta.Aksi_Modal("", "", "", "", true)
dialog_rpt := corporate_daftarpeserta.Dialog_DaftarPeserta(
"rptform", "xl",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialogreport",
"#"+dialog_rptbody_id, "outerHTML", hxinclude, dialog_rpt_id,
"Daftar RPT", body_rpt, close_rpt, aksi_rpt,
)
// dialog generate password peserta
text := "Apakah anda yakin untuk me-generate password untuk seluruh peserta"
body_genpass := corporate_daftarpeserta.Body_GenPass(dialog_passbody_id, text, corporate_daftarpeserta.JSShowModal(""))
close_genpass := corporate_daftarpeserta.Close_Modal("#" + dialog_password_id)
aksi_genpass := corporate_daftarpeserta.Aksi_Modal(
"#"+dialog_password_id,
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closegenpass",
"#"+dialog_passbody_id, "outerHTML", false,
)
dialog_genpass := corporate_daftarpeserta.Dialog_DaftarPeserta(
"genpassform", "",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialoggenpass",
"#"+dialog_passbody_id, "outerHTML", hxinclude,
dialog_password_id, "Generate Passsword Akun Peserta",
body_genpass, close_genpass, aksi_genpass,
)
// dialog reset akun peserta
body_acc := corporate_daftarpeserta.Body_Account(
dialog_akunbody_id,
models.CustomTextFieldv2Prm{
Label: "ID Akun Peserta",
Name: "akunpesertaid",
Type: "hidden",
ID: "akunpesertaidid",
},
models.CustomTextFieldv2Prm{
Label: "Email",
Name: "akunpesertaemail",
Type: "text",
ID: "akunpesertaemailid",
},
models.CustomTextFieldv2Prm{
Label: "Password baru",
Name: "akunpesertapassnew",
Type: "password",
ID: "akunpesertapassnewid",
},
models.CustomTextFieldv2Prm{
Label: "Ulangi password baru",
Name: "akunpesertapasscek",
Type: "password",
ID: "akunpesertapasscekid",
},
corporate_daftarpeserta.JSShowModal(""),
)
close_acc := corporate_daftarpeserta.Close_Modal("#" + dialog_akun_id)
aksi_acc := corporate_daftarpeserta.Aksi_Modal(
"#"+dialog_akun_id,
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closeviewakun",
"#"+dialog_akunbody_id, "outerHTML", false,
)
dialog_acc := corporate_daftarpeserta.Dialog_DaftarPeserta(
"akunform", "",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/viewakun",
"#"+dialog_akunbody_id, "outerHTML", hxinclude,
dialog_akun_id, "Reset Password Akun Peserta", body_acc, close_acc, aksi_acc,
)
// dialog detail paket dan test peserta
l_detail, err := tdp.TabDaftarPesertaServices.DetailTestdanPaket("")
if err != nil {
return err
}
t_detail := corporate_daftarpeserta.Table_DetailPaket(l_detail)
body_paket := corporate_daftarpeserta.Body_Detail(dialog_paketbody_id, t_detail, corporate_daftarpeserta.JSShowModal(""))
close_paket := corporate_daftarpeserta.Close_Modal("#" + dialog_paket_id)
aksi_paket := corporate_daftarpeserta.Aksi_Modal(
"#"+dialog_paket_id,
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closedetail",
"#"+dialog_paketbody_id, "outerHTML", true,
)
dialog_paket := corporate_daftarpeserta.Dialog_DaftarPeserta(
"detailpaketform", "xl",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialogdetail",
"#"+dialog_paketbody_id, "outerHTML", hxinclude,
dialog_paket_id, "Detail Pemeriksaan", body_paket, close_paket, aksi_paket,
)
// dialog file attachment peserta
l_file, err := tdp.TabDaftarPesertaServices.GetListAttachmentFile("")
if err != nil {
return err
}
t_file := corporate_daftarpeserta.Tab_Attachment(l_file)
body_file := corporate_daftarpeserta.Body_Attachment(dialog_attachbody_id, t_file, corporate_daftarpeserta.JSShowModal(""))
close_file := corporate_daftarpeserta.Close_Modal("#" + dialog_attach_id)
aksi_file := corporate_daftarpeserta.Aksi_Modal(
"#"+dialog_attach_id,
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closeattachment",
"#"+dialog_attachbody_id, "outerHTML", true,
)
dialog_file := corporate_daftarpeserta.Dialog_DaftarPeserta(
"attachmentform", "xl",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialogattachment",
"#"+dialog_attachbody_id, "outerHTML", hxinclude,
dialog_attach_id, "Detail Attachment", body_file, close_file, aksi_file,
)
tabdaftarpeserta := corporate_daftarpeserta.DaftarPesertaScreen(
table_id,
pagination_id,
dialog_rpt_id,
dialog_rptbody_id,
dialog_rpt,
dialog_akun_id,
dialog_akunbody_id,
dialog_acc,
dialog_password_id,
dialog_passbody_id,
dialog_genpass,
dialog_paket_id,
dialog_paketbody_id,
dialog_paket,
dialog_attach_id,
dialog_attachbody_id,
dialog_file,
dp_layout,
filtercomp,
)
return utils.View(c, tabdaftarpeserta)
}
func (tdp *TabDaftarPesertaHandlers) HandlePagination(c echo.Context) error {
pageparam := c.QueryParam("page")
table_id := c.QueryParam("table-id")
pagination_id := c.QueryParam("pagination-id")
keyword := c.QueryParam("searchdp")
mcu_id := c.Param("id")
dialog_rptbody_id := c.QueryParam("dialog-rptbody-id")
dialog_paketbody_id := c.QueryParam("dialog-paketbody-id")
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
dialog_attachbody_id := c.QueryParam("dialog-attachbody-id")
page, err := strconv.Atoi(pageparam)
if err != nil {
return err
}
peserta, total, err := tdp.TabDaftarPesertaServices.SearchDaftarPesertaMCU(mcu_id, keyword, page, 10)
if err != nil {
return err
}
hxinclude := "#search-daftar-peserta, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #table-id, #pagination-id, #dialog-rpt-id, #dialog-rptbody-id, #dialog-akun-id, #dialog-akunbody-id, #dialog-password-id, #dialog-passbody-id, #dialog-attach-id, #dialog-attachbody-id, #dialog-paket-id, #dialog-paketbody-id"
table := corporate_daftarpeserta.Table_DaftarPeserta(
peserta, table_id,
"/corp/dashboard_pic/detail/"+mcu_id+"/tabdaftarpeserta/openreport",
"#"+dialog_rptbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+mcu_id+"/tabdaftarpeserta/opendetail",
"#"+dialog_paketbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+mcu_id+"/tabdaftarpeserta/openviewakun",
"#"+dialog_akunbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+mcu_id+"/tabdaftarpeserta/openattachment",
"#"+dialog_attachbody_id, hxinclude, "outerHTML",
)
paginat := pagination.PaginationV3(
total, page, "/corp/dashboard_pic/detail/"+mcu_id+"/tabdaftarpeserta/changepage", pagination_id,
hxinclude, "#content-dp", "outerHTML", "", "", corporate_daftarpeserta.BeforeRequestContent(), corporate_daftarpeserta.AfterRequestContent(),
)
layout := corporate_daftarpeserta.Content(table, paginat)
return utils.View(c, layout)
}
func (tdp *TabDaftarPesertaHandlers) HandleFilter(c echo.Context) error {
keyword := c.QueryParam("searchdp")
mcuid := c.Param("id")
table_id := c.QueryParam("table-id")
paginat_id := c.QueryParam("pagination-id")
dialog_rptbody_id := c.QueryParam("dialog-rptbody-id")
dialog_paketbody_id := c.QueryParam("dialog-paketbody-id")
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
dialog_attachbody_id := c.QueryParam("dialog-attachbody-id")
peserta, total, err := tdp.TabDaftarPesertaServices.SearchDaftarPesertaMCU(mcuid, keyword, 1, 10)
if err != nil {
return err
}
hxinclude := "#search-daftar-peserta, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #table-id, #pagination-id, #dialog-rpt-id, #dialog-rptbody-id, #dialog-akun-id, #dialog-akunbody-id, #dialog-password-id, #dialog-passbody-id, #dialog-attach-id, #dialog-attachbody-id, #dialog-paket-id, #dialog-paketbody-id"
table := corporate_daftarpeserta.Table_DaftarPeserta(
peserta, table_id,
"/corp/dashboard_pic/detail/"+mcuid+"/tabdaftarpeserta/openreport",
"#"+dialog_rptbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+mcuid+"/tabdaftarpeserta/opendetail",
"#"+dialog_paketbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+mcuid+"/tabdaftarpeserta/openviewakun",
"#"+dialog_akunbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+mcuid+"/tabdaftarpeserta/openattachment",
"#"+dialog_attachbody_id, hxinclude, "outerHTML",
)
paginat := pagination.PaginationV3(
total, 1, "/corp/dashboard_pic/detail/"+mcuid+"/tabdaftarpeserta/changepage", paginat_id,
hxinclude, "#content-dp", "outerHTML", "", "", corporate_daftarpeserta.BeforeRequestContent(), corporate_daftarpeserta.AfterRequestContent(),
)
content := corporate_daftarpeserta.Content(table, paginat)
return utils.View(c, content)
}
func (tdp *TabDaftarPesertaHandlers) HandleOpenReportDialog(c echo.Context) error {
logger, _ := zap.NewProduction()
user_token := c.Get("user").(*jwt.Token)
claims := user_token.Claims.(jwt.MapClaims)
staffname := claims["M_StaffName"].(string)
mcuid := c.Param("id")
orderheaderid := c.QueryParam("idx")
dialog_rpt_id := c.QueryParam("dialog-rpt-id")
dialog_rptbody_id := c.QueryParam("dialog-rptbody-id")
logger.Info("show rpt by: ", zap.Any("orderheaderid", orderheaderid))
// rpt_dialog, err := tdp.TabDaftarPesertaServices.GetListReportPesertaV4(orderheaderid, staffname)
rpt_dialog, err := tdp.TabDaftarPesertaServices.GetListReportPesertaV5(orderheaderid, mcuid, staffname)
if err != nil {
logger.Error("Error get rpt", zap.Any("error: ", err))
tab := corporate_daftarpeserta.Tab_RPT([]models.TabViewReportMcu{})
mod := corporate_daftarpeserta.Body_RPT(dialog_rptbody_id, tab, corporate_daftarpeserta.JSShowModal("#"+dialog_rpt_id))
return utils.View(c, mod)
}
comp := corporate_daftarpeserta.Tab_RPT(rpt_dialog)
body := corporate_daftarpeserta.Body_RPT(dialog_rptbody_id, comp, corporate_daftarpeserta.JSShowModal("#"+dialog_rpt_id))
return utils.View(c, body)
}
func (tdp *TabDaftarPesertaHandlers) HandleDialogGenPass(c echo.Context) error {
id := c.Param("id")
dialog_rpt_id := c.QueryParam("dialog-rpt-id")
dialog_rptbody_id := c.QueryParam("dialog-rptbody-id")
dialog_paket_id := c.QueryParam("dialog-paket-id")
dialog_paketbody_id := c.QueryParam("dialog-paketbody-id")
dialog_akun_id := c.QueryParam("dialog-akun-id")
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
dialog_attach_id := c.QueryParam("dialog-attach-id")
dialog_attachbody_id := c.QueryParam("dialog-attachbody-id")
dialog_password_id := c.FormValue("dialog-password-id")
dialog_passbody_id := c.FormValue("dialog-passbody-id")
table_id := c.FormValue("table-id")
paginat_id := c.FormValue("pagination-id")
pageparam := c.FormValue("currpage" + paginat_id)
msg := "Apakah anda yakin untuk me-generate password untuk seluruh peserta"
resp, err := tdp.TabDaftarPesertaServices.GenerataPasswordMCU(id, "")
if err != nil {
body_pass := corporate_daftarpeserta.Body_GenPass(dialog_passbody_id, msg, corporate_daftarpeserta.JSShowModal(""))
toast := customtoastv2.CustomToastV2Show("Warning", "Gagal generate password peserta", "warning")
ret := []templ.Component{toast, body_pass}
return utils.ViewMulti(c, ret)
}
if resp.Status != "OK" {
body_pass := corporate_daftarpeserta.Body_GenPass(dialog_passbody_id, msg, corporate_daftarpeserta.JSShowModal(""))
toast := customtoastv2.CustomToastV2Show("Warning", "Gagal generate password peserta", "warning")
ret := []templ.Component{toast, body_pass}
return utils.ViewMulti(c, ret)
}
aa := "/corp/dashboard_pic/detail/" + id + "/tabdaftarpeserta/reload?page=" + pageparam
bb := "&table-id=" + table_id
cc := "&pagination-id=" + paginat_id
dd := "&dialog-rpt-id=" + dialog_rpt_id
ee := "&dialog-rptbody-id=" + dialog_rptbody_id
ff := "&dialog-password-id=" + dialog_password_id
gg := "&dialog-passbody-id=" + dialog_passbody_id
hh := "&dialog-akun-id=" + dialog_akun_id
ii := "&dialog-akunbody-id=" + dialog_akunbody_id
jj := "&dialog-attach-id=" + dialog_attach_id + "&dialog-attachbody-id=" + dialog_attachbody_id
kk := "&dialog-paket-id=" + dialog_paket_id + "&dialog-paketbody-id" + dialog_paketbody_id
ll := "&currpage" + paginat_id + "=" + pageparam
link := aa + bb + cc + dd + ee + ff + gg + hh + ii + jj + kk + ll
body_pass := corporate_daftarpeserta.Body_GenPass(dialog_passbody_id, msg, corporate_daftarpeserta.JSGenPassReload("#"+dialog_password_id, link))
msg = "Success generate password.\n" + resp.Message + " password, telah dikirim melalui email peserta"
toastt := customtoastv2.CustomToastV2Show("Success", msg, "success")
ret := []templ.Component{toastt, body_pass}
return utils.ViewMulti(c, ret)
}
func (tdp *TabDaftarPesertaHandlers) HandleCloseDialogGenPass(c echo.Context) error {
dialog_password_id := c.FormValue("dialog-password-id")
dialog_passbody_id := c.FormValue("dialog-passbody-id")
msg := "Apakah anda yakin untuk me-generate password untuk seluruh peserta"
body_pass := corporate_daftarpeserta.Body_GenPass(dialog_passbody_id, msg, corporate_daftarpeserta.JSHideModal("#"+dialog_password_id))
return utils.View(c, body_pass)
}
func (tdp *TabDaftarPesertaHandlers) HandleContentReload(c echo.Context) error {
id := c.Param("id")
keyword := c.FormValue("searchdp")
dialog_rptbody_id := c.QueryParam("dialog-rptbody-id")
dialog_paketbody_id := c.QueryParam("dialog-paketbody-id")
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
dialog_attachbody_id := c.QueryParam("dialog-attachbody-id")
table_id := c.FormValue("table-id")
pagination_id := c.FormValue("pagination-id")
pageparam := c.FormValue("currpage" + pagination_id)
currpage, err := strconv.Atoi(pageparam)
if err != nil {
return err
}
peserta, total, err := tdp.TabDaftarPesertaServices.SearchDaftarPesertaMCU(id, keyword, currpage, 10)
if err != nil {
return err
}
hxinclude := "#search-daftar-peserta, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #table-id, #pagination-id, #dialog-rpt-id, #dialog-rptbody-id, #dialog-akun-id, #dialog-akunbody-id, #dialog-password-id, #dialog-passbody-id, #dialog-attach-id, #dialog-attachbody-id, #dialog-paket-id, #dialog-paketbody-id"
table := corporate_daftarpeserta.Table_DaftarPeserta(
peserta, table_id,
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openreport",
"#"+dialog_rptbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/opendetail",
"#"+dialog_paketbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openviewakun",
"#"+dialog_akunbody_id, hxinclude, "outerHTML",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openattachment",
"#"+dialog_attachbody_id, hxinclude, "outerHTML",
)
pagination := pagination.PaginationV3(
total, currpage, "/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/changepage", pagination_id,
hxinclude, "#content-dp", "outerHTML", "", "", corporate_daftarpeserta.BeforeRequestContent(), corporate_daftarpeserta.AfterRequestContent(),
)
clayout := corporate_daftarpeserta.Content(table, pagination)
return utils.View(c, clayout)
}
func (tdp *TabDaftarPesertaHandlers) HandleOpenViewAkun(c echo.Context) error {
patient_id := c.QueryParam("patid")
dialog_akun_id := c.QueryParam("dialog-akun-id")
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
akun, err := tdp.TabDaftarPesertaServices.GetAkunPeserta(patient_id)
if err != nil {
body := corporate_daftarpeserta.Body_Account(
dialog_akunbody_id,
models.CustomTextFieldv2Prm{
Label: "ID Akun Peserta",
Name: "akunpesertaid",
Type: "hidden",
ID: "akunpesertaidid",
},
models.CustomTextFieldv2Prm{
Label: "Email",
Name: "akunpesertaemail",
Type: "text",
ID: "akunpesertaemailid",
},
models.CustomTextFieldv2Prm{
Label: "Password baru",
Name: "akunpesertapassnew",
Type: "password",
ID: "akunpesertapassnewid",
},
models.CustomTextFieldv2Prm{
Label: "Ulangi password baru",
Name: "akunpesertapasscek",
Type: "password",
ID: "akunpesertapasscekid",
},
corporate_daftarpeserta.JSShowModal(""),
)
toast := customtoastv2.CustomToastV2Show("Warning", "Gagal mengambil data peserta", "warning")
ret := []templ.Component{toast, body}
return utils.ViewMulti(c, ret)
}
body := corporate_daftarpeserta.Body_Account(
dialog_akunbody_id,
models.CustomTextFieldv2Prm{
Label: "ID Akun Peserta",
Name: "akunpesertaid",
Type: "hidden",
ID: "akunpesertaidid",
Value: strconv.Itoa(akun.AuthPatientID),
},
models.CustomTextFieldv2Prm{
Label: "Email",
Name: "akunpesertaemail",
Type: "text",
ID: "akunpesertaemailid",
Value: akun.AuthPatientEmail,
},
models.CustomTextFieldv2Prm{
Label: "Password baru",
Name: "akunpesertapassnew",
Type: "password",
ID: "akunpesertapassnewid",
Placeholder: "Masukan password baru",
},
models.CustomTextFieldv2Prm{
Label: "Ulangi password baru",
Name: "akunpesertapasscek",
Type: "password",
ID: "akunpesertapasscekid",
Placeholder: "Masukan password baru",
},
corporate_daftarpeserta.JSShowModal("#"+dialog_akun_id),
)
return utils.View(c, body)
}
func (tdp *TabDaftarPesertaHandlers) HandleCloseViewAkun(c echo.Context) error {
dialog_akun_id := c.QueryParam("dialog-akun-id")
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
body := corporate_daftarpeserta.Body_Account(
dialog_akunbody_id,
models.CustomTextFieldv2Prm{
Label: "ID Akun Peserta",
Name: "akunpesertaid",
Type: "hidden",
ID: "akunpesertaidid",
},
models.CustomTextFieldv2Prm{
Label: "Email",
Name: "akunpesertaemail",
Type: "text",
ID: "akunpesertaemailid",
},
models.CustomTextFieldv2Prm{
Label: "Password baru",
Name: "akunpesertapassnew",
Type: "password",
ID: "akunpesertapassnewid",
},
models.CustomTextFieldv2Prm{
Label: "Ulangi password baru",
Name: "akunpesertapasscek",
Type: "password",
ID: "akunpesertapasscekid",
},
corporate_daftarpeserta.JSHideModal("#"+dialog_akun_id),
)
return utils.View(c, body)
}
func (tdp *TabDaftarPesertaHandlers) HandleAkun(c echo.Context) error {
user_token := c.Get("user").(*jwt.Token)
token := user_token.Raw
// patient_id := c.QueryParam("patid")
dialog_akun_id := c.QueryParam("dialog-akun-id")
dialog_akunbody_id := c.QueryParam("dialog-akunbody-id")
akunID := c.FormValue("akunpesertaid")
akunEmail := c.FormValue("akunpesertaemail")
newPass := c.FormValue("akunpesertapassnew")
newPasscek := c.FormValue("akunpesertapasscek")
formValidation := ""
newValidation := ""
cekValidation := ""
if strings.TrimSpace(newPass) == "" {
formValidation = "Password tidak boleh kosong"
newValidation = "Password tidak boleh kosong"
}
if strings.TrimSpace(newPasscek) == "" {
formValidation = "Password tidak boleh kosong"
cekValidation = "Password tidak boleh kosong"
}
if strings.TrimSpace(newPass) == "" && strings.TrimSpace(newPasscek) == "" {
formValidation = "Password baru tidak boleh kosong"
newValidation = "Password baru tidak boleh kosong"
cekValidation = "Password baru tidak boleh kosong"
}
if strings.TrimSpace(newPass) != strings.TrimSpace(newPasscek) {
formValidation = "Password tidak sama"
newValidation = "Password tidak sama"
cekValidation = "Password tidak sama"
}
if formValidation != "" || newValidation != "" || cekValidation != "" {
body := corporate_daftarpeserta.Body_Account(
dialog_akunbody_id,
models.CustomTextFieldv2Prm{
Label: "ID Akun Peserta",
Name: "akunpesertaid",
Type: "hidden",
ID: "akunpesertaidid",
Value: akunID,
},
models.CustomTextFieldv2Prm{
Label: "Email",
Name: "akunpesertaemail",
Type: "text",
ID: "akunpesertaemailid",
Value: akunEmail,
},
models.CustomTextFieldv2Prm{
Label: "Password baru",
Name: "akunpesertapassnew",
Type: "password",
ID: "akunpesertapassnewid",
ErrorMsg: newValidation,
},
models.CustomTextFieldv2Prm{
Label: "Ulangi password baru",
Name: "akunpesertapasscek",
Type: "password",
ID: "akunpesertapasscekid",
ErrorMsg: cekValidation,
},
corporate_daftarpeserta.JSShowModal(""),
)
toast := customtoastv2.CustomToastV2Show("Warning", formValidation, "warning")
ret := []templ.Component{toast, body}
return utils.ViewMulti(c, ret)
}
resp, err := tdp.TabDaftarPesertaServices.ResetPasswordPeserta(token, newPass, akunEmail, akunID)
body_err := corporate_daftarpeserta.Body_Account(
dialog_akunbody_id,
models.CustomTextFieldv2Prm{
Label: "ID Akun Peserta",
Name: "akunpesertaid",
Type: "hidden",
ID: "akunpesertaidid",
Value: akunID,
},
models.CustomTextFieldv2Prm{
Label: "Email",
Name: "akunpesertaemail",
Type: "text",
ID: "akunpesertaemailid",
Value: akunEmail,
},
models.CustomTextFieldv2Prm{
Label: "Password baru",
Name: "akunpesertapassnew",
Type: "password",
ID: "akunpesertapassnewid",
},
models.CustomTextFieldv2Prm{
Label: "Ulangi password baru",
Name: "akunpesertapasscek",
Type: "password",
ID: "akunpesertapasscekid",
},
corporate_daftarpeserta.JSShowModal(""),
)
if err != nil {
toastt := customtoastv2.CustomToastV2Show("Warning", err.Error(), "warning")
return utils.ViewMulti(c, []templ.Component{toastt, body_err})
}
if resp.Status == "ERR" {
toastt := customtoastv2.CustomToastV2Show("Warning", resp.Message, "warning")
return utils.ViewMulti(c, []templ.Component{toastt, body_err})
}
body_scs := corporate_daftarpeserta.Body_Account(
dialog_akunbody_id,
models.CustomTextFieldv2Prm{
Label: "ID Akun Peserta",
Name: "akunpesertaid",
Type: "hidden",
ID: "akunpesertaidid",
},
models.CustomTextFieldv2Prm{
Label: "Email",
Name: "akunpesertaemail",
Type: "text",
ID: "akunpesertaemailid",
},
models.CustomTextFieldv2Prm{
Label: "Password baru",
Name: "akunpesertapassnew",
Type: "password",
ID: "akunpesertapassnewid",
},
models.CustomTextFieldv2Prm{
Label: "Ulangi password baru",
Name: "akunpesertapasscek",
Type: "password",
ID: "akunpesertapasscekid",
},
corporate_daftarpeserta.JSHideModal("#"+dialog_akun_id),
)
toasttt := customtoastv2.CustomToastV2Show("Success", "Berhasil reset password peserta", "success")
return utils.ViewMulti(c, []templ.Component{toasttt, body_scs})
}
func (tdp *TabDaftarPesertaHandlers) HandleOpenDetail(c echo.Context) error {
idx := c.QueryParam("idx")
dialog_paket_id := c.QueryParam("dialog-paket-id")
dialog_paketbody_id := c.QueryParam("dialog-paketbody-id")
paket, err := tdp.TabDaftarPesertaServices.DetailTestdanPaket(idx)
if err != nil {
toastt := customtoastv2.CustomToastV2Show("Warning", "error get data", "error")
tab := corporate_daftarpeserta.Table_DetailPaket([]models.TableTestPaket{})
mod := corporate_daftarpeserta.Body_Detail(dialog_paketbody_id, tab, corporate_daftarpeserta.JSHideModal("#"+dialog_paket_id))
return utils.ViewMulti(c, []templ.Component{toastt, mod})
}
table := corporate_daftarpeserta.Table_DetailPaket(paket)
body := corporate_daftarpeserta.Body_Detail(dialog_paketbody_id, table, corporate_daftarpeserta.JSShowModal("#"+dialog_paket_id))
return utils.View(c, body)
}
func (tdp *TabDaftarPesertaHandlers) HandleOpenAttachmentFile(c echo.Context) error {
idx := c.QueryParam("idx")
dialog_attach_id := c.QueryParam("dialog-attach-id")
dialog_attachbody_id := c.QueryParam("dialog-attachbody-id")
file, err := tdp.TabDaftarPesertaServices.GetListAttachmentFile(idx)
if err != nil {
toastt := customtoastv2.CustomToastV2Show("Error", "error get data", "error")
tab := corporate_daftarpeserta.Tab_Attachment([]models.AttachmentFIle{})
mod := corporate_daftarpeserta.Body_Attachment(dialog_attachbody_id, tab, corporate_daftarpeserta.JSHideModal("#"+dialog_attach_id))
return utils.ViewMulti(c, []templ.Component{toastt, mod})
}
tab := corporate_daftarpeserta.Tab_Attachment(file)
body := corporate_daftarpeserta.Body_Attachment(dialog_attachbody_id, tab, corporate_daftarpeserta.JSShowModal("#"+dialog_attach_id))
return utils.View(c, body)
}

View File

@@ -1,199 +0,0 @@
package mcu_corporate_handlers
import (
"cpone/component/pagination"
"cpone/models"
"cpone/utils"
corporate_mcudetail "cpone/views/corporate/mcu/mcutab"
"strconv"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
type TabDaftarPesertaServices interface {
GetListMcuDaftarPeserta(id string, currentpage int, rowperpage int) ([]models.ModelMcuDaftarPeserta, int, error)
GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error)
}
type TabDaftarPesertaHandlers struct {
TabDaftarPesertaServices TabDaftarPesertaServices
}
func NewTabDaftarPesertaHandlers(tdp TabDaftarPesertaServices) *TabDaftarPesertaHandlers {
return &TabDaftarPesertaHandlers{
TabDaftarPesertaServices: tdp,
}
}
func (tdp *TabDaftarPesertaHandlers) HandleShowTabDaftarPeserta(c echo.Context) error {
logger, _ := zap.NewProduction()
title := "Daftar Report"
tableID := utils.GenerateRandomID("tableid")
paginationID := utils.GenerateRandomID("paginationID")
dialogReportID := utils.GenerateRandomID("dialogreportid")
dialogReportBodyID := utils.GenerateRandomID("dialogreportbodyid")
id := c.Param("id")
logger.Info("Params", zap.Any("id", id))
dataTable, totalPage, err := tdp.TabDaftarPesertaServices.GetListMcuDaftarPeserta(id, 1, 10)
if err != nil {
return err
}
logger.Info("totalPage", zap.Any("total", totalPage))
table := corporate_mcudetail.TableDaftarPeserta(
dataTable,
tableID,
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openreport",
"#"+dialogReportBodyID,
"#tableID, #paginationID, #dialogReportID, #dialogReportBodyID",
"outerHTML",
)
pagination := pagination.PaginationV3(
totalPage,
1,
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/changepage",
paginationID,
"#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogReportID, #dialogReportBodyID",
"#contentlayout",
"outerHTML", "", "",
corporate_mcudetail.BeforeRequestContent(),
corporate_mcudetail.AfterRequestContent(),
)
clayout := corporate_mcudetail.ContentLayout(
table,
pagination,
)
tabData := []models.TabViewReportMcu{}
tabview := corporate_mcudetail.TabReportView(tabData)
bodymodal := corporate_mcudetail.ModalBody(
dialogReportBodyID,
tabview,
corporate_mcudetail.JsShowModal(""),
)
closemodal := corporate_mcudetail.ModalClose(
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/closereport",
"#"+dialogReportBodyID,
"outerHTML",
"#"+dialogReportID,
)
modaldialog := corporate_mcudetail.DialogReport(
"",
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/dialogreport",
"#"+dialogReportBodyID,
"outerHTML",
"#tableID, #paginationID, #dialogReportID, #dialogReportBodyID"+paginationID,
dialogReportID,
title,
bodymodal,
closemodal,
)
content := corporate_mcudetail.TabDaftarPesertaScreen(
tableID,
paginationID,
dialogReportID,
dialogReportBodyID,
clayout,
modaldialog,
)
// css := corporate_mcudetail.CSSTabDaftarPeserta()
// js := corporate_mcudetail.JsTabDaftarPeserta()
// view := corporate_mcudetail.ShowTabDafterPeserta(
// title,
// content,
// css,
// js,
// )
return utils.View(c, content)
}
func (tdp *TabDaftarPesertaHandlers) HandlePagination(c echo.Context) error {
pageparam := c.QueryParam("page")
tableID := c.QueryParam("tableID")
paginationID := c.QueryParam("paginationID")
// dialogReportID := c.QueryParam("dialogReportID")
dialogReportBodyID := c.QueryParam("dialogReportBodyID")
id := c.Param("id")
// var retval []templ.Component
page, err := strconv.Atoi(pageparam)
if err != nil {
return err
}
tableData, totalPage, err := tdp.TabDaftarPesertaServices.GetListMcuDaftarPeserta(id, page, 10)
if err != nil {
return err
}
table := corporate_mcudetail.TableDaftarPeserta(
tableData,
tableID,
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/openreport",
"#"+dialogReportBodyID,
"#tableID, #paginationID, #dialogReportID, #dialogReportBodyID",
"outerHTML",
)
pagination := pagination.PaginationV3(
totalPage,
page,
"/corp/dashboard_pic/detail/"+id+"/tabdaftarpeserta/changepage",
paginationID,
"#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogReportID, #dialogReportBodyID, #currPage"+paginationID,
"#contentlayout",
"outerHTML", "", "",
corporate_mcudetail.BeforeRequestContent(),
corporate_mcudetail.AfterRequestContent(),
)
// content := corporate_mcudetail.TabDaftarPesertaScreen(tableID, paginationID, table, pagination)
// retval = append(retval, table)
// retval = append(retval, pagination)
// return utils.ViewMulti(c, retval)
// return utils.View(c, content)
clayout := corporate_mcudetail.ContentLayout(table, pagination)
return utils.View(c, clayout)
}
func (tdp *TabDaftarPesertaHandlers) HandleOpenReportDialog(c echo.Context) error {
logger, _ := zap.NewProduction()
idx := c.QueryParam("idx")
dialogReportID := c.QueryParam("dialogReportID")
dialogReportBodyID := c.QueryParam("dialogReportBodyID")
logger.Info("params", zap.Any("idx", idx))
tabData, err := tdp.TabDaftarPesertaServices.GetReportMcu(idx)
if err != nil {
tab := corporate_mcudetail.TabReportView([]models.TabViewReportMcu{})
mod := corporate_mcudetail.ModalBody(
dialogReportBodyID,
tab,
corporate_mcudetail.JsShowModal(""),
)
return utils.View(c, mod)
}
tabcomponent := corporate_mcudetail.TabReportView(tabData)
modalbody := corporate_mcudetail.ModalBody(
dialogReportBodyID,
tabcomponent,
corporate_mcudetail.JsShowModal("#"+dialogReportID),
)
return utils.View(c, modalbody)
}

View File

@@ -0,0 +1,71 @@
package mcu_corporate_handlers
import (
"cpone/component/chart"
"cpone/models"
"cpone/utils"
corporate_kelainanfisik "cpone/views/corporate/mcu/mcutab/kelainanfisik"
"strings"
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
type TabKelainanFisikServices interface {
GetKelainanFisikBMI(mcuID string) (models.Piechart, error)
GetKelainanFisikHipertensi(mcuID string) (models.Piechart, error)
GetKelainanFisikRefraksi(mcuID string) (models.Piechart, error)
GetKelainanFisikPresentase(mcuID string) (models.Barchart, error)
GetKelFisikAlkohol(mcuID string) (models.Piechart, error)
GetKelFisikMerokok(mcuID string) (models.Piechart, error)
GetKelFisikOlahraga(mcuID string) (models.Piechart, error)
GetChartRenderFisik(mcuID string) ([]models.McuTabModels, error)
}
type TabKelainanFisikHandler struct {
TabKelainanFisikServices TabKelainanFisikServices
}
func NewTabKelainanFisikHandler(tkf TabKelainanFisikServices) *TabKelainanFisikHandler {
return &TabKelainanFisikHandler{
TabKelainanFisikServices: tkf,
}
}
func (tkf *TabKelainanFisikHandler) HandleShowTabKelainanFisik(c echo.Context) error {
logger, _ := zap.NewProduction()
logger.Info("Tab Kelainan Fisik")
id := c.Param("id")
chartsxs := []templ.Component{}
chartsmd := []templ.Component{}
chartslg := []templ.Component{}
tablist, err := tkf.TabKelainanFisikServices.GetChartRenderFisik(id)
if err != nil {
return err
}
for _, d := range tablist {
chartsxs = append(chartsxs, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"xs", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
chartsmd = append(chartsmd, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"md", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
chartslg = append(chartslg, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"lg", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
}
content := corporate_kelainanfisik.KelainanFisikScreen(chartsxs, chartsmd, chartslg)
return utils.View(c, content)
}

View File

@@ -0,0 +1,62 @@
package mcu_corporate_handlers
import (
"cpone/component/chart"
"cpone/models"
"cpone/utils"
corporate_kelainanglobal "cpone/views/corporate/mcu/mcutab/kelainanglobal"
"strings"
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
)
type TabKelainanGlobalServices interface {
GetKelainanFisik(mcuID string) (models.Barchart, error)
GetKelainanGlobalV2(mcuID string) (models.Barchart, error)
GetChartRenderGlobal(mcuID string) ([]models.McuTabModels, error)
}
type TabKelainanGlobalHandler struct {
TabKelainanGlobalServices TabKelainanGlobalServices
}
func NewTabKelainanGlobalHandler(tkg TabKelainanGlobalServices) *TabKelainanGlobalHandler {
return &TabKelainanGlobalHandler{
TabKelainanGlobalServices: tkg,
}
}
func (tkg *TabKelainanGlobalHandler) HandleShowTabKelainanGlobal(c echo.Context) error {
id := c.Param("id")
chartsxs := []templ.Component{}
chartsmd := []templ.Component{}
chartslg := []templ.Component{}
tablist, err := tkg.TabKelainanGlobalServices.GetChartRenderGlobal(id)
if err != nil {
return err
}
for _, d := range tablist {
chartsxs = append(chartsxs, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"xs", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
chartsmd = append(chartsmd, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"md", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
chartslg = append(chartslg, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"lg", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
}
content := corporate_kelainanglobal.KelainanGlobal_Screen(chartsxs, chartsmd, chartslg)
return utils.View(c, content)
}

View File

@@ -0,0 +1,68 @@
package mcu_corporate_handlers
import (
"cpone/component/chart"
"cpone/models"
"cpone/utils"
corporate_kelainanlab "cpone/views/corporate/mcu/mcutab/kelainanlab"
"strings"
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
)
type TabKelainanLabServices interface {
GetDataPresentaseKelainanLab(mcuID string) (models.Barchart, error)
GetHematologi(mcuID string) (models.BarchartV2, error)
GetUrinalisa(mcuID string) (models.BarchartV2, error)
GetGangguanFungsiHati(mcuID string) (models.BarchartV2, error)
GetGangguanMetabolismeLemak(mcuID string) (models.BarchartV2, error)
GetPeningkatanGlukosa(mcuID string) (models.BarchartV2, error)
GetChartRenderLab(mcuID string) ([]models.McuTabModels, error)
}
type TabKelainanLabHandler struct {
TabKelainanLabServices TabKelainanLabServices
}
func NewTabKelainanLabHandler(tkl TabKelainanLabServices) *TabKelainanLabHandler {
return &TabKelainanLabHandler{
TabKelainanLabServices: tkl,
}
}
func (tkl *TabKelainanLabHandler) HandleShowTabKelainanLab(c echo.Context) error {
id := c.Param("id")
tablist, err := tkl.TabKelainanLabServices.GetChartRenderLab(id)
if err != nil {
return err
}
chartsxs := []templ.Component{}
chartsmd := []templ.Component{}
chartslg := []templ.Component{}
for _, d := range tablist {
chartsxs = append(chartsxs, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"xs", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
chartsmd = append(chartsmd, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"md", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
chartslg = append(chartslg, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"lg", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
}
content := corporate_kelainanlab.KelainanLabScreen(chartsxs, chartsmd, chartslg)
return utils.View(c, content)
}

View File

@@ -0,0 +1,65 @@
package mcu_corporate_handlers
import (
"cpone/component/chart"
"cpone/models"
"cpone/utils"
corporate_kelainannonlab "cpone/views/corporate/mcu/mcutab/kelainannonlab"
"strings"
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
)
type TabKelainanNonLabServices interface {
GetDataKelNonLab(mcuID string) (models.Barchart, error)
GetThoraxPA(mcuID string) (models.BarchartV2, error)
GetGangguanJantung(mcuID string) (models.BarchartV2, error)
GetAutospirometri(mcuID string) (models.BarchartV2, error)
GetPendengaran(mcuID string) (models.BarchartV2, error)
GetChartRenderNonLab(mcuID string) ([]models.McuTabModels, error)
}
type TabKelainanNonLabHandler struct {
TabKelainanNonLabServices TabKelainanNonLabServices
}
func NewTabKelainanNonLabHandler(tknl TabKelainanNonLabServices) *TabKelainanNonLabHandler {
return &TabKelainanNonLabHandler{
TabKelainanNonLabServices: tknl,
}
}
func (tknl *TabKelainanNonLabHandler) HandleShowTabKelainanNonLab(c echo.Context) error {
id := c.Param("id")
chartsxs := []templ.Component{}
chartsmd := []templ.Component{}
chartslg := []templ.Component{}
tablist, err := tknl.TabKelainanNonLabServices.GetChartRenderNonLab(id)
if err != nil {
return err
}
for _, d := range tablist {
chartsxs = append(chartsxs, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"xs", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
chartsmd = append(chartsmd, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"md", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
chartslg = append(chartslg, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"lg", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
}
content := corporate_kelainannonlab.KelainanNonlabScreen(chartsxs, chartsmd, chartslg)
return utils.View(c, content)
}

View File

@@ -0,0 +1,68 @@
package mcu_corporate_handlers
import (
"cpone/component/chart"
"cpone/models"
"cpone/utils"
corporate_kepesertaan "cpone/views/corporate/mcu/mcutab/kepesertaan"
"strings"
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
type TabKepersertaanServices interface {
GetTotalKepesertaanMCU(mcuID string) (models.Piechart, error)
GetKepesertaanByGender(mcuID string) (models.Piechart, error)
GetKepesertaanByUmur(mcuID string) (models.Piechart, error)
GetChartRenderPeserta(mcuID string) ([]models.McuTabModels, error)
}
type TabKepersertaanHandler struct {
TabKepersertaanServices TabKepersertaanServices
}
func NewTabKepersertaanHandler(tkh TabKepersertaanServices) *TabKepersertaanHandler {
return &TabKepersertaanHandler{
TabKepersertaanServices: tkh,
}
}
func (tkh *TabKepersertaanHandler) HandleShowTabKepesertaan(c echo.Context) error {
logger, _ := zap.NewProduction()
logger.Info("Tab Kepesertaan")
id := c.Param("id")
logger.Info("Params", zap.Any("id", id))
tablist, err := tkh.TabKepersertaanServices.GetChartRenderPeserta(id)
if err != nil {
return err
}
chartsxs := []templ.Component{}
chartsmd := []templ.Component{}
chartslg := []templ.Component{}
for _, d := range tablist {
chartsxs = append(chartsxs, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"xs", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
chartsmd = append(chartsmd, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"md", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
chartslg = append(chartslg, chart.ShowChartResponsiveWidth(
strings.ToLower(strings.ReplaceAll(d.Mcu_ImageGrafikName+"lg", " ", "")),
d.Mcu_ImageGrafikJsonRender,
"450px",
))
}
content := corporate_kepesertaan.KepesertaanScreen(chartsxs, chartsmd, chartslg)
return utils.View(c, content)
}

View File

@@ -3,7 +3,7 @@ package mcu_corporate_handlers
import (
"cpone/models"
"cpone/utils"
corporate_mcudetail "cpone/views/corporate/mcu/mcutab"
corporate_kesimpulan "cpone/views/corporate/mcu/mcutab/kesimpulan"
"fmt"
"github.com/labstack/echo/v4"
@@ -14,6 +14,9 @@ type TabKesimpulanServices interface {
GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error)
GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error)
GetListKesimpulanFisik(id string) ([]models.ModelKesimpulanLab, error)
GetListKesimpulanLabV2(id string) ([]models.ModelKesimpulanLab, error)
GetListKesimpulanNonLabV2(id string) ([]models.ModelKesimpulanLab, error)
GetListKesimpulanFisikV2(id string) ([]models.ModelKesimpulanLab, error)
}
type TabKesimpulanHandler struct {
@@ -29,10 +32,10 @@ func NewTabKesimpulanHandler(us TabKesimpulanServices) *TabKesimpulanHandler {
func (tkh *TabKesimpulanHandler) HandleShowTabKesimpulanScreen(c echo.Context) error {
logger, _ := zap.NewProduction()
tableID := utils.GenerateRandomID("tablebody")
tableID := utils.GenerateRandomID("table-id")
id := c.Param("id")
dataLab, err := tkh.TabKesimpulanServices.GetListKesimpulanLab(id)
dataLab, err := tkh.TabKesimpulanServices.GetListKesimpulanLabV2(id)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET LIST LAB",
@@ -41,9 +44,10 @@ func (tkh *TabKesimpulanHandler) HandleShowTabKesimpulanScreen(c echo.Context) e
fmt.Println(dataLab)
return err
}
tableComponentLab := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID)
// tableComponentLab := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID)
tableComponentLab := corporate_kesimpulan.Table_Kesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID)
dataNonLab, err := tkh.TabKesimpulanServices.GetListKesimpulanNonLab(id)
dataNonLab, err := tkh.TabKesimpulanServices.GetListKesimpulanNonLabV2(id)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET LIST NON LAB",
@@ -52,9 +56,9 @@ func (tkh *TabKesimpulanHandler) HandleShowTabKesimpulanScreen(c echo.Context) e
fmt.Println(dataNonLab)
return err
}
tableComponentNonLab := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableID)
tableComponentNonLab := corporate_kesimpulan.Table_Kesimpulan("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableID)
dataFisik, err := tkh.TabKesimpulanServices.GetListKesimpulanFisik(id)
dataFisik, err := tkh.TabKesimpulanServices.GetListKesimpulanFisikV2(id)
if err != nil {
defer logger.Sync()
logger.Info("ERROR GET LIST FISIK",
@@ -63,14 +67,16 @@ func (tkh *TabKesimpulanHandler) HandleShowTabKesimpulanScreen(c echo.Context) e
fmt.Println(dataFisik)
return err
}
tableComponentFisik := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Fisik terbesar :", dataFisik, tableID)
tableComponentFisik := corporate_kesimpulan.Table_Kesimpulan("3 Kelainan Pemeriksaan Fisik terbesar :", dataFisik, tableID)
content := corporate_mcudetail.MainKesimpulan(
tableID,
tableComponentLab,
tableComponentNonLab,
tableComponentFisik,
)
// content := corporate_mcudetail.MainKesimpulan(
// tableID,
// tableComponentLab,
// tableComponentNonLab,
// tableComponentFisik,
// )
content := corporate_kesimpulan.KesimpulanScreen(tableID, tableComponentLab, tableComponentNonLab, tableComponentFisik)
return utils.View(c, content)
}

View File

@@ -0,0 +1,120 @@
package mcu_corporate_handlers
import (
"cpone/component/pagination"
"cpone/models"
"cpone/utils"
corporate_keuangan "cpone/views/corporate/mcu/mcutab/keuangan"
"strconv"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
type TabKeuanganServices interface {
GetTotalOrderKeuangan(mcuID string) (int, error)
GetTotalCardData(mcuID string) (models.TotalBillCard, error)
GetListingDataKeuangan(mcuID string, currentpage int, rowperpage int) ([]models.KeuanganModel, int, error)
}
type TabKeuanganHandler struct {
TabKeuanganServices TabKeuanganServices
}
func NewTabKeuanganHandler(tk TabKeuanganServices) *TabKeuanganHandler {
return &TabKeuanganHandler{
TabKeuanganServices: tk,
}
}
func (tk *TabKeuanganHandler) HandleShowTabKeuangan(c echo.Context) error {
logger, _ := zap.NewProduction()
logger.Info("handler keuangan")
tableID := utils.GenerateRandomID("table-id")
paginationID := utils.GenerateRandomID("pagination-id")
id := c.Param("id")
logger.Info("Params", zap.Any("id", id))
dataTable, totalPage, err := tk.TabKeuanganServices.GetListingDataKeuangan(id, 1, 10)
if err != nil {
defer logger.Sync()
logger.Info("error get list data keuangan", zap.Any("error", err))
return err
}
tablecompo := corporate_keuangan.Table_Keuangan(dataTable, tableID)
pagination := pagination.PaginationV3(
totalPage,
1,
"/corp/dashboard_pic/detail/"+id+"/tabkeuangan/changepage",
paginationID,
"#table-id, #pagination-id, #loading-parent, #loading-child, #loading-spinner, #loadingcontent",
"#content-uang",
"outerHTML", "", "",
corporate_keuangan.BeforeRequestContent(),
corporate_keuangan.AfterRequestContent(),
)
totalOrder, err := tk.TabKeuanganServices.GetTotalOrderKeuangan(id)
if err != nil {
defer logger.Sync()
logger.Info("error get total order keuangan", zap.Any("error", err))
return err
}
totalBill, err := tk.TabKeuanganServices.GetTotalCardData(id)
if err != nil {
defer logger.Sync()
logger.Info("error get total bill keuangan", zap.Any("error", err))
return err
}
totalOrderF := utils.FormatRibuan(int(totalOrder))
totalTagihan := utils.FormatRibuan(int(totalBill.TotalTagihan))
totalPelunasan := utils.FormatRibuan(int(totalBill.TotalPelunasan))
totalHutang := utils.FormatRibuan(int(totalBill.TotalHutang))
content := corporate_keuangan.Tab_Keuangan(
tableID, paginationID,
corporate_keuangan.Summary_Card(totalOrderF, totalTagihan, totalPelunasan, totalHutang),
corporate_keuangan.Content(tablecompo, pagination),
)
return utils.View(c, content)
}
func (tk *TabKeuanganHandler) HandleChangePage(c echo.Context) error {
pageparam := c.QueryParam("page")
tableID := c.QueryParam("table-id")
paginationID := c.QueryParam("pagination-id")
id := c.Param("id")
page, err := strconv.Atoi(pageparam)
if err != nil {
return err
}
tableData, totalPage, err := tk.TabKeuanganServices.GetListingDataKeuangan(id, page, 10)
if err != nil {
return err
}
tablecomp := corporate_keuangan.Table_Keuangan(tableData, tableID)
pagination := pagination.PaginationV3(
totalPage,
page,
"/corp/dashboard_pic/detail/"+id+"/tabkeuangan/changepage",
paginationID,
"#table-id, #pagination-id, #loading-parent, #loading-child, #loading-spinner, #loadingcontent",
"#content-uang",
"outerHTML", "", "",
corporate_keuangan.BeforeRequestContent(),
corporate_keuangan.AfterRequestContent(),
)
tabdanpagi := corporate_keuangan.Content(tablecomp, pagination)
return utils.View(c, tabdanpagi)
}

View File

@@ -17,10 +17,9 @@ import (
type PatientService interface {
GetDashboardPatientBreadcrumb(title string) (models.BreadCrumbV1, error)
ListingData(search string, date string, patID string, corpId string, currentpage int, rowperpage int) ([]models.DashboardPatient, int, error)
GetListtingData(email string, currentpage int, rowperpage int) ([]models.DashboardPatient, int, error)
GetPatientData(email string) (string, error)
GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error)
GetListReportPesertaV4(orderheaderID string, staffname string) ([]models.TabViewReportMcu, error)
}
func NewPatientHandler(us PatientService) *PatientHandler {
@@ -220,7 +219,11 @@ func (ph *PatientHandler) HandleOpenReport(c echo.Context) error {
dialogBodyID := c.QueryParam("dialogBodyID")
logger.Info("params", zap.Any("id", id))
tabData, err := ph.PatientService.GetReportMcu(id)
userCok := c.Get("user").(*jwt.Token)
claims := userCok.Claims.(jwt.MapClaims)
staffname := claims["M_StaffName"].(string)
newtabdata, err := ph.PatientService.GetListReportPesertaV4(id, staffname)
if err != nil {
tab := corporate_patient.TabReportView([]models.TabViewReportMcu{})
mod := corporate_patient.ModalBody(
@@ -231,7 +234,7 @@ func (ph *PatientHandler) HandleOpenReport(c echo.Context) error {
return utils.View(c, mod)
}
tabcomponent := corporate_patient.TabReportView(tabData)
tabcomponent := corporate_patient.TabReportView(newtabdata)
modalBody := corporate_patient.ModalBody(
dialogBodyID,
tabcomponent,

View File

@@ -8,13 +8,15 @@ import (
"net/http"
"time"
"github.com/golang-jwt/jwt/v5"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
type LoginService interface {
Login(username string, password string) (models.ResponseApi, error)
MultiSignIn(username string, password string) (models.Response, error)
CheckIsAccountCpone(email string) (string, error)
CheckAccountHasLocation(email string) (bool, error)
MultiSignInV2(username string, password string) (models.Response, error)
}
func NewLoginHandler(us LoginService) *LoginHandler {
@@ -29,34 +31,35 @@ type LoginHandler struct {
func (lh *LoginHandler) HandlerShowLogin(c echo.Context) error {
si := public_login.ShowLogin("Login ", public_login.MainLogin(), public_login.CssLogin(), public_login.JsLogin())
si := public_login.ShowLogin("Login ", public_login.MainLogin(true), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, si)
}
func (lh *LoginHandler) HandleSignIn(c echo.Context) error {
logger, _ := zap.NewProduction()
// host := c.Request().Host
username := c.FormValue("username")
password := c.FormValue("password")
defer logger.Sync()
logger.Info("Params", zap.Any("username", username), zap.Any("pass", password))
resp, err := lh.LoginService.MultiSignIn(username, password)
resp, err := lh.LoginService.MultiSignInV2(username, password)
if err != nil {
defer logger.Sync()
logger.Info("Error", zap.Error(err))
logger.Info("Error", zap.Any("error multi signin", err))
si := public_login.ShowLogin("Login ", public_login.MainLogin(), public_login.CssLogin(), public_login.JsLogin())
si := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, si)
}
if resp.Status == "ERR" {
defer logger.Sync()
logger.Info("Error", zap.Any("ERR", resp.Status))
si := public_login.ShowLogin("Login ", public_login.MainLogin(), public_login.CssLogin(), public_login.JsLogin())
si := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, si)
}
defer logger.Sync()
logger.Info("valid", zap.Any("value", resp))
@@ -77,7 +80,7 @@ func (lh *LoginHandler) HandleSignIn(c echo.Context) error {
defer logger.Sync()
logger.Info("Error", zap.Error(err))
si := public_login.ShowLogin("Login ", public_login.MainLogin(), public_login.CssLogin(), public_login.JsLogin())
si := public_login.ShowLogin("Login ", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, si)
}
@@ -99,7 +102,7 @@ func (lh *LoginHandler) HandleSignIn(c echo.Context) error {
localStorage.setItem("user", user);
htmx.on("htmx:configRequest", (e)=> {
e.detail.headers["Authentication"] = "Bearer ` + resp.Data.Token + `"
e.detail.headers["Authorization"] = "Bearer ` + resp.Data.Token + `"
})
setTimeout(() => {
@@ -114,7 +117,7 @@ func (lh *LoginHandler) HandleSignIn(c echo.Context) error {
func (lh *LoginHandler) HandleRedirect(c echo.Context) error {
logger, _ := zap.NewProduction()
url := c.QueryParam("url")
token := c.Request().Header.Get("Authentication")
token := c.Request().Header.Get("Authorization")
logger.Info("params", zap.Any("url", url), zap.Any("token", token))
c.Response().Header().Set("HX-Redirect", url)
@@ -148,3 +151,199 @@ func (lh *LoginHandler) HandleSignOut(c echo.Context) error {
c.Response().Header().Set("HX-Trigger", "script")
return c.String(http.StatusOK, ret)
}
func (lh *LoginHandler) HandleAutoLoginPage(c echo.Context) error {
userToken := c.Get("user").(*jwt.Token)
token := userToken.Raw
claims := userToken.Claims.(jwt.MapClaims)
userGroup := claims["M_UserGroupDashboard"].(string)
cookie := new(http.Cookie)
cookie.Name = "token"
cookie.Value = token
cookie.Path = "/"
cookie.HttpOnly = true
c.SetCookie(cookie)
var url string
switch userGroup {
case "cpone":
url = "/one-ui"
case "pic":
url = "/corp/dashboard_pic"
case "patient":
url = "/corp/dashboard_pat"
default:
url = "/one-ui"
}
redirect := `
<script>
setTimeout(() => {
htmx.ajax('GET', '/login/redirect?url=` + url + `', {
headers: {
Authorization: 'Bearer ` + token + `'
}
})
}, 200)
</script>
`
c.Response().Header().Set("HX-Trigger", "script")
return c.String(http.StatusOK, redirect)
}
func (lh *LoginHandler) HandleSignInV2(c echo.Context) error {
logger, _ := zap.NewProduction()
username := c.FormValue("username")
password := c.FormValue("password")
defer logger.Sync()
utype, err := lh.LoginService.CheckIsAccountCpone(username)
if err != nil {
logger.Info("[ERROR]", zap.Any("error check type account : ", err))
si := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, si)
}
// logger.Info("[INFO]", zap.Any("type account : ", utype))
// if utype == "cpone" {
if utype != "" {
url := "/one-ui/test/vuex/one-login-v2"
c.Response().Header().Set("HX-Redirect", url)
return c.String(http.StatusOK, utype)
}
// resp, err := lh.LoginService.MultiSignIn(username, password, "")
resp, err := lh.LoginService.MultiSignInV2(username, password)
if err != nil {
logger.Info("[ERROR]", zap.Any("error multi sigin: ", err))
si := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, si)
}
if resp.Status == "ERR" {
logger.Info("[ERROR]", zap.Any("error: ", resp.Status))
si := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, si)
}
defer logger.Sync()
var url string
switch resp.Data.Type {
case "pic":
url = "/corp/dashboard_pic"
case "patient":
url = "/corp/dashboard_pat"
default:
url = "/one-ui"
}
user, err := json.Marshal(resp.Data.User)
if err != nil {
logger.Info("Error", zap.Error(err))
si := public_login.ShowLogin("Login ", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, si)
}
cookie := new(http.Cookie)
cookie.Name = "token"
cookie.Value = resp.Data.Token
cookie.Path = "/"
cookie.HttpOnly = true
c.SetCookie(cookie)
user_str := string(user)
store := `
<script>
console.log("store token");
const token = "` + resp.Data.Token + `";
const user = JSON.stringify(` + user_str + `);
localStorage.setItem("token", token);
localStorage.setItem("user", user);
htmx.on("htmx:configRequest", (e)=> {
e.detail.headers["Authorization"] = "Bearer ` + resp.Data.Token + `"
})
setTimeout(() => {
htmx.ajax('GET', '/login/redirect?url=` + url + `')
}, 200)
</script>
`
c.Response().Header().Set("HX-Trigger", "script")
return c.String(http.StatusOK, store)
}
func (lh *LoginHandler) HandleSignInV3(c echo.Context) error {
logger, _ := zap.NewProduction()
username := c.FormValue("username")
password := c.FormValue("password")
// check is type cpone and exist in location
resp, err := lh.LoginService.MultiSignInV2(username, password)
if err != nil {
logger.Error("[ERROR]", zap.Any("multi signin process: ", err))
ret := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, ret)
}
if resp.Status == "ERR" {
logger.Error("[ERROR]", zap.Any("response signin process error: ", resp.Status))
ret := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, ret)
}
defer logger.Sync()
var url string
switch resp.Data.Type {
case "pic":
url = "/corp/dashboard_pic"
case "patient":
url = "/corp/dashboard_pat"
default:
url = "/one-ui"
}
user, err := json.Marshal(resp.Data.User)
if err != nil {
logger.Error("[ERROR]", zap.Any("process marshal response user", err))
ret := public_login.ShowLogin("Login", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
return utils.View(c, ret)
}
cookie := new(http.Cookie)
cookie.Name = "token"
cookie.Value = resp.Data.Token
cookie.Path = "/"
cookie.HttpOnly = true
c.SetCookie(cookie)
user_str := string(user)
// logger.Info("[INFO]", zap.Any("user data ", user_str))
store := `
<script>
console.log("store token");
const token = "` + resp.Data.Token + `";
const user = JSON.stringify(` + user_str + `);
localStorage.setItem("token", token);
localStorage.setItem("user", user);
htmx.on("htmx:configRequest", (e)=> {
e.detail.headers["Authorization"] = "Bearer ` + resp.Data.Token + `"
})
setTimeout(() => {
htmx.ajax('GET', '/login/redirect?url=` + url + `')
}, 200)
</script>
`
c.Response().Header().Set("HX-Trigger", "script")
return c.String(http.StatusOK, store)
}

View File

@@ -0,0 +1,16 @@
package public_handlers
import (
customtoastv2 "cpone/component/toastbootstrap"
"cpone/utils"
"github.com/labstack/echo/v4"
)
func HandlerHideToast(c echo.Context) error {
toastComponent := customtoastv2.CustomToastV2Hide()
si := toastComponent
return utils.View(c, si)
}

View File

@@ -64,6 +64,7 @@ func SetupRoutesEmployee(app *echo.Echo, e *dev_handlers.EmployeeHandler) {
func SetupRoutesProject(app *echo.Echo) {
}
func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
public := app.Group("/")
l := public_services.NewServicesLandingPage(public_services.LandingPage{}, appStore)
@@ -71,15 +72,22 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
public.GET("landingpage", lh.ShowLandingPage)
public.GET("home", lh.ShowLandingPage)
public.GET("home/login", lh.HandleBtnLogin)
// loginHdr := public_handlers.NewLoginHandler(l)
// public.GET("login", loginHdr.HandlerShowLogin)
public.GET("home/hidetoast", public_handlers.HandlerHideToast)
loginServ := public_services.NewServicesLogin(appStore)
loginHadlr := public_handlers.NewLoginHandler(loginServ)
public.GET("login", loginHadlr.HandlerShowLogin)
public.POST("login/signin", loginHadlr.HandleSignIn)
// ver cpone
// public.POST("login/signin", loginHadlr.HandleSignIn)
// ver devcpone
public.POST("login/signin", loginHadlr.HandleSignInV3)
public.GET("login/redirect", loginHadlr.HandleRedirect)
public.GET("login/signout", loginHadlr.HandleSignOut)
public.POST("login/autologin", loginHadlr.HandleAutoLoginPage, auth.IsAlreadyLogin)
// kartu kontrol
publicKartuKontrolServices := public_services.NewServicesKartuKontrol(appStore)
@@ -101,6 +109,7 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
// redirect to survey mcu page
public.GET("redirectsurveymcu", publicKartuKontrolhandlers.HandlerRedirectToSurveyMcu)
}
func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) {
corp := app.Group("/corp", auth.IsLoggedIn)
// corp := app.Group("/corp")
@@ -108,6 +117,12 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) {
lh := corporate_handlers.NewCompanyHandler(l)
corp.GET("/company", lh.ShowCompany)
// ganti password
accountService := corporate_services.NewAccountService(appStore)
accountHandler := corporate_handlers.NewAccountHandler(accountService)
corp.POST("/dashboard_pic/tutupgantipassword", accountHandler.HandleCloseChangePassword)
corp.POST("/dashboard_pic/gantipassword", accountHandler.HandleChangePassword)
// dashboard_pic
dashbrdPicServ := corporate_services.NewDashboardPicServices(appStore)
dashbrdPicHandl := corporate_handlers.NewDashboardPicHandler(dashbrdPicServ)
@@ -121,15 +136,57 @@ func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) {
mcudHandr := corporate_handlers.NewMcuDetailHandler(mcudServ)
corp.GET("/dashboard_pic/detail/:id", mcudHandr.HandlerShowMcuDetailScreen)
// tab kepesertaan
kepesertaanSrvs := mcu_corporate_services.NewTabKepersertaanService(appStore)
kepesertaanHdlr := mcu_corporate_handlers.NewTabKepersertaanHandler(kepesertaanSrvs)
corp.GET("/dashboard_pic/detail/:id/tabkepesertaan", kepesertaanHdlr.HandleShowTabKepesertaan)
// tab kelainan global
kelainanglobalSrvs := mcu_corporate_services.NewTabKelainanGlobalServices(appStore)
kelainanglobalHdlr := mcu_corporate_handlers.NewTabKelainanGlobalHandler(kelainanglobalSrvs)
corp.GET("/dashboard_pic/detail/:id/tabkelainanglobal", kelainanglobalHdlr.HandleShowTabKelainanGlobal)
// tab kelainan lab
kelainanlabSrvs := mcu_corporate_services.NewTabKelainanLabServices(appStore)
kelainanlabHdlr := mcu_corporate_handlers.NewTabKelainanLabHandler(kelainanlabSrvs)
corp.GET("/dashboard_pic/detail/:id/tabkelainanlab", kelainanlabHdlr.HandleShowTabKelainanLab)
// tab kelainan non lab
kelnonlabSrvs := mcu_corporate_services.NewTabKelainanNonLabServices(appStore)
kelnonlabHdlr := mcu_corporate_handlers.NewTabKelainanNonLabHandler(kelnonlabSrvs)
corp.GET("/dashboard_pic/detail/:id/tabkelainannonlab", kelnonlabHdlr.HandleShowTabKelainanNonLab)
// tab kelainan fisik
kelainanfisikSrvs := mcu_corporate_services.NewTabKelainanFisikServices(appStore)
kelainanfisikHdlr := mcu_corporate_handlers.NewTabKelainanFisikHandler(kelainanfisikSrvs)
corp.GET("/dashboard_pic/detail/:id/tabkelainanfisik", kelainanfisikHdlr.HandleShowTabKelainanFisik)
// tab kesimpulan
kesimpulanSrv := mcu_corporate_services.NewTabKesimpulanServices(appStore)
kesimpulanHdr := mcu_corporate_handlers.NewTabKesimpulanHandler(kesimpulanSrv)
corp.GET("/dashboard_pic/detail/:id/tabkesimpulan", kesimpulanHdr.HandleShowTabKesimpulanScreen)
// tab daftar peserta
daftarpesertaServ := mcu_corporate_services.NewTabDaftarPesertaServices(appStore)
daftarpesertaHandl := mcu_corporate_handlers.NewTabDaftarPesertaHandlers(daftarpesertaServ)
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta", daftarpesertaHandl.HandleShowTabDaftarPeserta)
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/changepage", daftarpesertaHandl.HandlePagination)
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/openreport", daftarpesertaHandl.HandleOpenReportDialog)
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/dialoggenpass", daftarpesertaHandl.HandleDialogGenPass)
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/closegenpass", daftarpesertaHandl.HandleCloseDialogGenPass)
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/openviewakun", daftarpesertaHandl.HandleOpenViewAkun)
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/closeviewakun", daftarpesertaHandl.HandleCloseViewAkun)
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/viewakun", daftarpesertaHandl.HandleAkun)
corp.POST("/dashboard_pic/detail/:id/tabdaftarpeserta/reload", daftarpesertaHandl.HandleContentReload)
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/opendetail", daftarpesertaHandl.HandleOpenDetail)
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/filter", daftarpesertaHandl.HandleFilter)
corp.GET("/dashboard_pic/detail/:id/tabdaftarpeserta/openattachment", daftarpesertaHandl.HandleOpenAttachmentFile)
// tab keuangan
keuanganService := mcu_corporate_services.NewTabKeuanganServices(appStore)
keuanganHandler := mcu_corporate_handlers.NewTabKeuanganHandler(keuanganService)
corp.GET("/dashboard_pic/detail/:id/tabkeuangan", keuanganHandler.HandleShowTabKeuangan)
corp.GET("/dashboard_pic/detail/:id/tabkeuangan/changepage", keuanganHandler.HandleChangePage)
patienServices := corporate_services.NewPatientServices(appStore)
patientHandler := corporate_handlers.NewPatientHandler(patienServices)

View File

@@ -151,6 +151,29 @@ templ DashboardLayout(
@navbaruser
</div>
<div class="mt-16">
// toast
<div class="toast-top-right" id="container-system-notification" style="position: absolute; top: 1vh; right: 0vw; z-index: 999;">
<!-- toast success -->
<div
id="notification-001"
class="toast fade hide"
role="alert"
aria-live="assertive"
aria-atomic="true"
>
<div class="toast-header bg-success text-white">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--ep mr-2 icon-xl" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 1024" data-icon="ep:success-filled"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"></path></svg>
<strong class="mr-auto">Success</strong>
<small class="text-muted text-white">just now</small>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="toast-body bg-success-transparent">
This is a success toast.
</div>
</div>
</div>
{ children... }
</div>
</div>

View File

@@ -58,7 +58,7 @@ func DashboardLayout(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"mt-16\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"mt-16\"><div class=\"toast-top-right\" id=\"container-system-notification\" style=\"position: absolute; top: 1vh; right: 0vw; z-index: 999;\"><!-- toast success --><div id=\"notification-001\" class=\"toast fade hide\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"toast-header bg-success text-white\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" role=\"img\" class=\"iconify iconify--ep mr-2 icon-xl\" width=\"1em\" height=\"1em\" preserveAspectRatio=\"xMidYMid meet\" viewBox=\"0 0 1024 1024\" data-icon=\"ep:success-filled\"><path fill=\"currentColor\" d=\"M512 64a448 448 0 1 1 0 896a448 448 0 0 1 0-896m-55.808 536.384l-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z\"></path></svg> <strong class=\"mr-auto\">Success</strong> <small class=\"text-muted text-white\">just now</small> <button type=\"button\" class=\"ml-2 mb-1 close\" data-dismiss=\"toast\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></div><div class=\"toast-body bg-success-transparent\">This is a success toast.\r</div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

6
models/account.models.go Normal file
View File

@@ -0,0 +1,6 @@
package models
type ResponseStatus struct {
Status string `json:"status"`
Message string `json:"message"`
}

177
models/chart.models.go Normal file
View File

@@ -0,0 +1,177 @@
package models
type SeriesData struct {
Value int `json:"value"`
Name string `json:"name"`
}
type Series struct {
Label struct {
Position string `json:"position"`
Formatter string `json:"formatter"`
} `json:"label"`
Name string `json:"name"`
Type string `json:"type"`
Radius []string `json:"radius"`
ItemStyle struct {
BorderRadius int `json:"borderRadius"`
BorderColor string `json:"borderColor"`
BorderWidth int `json:"borderWidth"`
} `json:"itemStyle"`
Data []SeriesData `json:"data"`
Emphasis struct {
ItemStyle struct {
ShadowBlur int `json:"shadowBlur"`
ShadowOffsetX int `json:"shadowOffsetX"`
ShadowColor string `json:"shadowColor"`
} `json:"itemStyle"`
} `json:"emphasis"`
}
type Piechart struct {
Title struct {
Text string `json:"text"`
SubText string `json:"subtext"`
Left string `json:"left"`
} `json:"title"`
Tooltip struct {
Trigger string `json:"trigger"`
} `json:"tooltip"`
Legend struct {
Top string `json:"top"`
Left string `json:"left"`
Orient string `json:"orient"`
Height int `json:"height"`
} `json:"legend"`
Series []Series `json:"series"`
}
type Barchart struct {
Title struct {
Text string `json:"text"`
Left string `json:"left"`
} `json:"title"`
Dataset struct {
Source [][]interface{} `json:"source"`
} `json:"dataset"`
Grid struct {
ContainLabel bool `json:"containLabel"`
} `json:"grid"`
XAxis struct {
Name string `json:"name"`
} `json:"xAxis"`
YAxis struct {
Type string `json:"type"`
} `json:"yAxis"`
VisualMap struct {
Orient string `json:"orient"`
Left string `json:"left"`
Min int `json:"min"`
Max int `json:"max"`
Show bool `json:"show"`
Dimension int `json:"dimension"`
InRange struct {
Color []string `json:"color"`
} `json:"inRange"`
} `json:"visualMap"`
Series []struct {
Label struct {
Position string `json:"position"`
Show bool `json:"show"`
Formatter string `json:"formatter"`
} `json:"label"`
Type string `json:"type"`
Encode struct {
X string `json:"x"`
Y string `json:"y"`
} `json:"encode"`
} `json:"series"`
Tooltip struct {
Trigger string `json:"trigger"`
AxisPointer struct {
Type string `json:"type"`
} `json:"axisPointer"`
} `json:"tooltip"`
Graphic struct {
Type string `json:"type"`
Left string `json:"left"`
Top string `json:"top"`
Style struct {
Text string `json:"text"`
FontSize string `json:"fontSize"`
FontWeight string `json:"fontWeight"`
} `json:"style"`
} `json:"graphic"`
}
type BarDataset struct {
Source [][]interface{} `json:"source"`
}
type BarchartV2 struct {
Title struct {
Text string `json:"text"`
Left string `json:"left"`
} `json:"title"`
Dataset struct {
Source [][]interface{} `json:"source"`
} `json:"dataset"`
Grid struct {
ContainLabel bool `json:"containLabel"`
} `json:"grid"`
XAxis struct {
Name string `json:"name"`
Type string `json:"type"`
AxisLabel struct {
Interval int `json:"interval"`
Rotate int `json:"rotate"`
} `json:"axisLabel"`
} `json:"xAxis"`
YAxis struct {
Type string `json:"type"`
Name string `json:"name"`
NameTextStyle struct {
Align string `json:"align"`
} `json:"nameTextStyle"`
NameGap int `json:"nameGap"`
} `json:"yAxis"`
VisualMap struct {
Orient string `json:"orient"`
Left string `json:"left"`
Min int `json:"min"`
Max int `json:"max"`
Dimension int `json:"dimension"`
Show bool `json:"show"`
InRange struct {
Color []string `json:"color"`
} `json:"inRange"`
} `json:"visualMap"`
Series []struct {
Label struct {
Position string `json:"position"`
Show bool `json:"show"`
Formatter string `json:"formatter"`
} `json:"label"`
Type string `json:"type"`
Encode struct {
X string `json:"x"`
Y string `json:"y"`
} `json:"encode"`
} `json:"series"`
Tooltip struct {
Trigger string `json:"trigger"`
AxisPointer struct {
Type string `json:"type"`
} `json:"axisPointer"`
} `json:"tooltip"`
Graphic struct {
Type string `json:"type"`
Left string `json:"left"`
Top string `json:"top"`
Style struct {
Text string `json:"text"`
FontSize string `json:"fontSize"`
FontWeight string `json:"fontWeight"`
} `json:"style"`
} `json:"graphic"`
}

34
models/keuangan.models.go Normal file
View File

@@ -0,0 +1,34 @@
package models
type KeuanganModel struct {
F_BillID int `db:"F_BillID"`
F_BillNo string `db:"F_BillNo"`
F_BillCorporateID int `db:"F_BillCorporateID"`
F_BillDueDate string `db:"F_BillDueDate"`
F_BillTotal int `db:"F_BillTotal"`
F_BillUnpaid int `db:"F_BillUnpaid"`
F_BillCreated string `db:"F_BillCreated"`
BillPayment []BillPaymentModel
TotalBillPayment int
}
type BillPaymentModel struct {
F_BillPaymentID int `db:"F_BillPaymentID"`
F_BillPaymentF_BillID int `db:"F_BillPaymentF_BillID"`
F_BillPaymentDate string `db:"F_BillPaymentDate"`
F_BillPaymentNumber string `db:"F_BillPaymentNumber"`
F_BillPaymentAmount float64 `db:"F_BillPaymentAmount"`
}
type TotalOrderHeader struct {
T_OrderHeaderID int `db:"T_OrderHeaderID"`
T_OrderHeaderCorporateID int `db:"T_OrderHeaderCorporateID"`
T_OrderHeaderTotal float64 `db:"T_OrderHeaderTotal"`
T_OrderHeaderCreated string `db:"T_OrderHeaderCreated"`
}
type TotalBillCard struct {
TotalTagihan int
TotalPelunasan int
TotalHutang int
}

View File

@@ -76,6 +76,8 @@ type Response struct {
MUserGroupDashboard string `json:"M_UserGroupDashboard"`
MUserDefaultTSampleStationID string `json:"M_UserDefaultT_SampleStationID"`
MStaffName string `json:"M_StaffName"`
MBranchID string `json:"M_BranchID"`
MBranchName string `json:"M_BranchName"`
IsCourier string `json:"is_courier"`
TimeAutologout string `json:"time_autologout"`
IP string `json:"ip"`

View File

@@ -12,16 +12,99 @@ type ModelMcuDaftarPeserta struct {
JenisKelamin string `db:"jenisKelamin"`
M_PatientDOB string `db:"M_PatientDOB"`
Age string `db:"age"`
AuthPatientEmail string `db:"authPatientEmail"`
AuthPatientIsActive string `db:"authPatientIsActive"`
Test_Paket string `db:"test_paket"`
List_Paket string `db:"list_paket"`
}
type ModelMcuPesertaReport struct {
type SoResultEntryReportModel struct {
So_ResultEntryID int `db:"So_ResultEntryID"`
So_ResultEntryT_OrderHeaderID int `db:"So_ResultEntryT_OrderHeaderID"`
So_ResultEntryT_OrderDetailID int `db:"So_ResultEntryT_OrderDetailID"`
So_ResultEntryNonlab_TemplateID int `db:"So_ResultEntryNonlab_TemplateID"`
So_ResultEntryNonlab_TemplateName string `db:"So_ResultEntryNonlab_TemplateName"`
Datetime string `db:"Datetime"`
}
type TabViewReportMcu struct {
Name string
Link string
}
type OrderReport struct {
M_OrderReportID int `db:"M_OrderReportID"`
M_OrderReportName string `db:"M_OrderReportName"`
M_OrderReportOrdering int `db:"M_OrderReportOrdering"`
M_OrderReportUrl string `db:"M_OrderReportUrl"`
M_OrderReportIsOrderHeader string `db:"M_OrderReportIsOrderHeader"`
M_OrderReportIsFisikUmum string `db:"M_OrderReportIsFisikUmum"`
M_OrderReportIsActive string `db:"M_OrderReportIsActive"`
Datetime string `db:"Datetime"`
}
type GeneratePasswordResponse struct {
Status string `json:"status"`
Message string `json:"message"`
}
type AuthPatient struct {
AuthPatientID int `db:"authPatientID"`
AuthPatientM_PatientID int `db:"authPatientM_PatientID"`
AuthPatientEmail string `db:"authPatientEmail"`
AuthPatientPassword string `db:"authPatientPassword"`
AuthPatientIsActive string `db:"authPatientIsActive"`
}
type GroupResultOrderModel struct {
Group_ResultID string `db:"Group_ResultID"`
Group_ResultName string `db:"Group_ResultName"`
Group_ResultResumeMcu string `db:"Group_ResultResumeMcu"`
Group_ResultOrderOrder string `db:"Group_ResultOrderOrder"`
Group_ResultUrl string `db:"Group_ResultUrl"`
Group_ResultIsOrderHeader string `db:"Group_ResultIsOrderHeader"`
Datetime string `db:"Datetime"`
}
type PatientMCU struct {
T_OrderHeaderID string `db:"T_OrderHeaderID"`
T_OrderHeaderLabNumber string `db:"T_OrderHeaderLabNumber"`
M_PatientID string `db:"M_PatientID"`
M_PatientName string `db:"M_PatientName"`
Datetime string `db:"Datetime"`
}
type SoRptData struct {
Rpt_name string `db:"rpt_name"`
So_id string `db:"so_id"`
Order_id string `db:"order_id"`
Datetime string `db:"Datetime"`
}
type ResumeMCU struct {
Mcu_ResumeID string `db:"Mcu_ResumeID"`
Datetime string `db:"Datetime"`
}
type DetailPaketMCU struct {
T_OrderDetailOrderT_PacketID string `db:"T_OrderDetailOrderT_PacketID"`
T_OrderDetailOrderT_PacketName string `db:"T_OrderDetailOrderT_PacketName"`
T_TestName string `db:"T_TestName"`
}
type DetailTestMCU struct {
T_OrderDetailOrderT_TestID string `db:"T_OrderDetailOrderT_TestID"`
T_OrderDetailOrderT_TestName string `db:"T_OrderDetailOrderT_TestName"`
}
type TableTestPaket struct {
Nomor int
NamaTest string
NamaPaket string
}
type AttachmentFIle struct {
File_AttachmentID int `db:"File_AttachmentID"`
File_AttachmentFileName string `db:"File_AttachmentFileName"`
Link string
}

10
models/mcutab.models.go Normal file
View File

@@ -0,0 +1,10 @@
package models
type McuTabModels struct {
Mcu_ImageGrafikGroupResult string `db:"Mcu_ImageGrafikGroupResult"`
Mcu_ImageGrafikGroupMenu string `db:"Mcu_ImageGrafikGroupMenu"`
Mcu_ImageGrafikName string `db:"Mcu_ImageGrafikName"`
Mcu_ImageGrafikJsonRender string `db:"Mcu_ImageGrafikJsonRender"`
TabID string
TabName string
}

View File

@@ -0,0 +1,7 @@
package models
type KelainanFisikDataModel struct {
Test string `db:"test"`
Total int `db:"total"`
Mcu_KelainanClasification string `db:"Mcu_KelainanClasification"`
}

View File

@@ -0,0 +1,17 @@
package models
type KelainanGlobalMCUModel struct {
Test string `db:"Test"`
Total int `db:"total"`
}
type KelainanGlobalFisikModel struct {
Mcu_KelainanName string `db:"Mcu_KelainanName"`
Total int `db:"total"`
}
type KelainanGlobalModel struct {
Mcu_KelainanID string `db:"Mcu_KelainanID"`
Test string `db:"Test"`
Total int `db:"Total"`
}

View File

@@ -0,0 +1,7 @@
package models
type KelainanLabModel struct {
Mcu_KelainanID string `db:"Mcu_KelainanID"`
Mcu_KelainanName string `db:"Test"`
Total int `db:"total"`
}

View File

@@ -0,0 +1,7 @@
package models
type KelNonLabModel struct {
Mcu_KelainanID string `db:"Mcu_KelainanID"`
Test string `db:"Test"`
Total int `db:"total"`
}

View File

@@ -0,0 +1,16 @@
package models
type TotalPesertaModel struct {
Peserta int `db:"peserta"`
Total int `db:"total"`
}
type GenderPesertaModel struct {
M_PatientGender string `db:"M_PatientGender"`
Jumlah int `db:"Jumlah"`
}
type UmurPesertaModel struct {
Umur string `db:"umur"`
Total int `db:"total"`
}

View File

@@ -0,0 +1,122 @@
package corporate_services
import (
"bytes"
"cpone/db"
"cpone/models"
"cpone/package/config"
"encoding/json"
"io"
"net/http"
)
type AccountService struct {
AccountStore db.AppStore
}
func NewAccountService(aStore db.AppStore) *AccountService {
return &AccountService{
AccountStore: aStore,
}
}
func (as *AccountService) ChangePasswordPIC(host string, token string, currPassword string, newPassword string) (models.ResponseStatus, error) {
var ret models.ResponseStatus
uri := "https://" + config.Data.Get("servername") + "/one-api/mockup/system/menu/change_password_pic"
params, _ := json.Marshal(map[string]string{
"new": newPassword,
"old": currPassword,
"token": token,
})
paramsBody := bytes.NewBuffer(params)
req, err := http.Post(uri, "application/json", paramsBody)
if err != nil {
ret = models.ResponseStatus{
Status: "ERR",
Message: "error request change password",
}
return ret, err
}
defer req.Body.Close()
resp, err := io.ReadAll(req.Body)
if err != nil {
ret = models.ResponseStatus{
Status: "ERR",
Message: "error read response",
}
return ret, err
}
err = json.Unmarshal(resp, &ret)
if err != nil {
ret = models.ResponseStatus{
Status: "ERR",
Message: "error unmarshal response",
}
return ret, err
}
return ret, nil
}
func (as *AccountService) ChangePasswordPAT(token string, currPassword string, newPassword string) (models.ResponseStatus, error) {
var ret models.ResponseStatus
uri := "https://" + config.Data.Get("servername") + "/one-api/mockup/system/menu/change_password_pat"
// params := url.Values{}
// params.Add("new", newPassword)
// params.Add("old", currPassword)
// params.Add("token", token)
// req, err := http.PostForm(uri, params)
// if err != nil {
// ret = models.ResponseStatus{
// Status: "ERR",
// Message: "error request change password",
// }
// return ret, err
// }
// defer req.Body.Close()
params, _ := json.Marshal(map[string]string{
"new": newPassword,
"old": currPassword,
"token": token,
})
paramsBody := bytes.NewBuffer(params)
req, err := http.Post(uri, "application/json", paramsBody)
if err != nil {
ret = models.ResponseStatus{
Status: "ERR",
Message: "error request change password",
}
return ret, err
}
defer req.Body.Close()
resp, err := io.ReadAll(req.Body)
if err != nil {
ret = models.ResponseStatus{
Status: "ERR",
Message: "error read response",
}
return ret, err
}
err = json.Unmarshal(resp, &ret)
if err != nil {
ret = models.ResponseStatus{
Status: "ERR",
Message: "error unmarshal response",
}
return ret, err
}
return ret, nil
}

View File

@@ -71,7 +71,29 @@ func (ea *DashboardPicServices) DummyDataTest() ([]models.DashboardPic, error) {
return employees, nil
}
func (ea *DashboardPicServices) ListingDashboardPic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.DashboardPic, int, error) {
func (ea *DashboardPicServices) GetCorporateName(userID string) (string, error) {
var corpName string
q := `
SELECT
CorporateName
FROM mgm_mcuuser
JOIN mgm_mcu ON Mgm_McuID = Mgm_McuUserMgm_McuID
JOIN corporate ON CorporateID = Mgm_McuCorporateID
WHERE Mgm_McuUserID = ?
`
if err := dbx.Handlex.Get(&corpName, q, userID); err != nil {
return "PT. ABC", err
}
if corpName == "" {
corpName = "Perusahaan A"
}
return corpName, nil
}
func (ea *DashboardPicServices) ListingDashboardPic(email string, search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.DashboardPic, int, error) {
logger, _ := zap.NewProduction()
var ret []models.DashboardPic
var totalData int
@@ -85,19 +107,9 @@ func (ea *DashboardPicServices) ListingDashboardPic(search string, startdate str
prmLabel := "%" + search + "%"
offset := (currentpage - 1) * rowperpage
q := `
SELECT COUNT(*)
FROM mgm_mcu
WHERE Mgm_McuIsActive = 'Y'
AND Mgm_McuLabel LIKE ?
AND Mgm_McuStartDate >= ?
AND Mgm_McuEndDate <= ?
`
if err := dbx.Handlex.Get(&totalData, q, prmLabel, startdate, enddate); err != nil {
return nil, 0, fmt.Errorf("error query get total data: %v", err)
}
q = `
logger.Info("Params", zap.Any("email", email))
q := `
SELECT
Mgm_McuID,
Mgm_McuLabel,
@@ -111,17 +123,20 @@ func (ea *DashboardPicServices) ListingDashboardPic(search string, startdate str
DATE_FORMAT(Mgm_McuEndDate, '%d-%m-%Y') AS Mgm_McuEndDate,
Mgm_McuIsActive
FROM mgm_mcu
WHERE Mgm_McuIsActive = 'Y'
JOIN mgm_mcuuser ON Mgm_McuUserMgm_McuID = Mgm_McuID
WHERE Mgm_McuUserEmail = ?
AND Mgm_McuIsActive = 'Y'
AND Mgm_McuLabel LIKE ?
AND Mgm_McuStartDate >= ?
AND Mgm_McuEndDate <= ?
ORDER BY Mgm_McuID ASC
LIMIT ? OFFSET ?
`
if err := dbx.Handlex.Select(&ret, q, prmLabel, startdate, enddate, rowperpage, offset); err != nil {
if err := dbx.Handlex.Select(&ret, q, email, prmLabel, startdate, enddate, rowperpage, offset); err != nil {
return nil, 0, fmt.Errorf("error query get data: %v", err)
}
logger.Info("Resp", zap.Any("Respsone", ret))
totalData = len(ret)
logger.Info("Response", zap.Any("data", ret), zap.Any("total data", totalData))
totalPage := int(math.Ceil(float64(totalData) / float64(rowperpage)))
return ret, totalPage, nil

View File

@@ -4,6 +4,7 @@ import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"fmt"
)
type McuDetailServices struct {
@@ -63,3 +64,48 @@ func (mcud *McuDetailServices) GetBreadcrumb(id string) (models.BreadCrumbV1, er
return breadcrumb, nil
}
func (mcud *McuDetailServices) GetTabNameList(id string) ([]models.McuTabModels, error) {
var ret []models.McuTabModels
q := `
SELECT
Mcu_ImageGrafikGroupResult,
Mcu_ImageGrafikGroupMenu,
Mcu_ImageGrafikName,
Mcu_ImageGrafikJsonRender
FROM mgm_mcugrafik
JOIN mcu_image_grafik ON Mcu_ImageGrafikID = Mgm_McuGrafikMcu_ImageGrafikID
WHERE Mgm_McuGrafikMgm_McuID = ?
AND Mgm_McuGrafikIsActive = 'Y'
GROUP BY Mcu_ImageGrafikGroupMenu, Mcu_ImageGrafikGroupResult
ORDER BY Mcu_ImageGrafikID
`
if err := dbx.Handlex.Select(&ret, q, id); err != nil {
return ret, fmt.Errorf("error get data tab name: %v", err)
}
for i, d := range ret {
switch d.Mcu_ImageGrafikGroupMenu {
case "SUMMARY":
if d.Mcu_ImageGrafikGroupResult == "LAB" {
ret[i].TabID = "tabkelainanlab"
ret[i].TabName = "Kelainan Lab"
} else if d.Mcu_ImageGrafikGroupResult == "NONLAB" {
ret[i].TabID = "tabkelainannonlab"
ret[i].TabName = "Kelainan Non Lab"
} else {
ret[i].TabID = "tabkelainanfisik"
ret[i].TabName = "Kelainan Fisik"
}
case "GLOBAL":
ret[i].TabID = "tabkelainanglobal"
ret[i].TabName = "Kelainan Global"
case "PESERTA":
ret[i].TabID = "tabkepesertaan"
ret[i].TabName = "Peserta"
}
}
return ret, nil
}

View File

@@ -1,11 +1,18 @@
package mcu_corporate_services
import (
"bytes"
"cpone/db"
"cpone/models"
"cpone/package/config"
dbx "cpone/package/database"
"database/sql"
"encoding/json"
"errors"
"fmt"
"io"
"math"
"net/http"
"strconv"
"go.uber.org/zap"
@@ -21,8 +28,7 @@ func NewTabDaftarPesertaServices(uStore db.AppStore) *TabDaftarPesertaServices {
}
}
func (tdps *TabDaftarPesertaServices) GetListMcuDaftarPeserta(id string, currentpage int, rowperpage int) ([]models.ModelMcuDaftarPeserta, int, error) {
logger, _ := zap.NewProduction()
func (tdps *TabDaftarPesertaServices) GetListDaftarPesertaMCU(id string, currentpage int, rowperpage int) ([]models.ModelMcuDaftarPeserta, int, error) {
var listDaftarPeserta []models.ModelMcuDaftarPeserta
var totalData int
offset := (currentpage - 1) * rowperpage
@@ -37,9 +43,66 @@ func (tdps *TabDaftarPesertaServices) GetListMcuDaftarPeserta(id string, current
return nil, 0, fmt.Errorf("error querying database: %v", err)
}
query := `SELECT T_OrderHeaderID,
query := `
SELECT *,
GROUP_CONCAT(test_paket) as list_paket
FROM (
SELECT
T_OrderHeaderID,
T_OrderHeaderDate,
IFNULL(T_OrderHeaderLabNumber, 0) AS T_OrderHeaderLabNumber,
T_OrderHeaderM_PatientAge,
M_PatientID,
M_PatientNoReg,
M_PatientName,
M_PatientGender,
CASE
WHEN M_PatientGender = 'male' THEN 'Laki - Laki'
WHEN M_PatientGender = 'female' THEN 'Perempuan'
ELSE ' '
END AS jenisKelamin,
DATE_FORMAT(M_PatientDOB, '%d %M %Y') AS M_PatientDOB,
FLOOR(DATEDIFF(CURDATE(), M_PatientDOB)/ 365.25) AS age,
IFNULL(authPatientEmail, "none") AS authPatientEmail,
IFNULL(authPatientIsActive, "N") AS authPatientIsActive,
CASE
WHEN T_OrderDetailOrderIsPacket = 'Y' THEN T_OrderDetailOrderT_PacketName
ELSE T_OrderDetailOrderT_TestName
END AS test_paket
FROM t_orderheader
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive = 'Y'
JOIN t_orderdetailorder ON T_OrderDetailOrderT_OrderHeaderID = T_OrderHeaderID
AND T_OrderDetailOrderIsActive = 'Y'
LEFT JOIN auth_patient ON M_PatientID = authPatientM_PatientID AND authPatientIsActive = 'Y'
WHERE T_OrderHeaderIsActive = 'Y' AND T_OrderHeaderMgm_McuID = ?
) x
GROUP BY T_OrderHeaderID
ORDER BY T_OrderHeaderLabNumber ASC
LIMIT ? OFFSET ?
`
if err := dbx.Handlex.Select(&listDaftarPeserta, query, id, rowperpage, offset); err != nil {
return nil, 0, fmt.Errorf("error querying database: %v", err)
}
totalPage := int(math.Ceil(float64(totalData) / float64(rowperpage)))
return listDaftarPeserta, totalPage, nil
}
func (tdps *TabDaftarPesertaServices) SearchDaftarPesertaMCU(mcuID string, keyword string, page int, perPage int) ([]models.ModelMcuDaftarPeserta, int, error) {
var listDaftarPeserta []models.ModelMcuDaftarPeserta
var totalData int
prmWord := "%" + keyword + "%"
offset := (page - 1) * perPage
sqlt := `
SELECT COUNT(*) as total
FROM (
SELECT
T_OrderHeaderID,
T_OrderHeaderDate,
T_OrderHeaderLabNumber,
IFNULL(T_OrderHeaderLabNumber, 0) AS T_OrderHeaderLabNumber,
T_OrderHeaderM_PatientAge,
M_PatientID,
M_PatientNoReg,
@@ -50,89 +113,810 @@ func (tdps *TabDaftarPesertaServices) GetListMcuDaftarPeserta(id string, current
WHEN M_PatientGender = 'female' THEN 'Perempuan'
ELSE ' '
END AS jenisKelamin,
M_PatientDOB,
FLOOR(DATEDIFF(CURDATE(), M_PatientDOB)/ 365.25) AS age
DATE_FORMAT(M_PatientDOB, '%d %M %Y') AS M_PatientDOB,
FLOOR(DATEDIFF(CURDATE(), M_PatientDOB)/ 365.25) AS age,
IFNULL(authPatientEmail, "none") AS authPatientEmail,
IFNULL(authPatientIsActive, "N") AS authPatientIsActive,
CASE
WHEN T_OrderDetailOrderIsPacket = 'Y' THEN T_OrderDetailOrderT_PacketName
ELSE T_OrderDetailOrderT_TestName
END AS test_paket
FROM t_orderheader
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID
AND M_PatientIsActive = 'Y'
WHERE T_OrderHeaderIsActive = 'Y' AND T_OrderHeaderMgm_McuID = ?
ORDER BY M_PatientName ASC
LIMIT ? OFFSET ?`
if err := dbx.Handlex.Select(&listDaftarPeserta, query, id, rowperpage, offset); err != nil {
return nil, 0, fmt.Errorf("error querying database: %v", err)
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive = 'Y'
JOIN t_orderdetailorder ON T_OrderDetailOrderT_OrderHeaderID = T_OrderHeaderID
AND T_OrderDetailOrderIsActive = 'Y'
LEFT JOIN auth_patient ON M_PatientID = authPatientM_PatientID AND authPatientIsActive = 'Y'
WHERE T_OrderHeaderIsActive = 'Y' AND T_OrderHeaderMgm_McuID = ? AND (M_PatientName LIKE ? OR M_PatientNIP LIKE ?)
GROUP BY T_OrderHeaderID
)x
`
if err := dbx.Handlex.Get(&totalData, sqlt, mcuID, prmWord, prmWord); err != nil {
return listDaftarPeserta, 0, fmt.Errorf("error querying database: %v", err)
}
totalPage := int(math.Ceil(float64(totalData) / float64(rowperpage)))
defer logger.Sync()
logger.Info("GET DATA PESERTA",
zap.Any("id", id),
zap.Any("total data", totalData),
zap.Any("peserta", listDaftarPeserta),
)
sql := `
SELECT *,
GROUP_CONCAT(test_paket) as list_paket
FROM (
SELECT
T_OrderHeaderID,
T_OrderHeaderDate,
IFNULL(T_OrderHeaderLabNumber, 0) AS T_OrderHeaderLabNumber,
T_OrderHeaderM_PatientAge,
M_PatientID,
M_PatientNoReg,
M_PatientName,
M_PatientGender,
CASE
WHEN M_PatientGender = 'male' THEN 'Laki - Laki'
WHEN M_PatientGender = 'female' THEN 'Perempuan'
ELSE ' '
END AS jenisKelamin,
DATE_FORMAT(M_PatientDOB, '%d %M %Y') AS M_PatientDOB,
FLOOR(DATEDIFF(CURDATE(), M_PatientDOB)/ 365.25) AS age,
IFNULL(authPatientEmail, "none") AS authPatientEmail,
IFNULL(authPatientIsActive, "N") AS authPatientIsActive,
CASE
WHEN T_OrderDetailOrderIsPacket = 'Y' THEN T_OrderDetailOrderT_PacketName
ELSE T_OrderDetailOrderT_TestName
END AS test_paket
FROM t_orderheader
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive = 'Y'
JOIN t_orderdetailorder ON T_OrderDetailOrderT_OrderHeaderID = T_OrderHeaderID
AND T_OrderDetailOrderIsActive = 'Y'
LEFT JOIN auth_patient ON M_PatientID = authPatientM_PatientID AND authPatientIsActive = 'Y'
WHERE T_OrderHeaderIsActive = 'Y' AND T_OrderHeaderMgm_McuID = ?
AND (M_PatientName LIKE ? OR M_PatientNIP LIKE ?)
) x
GROUP BY T_OrderHeaderID
ORDER BY T_OrderHeaderLabNumber ASC
LIMIT ? OFFSET ?
`
if err := dbx.Handlex.Select(&listDaftarPeserta, sql, mcuID, prmWord, prmWord, perPage, offset); err != nil {
return listDaftarPeserta, 0, fmt.Errorf("error querying database: %v", err)
}
totalPage := int(math.Ceil(float64(totalData) / float64(perPage)))
return listDaftarPeserta, totalPage, nil
}
func (tdps *TabDaftarPesertaServices) GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error) {
var ret []models.TabViewReportMcu
var data []models.ModelMcuPesertaReport
var totalData int
func (tdps *TabDaftarPesertaServices) DetailTestdanPaket(orderheaderID string) ([]models.TableTestPaket, error) {
var listPaket []models.DetailPaketMCU
var listTest []models.DetailTestMCU
var ret []models.TableTestPaket
q := `
SELECT COUNT(*)
FROM so_resultentry
WHERE So_ResultEntryT_OrderHeaderID = ?
AND So_ResultEntryIsActive = 'Y'
`
if err := dbx.Handlex.Get(&totalData, q, orderheaderID); err != nil {
return ret, fmt.Errorf("error get total mcu report: %v", err)
}
q = `
// get list test name
qr := `
SELECT
So_ResultEntryID,
So_ResultEntryT_OrderHeaderID,
So_ResultEntryNonlab_TemplateID,
So_ResultEntryNonlab_TemplateName
FROM so_resultentry
WHERE So_ResultEntryT_OrderHeaderID = ?
AND So_ResultEntryIsActive = 'Y'
ORDER BY So_ResultEntryNonlab_TemplateID
T_OrderDetailOrderT_TestID,
T_OrderDetailOrderT_TestName
FROM t_orderdetailorder
WHERE T_OrderDetailOrderT_OrderHeaderID = ?
AND T_OrderDetailOrderIsActive = 'Y'
AND T_OrderDetailOrderIsPacket = 'N'
`
if err := dbx.Handlex.Select(&data, q, orderheaderID); err != nil {
if err := dbx.Handlex.Select(&listTest, qr, orderheaderID); err != nil {
return ret, err
}
// Lab
ret = append(ret, models.TabViewReportMcu{Name: "Hasil Laboratorium", Link: "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_test.rptdesign&__format=pdf&PID=" + orderheaderID + "&username=adhi&tm=1717726294764"})
// get detail paket
q := `
SELECT DISTINCT
T_OrderDetailOrderT_PacketID,
T_OrderDetailOrderT_PacketName,
T_TestName
FROM t_orderdetailorder
JOIN t_packet ON T_PacketID = T_OrderDetailOrderT_PacketID
JOIN t_packetdetail ON T_PacketDetailT_PacketID = T_PacketID
JOIN t_test ON T_PacketDetailT_TestID = T_TestID
WHERE T_OrderDetailOrderT_OrderHeaderID = ?
`
if err := dbx.Handlex.Select(&listPaket, q, orderheaderID); err != nil {
return ret, err
}
// Non-lab
for _, n := range data {
var link models.TabViewReportMcu
nomor := 1
for _, d := range listTest {
ret = append(ret, models.TableTestPaket{
Nomor: nomor,
NamaTest: d.T_OrderDetailOrderT_TestName,
NamaPaket: d.T_OrderDetailOrderT_TestName,
})
nomor++
}
switch n.So_ResultEntryNonlab_TemplateName {
case "ECG":
link.Name = "Elektromedis"
link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_elmd.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&username=adhi&tm=1717726294764"
case "Thorax PA":
link.Name = "Radiologi"
link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_xray.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&username=adhi&tm=1717726294764"
case "Fisik Umum":
namaFisik := []string{"Hasil Fisik", "Hasil Pajanan", "Riwayat"}
linkFisik := []string{
"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_fisik.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=fisik&username=adhi&tm=1717726294764",
"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_pajanan.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=fisik&username=adhi&tm=1717726294764",
"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_riwayat.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=riwayat&username=adhi&tm=1717726294764",
}
for i := 0; i < 3; i++ {
ret = append(ret, models.TabViewReportMcu{Name: namaFisik[i], Link: linkFisik[i]})
}
continue
}
ret = append(ret, link)
for _, d := range listPaket {
ret = append(ret, models.TableTestPaket{
Nomor: nomor,
NamaTest: d.T_TestName,
NamaPaket: d.T_OrderDetailOrderT_PacketName,
})
nomor++
}
return ret, nil
}
func (tdps *TabDaftarPesertaServices) GenerataPasswordMCU(mgmMCUID string, host string) (models.GeneratePasswordResponse, error) {
logger, _ := zap.NewProduction()
var ret models.GeneratePasswordResponse
uri := "https://" + config.Data.Get("servername") + "/one-api/tools/auth_patient/generate/" + mgmMCUID
payload := []byte{}
resp, err := http.Post(uri, "application/json", bytes.NewBuffer(payload))
if err != nil {
return ret, fmt.Errorf("error request generate password: %v", err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
return ret, fmt.Errorf("error read body respoonse")
}
if err := json.Unmarshal(body, &ret); err != nil {
return ret, fmt.Errorf("error unmarshal json respoonse")
}
defer logger.Sync()
logger.Info("response", zap.Any("data", ret))
return ret, nil
}
func (tdps *TabDaftarPesertaServices) GetAkunPeserta(patientID string) (models.AuthPatient, error) {
// logger, _ := zap.NewProduction()
var ret models.AuthPatient
q := `
SELECT
authPatientID,
authPatientM_PatientID,
authPatientEmail,
authPatientPassword,
authPatientIsActive
FROM auth_patient
WHERE authPatientM_PatientID = ?
AND authPatientIsActive = 'Y'
`
if err := dbx.Handlex.Get(&ret, q, patientID); err != nil {
return ret, fmt.Errorf("error get akun peserta")
}
// logger.Info("response", zap.Any("data", ret))
return ret, nil
}
func (tdps *TabDaftarPesertaServices) ResetPasswordPeserta(token string, newPassword string, email string, authuserid string) (models.ResponseStatus, error) {
var ret models.ResponseStatus
uri := "https://" + config.Data.Get("servername") + "/one-api/mockup/system/menu/reset_password_pat"
params, _ := json.Marshal(map[string]string{
"new": newPassword,
"email": email,
"authuserid": authuserid,
"token": token,
})
paramsBody := bytes.NewBuffer(params)
resp, err := http.Post(uri, "application/json", paramsBody)
if err != nil {
ret = models.ResponseStatus{
Status: "ERR",
Message: "error request change password",
}
return ret, err
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
ret = models.ResponseStatus{
Status: "ERR",
Message: "error read response",
}
return ret, err
}
err = json.Unmarshal(body, &ret)
if err != nil {
ret = models.ResponseStatus{
Status: "ERR",
Message: "error unmarshal response",
}
return ret, err
}
return ret, nil
}
func (tdps *TabDaftarPesertaServices) GetListReportPesertaV3(orderheaderID string, staffname string) ([]models.TabViewReportMcu, error) {
var returnTab []models.TabViewReportMcu
var GroupResultOrder []models.GroupResultOrderModel
var SoResultData []models.SoResultEntryReportModel
q := `
SELECT
gr.Group_ResultID,
gr.Group_ResultName,
gr.Group_ResultResumeMcu,
gr.Group_ResultUrl,
gr.Group_ResultIsOrderHeader,
gro.Group_ResultOrderOrder,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail todtl
JOIN t_test tt ON todtl.T_OrderDetailT_TestID = tt.T_TestID
AND tt.T_TestIsActive = 'Y'
JOIN group_resultdetail grd ON tt.T_TestID = grd.Group_ResultDetailT_TestID
AND grd.Group_ResultDetailIsActive = 'Y'
JOIN group_result gr ON grd.Group_ResultDetailGroup_ResultID = gr.Group_ResultID
AND gr.Group_ResultIsActive = 'Y'
JOIN group_resultorder gro ON gro.Group_ResultOrderGroup_ResultID = gr.Group_ResultID
AND Group_ResultOrderIsActive = 'Y'
WHERE todtl.T_OrderDetailT_OrderHeaderID = ?
AND todtl.T_OrderDetailIsActive = 'Y'
GROUP BY gr.Group_ResultID
ORDER BY gro.Group_ResultOrderOrder
`
if err := dbx.Handlex.Select(&GroupResultOrder, q, orderheaderID); err != nil {
return returnTab, fmt.Errorf("error get group result order: %v", err)
}
q = `
SELECT
sre.So_ResultEntryID,
sre.So_ResultEntryT_OrderHeaderID,
sre.So_ResultEntryT_OrderDetailID,
sre.So_ResultEntryNonlab_TemplateID,
sre.So_ResultEntryNonlab_TemplateName
FROM t_orderdetail tdet
JOIN t_test tt ON tdet.T_OrderDetailT_TestID = tt.T_TestID
AND tt.T_TestIsActive = 'Y'
JOIN so_resultentry sre ON sre.So_ResultEntryT_OrderDetailID = tdet.T_OrderDetailID
AND sre.So_ResultEntryIsActive = 'Y'
WHERE tdet.T_OrderDetailT_OrderHeaderID = ?
AND tdet.T_OrderDetailIsActive = 'Y'
`
if err := dbx.Handlex.Select(&SoResultData, q, orderheaderID); err != nil {
return returnTab, fmt.Errorf("error get so result data non lab: %v", err)
}
mapSoResultData := map[string]int{}
for _, so := range SoResultData {
switch so.So_ResultEntryNonlab_TemplateName {
case "ECG":
mapSoResultData["Elektromedik"] = so.So_ResultEntryID
case "Thorax PA":
mapSoResultData["Rontgen"] = so.So_ResultEntryID
case "Fisik Umum", "Fisik Umum K3":
mapSoResultData["FISIK"] = so.So_ResultEntryID
default:
mapSoResultData[so.So_ResultEntryNonlab_TemplateName] = so.So_ResultEntryID
}
}
for _, group := range GroupResultOrder {
var urlMap map[string]string
if err := json.Unmarshal([]byte(group.Group_ResultUrl), &urlMap); err != nil {
return returnTab, fmt.Errorf("error parsing json: %v", err)
}
switch group.Group_ResultResumeMcu {
case "FISIK":
soResultID := strconv.Itoa(mapSoResultData["FISIK"])
if soResultID != "0" {
for key, value := range urlMap {
returnTab = append(returnTab, models.TabViewReportMcu{
Name: key,
Link: value + "&username=" + staffname + "&PID=" + soResultID + "&tm=" + group.Datetime,
})
}
}
case "NONLAB":
soResultID := strconv.Itoa(mapSoResultData[group.Group_ResultName])
if soResultID != "0" {
for _, value := range urlMap {
returnTab = append(returnTab, models.TabViewReportMcu{
Name: group.Group_ResultName,
Link: value + "&username=" + staffname + "&PID=" + soResultID + "&tm=" + group.Datetime,
})
}
}
case "LAB":
for _, value := range urlMap {
returnTab = append(returnTab, models.TabViewReportMcu{
Name: group.Group_ResultName,
Link: value + "&username=" + staffname + "&PID=" + orderheaderID + "&tm=" + group.Datetime,
})
}
default:
for _, value := range urlMap {
returnTab = append(returnTab, models.TabViewReportMcu{
Name: group.Group_ResultName,
Link: value + "&username=" + staffname + "&PID=" + orderheaderID + "&tm=" + group.Datetime,
})
}
}
}
return returnTab, nil
}
func (tdps *TabDaftarPesertaServices) GetListReportPesertaV4(orderheaderID string, staffname string) ([]models.TabViewReportMcu, error) {
var returnTab []models.TabViewReportMcu
var profile_patient models.PatientMCU
lab_rpt := ""
sql_prof := `
SELECT
toh.T_OrderHeaderID,
toh.T_OrderHeaderLabNumber,
mp.M_PatientID,
mp.M_PatientName,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderheader toh
JOIN m_patient mp ON toh.T_OrderHeaderM_PatientID = mp.M_PatientID
AND mp.M_PatientIsActive = 'Y'
WHERE toh.T_OrderHeaderID = ? AND toh.T_OrderHeaderIsActive = 'Y'
`
if err := dbx.Handlex.Get(&profile_patient, sql_prof, orderheaderID); err != nil {
if errors.Is(err, sql.ErrNoRows) {
profile_patient = models.PatientMCU{}
} else {
return returnTab, fmt.Errorf("error get group result order: %v", err)
}
}
if profile_patient.T_OrderHeaderLabNumber != "" {
lab_rpt = "/birt/frameset?__report=report/one/lab/rpt_test_portal.rptdesign&__format=pdf&PID=" + profile_patient.T_OrderHeaderID + "&tm=" + profile_patient.Datetime + "&username=" + staffname
}
var so_data_rpt []models.SoRptData
fisik := ""
rontgen := ""
ekg := ""
audiometri := ""
spirometri := ""
treadmill := ""
papsmear := ""
sql_rpt := `
SELECT DISTINCT group_resultName as rpt_name,
IFNULL(So_ResultEntryID,0) as so_id,
T_OrderDetailT_OrderHeaderID as order_id,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail
JOIN t_test ON T_OrderDetailT_TestID = T_TestID
JOIN group_resultdetail ON Group_ResultDetailT_TestID = T_TestID
JOIN group_result ON Group_ResultID = Group_ResultDetailGroup_ResultID AND
Group_ResultFlagPerTest = 'N' AND Group_ResultName <> 'LAB' AND Group_ResultFlagNonLab = 'N'
LEFT JOIN so_resultentry ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND So_ResultEntryIsActive = 'Y'
WHERE
T_OrderDetailT_OrderHeaderID = ? AND Group_ResultName <> 'Tanpa Hasil'
UNION
SELECT DISTINCT group_resultName as rpt_name,
IFNULL(So_ResultEntryID,0) as so_id,
T_OrderDetailT_OrderHeaderID as order_id,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail
JOIN t_test ON T_OrderDetailT_TestID = T_TestID
JOIN t_samplingso ON T_SamplingSoT_OrderHeaderID = T_OrderDetailT_OrderHeaderID AND
T_SamplingSoT_TestID = T_TestID
JOIN group_resultdetail ON Group_ResultDetailT_TestID = T_TestID
JOIN group_result ON Group_ResultID = Group_ResultDetailGroup_ResultID AND
Group_ResultFlagPerTest = 'N' AND Group_ResultName <> 'LAB' AND Group_ResultFlagNonLab = 'Y'
LEFT JOIN so_resultentry ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND So_ResultEntryIsActive = 'Y'
WHERE
T_OrderDetailT_OrderHeaderID = ? AND Group_ResultName <> 'Tanpa Hasil'
UNION
SELECT DISTINCT T_TestName as rpt_name,
IFNULL(So_ResultEntryID,0) as so_id,
T_OrderDetailT_OrderHeaderID as order_id,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail
JOIN t_test ON T_OrderDetailT_TestID = T_TestID AND T_TestName NOT IN ('Visus Mata','Buta Warna','Pemeriksaan Lapang Pandang')
JOIN t_samplingso ON T_SamplingSoT_OrderHeaderID = T_OrderDetailT_OrderHeaderID AND
T_SamplingSoT_TestID = T_TestID
JOIN group_resultdetail ON Group_ResultDetailT_TestID = T_TestID
JOIN group_result ON Group_ResultID = Group_ResultDetailGroup_ResultID AND
Group_ResultFlagPerTest = 'Y' AND Group_ResultFlagNonLab = 'Y'
LEFT JOIN so_resultentry ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND So_ResultEntryIsActive = 'Y'
WHERE
T_OrderDetailT_OrderHeaderID = ? AND Group_ResultName <> 'Tanpa Hasil'
`
if err := dbx.Handlex.Select(&so_data_rpt, sql_rpt, orderheaderID, orderheaderID, orderheaderID); err != nil {
if errors.Is(err, sql.ErrNoRows) {
so_data_rpt = []models.SoRptData{}
} else {
return returnTab, fmt.Errorf("error get data so_id: %v", err)
}
}
for _, d := range so_data_rpt {
switch d.Rpt_name {
case "Pemeriksaan Fisik":
fisik = "/birt/frameset?__report=report/one/mcu/mcu_fisik_history_v2_portal.rptdesign&__format=pdf&PType=fisik&PLang=1&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
// fisik = "/birt/run?__report=report/one/mcu/mcu_fisik_history_v2_portal.rptdesign&__format=pdf&PType=fisik&PLang=1&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Rontgen":
rontgen = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_xray_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Audiometri":
audiometri = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_audiometri_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Spirometri":
spirometri = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_spirometri_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "ECG":
ekg = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_ecg_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Treadmill":
treadmill = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_treadmill_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Papsmear":
papsmear = "/birt/frameset?__report=report/one/lab/rpt_test_papsmear_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
}
}
var ResumeData models.ResumeMCU
kesimpulan := ""
// cover := ""
sql_resume := `
SELECT
Mcu_ResumeID,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM mcu_resume
WHERE Mcu_ResumeT_OrderHeaderID = ?
AND Mcu_ResumeIsActive = 'Y' AND Mcu_ResumeStatus = 'VAL'
`
if err := dbx.Handlex.Get(&ResumeData, sql_resume, orderheaderID); err != nil {
if errors.Is(err, sql.ErrNoRows) {
ResumeData = models.ResumeMCU{}
} else {
return returnTab, fmt.Errorf("error get data resume id: %v", err)
}
}
if ResumeData.Mcu_ResumeID != "" {
// cover = "/birt/frameset?__report=report/one/mcu/rpt_mcu_resume_cover_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + ResumeData.Mcu_ResumeID + "&tm=" + ResumeData.Datetime
kesimpulan = "/birt/frameset?__report=report/one/mcu/rpt_mcu_saran_kesimpulan_v2_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + ResumeData.Mcu_ResumeID + "&tm=" + ResumeData.Datetime
}
if fisik != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Fisik", Link: fisik})
}
if rontgen != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Rontgen", Link: rontgen})
}
if ekg != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Elektromedik", Link: ekg})
}
if audiometri != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Audiometri", Link: audiometri})
}
if spirometri != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Spirometri", Link: spirometri})
}
if treadmill != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Treadmill", Link: treadmill})
}
if kesimpulan != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Kesimpulan", Link: kesimpulan})
}
if lab_rpt != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Lab", Link: lab_rpt})
}
if papsmear != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Papsmear", Link: papsmear})
}
return returnTab, nil
}
func (tdps *TabDaftarPesertaServices) GetListReportPesertaV5(orderheaderID string, mcuid string, staffname string) ([]models.TabViewReportMcu, error) {
var returnTab []models.TabViewReportMcu
var profile_patient models.PatientMCU
var tahunan_mcu int
sqlmgm := `
SELECT Mgm_McuReportHasil
FROM mgm_mcu
WHERE Mgm_McuID = ?
`
if err := dbx.Handlex.Get(&tahunan_mcu, sqlmgm, mcuid); err != nil {
if errors.Is(err, sql.ErrNoRows) {
tahunan_mcu = 1
} else {
return returnTab, fmt.Errorf("error get type tahunan mcur: %v", err)
}
}
lab_rpt := ""
sql_prof := `
SELECT
toh.T_OrderHeaderID,
toh.T_OrderHeaderLabNumber,
mp.M_PatientID,
mp.M_PatientName,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderheader toh
JOIN m_patient mp ON toh.T_OrderHeaderM_PatientID = mp.M_PatientID
AND mp.M_PatientIsActive = 'Y'
WHERE toh.T_OrderHeaderID = ? AND toh.T_OrderHeaderIsActive = 'Y'
`
if err := dbx.Handlex.Get(&profile_patient, sql_prof, orderheaderID); err != nil {
if errors.Is(err, sql.ErrNoRows) {
profile_patient = models.PatientMCU{}
} else {
return returnTab, fmt.Errorf("error get group result order: %v", err)
}
}
if profile_patient.T_OrderHeaderLabNumber != "" {
if tahunan_mcu != 1 {
lab_rpt = "/birt/frameset?__report=report/one/lab/rpt_test_history_portal.rptdesign&__format=pdf&PID=" + profile_patient.T_OrderHeaderID + "&tm=" + profile_patient.Datetime + "&username=" + staffname
} else {
lab_rpt = "/birt/frameset?__report=report/one/lab/rpt_test_portal.rptdesign&__format=pdf&PID=" + profile_patient.T_OrderHeaderID + "&tm=" + profile_patient.Datetime + "&username=" + staffname
}
}
var so_data_rpt []models.SoRptData
fisik := ""
rontgen := ""
ekg := ""
audiometri := ""
spirometri := ""
treadmill := ""
papsmear := ""
mikro := ""
usg := ""
sds := ""
sql_rpt := `
SELECT DISTINCT group_resultName as rpt_name,
IFNULL(So_ResultEntryID,0) as so_id,
T_OrderDetailT_OrderHeaderID as order_id,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail
JOIN t_test ON T_OrderDetailT_TestID = T_TestID
JOIN group_resultdetail ON Group_ResultDetailT_TestID = T_TestID
JOIN group_result ON Group_ResultID = Group_ResultDetailGroup_ResultID AND
Group_ResultFlagPerTest = 'N' AND Group_ResultName <> 'LAB' AND Group_ResultFlagNonLab = 'N'
LEFT JOIN so_resultentry ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND So_ResultEntryIsActive = 'Y'
WHERE
T_OrderDetailT_OrderHeaderID = ? AND Group_ResultName <> 'Tanpa Hasil'
UNION
SELECT DISTINCT group_resultName as rpt_name,
IFNULL(So_ResultEntryID,0) as so_id,
T_OrderDetailT_OrderHeaderID as order_id,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail
JOIN t_test ON T_OrderDetailT_TestID = T_TestID
JOIN t_samplingso ON T_SamplingSoT_OrderHeaderID = T_OrderDetailT_OrderHeaderID AND
T_SamplingSoT_TestID = T_TestID
JOIN group_resultdetail ON Group_ResultDetailT_TestID = T_TestID
JOIN group_result ON Group_ResultID = Group_ResultDetailGroup_ResultID AND
Group_ResultFlagPerTest = 'N' AND Group_ResultName <> 'LAB' AND Group_ResultFlagNonLab = 'Y'
LEFT JOIN so_resultentry ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND So_ResultEntryIsActive = 'Y'
WHERE
T_OrderDetailT_OrderHeaderID = ? AND Group_ResultName <> 'Tanpa Hasil'
UNION
SELECT DISTINCT T_TestName as rpt_name,
IFNULL(So_ResultEntryID,0) as so_id,
T_OrderDetailT_OrderHeaderID as order_id,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail
JOIN t_test ON T_OrderDetailT_TestID = T_TestID AND T_TestName NOT IN ('Visus Mata','Buta Warna','Pemeriksaan Lapang Pandang')
JOIN t_samplingso ON T_SamplingSoT_OrderHeaderID = T_OrderDetailT_OrderHeaderID AND
T_SamplingSoT_TestID = T_TestID
JOIN group_resultdetail ON Group_ResultDetailT_TestID = T_TestID
JOIN group_result ON Group_ResultID = Group_ResultDetailGroup_ResultID AND
Group_ResultFlagPerTest = 'Y' AND Group_ResultFlagNonLab = 'Y'
LEFT JOIN so_resultentry ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND So_ResultEntryIsActive = 'Y'
WHERE
T_OrderDetailT_OrderHeaderID = ? AND Group_ResultName <> 'Tanpa Hasil'
`
if err := dbx.Handlex.Select(&so_data_rpt, sql_rpt, orderheaderID, orderheaderID, orderheaderID); err != nil {
if errors.Is(err, sql.ErrNoRows) {
so_data_rpt = []models.SoRptData{}
} else {
return returnTab, fmt.Errorf("error get data so_id: %v", err)
}
}
for _, d := range so_data_rpt {
if tahunan_mcu != 1 {
switch d.Rpt_name {
case "Pemeriksaan Fisik":
// fisik = "/birt/frameset?__report=report/one/mcu/mcu_fisik_history_portal.rptdesign&__format=pdf&PType=fisik&PLang=1&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
fisik = "/birt/run?__report=report/one/mcu/mcu_fisik_history_portal.rptdesign&__format=pdf&PType=fisik&PLang=1&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Rontgen":
rontgen = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_radiology_2_annual_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Audiometri":
audiometri = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_audiometri_2_annual_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Spirometri":
spirometri = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_spirometri_2_annual_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "ECG":
ekg = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_ecg_2_annual_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Treadmill":
treadmill = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_treadmill_2_annual_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Papsmear":
papsmear = "/birt/frameset?__report=report/one/lab/rpt_test_papsmear_history_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.Order_id + "&tm=" + d.Datetime
case "Mikro":
mikro = "/birt/run?__report=report/one/lab/rpt_test_mikro_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.Order_id + "&tm=" + d.Datetime
case "USG", "USG Abdominal Aorta", "USG Upp & Low Abdomen":
usg = "/birt/run?__report=report/one/lab/rpt_hasil_so_usg_2_annual_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "SDS":
if d.So_id != "0" {
tipval := ""
tpe := `SELECT So_ResultEntrySDSTypeValue as tipval
FROM so_resultentrysds_type WHERE So_ResultEntrySDSTypeSo_ResultEntryID = ?
AND So_ResultEntrySDSTypeIsActive = 'Y' LIMIT 1`
if err := dbx.Handlex.Get(&tipval, tpe, d.So_id); err != nil {
if errors.Is(err, sql.ErrNoRows) {
} else {
return returnTab, fmt.Errorf("error get sds type value : %v", err)
}
}
if tipval != "" {
sds = "/birt/run?__report=report/one/lab/rpt_hasil_so_sds.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&PType=" + tipval + "&tm=" + d.Datetime
}
}
}
} else {
switch d.Rpt_name {
case "Pemeriksaan Fisik":
// fisik = "/birt/frameset?__report=report/one/mcu/mcu_fisik_history_v2_portal.rptdesign&__format=pdf&PType=fisik&PLang=1&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
fisik = "/birt/run?__report=report/one/mcu/mcu_fisik_history_v2_portal.rptdesign&__format=pdf&PType=fisik&PLang=1&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Rontgen":
rontgen = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_xray_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Audiometri":
audiometri = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_audiometri_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Spirometri":
spirometri = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_spirometri_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "ECG":
ekg = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_ecg_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Treadmill":
treadmill = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_treadmill_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Papsmear":
papsmear = "/birt/frameset?__report=report/one/lab/rpt_test_papsmear_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.Order_id + "&tm=" + d.Datetime
case "Mikro":
mikro = "/birt/run?__report=report/one/lab/rpt_test_mikro_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.Order_id + "&tm=" + d.Datetime
case "USG", "USG Abdominal Aorta", "USG Upp & Low Abdomen":
usg = "/birt/run?__report=report/one/lab/rpt_hasil_so_usg_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "SDS":
if d.So_id != "0" {
tipval := ""
tpe := `SELECT So_ResultEntrySDSTypeValue as tipval
FROM so_resultentrysds_type WHERE So_ResultEntrySDSTypeSo_ResultEntryID = ?
AND So_ResultEntrySDSTypeIsActive = 'Y' LIMIT 1`
if err := dbx.Handlex.Get(&tipval, tpe, d.So_id); err != nil {
if errors.Is(err, sql.ErrNoRows) {
} else {
return returnTab, fmt.Errorf("error get sds type value : %v", err)
}
}
if tipval != "" {
sds = "/birt/run?__report=report/one/lab/rpt_hasil_so_sds_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&PType=" + tipval + "&tm=" + d.Datetime
}
}
}
}
}
var ResumeData models.ResumeMCU
kesimpulan := ""
// cover := ""
sql_resume := `
SELECT
Mcu_ResumeID,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM mcu_resume
WHERE Mcu_ResumeT_OrderHeaderID = ?
AND Mcu_ResumeIsActive = 'Y' AND Mcu_ResumeStatus = 'VAL'
`
if err := dbx.Handlex.Get(&ResumeData, sql_resume, orderheaderID); err != nil {
if errors.Is(err, sql.ErrNoRows) {
ResumeData = models.ResumeMCU{}
} else {
return returnTab, fmt.Errorf("error get data resume id: %v", err)
}
}
if ResumeData.Mcu_ResumeID != "" {
if tahunan_mcu != 1 {
kesimpulan = "/birt/frameset?__report=report/one/mcu/rpt_mcu_saran_kesimpulan_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + ResumeData.Mcu_ResumeID + "&tm=" + ResumeData.Datetime
} else {
kesimpulan = "/birt/frameset?__report=report/one/mcu/rpt_mcu_saran_kesimpulan_v2_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + ResumeData.Mcu_ResumeID + "&tm=" + ResumeData.Datetime
}
// cover = "/birt/frameset?__report=report/one/mcu/rpt_mcu_resume_cover_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + ResumeData.Mcu_ResumeID + "&tm=" + ResumeData.Datetime
}
additional := ""
if fisik == "" {
id_add := ""
sql_additional := `SELECT So_ResultEntryID FROM t_orderdetail
JOIN so_resultentry ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND So_ResultEntryIsActive = 'Y'
WHERE T_OrderDetailT_OrderHeaderID = ? AND T_OrderDetailIsActive = 'Y' AND T_OrderDetailT_TestID IN (2571,2573,3450,2572) LIMIT 1`
if err := dbx.Handlex.Get(&id_add, sql_additional, orderheaderID); err != nil {
if errors.Is(err, sql.ErrNoRows) {
} else {
return returnTab, fmt.Errorf("error get additional rpt: %v", err)
}
}
if id_add != "" {
if tahunan_mcu != 1 {
additional = "/birt/run?__report=report/one/mcu/mcu_fisik_ttbbmata_history_portal.rptdesign&__format=pdf&username=" + staffname + "&PType=fisik&PID=" + id_add + "&PLang=1&tm="
} else {
additional = "/birt/run?__report=report/one/mcu/mcu_fisik_ttbbmata_portal.rptdesign&__format=pdf&username=" + staffname + "&PType=fisik&PID=" + id_add + "&PLang=1&tm="
}
}
}
if fisik != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Fisik", Link: fisik})
}
if rontgen != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Rontgen", Link: rontgen})
}
if usg != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "USG", Link: usg})
}
if ekg != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Elektromedik", Link: ekg})
}
if audiometri != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Audiometri", Link: audiometri})
}
if spirometri != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Spirometri", Link: spirometri})
}
if treadmill != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Treadmill", Link: treadmill})
}
if sds != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "SDS", Link: sds})
}
if kesimpulan != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Kesimpulan", Link: kesimpulan})
}
if lab_rpt != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Lab", Link: lab_rpt})
}
if papsmear != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Papsmear", Link: papsmear})
}
if mikro != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Mikro", Link: mikro})
}
if additional != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Tambahan", Link: additional})
}
return returnTab, nil
}
func (tdps *TabDaftarPesertaServices) GetListAttachmentFile(orderheaderID string) ([]models.AttachmentFIle, error) {
list_file := []models.AttachmentFIle{}
sql := `
SELECT
File_AttachmentID,
File_AttachmentFileName
FROM t_orderheader
JOIN file_attachment ON File_AttachmentT_OrderHeaderID = T_OrderHeaderID
AND T_OrderHeaderID = ? AND File_AttachmentIsActive = 'Y'
ORDER BY File_AttachmentID ASC`
if err := dbx.Handlex.Select(&list_file, sql, orderheaderID); err != nil {
return list_file, err
}
url := "/one-media/one-files/"
for i, v := range list_file {
list_file[i].Link = url + v.File_AttachmentFileName
}
return list_file, nil
}

View File

@@ -0,0 +1,589 @@
package mcu_corporate_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"cpone/utils"
"fmt"
"math"
"strconv"
"go.uber.org/zap"
)
type TabKelainanFisikServices struct {
TabKelainanFisikStore db.AppStore
}
func NewTabKelainanFisikServices(store db.AppStore) *TabKelainanFisikServices {
return &TabKelainanFisikServices{
TabKelainanFisikStore: store,
}
}
func (tkf *TabKelainanFisikServices) GetPieChartConf(title string, subtext string, data []models.SeriesData) (models.Piechart, error) {
option := models.Piechart{
Title: struct {
Text string `json:"text"`
SubText string `json:"subtext"`
Left string `json:"left"`
}{
Text: title,
SubText: subtext,
Left: "center",
},
Tooltip: struct {
Trigger string `json:"trigger"`
}{
Trigger: "item",
},
Legend: struct {
Top string `json:"top"`
Left string `json:"left"`
Orient string `json:"orient"`
Height int `json:"height"`
}{
Top: "bottom",
Left: "center",
Orient: "vertical",
Height: 75,
},
Series: []models.Series{
{
Label: struct {
Position string `json:"position"`
Formatter string `json:"formatter"`
}{
Position: "inner",
Formatter: "{d}%",
},
Name: "Access From",
Type: "pie",
Radius: []string{"20%", "50%"},
ItemStyle: struct {
BorderRadius int `json:"borderRadius"`
BorderColor string `json:"borderColor"`
BorderWidth int `json:"borderWidth"`
}{
BorderRadius: 10,
BorderColor: "#fff",
BorderWidth: 2,
},
Data: data,
Emphasis: struct {
ItemStyle struct {
ShadowBlur int `json:"shadowBlur"`
ShadowOffsetX int `json:"shadowOffsetX"`
ShadowColor string `json:"shadowColor"`
} `json:"itemStyle"`
}{
ItemStyle: struct {
ShadowBlur int `json:"shadowBlur"`
ShadowOffsetX int `json:"shadowOffsetX"`
ShadowColor string `json:"shadowColor"`
}{
ShadowBlur: 10,
ShadowOffsetX: 0,
ShadowColor: "rgba(0, 0, 0, 0.5)",
},
},
},
},
}
return option, nil
}
func (tkf *TabKelainanFisikServices) GetBarChartConf(title string, data models.BarDataset) (models.Barchart, error) {
isEmpty := ""
if len(data.Source) <= 1 {
isEmpty = "Data tidak ditemukan"
}
option := models.Barchart{}
option.Title = struct {
Text string "json:\"text\""
Left string `json:"left"`
}{
Text: title,
Left: "center",
}
option.Dataset = data
option.Grid.ContainLabel = true
option.XAxis.Name = "person"
option.YAxis.Type = "category"
option.VisualMap.Orient = "horizontal"
option.VisualMap.Left = "center"
option.VisualMap.Min = 0
option.VisualMap.Max = 10
option.VisualMap.Show = false
option.VisualMap.Dimension = 0
option.VisualMap.InRange.Color = []string{"#035bff", "#42aaf5", "#00eaf2"}
option.Series = []struct {
Label struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
} "json:\"label\""
Type string "json:\"type\""
Encode struct {
X string "json:\"x\""
Y string "json:\"y\""
} "json:\"encode\""
}{
{
Label: struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
}{
Position: "right",
Show: true,
Formatter: "{@[3]} %",
},
Type: "bar",
Encode: struct {
X string "json:\"x\""
Y string "json:\"y\""
}{
X: "amount",
Y: "product",
},
},
}
option.Tooltip = struct {
Trigger string "json:\"trigger\""
AxisPointer struct {
Type string "json:\"type\""
} "json:\"axisPointer\""
}{
Trigger: "axis",
AxisPointer: struct {
Type string "json:\"type\""
}{
Type: "shadow",
},
}
option.Graphic = struct {
Type string "json:\"type\""
Left string "json:\"left\""
Top string "json:\"top\""
Style struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
} "json:\"style\""
}{
Type: "text",
Left: "center",
Top: "middle",
Style: struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
}{
Text: isEmpty,
FontSize: "15",
FontWeight: "bold",
},
}
return option, nil
}
func (tkf *TabKelainanFisikServices) GetKelainanFisikPresentase(mcuID string) (models.Barchart, error) {
var option models.Barchart
var data []models.KelainanGlobalFisikModel
q := `
SELECT Mcu_KelainanName,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_fisik
JOIN t_orderheader ON T_KelainanFiskT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summaryfisik ON T_KelainanFiskMcu_FisikSummaryID = Mcu_SummaryFisikID AND
Mcu_SummaryFisikID NOT IN (63,67,68,69,70,71,72,73)
join mcu_kelainan on Mcu_SummaryFisikMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
where T_KelainanFiskIsActive = 'Y' and T_OrderHeaderMgm_McuID = ? AND
Mcu_KelainanClasification NOT IN ('who','kemenkes','JNC-VIII','ESC/ESH')
group by Mcu_KelainanID
ORDER BY total DESC
LIMIT 10
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data kelainan fisik: %v", err)
}
var jumlahPeserta models.TotalPesertaModel
q = `
SELECT
COUNT(distinct(T_OrderHeaderID)) as peserta,
COUNT( distinct(Mcu_PreregisterPatientsM_PatientID)) as total
FROM mcu_preregister_patients
LEFT JOIN t_orderheader ON Mcu_PreregisterPatientsT_OrderHeaderID = T_OrderHeaderID AND
T_OrderHeaderIsActive = 'Y'
WHERE
Mcu_PreregisterPatientsMgm_McuID = ? AND
Mcu_PreregisterPatientsIsActive = 'Y'
`
if err := dbx.Handlex.Get(&jumlahPeserta, q, mcuID); err != nil {
return option, fmt.Errorf("error get jumlah peserta %v", err)
}
title := "Kelainan Fisik (10 Terbesar)"
chartData := models.BarDataset{
Source: [][]interface{}{
{"score", "amount", "product", "percentage"},
},
}
for i, d := range data {
percentage := float64(d.Total) / float64(jumlahPeserta.Peserta) * 100
roundedPercentage := math.Round(percentage*100) / 100
percentStr := strconv.FormatFloat(roundedPercentage, 'f', -1, 64)
newText := utils.SplitStrings(d.Mcu_KelainanName, 2)
chartData.Source = append(chartData.Source, []interface{}{
i, d.Total, newText, percentStr,
})
}
option, err := tkf.GetBarChartConf(title, chartData)
if err != nil {
return option, fmt.Errorf("error insert data to barchart %v", err)
}
return option, nil
}
func (tkf *TabKelainanFisikServices) GetKelainanFisikBMI(mcuID string) (models.Piechart, error) {
logger, _ := zap.NewProduction()
var option models.Piechart
var data []models.KelainanFisikDataModel
q := `
SELECT Mcu_KelainanName as test,
Mcu_KelainanClasification,
count(distinct orderkel.T_OrderHeaderID) as total
FROM mcu_kelainan
JOIN mcu_summaryfisik ON Mcu_SummaryFisikMcu_KelainanID = Mcu_KelainanID AND
Mcu_SummaryFisikIsActive = 'Y'
LEFT JOIN t_kelainan_fisik ON T_KelainanFiskMcu_FisikSummaryID = Mcu_SummaryFisikID AND
T_KelainanFiskIsActive= 'Y'
LEFT JOIN t_orderheader orderkel ON T_KelainanFiskT_OrderHeaderID = orderkel.T_OrderHeaderID AND
orderkel.T_OrderHeaderIsActive = 'Y' AND orderkel.T_OrderHeaderMgm_McuID = ?
WHERE
Mcu_KelainanIsActive = 'Y' AND Mcu_KelainanClasification = 'asia_pacific'
group by Mcu_KelainanID
UNION
SELECT 'Normal' as test,
'asia_pacific' as Mcu_KelainanClasification,
ifnull(count(distinct T_OrderHeaderID) - summary_total_kelainan_bmi(?), 0) as total
FROM t_orderheader
WHERE
T_OrderHeaderMgm_McuID = ? AND T_OrderHeaderIsActive = 'Y'
group by T_OrderHeaderMgm_McuID
`
if err := dbx.Handlex.Select(&data, q, mcuID, mcuID, mcuID); err != nil {
return option, fmt.Errorf("error get data kel fisik bmi %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Status Index Masa Tubuh (BMI)"
subtext := ""
chartData := []models.SeriesData{}
if data != nil {
for _, d := range data {
chartData = append(chartData, models.SeriesData{
Value: d.Total,
Name: d.Test + ": " + strconv.Itoa(d.Total) + " Peserta",
})
}
} else {
chartData = append(chartData, models.SeriesData{Value: 0, Name: "No Data"})
}
option, err := tkf.GetPieChartConf(title, subtext, chartData)
if err != nil {
return option, fmt.Errorf("error get & insert data into chart: %v", err)
}
return option, nil
}
func (tkf *TabKelainanFisikServices) GetKelainanFisikHipertensi(mcuID string) (models.Piechart, error) {
logger, _ := zap.NewProduction()
var option models.Piechart
var data []models.KelainanFisikDataModel
q := `
SELECT Mcu_KelainanName as test,
Mcu_KelainanClasification,
count(distinct orderkel.T_OrderHeaderID) as total
FROM mcu_kelainan
JOIN mcu_summaryfisik ON Mcu_SummaryFisikMcu_KelainanID = Mcu_KelainanID AND
Mcu_SummaryFisikIsActive = 'Y'
LEFT JOIN t_kelainan_fisik ON T_KelainanFiskMcu_FisikSummaryID = Mcu_SummaryFisikID AND
T_KelainanFiskIsActive= 'Y'
LEFT JOIN t_orderheader orderkel ON T_KelainanFiskT_OrderHeaderID = orderkel.T_OrderHeaderID AND
orderkel.T_OrderHeaderIsActive = 'Y' AND orderkel.T_OrderHeaderMgm_McuID = ?
WHERE
Mcu_KelainanIsActive = 'Y' AND Mcu_KelainanClasification = 'JNC-VII'
group by Mcu_KelainanID
UNION
SELECT 'Normal' as test,
'JNC-VII' as Mcu_KelainanClasification,
IFNULL(COUNT(T_OrderHeaderID) - summary_total_kelainan_hipertensi(?), 0) as total
FROM t_orderheader
WHERE
T_OrderHeaderMgm_McuID = ? AND T_OrderHeaderIsActive = 'Y'
group by T_OrderHeaderMgm_McuID
`
if err := dbx.Handlex.Select(&data, q, mcuID, mcuID, mcuID); err != nil {
return option, fmt.Errorf("error get data kel fisik hipertensi: %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Kriteria Hipertensi"
subtext := ""
chartData := []models.SeriesData{}
if data != nil {
for _, d := range data {
chartData = append(chartData, models.SeriesData{
Value: d.Total,
Name: d.Test + ": " + strconv.Itoa(d.Total) + " Peserta",
})
}
} else {
chartData = append(chartData, models.SeriesData{Value: 0, Name: "No Data"})
}
option, err := tkf.GetPieChartConf(title, subtext, chartData)
if err != nil {
return option, fmt.Errorf("error get and insert data into piechart : %v", err)
}
return option, nil
}
func (tkf *TabKelainanFisikServices) GetKelainanFisikRefraksi(mcuID string) (models.Piechart, error) {
var option models.Piechart
var data []models.KelainanFisikDataModel
q := `
SELECT Mcu_KelainanName as test,
count(distinct orderkel.T_OrderHeaderID) as total
FROM mcu_kelainan
JOIN mcu_summaryfisik ON Mcu_SummaryFisikMcu_KelainanID = Mcu_KelainanID AND
Mcu_SummaryFisikIsActive = 'Y'
LEFT JOIN t_kelainan_fisik ON T_KelainanFiskMcu_FisikSummaryID = Mcu_SummaryFisikID AND
T_KelainanFiskIsActive= 'Y'
LEFT JOIN t_orderheader orderkel ON T_KelainanFiskT_OrderHeaderID = orderkel.T_OrderHeaderID AND
orderkel.T_OrderHeaderIsActive = 'Y' AND orderkel.T_OrderHeaderMgm_McuID = ?
WHERE
Mcu_KelainanIsActive = 'Y' AND Mcu_KelainanID IN (24,25)
group by Mcu_KelainanID
UNION
SELECT 'Normal' as test,
IFNULL(count(distinct T_OrderHeaderID) - summary_total_kelainan_visus(?), 0) as total
FROM t_orderheader
WHERE
T_OrderHeaderMgm_McuID = ? AND T_OrderHeaderIsActive = 'Y'
group by T_OrderHeaderMgm_McuID
`
if err := dbx.Handlex.Select(&data, q, mcuID, mcuID, mcuID); err != nil {
return option, fmt.Errorf("error get data kel fisik refraksi: %v", err)
}
title := "Refraksi"
subtext := ""
chartData := []models.SeriesData{}
if data != nil {
for _, d := range data {
chartData = append(chartData, models.SeriesData{
Value: d.Total,
Name: d.Test + ": " + strconv.Itoa(d.Total) + " Peserta",
})
}
} else {
chartData = append(chartData, models.SeriesData{Value: 0, Name: "No Data"})
}
option, err := tkf.GetPieChartConf(title, subtext, chartData)
if err != nil {
return option, fmt.Errorf("error get and insert data to chart: %v", err)
}
return option, nil
}
func (tkf *TabKelainanFisikServices) GetKelFisikAlkohol(mcuID string) (models.Piechart, error) {
var option models.Piechart
var data []models.KelainanFisikDataModel
q := `
SELECT
Mcu_KelainanName as test,
COUNT( distinct T_OrderHeaderID) as total
FROM mcu_kelainan
JOIN mcu_summaryfisik ON Mcu_SummaryFisikMcu_KelainanID = Mcu_KelainanID AND
Mcu_KelainanIsActive = 'Y' AND Mcu_KelainanID IN (117,118,119)
LEFT JOIN t_kelainan_fisik ON T_KelainanFiskMcu_FisikSummaryID = Mcu_SummaryFisikID AND
T_KelainanFiskIsActive = 'Y'
LEFT JOIN so_resultentry ON T_KelainanFiskSo_ResultEntryID = So_ResultEntryID AND
So_ResultEntryIsActive = 'Y'
LEFT JOIN so_resultentry_fisik_umum ON So_ResultEntryFisikUmumSo_ResultEntryID = So_ResultEntryID AND
So_ResultEntryFisikUmumIsActive = 'Y'
LEFT JOIN t_orderheader ON So_ResultEntryT_OrderHeaderID = T_OrderHeaderID AND
T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data kel fisik konsumsi alkohol: %v", err)
}
title := "Konsumsi Alkohol"
subtext := ""
chartData := []models.SeriesData{}
if data != nil {
for _, d := range data {
chartData = append(chartData, models.SeriesData{
Value: d.Total,
Name: d.Test + ": " + strconv.Itoa(d.Total) + " Peserta",
})
}
} else {
chartData = append(chartData, models.SeriesData{Value: 0, Name: "No Data"})
}
option, err := tkf.GetPieChartConf(title, subtext, chartData)
if err != nil {
return option, fmt.Errorf("error get and insert data to chart: %v", err)
}
return option, nil
}
func (tkf *TabKelainanFisikServices) GetKelFisikMerokok(mcuID string) (models.Piechart, error) {
var option models.Piechart
var data []models.KelainanFisikDataModel
q := `
SELECT Mcu_KelainanName as test, COUNT( distinct T_OrderHeaderID) as total
FROM mcu_kelainan
JOIN mcu_summaryfisik ON Mcu_SummaryFisikMcu_KelainanID = Mcu_KelainanID AND
Mcu_KelainanIsActive = 'Y' AND Mcu_KelainanID IN (120,121,122)
LEFT JOIN t_kelainan_fisik ON T_KelainanFiskMcu_FisikSummaryID = Mcu_SummaryFisikID AND
T_KelainanFiskIsActive = 'Y'
LEFT JOIN so_resultentry ON T_KelainanFiskSo_ResultEntryID = So_ResultEntryID AND
So_ResultEntryIsActive = 'Y'
LEFT JOIN so_resultentry_fisik_umum ON So_ResultEntryFisikUmumSo_ResultEntryID = So_ResultEntryID AND
So_ResultEntryFisikUmumIsActive = 'Y'
LEFT JOIN t_orderheader ON So_ResultEntryT_OrderHeaderID = T_OrderHeaderID AND
T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data kel fisik merokok %v", err)
}
title := "Merokok"
subtext := ""
chartData := []models.SeriesData{}
if data != nil {
for _, d := range data {
chartData = append(chartData, models.SeriesData{
Value: d.Total,
Name: d.Test + ": " + strconv.Itoa(d.Total) + " Peserta",
})
}
} else {
chartData = append(chartData, models.SeriesData{Value: 0, Name: "No Data"})
}
option, err := tkf.GetPieChartConf(title, subtext, chartData)
if err != nil {
return option, fmt.Errorf("error get and insert data into chart %v", err)
}
return option, nil
}
func (tkf *TabKelainanFisikServices) GetKelFisikOlahraga(mcuID string) (models.Piechart, error) {
var option models.Piechart
var data []models.KelainanFisikDataModel
q := `
SELECT Mcu_KelainanName as test, COUNT( distinct T_OrderHeaderID) as total
FROM mcu_kelainan
JOIN mcu_summaryfisik ON Mcu_SummaryFisikMcu_KelainanID = Mcu_KelainanID AND
Mcu_KelainanIsActive = 'Y' AND Mcu_KelainanID IN (123,124)
LEFT JOIN t_kelainan_fisik ON T_KelainanFiskMcu_FisikSummaryID = Mcu_SummaryFisikID AND
T_KelainanFiskIsActive = 'Y'
LEFT JOIN so_resultentry ON T_KelainanFiskSo_ResultEntryID = So_ResultEntryID AND
So_ResultEntryIsActive = 'Y'
LEFT JOIN so_resultentry_fisik_umum ON So_ResultEntryFisikUmumSo_ResultEntryID = So_ResultEntryID AND
So_ResultEntryFisikUmumIsActive = 'Y'
LEFT JOIN t_orderheader ON So_ResultEntryT_OrderHeaderID = T_OrderHeaderID AND
T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data kel fisik olahraga %v", err)
}
title := "Olahraga"
subtext := ""
chartData := []models.SeriesData{}
if data != nil {
for _, d := range data {
chartData = append(chartData, models.SeriesData{
Value: d.Total,
Name: d.Test + ": " + strconv.Itoa(d.Total) + " Peserta",
})
}
} else {
chartData = append(chartData, models.SeriesData{Value: 0, Name: "No Data"})
}
option, err := tkf.GetPieChartConf(title, subtext, chartData)
if err != nil {
return option, fmt.Errorf("error get and insert data to chart %v", err)
}
return option, nil
}
func (tkf *TabKelainanFisikServices) GetChartRenderFisik(mcuID string) ([]models.McuTabModels, error) {
var ret []models.McuTabModels
q := `
SELECT
Mcu_ImageGrafikGroupResult,
Mcu_ImageGrafikGroupMenu,
Mcu_ImageGrafikName,
Mcu_ImageGrafikJsonRender
FROM mgm_mcugrafik
JOIN mcu_image_grafik ON Mcu_ImageGrafikID = Mgm_McuGrafikMcu_ImageGrafikID
WHERE Mgm_McuGrafikMgm_McuID = ?
AND Mcu_ImageGrafikGroupResult = "FISIK"
AND Mgm_McuGrafikIsActive = 'Y'
ORDER BY Mcu_ImageGrafikID
`
if err := dbx.Handlex.Select(&ret, q, mcuID); err != nil {
return ret, fmt.Errorf("error get data tab peserta: %v", err)
}
return ret, nil
}

View File

@@ -0,0 +1,349 @@
package mcu_corporate_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"cpone/utils"
"fmt"
"math"
"strconv"
"go.uber.org/zap"
)
type TabKelainanGlobalServices struct {
TabKelainanGlobalServicesStore db.AppStore
}
func NewTabKelainanGlobalServices(store db.AppStore) *TabKelainanGlobalServices {
return &TabKelainanGlobalServices{
TabKelainanGlobalServicesStore: store,
}
}
func (tkg *TabKelainanGlobalServices) GetBarChartConf(title string, data models.BarDataset) (models.Barchart, error) {
isEmpty := ""
if len(data.Source) <= 1 {
isEmpty = "Data tidak ditemukan"
}
option := models.Barchart{}
option.Title = struct {
Text string "json:\"text\""
Left string `json:"left"`
}{
Text: title,
Left: "center",
}
option.Dataset = data
option.Grid.ContainLabel = true
option.XAxis.Name = "person"
option.YAxis.Type = "category"
option.VisualMap.Orient = "horizontal"
option.VisualMap.Left = "center"
option.VisualMap.Min = 0
option.VisualMap.Max = 10
option.VisualMap.Show = false
option.VisualMap.Dimension = 0
option.VisualMap.InRange.Color = []string{"#035bff", "#42aaf5", "#00eaf2"}
option.Series = []struct {
Label struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
} "json:\"label\""
Type string "json:\"type\""
Encode struct {
X string "json:\"x\""
Y string "json:\"y\""
} "json:\"encode\""
}{
{
Label: struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
}{
Position: "right",
Show: true,
Formatter: "{@[3]} %",
},
Type: "bar",
Encode: struct {
X string "json:\"x\""
Y string "json:\"y\""
}{
X: "amount",
Y: "product",
},
},
}
option.Tooltip = struct {
Trigger string "json:\"trigger\""
AxisPointer struct {
Type string "json:\"type\""
} "json:\"axisPointer\""
}{
Trigger: "axis",
AxisPointer: struct {
Type string "json:\"type\""
}{
Type: "shadow",
},
}
option.Graphic = struct {
Type string "json:\"type\""
Left string "json:\"left\""
Top string "json:\"top\""
Style struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
} "json:\"style\""
}{
Type: "text",
Left: "center",
Top: "middle",
Style: struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
}{
Text: isEmpty,
FontSize: "15",
FontWeight: "bold",
},
}
return option, nil
}
func (tkg *TabKelainanGlobalServices) GetKelainanGlobalMCU(mcuID string) (models.Barchart, error) {
logger, _ := zap.NewProduction()
var option models.Barchart
var data []models.KelainanGlobalMCUModel
q := `
SELECT
IFNULL(Nat_TestName ,Mcu_KelainanGroupName) AS Test,
COUNT(Mgm_HeaderT_OrderHeaderID) 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_HeaderIsNormal = 'N'
GROUP BY Mcu_KelainanGroupID ORDER BY COUNT(Mgm_HeaderT_OrderHeaderID) DESC
`
// Mgm_DetailMcu_KelainanID ->> versi php
// Mcu_KelainanGroupID ->> versi excel
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data kelainan global mcu %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Kelainan MCU"
chartData := models.BarDataset{
Source: [][]interface{}{
{"score", "amount", "product", "percentage"},
},
}
max := 1
for _, d := range data {
if d.Total >= max {
max = d.Total
}
}
for i, d := range data {
percentage := float64(d.Total) / float64(max) * 100
roundedPercentage := math.Round(percentage*100) / 100
percentStr := strconv.FormatFloat(roundedPercentage, 'f', -1, 64)
chartData.Source = append(chartData.Source, []interface{}{
i, d.Total, d.Test, percentStr,
})
}
option, err := tkg.GetBarChartConf(title, chartData)
if err != nil {
return option, fmt.Errorf("error insert data to barchart %v", err)
}
return option, nil
}
func (tkg *TabKelainanGlobalServices) GetKelainanFisik(mcuID string) (models.Barchart, error) {
logger, _ := zap.NewProduction()
var option models.Barchart
var data []models.KelainanGlobalFisikModel
q := `
SELECT
Mcu_KelainanName,
COUNT(Mgm_HeaderT_OrderHeaderID) 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
WHERE Mgm_HeaderIsActive = 'Y' AND Mgm_HeaderMgm_McuID = ?
AND Mgm_HeaderType = 'F'
AND Mgm_HeaderIsNormal = 'N'
GROUP BY Mcu_KelainanID
ORDER BY total DESC
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data kelainan global fisik %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Kelainan Fisik"
chartData := models.BarDataset{
Source: [][]interface{}{
{"score", "amount", "product", "percentage"},
},
}
max := 1
for _, d := range data {
if d.Total >= max {
max = d.Total
}
}
for _, d := range data {
percentage := float64(d.Total) / float64(max) * 100
roundedPercentage := math.Round(percentage*100) / 100
percentStr := strconv.FormatFloat(roundedPercentage, 'f', -1, 64)
chartData.Source = append(chartData.Source, []interface{}{
d.Total, d.Total, d.Mcu_KelainanName, percentStr,
})
}
option, err := tkg.GetBarChartConf(title, chartData)
if err != nil {
return option, nil
}
return option, nil
}
func (tkg *TabKelainanGlobalServices) GetKelainanGlobalV2(mcuID string) (models.Barchart, error) {
var option models.Barchart
var data []models.KelainanGlobalModel
q := `
SELECT * FROM (
SELECT Mcu_KelainanID,
Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as Total
FROM t_kelainan_lab
JOIN t_orderheader ON T_KelainanLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarylab ON T_KelainanLabMcu_SummaryLabID = Mcu_SummaryLabID
join mcu_kelainan on Mcu_summaryLabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryLabNat_TestID = Nat_TestID AND T_KelainanLabNat_TestID = Mcu_SummaryLabNat_TestID
where T_KelainanLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
UNION
SELECT Mcu_KelainanID, Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as Total
FROM t_kelainan_nonlab
JOIN t_orderheader ON T_KelainanNonLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarynonlab ON T_KelainanNonLabMcu_SummaryNonlabID = Mcu_SummaryNonlabID
join mcu_kelainan on Mcu_SummaryNonlabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryNonlabNat_TestID = Nat_TestID AND
T_KelainanNonLabNat_TestID = Mcu_SummaryNonlabNat_TestID
where T_KelainanNonLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
UNION
SELECT Mcu_KelainanID, Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as Total
FROM t_kelainan_fisik
JOIN t_orderheader ON T_KelainanFiskT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summaryfisik ON T_KelainanFiskMcu_FisikSummaryID = Mcu_SummaryFisikID AND
Mcu_SummaryFisikID NOT IN (63,67,68,69,70,71,72,73)
join mcu_kelainan on Mcu_SummaryFisikMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
where T_KelainanFiskIsActive = 'Y' and T_OrderHeaderMgm_McuID = ? AND
Mcu_KelainanClasification NOT IN ('who','kemenkes','JNC-VIII','ESC/ESH')
group by Mcu_KelainanID
) a
ORDER BY total DESC
LIMIT 10
`
if err := dbx.Handlex.Select(&data, q, mcuID, mcuID, mcuID); err != nil {
return option, fmt.Errorf("error get data kelainan global %v", err)
}
var jumlahPeserta models.TotalPesertaModel
q = `
SELECT
COUNT(distinct(T_OrderHeaderID)) as peserta,
COUNT( distinct(Mcu_PreregisterPatientsM_PatientID)) as total
FROM mcu_preregister_patients
LEFT JOIN t_orderheader ON Mcu_PreregisterPatientsT_OrderHeaderID = T_OrderHeaderID AND
T_OrderHeaderIsActive = 'Y'
WHERE
Mcu_PreregisterPatientsMgm_McuID = ? AND
Mcu_PreregisterPatientsIsActive = 'Y'
`
if err := dbx.Handlex.Get(&jumlahPeserta, q, mcuID); err != nil {
return option, fmt.Errorf("error get jumlah peserta %v", err)
}
title := "Kelainan Global (10 Terbesar)"
chartData := models.BarDataset{
Source: [][]interface{}{
{"score", "amount", "product", "percentage"},
},
}
for i, d := range data {
percentage := float64(d.Total) / float64(jumlahPeserta.Peserta) * 100
roundedPercentage := math.Round(percentage*100) / 100
percentStr := strconv.FormatFloat(roundedPercentage, 'f', -1, 64)
newText := utils.SplitStrings(d.Test, 2)
chartData.Source = append(chartData.Source, []interface{}{
i, d.Total, newText, percentStr,
})
}
option, err := tkg.GetBarChartConf(title, chartData)
if err != nil {
return option, fmt.Errorf("error insert data to barchart %v", err)
}
return option, nil
}
func (tkg *TabKelainanGlobalServices) GetChartRenderGlobal(mcuID string) ([]models.McuTabModels, error) {
var ret []models.McuTabModels
q := `
SELECT
Mcu_ImageGrafikGroupResult,
Mcu_ImageGrafikGroupMenu,
Mcu_ImageGrafikName,
Mcu_ImageGrafikJsonRender
FROM mgm_mcugrafik
JOIN mcu_image_grafik ON Mcu_ImageGrafikID = Mgm_McuGrafikMcu_ImageGrafikID
WHERE Mgm_McuGrafikMgm_McuID = ?
AND Mcu_ImageGrafikGroupMenu = "GLOBAL"
AND Mgm_McuGrafikIsActive = 'Y'
ORDER BY Mcu_ImageGrafikID
`
if err := dbx.Handlex.Select(&ret, q, mcuID); err != nil {
return ret, fmt.Errorf("error get data tab peserta: %v", err)
}
return ret, nil
}

View File

@@ -0,0 +1,550 @@
package mcu_corporate_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"cpone/utils"
"fmt"
"math"
"strconv"
"go.uber.org/zap"
)
type TabKelainanLabServices struct {
TabKelainanLabStore db.AppStore
}
func NewTabKelainanLabServices(store db.AppStore) *TabKelainanLabServices {
return &TabKelainanLabServices{
TabKelainanLabStore: store,
}
}
func (tkl *TabKelainanLabServices) ConfBarchart(title string, data models.BarDataset) (models.Barchart, error) {
isEmpty := ""
if len(data.Source) <= 1 {
isEmpty = "Data tidak ditemukan"
}
option := models.Barchart{}
option.Title = struct {
Text string "json:\"text\""
Left string `json:"left"`
}{
Text: title,
Left: "center",
}
option.Dataset = data
option.Grid.ContainLabel = true
option.XAxis.Name = "person"
option.YAxis.Type = "category"
option.VisualMap.Orient = "horizontal"
option.VisualMap.Left = "center"
option.VisualMap.Min = 0
option.VisualMap.Max = 10
option.VisualMap.Show = false
option.VisualMap.Dimension = 0
option.VisualMap.InRange.Color = []string{"#035bff", "#42aaf5", "#00eaf2"}
option.Series = []struct {
Label struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
} "json:\"label\""
Type string "json:\"type\""
Encode struct {
X string "json:\"x\""
Y string "json:\"y\""
} "json:\"encode\""
}{
{
Label: struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
}{
Position: "right",
Show: true,
Formatter: "{@[3]} %",
},
Type: "bar",
Encode: struct {
X string "json:\"x\""
Y string "json:\"y\""
}{
X: "amount",
Y: "product",
},
},
}
option.Tooltip = struct {
Trigger string "json:\"trigger\""
AxisPointer struct {
Type string "json:\"type\""
} "json:\"axisPointer\""
}{
Trigger: "axis",
AxisPointer: struct {
Type string "json:\"type\""
}{
Type: "shadow",
},
}
option.Graphic = struct {
Type string "json:\"type\""
Left string "json:\"left\""
Top string "json:\"top\""
Style struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
} "json:\"style\""
}{
Type: "text",
Left: "center",
Top: "middle",
Style: struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
}{
Text: isEmpty,
FontSize: "15",
FontWeight: "bold",
},
}
return option, nil
}
func (tkl *TabKelainanLabServices) ConfBarchartVertical(title string, data []models.KelainanLabModel) (models.BarchartV2, error) {
chartData := models.BarDataset{
Source: [][]interface{}{
{"score", "amount", "product"},
},
}
isEmpty := ""
if len(data) == 0 {
isEmpty = "Data tidak ditemukan"
}
cnt := len(data)
for idx, d := range data {
newText := utils.SplitStrings(d.Mcu_KelainanName, 2)
chartData.Source = append(chartData.Source, []interface{}{
idx, d.Total, newText,
})
}
option := models.BarchartV2{
Title: struct {
Text string "json:\"text\""
Left string `json:"left"`
}{
Text: title,
Left: "center",
},
Dataset: struct {
Source [][]interface{} "json:\"source\""
}{chartData.Source},
Grid: struct {
ContainLabel bool "json:\"containLabel\""
}{true},
XAxis: struct {
Name string "json:\"name\""
Type string "json:\"type\""
AxisLabel struct {
Interval int "json:\"interval\""
Rotate int "json:\"rotate\""
} "json:\"axisLabel\""
}{
Name: "",
Type: "category",
AxisLabel: struct {
Interval int "json:\"interval\""
Rotate int "json:\"rotate\""
}{
Interval: 0,
Rotate: 0,
},
},
YAxis: struct {
Type string "json:\"type\""
Name string "json:\"name\""
NameTextStyle struct {
Align string "json:\"align\""
} "json:\"nameTextStyle\""
NameGap int "json:\"nameGap\""
}{
Type: "value",
Name: "",
NameTextStyle: struct {
Align string "json:\"align\""
}{
Align: "right",
},
NameGap: 20,
},
VisualMap: struct {
Orient string "json:\"orient\""
Left string "json:\"left\""
Min int "json:\"min\""
Max int "json:\"max\""
Dimension int "json:\"dimension\""
Show bool "json:\"show\""
InRange struct {
Color []string "json:\"color\""
} "json:\"inRange\""
}{
Orient: "horizontal",
Left: "center",
Min: 0,
Max: cnt,
Dimension: 0,
Show: false,
InRange: struct {
Color []string "json:\"color\""
}{
Color: []string{"#035bff", "#42aaf5", "#00eaf2"},
},
},
Series: []struct {
Label struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
} "json:\"label\""
Type string "json:\"type\""
Encode struct {
X string "json:\"x\""
Y string "json:\"y\""
} "json:\"encode\""
}{
{
Label: struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
}{
Position: "inside",
Show: true,
Formatter: "{@[1]}",
},
Type: "bar",
Encode: struct {
X string "json:\"x\""
Y string "json:\"y\""
}{
X: "product",
Y: "amount",
},
},
},
Tooltip: struct {
Trigger string "json:\"trigger\""
AxisPointer struct {
Type string "json:\"type\""
} "json:\"axisPointer\""
}{
Trigger: "axis",
AxisPointer: struct {
Type string "json:\"type\""
}{
Type: "shadow",
},
},
Graphic: struct {
Type string "json:\"type\""
Left string "json:\"left\""
Top string "json:\"top\""
Style struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
} "json:\"style\""
}{
Type: "text",
Left: "center",
Top: "middle",
Style: struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
}{
Text: isEmpty,
FontSize: "15",
FontWeight: "bold",
},
},
}
return option, nil
}
func (tkl *TabKelainanLabServices) GetDataPresentaseKelainanLab(mcuID string) (models.Barchart, error) {
logger, _ := zap.NewProduction()
var option models.Barchart
var data []models.KelainanLabModel
q := `
SELECT Mcu_KelainanID,
Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_lab
JOIN t_orderheader ON T_KelainanLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarylab ON T_KelainanLabMcu_SummaryLabID = Mcu_SummaryLabID
join mcu_kelainan on Mcu_summaryLabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryLabNat_TestID = Nat_TestID AND T_KelainanLabNat_TestID = Mcu_SummaryLabNat_TestID
where T_KelainanLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
LIMIT 10
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get kelainan lab %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Kelainan Lab (10 Terbesar)"
chartData := models.BarDataset{
Source: [][]interface{}{
{"score", "amount", "product", "percentage"},
},
}
var jumlahPeserta models.TotalPesertaModel
q = `
SELECT
COUNT(distinct(T_OrderHeaderID)) as peserta,
COUNT( distinct(Mcu_PreregisterPatientsM_PatientID)) as total
FROM mcu_preregister_patients
LEFT JOIN t_orderheader ON Mcu_PreregisterPatientsT_OrderHeaderID = T_OrderHeaderID AND
T_OrderHeaderIsActive = 'Y'
WHERE
Mcu_PreregisterPatientsMgm_McuID = ? AND
Mcu_PreregisterPatientsIsActive = 'Y'
`
if err := dbx.Handlex.Get(&jumlahPeserta, q, mcuID); err != nil {
return option, fmt.Errorf("error get jumlah peserta %v", err)
}
for i, d := range data {
percentage := float64(d.Total) / float64(jumlahPeserta.Peserta) * 100
roundedPercentage := math.Round(percentage*100) / 100
percentStr := strconv.FormatFloat(roundedPercentage, 'f', -1, 64)
newText := utils.SplitStrings(d.Mcu_KelainanName, 2)
chartData.Source = append(chartData.Source, []interface{}{
i, d.Total, newText, percentStr,
})
}
option, err := tkl.ConfBarchart(title, chartData)
if err != nil {
return option, fmt.Errorf("error insert data to chart %v", err)
}
return option, nil
}
func (tkl *TabKelainanLabServices) GetHematologi(mcuID string) (models.BarchartV2, error) {
logger, _ := zap.NewProduction()
var option models.BarchartV2
var data []models.KelainanLabModel
q := `
SELECT Mcu_KelainanID,
Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_lab
JOIN t_orderheader ON T_KelainanLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarylab ON T_KelainanLabMcu_SummaryLabID = Mcu_SummaryLabID
join mcu_kelainan on Mcu_summaryLabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID AND Mcu_KelainanGroupID = 14
JOIN nat_test ON Mcu_SummaryLabNat_TestID = Nat_TestID AND T_KelainanLabNat_TestID = Mcu_SummaryLabNat_TestID
where T_KelainanLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get hematologi %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Hematologi"
option, err := tkl.ConfBarchartVertical(title, data)
if err != nil {
return option, fmt.Errorf("error insert data to chart %v", err)
}
return option, nil
}
func (tkl *TabKelainanLabServices) GetUrinalisa(mcuID string) (models.BarchartV2, error) {
logger, _ := zap.NewProduction()
var option models.BarchartV2
var data []models.KelainanLabModel
q := `
SELECT Mcu_KelainanID,
Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_lab
JOIN t_orderheader ON T_KelainanLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarylab ON T_KelainanLabMcu_SummaryLabID = Mcu_SummaryLabID
join mcu_kelainan on Mcu_summaryLabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
AND Mcu_KelainanGroupID = 15
JOIN nat_test ON Mcu_SummaryLabNat_TestID = Nat_TestID
AND T_KelainanLabNat_TestID = Mcu_SummaryLabNat_TestID
where T_KelainanLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get urinalisa %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Urinalisa"
option, err := tkl.ConfBarchartVertical(title, data)
if err != nil {
return option, fmt.Errorf("error insert data to chart %v", err)
}
return option, nil
}
func (tkl *TabKelainanLabServices) GetGangguanFungsiHati(mcuID string) (models.BarchartV2, error) {
logger, _ := zap.NewProduction()
var option models.BarchartV2
var data []models.KelainanLabModel
q := `
SELECT Mcu_KelainanID,
Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_lab
JOIN t_orderheader ON T_KelainanLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarylab ON T_KelainanLabMcu_SummaryLabID = Mcu_SummaryLabID
join mcu_kelainan on Mcu_summaryLabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID AND Mcu_KelainanGroupID = 16
JOIN nat_test ON Mcu_SummaryLabNat_TestID = Nat_TestID AND T_KelainanLabNat_TestID = Mcu_SummaryLabNat_TestID
where T_KelainanLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get gangguan fungsi hati %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Gangguan Fungsi Hati"
option, err := tkl.ConfBarchartVertical(title, data)
if err != nil {
return option, fmt.Errorf("error insert data to chart %v", err)
}
return option, nil
}
func (tkl *TabKelainanLabServices) GetGangguanMetabolismeLemak(mcuID string) (models.BarchartV2, error) {
logger, _ := zap.NewProduction()
var option models.BarchartV2
var data []models.KelainanLabModel
q := `
SELECT Mcu_KelainanID,
Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_lab
JOIN t_orderheader ON T_KelainanLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarylab ON T_KelainanLabMcu_SummaryLabID = Mcu_SummaryLabID
join mcu_kelainan on Mcu_summaryLabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryLabNat_TestID = Nat_TestID AND
T_KelainanLabNat_TestID = Mcu_SummaryLabNat_TestID AND Nat_TestCode IN ( '10520300','10520400')
where T_KelainanLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get gangguan metabolisme lemak %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Gangguan Metabolisme Lemak"
option, err := tkl.ConfBarchartVertical(title, data)
if err != nil {
return option, fmt.Errorf("error insert data to chart %v", err)
}
return option, nil
}
func (tkl *TabKelainanLabServices) GetPeningkatanGlukosa(mcuID string) (models.BarchartV2, error) {
logger, _ := zap.NewProduction()
var option models.BarchartV2
var data []models.KelainanLabModel
q := `
SELECT Mcu_KelainanID,
Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_lab
JOIN t_orderheader ON T_KelainanLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarylab ON T_KelainanLabMcu_SummaryLabID = Mcu_SummaryLabID
join mcu_kelainan on Mcu_summaryLabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryLabNat_TestID = Nat_TestID AND
T_KelainanLabNat_TestID = Mcu_SummaryLabNat_TestID AND Nat_TestCode IN ( '10540200')
where T_KelainanLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get peningkatan glukosa %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Peningkatan Glukosa"
option, err := tkl.ConfBarchartVertical(title, data)
if err != nil {
return option, fmt.Errorf("error insert data to chart %v", err)
}
return option, nil
}
func (tkl *TabKelainanLabServices) GetChartRenderLab(mcuID string) ([]models.McuTabModels, error) {
var ret []models.McuTabModels
q := `
SELECT
Mcu_ImageGrafikGroupResult,
Mcu_ImageGrafikGroupMenu,
Mcu_ImageGrafikName,
Mcu_ImageGrafikJsonRender
FROM mgm_mcugrafik
JOIN mcu_image_grafik ON Mcu_ImageGrafikID = Mgm_McuGrafikMcu_ImageGrafikID
WHERE Mgm_McuGrafikMgm_McuID = ?
AND Mcu_ImageGrafikGroupResult = "LAB"
AND Mgm_McuGrafikIsActive = 'Y'
ORDER BY Mcu_ImageGrafikID
`
if err := dbx.Handlex.Select(&ret, q, mcuID); err != nil {
return ret, fmt.Errorf("error get data tab peserta: %v", err)
}
return ret, nil
}

View File

@@ -0,0 +1,516 @@
package mcu_corporate_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"cpone/utils"
"fmt"
"math"
"strconv"
"go.uber.org/zap"
)
type TabKelainanNonLabServices struct {
TabKelainanNonLabStore db.AppStore
}
func NewTabKelainanNonLabServices(store db.AppStore) *TabKelainanNonLabServices {
return &TabKelainanNonLabServices{
TabKelainanNonLabStore: store,
}
}
func (tknl *TabKelainanNonLabServices) GetBarChartConf(title string, data models.BarDataset) (models.Barchart, error) {
isEmpty := ""
if len(data.Source) <= 1 {
isEmpty = "Data tidak ditemukan"
}
option := models.Barchart{}
option.Title = struct {
Text string "json:\"text\""
Left string `json:"left"`
}{
Text: title,
Left: "center",
}
option.Dataset = data
option.Grid.ContainLabel = true
option.XAxis.Name = "person"
option.YAxis.Type = "category"
option.VisualMap.Orient = "horizontal"
option.VisualMap.Left = "center"
option.VisualMap.Min = 0
option.VisualMap.Max = 4
option.VisualMap.Show = false
option.VisualMap.Dimension = 0
option.VisualMap.InRange.Color = []string{"#035bff", "#42aaf5", "#00eaf2"}
option.Series = []struct {
Label struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
} "json:\"label\""
Type string "json:\"type\""
Encode struct {
X string "json:\"x\""
Y string "json:\"y\""
} "json:\"encode\""
}{
{
Label: struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
}{
Position: "right",
Show: true,
Formatter: "{@[3]} %",
},
Type: "bar",
Encode: struct {
X string "json:\"x\""
Y string "json:\"y\""
}{
X: "amount",
Y: "product",
},
},
}
option.Tooltip = struct {
Trigger string "json:\"trigger\""
AxisPointer struct {
Type string "json:\"type\""
} "json:\"axisPointer\""
}{
Trigger: "axis",
AxisPointer: struct {
Type string "json:\"type\""
}{
Type: "shadow",
},
}
option.Graphic = struct {
Type string "json:\"type\""
Left string "json:\"left\""
Top string "json:\"top\""
Style struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
} "json:\"style\""
}{
Type: "text",
Left: "center",
Top: "middle",
Style: struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
}{
Text: isEmpty,
FontSize: "15",
FontWeight: "bold",
},
}
return option, nil
}
func (tknl *TabKelainanNonLabServices) ConfBarchartVertical(title string, data []models.KelNonLabModel) (models.BarchartV2, error) {
chartData := models.BarDataset{
Source: [][]interface{}{
{"score", "amount", "product"},
},
}
isEmpty := ""
if len(data) == 0 {
isEmpty = "Data tidak ditemukan"
}
cnt := len(data)
for idx, d := range data {
// if len(d.Test) > 30 {
// var newText = d.Test[:30] + "- \n" + d.Test[30:]
// chartData.Source = append(chartData.Source, []interface{}{
// idx, d.Total, newText,
// })
// continue
// }
newText := utils.SplitStrings(d.Test, 2)
chartData.Source = append(chartData.Source, []interface{}{
idx, d.Total, newText,
})
}
option := models.BarchartV2{
Title: struct {
Text string "json:\"text\""
Left string `json:"left"`
}{
Text: title,
Left: "center",
},
Dataset: struct {
Source [][]interface{} "json:\"source\""
}{chartData.Source},
Grid: struct {
ContainLabel bool "json:\"containLabel\""
}{true},
XAxis: struct {
Name string "json:\"name\""
Type string "json:\"type\""
AxisLabel struct {
Interval int "json:\"interval\""
Rotate int "json:\"rotate\""
} "json:\"axisLabel\""
}{
Name: "",
Type: "category",
AxisLabel: struct {
Interval int "json:\"interval\""
Rotate int "json:\"rotate\""
}{
Interval: 0,
Rotate: 0,
},
},
YAxis: struct {
Type string "json:\"type\""
Name string "json:\"name\""
NameTextStyle struct {
Align string "json:\"align\""
} "json:\"nameTextStyle\""
NameGap int "json:\"nameGap\""
}{
Type: "value",
Name: "",
NameTextStyle: struct {
Align string "json:\"align\""
}{
Align: "right",
},
NameGap: 20,
},
VisualMap: struct {
Orient string "json:\"orient\""
Left string "json:\"left\""
Min int "json:\"min\""
Max int "json:\"max\""
Dimension int "json:\"dimension\""
Show bool "json:\"show\""
InRange struct {
Color []string "json:\"color\""
} "json:\"inRange\""
}{
Orient: "horizontal",
Left: "center",
Min: 0,
Max: cnt,
Dimension: 0,
Show: false,
InRange: struct {
Color []string "json:\"color\""
}{
Color: []string{"#035bff", "#42aaf5", "#00eaf2"},
},
},
Series: []struct {
Label struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
} "json:\"label\""
Type string "json:\"type\""
Encode struct {
X string "json:\"x\""
Y string "json:\"y\""
} "json:\"encode\""
}{
{
Label: struct {
Position string "json:\"position\""
Show bool "json:\"show\""
Formatter string "json:\"formatter\""
}{
Position: "inside",
Show: true,
Formatter: "{@[1]}",
},
Type: "bar",
Encode: struct {
X string "json:\"x\""
Y string "json:\"y\""
}{
X: "product",
Y: "amount",
},
},
},
Tooltip: struct {
Trigger string "json:\"trigger\""
AxisPointer struct {
Type string "json:\"type\""
} "json:\"axisPointer\""
}{
Trigger: "axis",
AxisPointer: struct {
Type string "json:\"type\""
}{
Type: "shadow",
},
},
Graphic: struct {
Type string "json:\"type\""
Left string "json:\"left\""
Top string "json:\"top\""
Style struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
} "json:\"style\""
}{
Type: "text",
Left: "center",
Top: "middle",
Style: struct {
Text string "json:\"text\""
FontSize string "json:\"fontSize\""
FontWeight string "json:\"fontWeight\""
}{
Text: isEmpty,
FontSize: "15",
FontWeight: "bold",
},
},
}
return option, nil
}
func (tknl *TabKelainanNonLabServices) GetDataKelNonLab(mcuID string) (models.Barchart, error) {
logger, _ := zap.NewProduction()
var option models.Barchart
var data []models.KelNonLabModel
q := `
SELECT Mcu_KelainanID, Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_nonlab
JOIN t_orderheader ON T_KelainanNonLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarynonlab ON T_KelainanNonLabMcu_SummaryNonlabID = Mcu_SummaryNonlabID
join mcu_kelainan on Mcu_SummaryNonlabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryNonlabNat_TestID = Nat_TestID AND
T_KelainanNonLabNat_TestID = Mcu_SummaryNonlabNat_TestID
where T_KelainanNonLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
LIMIT 10
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data kelainan global mcu %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Kelainan Non Lab (10 Terbesar)"
chartData := models.BarDataset{
Source: [][]interface{}{
{"score", "amount", "product", "percentage"},
},
}
var jumlahPeserta models.TotalPesertaModel
q = `
SELECT
COUNT(distinct(T_OrderHeaderID)) as peserta,
COUNT( distinct(Mcu_PreregisterPatientsM_PatientID)) as total
FROM mcu_preregister_patients
LEFT JOIN t_orderheader ON Mcu_PreregisterPatientsT_OrderHeaderID = T_OrderHeaderID AND
T_OrderHeaderIsActive = 'Y'
WHERE
Mcu_PreregisterPatientsMgm_McuID = ? AND
Mcu_PreregisterPatientsIsActive = 'Y'
`
if err := dbx.Handlex.Get(&jumlahPeserta, q, mcuID); err != nil {
return option, fmt.Errorf("error get jumlah peserta %v", err)
}
for i, d := range data {
percentage := float64(d.Total) / float64(jumlahPeserta.Peserta) * 100
roundedPercentage := math.Round(percentage*100) / 100
percentStr := strconv.FormatFloat(roundedPercentage, 'f', -1, 64)
newText := utils.SplitStrings(d.Test, 2)
chartData.Source = append(chartData.Source, []interface{}{
i, d.Total, newText, percentStr,
})
}
option, err := tknl.GetBarChartConf(title, chartData)
if err != nil {
return option, fmt.Errorf("error insert data to barchart %v", err)
}
return option, nil
}
func (tknl *TabKelainanNonLabServices) GetThoraxPA(mcuID string) (models.BarchartV2, error) {
logger, _ := zap.NewProduction()
var option models.BarchartV2
var data []models.KelNonLabModel
q := `
SELECT Mcu_KelainanID, Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_nonlab
JOIN t_orderheader ON T_KelainanNonLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarynonlab ON T_KelainanNonLabMcu_SummaryNonlabID = Mcu_SummaryNonlabID
join mcu_kelainan on Mcu_SummaryNonlabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryNonlabNat_TestID = Nat_TestID AND
T_KelainanNonLabNat_TestID = Mcu_SummaryNonlabNat_TestID AND Nat_TestID = 5798
where T_KelainanNonLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
LIMIT 10
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data thorax pa %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Thorax PA"
option, err := tknl.ConfBarchartVertical(title, data)
if err != nil {
return option, fmt.Errorf("error insert data into chart %v", err)
}
return option, nil
}
func (tknl *TabKelainanNonLabServices) GetGangguanJantung(mcuID string) (models.BarchartV2, error) {
var option models.BarchartV2
var data []models.KelNonLabModel
q := `
SELECT Mcu_KelainanID, Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_nonlab
JOIN t_orderheader ON T_KelainanNonLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarynonlab ON T_KelainanNonLabMcu_SummaryNonlabID = Mcu_SummaryNonlabID
join mcu_kelainan on Mcu_SummaryNonlabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID AND
Mcu_KelainanGroupID = 10
JOIN nat_test ON Mcu_SummaryNonlabNat_TestID = Nat_TestID AND
T_KelainanNonLabNat_TestID = Mcu_SummaryNonlabNat_TestID
where T_KelainanNonLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
LIMIT 10
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data gangguan jantung %v", err)
}
title := "Gangguan Jantung"
option, err := tknl.ConfBarchartVertical(title, data)
if err != nil {
return option, fmt.Errorf("error insert data into chart %v", err)
}
return option, nil
}
func (tknl *TabKelainanNonLabServices) GetAutospirometri(mcuID string) (models.BarchartV2, error) {
var option models.BarchartV2
var data []models.KelNonLabModel
q := `
SELECT Mcu_KelainanID, Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_nonlab
JOIN t_orderheader ON T_KelainanNonLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarynonlab ON T_KelainanNonLabMcu_SummaryNonlabID = Mcu_SummaryNonlabID
join mcu_kelainan on Mcu_SummaryNonlabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryNonlabNat_TestID = Nat_TestID AND
T_KelainanNonLabNat_TestID = Mcu_SummaryNonlabNat_TestID AND Nat_TestID = 5321
where T_KelainanNonLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
LIMIT 10
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data autspirometri %v", err)
}
title := "Spirometri"
option, err := tknl.ConfBarchartVertical(title, data)
if err != nil {
return option, fmt.Errorf("error insert data into chart %v", err)
}
return option, nil
}
func (tknl *TabKelainanNonLabServices) GetPendengaran(mcuID string) (models.BarchartV2, error) {
var option models.BarchartV2
var data []models.KelNonLabModel
q := `
SELECT Mcu_KelainanID, Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_nonlab
JOIN t_orderheader ON T_KelainanNonLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarynonlab ON T_KelainanNonLabMcu_SummaryNonlabID = Mcu_SummaryNonlabID
join mcu_kelainan on Mcu_SummaryNonlabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryNonlabNat_TestID = Nat_TestID AND
T_KelainanNonLabNat_TestID = Mcu_SummaryNonlabNat_TestID AND Nat_TestID = 5308
where T_KelainanNonLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
LIMIT 10
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data gangguan pendengaran %v", err)
}
title := "Gangguan Pendengaran"
option, err := tknl.ConfBarchartVertical(title, data)
if err != nil {
return option, fmt.Errorf("error insert data into chart %v", err)
}
return option, nil
}
func (tknl *TabKelainanNonLabServices) GetChartRenderNonLab(mcuID string) ([]models.McuTabModels, error) {
var ret []models.McuTabModels
q := `
SELECT
Mcu_ImageGrafikGroupResult,
Mcu_ImageGrafikGroupMenu,
Mcu_ImageGrafikName,
Mcu_ImageGrafikJsonRender
FROM mgm_mcugrafik
JOIN mcu_image_grafik ON Mcu_ImageGrafikID = Mgm_McuGrafikMcu_ImageGrafikID
WHERE Mgm_McuGrafikMgm_McuID = ?
AND Mcu_ImageGrafikGroupResult = "NONLAB"
AND Mgm_McuGrafikIsActive = 'Y'
ORDER BY Mcu_ImageGrafikID
`
if err := dbx.Handlex.Select(&ret, q, mcuID); err != nil {
return ret, fmt.Errorf("error get data tab peserta: %v", err)
}
return ret, nil
}

View File

@@ -0,0 +1,267 @@
package mcu_corporate_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"fmt"
"strconv"
"go.uber.org/zap"
)
type TabKepersertaanServices struct {
TabKepersertaanServiceStore db.AppStore
}
func NewTabKepersertaanService(store db.AppStore) *TabKepersertaanServices {
return &TabKepersertaanServices{
TabKepersertaanServiceStore: store,
}
}
func (tkp *TabKepersertaanServices) GetPieChartConf(title string, subtext string, data []models.SeriesData) (models.Piechart, error) {
option := models.Piechart{
Title: struct {
Text string `json:"text"`
SubText string `json:"subtext"`
Left string `json:"left"`
}{
Text: title,
SubText: subtext,
Left: "center",
},
Tooltip: struct {
Trigger string `json:"trigger"`
}{
Trigger: "item",
},
Legend: struct {
Top string `json:"top"`
Left string `json:"left"`
Orient string `json:"orient"`
Height int `json:"height"`
}{
Top: "bottom",
Left: "center",
Orient: "vertical",
Height: 75,
},
Series: []models.Series{
{
Label: struct {
Position string `json:"position"`
Formatter string `json:"formatter"`
}{
Position: "inner",
Formatter: "{d}%",
},
Name: "Access From",
Type: "pie",
Radius: []string{"20%", "50%"},
ItemStyle: struct {
BorderRadius int `json:"borderRadius"`
BorderColor string `json:"borderColor"`
BorderWidth int `json:"borderWidth"`
}{
BorderRadius: 10,
BorderColor: "#fff",
BorderWidth: 2,
},
Data: data,
Emphasis: struct {
ItemStyle struct {
ShadowBlur int `json:"shadowBlur"`
ShadowOffsetX int `json:"shadowOffsetX"`
ShadowColor string `json:"shadowColor"`
} `json:"itemStyle"`
}{
ItemStyle: struct {
ShadowBlur int `json:"shadowBlur"`
ShadowOffsetX int `json:"shadowOffsetX"`
ShadowColor string `json:"shadowColor"`
}{
ShadowBlur: 10,
ShadowOffsetX: 0,
ShadowColor: "rgba(0, 0, 0, 0.5)",
},
},
},
},
}
return option, nil
}
func (tkp *TabKepersertaanServices) GetTotalKepesertaanMCU(mcuID string) (models.Piechart, error) {
logger, _ := zap.NewProduction()
var option models.Piechart
var data models.TotalPesertaModel
q := `
SELECT
COUNT(distinct(T_OrderHeaderID)) as peserta,
COUNT( distinct(Mcu_PreregisterPatientsM_PatientID)) as total
FROM mcu_preregister_patients
LEFT JOIN t_orderheader ON Mcu_PreregisterPatientsT_OrderHeaderID = T_OrderHeaderID AND
T_OrderHeaderIsActive = 'Y'
WHERE
Mcu_PreregisterPatientsMgm_McuID = ? AND
Mcu_PreregisterPatientsIsActive = 'Y'
`
if err := dbx.Handlex.Get(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get total participant %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
title := "Peserta MCU"
subtext := "Total Peserta " + strconv.Itoa(data.Total)
chartData := []models.SeriesData{}
if data.Total == 0 {
chartData = append(chartData, models.SeriesData{Value: 0, Name: "No Data"})
} else {
chartData = []models.SeriesData{
{
Value: data.Peserta,
Name: "Sudah MCU: " + strconv.Itoa(data.Peserta) + " peserta",
},
{
Value: data.Total - data.Peserta,
Name: "Belum MCU: " + strconv.Itoa(data.Total-data.Peserta) + " peserta",
},
}
}
option, err := tkp.GetPieChartConf(title, subtext, chartData)
if err != nil {
return option, fmt.Errorf("error get piechart total peserta: %v", err)
}
return option, nil
}
func (tkp *TabKepersertaanServices) GetKepesertaanByGender(mcuID string) (models.Piechart, error) {
logger, _ := zap.NewProduction()
var option models.Piechart
var data []models.GenderPesertaModel
title := "Peserta MCU"
subtext := "Berdasarkan jenis kelamin"
chartData := []models.SeriesData{}
q := `
SELECT IF(M_PatientGender = 'male','Laki-laki','Perempuan') as M_PatientGender,
COUNT(T_OrderHeaderID) as Jumlah
FROM t_orderheader
LEFT JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive = 'Y'
WHERE T_OrderHeaderMgm_McuID = ? AND T_OrderHeaderIsActive = 'Y'
GROUP BY M_PatientGender
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get total gender %v", err)
}
defer logger.Sync()
logger.Info("resp data", zap.Any("data", data))
if data != nil {
for _, d := range data {
chartData = append(chartData, models.SeriesData{
Value: d.Jumlah,
Name: d.M_PatientGender + ": " + strconv.Itoa(d.Jumlah) + " Peserta",
})
}
} else {
chartData = append(chartData, models.SeriesData{Value: 0, Name: "No Data"})
}
option, err := tkp.GetPieChartConf(title, subtext, chartData)
if err != nil {
return option, fmt.Errorf("error get piechart total gender: %v", err)
}
return option, nil
}
func (tkp *TabKepersertaanServices) GetKepesertaanByUmur(mcuID string) (models.Piechart, error) {
logger, _ := zap.NewProduction()
var option models.Piechart
var data []models.UmurPesertaModel
title := "Peserta MCU"
subtext := "Berdasarkan umur"
chartData := []models.SeriesData{}
q := `
SELECT
CASE
WHEN LEFT(T_OrderHeaderM_PatientAge,2) < '30' THEN "1. < 30 tahun"
WHEN LEFT(T_OrderHeaderM_PatientAge,2) >= '30' AND left(T_OrderHeaderM_PatientAge,2) < '40' THEN "2. 30 -< 40 tahun"
WHEN LEFT(T_OrderHeaderM_PatientAge,2) >= '40' AND left(T_OrderHeaderM_PatientAge,2) < '50' THEN "3. 40 - < 50 tahun"
WHEN LEFT(T_OrderHeaderM_PatientAge,2) >= '50' THEN "4. > 50 tahun" ELSE ""
END AS umur,
COUNT(T_OrderHeaderID) as total
FROM t_orderheader
LEFT JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive = 'Y'
WHERE t_orderheaderMgm_McuID = ? AND T_OrderHeaderIsActive = 'Y'
GROUP BY
CASE
WHEN LEFT(T_OrderHeaderM_PatientAge,2) < '30' THEN "1. < 30 tahun"
WHEN LEFT(T_OrderHeaderM_PatientAge,2) >= '30' AND left(T_OrderHeaderM_PatientAge,2) < '40' THEN "2. 30 -< 40 tahun"
WHEN LEFT(T_OrderHeaderM_PatientAge,2) >= '40' AND left(T_OrderHeaderM_PatientAge,2) < '50' THEN "3. 40 - < 50 tahun"
WHEN LEFT(T_OrderHeaderM_PatientAge,2) >= '50' THEN "4. > 50 tahun" ELSE ""
END
ORDER BY umur
`
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
return option, fmt.Errorf("error get data jumlah umur: %v", err)
}
defer logger.Sync()
logger.Info("response data", zap.Any("data", data))
if data != nil {
for _, d := range data {
chartData = append(chartData, models.SeriesData{
Value: d.Total,
Name: d.Umur + ": " + strconv.Itoa(d.Total) + " Peserta",
})
}
} else {
chartData = append(chartData, models.SeriesData{Value: 0, Name: "No Data"})
}
option, err := tkp.GetPieChartConf(title, subtext, chartData)
if err != nil {
return option, fmt.Errorf("error get piechart jumlah umur: %v", err)
}
return option, nil
}
func (tkp *TabKepersertaanServices) GetChartRenderPeserta(mcuID string) ([]models.McuTabModels, error) {
var ret []models.McuTabModels
q := `
SELECT
Mcu_ImageGrafikGroupResult,
Mcu_ImageGrafikGroupMenu,
Mcu_ImageGrafikName,
Mcu_ImageGrafikJsonRender
FROM mgm_mcugrafik
JOIN mcu_image_grafik ON Mcu_ImageGrafikID = Mgm_McuGrafikMcu_ImageGrafikID
WHERE Mgm_McuGrafikMgm_McuID = ?
AND Mcu_ImageGrafikGroupMenu = "PESERTA"
AND Mgm_McuGrafikIsActive = 'Y'
ORDER BY Mcu_ImageGrafikID
`
if err := dbx.Handlex.Select(&ret, q, mcuID); err != nil {
return ret, fmt.Errorf("error get data tab peserta: %v", err)
}
return ret, nil
}

View File

@@ -230,3 +230,78 @@ func (tks *TabKesimpulanServices) GetListKesimpulanFisik(id string) ([]models.Mo
return listFisik, nil
}
func (tks *TabKesimpulanServices) GetListKesimpulanLabV2(id string) ([]models.ModelKesimpulanLab, error) {
var data []models.ModelKesimpulanLab
q := `
SELECT Mcu_KelainanID as nomor,
Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_lab
JOIN t_orderheader ON T_KelainanLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarylab ON T_KelainanLabMcu_SummaryLabID = Mcu_SummaryLabID
join mcu_kelainan on Mcu_summaryLabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryLabNat_TestID = Nat_TestID AND T_KelainanLabNat_TestID = Mcu_SummaryLabNat_TestID
where T_KelainanLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
LIMIT 3
`
if err := dbx.Handlex.Select(&data, q, id); err != nil {
return data, fmt.Errorf("error get data top 3 kelainan lab %v", err)
}
return data, nil
}
func (tks *TabKesimpulanServices) GetListKesimpulanNonLabV2(id string) ([]models.ModelKesimpulanLab, error) {
var data []models.ModelKesimpulanLab
q := `
SELECT Mcu_KelainanID as nomor, Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_nonlab
JOIN t_orderheader ON T_KelainanNonLabT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summarynonlab ON T_KelainanNonLabMcu_SummaryNonlabID = Mcu_SummaryNonlabID
join mcu_kelainan on Mcu_SummaryNonlabMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
JOIN nat_test ON Mcu_SummaryNonlabNat_TestID = Nat_TestID AND
T_KelainanNonLabNat_TestID = Mcu_SummaryNonlabNat_TestID
where T_KelainanNonLabIsActive = 'Y' and T_OrderHeaderMgm_McuID = ?
group by Mcu_KelainanID
ORDER BY total DESC
LIMIT 3
`
if err := dbx.Handlex.Select(&data, q, id); err != nil {
return data, fmt.Errorf("error get data top 3 kelainan non lab %v", err)
}
return data, nil
}
func (tks *TabKesimpulanServices) GetListKesimpulanFisikV2(id string) ([]models.ModelKesimpulanLab, error) {
var data []models.ModelKesimpulanLab
q := `
SELECT Mcu_KelainanID as nomor, Mcu_KelainanName as Test,
count(distinct T_OrderHeaderID) as total
FROM t_kelainan_fisik
JOIN t_orderheader ON T_KelainanFiskT_OrderHeaderID = T_OrderHeaderID
JOIN mcu_summaryfisik ON T_KelainanFiskMcu_FisikSummaryID = Mcu_SummaryFisikID AND
Mcu_SummaryFisikID NOT IN (63,67,68,69,70,71,72,73)
join mcu_kelainan on Mcu_SummaryFisikMcu_KelainanID = Mcu_KelainanID
join mcu_kelainangroup on Mcu_KelainanMcu_KelainanGroupID = Mcu_KelainanGroupID
where T_KelainanFiskIsActive = 'Y' and T_OrderHeaderMgm_McuID = ? AND
Mcu_KelainanClasification NOT IN ('who','kemenkes','JNC-VIII','ESC/ESH')
group by Mcu_KelainanID
ORDER BY total DESC
LIMIT 3
`
if err := dbx.Handlex.Select(&data, q, id); err != nil {
return data, fmt.Errorf("error get data top 3 kelainan fisik %v", err)
}
return data, nil
}

View File

@@ -0,0 +1,198 @@
package mcu_corporate_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"fmt"
"math"
"go.uber.org/zap"
)
type TabKeuanganServices struct {
TabKeuanganStore db.AppStore
}
func NewTabKeuanganServices(uStore db.AppStore) *TabKeuanganServices {
return &TabKeuanganServices{
TabKeuanganStore: uStore,
}
}
func (tks *TabKeuanganServices) GetTotalOrderKeuangan(mcuID string) (int, error) {
logger, _ := zap.NewProduction()
var mcu models.DashboardPic
ret := 0
var data []models.TotalOrderHeader
q := `
SELECT
Mgm_McuID,
Mgm_McuLabel,
Mgm_McuCorporateID,
Mgm_McuIsActive
FROM mgm_mcu
WHERE Mgm_McuIsActive = 'Y'
AND Mgm_McuID = ?
`
if err := dbx.Handlex.Get(&mcu, q, mcuID); err != nil {
defer logger.Sync()
logger.Info("error get corportate id", zap.Any("mcuID", mcuID))
return ret, fmt.Errorf("error get corporate id: %v", err)
}
q = `
SELECT
T_OrderHeaderID,
T_OrderHeaderCorporateID,
T_OrderHeaderTotal,
T_OrderHeaderCreated
FROM t_orderheader
WHERE T_OrderHeaderIsActive = 'Y'
AND T_OrderHeaderCorporateID = ?
`
if err := dbx.Handlex.Select(&data, q, mcu.Mgm_McuCorporateID); err != nil {
defer logger.Sync()
logger.Info("error get orderheader data by corp id", zap.Any("corpID", mcu.Mgm_McuCorporateID))
return ret, fmt.Errorf("error get orderheader data by corp id: %v", err)
}
for _, d := range data {
ret = ret + int(d.T_OrderHeaderTotal)
}
return ret, nil
}
func (tks *TabKeuanganServices) GetTotalCardData(mcuID string) (models.TotalBillCard, error) {
logger, _ := zap.NewProduction()
var ret models.TotalBillCard
var mcu models.DashboardPic
var uang []models.KeuanganModel
q := `
SELECT
Mgm_McuID,
Mgm_McuLabel,
Mgm_McuCorporateID,
Mgm_McuIsActive
FROM mgm_mcu
WHERE Mgm_McuIsActive = 'Y'
AND Mgm_McuID = ?
`
if err := dbx.Handlex.Get(&mcu, q, mcuID); err != nil {
defer logger.Sync()
logger.Info("error get corportate id", zap.Any("mcuID", mcuID))
return ret, fmt.Errorf("error get corporate id: %v", err)
}
q = `
SELECT
fb.F_BillID,
fb.F_BillNo,
fb.F_BillCorporateID,
DATE_FORMAT(fb.F_BillDueDate, '%e %M %Y') AS F_BillDueDate,
fb.F_BillTotal,
fb.F_BillUnpaid,
DATE_FORMAT(fb.F_BillCreated, '%e %M %Y') AS F_BillCreated
FROM f_bill fb
WHERE fb.F_BillIsActive = 'Y'
AND fb.F_BillCorporateID = ?
`
if err := dbx.Handlex.Select(&uang, q, mcu.Mgm_McuCorporateID); err != nil {
defer logger.Sync()
logger.Error("Error Get List Bill Data", zap.Any("corpID", mcu.Mgm_McuCorporateID))
return ret, fmt.Errorf("error query database: %v", err)
}
for _, bill := range uang {
ret.TotalTagihan = ret.TotalTagihan + bill.F_BillTotal
ret.TotalHutang = ret.TotalHutang + bill.F_BillUnpaid
}
ret.TotalPelunasan = ret.TotalTagihan - ret.TotalHutang
return ret, nil
}
func (tks *TabKeuanganServices) GetListingDataKeuangan(mcuID string, currentpage int, rowperpage int) ([]models.KeuanganModel, int, error) {
logger, _ := zap.NewProduction()
var ret []models.KeuanganModel
var totalData int
var mcu models.DashboardPic
q := `
SELECT
Mgm_McuID,
Mgm_McuLabel,
Mgm_McuCorporateID,
Mgm_McuIsActive
FROM mgm_mcu
WHERE Mgm_McuIsActive = 'Y'
AND Mgm_McuID = ?
`
if err := dbx.Handlex.Get(&mcu, q, mcuID); err != nil {
defer logger.Sync()
logger.Info("error get corportate id", zap.Any("mcuID", mcuID))
return ret, 0, fmt.Errorf("error get corporate id: %v", err)
}
offset := (currentpage - 1) * rowperpage
querytotal := `
SELECT COUNT(*)
FROM f_bill
WHERE F_BillIsActive = 'Y' AND F_BillCorporateID = ?
`
if err := dbx.Handlex.Get(&totalData, querytotal, mcu.Mgm_McuCorporateID); err != nil {
return nil, 0, fmt.Errorf("error query get total data: %v", err)
}
q = `
SELECT
fb.F_BillID,
fb.F_BillNo,
fb.F_BillCorporateID,
DATE_FORMAT(fb.F_BillDueDate, '%e %M %Y') AS F_BillDueDate,
fb.F_BillTotal,
fb.F_BillUnpaid,
DATE_FORMAT(fb.F_BillCreated, '%e %M %Y') AS F_BillCreated
FROM f_bill fb
WHERE fb.F_BillIsActive = 'Y'
AND fb.F_BillCorporateID = ?
LIMIT ? OFFSET ?
`
if err := dbx.Handlex.Select(&ret, q, mcu.Mgm_McuCorporateID, rowperpage, offset); err != nil {
defer logger.Sync()
logger.Error("Error Get List Bill Data", zap.Any("corpID", mcu.Mgm_McuCorporateID))
return ret, 0, fmt.Errorf("error query database: %v", err)
}
for idx, data := range ret {
var paym []models.BillPaymentModel
q := `
SELECT
F_BillPaymentID,
F_BillPaymentF_BillID,
DATE_FORMAT(F_BillPaymentDate, '%e %M %Y') AS F_BillPaymentDate,
F_BillPaymentNumber,
F_BillPaymentAmount
FROM f_bill_payment
WHERE F_BillPaymentIsActive = 'Y'
AND F_BillPaymentF_BillID = ?
`
if err := dbx.Handlex.Select(&paym, q, data.F_BillID); err != nil {
defer logger.Sync()
logger.Error("Error Get List Payment Data", zap.Any("billID", data.F_BillID))
return ret, 0, fmt.Errorf("error query database: %v", err)
}
ret[idx].BillPayment = append(ret[idx].BillPayment, paym...)
ret[idx].TotalBillPayment = data.F_BillTotal - data.F_BillUnpaid
}
totalPage := int(math.Ceil(float64(totalData) / float64(rowperpage)))
return ret, totalPage, nil
}

View File

@@ -4,6 +4,7 @@ import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"encoding/json"
"fmt"
"math"
"strconv"
@@ -62,52 +63,6 @@ func (sp *PatientServices) GetDashboardPatientBreadcrumb(title string) (models.B
return breadcrumb, nil
}
func (sp *PatientServices) ListingData(search string, date string, patID string, corpId string, currentpage int, rowperpage int) ([]models.DashboardPatient, int, error) {
logger, _ := zap.NewProduction()
var ret []models.DashboardPatient
var totalData int
if len(date) == 0 {
date = ""
}
prmSearch := "%" + search + "%"
offset := (currentpage - 1) * rowperpage
q := `
SELECT COUNT(*)
FROM t_orderheader
WHERE T_OrderHeaderIsActive = 'Y'
AND T_OrderHeaderLabNumber LIKE ?
AND T_OrderHeaderM_PatientID = ?
`
if err := dbx.Handlex.Get(&totalData, q, prmSearch, patID); err != nil {
return nil, 0, fmt.Errorf("error query get total data: %v", err)
}
q = `
SELECT
T_OrderHeaderID,
DATE_FORMAT(T_OrderHeaderDate, '%d/%m/%Y') AS T_OrderHeaderDate,
T_OrderHeaderLabNumber,
T_OrderHeaderM_PatientID,
T_OrderHeaderCorporateID,
T_OrderHeaderMgm_McuID,
T_OrderHeaderIsActive
FROM t_orderheader
WHERE T_OrderHeaderIsActive = 'Y'
AND T_OrderHeaderLabNumber LIKE ?
AND T_OrderHeaderM_PatientID = ?
LIMIT ? OFFSET ?
`
if err := dbx.Handlex.Select(&ret, q, prmSearch, patID, rowperpage, offset); err != nil {
return nil, 0, fmt.Errorf("error query get data: %v", err)
}
logger.Info("response", zap.Any("data", ret))
totalPage := int(math.Ceil(float64(totalData) / float64(rowperpage)))
return ret, totalPage, nil
}
func (sp *PatientServices) GetListtingData(email string, currentpage int, rowperpage int) ([]models.DashboardPatient, int, error) {
logger, _ := zap.NewProduction()
var ret []models.DashboardPatient
@@ -150,65 +105,268 @@ func (sp *PatientServices) GetListtingData(email string, currentpage int, rowper
return ret, totalPage, nil
}
func (sp *PatientServices) GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error) {
var ret []models.TabViewReportMcu
var data []models.ModelMcuPesertaReport
var totalData int
func (sp *PatientServices) GetListReportPesertaV3(orderheaderID string, staffname string) ([]models.TabViewReportMcu, error) {
var returnTab []models.TabViewReportMcu
var GroupResultOrder []models.GroupResultOrderModel
var SoResultData []models.SoResultEntryReportModel
q := `
SELECT COUNT(*)
FROM so_resultentry
WHERE So_ResultEntryT_OrderHeaderID = ?
AND So_ResultEntryIsActive = 'Y'
SELECT
gr.Group_ResultID,
gr.Group_ResultName,
gr.Group_ResultResumeMcu,
gr.Group_ResultUrl,
gr.Group_ResultIsOrderHeader,
gro.Group_ResultOrderOrder,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail todtl
JOIN t_test tt ON todtl.T_OrderDetailT_TestID = tt.T_TestID
AND tt.T_TestIsActive = 'Y'
JOIN group_resultdetail grd ON tt.T_TestID = grd.Group_ResultDetailT_TestID
AND grd.Group_ResultDetailIsActive = 'Y'
JOIN group_result gr ON grd.Group_ResultDetailGroup_ResultID = gr.Group_ResultID
AND gr.Group_ResultIsActive = 'Y'
JOIN group_resultorder gro ON gro.Group_ResultOrderGroup_ResultID = gr.Group_ResultID
AND Group_ResultOrderIsActive = 'Y'
WHERE todtl.T_OrderDetailT_OrderHeaderID = ?
AND todtl.T_OrderDetailIsActive = 'Y'
GROUP BY gr.Group_ResultID
ORDER BY gro.Group_ResultOrderOrder
`
if err := dbx.Handlex.Get(&totalData, q, orderheaderID); err != nil {
return ret, fmt.Errorf("error get total mcu report: %v", err)
if err := dbx.Handlex.Select(&GroupResultOrder, q, orderheaderID); err != nil {
return returnTab, fmt.Errorf("error get group result order: %v", err)
}
q = `
SELECT
So_ResultEntryID,
So_ResultEntryT_OrderHeaderID,
So_ResultEntryNonlab_TemplateID,
So_ResultEntryNonlab_TemplateName
FROM so_resultentry
WHERE So_ResultEntryT_OrderHeaderID = ?
AND So_ResultEntryIsActive = 'Y'
ORDER BY So_ResultEntryNonlab_TemplateID
SELECT
sre.So_ResultEntryID,
sre.So_ResultEntryT_OrderHeaderID,
sre.So_ResultEntryT_OrderDetailID,
sre.So_ResultEntryNonlab_TemplateID,
sre.So_ResultEntryNonlab_TemplateName
FROM t_orderdetail tdet
JOIN t_test tt ON tdet.T_OrderDetailT_TestID = tt.T_TestID
AND tt.T_TestIsActive = 'Y'
JOIN so_resultentry sre ON sre.So_ResultEntryT_OrderDetailID = tdet.T_OrderDetailID
AND sre.So_ResultEntryIsActive = 'Y'
WHERE tdet.T_OrderDetailT_OrderHeaderID = ?
AND tdet.T_OrderDetailIsActive = 'Y'
`
if err := dbx.Handlex.Select(&data, q, orderheaderID); err != nil {
return ret, err
if err := dbx.Handlex.Select(&SoResultData, q, orderheaderID); err != nil {
return returnTab, fmt.Errorf("error get so result data non lab: %v", err)
}
// Lab
ret = append(ret, models.TabViewReportMcu{Name: "Hasil Laboratorium", Link: "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_test.rptdesign&__format=pdf&PID=" + orderheaderID + "&username=adhi&tm=1717726294764"})
// Non-lab
for _, n := range data {
var link models.TabViewReportMcu
switch n.So_ResultEntryNonlab_TemplateName {
mapSoResultData := map[string]int{}
for _, so := range SoResultData {
switch so.So_ResultEntryNonlab_TemplateName {
case "ECG":
link.Name = "Elektromedis"
link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_elmd.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&username=adhi&tm=1717726294764"
mapSoResultData["Elektromedik"] = so.So_ResultEntryID
case "Thorax PA":
link.Name = "Radiologi"
link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_xray.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&username=adhi&tm=1717726294764"
case "Fisik Umum":
namaFisik := []string{"Hasil Fisik", "Hasil Pajanan", "Riwayat"}
linkFisik := []string{
"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_fisik.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=fisik&username=adhi&tm=1717726294764",
"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_pajanan.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=fisik&username=adhi&tm=1717726294764",
"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_riwayat.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&PType=riwayat&username=adhi&tm=1717726294764",
}
for i := 0; i < 3; i++ {
ret = append(ret, models.TabViewReportMcu{Name: namaFisik[i], Link: linkFisik[i]})
}
continue
mapSoResultData["Rontgen"] = so.So_ResultEntryID
case "Fisik Umum", "Fisik Umum K3":
mapSoResultData["FISIK"] = so.So_ResultEntryID
default:
mapSoResultData[so.So_ResultEntryNonlab_TemplateName] = so.So_ResultEntryID
}
}
for _, group := range GroupResultOrder {
var urlMap map[string]string
if err := json.Unmarshal([]byte(group.Group_ResultUrl), &urlMap); err != nil {
return returnTab, fmt.Errorf("error parsing json: %v", err)
}
ret = append(ret, link)
switch group.Group_ResultResumeMcu {
case "FISIK":
soResultID := strconv.Itoa(mapSoResultData["FISIK"])
if soResultID != "0" {
for key, value := range urlMap {
returnTab = append(returnTab, models.TabViewReportMcu{
Name: key,
Link: value + "&username=" + staffname + "&PID=" + soResultID + "&tm=" + group.Datetime,
})
}
}
case "NONLAB":
soResultID := strconv.Itoa(mapSoResultData[group.Group_ResultName])
if soResultID != "0" {
for _, value := range urlMap {
returnTab = append(returnTab, models.TabViewReportMcu{
Name: group.Group_ResultName,
Link: value + "&username=" + staffname + "&PID=" + soResultID + "&tm=" + group.Datetime,
})
}
}
case "LAB":
for _, value := range urlMap {
returnTab = append(returnTab, models.TabViewReportMcu{
Name: group.Group_ResultName,
Link: value + "&username=" + staffname + "&PID=" + orderheaderID + "&tm=" + group.Datetime,
})
}
default:
for _, value := range urlMap {
returnTab = append(returnTab, models.TabViewReportMcu{
Name: group.Group_ResultName,
Link: value + "&username=" + staffname + "&PID=" + orderheaderID + "&tm=" + group.Datetime,
})
}
}
}
return ret, nil
return returnTab, nil
}
func (sp *PatientServices) GetListReportPesertaV4(orderheaderID string, staffname string) ([]models.TabViewReportMcu, error) {
var returnTab []models.TabViewReportMcu
var profile_patient models.PatientMCU
lab_rpt := ""
sql := `
SELECT
toh.T_OrderHeaderID,
toh.T_OrderHeaderLabNumber,
mp.M_PatientID,
mp.M_PatientName,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderheader toh
JOIN m_patient mp ON toh.T_OrderHeaderM_PatientID = mp.M_PatientID
AND mp.M_PatientIsActive = 'Y'
WHERE toh.T_OrderHeaderID = ? AND toh.T_OrderHeaderIsActive = 'Y'
`
if err := dbx.Handlex.Get(&profile_patient, sql, orderheaderID); err != nil {
return returnTab, fmt.Errorf("error get group result order: %v", err)
}
if profile_patient.T_OrderHeaderLabNumber != "" {
lab_rpt = "/birt/frameset?__report=report/one/lab/rpt_test_portal.rptdesign&__format=pdf&PID=" + profile_patient.T_OrderHeaderID + "&tm=" + profile_patient.Datetime + "&username=" + staffname
}
var so_data_rpt []models.SoRptData
fisik := ""
rontgen := ""
ekg := ""
audiometri := ""
spirometri := ""
treadmill := ""
papsmear := ""
sql_rpt := `
SELECT DISTINCT group_resultName as rpt_name,
IFNULL(So_ResultEntryID,0) as so_id,
T_OrderDetailT_OrderHeaderID as order_id,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail
JOIN t_test ON T_OrderDetailT_TestID = T_TestID
JOIN group_resultdetail ON Group_ResultDetailT_TestID = T_TestID
JOIN group_result ON Group_ResultID = Group_ResultDetailGroup_ResultID AND
Group_ResultFlagPerTest = 'N' AND Group_ResultName <> 'LAB' AND Group_ResultFlagNonLab = 'N'
LEFT JOIN so_resultentry ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND So_ResultEntryIsActive = 'Y'
WHERE
T_OrderDetailT_OrderHeaderID = ? AND Group_ResultName <> 'Tanpa Hasil'
UNION
SELECT DISTINCT group_resultName as rpt_name,
IFNULL(So_ResultEntryID,0) as so_id,
T_OrderDetailT_OrderHeaderID as order_id,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail
JOIN t_test ON T_OrderDetailT_TestID = T_TestID
JOIN t_samplingso ON T_SamplingSoT_OrderHeaderID = T_OrderDetailT_OrderHeaderID AND
T_SamplingSoT_TestID = T_TestID
JOIN group_resultdetail ON Group_ResultDetailT_TestID = T_TestID
JOIN group_result ON Group_ResultID = Group_ResultDetailGroup_ResultID AND
Group_ResultFlagPerTest = 'N' AND Group_ResultName <> 'LAB' AND Group_ResultFlagNonLab = 'Y'
LEFT JOIN so_resultentry ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND So_ResultEntryIsActive = 'Y'
WHERE
T_OrderDetailT_OrderHeaderID = ? AND Group_ResultName <> 'Tanpa Hasil'
UNION
SELECT DISTINCT T_TestName as rpt_name,
IFNULL(So_ResultEntryID,0) as so_id,
T_OrderDetailT_OrderHeaderID as order_id,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM t_orderdetail
JOIN t_test ON T_OrderDetailT_TestID = T_TestID AND T_TestName NOT IN ('Visus Mata','Buta Warna','Pemeriksaan Lapang Pandang')
JOIN t_samplingso ON T_SamplingSoT_OrderHeaderID = T_OrderDetailT_OrderHeaderID AND
T_SamplingSoT_TestID = T_TestID
JOIN group_resultdetail ON Group_ResultDetailT_TestID = T_TestID
JOIN group_result ON Group_ResultID = Group_ResultDetailGroup_ResultID AND
Group_ResultFlagPerTest = 'Y' AND Group_ResultFlagNonLab = 'Y'
LEFT JOIN so_resultentry ON So_ResultEntryT_OrderDetailID = T_OrderDetailID AND So_ResultEntryIsActive = 'Y'
WHERE
T_OrderDetailT_OrderHeaderID = ? AND Group_ResultName <> 'Tanpa Hasil'
`
if err := dbx.Handlex.Select(&so_data_rpt, sql_rpt, orderheaderID, orderheaderID, orderheaderID); err != nil {
return returnTab, fmt.Errorf("error get data so_id: %v", err)
}
for _, d := range so_data_rpt {
switch d.Rpt_name {
case "Pemeriksaan Fisik":
fisik = "/birt/frameset?__report=report/one/mcu/mcu_fisik_history_v2_portal.rptdesign&__format=pdf&PType=fisik&PLang=1&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
// fisik = "/birt/run?__report=report/one/mcu/mcu_fisik_history_v2_portal.rptdesign&__format=pdf&PType=fisik&PLang=1&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Rontgen":
rontgen = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_xray_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Audiometri":
audiometri = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_audiometri_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Spirometri":
spirometri = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_spirometri_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "ECG":
ekg = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_ecg_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Treadmill":
treadmill = "/birt/frameset?__report=report/one/lab/rpt_hasil_so_treadmill_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
case "Papsmear":
papsmear = "/birt/frameset?__report=report/one/lab/rpt_test_papsmear_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + d.So_id + "&tm=" + d.Datetime
}
}
var ResumeData models.ResumeMCU
kesimpulan := ""
// cover := ""
sql_resume := `
SELECT
Mcu_ResumeID,
DATE_FORMAT(NOW(), '%y%m%d%H%i%s') AS Datetime
FROM mcu_resume
WHERE Mcu_ResumeT_OrderHeaderID = ?
AND Mcu_ResumeIsActive = 'Y' AND Mcu_ResumeStatus = 'VAL'
`
if err := dbx.Handlex.Get(&ResumeData, sql_resume, orderheaderID); err != nil {
return returnTab, fmt.Errorf("error get data resume id: %v", err)
}
if ResumeData.Mcu_ResumeID != "" {
// cover = "/birt/frameset?__report=report/one/mcu/rpt_mcu_resume_cover_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + ResumeData.Mcu_ResumeID + "&tm=" + ResumeData.Datetime
kesimpulan = "/birt/frameset?__report=report/one/mcu/rpt_mcu_saran_kesimpulan_v2_portal.rptdesign&__format=pdf&username=" + staffname + "&PID=" + ResumeData.Mcu_ResumeID + "&tm=" + ResumeData.Datetime
}
if fisik != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Fisik", Link: fisik})
}
if rontgen != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Rontgen", Link: rontgen})
}
if ekg != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Elektromedik", Link: ekg})
}
if audiometri != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Audiometri", Link: audiometri})
}
if spirometri != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Spirometri", Link: spirometri})
}
if treadmill != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Treadmill", Link: treadmill})
}
if kesimpulan != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Kesimpulan", Link: kesimpulan})
}
if lab_rpt != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Lab", Link: lab_rpt})
}
if papsmear != "" {
returnTab = append(returnTab, models.TabViewReportMcu{Name: "Papsmear", Link: papsmear})
}
return returnTab, nil
}

View File

@@ -4,11 +4,13 @@ import (
"bytes"
"cpone/db"
"cpone/models"
"cpone/package/config"
dbx "cpone/package/database"
"database/sql"
"encoding/json"
"fmt"
"errors"
"io"
"net/http"
"net/url"
"go.uber.org/zap"
)
@@ -24,79 +26,76 @@ func NewServicesLogin(uStore db.AppStore) *ServicesLogin {
}
}
func (ls *ServicesLogin) Login(username string, password string) (models.ResponseApi, error) {
logger, _ := zap.NewProduction()
url := "https://devcpone.aplikasi.web.id/one-api/v1/system/auth/login"
var resp models.ResponseApi
// Create a JSON payload with the username and password
payload := []byte(fmt.Sprintf(`{"username": "%s", "password": "%s"}`, username, password))
logger.Info("payload", zap.Any("data", payload))
// Make the POST request
request, err := http.Post(url, "application/json", bytes.NewBuffer(payload))
if err != nil {
logger.Info("requser", zap.Any("err", err))
return resp, err
}
if request.StatusCode != http.StatusOK {
logger.Info("status", zap.Any("err", request.StatusCode))
return resp, fmt.Errorf("server returned non-OK status: %d", request.StatusCode)
}
defer request.Body.Close()
// Read the response body
body, err := io.ReadAll(request.Body)
if err != nil {
logger.Info("body", zap.Any("data", body))
return resp, err
}
if err := json.Unmarshal(body, &resp); err != nil {
logger.Info("json", zap.Any("data", err))
return resp, err
}
// Check if status is "ERR"
if resp.Status == "ERR" {
logger.Info("status", zap.Any("data", resp.Message))
return resp, fmt.Errorf("login failed: %s", resp.Message)
}
return resp, nil
}
func (ls *ServicesLogin) MultiSignIn(username string, password string) (models.Response, error) {
func (ls *ServicesLogin) MultiSignInV2(username string, password string) (models.Response, error) {
logger, _ := zap.NewProduction()
var ret models.Response
uri := "https://devcpone.aplikasi.web.id/one-api/v1/system/auth/multi_login"
params := url.Values{}
params.Add("username", username)
params.Add("password", password)
// uri := "https://" + config.Data.Get("servername") + "/one-api/v1/system/auth_v2/multi_login"
uri := "https://" + config.Data.Get("servername") + "/one-api/v1/system/auth_v2/multi_login_v2"
resp, err := http.PostForm(uri, params)
params, _ := json.Marshal(map[string]string{
"username": username,
"password": password,
})
paramsBody := bytes.NewBuffer(params)
resp, err := http.Post(uri, "application/json", paramsBody)
if err != nil {
defer logger.Sync()
logger.Error("error request post", zap.Any("error", err))
logger.Error("[ERROR]", zap.Any("error request login ", err))
return ret, err
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
defer logger.Sync()
logger.Error("error read body", zap.Any("error", err))
logger.Error("[ERROR]", zap.Any("error read body response ", err))
return ret, err
}
err = json.Unmarshal(body, &ret)
if err != nil {
defer logger.Sync()
logger.Error("error parse body", zap.Any("error", err))
logger.Error("[ERROR]", zap.Any("error unmarshal response ", err))
return ret, err
}
// logger.Info("[INFO]", zap.Any("success sign in ", &ret))
return ret, nil
}
func (ls *ServicesLogin) CheckIsAccountCpone(email string) (string, error) {
var usr_type string
q := `
SELECT M_UserEmail
FROM m_user
WHERE M_UserEmail = ? AND M_UserIsActive = 'Y'
`
if err := dbx.Handlex.Get(&usr_type, q, email); err != nil {
if errors.Is(err, sql.ErrNoRows) {
return "", nil
}
return "", err
}
return usr_type, nil
}
func (ls *ServicesLogin) CheckAccountHasLocation(email string) (bool, error) {
var placeholder string
sqla := `SELECT
M_UserEmail
FROM m_user
JOIN m_userlocation ON M_UserLocationM_UserID = M_UserID
WHERE M_UserEmail = ?
AND M_UserIsActive = 'Y'
`
if err := dbx.Handlex.Get(&placeholder, sqla, email); err != nil {
if errors.Is(err, sql.ErrNoRows) {
return false, nil
}
return false, err
}
return true, nil
}

View File

@@ -0,0 +1,12 @@
package utils
import (
"golang.org/x/text/language"
"golang.org/x/text/message"
)
func FormatRibuan(amount int) string {
p := message.NewPrinter(language.Indonesian)
formated := p.Sprintf("%v", amount)
return formated
}

View File

@@ -0,0 +1,20 @@
package utils
import (
"strings"
)
func SplitStrings(text string, count int) string {
words := strings.Split(text, " ")
var result strings.Builder
for i := 0; i < len(words); i += count {
if i+count < len(words) {
result.WriteString(strings.Join(words[i:i+count], " ") + "\n")
} else {
result.WriteString(strings.Join(words[i:], " "))
}
}
return result.String()
}

View File

@@ -11,7 +11,7 @@ templ FilterListing(
) {
<div class="row pt-8 align-items-center">
<div class="col-12 col-sm-3 col-md-1 col-lg-1 col-xl-1 mb-2">
<label class="text-black font-weight-bolder">Stard Date:</label>
<label class="text-black font-weight-bolder">Start Date:</label>
</div>
<div class="col-12 col-sm-9 col-md-2 col-lg-2 col-xl-2 mb-2">
<input
@@ -54,7 +54,7 @@ templ FilterListing(
name="search"
class="form-control form-control-lg bg-field border-0 rounded-lg"
type="text"
placeholder="nama karyawan"
placeholder="Nama MCU"
hx-get={ hxGet }
hx-trigger={ hxTrigger }
hx-include={ hxInclude }

View File

@@ -31,7 +31,7 @@ func FilterListing(
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row pt-8 align-items-center\"><div class=\"col-12 col-sm-3 col-md-1 col-lg-1 col-xl-1 mb-2\"><label class=\"text-black font-weight-bolder\">Stard Date:</label></div><div class=\"col-12 col-sm-9 col-md-2 col-lg-2 col-xl-2 mb-2\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row pt-8 align-items-center\"><div class=\"col-12 col-sm-3 col-md-1 col-lg-1 col-xl-1 mb-2\"><label class=\"text-black font-weight-bolder\">Start Date:</label></div><div class=\"col-12 col-sm-9 col-md-2 col-lg-2 col-xl-2 mb-2\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -221,7 +221,7 @@ func FilterListing(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input id=\"searchID\" name=\"search\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"text\" placeholder=\"nama karyawan\" hx-get=\"")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input id=\"searchID\" name=\"search\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"text\" placeholder=\"Nama MCU\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -8,21 +8,27 @@ templ ListingData(
listID string,
) {
<div id={listID} class="align-items-center py-8 flex-column" hx-swap-oob="true">
<div class="bg-field rounded">
<div class="p-8">
for i, d := range data {
if i == (len(data) - 1) {
<div id={ strconv.Itoa(int(d.Mgm_McuID)) } class="card shadow p-8" hx-get={"/corp/dashboard_pic/click/" + strconv.Itoa(d.Mgm_McuID)}>
@ItemCard(d)
</div>
} else {
<div id={ strconv.Itoa(int(d.Mgm_McuID)) } class="card shadow p-8 mb-8" hx-get={"/corp/dashboard_pic/click/" + strconv.Itoa(d.Mgm_McuID)}>
@ItemCard(d)
</div>
}
}
if len(data) == 0 {
<div class="text-center">
<h4>Data Tidak Ditemukan</h4>
</div>
</div>
} else {
<div class="bg-field rounded">
<div class="p-8">
for i, d := range data {
if i == (len(data) - 1) {
<div id={ strconv.Itoa(int(d.Mgm_McuID)) } class="card shadow p-8" hx-get={"/corp/dashboard_pic/click/" + strconv.Itoa(d.Mgm_McuID)}>
@ItemCard(d)
</div>
} else {
<div id={ strconv.Itoa(int(d.Mgm_McuID)) } class="card shadow p-8 mb-8" hx-get={"/corp/dashboard_pic/click/" + strconv.Itoa(d.Mgm_McuID)}>
@ItemCard(d)
</div>
}
}
</div>
</div>
}
</div>
}

View File

@@ -42,92 +42,107 @@ func ListingData(
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"align-items-center py-8 flex-column\" hx-swap-oob=\"true\"><div class=\"bg-field rounded\"><div class=\"p-8\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"align-items-center py-8 flex-column\" hx-swap-oob=\"true\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i, d := range data {
if i == (len(data) - 1) {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(int(d.Mgm_McuID)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 15, Col: 64}
}
_, 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("\" class=\"card shadow p-8\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs("/corp/dashboard_pic/click/" + strconv.Itoa(d.Mgm_McuID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 15, Col: 155}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ItemCard(d).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
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(int(d.Mgm_McuID)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 19, Col: 64}
}
_, 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("\" class=\"card shadow p-8 mb-8\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("/corp/dashboard_pic/click/" + strconv.Itoa(d.Mgm_McuID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 19, Col: 160}
}
_, 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
}
templ_7745c5c3_Err = ItemCard(d).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 len(data) == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"text-center\"><h4>Data Tidak Ditemukan</h4></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"bg-field rounded\"><div class=\"p-8\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i, d := range data {
if i == (len(data) - 1) {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(int(d.Mgm_McuID)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 20, Col: 68}
}
_, 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("\" class=\"card shadow p-8\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs("/corp/dashboard_pic/click/" + strconv.Itoa(d.Mgm_McuID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 20, Col: 159}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = ItemCard(d).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
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(int(d.Mgm_McuID)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 24, Col: 68}
}
_, 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("\" class=\"card shadow p-8 mb-8\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("/corp/dashboard_pic/click/" + strconv.Itoa(d.Mgm_McuID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 24, Col: 164}
}
_, 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
}
templ_7745c5c3_Err = ItemCard(d).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
}
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -158,7 +173,7 @@ func ItemCard(data models.DashboardPic) templ.Component {
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuLabel)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 32, Col: 54}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 38, Col: 54}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
@@ -171,7 +186,7 @@ func ItemCard(data models.DashboardPic) templ.Component {
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuNote)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 35, Col: 74}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 41, Col: 74}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
@@ -184,7 +199,7 @@ func ItemCard(data models.DashboardPic) templ.Component {
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuStartDate)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 38, Col: 79}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 44, Col: 79}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
@@ -197,7 +212,7 @@ func ItemCard(data models.DashboardPic) templ.Component {
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuEndDate)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 38, Col: 105}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 44, Col: 105}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {

View File

@@ -57,7 +57,8 @@ templ CSSMcuDetail(
@CssKesimpulan
}
templ JSMcuDetail() {
templ JSMcuDetail() {
<script src="assets/js/echarts-js/echart.min.js"></script>
}
templ ShowMcuDetail(

View File

@@ -98,6 +98,10 @@ func JSMcuDetail() templ.Component {
templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script src=\"assets/js/echarts-js/echart.min.js\"></script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}

View File

@@ -0,0 +1,158 @@
package corporate_mcudetail
import "cpone/models"
import "strconv"
templ McuDetailTabView(
McuID string,
McuTab []models.McuTabModels,
) {
<div>
<ul class="nav nav-tabs nav-tabs-line">
for i, d := range McuTab {
if i == 0 {
<li class="nav-item">
<a
class="nav-link active"
data-toggle="tab"
href={templ.URL("#mcu_tab_" + strconv.Itoa(i))}
>{ d.TabName }</a>
</li>
} else {
<li class="nav-item">
<a
class="nav-link"
data-toggle="tab"
href={templ.URL("#mcu_tab_" + strconv.Itoa(i))}
>{ d.TabName }</a>
</li>
}
}
<li class="nav-item">
<a
if len(McuTab) == 0 {
class="nav-link active"
} else {
class="nav-link"
}
data-toggle="tab"
href={templ.URL("#mcu_tab_" + strconv.Itoa(len(McuTab) + 1))}
>Kesimpulan</a>
</li>
<li class="nav-item">
<a
class="nav-link"
data-toggle="tab"
href={templ.URL("#mcu_tab_" + strconv.Itoa(len(McuTab) + 2))}
>Daftar Peserta</a>
</li>
<li class="nav-item">
<a
class="nav-link"
data-toggle="tab"
href={templ.URL("#mcu_tab_" + strconv.Itoa(len(McuTab) + 3))}
>Executive Summary</a>
</li>
<li class="nav-item">
<a
class="nav-link"
data-toggle="tab"
href={templ.URL("#mcu_tab_" + strconv.Itoa(len(McuTab) + 4))}
>Keuangan</a>
</li>
</ul>
</div>
<div class="tab-content mt-5" id="mcutabcontent">
for i, d := range McuTab {
if i == 0 {
<div
class="tab-pane fade show active" role="tabpanel"
id={"mcu_tab_" + strconv.Itoa(i)}
aria-labelledby={"mcu_tab_" + strconv.Itoa(i)}
hx-get={"/corp/dashboard_pic/detail/" + McuID +"/" + d.TabID}
hx-target={"#" + d.TabID}
hx-trigger="load"
hx-indicator={"." + d.TabID + d.Mcu_ImageGrafikGroupMenu}
>
<div id={d.TabID}></div>
<div style="display: flex; justify-content: center; align-items: center;">
<span class={"htmx-indicator spinner-border spinner-border-lg " + d.TabID + d.Mcu_ImageGrafikGroupMenu} role="status" aria-hidden="true"></span>
</div>
</div>
} else {
<div
class="tab-pane fade" role="tabpanel"
id={"mcu_tab_" + strconv.Itoa(i)}
aria-labelledby={"mcu_tab_" + strconv.Itoa(i)}
hx-get={"/corp/dashboard_pic/detail/" + McuID +"/" + d.TabID}
hx-target={"#" + d.TabID}
hx-trigger="load"
hx-indicator={"." + d.TabID + d.Mcu_ImageGrafikGroupMenu}
>
<div id={d.TabID}></div>
<div style="display: flex; justify-content: center; align-items: center;">
<span class={"htmx-indicator spinner-border spinner-border-lg " + d.TabID + d.Mcu_ImageGrafikGroupMenu} role="status" aria-hidden="true"></span>
</div>
</div>
}
}
<div
if len(McuTab) == 0 {
class="tab-pane fade show active"
} else {
class="tab-pane fade"
}
role="tabpanel"
id={"mcu_tab_" + strconv.Itoa(len(McuTab) + 1)}
aria-labelledby={"mcu_tab_" + strconv.Itoa(len(McuTab) + 1)}
hx-get={"/corp/dashboard_pic/detail/" + McuID +"/tabkesimpulan"}
hx-target="#tabkesimpulan"
hx-trigger="load"
hx-indicator=".kesimpulanloading"
>
<div id="tabkesimpulan"></div>
<div style="display: flex; justify-content: center; align-items: center;">
<span class="htmx-indicator spinner-border spinner-border-lg kesimpulanloading" role="status" aria-hidden="true"></span>
</div>
</div>
<div
class="tab-pane fade" role="tabpanel"
id={"mcu_tab_" + strconv.Itoa(len(McuTab) + 2)}
aria-labelledby={"mcu_tab_" + strconv.Itoa(len(McuTab) + 2)}
hx-get={"/corp/dashboard_pic/detail/" + McuID +"/tabdaftarpeserta"}
hx-target="#tabdaftarpeserta"
hx-trigger="load"
hx-indicator=".tabdaftarpesertaload"
>
<div id="tabdaftarpeserta"></div>
<div style="display: flex; justify-content: center; align-items: center;">
<span class="htmx-indicator spinner-border spinner-border-lg tabdaftarpesertaload" role="status" aria-hidden="true"></span>
</div>
</div>
<div
class="tab-pane fade" role="tabpanel"
id={"mcu_tab_" + strconv.Itoa(len(McuTab) + 3)}
aria-labelledby={"mcu_tab_" + strconv.Itoa(len(McuTab) + 3)}
style="height: 700px;"
>
<object
data={"/birt/run?__report=report/one/mcu/rpt_executive_summary_mcu_001.rptdesign&__format=pdf&PID="+McuID+"&username=admin&tm=1722914077866"}
type="application/pdf" width="100%" height="100%"
></object>
</div>
<div
class="tab-pane fade" role="tabpanel"
id={"mcu_tab_" + strconv.Itoa(len(McuTab) + 4)}
aria-labelledby={"mcu_tab_" + strconv.Itoa(len(McuTab) + 4)}
hx-get={"/corp/dashboard_pic/detail/" + McuID +"/tabkeuangan"}
hx-target="#tabkeuangan"
hx-trigger="load"
hx-indicator=".uangloading"
>
<div id="tabkeuangan"></div>
<div style="display: flex; justify-content: center; align-items: center;">
<span class="htmx-indicator spinner-border spinner-border-lg uangloading" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
}

View File

@@ -0,0 +1,17 @@
package corporate_daftarpeserta
templ Filter_DaftarPeserta(
hx_get string, hx_target string, hx_include string, hx_swap string,
hx_trigger string, hx_before templ.ComponentScript, hx_after templ.ComponentScript,
) {
<div class="row pt-8 align-items-center">
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 mb-2">
<input
id="search-daftar-peserta" type="text" placeholder="Cari nama peserta atau NIP"
name="searchdp" class="form-control form-control-lg bg-field border-0 rounded-lg"
hx-get={ hx_get } hx-target={ hx_target } hx-include={ hx_include } hx-swap={ hx_swap }
hx-trigger={ hx_trigger } hx-on::before-request={ hx_before } hx-on::after-request={ hx_after }
/>
</div>
</div>
}

View File

@@ -0,0 +1,129 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_daftarpeserta
//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"
func Filter_DaftarPeserta(
hx_get string, hx_target string, hx_include string, hx_swap string,
hx_trigger string, hx_before templ.ComponentScript, hx_after templ.ComponentScript,
) 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=\"row pt-8 align-items-center\"><div class=\"col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 mb-2\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hx_before, hx_after)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input id=\"search-daftar-peserta\" type=\"text\" placeholder=\"Cari nama peserta atau NIP\" name=\"searchdp\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(hx_get)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\filter.templ`, Line: 12, Col: 31}
}
_, 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("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hx_target)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\filter.templ`, Line: 12, Col: 55}
}
_, 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("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hx_include)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\filter.templ`, Line: 12, Col: 81}
}
_, 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(hx_swap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\filter.templ`, Line: 12, Col: 101}
}
_, 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("\" hx-trigger=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hx_trigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\filter.templ`, Line: 13, Col: 39}
}
_, 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("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 templ.ComponentScript = hx_before
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 templ.ComponentScript = hx_after
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></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
})
}

View File

@@ -0,0 +1,92 @@
package corporate_daftarpeserta
import "cpone/component/modal"
import "cpone/component/customtextfield"
import "cpone/models"
templ Dialog_DaftarPeserta(
component_id string, size string,
hx_post string, hx_target string, hx_swap string, hx_include string,
modal_id string, modal_title string, modal_body templ.Component,
modal_close templ.Component, modal_aksi templ.Component,
) {
<div>
<form
id={ component_id } class="form"
hx-post={ hx_post } hx-target={ hx_target }
hx-swap={ hx_swap } hx-inclide={ hx_include } hx-indicator=".formloading"
>
if size == "xl" {
@modalcomponent.ModalXL(modal_id, modal_title, modal_body, modal_aksi, modal_close)
} else {
@modalcomponent.Modal(modal_id, modal_title, modal_body, modal_aksi, modal_close)
}
</form>
</div>
}
templ Body_GenPass(component_id string, message string, hx_onload templ.ComponentScript) {
<div id={ component_id } hx-on::load={ hx_onload }>
<p>{ message }</p>
</div>
}
templ Body_Account(
component_id string,
acc_id models.CustomTextFieldv2Prm,
acc_email models.CustomTextFieldv2Prm,
pass models.CustomTextFieldv2Prm,
pass_cek models.CustomTextFieldv2Prm,
hx_onload templ.ComponentScript,
) {
<div id={ component_id } hx-on::load={ hx_onload }>
@customtextfield.CustomTextFieldv2(acc_id)
@customtextfield.CustomTextFieldv2(acc_email)
@customtextfield.CustomTextFieldv2(pass)
@customtextfield.CustomTextFieldv2(pass_cek)
</div>
}
templ Body_RPT(component_id string, list_rpt templ.Component, hx_onload templ.ComponentScript) {
<div id={ component_id } hx-on::load={ hx_onload }>
@list_rpt
</div>
}
templ Body_Detail(component_id string, table_detail templ.Component, hx_onload templ.ComponentScript) {
<div id={ component_id } hx-on::load={ hx_onload }>
@table_detail
</div>
}
templ Body_Attachment(component_id string, list_atc templ.Component, hx_onload templ.ComponentScript) {
<div id={ component_id } hx-on::load={ hx_onload }>
@list_atc
</div>
}
templ Close_Modal(modal_id string) {
<button
type="button" class="close" data-dismiss="modal"
aria-label="Close" hx-on::after-request={ JSHideModal(modal_id) }
> <i aria-hidden="true" class="ki ki-close"></i> </button>
}
templ Aksi_Modal(modal_id string, hx_post string, hx_target string, hx_swap string, blank bool) {
<div>
if !blank {
<button
type="button" class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btncancel"
data-dismiss="modal" hx-indicator=".cancelloading" hx-on::after-request={ JSHideModal(modal_id) }
hx-post={ hx_post } hx-target={ hx_target } hx-swap={ hx_swap }
>
<span class="htmx-indicator spinner-border spinner-border-sm cancelloading" role="status" aria-hidden="true"></span>
Batal
</button>
<button type="submit" class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnsimpan">
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
Yakin
</button>
}
</div>
}

View File

@@ -0,0 +1,561 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_daftarpeserta
//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/modal"
import "cpone/component/customtextfield"
import "cpone/models"
func Dialog_DaftarPeserta(
component_id string, size string,
hx_post string, hx_target string, hx_swap string, hx_include string,
modal_id string, modal_title string, modal_body templ.Component,
modal_close templ.Component, modal_aksi 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("<div><form id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(component_id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 15, Col: 29}
}
_, 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("\" class=\"form\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hx_post)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 16, Col: 29}
}
_, 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("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(hx_target)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 16, Col: 53}
}
_, 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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(hx_swap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 17, Col: 29}
}
_, 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("\" hx-inclide=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hx_include)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 17, Col: 55}
}
_, 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("\" hx-indicator=\".formloading\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if size == "xl" {
templ_7745c5c3_Err = modalcomponent.ModalXL(modal_id, modal_title, modal_body, modal_aksi, modal_close).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
templ_7745c5c3_Err = modalcomponent.Modal(modal_id, modal_title, modal_body, modal_aksi, modal_close).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</form></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 Body_GenPass(component_id string, message string, hx_onload templ.ComponentScript) 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.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hx_onload)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(component_id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 29, Col: 26}
}
_, 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("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 templ.ComponentScript = hx_onload
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 30, Col: 20}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></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 Body_Account(
component_id string,
acc_id models.CustomTextFieldv2Prm,
acc_email models.CustomTextFieldv2Prm,
pass models.CustomTextFieldv2Prm,
pass_cek models.CustomTextFieldv2Prm,
hx_onload templ.ComponentScript,
) 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.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hx_onload)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, 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(component_id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 42, Col: 26}
}
_, 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-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 templ.ComponentScript = hx_onload
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13.Call)
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 = customtextfield.CustomTextFieldv2(acc_id).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(acc_email).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(pass).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(pass_cek).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 Body_RPT(component_id string, list_rpt templ.Component, hx_onload templ.ComponentScript) 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_Var14 := templ.GetChildren(ctx)
if templ_7745c5c3_Var14 == nil {
templ_7745c5c3_Var14 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hx_onload)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(component_id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 51, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 templ.ComponentScript = hx_onload
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16.Call)
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 = list_rpt.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 Body_Detail(component_id string, table_detail templ.Component, hx_onload templ.ComponentScript) 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_Var17 := templ.GetChildren(ctx)
if templ_7745c5c3_Var17 == nil {
templ_7745c5c3_Var17 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hx_onload)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(component_id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 57, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 templ.ComponentScript = hx_onload
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var19.Call)
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 = table_detail.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 Body_Attachment(component_id string, list_atc templ.Component, hx_onload templ.ComponentScript) 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_Var20 := templ.GetChildren(ctx)
if templ_7745c5c3_Var20 == nil {
templ_7745c5c3_Var20 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hx_onload)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(component_id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 63, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var22 templ.ComponentScript = hx_onload
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22.Call)
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 = list_atc.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 Close_Modal(modal_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 {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var23 := templ.GetChildren(ctx)
if templ_7745c5c3_Var23 == nil {
templ_7745c5c3_Var23 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal(modal_id))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 templ.ComponentScript = JSHideModal(modal_id)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var24.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
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 Aksi_Modal(modal_id string, hx_post string, hx_target string, hx_swap string, blank bool) 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_Var25 := templ.GetChildren(ctx)
if templ_7745c5c3_Var25 == nil {
templ_7745c5c3_Var25 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !blank {
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal(modal_id))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btncancel\" data-dismiss=\"modal\" hx-indicator=\".cancelloading\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 templ.ComponentScript = JSHideModal(modal_id)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var26.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(hx_post)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 81, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(hx_target)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 81, Col: 57}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(hx_swap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\modal.templ`, Line: 81, Col: 77}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><span class=\"htmx-indicator spinner-border spinner-border-sm cancelloading\" role=\"status\" aria-hidden=\"true\"></span> Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnsimpan\"><span class=\"htmx-indicator spinner-border spinner-border-sm formloading\" role=\"status\" aria-hidden=\"true\"></span> Yakin\r</button>")
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
})
}

View File

@@ -0,0 +1,61 @@
package corporate_daftarpeserta
script BeforeRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}
script AfterRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.remove("overlay");
loadingParent.classList.remove("overlay-block");
loadingChild.classList.remove("overlay-layer");
loadingSpinner.classList.add("d-none");
}
script JSHideModal(modal_id string) {
$(modal_id).modal('hide');
}
script JSShowModal(modal_id string) {
$(modal_id).modal('show');
}
script JSGenPassReload(modal_id string, link string) {
$(modal_id).modal('hide');
htmx.ajax('POST', link, {target:'#content-dp', swap:'outerHTML'});
}
script HandleFormBeforeRequest() {
const btnCancel = document.querySelectorAll('.btncancel');
const btnSimpan = document.querySelectorAll('.btnsimpan');
for (let i = 0; i < btnCancel.length; i++) {
btnCancel[i].setAttribute('disabled', 'true');
}
for (let i = 0; i < btnSimpan.length; i++) {
btnSimpan[i].setAttribute('disabled', 'true');
}
}
script HandleFormAfterRequest() {
const btnCancel = document.querySelectorAll('.btncancel');
const btnSimpan = document.querySelectorAll('.btnsimpan');
for (let i = 0; i < btnCancel.length; i++) {
btnCancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnSimpan.length; i++) {
btnSimpan[i].removeAttribute('disabled');
}
}

View File

@@ -0,0 +1,109 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_daftarpeserta
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
func BeforeRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_BeforeRequestContent_5717`,
Function: `function __templ_BeforeRequestContent_5717(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}`,
Call: templ.SafeScript(`__templ_BeforeRequestContent_5717`),
CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContent_5717`),
}
}
func AfterRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_AfterRequestContent_077f`,
Function: `function __templ_AfterRequestContent_077f(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.remove("overlay");
loadingParent.classList.remove("overlay-block");
loadingChild.classList.remove("overlay-layer");
loadingSpinner.classList.add("d-none");
}`,
Call: templ.SafeScript(`__templ_AfterRequestContent_077f`),
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContent_077f`),
}
}
func JSHideModal(modal_id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JSHideModal_6635`,
Function: `function __templ_JSHideModal_6635(modal_id){$(modal_id).modal('hide');
}`,
Call: templ.SafeScript(`__templ_JSHideModal_6635`, modal_id),
CallInline: templ.SafeScriptInline(`__templ_JSHideModal_6635`, modal_id),
}
}
func JSShowModal(modal_id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JSShowModal_f662`,
Function: `function __templ_JSShowModal_f662(modal_id){$(modal_id).modal('show');
}`,
Call: templ.SafeScript(`__templ_JSShowModal_f662`, modal_id),
CallInline: templ.SafeScriptInline(`__templ_JSShowModal_f662`, modal_id),
}
}
func JSGenPassReload(modal_id string, link string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JSGenPassReload_f8af`,
Function: `function __templ_JSGenPassReload_f8af(modal_id, link){$(modal_id).modal('hide');
htmx.ajax('POST', link, {target:'#content-dp', swap:'outerHTML'});
}`,
Call: templ.SafeScript(`__templ_JSGenPassReload_f8af`, modal_id, link),
CallInline: templ.SafeScriptInline(`__templ_JSGenPassReload_f8af`, modal_id, link),
}
}
func HandleFormBeforeRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormBeforeRequest_2881`,
Function: `function __templ_HandleFormBeforeRequest_2881(){const btnCancel = document.querySelectorAll('.btncancel');
const btnSimpan = document.querySelectorAll('.btnsimpan');
for (let i = 0; i < btnCancel.length; i++) {
btnCancel[i].setAttribute('disabled', 'true');
}
for (let i = 0; i < btnSimpan.length; i++) {
btnSimpan[i].setAttribute('disabled', 'true');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_2881`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_2881`),
}
}
func HandleFormAfterRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormAfterRequest_568b`,
Function: `function __templ_HandleFormAfterRequest_568b(){const btnCancel = document.querySelectorAll('.btncancel');
const btnSimpan = document.querySelectorAll('.btnsimpan');
for (let i = 0; i < btnCancel.length; i++) {
btnCancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnSimpan.length; i++) {
btnSimpan[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_568b`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_568b`),
}
}

View File

@@ -0,0 +1,79 @@
package corporate_daftarpeserta
import "cpone/layout"
import "cpone/component/customtextfield"
import "cpone/models"
templ DaftarPesertaScreen(
table_id string, pagination_id string,
dialog_RPT_id string, dialog_RPTBody_id string, dialog_RPT templ.Component,
dialog_Akun_id string, dialog_AkunBody_id string, dialog_Akun templ.Component,
dialog_GenPassword_id string, dialog_GenPasswordBody_id string, dialog_GenPassword templ.Component,
dialog_DetailPaket_id string, dialog_DetailPaketBody_id string, dialog_Detailpaket templ.Component,
dialog_Attachment_id string, dialog_AttachmentBody_id string, dialog_Attachment templ.Component,
content templ.Component, filter_content templ.Component,
) {
<div class="container-fluid">
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "table-id", Name: "table-id", Type: "hidden", Value: table_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "pagination-id", Name: "pagination-id", Type: "hidden", Value: pagination_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-rpt-id", Name: "dialog-rpt-id", Type: "hidden", Value: dialog_RPT_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-rptbody-id", Name: "dialog-rptbody-id", Type: "hidden", Value: dialog_RPTBody_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-akun-id", Name: "dialog-akun-id", Type: "hidden", Value: dialog_Akun_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-akunbody-id", Name: "dialog-akunbody-id", Type: "hidden", Value: dialog_AkunBody_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-password-id", Name: "dialog-password-id", Type: "hidden", Value: dialog_GenPassword_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-passbody-id", Name: "dialog-passbody-id", Type: "hidden", Value: dialog_GenPasswordBody_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-attach-id", Name: "dialog-attach-id", Type: "hidden", Value: dialog_Attachment_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-attachbody-id", Name: "dialog-attachbody-id", Type: "hidden", Value: dialog_AttachmentBody_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-paket-id", Name: "dialog-paket-id", Type: "hidden", Value: dialog_DetailPaket_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-paketbody-id", Name: "dialog-paketbody-id", Type: "hidden", Value: dialog_DetailPaketBody_id})
<div class="row align-items-center justify-content-center py-10">
<div class="col-md-2 col-sm-12 p-0"></div>
<div class="col-md-8 col-sm-12 p-0">
<h2 class="title text-black" style="margin-bottom: 0; text-align: center;">Daftar Peserta</h2>
</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={"#" + dialog_GenPassword_id }>Generate Password</button>
</div>
</div>
</div>
@filter_content
<div id="loading-parent" class="rounded">
@content
<div id="loading-child" class="rounded bg-transparent">
<div id="loading-spinner" class="spinner-border text-primary d-none" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading....</span>
</div>
</div>
<div id="loadingcontent"></div>
</div>
@dialog_GenPassword
@dialog_Akun
@dialog_RPT
@dialog_Detailpaket
@dialog_Attachment
</div>
}
templ CSS_DaftarPeserta() {
<style>
.container-rpt {
width: 100%;
overflow-x: auto;
white-space: nowrap;
}
</style>
}
templ JS_DaftarPeserta() {}
templ ShowDaftarPeserta(
title string,
component templ.Component,
css templ.Component,
js templ.Component,
) {
@layout.PlaygroundLayout(title, css, js) {
@component
}
}

View File

@@ -0,0 +1,240 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_daftarpeserta
//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/layout"
import "cpone/component/customtextfield"
import "cpone/models"
func DaftarPesertaScreen(
table_id string, pagination_id string,
dialog_RPT_id string, dialog_RPTBody_id string, dialog_RPT templ.Component,
dialog_Akun_id string, dialog_AkunBody_id string, dialog_Akun templ.Component,
dialog_GenPassword_id string, dialog_GenPasswordBody_id string, dialog_GenPassword templ.Component,
dialog_DetailPaket_id string, dialog_DetailPaketBody_id string, dialog_Detailpaket templ.Component,
dialog_Attachment_id string, dialog_AttachmentBody_id string, dialog_Attachment templ.Component,
content templ.Component, filter_content 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("<div class=\"container-fluid\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "table-id", Name: "table-id", Type: "hidden", Value: table_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "pagination-id", Name: "pagination-id", Type: "hidden", Value: pagination_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-rpt-id", Name: "dialog-rpt-id", Type: "hidden", Value: dialog_RPT_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-rptbody-id", Name: "dialog-rptbody-id", Type: "hidden", Value: dialog_RPTBody_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-akun-id", Name: "dialog-akun-id", Type: "hidden", Value: dialog_Akun_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-akunbody-id", Name: "dialog-akunbody-id", Type: "hidden", Value: dialog_AkunBody_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-password-id", Name: "dialog-password-id", Type: "hidden", Value: dialog_GenPassword_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-passbody-id", Name: "dialog-passbody-id", Type: "hidden", Value: dialog_GenPasswordBody_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-attach-id", Name: "dialog-attach-id", Type: "hidden", Value: dialog_Attachment_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-attachbody-id", Name: "dialog-attachbody-id", Type: "hidden", Value: dialog_AttachmentBody_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-paket-id", Name: "dialog-paket-id", Type: "hidden", Value: dialog_DetailPaket_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialog-paketbody-id", Name: "dialog-paketbody-id", Type: "hidden", Value: dialog_DetailPaketBody_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row align-items-center justify-content-center py-10\"><div class=\"col-md-2 col-sm-12 p-0\"></div><div class=\"col-md-8 col-sm-12 p-0\"><h2 class=\"title text-black\" style=\"margin-bottom: 0; text-align: center;\">Daftar Peserta</h2></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=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialog_GenPassword_id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\tablayout.templ`, Line: 36, Col: 126}
}
_, 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("\">Generate Password</button></div></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = filter_content.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-parent\" class=\"rounded\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = content.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-child\" class=\"rounded bg-transparent\"><div id=\"loading-spinner\" class=\"spinner-border text-primary d-none\" style=\"width: 3rem; height: 3rem;\" role=\"status\"><span class=\"sr-only\">Loading....</span></div></div><div id=\"loadingcontent\"></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = dialog_GenPassword.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = dialog_Akun.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = dialog_RPT.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = dialog_Detailpaket.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = dialog_Attachment.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 CSS_DaftarPeserta() 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("<style>\r\n .container-rpt {\r\n width: 100%;\r\n overflow-x: auto;\r\n white-space: nowrap;\r\n }\r\n </style>")
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 JS_DaftarPeserta() 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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func ShowDaftarPeserta(
title string,
component templ.Component,
css templ.Component,
js 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_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var6 := 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)
}
templ_7745c5c3_Err = component.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer)
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.PlaygroundLayout(title, css, js).Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), 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
})
}

View File

@@ -0,0 +1,184 @@
package corporate_daftarpeserta
import "cpone/component/table"
import "cpone/models"
import "strconv"
templ Content(tabledp templ.Component, paginationdp templ.Component) {
<div id="content-dp" hx-on::load={ AfterRequestContent() }>
@tabledp
@paginationdp
</div>
}
templ Table_DaftarPeserta(
data []models.ModelMcuDaftarPeserta, table_id string,
hx_get_rpt string, hx_target_rpt string, hx_include_rpt string, hx_swap_rpt string,
hx_get_dtl string, hx_target_dtl string, hx_include_dtl string, hx_swap_dtl string,
hx_get_acc string, hx_target_acc string, hx_include_acc string, hx_swap_acc string,
hx_get_atc string, hx_target_atc string, hx_include_atc string, hx_swap_atc string,
) {
<div id={ table_id }>
@tablecomponent.TableV3([]string{"NOMOR LAB", "NAMA", "JENIS KELAMIN", "TANGGAL LAHIR", "NAMA PAKET", "AKSI"},
[]string{"15%","20%","15%","15%","20%","15%"},
ItemRow(data,
hx_get_rpt, hx_target_rpt, hx_include_rpt, hx_swap_rpt,
hx_get_dtl, hx_target_dtl, hx_include_dtl, hx_swap_dtl,
hx_get_acc, hx_target_acc, hx_include_acc, hx_swap_acc,
hx_get_atc, hx_target_atc, hx_include_atc, hx_swap_atc,
),
)
</div>
}
templ ItemRow(data []models.ModelMcuDaftarPeserta,
hx_get_rpt string, hx_target_rpt string, hx_include_rpt string, hx_swap_rpt string,
hx_get_dtl string, hx_target_dtl string, hx_include_dtl string, hx_swap_dtl string,
hx_get_acc string, hx_target_acc string, hx_include_acc string, hx_swap_acc string,
hx_get_atc string, hx_target_atc string, hx_include_atc string, hx_swap_atc string,
) {
if len(data) == 0 {
<tr>
<td colspan="6" class="text-center"> Data Tidak Ditemukan </td>
</tr>
}
for _, v := range data {
<tr>
<td>{ v.T_OrderHeaderLabNumber }</td>
<td>{ v.M_PatientName }</td>
<td>{ v.JenisKelamin }</td>
<td>{ v.M_PatientDOB }</td>
<td>{ v.List_Paket }</td>
<td>@ItemAksi(v,
hx_get_rpt, hx_target_rpt, hx_include_rpt, hx_swap_rpt,
hx_get_dtl, hx_target_dtl, hx_include_dtl, hx_swap_dtl,
hx_get_acc, hx_target_acc, hx_include_acc, hx_swap_acc,
hx_get_atc, hx_target_atc, hx_include_atc, hx_swap_atc,
)
</td>
</tr>
}
}
templ ItemAksi(
data models.ModelMcuDaftarPeserta,
hx_get_rpt string, hx_target_rpt string, hx_include_rpt string, hx_swap_rpt string,
hx_get_dtl string, hx_target_dtl string, hx_include_dtl string, hx_swap_dtl string,
hx_get_acc string, hx_target_acc string, hx_include_acc string, hx_swap_acc string,
hx_get_atc string, hx_target_atc string, hx_include_atc string, hx_swap_atc string,
) {
<div class="row px-5 d-flex justify-content-around">
<a
type="button" class="btn btn-icon" title="Detail test dan paket"
hx-get={ hx_get_dtl + "?idx=" + data.T_OrderHeaderID } hx-target={ hx_target_dtl }
hx-include={ hx_include_dtl } hx-swap={ hx_swap_dtl }
><i class="flaticon2-list-1"></i></a>
<a
type="button" class="btn btn-icon" title="Detail RPT MCU"
hx-get={ hx_get_rpt + "?idx=" + data.T_OrderHeaderID } hx-target={ hx_target_rpt }
hx-include={ hx_include_rpt } hx-swap={ hx_swap_rpt }
><i class="flaticon2-file"></i></a>
<a
type="button" class="btn btn-icon" title="Detail Attachment"
hx-get={ hx_get_atc + "?idx=" + data.T_OrderHeaderID } hx-target={ hx_target_atc }
hx-include={ hx_include_atc } hx-swap={ hx_swap_atc }
><i class="flaticon-folder-1"></i></a>
if data.AuthPatientEmail != "none" {
<a
type="button" class="btn btn-icon" title="Detail Akun"
hx-get={ hx_get_acc + "?patid=" + data.M_PatientID } hx-target={ hx_target_acc }
hx-include={ hx_include_acc } hx-swap={ hx_swap_acc }
><i class="flaticon-user-settings"></i></a>
}
</div>
}
templ Table_DetailPaket(data []models.TableTestPaket) {
<div id="table-detail-paket" style="max-height: 700px; overflow-y: auto;">
@tablecomponent.TableV3([]string{"NOMOR", "NAMA TEST", "NAMA PAKET"},
[]string{"20%", "40%", "40%"},
Detail_ItemRow(data),
)
</div>
}
templ Detail_ItemRow(data []models.TableTestPaket) {
if len(data) == 0 {
<tr>
<td colspan="3" class="text-center"> Data Tidak Ditemukan </td>
</tr>
}
for _, v := range data {
<tr>
<td>{ strconv.Itoa(v.Nomor) }</td>
<td>{ v.NamaTest }</td>
<td>{ v.NamaPaket }</td>
</tr>
}
}
templ Tab_RPT(data []models.TabViewReportMcu) {
<div class="container-rpt">
<ul class="nav nav-tabs nav-tabs-line">
for i, v := range data {
if i == 0 {
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href={templ.URL("#kt_tab_pat_" + strconv.Itoa(i))}>{ v.Name }</a>
</li>
} else {
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href={templ.URL("#kt_tab_pat_" + strconv.Itoa(i))}>{ v.Name }</a>
</li>
}
}
</ul>
</div>
<div class="tab-content mt-5" id="patTabContent">
for i, v := range data {
if i == 0 {
<div class="tab-pane fade show active" id={"kt_tab_pat_" + strconv.Itoa(i)} role="tabpanel" aria-labelledby={"kt_tab_pat_" + strconv.Itoa(i)} style="height: 700px;">
<object data={ v.Link } type="application/pdf" width="100%" height="100%"></object>
</div>
} else {
<div class="tab-pane fade show" id={"kt_tab_pat_" + strconv.Itoa(i)} role="tabpanel" aria-labelledby={"kt_tab_pat_" + strconv.Itoa(i)} style="height: 700px;">
<object data={ v.Link } type="application/pdf" width="100%" height="100%"></object>
</div>
}
}
</div>
}
templ Tab_Attachment(data []models.AttachmentFIle) {
<div class="container-rpt">
<ul class="nav nav-tabs nav-tabs-line">
for i, v := range data {
// if i == 0 {
// <li class="nav-item">
// <a class="nav-link" data-toggle="tab" href={templ.URL("#kt_tab_atc_" + strconv.Itoa(i))}>{ v.File_AttachmentFileName }</a>
// </li>
// } else {
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href={templ.URL("#kt_tab_atc_" + strconv.Itoa(i))}>{ v.File_AttachmentFileName }</a>
</li>
// }
}
</ul>
</div>
<div class="tab-content mt-5" id="atcTabContent" style="min-height: 700px;">
if len(data) == 0 {
<div style="min-height: 350px;"></div>
<h3 class="text-center">Tidak ada file</h3>
}
for i, v := range data {
// if i == 0 {
// <div class="tab-pane fade show" id={"kt_tab_atc_" + strconv.Itoa(i)} role="tabpanel" aria-labelledby={"kt_tab_atc_" + strconv.Itoa(i)} style="height: 700px;">
// <object data={ v.Link } type="application/pdf" width="100%" height="100%"></object>
// </div>
// } else {
<div class="tab-pane fade show" id={"kt_tab_atc_" + strconv.Itoa(i)} role="tabpanel" aria-labelledby={"kt_tab_atc_" + strconv.Itoa(i)} style="height: 700px;">
<object data={ v.Link } type="application/pdf" width="100%" height="100%"></object>
</div>
// }
}
</div>
}

View File

@@ -0,0 +1,883 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_daftarpeserta
//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"
import "cpone/models"
import "strconv"
func Content(tabledp templ.Component, paginationdp 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.RenderScriptItems(ctx, templ_7745c5c3_Buffer, AfterRequestContent())
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"content-dp\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 templ.ComponentScript = AfterRequestContent()
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2.Call)
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 = tabledp.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = paginationdp.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 Table_DaftarPeserta(
data []models.ModelMcuDaftarPeserta, table_id string,
hx_get_rpt string, hx_target_rpt string, hx_include_rpt string, hx_swap_rpt string,
hx_get_dtl string, hx_target_dtl string, hx_include_dtl string, hx_swap_dtl string,
hx_get_acc string, hx_target_acc string, hx_include_acc string, hx_swap_acc string,
hx_get_atc string, hx_target_atc string, hx_include_atc string, hx_swap_atc 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(table_id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 21, Col: 22}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NOMOR LAB", "NAMA", "JENIS KELAMIN", "TANGGAL LAHIR", "NAMA PAKET", "AKSI"},
[]string{"15%", "20%", "15%", "15%", "20%", "15%"},
ItemRow(data,
hx_get_rpt, hx_target_rpt, hx_include_rpt, hx_swap_rpt,
hx_get_dtl, hx_target_dtl, hx_include_dtl, hx_swap_dtl,
hx_get_acc, hx_target_acc, hx_include_acc, hx_swap_acc,
hx_get_atc, hx_target_atc, hx_include_atc, hx_swap_atc,
),
).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 ItemRow(data []models.ModelMcuDaftarPeserta,
hx_get_rpt string, hx_target_rpt string, hx_include_rpt string, hx_swap_rpt string,
hx_get_dtl string, hx_target_dtl string, hx_include_dtl string, hx_swap_dtl string,
hx_get_acc string, hx_target_acc string, hx_include_acc string, hx_swap_acc string,
hx_get_atc string, hx_target_atc string, hx_include_atc string, hx_swap_atc 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_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=\"6\" 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.T_OrderHeaderLabNumber)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 47, Col: 42}
}
_, 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.M_PatientName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 48, Col: 33}
}
_, 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.JenisKelamin)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 49, Col: 32}
}
_, 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><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(v.M_PatientDOB)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 50, Col: 32}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
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_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(v.List_Paket)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 51, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
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
}
templ_7745c5c3_Err = ItemAksi(v,
hx_get_rpt, hx_target_rpt, hx_include_rpt, hx_swap_rpt,
hx_get_dtl, hx_target_dtl, hx_include_dtl, hx_swap_dtl,
hx_get_acc, hx_target_acc, hx_include_acc, hx_swap_acc,
hx_get_atc, hx_target_atc, hx_include_atc, hx_swap_atc,
).Render(ctx, templ_7745c5c3_Buffer)
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
})
}
func ItemAksi(
data models.ModelMcuDaftarPeserta,
hx_get_rpt string, hx_target_rpt string, hx_include_rpt string, hx_swap_rpt string,
hx_get_dtl string, hx_target_dtl string, hx_include_dtl string, hx_swap_dtl string,
hx_get_acc string, hx_target_acc string, hx_include_acc string, hx_swap_acc string,
hx_get_atc string, hx_target_atc string, hx_include_atc string, hx_swap_atc 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 class=\"row px-5 d-flex justify-content-around\"><a type=\"button\" class=\"btn btn-icon\" title=\"Detail test dan paket\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hx_get_dtl + "?idx=" + data.T_OrderHeaderID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 73, Col: 64}
}
_, 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-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hx_target_dtl)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 73, Col: 92}
}
_, 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("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(hx_include_dtl)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 74, Col: 39}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(hx_swap_dtl)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 74, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><i class=\"flaticon2-list-1\"></i></a> <a type=\"button\" class=\"btn btn-icon\" title=\"Detail RPT MCU\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hx_get_rpt + "?idx=" + data.T_OrderHeaderID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 78, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hx_target_rpt)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 78, Col: 92}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hx_include_rpt)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 79, Col: 39}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(hx_swap_rpt)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 79, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><i class=\"flaticon2-file\"></i></a> <a type=\"button\" class=\"btn btn-icon\" title=\"Detail Attachment\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hx_get_atc + "?idx=" + data.T_OrderHeaderID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 83, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(hx_target_atc)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 83, Col: 92}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(hx_include_atc)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 84, Col: 39}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(hx_swap_atc)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 84, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><i class=\"flaticon-folder-1\"></i></a> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if data.AuthPatientEmail != "none" {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btn btn-icon\" title=\"Detail Akun\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(hx_get_acc + "?patid=" + data.M_PatientID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 89, Col: 66}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(hx_target_acc)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 89, Col: 94}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(hx_include_acc)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 90, Col: 43}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(hx_swap_acc)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 90, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><i class=\"flaticon-user-settings\"></i></a>")
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 Table_DetailPaket(data []models.TableTestPaket) 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_Var28 := templ.GetChildren(ctx)
if templ_7745c5c3_Var28 == nil {
templ_7745c5c3_Var28 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"table-detail-paket\" style=\"max-height: 700px; overflow-y: auto;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NOMOR", "NAMA TEST", "NAMA PAKET"},
[]string{"20%", "40%", "40%"},
Detail_ItemRow(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 Detail_ItemRow(data []models.TableTestPaket) 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_Var29 := templ.GetChildren(ctx)
if templ_7745c5c3_Var29 == nil {
templ_7745c5c3_Var29 = 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_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.Nomor))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 113, Col: 39}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
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_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(v.NamaTest)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 114, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
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_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(v.NamaPaket)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 115, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
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
})
}
func Tab_RPT(data []models.TabViewReportMcu) 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_Var33 := templ.GetChildren(ctx)
if templ_7745c5c3_Var33 == nil {
templ_7745c5c3_Var33 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"container-rpt\"><ul class=\"nav nav-tabs nav-tabs-line\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i, v := range data {
if i == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<li class=\"nav-item\"><a class=\"nav-link active\" data-toggle=\"tab\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var34 templ.SafeURL = templ.URL("#kt_tab_pat_" + strconv.Itoa(i))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var34)))
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_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(v.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 126, Col: 128}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var36 templ.SafeURL = templ.URL("#kt_tab_pat_" + strconv.Itoa(i))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var36)))
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_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(v.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 130, Col: 121}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</ul></div><div class=\"tab-content mt-5\" id=\"patTabContent\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i, v := range data {
if i == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"tab-pane fade show active\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var38 string
templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinStringErrs("kt_tab_pat_" + strconv.Itoa(i))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 139, Col: 90}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" role=\"tabpanel\" aria-labelledby=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var39 string
templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs("kt_tab_pat_" + strconv.Itoa(i))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 139, Col: 156}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" style=\"height: 700px;\"><object data=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var40 string
templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinStringErrs(v.Link)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 140, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"application/pdf\" width=\"100%\" height=\"100%\"></object></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"tab-pane fade show\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var41 string
templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs("kt_tab_pat_" + strconv.Itoa(i))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 143, Col: 83}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" role=\"tabpanel\" aria-labelledby=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var42 string
templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs("kt_tab_pat_" + strconv.Itoa(i))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 143, Col: 149}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" style=\"height: 700px;\"><object data=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var43 string
templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(v.Link)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 144, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"application/pdf\" width=\"100%\" height=\"100%\"></object></div>")
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 Tab_Attachment(data []models.AttachmentFIle) 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_Var44 := templ.GetChildren(ctx)
if templ_7745c5c3_Var44 == nil {
templ_7745c5c3_Var44 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"container-rpt\"><ul class=\"nav nav-tabs nav-tabs-line\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i, v := range data {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var45 templ.SafeURL = templ.URL("#kt_tab_atc_" + strconv.Itoa(i))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var45)))
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_Var46 string
templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.JoinStringErrs(v.File_AttachmentFileName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 161, Col: 140}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</ul></div><div class=\"tab-content mt-5\" id=\"atcTabContent\" style=\"min-height: 700px;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if len(data) == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div style=\"min-height: 350px;\"></div><h3 class=\"text-center\">Tidak ada file</h3>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
for i, v := range data {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" <div class=\"tab-pane fade show\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var47 string
templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs("kt_tab_atc_" + strconv.Itoa(i))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 178, Col: 83}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" role=\"tabpanel\" aria-labelledby=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var48 string
templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs("kt_tab_atc_" + strconv.Itoa(i))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 178, Col: 149}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" style=\"height: 700px;\"><object data=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var49 string
templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(v.Link)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\daftarpeserta\table.templ`, Line: 179, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"application/pdf\" width=\"100%\" height=\"100%\"></object></div>")
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
})
}

View File

@@ -0,0 +1,50 @@
package corporate_kelainanfisik
templ KelainanFisikScreen(chart_xs []templ.Component, chart_md []templ.Component, chart_lg []templ.Component) {
<div class="container-fluid">
<div class="d-flex justify-content-center py-10">
<h2 class="title text-black" style="margin-bottom: 0;">Data Kelainan Fisik</h2>
</div>
// xs
<div class="d-xs-block d-sm-block d-md-none">
<div class="row justify-content-center">
for _, v := range chart_xs {
<div class="col-12 my-4">
@Chart_Card(v)
</div>
}
</div>
</div>
// md
<div class="d-none d-md-block d-lg-none">
<div class="row justify-content-center">
for _, v := range chart_md {
<div class="col-12 my-4">
@Chart_Card(v)
</div>
}
</div>
</div>
// lg
<div class="d-none d-lg-block">
<div class="row justify-content-center">
for _, v := range chart_lg {
<div class="m-4" style="width: 47%;">
@Chart_Card(v)
</div>
}
</div>
</div>
</div>
}
templ Chart_Card(chart templ.Component) {
<div class="card shadow p-4" style="display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;">
<div class="d-flex flex-column pt-8" style="width: 100%;">
@chart
</div>
</div>
}

View File

@@ -0,0 +1,121 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_kelainanfisik
//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"
func KelainanFisikScreen(chart_xs []templ.Component, chart_md []templ.Component, chart_lg []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("<div class=\"container-fluid\"><div class=\"d-flex justify-content-center py-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0;\">Data Kelainan Fisik</h2></div><div class=\"d-xs-block d-sm-block d-md-none\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_xs {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-md-block d-lg-none\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_md {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-lg-block\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_lg {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"m-4\" style=\"width: 47%;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, 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 Chart_Card(chart 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_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("<div class=\"card shadow p-4\" style=\"display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;\"><div class=\"d-flex flex-column pt-8\" style=\"width: 100%;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = chart.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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
})
}

View File

@@ -0,0 +1,50 @@
package corporate_kelainanglobal
templ KelainanGlobal_Screen(chart_xs []templ.Component, chart_md []templ.Component, chart_lg []templ.Component) {
<div class="container-fluid">
<div class="d-flex justify-content-center py-10">
<h2 class="title text-black" style="margin-bottom: 0;">Data Kelainan Global</h2>
</div>
// xs
<div class="d-xs-block d-sm-block d-md-none">
<div class="row justify-content-center">
for _, v := range chart_xs {
<div class="col-12 my-4">
@Chart_Card(v)
</div>
}
</div>
</div>
// md
<div class="d-none d-md-block d-lg-none">
<div class="row justify-content-center">
for _, v := range chart_md {
<div class="col-12 my-4">
@Chart_Card(v)
</div>
}
</div>
</div>
// lg
<div class="d-none d-lg-block">
<div class="row justify-content-center">
for _, v := range chart_lg {
<div class="m-4" style="width: 100%;">
@Chart_Card(v)
</div>
}
</div>
</div>
</div>
}
templ Chart_Card(chart templ.Component) {
<div class="card shadow p-4" style="display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;">
<div class="d-flex flex-column pt-8" style="width: 100%;">
@chart
</div>
</div>
}

View File

@@ -0,0 +1,121 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_kelainanglobal
//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"
func KelainanGlobal_Screen(chart_xs []templ.Component, chart_md []templ.Component, chart_lg []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("<div class=\"container-fluid\"><div class=\"d-flex justify-content-center py-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0;\">Data Kelainan Global</h2></div><div class=\"d-xs-block d-sm-block d-md-none\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_xs {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-md-block d-lg-none\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_md {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-lg-block\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_lg {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"m-4\" style=\"width: 100%;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, 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 Chart_Card(chart 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_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("<div class=\"card shadow p-4\" style=\"display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;\"><div class=\"d-flex flex-column pt-8\" style=\"width: 100%;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = chart.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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
})
}

View File

@@ -0,0 +1,50 @@
package corporate_kelainanlab
templ KelainanLabScreen(chart_xs []templ.Component, chart_md []templ.Component, chart_lg []templ.Component) {
<div class="container-fluid">
<div class="d-flex justify-content-center py-10">
<h2 class="title text-black" style="margin-bottom: 0;">Data Kelainan Lab</h2>
</div>
// xs
<div class="d-xs-block d-sm-block d-md-none">
<div class="row justify-content-center">
for _, v := range chart_xs {
<div class="col-12 my-4">
@Chart_Card(v)
</div>
}
</div>
</div>
// md
<div class="d-none d-md-block d-lg-none">
<div class="row justify-content-center">
for _, v := range chart_md {
<div class="col-12 my-4">
@Chart_Card(v)
</div>
}
</div>
</div>
// lg
<div class="d-none d-lg-block">
<div class="row justify-content-center">
for _, v := range chart_lg {
<div class="m-4" style="width: 47%;">
@Chart_Card(v)
</div>
}
</div>
</div>
</div>
}
templ Chart_Card(chart templ.Component) {
<div class="card shadow p-4" style="display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;">
<div class="d-flex flex-column pt-8" style="width: 100%;">
@chart
</div>
</div>
}

View File

@@ -0,0 +1,121 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_kelainanlab
//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"
func KelainanLabScreen(chart_xs []templ.Component, chart_md []templ.Component, chart_lg []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("<div class=\"container-fluid\"><div class=\"d-flex justify-content-center py-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0;\">Data Kelainan Lab</h2></div><div class=\"d-xs-block d-sm-block d-md-none\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_xs {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-md-block d-lg-none\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_md {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-lg-block\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_lg {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"m-4\" style=\"width: 47%;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, 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 Chart_Card(chart 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_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("<div class=\"card shadow p-4\" style=\"display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;\"><div class=\"d-flex flex-column pt-8\" style=\"width: 100%;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = chart.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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
})
}

View File

@@ -0,0 +1,50 @@
package corporate_kelainannonlab
templ KelainanNonlabScreen(chart_xs []templ.Component, chart_md []templ.Component, chart_lg []templ.Component) {
<div class="container-fluid">
<div class="d-flex justify-content-center py-10">
<h2 class="title text-black" style="margin-bottom: 0;">Data Kelainan Non Lab</h2>
</div>
// xs
<div class="d-xs-block d-sm-block d-md-none">
<div class="row justify-content-center">
for _, v := range chart_xs {
<div class="col-12 my-4">
@Chart_Card(v)
</div>
}
</div>
</div>
// md
<div class="d-none d-md-block d-lg-none">
<div class="row justify-content-center">
for _, v := range chart_md {
<div class="col-12 my-4">
@Chart_Card(v)
</div>
}
</div>
</div>
// lg
<div class="d-none d-lg-block">
<div class="row justify-content-center">
for _, v := range chart_lg {
<div class="m-4" style="width: 47%;">
@Chart_Card(v)
</div>
}
</div>
</div>
</div>
}
templ Chart_Card(chart templ.Component) {
<div class="card shadow p-4" style="display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;">
<div class="d-flex flex-column pt-8" style="width: 100%;">
@chart
</div>
</div>
}

View File

@@ -0,0 +1,121 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_kelainannonlab
//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"
func KelainanNonlabScreen(chart_xs []templ.Component, chart_md []templ.Component, chart_lg []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("<div class=\"container-fluid\"><div class=\"d-flex justify-content-center py-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0;\">Data Kelainan Non Lab</h2></div><div class=\"d-xs-block d-sm-block d-md-none\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_xs {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-md-block d-lg-none\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_md {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-lg-block\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_lg {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"m-4\" style=\"width: 47%;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, 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 Chart_Card(chart 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_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("<div class=\"card shadow p-4\" style=\"display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;\"><div class=\"d-flex flex-column pt-8\" style=\"width: 100%;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = chart.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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
})
}

View File

@@ -0,0 +1,50 @@
package corporate_kepesertaan
templ KepesertaanScreen(chart_xs []templ.Component, chart_md []templ.Component, chart_lg []templ.Component) {
<div class="container-fluid">
<div class="d-flex justify-content-center py-10">
<h2 class="title text-black" style="margin-bottom: 0;">Data Kepesertaan MCU</h2>
</div>
// xs
<div class="d-xs-block d-sm-block d-md-none">
<div class="row justify-content-center">
for _, v := range chart_xs {
<div class="col-12 my-4">
@Chart_Card(v)
</div>
}
</div>
</div>
// md
<div class="d-none d-md-block d-lg-none">
<div class="row justify-content-center">
for _, v := range chart_md {
<div class="col-12 my-4">
@Chart_Card(v)
</div>
}
</div>
</div>
// lg
<div class="d-none d-lg-block">
<div class="row justify-content-center">
for _, v := range chart_lg {
<div class="m-4" style="width: 47%;">
@Chart_Card(v)
</div>
}
</div>
</div>
</div>
}
templ Chart_Card(chart templ.Component) {
<div class="card shadow p-4" style="display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;">
<div class="d-flex flex-column pt-8" style="width: 100%;">
@chart
</div>
</div>
}

View File

@@ -0,0 +1,121 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_kepesertaan
//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"
func KepesertaanScreen(chart_xs []templ.Component, chart_md []templ.Component, chart_lg []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("<div class=\"container-fluid\"><div class=\"d-flex justify-content-center py-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0;\">Data Kepesertaan MCU</h2></div><div class=\"d-xs-block d-sm-block d-md-none\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_xs {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-md-block d-lg-none\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_md {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-12 my-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><div class=\"d-none d-lg-block\"><div class=\"row justify-content-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range chart_lg {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"m-4\" style=\"width: 47%;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Chart_Card(v).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
}
}
_, 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 Chart_Card(chart 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_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("<div class=\"card shadow p-4\" style=\"display: flex; justify-content: center; align-items: center; height: 100%; width: 100%;\"><div class=\"d-flex flex-column pt-8\" style=\"width: 100%;\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = chart.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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
})
}

View File

@@ -0,0 +1,53 @@
package corporate_kesimpulan
import "cpone/component/customtextfield"
import "cpone/models"
templ KesimpulanScreen(
table_id string, content_lab templ.Component,
content_nonlab templ.Component, content_fisik templ.Component,
) {
<div class="container-fluid">
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "table-id", Name: "table-id", Type: "hidden", Value: table_id})
<div class="d-flex justify-content-center py-10">
<h2 class="title text-black" style="margin-bottom: 0;"> Kesimpulan </h2>
</div>
<div id="loading-parent" class="rounded">
@content_lab
@content_nonlab
@content_fisik
<div id="loading-child" class="rounded bg-transparent">
<div id="loading-spinner" class="spinner-border text-primary d-none">
<span class="sr-only">Loading....</span>
</div>
</div>
</div>
<div id="loadingcontent"></div>
</div>
}
templ CSSKesimpulan() {
<style>
.dot-text {
position: relative;
padding-left: 1.5em; /* Menambahkan padding untuk memberi ruang pada titik */
}
.dot-text::before {
content: "•"; /* Menambahkan titik di depan teks */
position: absolute;
left: 1em; /* Atur posisi titik */
top: 0;
transform: translateX(-100%);
}
.information-title {
color: #0e1e28;
font-family: Poppins;
font-size: 20px;
font-style: normal;
font-weight: 600;
line-height: normal;
}
</style>
}

View File

@@ -1,7 +1,7 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_mcudetail
package corporate_kesimpulan
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -10,16 +10,12 @@ import "context"
import "io"
import "bytes"
import (
"cpone/component/customtextfield"
"cpone/models"
)
import "cpone/component/customtextfield"
import "cpone/models"
func MainKesimpulan(
tableID string,
tablecontent templ.Component,
tablecontentnonlab templ.Component,
tablecontentfisik templ.Component,
func KesimpulanScreen(
table_id string, content_lab templ.Component,
content_nonlab templ.Component, content_fisik 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)
@@ -37,30 +33,27 @@ func MainKesimpulan(
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)
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "table-id", Name: "table-id", Type: "hidden", Value: table_id}).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 text-black\" style=\"margin-bottom: 0\">Kesimpulan</h2></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-center py-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0;\">Kesimpulan </h2></div><div id=\"loading-parent\" class=\"rounded\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = content_lab.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecontentnonlab.Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = content_nonlab.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecontentfisik.Render(ctx, templ_7745c5c3_Buffer)
templ_7745c5c3_Err = content_fisik.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-child\" class=\"rounded bg-transparent\"><div id=\"loading-spinner\" class=\"spinner-border text-primary d-none\"><span class=\"sr-only\">Loading....</span></div></div></div><div id=\"loadingcontent\"></div></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -71,7 +64,7 @@ func MainKesimpulan(
})
}
func CssKesimpulan() templ.Component {
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 {
@@ -84,7 +77,7 @@ func CssKesimpulan() templ.Component {
templ_7745c5c3_Var2 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<style>\r\n .dot-text {\r\n position: relative;\r\n padding-left: 1.5em; /* Menambahkan padding untuk memberi ruang pada titik */\r\n }\r\n\r\n .dot-text::before {\r\n content: \"•\"; /* Menambahkan titik di depan teks */\r\n position: absolute;\r\n left: 1em; /* Atur posisi titik */\r\n top: 0;\r\n transform: translateX(-100%);\r\n }\r\n\r\n .information-title {\r\n color: #0e1e28;\r\n font-family: Poppins;\r\n font-size: 20px;\r\n font-style: normal;\r\n font-weight: 600;\r\n line-height: normal;\r\n } \r\n </style>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<style>\r\n .dot-text {\r\n position: relative;\r\n padding-left: 1.5em; /* Menambahkan padding untuk memberi ruang pada titik */\r\n }\r\n\r\n .dot-text::before {\r\n content: \"•\"; /* Menambahkan titik di depan teks */\r\n position: absolute;\r\n left: 1em; /* Atur posisi titik */\r\n top: 0;\r\n transform: translateX(-100%);\r\n }\r\n\r\n .information-title {\r\n color: #0e1e28;\r\n font-family: Poppins;\r\n font-size: 20px;\r\n font-style: normal;\r\n font-weight: 600;\r\n line-height: normal;\r\n }\r\n </style>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -94,23 +87,3 @@ func CssKesimpulan() templ.Component {
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
})
}

View File

@@ -0,0 +1,35 @@
package corporate_kesimpulan
import (
"cpone/component/table"
"cpone/models"
"strconv"
)
templ Table_Kesimpulan(title string, data []models.ModelKesimpulanLab, table_id 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 id={ table_id }>
@tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PRESENTASE"}, []string{"5%", "70%", "25%"}, Row_Kesimpulan(data))
</div>
</div>
</div>
}
templ Row_Kesimpulan(data []models.ModelKesimpulanLab) {
if len(data) == 0 {
<tr>
<td colspan="3" class="text-center">Data Tidak Ditemukan</td>
</tr>
}
for i, v := range data {
<tr>
<td>{ strconv.Itoa(i + 1) }</td>
<td>{ v.Test }</td>
<td>{ v.Total }</td>
</tr>
}
}

View File

@@ -1,7 +1,7 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_mcudetail
package corporate_kesimpulan
//lint:file-ignore SA4006 This context is only used if a nested component is present.
@@ -13,9 +13,10 @@ import "bytes"
import (
"cpone/component/table"
"cpone/models"
"strconv"
)
func CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID string) templ.Component {
func Table_Kesimpulan(title string, data []models.ModelKesimpulanLab, table_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 {
@@ -28,24 +29,37 @@ func CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID
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\">")
_, 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\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 12, Col: 11}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\kesimpulan\table.templ`, Line: 12, Col: 62}
}
_, 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>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h3></div><div class=\"card-body\"><div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = TableKesimpulan(data, tableID).Render(ctx, templ_7745c5c3_Buffer)
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(table_id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\kesimpulan\table.templ`, Line: 15, Col: 30}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PRESENTASE"}, []string{"5%", "70%", "25%"}, Row_Kesimpulan(data)).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -60,8 +74,7 @@ func CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID
})
}
func TableKesimpulan(data []models.ModelKesimpulanLab,
tableID string) templ.Component {
func Row_Kesimpulan(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 {
@@ -69,57 +82,9 @@ func TableKesimpulan(data []models.ModelKesimpulanLab,
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(tableID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 25, Col: 18}
}
_, 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("\">")
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("</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 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
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if len(data) == 0 {
@@ -128,15 +93,28 @@ func RowKesimpulan(data []models.ModelKesimpulanLab) templ.Component {
return templ_7745c5c3_Err
}
}
for _, v := range data {
for i, 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)
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(i + 1))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 41, Col: 16}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\kesimpulan\table.templ`, Line: 30, Col: 37}
}
_, 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("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.Test)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\kesimpulan\table.templ`, Line: 31, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -147,27 +125,14 @@ func RowKesimpulan(data []models.ModelKesimpulanLab) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.Test)
templ_7745c5c3_Var7, 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: 42, Col: 15}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\kesimpulan\table.templ`, Line: 32, Col: 25}
}
_, 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\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("</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err

View File

@@ -0,0 +1,23 @@
package corporate_keuangan
script AfterRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.remove("overlay");
loadingParent.classList.remove("overlay-block");
loadingChild.classList.remove("overlay-layer");
loadingSpinner.classList.add("d-none");
}
script BeforeRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}

View File

@@ -0,0 +1,42 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_keuangan
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
func AfterRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_AfterRequestContent_077f`,
Function: `function __templ_AfterRequestContent_077f(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.remove("overlay");
loadingParent.classList.remove("overlay-block");
loadingChild.classList.remove("overlay-layer");
loadingSpinner.classList.add("d-none");
}`,
Call: templ.SafeScript(`__templ_AfterRequestContent_077f`),
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContent_077f`),
}
}
func BeforeRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_BeforeRequestContent_5717`,
Function: `function __templ_BeforeRequestContent_5717(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}`,
Call: templ.SafeScript(`__templ_BeforeRequestContent_5717`),
CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContent_5717`),
}
}

View File

@@ -0,0 +1,64 @@
package corporate_keuangan
import "cpone/component/customtextfield"
import "cpone/models"
templ Tab_Keuangan(
table_id string, pagination_id string,
summary_card templ.Component, content templ.Component,
) {
<div class="container-fluid">
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "table-id", Name: "table-id", Type: "hidden", Value: table_id})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "pagination-id", Name: "pagination-id", Type: "hidden", Value: pagination_id})
<div class="d-flex justify-content-center py-10">
<h2 class="title text-black" style="margin-bottom: 0;">Keuangan</h2>
</div>
<div id="loading-parent" class="rounded">
@summary_card
@content
<div id="loading-child" class="rounded bg-transparent">
<div id="loading-spinner" class="spinner-border text-primary d-none">
<span class="sr-only">Loading....</span>
</div>
</div>
</div>
<div id="loadingcontent"></div>
</div>
}
templ Summary_Card(total_order string, total_tagihan string, total_lunas string, total_hutang string) {
<div class="row">
<div class="col-3">
<div class="card bg-primary-transparent shadow p-4">
<div class="d-flex flex-column">
<h3>Order</h3>
<h1 class="font-weight-bolder ml-auto mt-4">{ total_order }</h1>
</div>
</div>
</div>
<div class="col-3">
<div class="card bg-warning-transparent shadow p-4">
<div class="d-flex flex-column">
<h3>Tagihan</h3>
<h1 class="font-weight-bolder ml-auto mt-4">{ total_tagihan }</h1>
</div>
</div>
</div>
<div class="col-3">
<div class="card bg-success-transparent shadow p-4">
<div class="d-flex flex-column">
<h3>Pelunasan</h3>
<h1 class="font-weight-bolder ml-auto mt-4">{ total_lunas }</h1>
</div>
</div>
</div>
<div class="col-3">
<div class="card bg-danger-transparent shadow p-4">
<div class="d-flex flex-column">
<h3>Hutang</h3>
<h1 class="font-weight-bolder ml-auto mt-4">{ total_hutang }</h1>
</div>
</div>
</div>
</div>
}

View File

@@ -0,0 +1,141 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_keuangan
//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"
import "cpone/models"
func Tab_Keuangan(
table_id string, pagination_id string,
summary_card templ.Component, content 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("<div class=\"container-fluid\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "table-id", Name: "table-id", Type: "hidden", Value: table_id}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "pagination-id", Name: "pagination-id", Type: "hidden", Value: pagination_id}).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 py-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0;\">Keuangan</h2></div><div id=\"loading-parent\" class=\"rounded\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = summary_card.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = content.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-child\" class=\"rounded bg-transparent\"><div id=\"loading-spinner\" class=\"spinner-border text-primary d-none\"><span class=\"sr-only\">Loading....</span></div></div></div><div id=\"loadingcontent\"></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 Summary_Card(total_order string, total_tagihan string, total_lunas string, total_hutang 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_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("<div class=\"row\"><div class=\"col-3\"><div class=\"card bg-primary-transparent shadow p-4\"><div class=\"d-flex flex-column\"><h3>Order</h3><h1 class=\"font-weight-bolder ml-auto mt-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(total_order)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\tablayout.templ`, Line: 35, Col: 77}
}
_, 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("</h1></div></div></div><div class=\"col-3\"><div class=\"card bg-warning-transparent shadow p-4\"><div class=\"d-flex flex-column\"><h3>Tagihan</h3><h1 class=\"font-weight-bolder ml-auto mt-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(total_tagihan)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\tablayout.templ`, Line: 43, Col: 79}
}
_, 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("</h1></div></div></div><div class=\"col-3\"><div class=\"card bg-success-transparent shadow p-4\"><div class=\"d-flex flex-column\"><h3>Pelunasan</h3><h1 class=\"font-weight-bolder ml-auto mt-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(total_lunas)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\tablayout.templ`, Line: 51, Col: 77}
}
_, 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("</h1></div></div></div><div class=\"col-3\"><div class=\"card bg-danger-transparent shadow p-4\"><div class=\"d-flex flex-column\"><h3>Hutang</h3><h1 class=\"font-weight-bolder ml-auto mt-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(total_hutang)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\tablayout.templ`, Line: 59, Col: 78}
}
_, 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("</h1></div></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
})
}

View File

@@ -0,0 +1,98 @@
package corporate_keuangan
import "cpone/models"
import "strconv"
import "cpone/utils"
templ Content(tablecomp templ.Component, paginationcomp templ.Component) {
<div id="content-uang" hx-on::load={ AfterRequestContent() }>
@tablecomp
@paginationcomp
</div>
}
templ Table_Keuangan(data []models.KeuanganModel, table_id string) {
<div id={ table_id } class="mt-8">
<table class="table table-hover table-bordered">
<thead>
<tr class="rounded-lg bg-header-table">
<th scope="col" class="text-center col-5" colspan="3"><h4>TAGIHAN</h4></th>
<th scope="col" class="text-center col-4" colspan="2"><h4>PELUNASAN</h4></th>
<th scope="col" class="text-center col-5" rowspan="2" style="vertical-align: middle;"><h4>SISA</h4></th>
</tr>
<tr>
<th scope="col" class="text-center">No/Tgl</th>
<th scope="col" class="text-center">Tgl Jatuh Tempo</th>
<th scope="col" class="text-center">Jumlah</th>
<th scope="col" class="text-center">No/Tgl</th>
<th scope="col" class="text-center">Jumlah</th>
</tr>
</thead>
<tbody>
@Row_Keuangan(data)
</tbody>
</table>
</div>
}
templ Row_Keuangan(data []models.KeuanganModel) {
if len(data) == 0 {
<tr>
<td colspan="6" class="text-center">Data Tidak Ditemukan</td>
</tr>
}
for _, v := range data {
if len(v.BillPayment) == 0 {
<tr>
<td class="text-center">
<div>{ v.F_BillNo }</div>
<div>{ v.F_BillCreated }</div>
</td>
<td class="text-center">{ v.F_BillDueDate }</td>
<td class="text-center">{ utils.FormatRibuan(v.F_BillTotal) }</td>
<td class="text-center">-</td>
<td class="text-center">-</td>
<td class="text-center">{ utils.FormatRibuan(v.F_BillUnpaid) }</td>
</tr>
} else if len(v.BillPayment) == 1 {
<tr>
<td class="text-center" rowspan={ strconv.Itoa(len(v.BillPayment)) }>
<div>{ v.F_BillNo }</div>
<div>{ v.F_BillCreated }</div>
</td>
<td class="text-center" rowspan={ strconv.Itoa(len(v.BillPayment)) }>{ v.F_BillDueDate }</td>
<td class="text-center" rowspan={ strconv.Itoa(len(v.BillPayment)) }>{ utils.FormatRibuan(v.F_BillTotal) }</td>
<td class="text-center">
<div>{ v.BillPayment[0].F_BillPaymentNumber }</div>
<div>{ v.BillPayment[0].F_BillPaymentDate }</div>
</td>
<td class="text-center">{ utils.FormatRibuan(int(v.BillPayment[0].F_BillPaymentAmount)) }</td>
<td class="text-center" rowspan={ strconv.Itoa(len(v.BillPayment)) }>{ utils.FormatRibuan(v.F_BillUnpaid) }</td>
</tr>
} else {
<tr>
<td class="text-center" rowspan={ strconv.Itoa(len(v.BillPayment)) }>
<div>{ v.F_BillNo }</div>
<div>{ v.F_BillCreated }</div>
</td>
<td class="text-center" rowspan={ strconv.Itoa(len(v.BillPayment)) }>{ v.F_BillDueDate }</td>
<td class="text-center" rowspan={ strconv.Itoa(len(v.BillPayment)) }>{ utils.FormatRibuan(v.F_BillTotal) }</td>
<td class="text-center">
<div>{ v.BillPayment[0].F_BillPaymentNumber }</div>
<div>{ v.BillPayment[0].F_BillPaymentDate }</div>
</td>
<td class="text-center">{ utils.FormatRibuan(int(v.BillPayment[0].F_BillPaymentAmount)) }</td>
<td class="text-center" rowspan={ strconv.Itoa(len(v.BillPayment)) }>{ utils.FormatRibuan(v.F_BillUnpaid) }</td>
</tr>
for i := 1; i < len(v.BillPayment); i++ {
<tr>
<td class="text-center">
<div>{ v.BillPayment[i].F_BillPaymentNumber }</div>
<div>{ v.BillPayment[i].F_BillPaymentDate }</div>
</td>
<td class="text-center">{ utils.FormatRibuan(int(v.BillPayment[i].F_BillPaymentAmount)) }</td>
</tr>
}
}
}
}

View File

@@ -0,0 +1,575 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package corporate_keuangan
//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/models"
import "strconv"
import "cpone/utils"
func Content(tablecomp templ.Component, paginationcomp 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.RenderScriptItems(ctx, templ_7745c5c3_Buffer, AfterRequestContent())
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"content-uang\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 templ.ComponentScript = AfterRequestContent()
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var2.Call)
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 = tablecomp.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = paginationcomp.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 Table_Keuangan(data []models.KeuanganModel, table_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 {
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(table_id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 15, Col: 22}
}
_, 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("\" class=\"mt-8\"><table class=\"table table-hover table-bordered\"><thead><tr class=\"rounded-lg bg-header-table\"><th scope=\"col\" class=\"text-center col-5\" colspan=\"3\"><h4>TAGIHAN</h4></th><th scope=\"col\" class=\"text-center col-4\" colspan=\"2\"><h4>PELUNASAN</h4></th><th scope=\"col\" class=\"text-center col-5\" rowspan=\"2\" style=\"vertical-align: middle;\"><h4>SISA</h4></th></tr><tr><th scope=\"col\" class=\"text-center\">No/Tgl</th><th scope=\"col\" class=\"text-center\">Tgl Jatuh Tempo</th><th scope=\"col\" class=\"text-center\">Jumlah</th><th scope=\"col\" class=\"text-center\">No/Tgl</th><th scope=\"col\" class=\"text-center\">Jumlah</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = Row_Keuangan(data).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</tbody></table></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 Row_Keuangan(data []models.KeuanganModel) 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=\"6\" class=\"text-center\">Data Tidak Ditemukan</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
for _, v := range data {
if len(v.BillPayment) == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td class=\"text-center\"><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillNo)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 48, Col: 37}
}
_, 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("</div><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillCreated)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 49, Col: 42}
}
_, 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("</div></td><td class=\"text-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillDueDate)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 51, Col: 57}
}
_, 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><td class=\"text-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(utils.FormatRibuan(v.F_BillTotal))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 52, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td class=\"text-center\">-</td><td class=\"text-center\">-</td><td class=\"text-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(utils.FormatRibuan(v.F_BillUnpaid))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 55, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
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
}
} else if len(v.BillPayment) == 1 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td class=\"text-center\" rowspan=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(len(v.BillPayment)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 59, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
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
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillNo)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 60, Col: 37}
}
_, 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("</div><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillCreated)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 61, Col: 42}
}
_, 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("</div></td><td class=\"text-center\" rowspan=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(len(v.BillPayment)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 63, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
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_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillDueDate)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 63, Col: 102}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td class=\"text-center\" rowspan=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(len(v.BillPayment)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 64, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
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_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(utils.FormatRibuan(v.F_BillTotal))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 64, Col: 120}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td class=\"text-center\"><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[0].F_BillPaymentNumber)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 66, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[0].F_BillPaymentDate)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 67, Col: 61}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></td><td class=\"text-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(utils.FormatRibuan(int(v.BillPayment[0].F_BillPaymentAmount)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 69, Col: 103}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td class=\"text-center\" rowspan=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(len(v.BillPayment)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 70, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
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_Var22 string
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(utils.FormatRibuan(v.F_BillUnpaid))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 70, Col: 121}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
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
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td class=\"text-center\" rowspan=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(len(v.BillPayment)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 74, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
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
}
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillNo)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 75, Col: 37}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillCreated)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 76, Col: 42}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></td><td class=\"text-center\" rowspan=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(len(v.BillPayment)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 78, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
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_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(v.F_BillDueDate)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 78, Col: 102}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td class=\"text-center\" rowspan=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(len(v.BillPayment)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 79, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
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_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(utils.FormatRibuan(v.F_BillTotal))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 79, Col: 120}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td class=\"text-center\"><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[0].F_BillPaymentNumber)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 81, Col: 63}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[0].F_BillPaymentDate)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 82, Col: 61}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></td><td class=\"text-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(utils.FormatRibuan(int(v.BillPayment[0].F_BillPaymentAmount)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 84, Col: 103}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td class=\"text-center\" rowspan=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(len(v.BillPayment)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 85, Col: 82}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
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_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(utils.FormatRibuan(v.F_BillUnpaid))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 85, Col: 121}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
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
}
for i := 1; i < len(v.BillPayment); i++ {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td class=\"text-center\"><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[i].F_BillPaymentNumber)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 90, Col: 67}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var36 string
templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(v.BillPayment[i].F_BillPaymentDate)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 91, Col: 65}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></td><td class=\"text-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(utils.FormatRibuan(int(v.BillPayment[i].F_BillPaymentAmount)))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\keuangan\table.templ`, Line: 93, Col: 107}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
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,124 +0,0 @@
package corporate_mcudetail
import "cpone/component/modal"
import "cpone/models"
import "strconv"
templ DialogReport(
IDComponent string,
postLink string,
hxTarget string,
hxSwap string,
hxInclude string,
modalID string,
modalTitle string,
modalBody templ.Component,
modalClose templ.Component,
) {
<div class="">
<div
id={ IDComponent }
hx-include={ hxInclude }
>
@modalcomponent.ModalViewXL(modalID,
modalTitle,
modalBody,
modalClose,
)
</div>
</div>
}
templ ModalBody(
IDComponent string,
tabComponent templ.Component,
hxOnLoad templ.ComponentScript,
) {
<div id={ IDComponent } hx-on::load={ hxOnLoad }>
@tabComponent
</div>
}
script JsHideModal(modalID string) {
$(modalID).modal('hide');
}
script JsShowModal(modalID string) {
$(modalID).modal('show');
}
templ ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID string) {
<button
type="button"
hx-on::after-request={ JsHideModal(modalID) }
class="close"
data-dismiss="modal"
aria-label="Close"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}
templ TabReportView(
datamcu []models.TabViewReportMcu,
) {
<div>
<ul class="nav nav-tabs nav-tabs-line">
for i, v := range datamcu {
if i == 0 {
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href={templ.URL("#kt_tab_pat_" + strconv.Itoa(i))}>{ v.Name }</a>
</li>
} else {
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href={templ.URL("#kt_tab_pat_" + strconv.Itoa(i))}>{ v.Name }</a>
</li>
}
}
</ul>
</div>
<div class="tab-content mt-5" id="patTabContent">
for i, v := range datamcu {
if i == 0 {
<div class="tab-pane fade show active" id={"kt_tab_pat_" + strconv.Itoa(i)} role="tabpanel" aria-labelledby={"kt_tab_pat_" + strconv.Itoa(i)} style="height: 700px;">
<object data={ v.Link } type="application/pdf" width="100%" height="100%"></object>
</div>
} else {
<div class="tab-pane fade show" id={"kt_tab_pat_" + strconv.Itoa(i)} role="tabpanel" aria-labelledby={"kt_tab_pat_" + strconv.Itoa(i)} style="height: 700px;">
<object data={ v.Link } type="application/pdf" width="100%" height="100%"></object>
</div>
}
}
</div>
}
// <div>
// <ul class="nav nav-tabs nav-tabs-line">
// <li class="nav-item">
// <a class="nav-link active" data-toggle="tab" href="#kt_tab_pat_1">Hasil Lab</a>
// </li>
// <li class="nav-item">
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_2">Hasil Non Lab</a>
// </li>
// <li class="nav-item">
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_3">Hasil Fisik</a>
// </li>
// <li class="nav-item">
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_4">Resume Individu</a>
// </li>
// </ul>
// </div>
// <div class="tab-content mt-5" id="patTabContent">
// <div class="tab-pane fade show active" id="kt_tab_pat_1" role="tabpanel" aria-labelledby="kt_tab_pat_1" style="height: 700px;">
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_history.rptdesign&__format=pdf&PID=5&PPatientID=112&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
// </div>
// <div class="tab-pane fade" id="kt_tab_pat_2" role="tabpanel" aria-labelledby="kt_tab_pat_2" style="height: 700px;">
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_pajanan.rptdesign&__format=pdf&PID=5&PType=fisik&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
// </div>
// <div class="tab-pane fade" id="kt_tab_pat_3" role="tabpanel" aria-labelledby="kt_tab_pat_3" style="height: 700px;">
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_fisik.rptdesign&__format=pdf&PID=5&PType=fisik&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
// </div>
// <div class="tab-pane fade" id="kt_tab_pat_4" role="tabpanel" aria-labelledby="kt_tab_pat_4" style="height: 700px;">
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_resume.rptdesign&__format=pdf&PID=1&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
// </div>
// </div>

View File

@@ -1,419 +0,0 @@
// 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/modal"
import "cpone/models"
import "strconv"
func DialogReport(
IDComponent string,
postLink string,
hxTarget string,
hxSwap string,
hxInclude string,
modalID string,
modalTitle string,
modalBody templ.Component,
modalClose 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("<div class=\"\"><div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(IDComponent)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 20, Col: 28}
}
_, 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("\" hx-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 21, Col: 34}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalcomponent.ModalViewXL(modalID,
modalTitle,
modalBody,
modalClose,
).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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 ModalBody(
IDComponent string,
tabComponent templ.Component,
hxOnLoad templ.ComponentScript,
) 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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxOnLoad)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(IDComponent)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 37, Col: 25}
}
_, 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("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6.Call)
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 = tabComponent.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 JsHideModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsHideModal_5a6b`,
Function: `function __templ_JsHideModal_5a6b(modalID){$(modalID).modal('hide');
}`,
Call: templ.SafeScript(`__templ_JsHideModal_5a6b`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsHideModal_5a6b`, modalID),
}
}
func JsShowModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JsShowModal_3767`,
Function: `function __templ_JsShowModal_3767(modalID){$(modalID).modal('show');
}`,
Call: templ.SafeScript(`__templ_JsShowModal_3767`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JsShowModal_3767`, modalID),
}
}
func ModalClose(LinkClose string, hxTarget string, hxSwap string, modalID 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_Var7 := templ.GetChildren(ctx)
if templ_7745c5c3_Var7 == nil {
templ_7745c5c3_Var7 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JsHideModal(modalID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button type=\"button\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 templ.ComponentScript = JsHideModal(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
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 TabReportView(
datamcu []models.TabViewReportMcu,
) 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_Var9 := templ.GetChildren(ctx)
if templ_7745c5c3_Var9 == nil {
templ_7745c5c3_Var9 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div><ul class=\"nav nav-tabs nav-tabs-line\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i, v := range datamcu {
if i == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<li class=\"nav-item\"><a class=\"nav-link active\" data-toggle=\"tab\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 templ.SafeURL = templ.URL("#kt_tab_pat_" + strconv.Itoa(i))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var10)))
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_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(v.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 70, Col: 128}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 templ.SafeURL = templ.URL("#kt_tab_pat_" + strconv.Itoa(i))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var12)))
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_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(v.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 74, Col: 121}
}
_, 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("</a></li>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</ul></div><div class=\"tab-content mt-5\" id=\"patTabContent\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for i, v := range datamcu {
if i == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"tab-pane fade show active\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs("kt_tab_pat_" + strconv.Itoa(i))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 83, Col: 90}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" role=\"tabpanel\" aria-labelledby=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs("kt_tab_pat_" + strconv.Itoa(i))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 83, Col: 156}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" style=\"height: 700px;\"><object data=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(v.Link)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 84, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"application/pdf\" width=\"100%\" height=\"100%\"></object></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"tab-pane fade show\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs("kt_tab_pat_" + strconv.Itoa(i))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 87, Col: 83}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" role=\"tabpanel\" aria-labelledby=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs("kt_tab_pat_" + strconv.Itoa(i))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 87, Col: 149}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" style=\"height: 700px;\"><object data=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(v.Link)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\modaldaftarpeserta.templ`, Line: 88, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" type=\"application/pdf\" width=\"100%\" height=\"100%\"></object></div>")
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
})
}
// <div>
// <ul class="nav nav-tabs nav-tabs-line">
// <li class="nav-item">
// <a class="nav-link active" data-toggle="tab" href="#kt_tab_pat_1">Hasil Lab</a>
// </li>
// <li class="nav-item">
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_2">Hasil Non Lab</a>
// </li>
// <li class="nav-item">
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_3">Hasil Fisik</a>
// </li>
// <li class="nav-item">
// <a class="nav-link" data-toggle="tab" href="#kt_tab_pat_4">Resume Individu</a>
// </li>
// </ul>
// </div>
// <div class="tab-content mt-5" id="patTabContent">
// <div class="tab-pane fade show active" id="kt_tab_pat_1" role="tabpanel" aria-labelledby="kt_tab_pat_1" style="height: 700px;">
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_history.rptdesign&__format=pdf&PID=5&PPatientID=112&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
// </div>
// <div class="tab-pane fade" id="kt_tab_pat_2" role="tabpanel" aria-labelledby="kt_tab_pat_2" style="height: 700px;">
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_pajanan.rptdesign&__format=pdf&PID=5&PType=fisik&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
// </div>
// <div class="tab-pane fade" id="kt_tab_pat_3" role="tabpanel" aria-labelledby="kt_tab_pat_3" style="height: 700px;">
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/mcu_fisik.rptdesign&__format=pdf&PID=5&PType=fisik&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
// </div>
// <div class="tab-pane fade" id="kt_tab_pat_4" role="tabpanel" aria-labelledby="kt_tab_pat_4" style="height: 700px;">
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_resume.rptdesign&__format=pdf&PID=1&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
// </div>
// </div>

View File

@@ -1,85 +0,0 @@
package corporate_mcudetail
import "cpone/layout"
import "cpone/models"
import "cpone/component/customtextfield"
templ TabDaftarPesertaScreen(
tableID string,
paginationID string,
dialogReportID string,
dialogReportBodyID string,
content templ.Component,
dialogReport templ.Component,
) {
<div class="container-fluid">
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
Name: "tableID",
Type: "hidden",
Value: tableID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
Name: "paginationID",
Type: "hidden",
Value: paginationID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogReportID",
Name: "dialogReportID",
Type: "hidden",
Value: dialogReportID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogReportBodyID",
Name: "dialogReportBodyID",
Type: "hidden",
Value: dialogReportBodyID})
<div class="d-flex justify-content-center pt-10 pb-10">
<h2 class="title text-black" style="margin-bottom: 0">Daftar Peserta</h2>
</div>
<div id="loading-parent" class="rounded">
@content
@dialogReport
<div id="loading-child" class="rounded bg-transparent">
<div id="loading-spinner" class="spinner-border text-primary d-none" style="width: 3rem; height: 3rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
</div>
<div id="loadingcontent"></div>
</div>
}
templ CSSTabDaftarPeserta() {
}
templ JsTabDaftarPeserta() {
}
script BeforeRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}
script AfterRequestContent() {
const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.remove("overlay");
loadingParent.classList.remove("overlay-block");
loadingChild.classList.remove("overlay-layer");
loadingSpinner.classList.add("d-none");
}
templ ShowTabDafterPeserta(
title string,
cmp templ.Component,
css templ.Component,
js templ.Component,
) {
@layout.PlaygroundLayout(title, css, js) {
@cmp
}
}

View File

@@ -1,208 +0,0 @@
// 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/layout"
import "cpone/models"
import "cpone/component/customtextfield"
func TabDaftarPesertaScreen(
tableID string,
paginationID string,
dialogReportID string,
dialogReportBodyID string,
content templ.Component,
dialogReport 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("<div class=\"container-fluid\">")
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 = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
Name: "paginationID",
Type: "hidden",
Value: paginationID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogReportID",
Name: "dialogReportID",
Type: "hidden",
Value: dialogReportID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogReportBodyID",
Name: "dialogReportBodyID",
Type: "hidden",
Value: dialogReportBodyID}).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 text-black\" style=\"margin-bottom: 0\">Daftar Peserta</h2></div><div id=\"loading-parent\" class=\"rounded\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = content.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = dialogReport.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"loading-child\" class=\"rounded bg-transparent\"><div id=\"loading-spinner\" class=\"spinner-border text-primary d-none\" style=\"width: 3rem; height: 3rem;\" role=\"status\"><span class=\"sr-only\">Loading...</span></div></div></div><div id=\"loadingcontent\"></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 CSSTabDaftarPeserta() 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)
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func JsTabDaftarPeserta() 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
})
}
func BeforeRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_BeforeRequestContent_5717`,
Function: `function __templ_BeforeRequestContent_5717(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.add("overlay");
loadingParent.classList.add("overlay-block");
loadingChild.classList.add("overlay-layer");
loadingSpinner.classList.remove("d-none");
}`,
Call: templ.SafeScript(`__templ_BeforeRequestContent_5717`),
CallInline: templ.SafeScriptInline(`__templ_BeforeRequestContent_5717`),
}
}
func AfterRequestContent() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_AfterRequestContent_848c`,
Function: `function __templ_AfterRequestContent_848c(){const loadingParent = document.getElementById("loading-parent");
const loadingChild = document.getElementById("loading-child");
const loadingSpinner = document.getElementById("loading-spinner");
loadingParent.classList.remove("overlay");
loadingParent.classList.remove("overlay-block");
loadingChild.classList.remove("overlay-layer");
loadingSpinner.classList.add("d-none");
}`,
Call: templ.SafeScript(`__templ_AfterRequestContent_848c`),
CallInline: templ.SafeScriptInline(`__templ_AfterRequestContent_848c`),
}
}
func ShowTabDafterPeserta(
title string,
cmp templ.Component,
css templ.Component,
js 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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = 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_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
templ_7745c5c3_Err = cmp.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = io.Copy(templ_7745c5c3_W, templ_7745c5c3_Buffer)
}
return templ_7745c5c3_Err
})
templ_7745c5c3_Err = layout.PlaygroundLayout(title, css, js).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), 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
})
}

View File

@@ -1,55 +0,0 @@
package corporate_mcudetail
import (
"cpone/component/customtextfield"
"cpone/models"
)
templ MainKesimpulan(
tableID string,
tablecontent templ.Component,
tablecontentnonlab templ.Component,
tablecontentfisik templ.Component,
) {
<div class="container-fluid">
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "tableID",
Name: "tableID",
Type: "hidden",
Value: tableID})
<div class="d-flex justify-content-center pt-10 pb-10">
<h2 class="title text-black" style="margin-bottom: 0">Kesimpulan</h2>
</div>
@tablecontent
@tablecontentnonlab
@tablecontentfisik
</div>
}
templ CssKesimpulan() {
<style>
.dot-text {
position: relative;
padding-left: 1.5em; /* Menambahkan padding untuk memberi ruang pada titik */
}
.dot-text::before {
content: "•"; /* Menambahkan titik di depan teks */
position: absolute;
left: 1em; /* Atur posisi titik */
top: 0;
transform: translateX(-100%);
}
.information-title {
color: #0e1e28;
font-family: Poppins;
font-size: 20px;
font-style: normal;
font-weight: 600;
line-height: normal;
}
</style>
}
templ JsKesimpulan() {
}

View File

@@ -1,46 +0,0 @@
package corporate_mcudetail
import (
"cpone/component/table"
"cpone/models"
)
templ CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID 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>
@TableKesimpulan(data, tableID)
</div>
</div>
</div>
}
templ TableKesimpulan(data []models.ModelKesimpulanLab,
tableID string) {
<div id={ tableID }>
@tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"},
[]string{"5%", "70%", "25%"},
RowKesimpulan(data),
)
</div>
}
templ RowKesimpulan(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>
}
}

Some files were not shown because too many files have changed in this diff Show More