Compare commits
58 Commits
stephen_de
...
adib/echar
| Author | SHA1 | Date | |
|---|---|---|---|
| e4364f0c4f | |||
| f2d8207f25 | |||
| eb7343117b | |||
| 7a22f5e4d0 | |||
| 1c7e223195 | |||
| 2a25c60cc2 | |||
| 9008cac97d | |||
| 91a157b023 | |||
| 54de2a0ece | |||
| 9af95cfd9f | |||
| 0e7f438c6a | |||
| 78af5abdf0 | |||
| 2179017556 | |||
| accd8d57d9 | |||
| dbad97d0f2 | |||
| 322a70b582 | |||
| 2cb5ceac47 | |||
| fdc8c54eed | |||
| c771187889 | |||
| 5826d72988 | |||
| 664c041acf | |||
| 7094dadbdf | |||
| 8f818f9e94 | |||
| 78487fafd0 | |||
| 16a2bd45f5 | |||
| fd4f792d8a | |||
| e1200fae61 | |||
| 3bc13d64bc | |||
| b279a942dd | |||
| 17e1268cac | |||
|
|
e6b5435337 | ||
| 2f651cba3d | |||
|
|
16de8d4493 | ||
|
|
8dd071a924 | ||
|
|
1bfeb97a57 | ||
|
|
988cee93c2 | ||
|
|
fe3cb753b5 | ||
|
|
23382aa755 | ||
|
|
49a9f76574 | ||
|
|
126f623298 | ||
|
|
1c727a5ae7 | ||
|
|
18b89453ba | ||
| b508eb68da | |||
| 7f3e75a8e3 | |||
| d1ff7ba2fb | |||
| 52a161195e | |||
| 6deadec9a3 | |||
| c04b8b1081 | |||
| e1c8ddd8f0 | |||
| e6a5925588 | |||
| a2fc463990 | |||
| 246dd34542 | |||
| 9f822c5514 | |||
| dd980b4430 | |||
|
|
f30189816b | ||
| 8dfdc3fece | |||
| 2d67b7b723 | |||
| f825bc1639 |
10
README.md
10
README.md
@@ -56,4 +56,12 @@ $ templ generate --watch
|
||||
### Happy coding 😀!!
|
||||
|
||||
# LINK ODOO DAN TUTORIAL INIT
|
||||
http://odoo.sismedika.com/web#id=6282&cids=1&menu_id=225&action=342&active_id=3&model=project.task&view_type=form
|
||||
http://odoo.sismedika.com/web#id=6282&cids=1&menu_id=225&action=342&active_id=3&model=project.task&view_type=form
|
||||
|
||||
|
||||
## BUILD WEB LINUX
|
||||
Run di Bash command line
|
||||
|
||||
```
|
||||
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ./bin/main ./cmd/main.go
|
||||
```
|
||||
|
||||
@@ -54,17 +54,17 @@ var KTLogin = function () {
|
||||
|
||||
validation.validate().then(function (status) {
|
||||
if (status == 'Valid') {
|
||||
swal.fire({
|
||||
text: "All is cool! Now you submit this form",
|
||||
icon: "success",
|
||||
buttonsStyling: false,
|
||||
confirmButtonText: "Ok, got it!",
|
||||
customClass: {
|
||||
confirmButton: "btn font-weight-bold btn-light-primary"
|
||||
}
|
||||
}).then(function () {
|
||||
KTUtil.scrollTop();
|
||||
});
|
||||
// swal.fire({
|
||||
// text: "All is cool! Now you submit this form",
|
||||
// icon: "success",
|
||||
// buttonsStyling: false,
|
||||
// confirmButtonText: "Ok, got it!",
|
||||
// customClass: {
|
||||
// confirmButton: "btn font-weight-bold btn-light-primary"
|
||||
// }
|
||||
// }).then(function () {
|
||||
// KTUtil.scrollTop();
|
||||
// });
|
||||
} else {
|
||||
swal.fire({
|
||||
text: "Sorry, looks like there are some errors detected, please try again.",
|
||||
|
||||
4978
assets/hanan/fisik-2.html
Normal file
4978
assets/hanan/fisik-2.html
Normal file
File diff suppressed because it is too large
Load Diff
784
assets/hanan/kesimpulan-saran.html
Normal file
784
assets/hanan/kesimpulan-saran.html
Normal file
@@ -0,0 +1,784 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Template Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme
|
||||
Author: KeenThemes
|
||||
Website: http://www.keenthemes.com/
|
||||
Contact: support@keenthemes.com
|
||||
Follow: www.twitter.com/keenthemes
|
||||
Dribbble: www.dribbble.com/keenthemes
|
||||
Like: www.facebook.com/keenthemes
|
||||
Purchase: https://1.envato.market/EA4JP
|
||||
Renew Support: https://1.envato.market/EA4JP
|
||||
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
|
||||
-->
|
||||
<html lang="en">
|
||||
<!--begin::Head-->
|
||||
|
||||
<head>
|
||||
<base href="../" />
|
||||
<meta charset="utf-8" />
|
||||
<title>KESIMPULAN & SARAN</title>
|
||||
<meta name="description" content="Login page example" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
|
||||
<!--begin::Fonts-->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700"
|
||||
/>
|
||||
<!--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="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Public Sans:300,400,500,600,700"
|
||||
/>
|
||||
<link rel="shortcut icon" href="assets/media/logos/favicon.ico" />
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Roboto"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
|
||||
/>
|
||||
<link href="https://fonts.cdnfonts.com/css/open-sans" rel="stylesheet" />
|
||||
|
||||
<style>
|
||||
#canvas {
|
||||
/* overflow-x: scroll; */
|
||||
margin: 40px 10vw 40px 10vw;
|
||||
}
|
||||
#title {
|
||||
font-weight: 600;
|
||||
}
|
||||
.breadcrumb {
|
||||
background-color: white;
|
||||
padding: 0px 0px !important;
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
|
||||
.breadcrumb-item a {
|
||||
color: #3f4254;
|
||||
font-family: Poppins;
|
||||
font-size: 13px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: 21px;
|
||||
}
|
||||
|
||||
.breadcrumb-item.active {
|
||||
color: #b5b5c3;
|
||||
font-family: Poppins;
|
||||
font-size: 13px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: 21px;
|
||||
}
|
||||
.nav-tabs {
|
||||
border-bottom: 0px solid #000000 !important;
|
||||
}
|
||||
.nav-link {
|
||||
color: #637381;
|
||||
font-family: Public Sans;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav-link.active {
|
||||
color: #212b36 !important; /* Warna teks untuk tab yang aktif */
|
||||
border-bottom: 2px solid #0c518c !important; /* Garis bawah untuk tab yang aktif */
|
||||
font-family: Public Sans;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
line-height: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th {
|
||||
color: #637381;
|
||||
font-family: Roboto;
|
||||
font-weight: 700 !important;
|
||||
font-size: 14px !important;
|
||||
padding-bottom: 5px !important;
|
||||
padding-left: 1px !important;
|
||||
border-bottom: 1pt dashed #e4e6ef !important;
|
||||
}
|
||||
tr {
|
||||
border-bottom: 1pt dashed #e4e6ef !important;
|
||||
font-family: Roboto;
|
||||
}
|
||||
td {
|
||||
color: #0e1e28;
|
||||
font-family: Roboto;
|
||||
font-style: normal;
|
||||
font-weight: 500 !important;
|
||||
font-size: 16px !important;
|
||||
line-height: 30px; /* 187.5% */
|
||||
letter-spacing: -0.32px;
|
||||
padding-left: 1px !important;
|
||||
padding-top: 16px !important;
|
||||
padding-bottom: 16px !important;
|
||||
}
|
||||
thead {
|
||||
border-bottom: 1pt dashed #e4e6ef !important;
|
||||
}
|
||||
.kesimpulan-desc {
|
||||
color: #0e1e28;
|
||||
font-family: Roboto;
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: normal;
|
||||
letter-spacing: -0.24px;
|
||||
}
|
||||
.label-text {
|
||||
background-color: grey;
|
||||
color: black;
|
||||
padding: 5px 20px 5px 20px !important;
|
||||
border-radius: 6px;
|
||||
font-family: Poppins !important;
|
||||
font-size: 11px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 500 !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
.label-text.fit {
|
||||
background: #c9f7f5;
|
||||
color: #1bc5bd;
|
||||
padding: 5px 20px 5px 20px !important;
|
||||
border-radius: 6px;
|
||||
font-family: Poppins !important;
|
||||
font-size: 11px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 500 !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
.label-text.unfit {
|
||||
background: #fff4de;
|
||||
color: #ffa800;
|
||||
padding: 5px 20px 5px 20px !important;
|
||||
border-radius: 6px;
|
||||
font-family: Poppins !important;
|
||||
font-size: 11px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 500 !important;
|
||||
line-height: normal !important;
|
||||
}
|
||||
|
||||
.iconify-btn {
|
||||
color: #637381 !important;
|
||||
width: 23px !important;
|
||||
height: 23px !important;
|
||||
margin-right: 1em;
|
||||
}
|
||||
.iconify-btn-blue {
|
||||
color: #0c518c !important;
|
||||
width: 23px !important;
|
||||
height: 23px !important;
|
||||
margin-right: 1em;
|
||||
}
|
||||
.modal-header {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
.modal-title {
|
||||
font-family: "Public Sans" !important;
|
||||
font-size: 18px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 700 !important;
|
||||
line-height: 28px !important;
|
||||
}
|
||||
.modal-dialog {
|
||||
border-radius: 8px;
|
||||
}
|
||||
.btn-print {
|
||||
border-radius: 6px !important;
|
||||
background-color: #f5f8fa !important;
|
||||
font-family: Roboto;
|
||||
font-size: 14px;
|
||||
margin-bottom: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: normal;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.modal-xl {
|
||||
border-radius: 6px !important;
|
||||
max-width: 90vw !important;
|
||||
max-height: 95vh !important;
|
||||
width: 90vw !important;
|
||||
height: 95vh !important;
|
||||
}
|
||||
.header-print {
|
||||
background-color: #d9d9d9;
|
||||
}
|
||||
.modal-print-title {
|
||||
color: #000;
|
||||
font-family: "Open Sans";
|
||||
font-size: 28px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: normal;
|
||||
}
|
||||
.close-print {
|
||||
color: red !important;
|
||||
width: 30px !important;
|
||||
height: 30px !important;
|
||||
}
|
||||
.form-label {
|
||||
font-family: Poppins !important;
|
||||
font-size: 14px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 600 !important;
|
||||
line-height: 24px !important; /* 171.429% */
|
||||
}
|
||||
.form-input {
|
||||
font-family: Poppins !important;
|
||||
font-size: 16px !important;
|
||||
font-style: normal !important;
|
||||
font-weight: 400 !important;
|
||||
line-height: 24px !important;
|
||||
}
|
||||
.btn-text {
|
||||
font-family: "Public Sans";
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
line-height: 24px;
|
||||
}
|
||||
.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>
|
||||
</head>
|
||||
<!--end::Head-->
|
||||
|
||||
<!--begin::Body-->
|
||||
|
||||
<body
|
||||
id="kt_body"
|
||||
class="header-fixed bg-white header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading"
|
||||
>
|
||||
<!--begin::Main-->
|
||||
<div class="d-flex flex-column flex-root bg-white" id="canvas">
|
||||
<div>
|
||||
<!-- breadcrumb & icon tanya START -->
|
||||
<div class="row">
|
||||
<div class="col-11">
|
||||
<h1 class="title" style="margin-bottom: 0">
|
||||
PT. Sadhana Abiyasa Sampoerna
|
||||
</h1>
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb" style="margin-bottom: 0">
|
||||
<li class="breadcrumb-item"><a href="#">Dashboard</a></li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="#">Employee Health Medical Analytic</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="#">PT. Sadhana Abiyasa Sampoerna</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active" aria-current="page">
|
||||
Mcu Karyawan
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="col-1 align-content-center">
|
||||
<!-- align-content-center -->
|
||||
<div class="d-flex justify-content-end">
|
||||
<a href="#">
|
||||
<i class="fas fa-info-circle text-primary"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- breadcrumb & icon tanya END -->
|
||||
</div>
|
||||
<div class="mt-10">
|
||||
<ul class="nav nav-tabs nav-tabs-line">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_1"
|
||||
>Peserta</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_2"
|
||||
>Kelainan global</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_3"
|
||||
>Kelainan Lab</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_4"
|
||||
>kelainan Non Lab</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_5"
|
||||
>kelainan Fisik</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#kt_tab_pane_6"
|
||||
>Kesimpulan & Saran</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_7"
|
||||
>Daftar Peserta</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center pt-10 pb-10">
|
||||
<h2 class="title" style="margin-bottom: 0">Kesimpulan</h2>
|
||||
</div>
|
||||
|
||||
<!-- Kelainan pemeriksaan lab -->
|
||||
<div class="card card-custom gutter-b" style="border-radius: 20px">
|
||||
<div style="padding-top: 12px">
|
||||
<h3 class="card-label dot-text text-black">
|
||||
3 Kelainan Pemeriksaan Lab terbesar :
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<table class="table table-hover table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" width="5%">NO</th>
|
||||
<th scope="col" width="70%">PEMERIKSAAN</th>
|
||||
<th scope="col" width="25%">PRESENTASE</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Hipercholesterolemia</td>
|
||||
<td>44.5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Hiperuricemia</td>
|
||||
<td>22.7</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Peningkatan SGPT</td>
|
||||
<td>15.8</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Kelainan pemeriksaan lab -->
|
||||
|
||||
<!-- Kelainan pemeriksaan non lab -->
|
||||
<div class="card card-custom gutter-b" style="border-radius: 20px">
|
||||
<div style="padding-top: 12px">
|
||||
<h3 class="card-label dot-text text-black">
|
||||
3 Kelainan Pemeriksaan Non Lab terbesar :
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<table class="table table-hover table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" width="5%">NO</th>
|
||||
<th scope="col" width="70%">PEMERIKSAAN</th>
|
||||
<th scope="col" width="25%">PRESENTASE</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Retriksi Ringan</td>
|
||||
<td>22.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Gangguan Konduksi Ringan</td>
|
||||
<td>15.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Obstruksi Sedang</td>
|
||||
<td>13.0</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Kelainan pemeriksaan non lab -->
|
||||
|
||||
<!-- Kelainan pemeriksaan Fisik -->
|
||||
<div class="card card-custom gutter-b" style="border-radius: 20px">
|
||||
<div style="padding-top: 12px">
|
||||
<h3 class="card-label dot-text text-black">
|
||||
3 Kelainan Pemeriksaan Fisik terbesar :
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<table class="table table-hover table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" width="5%">NO</th>
|
||||
<th scope="col" width="70%">PEMERIKSAAN</th>
|
||||
<th scope="col" width="25%">PRESENTASE</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Obesitas Stage 1</td>
|
||||
<td>41.7</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Pre Hipertensi</td>
|
||||
<td>39.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Kelainan Refraksi</td>
|
||||
<td>35.2</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Kelainan pemeriksaan Fisik -->
|
||||
|
||||
<!-- Saran -->
|
||||
<div class="d-flex justify-content-center pt-10 pb-10">
|
||||
<h2 class="information-title title" style="margin-bottom: 0">Saran</h2>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="information-title mb-3">Tujuan MCU</h3>
|
||||
<div>
|
||||
<div class="dot-text">Olah raga teratur</div>
|
||||
<div class="dot-text">Penurunan berat badan</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="information-title mb-3">Kelainan Refraksi</h3>
|
||||
<div>
|
||||
<div class="mb-5">
|
||||
<div>1. Kelainan refraksi dengan kacamata</div>
|
||||
<div class="dot-text">
|
||||
Konsul dokter Scpesialis Mata untuk pemakaian kacamata/ lensa
|
||||
kontak
|
||||
</div>
|
||||
</div>
|
||||
<div>2. Kelainan refraksi tanpa kacamata</div>
|
||||
<div class="dot-text">Pemakaian kacamata/ lensa kontak</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="information-title mb-3">Tekanan Darah</h3>
|
||||
<div>
|
||||
<div class="mb-5">
|
||||
<div>1. Pre Hipertensi</div>
|
||||
<div class="dot-text">Olah raga teratur</div>
|
||||
<div class="dot-text">Cukup istirahat</div>
|
||||
<div class="dot-text">Pemeriksaan tekanan darah secara teratur</div>
|
||||
</div>
|
||||
<div class="mb-5">
|
||||
<div>2. Hipertensi stage 1 dan 2</div>
|
||||
<div class="dot-text">Olah raga teratur</div>
|
||||
<div class="dot-text">Cukup istirahat</div>
|
||||
<div class="dot-text">Batasi konsumsi garam</div>
|
||||
<div class="dot-text">Pemeriksaan tekanan darah secara teratur</div>
|
||||
<div class="dot-text">
|
||||
Pengobatan/ minum obat secara teratur (bila ybs sudah minum obat,
|
||||
hipertensi tetapi kadang-kadang atau tidak rutin)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="information-title mb-3">
|
||||
Peningkatan Profil lemak dan Hiperglikemia
|
||||
</h3>
|
||||
<div>
|
||||
<div class="dot-text">Diet rendah lemak, karbohidrat dan gula,</div>
|
||||
<div class="dot-text">Olahraga secara teraturs</div>
|
||||
<div class="dot-text">
|
||||
Program promosi kesehatan terutama untuk mencegah terjadinya dampak
|
||||
serius peningkatan lemak darah
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<h3 class="information-title mb-3">Hiperuricemia</h3>
|
||||
<div>
|
||||
<div class="dot-text" s>
|
||||
Mengurangi asupan makanan/sayuran yang mengandung purin (melinjo,
|
||||
kangkung, jeroan, emping, dll)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Saran -->
|
||||
</div>
|
||||
<!--end::Main-->
|
||||
<script>
|
||||
var HOST_URL =
|
||||
"https://preview.keenthemes.com/metronic/theme/html/tools/preview";
|
||||
</script>
|
||||
<!--begin::Global Config(global config for global JS scripts)-->
|
||||
<script>
|
||||
var KTAppSettings = {
|
||||
breakpoints: {
|
||||
sm: 576,
|
||||
md: 768,
|
||||
lg: 992,
|
||||
xl: 1200,
|
||||
xxl: 1400,
|
||||
},
|
||||
colors: {
|
||||
theme: {
|
||||
base: {
|
||||
white: "#ffffff",
|
||||
primary: "#3699FF",
|
||||
secondary: "#E5EAEE",
|
||||
success: "#1BC5BD",
|
||||
info: "#8950FC",
|
||||
warning: "#FFA800",
|
||||
danger: "#F64E60",
|
||||
light: "#E4E6EF",
|
||||
dark: "#181C32",
|
||||
},
|
||||
light: {
|
||||
white: "#ffffff",
|
||||
primary: "#E1F0FF",
|
||||
secondary: "#EBEDF3",
|
||||
success: "#C9F7F5",
|
||||
info: "#EEE5FF",
|
||||
warning: "#FFF4DE",
|
||||
danger: "#FFE2E5",
|
||||
light: "#F3F6F9",
|
||||
dark: "#D6D6E0",
|
||||
},
|
||||
inverse: {
|
||||
white: "#ffffff",
|
||||
primary: "#ffffff",
|
||||
secondary: "#3F4254",
|
||||
success: "#ffffff",
|
||||
info: "#ffffff",
|
||||
warning: "#ffffff",
|
||||
danger: "#ffffff",
|
||||
light: "#464E5F",
|
||||
dark: "#ffffff",
|
||||
},
|
||||
},
|
||||
gray: {
|
||||
"gray-100": "#F3F6F9",
|
||||
"gray-200": "#EBEDF3",
|
||||
"gray-300": "#E4E6EF",
|
||||
"gray-400": "#D1D3E0",
|
||||
"gray-500": "#B5B5C3",
|
||||
"gray-600": "#7E8299",
|
||||
"gray-700": "#5E6278",
|
||||
"gray-800": "#3F4254",
|
||||
"gray-900": "#181C32",
|
||||
},
|
||||
},
|
||||
"font-family": "Poppins",
|
||||
};
|
||||
</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>
|
||||
<!--end::Global Theme Bundle-->
|
||||
|
||||
<!--begin::Page Vendors(used by this page)-->
|
||||
<script src="assets/plugins/custom/fullcalendar/fullcalendar.bundle.js"></script>
|
||||
<!--end::Page Vendors-->
|
||||
|
||||
<!--begin::Page Scripts(used by this page)-->
|
||||
<script src="assets/js/pages/widgets.js"></script>
|
||||
<!--end::Page Scripts-->
|
||||
<!-- echartjs.min.js -->
|
||||
<script src="assets/js/echarts-js/echart.min.js"></script>
|
||||
<!-- SCRIPT -->
|
||||
<script
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/iconify/2.0.0/iconify.min.js"
|
||||
integrity="sha512-lYMiwcB608+RcqJmP93CMe7b4i9G9QK1RbixsNu4PzMRJMsqr/bUrkXUuFzCNsRUo3IXNUr5hz98lINURv5CNA=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"
|
||||
></script>
|
||||
<script type="text/javascript">
|
||||
$.fn.redraw = function () {
|
||||
$(this).each(function () {
|
||||
var redraw = this.offsetHeight;
|
||||
});
|
||||
};
|
||||
function ShowModal(name, nolab) {
|
||||
console.log(name + nolab);
|
||||
$("#modal-list-print-title").text(name + "-" + nolab);
|
||||
$(".modal-list-print").modal("show");
|
||||
}
|
||||
function ShowModalPrint(data, title) {
|
||||
console.log(data);
|
||||
let a =
|
||||
"https://devone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_fo_001.rptdesign&__format=pdf&username=ADMIN&PID=132061?t=1713408676799";
|
||||
let b =
|
||||
"https://devone.aplikasi.web.id/birt/run?__report=report/one/external/rpt_mt_pramita_001.rptdesign&__format=pdf&username=adminsas%20&PID=77&tm=1713317444625";
|
||||
$(".modal-print-title").text(title);
|
||||
let tag =
|
||||
'<object id="object-print" width="100%" type="application/pdf" style="height: 80vh" ></object>';
|
||||
if (data === "1") {
|
||||
// $("#object-print").attr("data", a);
|
||||
tag =
|
||||
'<object id="object-print" width="100%" data="' +
|
||||
a +
|
||||
'" type="application/pdf" style="height: 80vh" ></object>';
|
||||
} else {
|
||||
// $("#object-print").attr("data", b);
|
||||
tag =
|
||||
'<object id="object-print" width="100%" data="' +
|
||||
b +
|
||||
'" type="application/pdf" style="height: 80vh" ></object>';
|
||||
}
|
||||
$("#object-print").replaceWith(tag);
|
||||
console.log(tag);
|
||||
|
||||
$(".modal-list-print").modal("hide");
|
||||
$(".modal-print").modal("show");
|
||||
}
|
||||
function CloseModalPrint() {
|
||||
// $("#object-print").removeAttr("data");
|
||||
// $("#object-print").redraw();
|
||||
$(".modal-list-print").modal("show");
|
||||
$(".modal-print").modal("hide");
|
||||
}
|
||||
|
||||
function ShowModalAkses(email, password, checked) {
|
||||
console.log("email" + email);
|
||||
console.log("password" + password);
|
||||
console.log("checked :" + checked);
|
||||
$(".modal-akses").modal("show");
|
||||
$('input[name="email"]').val(email);
|
||||
$('input[name="password"]').val(password);
|
||||
// $("#akses").attr("checked", checked);
|
||||
// $('input[type="checkbox"]').removeAttr("checked");
|
||||
$('input[name="akses"]').removeAttr("checked");
|
||||
let appChecked =
|
||||
'<span class="switch switch-sm switch-akses "><label><input id="akses" type="checkbox" name="akses" checked/><span></span></label></span>';
|
||||
let appNotChecked =
|
||||
'<span class="switch switch-sm switch-akses "><label><input id="akses" type="checkbox" name="akses" /><span></span></label></span>';
|
||||
|
||||
if (checked === "checked") {
|
||||
// $('input[name="akses"]').attr("checked");
|
||||
// $(".form-akses-switch").append(appChecked);
|
||||
$(".switch-akses").replaceWith(appChecked);
|
||||
} else {
|
||||
// $('input[name="akses"]').removeAttr("checked");
|
||||
// $('input[name="akses"]').removeAttr("checked");
|
||||
// $(".form-akses-switch").append(appNotChecked);
|
||||
$(".switch-akses").replaceWith(appNotChecked);
|
||||
}
|
||||
if (checked !== "checked") {
|
||||
$(".switch-akses").replaceWith(appNotChecked);
|
||||
}
|
||||
// $("#akses").load(window.location.href + " #akses");
|
||||
}
|
||||
$("#akses").change(function () {
|
||||
if (this.checked) {
|
||||
$('input[name="akses"]').attr("checked", "checked");
|
||||
} else {
|
||||
$('input[name="akses"]').removeAttr("checked");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
<!--end::Body-->
|
||||
</html>
|
||||
273
assets/mcu/formKeuangan.html
Normal file
273
assets/mcu/formKeuangan.html
Normal 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>
|
||||
4682
assets/mcu/isihasilriwayat.html
Normal file
4682
assets/mcu/isihasilriwayat.html
Normal file
File diff suppressed because it is too large
Load Diff
20
auth/jwt.go
Normal file
20
auth/jwt.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
echojwt "github.com/labstack/echo-jwt/v4"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
var IsLoggedIn = echojwt.WithConfig(
|
||||
echojwt.Config{
|
||||
SigningKey: []byte("--one_api-secret-2019-04-01"),
|
||||
TokenLookup: "cookie:token",
|
||||
ErrorHandler: JWTErrorChecker,
|
||||
},
|
||||
)
|
||||
|
||||
func JWTErrorChecker(c echo.Context, err error) error {
|
||||
return c.Redirect(http.StatusTemporaryRedirect, "/login")
|
||||
}
|
||||
@@ -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%";
|
||||
}
|
||||
|
||||
@@ -21,6 +21,35 @@ script GenerateChart(idDiv string, udata string) {
|
||||
// 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 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)
|
||||
|
||||
@@ -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,78 @@ 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_a276`,
|
||||
Function: `function __templ_GenerateChartFixed_a276(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_a276`, idDiv, udata, width, height),
|
||||
CallInline: templ.SafeScriptInline(`__templ_GenerateChartFixed_a276`, idDiv, udata, width, height),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,3 +57,29 @@ templ ModalXL(modalID string, modalTitle string, modalBody templ.Component, moda
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ModalViewXL(modalID string, modalTitle string, modalBody templ.Component, btnClose templ.Component) {
|
||||
<div
|
||||
class="modal fade"
|
||||
style="display: none"
|
||||
id={ modalID }
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
data-backdrop="static"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<div class="modal-dialog modal-xl modal-dialog-centered" role="document">
|
||||
<div class="modal-content rounded-lg">
|
||||
<div class="modal-header border-bottom-0">
|
||||
<h6 class="modal-title text-black font-weight-bolder">
|
||||
{ modalTitle }
|
||||
</h6>
|
||||
@btnClose
|
||||
</div>
|
||||
<div class="modal-body border-bottom-0">
|
||||
@modalBody
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -157,3 +157,69 @@ func ModalXL(modalID string, modalTitle string, modalBody templ.Component, modal
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func ModalViewXL(modalID string, modalTitle string, modalBody templ.Component, btnClose 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_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 class=\"modal fade\" style=\"display: none\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(modalID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal.templ`, Line: 65, Col: 14}
|
||||
}
|
||||
_, 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("\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\" aria-hidden=\"true\"><div class=\"modal-dialog modal-xl modal-dialog-centered\" role=\"document\"><div class=\"modal-content rounded-lg\"><div class=\"modal-header border-bottom-0\"><h6 class=\"modal-title text-black font-weight-bolder\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(modalTitle)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal.templ`, Line: 75, Col: 18}
|
||||
}
|
||||
_, 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("</h6>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = btnClose.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"modal-body border-bottom-0\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalBody.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -24,16 +24,16 @@ templ Navbaruserprofile(dataUser models.User) {
|
||||
<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>
|
||||
// <div>
|
||||
// <!--begin:Heading-->
|
||||
// <h5 class="mb-5">
|
||||
// Recent Notifications
|
||||
// </h5>
|
||||
// <!--end:Heading-->
|
||||
// <!--begin::Item-->
|
||||
// @NotificationCard()
|
||||
// <!--end::Item-->
|
||||
// </div>
|
||||
<!--end::Notifications-->
|
||||
</div>
|
||||
<!--end::Content-->
|
||||
@@ -55,7 +55,12 @@ templ ProfileHeader(dataUser models.User) {
|
||||
{ dataUser.UserPosition }
|
||||
</div>
|
||||
<div class="navi mt-2">
|
||||
<a href="#" class="btn btn-sm btn-light-primary font-weight-bolder py-2 px-5">Sign Out</a>
|
||||
<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>
|
||||
|
||||
@@ -33,15 +33,7 @@ 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--><div><!--begin:Heading--><h5 class=\"mb-5\">Recent Notifications\r</h5><!--end:Heading--><!--begin::Item-->")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = NotificationCard().Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--end::Item--></div><!--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><!--end::Separator--><!--begin::Notifications--><!--end::Notifications--></div><!--end::Content--></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -91,7 +83,7 @@ func ProfileHeader(dataUser models.User) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"navi mt-2\"><a href=\"#\" class=\"btn btn-sm btn-light-primary font-weight-bolder py-2 px-5\">Sign Out</a></div></div></div>")
|
||||
_, 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>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -10,7 +10,11 @@ templ TableV3(thName []string, thWidth []string, trComponent templ.Component) {
|
||||
<thead>
|
||||
<tr class="rounded-lg bg-header-table">
|
||||
for i, item := range thName {
|
||||
<th scope="col" width={ thWidth[i] }>{ item }</th>
|
||||
if item == "AKSI" {
|
||||
<th scope="col" width={ thWidth[i] } class="text-center">{ item }</th>
|
||||
} else {
|
||||
<th scope="col" width={ thWidth[i] }>{ item }</th>
|
||||
}
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -38,35 +38,68 @@ func TableV3(thName []string, thWidth []string, trComponent templ.Component) tem
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for i, item := range thName {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<th scope=\"col\" width=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(thWidth[i])
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 13, Col: 41}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(item)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 13, Col: 50}
|
||||
}
|
||||
_, 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("</th>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
if item == "AKSI" {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<th scope=\"col\" width=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(thWidth[i])
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 14, Col: 42}
|
||||
}
|
||||
_, 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=\"text-center\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(item)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 14, Col: 71}
|
||||
}
|
||||
_, 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("</th>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<th scope=\"col\" width=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(thWidth[i])
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 16, Col: 42}
|
||||
}
|
||||
_, 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
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(item)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\table\tablev3.templ`, Line: 16, Col: 51}
|
||||
}
|
||||
_, 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("</th>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</tr></thead> <tbody>")
|
||||
@@ -101,9 +134,9 @@ func DivEmptyV3() templ.Component {
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var4 == nil {
|
||||
templ_7745c5c3_Var4 = templ.NopComponent
|
||||
templ_7745c5c3_Var6 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var6 == nil {
|
||||
templ_7745c5c3_Var6 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div></div>")
|
||||
|
||||
2
go.mod
2
go.mod
@@ -7,6 +7,7 @@ require (
|
||||
github.com/fsnotify/fsnotify v1.7.0
|
||||
github.com/glebarez/go-sqlite v1.22.0
|
||||
github.com/go-sql-driver/mysql v1.8.1
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0
|
||||
github.com/jmoiron/sqlx v1.4.0
|
||||
github.com/labstack/echo/v4 v4.12.0
|
||||
github.com/spf13/viper v1.18.2
|
||||
@@ -36,6 +37,7 @@ require (
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
|
||||
github.com/google/uuid v1.5.0 // indirect
|
||||
github.com/labstack/echo-jwt/v4 v4.2.0
|
||||
github.com/labstack/gommon v0.4.2
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
|
||||
4
go.sum
4
go.sum
@@ -18,6 +18,8 @@ github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpv
|
||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE=
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
|
||||
@@ -32,6 +34,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/labstack/echo-jwt/v4 v4.2.0 h1:odSISV9JgcSCuhgQSV/6Io3i7nUmfM/QkBeR5GVJj5c=
|
||||
github.com/labstack/echo-jwt/v4 v4.2.0/go.mod h1:MA2RqdXdEn4/uEglx0HcUOgQSyBaTh5JcaHIan3biwU=
|
||||
github.com/labstack/echo/v4 v4.12.0 h1:IKpw49IMryVB2p1a4dzwlhP1O2Tf2E0Ir/450lH+kI0=
|
||||
github.com/labstack/echo/v4 v4.12.0/go.mod h1:UP9Cr2DJXbOK3Kr9ONYzNowSh7HP0aG0ShAyycHSJvM=
|
||||
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
|
||||
|
||||
209
handlers/corporate/dashboardpic.handlers.go
Normal file
209
handlers/corporate/dashboardpic.handlers.go
Normal file
@@ -0,0 +1,209 @@
|
||||
package corporate_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
"cpone/component/pagination"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_dashboardpic "cpone/views/corporate/dashboardpic"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
type DashboardPicHandler struct {
|
||||
DashboardPicServices DashboardPicServices
|
||||
}
|
||||
|
||||
func NewDashboardPicHandler(ea DashboardPicServices) *DashboardPicHandler {
|
||||
return &DashboardPicHandler{
|
||||
DashboardPicServices: ea,
|
||||
}
|
||||
}
|
||||
|
||||
func (ea *DashboardPicHandler) HandleShowEmployeeAnalyticScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
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))
|
||||
|
||||
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: convr,
|
||||
Username: name,
|
||||
UserFullName: name,
|
||||
UserPosition: position,
|
||||
}
|
||||
|
||||
dataBreadcrumb, err := ea.DashboardPicServices.GetEmployeeAnalyticBreadcrumb(title)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error breadcrumb dev", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
defer logger.Sync()
|
||||
|
||||
navbaruser := navbarmenu.NavbarWithLogo(user)
|
||||
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
|
||||
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
|
||||
|
||||
listingData, totalPage, err := ea.DashboardPicServices.ListingDashboardPic("", "", "", 1, 10)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error get listing data", zap.Any("error", err), zap.Any("total", totalPage))
|
||||
return err
|
||||
}
|
||||
listingcomponent := corporate_dashboardpic.ListingData(listingData, listID)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
1,
|
||||
"/corp/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "",
|
||||
corporate_dashboardpic.BeforeRequestContent(),
|
||||
corporate_dashboardpic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
filtercomponent := corporate_dashboardpic.FilterListing(
|
||||
"/corp/dashboard_pic/filter",
|
||||
"input changed delay:500ms",
|
||||
"#searchID, #startdateID, #enddateID, #listID, #paginationID",
|
||||
"outerHTML",
|
||||
"#"+paginationID,
|
||||
corporate_dashboardpic.BeforeRequestContent(),
|
||||
corporate_dashboardpic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
content := corporate_dashboardpic.DashboardPic(
|
||||
listID,
|
||||
paginationID,
|
||||
breadcrumb,
|
||||
filtercomponent,
|
||||
listingcomponent,
|
||||
paginationcomponent,
|
||||
)
|
||||
css := corporate_dashboardpic.CSSDashboardPIC()
|
||||
js := corporate_dashboardpic.JSDashboardPIC()
|
||||
|
||||
view := corporate_dashboardpic.ShowDashboardPic(title, content, css, js, navbaruser, sidbaruser)
|
||||
return utils.View(c, view)
|
||||
}
|
||||
|
||||
func (ea *DashboardPicHandler) HandlePagination(c echo.Context) error {
|
||||
|
||||
pageparam := c.QueryParam("page")
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
search := c.QueryParam("search")
|
||||
startdate := c.QueryParam("startdate")
|
||||
enddate := c.QueryParam("enddate")
|
||||
|
||||
var retVal []templ.Component
|
||||
logger, _ := zap.NewProduction()
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error convert page param")
|
||||
return err
|
||||
}
|
||||
|
||||
listdata, totalPage, err := ea.DashboardPicServices.ListingDashboardPic(search, startdate, enddate, page, 10)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error convert page param")
|
||||
return err
|
||||
}
|
||||
listcomponent := corporate_dashboardpic.ListingData(listdata, listID)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
page,
|
||||
"/corp/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "",
|
||||
corporate_dashboardpic.BeforeRequestContent(),
|
||||
corporate_dashboardpic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
retVal = append(retVal, listcomponent)
|
||||
retVal = append(retVal, paginationcomponent)
|
||||
return utils.ViewMulti(c, retVal)
|
||||
}
|
||||
|
||||
func (ea *DashboardPicHandler) HandleFilter(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
search := c.QueryParam("search")
|
||||
startdate := c.QueryParam("startdate")
|
||||
enddate := c.QueryParam("enddate")
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
|
||||
dataList, totalPage, err := ea.DashboardPicServices.ListingDashboardPic(search, startdate, enddate, 1, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error Get Listing Data", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
listcomponent := corporate_dashboardpic.ListingData(dataList, listID)
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage, 1,
|
||||
"/corp/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID, "outerHTML", "", "",
|
||||
corporate_dashboardpic.BeforeRequestContent(),
|
||||
corporate_dashboardpic.AfterRequestContent(),
|
||||
)
|
||||
|
||||
var retval []templ.Component
|
||||
retval = append(retval, listcomponent)
|
||||
retval = append(retval, paginationcomponent)
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
|
||||
func (ea *DashboardPicHandler) HandleToDetail(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
id := c.Param("id")
|
||||
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
url := "/corp/dashboard_pic/detail/" + id
|
||||
c.Response().Header().Set("HX-Redirect", url)
|
||||
|
||||
return c.String(http.StatusOK, url)
|
||||
}
|
||||
80
handlers/corporate/mcudetail.handlers.go
Normal file
80
handlers/corporate/mcudetail.handlers.go
Normal file
@@ -0,0 +1,80 @@
|
||||
package corporate_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_mcudetail "cpone/views/corporate/mcu"
|
||||
corporate_tabmcudetail "cpone/views/corporate/mcu/mcutab"
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type McuDetailServices interface {
|
||||
GetBreadcrumb(id string) (models.BreadCrumbV1, error)
|
||||
}
|
||||
|
||||
type McuDetailHandler struct {
|
||||
McuDetailServices McuDetailServices
|
||||
}
|
||||
|
||||
func NewMcuDetailHandler(mcud McuDetailServices) *McuDetailHandler {
|
||||
return &McuDetailHandler{
|
||||
McuDetailServices: mcud,
|
||||
}
|
||||
}
|
||||
|
||||
func (mcud *McuDetailHandler) HandlerShowMcuDetailScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
id := c.Param("id")
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
userCok := c.Get("user").(*jwt.Token)
|
||||
claims := userCok.Claims.(jwt.MapClaims)
|
||||
name := claims["M_StaffName"].(string)
|
||||
position := claims["M_UserGroupDashboard"].(string)
|
||||
logger.Info("jwt", zap.Any("name", name))
|
||||
|
||||
user := models.User{
|
||||
UserID: 1,
|
||||
Username: name,
|
||||
UserFullName: name,
|
||||
UserPosition: position,
|
||||
}
|
||||
|
||||
dataBreadcrumb, err := mcud.McuDetailServices.GetBreadcrumb(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error breadcrumb corp", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
|
||||
navbaruser := navbarmenu.NavbarWithLogo(user)
|
||||
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
|
||||
|
||||
content := corporate_mcudetail.McuDetailScreen(
|
||||
breadcrumb,
|
||||
corporate_mcudetail.TabViewMcuDetail(id),
|
||||
)
|
||||
css := corporate_mcudetail.CSSMcuDetail(
|
||||
corporate_tabmcudetail.CssKesimpulan(),
|
||||
)
|
||||
js := corporate_mcudetail.JSMcuDetail()
|
||||
|
||||
view := corporate_mcudetail.ShowMcuDetail(
|
||||
dataBreadcrumb.Title,
|
||||
content,
|
||||
css,
|
||||
js,
|
||||
navbaruser,
|
||||
sidbaruser,
|
||||
)
|
||||
|
||||
return utils.View(c, view)
|
||||
}
|
||||
199
handlers/corporate/mcudetail/tabdaftarpeserta.handlers.go
Normal file
199
handlers/corporate/mcudetail/tabdaftarpeserta.handlers.go
Normal file
@@ -0,0 +1,199 @@
|
||||
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)
|
||||
}
|
||||
79
handlers/corporate/mcudetail/tabkelainanfisik.hanlders.go
Normal file
79
handlers/corporate/mcudetail/tabkelainanfisik.hanlders.go
Normal file
@@ -0,0 +1,79 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/chart"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_mcudetail "cpone/views/corporate/mcu/mcutab"
|
||||
"encoding/json"
|
||||
|
||||
"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)
|
||||
}
|
||||
|
||||
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")
|
||||
logger.Info("Params", zap.Any("id", id))
|
||||
|
||||
bmi, err := tkf.TabKelainanFisikServices.GetKelainanFisikBMI(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hiper, err := tkf.TabKelainanFisikServices.GetKelainanFisikHipertensi(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
bmijson, err := json.MarshalIndent(bmi, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hiperjson, err := json.MarshalIndent(hiper, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
chartsxs := []templ.Component{
|
||||
chart.ShowChartFixed("bmixs", string(bmijson), "400px", "450px"),
|
||||
chart.ShowChartFixed("hprxs", string(hiperjson), "400px", "450px"),
|
||||
}
|
||||
|
||||
chartsmd := []templ.Component{
|
||||
chart.ShowChartFixed("bmimd", string(bmijson), "450px", "450px"),
|
||||
chart.ShowChartFixed("hprmd", string(hiperjson), "450px", "450px"),
|
||||
}
|
||||
|
||||
chartslg := []templ.Component{
|
||||
chart.ShowChartFixed("bmilg", string(bmijson), "600px", "450px"),
|
||||
chart.ShowChartFixed("hprlg", string(hiperjson), "600px", "450px"),
|
||||
}
|
||||
|
||||
content := corporate_mcudetail.Tabkelainanfisik(
|
||||
chartsxs,
|
||||
chartsmd,
|
||||
chartslg,
|
||||
)
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
78
handlers/corporate/mcudetail/tabkelainanglobal.handlers.go
Normal file
78
handlers/corporate/mcudetail/tabkelainanglobal.handlers.go
Normal file
@@ -0,0 +1,78 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/chart"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_mcudetail "cpone/views/corporate/mcu/mcutab"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type TabKelainanGlobalServices interface {
|
||||
GetKelainanGlobalMCU(mcuID string) (models.Barchart, error)
|
||||
GetKelainanFisik(mcuID string) (models.Barchart, error)
|
||||
}
|
||||
|
||||
type TabKelainanGlobalHandler struct {
|
||||
TabKelainanGlobalServices TabKelainanGlobalServices
|
||||
}
|
||||
|
||||
func NewTabKelainanGlobalHandler(tkg TabKelainanGlobalServices) *TabKelainanGlobalHandler {
|
||||
return &TabKelainanGlobalHandler{
|
||||
TabKelainanGlobalServices: tkg,
|
||||
}
|
||||
}
|
||||
|
||||
func (tkg *TabKelainanGlobalHandler) HandleShowTabKelainanGlobal(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
id := c.Param("id")
|
||||
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
kelmcu, err := tkg.TabKelainanGlobalServices.GetKelainanGlobalMCU(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
kelfisik, err := tkg.TabKelainanGlobalServices.GetKelainanFisik(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
klmcujson, err := json.MarshalIndent(kelmcu, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
klfisjson, err := json.MarshalIndent(kelfisik, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
chartsxs := []templ.Component{
|
||||
chart.ShowChartFixed("chartmcuxs", string(klmcujson), "400px", "450px"),
|
||||
chart.ShowChartFixed("chartfisikxs", string(klfisjson), "400px", "450px"),
|
||||
}
|
||||
|
||||
chartsmd := []templ.Component{
|
||||
chart.ShowChartFixed("chartmcumd", string(klmcujson), "500px", "450px"),
|
||||
chart.ShowChartFixed("chartfisikmd", string(klfisjson), "500px", "450px"),
|
||||
}
|
||||
|
||||
chartslg := []templ.Component{
|
||||
chart.ShowChartFixed("chartmculg", string(klmcujson), "1000px", "450px"),
|
||||
chart.ShowChartFixed("chartfisiklg", string(klfisjson), "1000px", "450px"),
|
||||
}
|
||||
|
||||
content := corporate_mcudetail.TabKelainanGlobal(
|
||||
chartsxs,
|
||||
chartsmd,
|
||||
chartslg,
|
||||
)
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
130
handlers/corporate/mcudetail/tabkelainanlab.handlers.go
Normal file
130
handlers/corporate/mcudetail/tabkelainanlab.handlers.go
Normal file
@@ -0,0 +1,130 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/chart"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_mcudetail "cpone/views/corporate/mcu/mcutab"
|
||||
"encoding/json"
|
||||
|
||||
"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)
|
||||
}
|
||||
|
||||
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")
|
||||
|
||||
datapre, err := tkl.TabKelainanLabServices.GetDataPresentaseKelainanLab(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hematologi, err := tkl.TabKelainanLabServices.GetHematologi(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
urinalisa, err := tkl.TabKelainanLabServices.GetUrinalisa(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hati, err := tkl.TabKelainanLabServices.GetGangguanFungsiHati(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
lemak, err := tkl.TabKelainanLabServices.GetGangguanMetabolismeLemak(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
glukosa, err := tkl.TabKelainanLabServices.GetPeningkatanGlukosa(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dataprejson, err := json.MarshalIndent(datapre, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hemajson, err := json.MarshalIndent(hematologi, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
urinjson, err := json.MarshalIndent(urinalisa, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
hatijson, err := json.MarshalIndent(hati, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
lemakjson, err := json.MarshalIndent(lemak, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
glukosjson, err := json.MarshalIndent(glukosa, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
chartsxs := []templ.Component{
|
||||
chart.ShowChartFixed("dataprexs", string(dataprejson), "400px", "450px"),
|
||||
chart.ShowChartFixed("hemaxs", string(hemajson), "400px", "450px"),
|
||||
chart.ShowChartFixed("urinxs", string(urinjson), "400px", "450px"),
|
||||
chart.ShowChartFixed("hatixs", string(hatijson), "400px", "450px"),
|
||||
chart.ShowChartFixed("lemakxs", string(lemakjson), "400px", "450px"),
|
||||
chart.ShowChartFixed("glukosxs", string(glukosjson), "400px", "450px"),
|
||||
}
|
||||
|
||||
chartsmd := []templ.Component{
|
||||
chart.ShowChartFixed("datapremd", string(dataprejson), "500px", "450px"),
|
||||
chart.ShowChartFixed("hemamd", string(hemajson), "500px", "450px"),
|
||||
chart.ShowChartFixed("urinmd", string(urinjson), "500px", "450px"),
|
||||
chart.ShowChartFixed("hatimd", string(hatijson), "500px", "450px"),
|
||||
chart.ShowChartFixed("lemakmd", string(lemakjson), "500px", "450px"),
|
||||
chart.ShowChartFixed("glukosmd", string(glukosjson), "500px", "450px"),
|
||||
}
|
||||
|
||||
chartslg := []templ.Component{
|
||||
chart.ShowChartFixed("hemalg", string(hemajson), "600px", "450px"),
|
||||
chart.ShowChartFixed("urinlg", string(urinjson), "600px", "450px"),
|
||||
chart.ShowChartFixed("hatilg", string(hatijson), "600px", "450px"),
|
||||
chart.ShowChartFixed("lemaklg", string(lemakjson), "600px", "450px"),
|
||||
chart.ShowChartFixed("glukoslg", string(glukosjson), "600px", "450px"),
|
||||
}
|
||||
|
||||
content := corporate_mcudetail.TabKelainanLab(
|
||||
chart.ShowChartFixed("dataprelg", string(dataprejson), "1000px", "450px"),
|
||||
chartsxs,
|
||||
chartsmd,
|
||||
chartslg,
|
||||
)
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
74
handlers/corporate/mcudetail/tabkelainannonlab.handlers.go
Normal file
74
handlers/corporate/mcudetail/tabkelainannonlab.handlers.go
Normal file
@@ -0,0 +1,74 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/chart"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_mcudetail "cpone/views/corporate/mcu/mcutab"
|
||||
"encoding/json"
|
||||
|
||||
"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)
|
||||
}
|
||||
|
||||
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")
|
||||
|
||||
datapre, err := tknl.TabKelainanNonLabServices.GetDataKelNonLab(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
thorax, err := tknl.TabKelainanNonLabServices.GetThoraxPA(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dataprejson, err := json.MarshalIndent(datapre, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
thrxjson, err := json.MarshalIndent(thorax, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
chartsxs := []templ.Component{
|
||||
chart.ShowChartFixed("datanonxs", string(dataprejson), "400px", "450px"),
|
||||
chart.ShowChartFixed("thoraxxs", string(thrxjson), "400px", "450px"),
|
||||
}
|
||||
|
||||
chartsmd := []templ.Component{
|
||||
chart.ShowChartFixed("datanonmd", string(dataprejson), "500px", "450px"),
|
||||
chart.ShowChartFixed("thoraxmd", string(thrxjson), "500px", "450px"),
|
||||
}
|
||||
|
||||
chartslg := []templ.Component{
|
||||
chart.ShowChartFixed("datanonlg", string(dataprejson), "1000px", "450px"),
|
||||
chart.ShowChartFixed("thoraxlg", string(thrxjson), "600px", "450px"),
|
||||
}
|
||||
|
||||
content := corporate_mcudetail.TabKelainanNonLab(
|
||||
chartsxs,
|
||||
chartsmd,
|
||||
chartslg,
|
||||
)
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
93
handlers/corporate/mcudetail/tabkepesertaan.handlers.go
Normal file
93
handlers/corporate/mcudetail/tabkepesertaan.handlers.go
Normal file
@@ -0,0 +1,93 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/component/chart"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_mcudetail "cpone/views/corporate/mcu/mcutab"
|
||||
"encoding/json"
|
||||
|
||||
"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)
|
||||
}
|
||||
|
||||
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))
|
||||
|
||||
peserta, err := tkh.TabKepersertaanServices.GetTotalKepesertaanMCU(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
gender, err := tkh.TabKepersertaanServices.GetKepesertaanByGender(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
umur, err := tkh.TabKepersertaanServices.GetKepesertaanByUmur(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
totaljson, err := json.MarshalIndent(peserta, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
genderjson, err := json.MarshalIndent(gender, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
umurjson, err := json.MarshalIndent(umur, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
chartsxs := []templ.Component{
|
||||
chart.ShowChartFixed("charttotalxs", string(totaljson), "400px", "450px"),
|
||||
chart.ShowChartFixed("chartgenderxs", string(genderjson), "400px", "450px"),
|
||||
chart.ShowChartFixed("chartumurxs", string(umurjson), "400px", "450px"),
|
||||
}
|
||||
|
||||
chartsmd := []templ.Component{
|
||||
chart.ShowChartFixed("charttotalmd", string(totaljson), "450px", "450px"),
|
||||
chart.ShowChartFixed("chartgendermd", string(genderjson), "450px", "450px"),
|
||||
chart.ShowChartFixed("chartumurmd", string(umurjson), "450px", "450px"),
|
||||
}
|
||||
|
||||
chartslg := []templ.Component{
|
||||
chart.ShowChartFixed("charttotal", string(totaljson), "600px", "450px"),
|
||||
chart.ShowChartFixed("chartgender", string(genderjson), "600px", "450px"),
|
||||
chart.ShowChartFixed("chartumur", string(umurjson), "600px", "450px"),
|
||||
}
|
||||
|
||||
content := corporate_mcudetail.TabKepesertaan(
|
||||
chartsxs,
|
||||
chartsmd,
|
||||
chartslg,
|
||||
)
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
76
handlers/corporate/mcudetail/tabkesimpulan.handlers.go
Normal file
76
handlers/corporate/mcudetail/tabkesimpulan.handlers.go
Normal file
@@ -0,0 +1,76 @@
|
||||
package mcu_corporate_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_mcudetail "cpone/views/corporate/mcu/mcutab"
|
||||
"fmt"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type TabKesimpulanServices interface {
|
||||
GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanFisik(id string) ([]models.ModelKesimpulanLab, error)
|
||||
}
|
||||
|
||||
type TabKesimpulanHandler struct {
|
||||
TabKesimpulanServices TabKesimpulanServices
|
||||
}
|
||||
|
||||
func NewTabKesimpulanHandler(us TabKesimpulanServices) *TabKesimpulanHandler {
|
||||
return &TabKesimpulanHandler{
|
||||
TabKesimpulanServices: us,
|
||||
}
|
||||
}
|
||||
|
||||
func (tkh *TabKesimpulanHandler) HandleShowTabKesimpulanScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
tableID := utils.GenerateRandomID("tablebody")
|
||||
id := c.Param("id")
|
||||
|
||||
dataLab, err := tkh.TabKesimpulanServices.GetListKesimpulanLab(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST LAB",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataLab)
|
||||
return err
|
||||
}
|
||||
tableComponentLab := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID)
|
||||
|
||||
dataNonLab, err := tkh.TabKesimpulanServices.GetListKesimpulanNonLab(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST NON LAB",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataNonLab)
|
||||
return err
|
||||
}
|
||||
tableComponentNonLab := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableID)
|
||||
|
||||
dataFisik, err := tkh.TabKesimpulanServices.GetListKesimpulanFisik(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST FISIK",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataFisik)
|
||||
return err
|
||||
}
|
||||
tableComponentFisik := corporate_mcudetail.CardTableKesimpulan("3 Kelainan Pemeriksaan Fisik terbesar :", dataFisik, tableID)
|
||||
|
||||
content := corporate_mcudetail.MainKesimpulan(
|
||||
tableID,
|
||||
tableComponentLab,
|
||||
tableComponentNonLab,
|
||||
tableComponentFisik,
|
||||
)
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
129
handlers/corporate/mcudetail/tabkeuangan.handlers.go
Normal file
129
handlers/corporate/mcudetail/tabkeuangan.handlers.go
Normal file
@@ -0,0 +1,129 @@
|
||||
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 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("tableID")
|
||||
paginationID := utils.GenerateRandomID("paginationID")
|
||||
|
||||
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_mcudetail.TableKeuangan(dataTable, tableID)
|
||||
|
||||
pagination := pagination.PaginationV3(
|
||||
totalPage,
|
||||
1,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabkeuangan/changepage",
|
||||
paginationID,
|
||||
"#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent",
|
||||
"#tabdanpagi",
|
||||
"outerHTML", "", "",
|
||||
corporate_mcudetail.BeforeRequestContent(),
|
||||
corporate_mcudetail.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_mcudetail.TabKeuanganScreen(
|
||||
tableID,
|
||||
paginationID,
|
||||
corporate_mcudetail.KeuanganCard(
|
||||
totalOrderF,
|
||||
totalTagihan,
|
||||
totalPelunasan,
|
||||
totalHutang,
|
||||
),
|
||||
corporate_mcudetail.TableAndPagination(
|
||||
tablecompo,
|
||||
pagination,
|
||||
),
|
||||
)
|
||||
|
||||
return utils.View(c, content)
|
||||
}
|
||||
|
||||
func (tk *TabKeuanganHandler) HandleChangePage(c echo.Context) error {
|
||||
pageparam := c.QueryParam("page")
|
||||
tableID := c.QueryParam("tableID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
|
||||
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_mcudetail.TableKeuangan(tableData, tableID)
|
||||
pagination := pagination.PaginationV3(
|
||||
totalPage,
|
||||
page,
|
||||
"/corp/dashboard_pic/detail/"+id+"/tabkeuangan/changepage",
|
||||
paginationID,
|
||||
"#tableID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent",
|
||||
"#tabdanpagi",
|
||||
"outerHTML", "", "",
|
||||
corporate_mcudetail.BeforeRequestContent(),
|
||||
corporate_mcudetail.AfterRequestContent(),
|
||||
)
|
||||
|
||||
tabdanpagi := corporate_mcudetail.TableAndPagination(tablecomp, pagination)
|
||||
return utils.View(c, tabdanpagi)
|
||||
}
|
||||
@@ -1,13 +1,26 @@
|
||||
package corporate_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
"cpone/component/pagination"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
corporate_patient "cpone/views/corporate/patient"
|
||||
"strconv"
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
func NewPatientHandler(us PatientService) *PatientHandler {
|
||||
@@ -20,7 +33,210 @@ type PatientHandler struct {
|
||||
PatientService PatientService
|
||||
}
|
||||
|
||||
func (uh *PatientHandler) ShowPatient(c echo.Context) error {
|
||||
helo := corporate_patient.Show()
|
||||
return utils.View(c, helo)
|
||||
func (ph *PatientHandler) LoadLocalData(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
dialogID := c.QueryParam("dialogID")
|
||||
dialogBodyID := c.QueryParam("dialogBodyID")
|
||||
userEmail := c.QueryParam("userEmail")
|
||||
logger.Info("params", zap.Any("email", userEmail))
|
||||
|
||||
title, err := ph.PatientService.GetPatientData(userEmail)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error get user", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
dataBreadcrumb, err := ph.PatientService.GetDashboardPatientBreadcrumb(title)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error breadcrumb", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
defer logger.Sync()
|
||||
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
|
||||
|
||||
listingdata, totalPage, err := ph.PatientService.GetListtingData(userEmail, 1, 10)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("error get listing data", zap.Any("error", err), zap.Any("total", totalPage))
|
||||
return err
|
||||
}
|
||||
listingcomponent := corporate_patient.ListingData(listingdata,
|
||||
listID,
|
||||
"/corp/dashboard_pat/open",
|
||||
"#"+dialogBodyID,
|
||||
"#listID, #paginationID, #dialogID, #dialogBodyID, #userEmail",
|
||||
"outerHTML",
|
||||
)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
1,
|
||||
"/corp/dashboard_pat/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogID, #dialogBodyID, #userEmail",
|
||||
"#contentlayout",
|
||||
"outerHTML", "", "",
|
||||
corporate_patient.BeforeRequestContent(),
|
||||
corporate_patient.AfterRequestContent(),
|
||||
)
|
||||
|
||||
tabData := []models.TabViewReportMcu{}
|
||||
tabcomponent := corporate_patient.TabReportView(tabData)
|
||||
|
||||
bodyModal := corporate_patient.ModalBody(
|
||||
dialogBodyID,
|
||||
tabcomponent,
|
||||
corporate_patient.JsShowModal(""),
|
||||
)
|
||||
|
||||
bodyClose := corporate_patient.ModalClose(
|
||||
"/corp/dashboard_pat/closemodal",
|
||||
"#"+dialogBodyID,
|
||||
"outerHTML",
|
||||
"#"+dialogID,
|
||||
)
|
||||
|
||||
modalDialog := corporate_patient.DialogReport(
|
||||
"",
|
||||
"/corp/dashboard_pat/dialog",
|
||||
"#"+dialogBodyID,
|
||||
"outerHTML",
|
||||
"#listID, #paginationID, #dialogID, #userEmail, #dialogBodyID"+paginationID,
|
||||
dialogID,
|
||||
title,
|
||||
bodyModal,
|
||||
bodyClose,
|
||||
)
|
||||
|
||||
content := corporate_patient.ContentP(listingcomponent, paginationcomponent)
|
||||
|
||||
view := corporate_patient.ContentPage(
|
||||
breadcrumb,
|
||||
content,
|
||||
modalDialog,
|
||||
)
|
||||
|
||||
return utils.View(c, view)
|
||||
}
|
||||
|
||||
func (ph *PatientHandler) HandleShowPatient(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
listID := utils.GenerateRandomID("listid")
|
||||
paginationID := utils.GenerateRandomID("paginationid")
|
||||
dialogID := utils.GenerateRandomID("dialogid")
|
||||
dialogBodyID := utils.GenerateRandomID("dialogbodyid")
|
||||
|
||||
userCok := c.Get("user").(*jwt.Token)
|
||||
claims := userCok.Claims.(jwt.MapClaims)
|
||||
name := claims["M_StaffName"].(string)
|
||||
position := claims["M_UserGroupDashboard"].(string)
|
||||
logger.Info("jwt", zap.Any("name", name))
|
||||
|
||||
user := models.User{
|
||||
UserID: 1,
|
||||
Username: name,
|
||||
UserFullName: name,
|
||||
UserPosition: position,
|
||||
}
|
||||
|
||||
navbaruser := navbarmenu.NavbarWithLogo(user)
|
||||
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
|
||||
|
||||
content := corporate_patient.DashboardPat(
|
||||
listID,
|
||||
paginationID,
|
||||
dialogID,
|
||||
dialogBodyID,
|
||||
)
|
||||
css := corporate_patient.CSSDashboardPat()
|
||||
js := corporate_patient.JSDashboardPat()
|
||||
|
||||
view := corporate_patient.ShowDashboardPat("Dashboard Pasien", content, css, js, navbaruser, sidbaruser)
|
||||
return utils.View(c, view)
|
||||
}
|
||||
|
||||
func (ph *PatientHandler) HandleChangePage(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
pageparam := c.QueryParam("page")
|
||||
listID := c.QueryParam("listID")
|
||||
paginationID := c.QueryParam("paginationID")
|
||||
dialogBodyID := c.QueryParam("dialogBodyID")
|
||||
userEmail := c.QueryParam("userEmail")
|
||||
logger.Info("params", zap.Any("userEmail", userEmail))
|
||||
|
||||
// var retval []templ.Component
|
||||
page, err := strconv.Atoi(pageparam)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("error convert page param")
|
||||
return err
|
||||
}
|
||||
|
||||
listData, totalPage, err := ph.PatientService.GetListtingData(userEmail, page, 10)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("error get data listing")
|
||||
return err
|
||||
}
|
||||
listcomponent := corporate_patient.ListingData(listData,
|
||||
listID,
|
||||
"/corp/dashboard_pat/open",
|
||||
"#"+dialogBodyID,
|
||||
"#listID, #paginationID, #dialogID, #dialogBodyID, #userEmail",
|
||||
"outerHTML",
|
||||
)
|
||||
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
page,
|
||||
"/corp/dashboard_pat/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #loading-parent, #loading-child, #loading-spinner, #loadingcontent, #dialogID, #dialogBodyID, #userEmail, #currPage"+paginationID,
|
||||
"#contentlayout",
|
||||
"outerHTML", "", "",
|
||||
corporate_patient.BeforeRequestContent(),
|
||||
corporate_patient.AfterRequestContent(),
|
||||
)
|
||||
|
||||
// retval = append(retval, listcomponent)
|
||||
// retval = append(retval, paginationcomponent)
|
||||
// return utils.ViewMulti(c, retval)
|
||||
|
||||
content := corporate_patient.ContentP(listcomponent, paginationcomponent)
|
||||
return utils.View(c, content)
|
||||
}
|
||||
|
||||
func (ph *PatientHandler) HandleOpenReport(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
id := c.QueryParam("id")
|
||||
dialogID := c.QueryParam("dialogID")
|
||||
dialogBodyID := c.QueryParam("dialogBodyID")
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
tabData, err := ph.PatientService.GetReportMcu(id)
|
||||
if err != nil {
|
||||
tab := corporate_patient.TabReportView([]models.TabViewReportMcu{})
|
||||
mod := corporate_patient.ModalBody(
|
||||
dialogBodyID,
|
||||
tab,
|
||||
corporate_patient.JsShowModal(""),
|
||||
)
|
||||
return utils.View(c, mod)
|
||||
}
|
||||
|
||||
tabcomponent := corporate_patient.TabReportView(tabData)
|
||||
modalBody := corporate_patient.ModalBody(
|
||||
dialogBodyID,
|
||||
tabcomponent,
|
||||
corporate_patient.JsShowModal("#"+dialogID),
|
||||
)
|
||||
|
||||
return utils.View(c, modalBody)
|
||||
}
|
||||
|
||||
72
handlers/dev/detailmcu.handlers.go
Normal file
72
handlers/dev/detailmcu.handlers.go
Normal file
@@ -0,0 +1,72 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
breadcrumadmin "cpone/component/breadcrumbadmin"
|
||||
navbarmenu "cpone/component/navbar"
|
||||
sidebaruserprofile "cpone/component/sidebar_user_profile"
|
||||
"cpone/models"
|
||||
"cpone/services"
|
||||
"cpone/utils"
|
||||
dev_detailmcu "cpone/views/dev/mcu"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type DetailMcuServices interface {
|
||||
GetBreadcrumb(title string) (models.BreadCrumbV1, error)
|
||||
}
|
||||
|
||||
type DetailMcuHandler struct {
|
||||
DetailMcuServices DetailMcuServices
|
||||
}
|
||||
|
||||
func NewDetailMcuHandler(dmcu DetailMcuServices) *DetailMcuHandler {
|
||||
return &DetailMcuHandler{
|
||||
DetailMcuServices: dmcu,
|
||||
}
|
||||
}
|
||||
|
||||
func (dmcu *DetailMcuHandler) HandleShowDetailMcuScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
title := "PT. Sadhana Abiyasa Sampoerna"
|
||||
|
||||
id := c.Param("id")
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
user, err := services.GetUserLogin()
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error get user dev", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
dataBreadcrumb, err := dmcu.DetailMcuServices.GetBreadcrumb(title)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error breadcrumb dev", zap.Any("error", err))
|
||||
return err
|
||||
}
|
||||
|
||||
breadcrumb := breadcrumadmin.MainBreadcrumbAdminV1(dataBreadcrumb)
|
||||
navbaruser := navbarmenu.NavbarWithLogo(user)
|
||||
sidbaruser := sidebaruserprofile.Navbaruserprofile(user)
|
||||
|
||||
content := dev_detailmcu.DetailMcuScreen(
|
||||
breadcrumb,
|
||||
dev_detailmcu.TabViewDetailMcu(id),
|
||||
)
|
||||
css := dev_detailmcu.CSSDetailMcu()
|
||||
js := dev_detailmcu.JSDetailMcu()
|
||||
|
||||
view := dev_detailmcu.ShowDetailMcu(
|
||||
title,
|
||||
content,
|
||||
css,
|
||||
js,
|
||||
navbaruser,
|
||||
sidbaruser,
|
||||
)
|
||||
|
||||
return utils.View(c, view)
|
||||
}
|
||||
@@ -18,8 +18,8 @@ import (
|
||||
|
||||
type EmployeeAnalyticServices interface {
|
||||
GetEmployeeAnalyticBreadcrumb(title string) (models.BreadCrumbV1, error)
|
||||
DummyDataTest() ([]models.EmployeeAnalytic, error)
|
||||
ListingEmployeeAnalytic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.EmployeeAnalytic, int, error)
|
||||
DummyDataTest() ([]models.DashboardPic, error)
|
||||
ListingEmployeeAnalytic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.DashboardPic, int, error)
|
||||
}
|
||||
|
||||
type EmployeeAnalyticHandler struct {
|
||||
@@ -69,7 +69,7 @@ func (ea *EmployeeAnalyticHandler) HandleShowEmployeeAnalyticScreen(c echo.Conte
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
1,
|
||||
"/dev/employeeanalytic/changepage",
|
||||
"/dev/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID,
|
||||
@@ -79,7 +79,7 @@ func (ea *EmployeeAnalyticHandler) HandleShowEmployeeAnalyticScreen(c echo.Conte
|
||||
)
|
||||
|
||||
filtercomponent := dev_employeeanalytic.FilterListing(
|
||||
"/dev/employeeanalytic/filter",
|
||||
"/dev/dashboard_pic/filter",
|
||||
"input changed delay:500ms",
|
||||
"#searchID, #startdateID, #enddateID, #listID, #paginationID",
|
||||
"outerHTML",
|
||||
@@ -132,7 +132,7 @@ func (ea *EmployeeAnalyticHandler) HandlePagination(c echo.Context) error {
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage,
|
||||
page,
|
||||
"/dev/employeeanalytic/changepage",
|
||||
"/dev/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID,
|
||||
@@ -165,7 +165,7 @@ func (ea *EmployeeAnalyticHandler) HandleFilter(c echo.Context) error {
|
||||
listcomponent := dev_employeeanalytic.ListingData(dataList, listID)
|
||||
paginationcomponent := pagination.PaginationV3(
|
||||
totalPage, 1,
|
||||
"/dev/employeeanalytic/changepage",
|
||||
"/dev/dashboard_pic/changepage",
|
||||
paginationID,
|
||||
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
|
||||
"#"+paginationID, "outerHTML", "", "",
|
||||
@@ -178,3 +178,15 @@ func (ea *EmployeeAnalyticHandler) HandleFilter(c echo.Context) error {
|
||||
retval = append(retval, paginationcomponent)
|
||||
return utils.ViewMulti(c, retval)
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticHandler) HandleIntoDetail(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
id := c.Param("id")
|
||||
|
||||
logger.Info("params", zap.Any("id", id))
|
||||
|
||||
url := "/dev/detail/" + id
|
||||
c.Response().Header().Set("HX-Redirect", url)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
88
handlers/dev/kesimpulan.handlers.go
Normal file
88
handlers/dev/kesimpulan.handlers.go
Normal file
@@ -0,0 +1,88 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
dev_kesimpulan "cpone/views/dev/kesimpulan"
|
||||
"fmt"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type KesimpulanService interface {
|
||||
GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error)
|
||||
GetListKesimpulanFisik(id string) ([]models.ModelKesimpulanLab, error)
|
||||
}
|
||||
|
||||
func NewKesimpulanHandler(us KesimpulanService) *KesimpulanHandler {
|
||||
return &KesimpulanHandler{
|
||||
KesimpulanService: us,
|
||||
}
|
||||
}
|
||||
|
||||
type KesimpulanHandler struct {
|
||||
KesimpulanService KesimpulanService
|
||||
}
|
||||
|
||||
func (h *KesimpulanHandler) HandleShowKesimpulanScreen(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
tableID := utils.GenerateRandomID("tablebody")
|
||||
id := c.Param("id")
|
||||
|
||||
// table component
|
||||
dataLab, err := h.KesimpulanService.GetListKesimpulanLab(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST LAB",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataLab)
|
||||
return err
|
||||
}
|
||||
|
||||
logger.Info("CEK DATA",
|
||||
zap.Any("data lab", dataLab))
|
||||
|
||||
tableComponentLab := dev_kesimpulan.CardTableKesimpulan("3 Kelainan Pemeriksaan Lab terbesar :", dataLab, tableID)
|
||||
|
||||
// table component non lab
|
||||
dataNonLab, err := h.KesimpulanService.GetListKesimpulanNonLab(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST NON LAB",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataNonLab)
|
||||
return err
|
||||
}
|
||||
|
||||
logger.Info("CEK DATA",
|
||||
zap.Any("data lab", dataNonLab))
|
||||
tableComponentNonLab := dev_kesimpulan.CardTableKesimpulan("3 Kelainan Pemeriksaan Non Lab terbesar :", dataNonLab, tableID)
|
||||
|
||||
// table component fisik
|
||||
dataFisik, err := h.KesimpulanService.GetListKesimpulanFisik(id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST FISIK",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataFisik)
|
||||
return err
|
||||
}
|
||||
|
||||
logger.Info("CEK DATA",
|
||||
zap.Any("data lab", dataFisik))
|
||||
tableComponentFisik := dev_kesimpulan.CardTableKesimpulan("3 Kelainan Pemeriksaan Fisik terbesar :", dataFisik, tableID)
|
||||
|
||||
content := dev_kesimpulan.MainKesimpulan(tableID,
|
||||
tableComponentLab,
|
||||
tableComponentNonLab,
|
||||
tableComponentFisik)
|
||||
|
||||
view := dev_kesimpulan.ShowKesimpulan("KESIMPULAN", content, dev_kesimpulan.CssKesimpulan(), dev_kesimpulan.JsKesimpulan())
|
||||
return utils.View(c, view)
|
||||
}
|
||||
66
handlers/dev/mcudaftarpeserta.handlers.go
Normal file
66
handlers/dev/mcudaftarpeserta.handlers.go
Normal file
@@ -0,0 +1,66 @@
|
||||
package dev_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
dev_mcudaftarpeserta "cpone/views/dev/mcu/daftarpeserta"
|
||||
"fmt"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type McuDaftarPesertaServices interface {
|
||||
GetListMcuDaftarPeserta(id string, currentPage int, rowPerPage int) ([]models.ModelMcuDaftarPeserta, int, error)
|
||||
}
|
||||
|
||||
type McuDaftarPesertaHandler struct {
|
||||
McuDaftarPesertaServices McuDaftarPesertaServices
|
||||
}
|
||||
|
||||
func NewMcuDaftarPeserta(mdp McuDaftarPesertaServices) *McuDaftarPesertaHandler {
|
||||
return &McuDaftarPesertaHandler{
|
||||
McuDaftarPesertaServices: mdp,
|
||||
}
|
||||
}
|
||||
|
||||
func (mdp *McuDaftarPesertaHandler) HandleGetMcuDaftarPeserta(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
|
||||
id := c.Param("id")
|
||||
|
||||
// get listing data
|
||||
dataMcuDaftarPeserta, totalPage, err := mdp.McuDaftarPesertaServices.GetListMcuDaftarPeserta(id, 1, 5)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("ERROR GET LIST LAB",
|
||||
zap.Any("error", err),
|
||||
)
|
||||
fmt.Println(dataMcuDaftarPeserta)
|
||||
return err
|
||||
}
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("PESERTA",
|
||||
zap.Any("totalpage", totalPage),
|
||||
)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (mdp *McuDaftarPesertaHandler) HandleShowMcuDaftarPeserta(c echo.Context) error {
|
||||
title := "Daftar Peserta"
|
||||
|
||||
content := dev_mcudaftarpeserta.McuDaftarPesertaScreen()
|
||||
css := dev_mcudaftarpeserta.CSSMcuDaftarPeserta()
|
||||
js := dev_mcudaftarpeserta.JsMcuDaftarPeserta()
|
||||
|
||||
view := dev_mcudaftarpeserta.ShowMcuDafterPeserta(
|
||||
title,
|
||||
content,
|
||||
css,
|
||||
js,
|
||||
)
|
||||
|
||||
return utils.View(c, view)
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package public_handlers
|
||||
import (
|
||||
public_services "cpone/services/public"
|
||||
public_landingpage "cpone/views/public/landingpage"
|
||||
"net/http"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"go.uber.org/zap"
|
||||
@@ -56,7 +57,7 @@ func (uh *LandingPageHandler) ShowLandingPage(c echo.Context) error {
|
||||
)
|
||||
// fmt.Printf("%+v\n", udata)
|
||||
|
||||
helo := public_landingpage.ShowLandingPage("Hello World",
|
||||
helo := public_landingpage.ShowLandingPage("HOME",
|
||||
public_landingpage.MainLandingPage(public_landingpage.ListMedicalService(udata),
|
||||
public_landingpage.ListAdvantage(adData), public_landingpage.ListPromotion(lpData),
|
||||
public_landingpage.FooterSection(ftNav)),
|
||||
@@ -65,6 +66,12 @@ func (uh *LandingPageHandler) ShowLandingPage(c echo.Context) error {
|
||||
return uh.View(c, helo)
|
||||
}
|
||||
|
||||
func (uh *LandingPageHandler) HandleBtnLogin(c echo.Context) error {
|
||||
c.Response().Header().Set("HX-Redirect", "/login")
|
||||
|
||||
return c.String(http.StatusOK, "/login")
|
||||
}
|
||||
|
||||
func (uh *LandingPageHandler) View(c echo.Context, cmp templ.Component) error {
|
||||
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
|
||||
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
package public_handlers
|
||||
|
||||
import (
|
||||
"cpone/models"
|
||||
"cpone/utils"
|
||||
public_login "cpone/views/public/login"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"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)
|
||||
}
|
||||
|
||||
func NewLoginHandler(us LoginService) *LoginHandler {
|
||||
@@ -20,14 +27,133 @@ type LoginHandler struct {
|
||||
LoginService LoginService
|
||||
}
|
||||
|
||||
// func (uh *LoginHandler) ShowLogin(c echo.Context) error {
|
||||
// helo := client_Login.Show()
|
||||
// return utils.View(c, helo)
|
||||
// }
|
||||
|
||||
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()
|
||||
|
||||
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)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error", zap.Any("error multi signin", err))
|
||||
|
||||
si := public_login.ShowLogin("Login ", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, si)
|
||||
|
||||
// loginform := public_login.FormSignin(false)
|
||||
// return utils.View(c, loginform)
|
||||
}
|
||||
if resp.Status == "ERR" {
|
||||
defer logger.Sync()
|
||||
logger.Info("Error", zap.Any("ERR", resp.Status))
|
||||
|
||||
si := public_login.ShowLogin("Login ", public_login.MainLogin(false), public_login.CssLogin(), public_login.JsLogin())
|
||||
return utils.View(c, si)
|
||||
// loginform := public_login.FormSignin(false)
|
||||
// return utils.View(c, loginform)
|
||||
}
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("valid", zap.Any("value", resp))
|
||||
|
||||
var url string
|
||||
switch resp.Data.Type {
|
||||
case "cpone":
|
||||
url = "/one-ui"
|
||||
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 {
|
||||
defer logger.Sync()
|
||||
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)
|
||||
|
||||
// loginform := public_login.FormSignin(false)
|
||||
// return utils.View(c, loginform)
|
||||
}
|
||||
|
||||
cookie := new(http.Cookie)
|
||||
cookie.Name = "token"
|
||||
cookie.Value = resp.Data.Token
|
||||
cookie.Path = "/"
|
||||
cookie.HttpOnly = true
|
||||
|
||||
c.SetCookie(cookie)
|
||||
|
||||
userString := string(user)
|
||||
store := `
|
||||
<script>
|
||||
console.log("store token");
|
||||
const token = "` + resp.Data.Token + `";
|
||||
const user = JSON.stringify(` + userString + `);
|
||||
localStorage.setItem("token", token);
|
||||
localStorage.setItem("user", user);
|
||||
|
||||
htmx.on("htmx:configRequest", (e)=> {
|
||||
e.detail.headers["Authentication"] = "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) HandleRedirect(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
url := c.QueryParam("url")
|
||||
token := c.Request().Header.Get("Authentication")
|
||||
logger.Info("params", zap.Any("url", url), zap.Any("token", token))
|
||||
|
||||
c.Response().Header().Set("HX-Redirect", url)
|
||||
return c.String(http.StatusOK, url)
|
||||
}
|
||||
|
||||
func (lh *LoginHandler) HandleSignOut(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
logger.Info("Logout")
|
||||
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>
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"cpone/auth"
|
||||
client_handlers "cpone/handlers/client"
|
||||
corporate_handlers "cpone/handlers/corporate"
|
||||
mcu_corporate_handlers "cpone/handlers/corporate/mcudetail"
|
||||
dev_handlers "cpone/handlers/dev"
|
||||
public_handlers "cpone/handlers/public"
|
||||
client_services "cpone/services/client"
|
||||
corporate_services "cpone/services/corporate"
|
||||
mcu_corporate_services "cpone/services/corporate/mcudetail"
|
||||
dev_services "cpone/services/dev"
|
||||
public_services "cpone/services/public"
|
||||
|
||||
@@ -16,10 +19,10 @@ import (
|
||||
)
|
||||
|
||||
func SetupRoutes(app *echo.Echo, h *dev_handlers.UserHandler) {
|
||||
group := app.Group("/user")
|
||||
// group := app.Group("/user")
|
||||
|
||||
group.GET("", h.HandlerShowUsers)
|
||||
group.GET("/details/:id", h.HandlerShowUserById)
|
||||
// group.GET("", h.HandlerShowUsers)
|
||||
// group.GET("/details/:id", h.HandlerShowUserById)
|
||||
|
||||
}
|
||||
|
||||
@@ -67,8 +70,16 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
|
||||
lh := public_handlers.NewLandingPageHandler(l)
|
||||
public.GET("landingpage", lh.ShowLandingPage)
|
||||
public.GET("home", lh.ShowLandingPage)
|
||||
loginHdr := public_handlers.NewLoginHandler(l)
|
||||
public.GET("login", loginHdr.HandlerShowLogin)
|
||||
public.GET("home/login", lh.HandleBtnLogin)
|
||||
// loginHdr := public_handlers.NewLoginHandler(l)
|
||||
// public.GET("login", loginHdr.HandlerShowLogin)
|
||||
|
||||
loginServ := public_services.NewServicesLogin(appStore)
|
||||
loginHadlr := public_handlers.NewLoginHandler(loginServ)
|
||||
public.GET("login", loginHadlr.HandlerShowLogin)
|
||||
public.POST("login/signin", loginHadlr.HandleSignIn)
|
||||
public.GET("login/redirect", loginHadlr.HandleRedirect)
|
||||
public.GET("login/signout", loginHadlr.HandleSignOut)
|
||||
|
||||
// kartu kontrol
|
||||
publicKartuKontrolServices := public_services.NewServicesKartuKontrol(appStore)
|
||||
@@ -91,16 +102,78 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
|
||||
public.GET("redirectsurveymcu", publicKartuKontrolhandlers.HandlerRedirectToSurveyMcu)
|
||||
}
|
||||
func SetupRoutesCorporate(app *echo.Echo, appStore db.AppStore) {
|
||||
public := app.Group("/corp")
|
||||
corp := app.Group("/corp", auth.IsLoggedIn)
|
||||
// corp := app.Group("/corp")
|
||||
l := corporate_services.NewServicesCompany(appStore)
|
||||
lh := corporate_handlers.NewCompanyHandler(l)
|
||||
public.GET("/company", lh.ShowCompany)
|
||||
patientHandler := corporate_handlers.NewPatientHandler(l)
|
||||
public.GET("/patient", patientHandler.ShowPatient)
|
||||
corp.GET("/company", lh.ShowCompany)
|
||||
|
||||
// dashboard_pic
|
||||
dashbrdPicServ := corporate_services.NewDashboardPicServices(appStore)
|
||||
dashbrdPicHandl := corporate_handlers.NewDashboardPicHandler(dashbrdPicServ)
|
||||
corp.GET("/dashboard_pic", dashbrdPicHandl.HandleShowEmployeeAnalyticScreen)
|
||||
corp.GET("/dashboard_pic/changepage", dashbrdPicHandl.HandlePagination)
|
||||
corp.GET("/dashboard_pic/filter", dashbrdPicHandl.HandleFilter)
|
||||
corp.GET("/dashboard_pic/click/:id", dashbrdPicHandl.HandleToDetail)
|
||||
|
||||
// mcu detail
|
||||
mcudServ := corporate_services.NewMcuDetailServices(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)
|
||||
|
||||
// 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)
|
||||
corp.GET("/dashboard_pat", patientHandler.HandleShowPatient)
|
||||
corp.GET("/dashboard_pat/content", patientHandler.LoadLocalData)
|
||||
corp.GET("/dashboard_pat/changepage", patientHandler.HandleChangePage)
|
||||
corp.GET("/dashboard_pat/open", patientHandler.HandleOpenReport)
|
||||
}
|
||||
|
||||
func SetupRoutesClient(app *echo.Echo, appStore db.AppStore) {
|
||||
public := app.Group("/client")
|
||||
public := app.Group("/client", auth.IsLoggedIn)
|
||||
|
||||
lpanel := client_services.NewServicesMdPanel(appStore)
|
||||
lhpanel := client_handlers.NewMdPanelHandler(lpanel)
|
||||
@@ -236,9 +309,14 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
|
||||
// employee analytic
|
||||
devEmplAnaServices := dev_services.NewEmployeeAnalyticServices(appStore)
|
||||
devEmplAnaHandler := dev_handlers.NewEmployeeAnalyticHandler(devEmplAnaServices)
|
||||
dev.GET("/employeeanalytic", devEmplAnaHandler.HandleShowEmployeeAnalyticScreen)
|
||||
dev.GET("/employeeanalytic/changepage", devEmplAnaHandler.HandlePagination)
|
||||
dev.GET("/employeeanalytic/filter", devEmplAnaHandler.HandleFilter)
|
||||
dev.GET("/dashboard_pic", devEmplAnaHandler.HandleShowEmployeeAnalyticScreen)
|
||||
dev.GET("/dashboard_pic/changepage", devEmplAnaHandler.HandlePagination)
|
||||
dev.GET("/dashboard_pic/filter", devEmplAnaHandler.HandleFilter)
|
||||
dev.GET("/dashboard_pic/click/:id", devEmplAnaHandler.HandleIntoDetail)
|
||||
|
||||
devDetailMcuService := dev_services.NewDetailMcuServices(appStore)
|
||||
devDetailMcuHandler := dev_handlers.NewDetailMcuHandler(devDetailMcuService)
|
||||
dev.GET("/detail/:id", devDetailMcuHandler.HandleShowDetailMcuScreen)
|
||||
|
||||
// group result
|
||||
devGRServices := dev_services.NewServicesGroupResult(appStore)
|
||||
@@ -329,4 +407,14 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
|
||||
dev.GET("/md/bahan/opendelete", devMdBahanHandlers.HandleOpenDeleteMdBahan)
|
||||
dev.POST("/md/bahan/closedeleteform", devMdBahanHandlers.HandleCloseDeleteMdBahan)
|
||||
dev.POST("/md/bahan/delete", devMdBahanHandlers.HandleDeleteMdBahan)
|
||||
|
||||
// Kesimpulan
|
||||
devKesimpulanServices := dev_services.NewServicesKesimpulan(appStore)
|
||||
devKesimpuanHandler := dev_handlers.NewKesimpulanHandler(devKesimpulanServices)
|
||||
dev.GET("/kesimpulan/:id", devKesimpuanHandler.HandleShowKesimpulanScreen)
|
||||
|
||||
// mcu daftar peserta
|
||||
devMcuDaftarPesertaServices := dev_services.NewMcuDaftarPesertaServices(appStore)
|
||||
devMcuDaftarPesertaHandler := dev_handlers.NewMcuDaftarPeserta(devMcuDaftarPesertaServices)
|
||||
dev.GET("/mcudaftarpeserta/:id", devMcuDaftarPesertaHandler.HandleGetMcuDaftarPeserta)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package layout
|
||||
|
||||
templ EmployeeAnalyticLayout(
|
||||
templ DashboardLayout(
|
||||
title string,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
@@ -10,7 +10,7 @@ import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
func EmployeeAnalyticLayout(
|
||||
func DashboardLayout(
|
||||
title string,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
@@ -36,7 +36,7 @@ func EmployeeAnalyticLayout(
|
||||
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: `layout\layout_employee_analytic.templ`, Line: 16, Col: 34}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `layout\layout_dashboard.templ`, Line: 16, Col: 34}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
155
models/chart.models.go
Normal file
155
models/chart.models.go
Normal file
@@ -0,0 +1,155 @@
|
||||
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"`
|
||||
} `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"`
|
||||
}
|
||||
|
||||
type BarDataset struct {
|
||||
Source [][]interface{} `json:"source"`
|
||||
}
|
||||
|
||||
type BarchartV2 struct {
|
||||
Title struct {
|
||||
Text string `json:"text"`
|
||||
} `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"`
|
||||
}
|
||||
11
models/dashboardpatient.models.go
Normal file
11
models/dashboardpatient.models.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package models
|
||||
|
||||
type DashboardPatient struct {
|
||||
T_OrderHeaderID int `db:"T_OrderHeaderID"`
|
||||
T_OrderHeaderDate string `db:"T_OrderHeaderDate"`
|
||||
T_OrderHeaderLabNumber string `db:"T_OrderHeaderLabNumber"`
|
||||
T_OrderHeaderM_PatientID int `db:"T_OrderHeaderM_PatientID"`
|
||||
T_OrderHeaderCorporateID int `db:"T_OrderHeaderCorporateID"`
|
||||
T_OrderHeaderMgm_McuID int `db:"T_OrderHeaderMgm_McuID"`
|
||||
T_OrderHeaderIsActive string `db:"T_OrderHeaderIsActive"`
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package models
|
||||
|
||||
type EmployeeAnalytic struct {
|
||||
type DashboardPic struct {
|
||||
Mgm_McuID int `db:"Mgm_McuID"`
|
||||
Mgm_McuLabel string `db:"Mgm_McuLabel"`
|
||||
Mgm_McuFlagRelasiBayarSendiri string `db:"Mgm_McuFlagRelasiBayarSendiri"`
|
||||
|
||||
7
models/kesimpulan.models.go
Normal file
7
models/kesimpulan.models.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package models
|
||||
|
||||
type ModelKesimpulanLab struct {
|
||||
Nomor string `db:"nomor"`
|
||||
Test string `db:"Test"`
|
||||
Total string `db:"total"`
|
||||
}
|
||||
34
models/keuangan.models.go
Normal file
34
models/keuangan.models.go
Normal 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
|
||||
}
|
||||
89
models/login.models.go
Normal file
89
models/login.models.go
Normal file
@@ -0,0 +1,89 @@
|
||||
package models
|
||||
|
||||
type ResponseApi struct {
|
||||
Status string `json:"status"`
|
||||
Data struct {
|
||||
User struct {
|
||||
MUserID string `json:"M_UserID"`
|
||||
MUserEmail string `json:"M_UserEmail"`
|
||||
MUserUsername string `json:"M_UserUsername"`
|
||||
MUserGroupDashboard string `json:"M_UserGroupDashboard"`
|
||||
MUserDefaultTSampleStationID string `json:"M_UserDefaultT_SampleStationID"`
|
||||
MStaffName string `json:"M_StaffName"`
|
||||
IsCourier string `json:"is_courier"`
|
||||
TimeAutologout string `json:"time_autologout"`
|
||||
IP string `json:"ip"`
|
||||
Agent string `json:"agent"`
|
||||
Version string `json:"version"`
|
||||
LastLogin string `json:"last-login"`
|
||||
} `json:"user"`
|
||||
Token string `json:"token"`
|
||||
Type string `json:"type"`
|
||||
} `json:"data"`
|
||||
Message string `json:"message"`
|
||||
Query string `json:"query"`
|
||||
DbError struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
} `json:"db_error"`
|
||||
}
|
||||
|
||||
type ResponseInvalid struct {
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
Query string `json:"query"`
|
||||
DbError struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
} `json:"db_error"`
|
||||
}
|
||||
|
||||
type ResponseValid struct {
|
||||
Status string `json:"status"`
|
||||
Data struct {
|
||||
User struct {
|
||||
MUserID string `json:"M_UserID"`
|
||||
MUserEmail string `json:"M_UserEmail"`
|
||||
MUserUsername string `json:"M_UserUsername"`
|
||||
MUserGroupDashboard string `json:"M_UserGroupDashboard"`
|
||||
MUserDefaultTSampleStationID string `json:"M_UserDefaultT_SampleStationID"`
|
||||
MStaffName string `json:"M_StaffName"`
|
||||
IsCourier string `json:"is_courier"`
|
||||
TimeAutologout string `json:"time_autologout"`
|
||||
IP string `json:"ip"`
|
||||
Agent string `json:"agent"`
|
||||
Version string `json:"version"`
|
||||
LastLogin string `json:"last-login"`
|
||||
} `json:"user"`
|
||||
Token string `json:"token"`
|
||||
Type string `json:"type"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
Query string `json:"query"`
|
||||
DbError struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
} `json:"db_error"`
|
||||
Data struct {
|
||||
User struct {
|
||||
MUserID string `json:"M_UserID"`
|
||||
MUserEmail string `json:"M_UserEmail"`
|
||||
MUserUsername string `json:"M_UserUsername"`
|
||||
MUserGroupDashboard string `json:"M_UserGroupDashboard"`
|
||||
MUserDefaultTSampleStationID string `json:"M_UserDefaultT_SampleStationID"`
|
||||
MStaffName string `json:"M_StaffName"`
|
||||
IsCourier string `json:"is_courier"`
|
||||
TimeAutologout string `json:"time_autologout"`
|
||||
IP string `json:"ip"`
|
||||
Agent string `json:"agent"`
|
||||
Version string `json:"version"`
|
||||
LastLogin string `json:"last-login"`
|
||||
} `json:"user"`
|
||||
Token string `json:"token"`
|
||||
Type string `json:"type"`
|
||||
} `json:"data"`
|
||||
}
|
||||
27
models/mcudaftarpeserta.models.go
Normal file
27
models/mcudaftarpeserta.models.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package models
|
||||
|
||||
type ModelMcuDaftarPeserta struct {
|
||||
T_OrderHeaderID string `db:"T_OrderHeaderID"`
|
||||
T_OrderHeaderDate string `db:"T_OrderHeaderDate"`
|
||||
T_OrderHeaderLabNumber string `db:"T_OrderHeaderLabNumber"`
|
||||
T_OrderHeaderM_PatientAge string `db:"T_OrderHeaderM_PatientAge"`
|
||||
M_PatientID string `db:"M_PatientID"`
|
||||
M_PatientNoReg string `db:"M_PatientNoReg"`
|
||||
M_PatientName string `db:"M_PatientName"`
|
||||
M_PatientGender string `db:"M_PatientGender"`
|
||||
JenisKelamin string `db:"jenisKelamin"`
|
||||
M_PatientDOB string `db:"M_PatientDOB"`
|
||||
Age string `db:"age"`
|
||||
}
|
||||
|
||||
type ModelMcuPesertaReport struct {
|
||||
So_ResultEntryID int `db:"So_ResultEntryID"`
|
||||
So_ResultEntryT_OrderHeaderID int `db:"So_ResultEntryT_OrderHeaderID"`
|
||||
So_ResultEntryNonlab_TemplateID int `db:"So_ResultEntryNonlab_TemplateID"`
|
||||
So_ResultEntryNonlab_TemplateName string `db:"So_ResultEntryNonlab_TemplateName"`
|
||||
}
|
||||
|
||||
type TabViewReportMcu struct {
|
||||
Name string
|
||||
Link string
|
||||
}
|
||||
7
models/tabkelainanfisik.models.go
Normal file
7
models/tabkelainanfisik.models.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package models
|
||||
|
||||
type KelainanFisikDataModel struct {
|
||||
Test string `db:"test"`
|
||||
Total int `db:"total"`
|
||||
Mcu_KelainanClasification string `db:"Mcu_KelainanClasification"`
|
||||
}
|
||||
11
models/tabkelainanglobal.models.go
Normal file
11
models/tabkelainanglobal.models.go
Normal file
@@ -0,0 +1,11 @@
|
||||
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"`
|
||||
}
|
||||
6
models/tabkelainanlab.models.go
Normal file
6
models/tabkelainanlab.models.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package models
|
||||
|
||||
type KelainanLabModel struct {
|
||||
Mcu_KelainanName string `db:"Mcu_KelainanName"`
|
||||
Total int `db:"total"`
|
||||
}
|
||||
6
models/tabkelainannonlab.models.go
Normal file
6
models/tabkelainannonlab.models.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package models
|
||||
|
||||
type KelNonLabModel struct {
|
||||
Kelainan string `db:"kelainan"`
|
||||
Total int `db:"total"`
|
||||
}
|
||||
16
models/tabkepesertaan.models.go
Normal file
16
models/tabkepesertaan.models.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
type TotalPesertaModel struct {
|
||||
Peserta int `db:"peserta"`
|
||||
Mgm_McuTotalParticipant int `db:"Mgm_McuTotalParticipant"`
|
||||
}
|
||||
|
||||
type GenderPesertaModel struct {
|
||||
M_PatientGender string `db:"M_PatientGender"`
|
||||
Jumlah int `db:"Jumlah"`
|
||||
}
|
||||
|
||||
type UmurPesertaModel struct {
|
||||
Umur string `db:"umur"`
|
||||
Total int `db:"total"`
|
||||
}
|
||||
147
services/corporate/dashboardpic.services.go
Normal file
147
services/corporate/dashboardpic.services.go
Normal file
@@ -0,0 +1,147 @@
|
||||
package corporate_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type DashboardPicServices struct {
|
||||
DashboardPicStore db.AppStore
|
||||
}
|
||||
|
||||
func NewDashboardPicServices(uStore db.AppStore) *DashboardPicServices {
|
||||
return &DashboardPicServices{
|
||||
DashboardPicStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
func (ea *DashboardPicServices) GetEmployeeAnalyticBreadcrumb(title string) (models.BreadCrumbV1, error) {
|
||||
breadcrumb := models.BreadCrumbV1{
|
||||
Title: title,
|
||||
Item: []models.ItemBreadCrumbV1{
|
||||
{
|
||||
Item: "Dashboard",
|
||||
Url: "/corp/dashboard_pic",
|
||||
},
|
||||
{
|
||||
Item: "Employee Health Medical Analytic",
|
||||
Url: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return breadcrumb, nil
|
||||
}
|
||||
|
||||
func (ea *DashboardPicServices) DummyDataTest() ([]models.DashboardPic, error) {
|
||||
employees := []models.DashboardPic{
|
||||
{
|
||||
Mgm_McuID: 1,
|
||||
Mgm_McuLabel: "Employee 1",
|
||||
Mgm_McuFlagRelasiBayarSendiri: "Yes",
|
||||
Mgm_McuBisaTambahPemeriksaan: "No",
|
||||
Mgm_McuCorporateID: 101,
|
||||
Mgm_McuNumber: "EMP001",
|
||||
Mgm_McuNumberNational: "NAT001",
|
||||
Mgm_McuNote: "Lorem ipsum dolor sit amet.",
|
||||
Mgm_McuStartDate: "2024-01-01",
|
||||
Mgm_McuEndDate: "2024-12-31",
|
||||
Mgm_McuIsActive: "Y",
|
||||
},
|
||||
{
|
||||
Mgm_McuID: 2,
|
||||
Mgm_McuLabel: "Employee 2",
|
||||
Mgm_McuFlagRelasiBayarSendiri: "No",
|
||||
Mgm_McuBisaTambahPemeriksaan: "Yes",
|
||||
Mgm_McuCorporateID: 102,
|
||||
Mgm_McuNumber: "EMP002",
|
||||
Mgm_McuNumberNational: "NAT002",
|
||||
Mgm_McuNote: "Lorem ipsum dolor sit amet consectetur.",
|
||||
Mgm_McuStartDate: "2024-02-15",
|
||||
Mgm_McuEndDate: "2024-11-30",
|
||||
Mgm_McuIsActive: "Y",
|
||||
},
|
||||
}
|
||||
|
||||
return employees, nil
|
||||
}
|
||||
|
||||
func (ea *DashboardPicServices) GetCorporateName(userID string) (string, error) {
|
||||
var corpName string
|
||||
|
||||
q := `
|
||||
SELECT
|
||||
c.CorporateName
|
||||
FROM mgm_mcu mm
|
||||
JOIN corporate c ON c.CorporateID = mm.Mgm_McuCorporateID
|
||||
AND CorporateIsActive = 'Y'
|
||||
WHERE mm.Mgm_McuID = ?
|
||||
AND mm.Mgm_McuIsActive = 'Y'
|
||||
`
|
||||
if err := dbx.Handlex.Get(&corpName, q, userID); err != nil {
|
||||
return "PT. ABC", err
|
||||
}
|
||||
|
||||
return corpName, nil
|
||||
}
|
||||
|
||||
func (ea *DashboardPicServices) ListingDashboardPic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.DashboardPic, int, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret []models.DashboardPic
|
||||
var totalData int
|
||||
|
||||
if len(startdate) == 0 {
|
||||
startdate = "1900-01-01"
|
||||
}
|
||||
if len(enddate) == 0 {
|
||||
enddate = "9999-12-12"
|
||||
}
|
||||
|
||||
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 = `
|
||||
SELECT
|
||||
Mgm_McuID,
|
||||
Mgm_McuLabel,
|
||||
Mgm_McuFlagRelasiBayarSendiri,
|
||||
Mgm_McuBisaTambahPemeriksaan,
|
||||
Mgm_McuCorporateID,
|
||||
Mgm_McuNumber,
|
||||
Mgm_McuNumberNational,
|
||||
Mgm_McuNote,
|
||||
DATE_FORMAT(Mgm_McuStartDate, '%d-%m-%Y') AS Mgm_McuStartDate,
|
||||
DATE_FORMAT(Mgm_McuEndDate, '%d-%m-%Y') AS Mgm_McuEndDate,
|
||||
Mgm_McuIsActive
|
||||
FROM mgm_mcu
|
||||
WHERE 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 {
|
||||
return nil, 0, fmt.Errorf("error query get data: %v", err)
|
||||
}
|
||||
logger.Info("Resp", zap.Any("Respsone", ret))
|
||||
|
||||
totalPage := int(math.Ceil(float64(totalData) / float64(rowperpage)))
|
||||
return ret, totalPage, nil
|
||||
}
|
||||
65
services/corporate/mcudetail.services.go
Normal file
65
services/corporate/mcudetail.services.go
Normal file
@@ -0,0 +1,65 @@
|
||||
package corporate_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
)
|
||||
|
||||
type McuDetailServices struct {
|
||||
McuDetailStore db.AppStore
|
||||
}
|
||||
|
||||
func NewMcuDetailServices(uStore db.AppStore) *McuDetailServices {
|
||||
return &McuDetailServices{
|
||||
McuDetailStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
func (mcud *McuDetailServices) GetBreadcrumb(id string) (models.BreadCrumbV1, error) {
|
||||
var mcu models.DashboardPic
|
||||
|
||||
breadcrumb := models.BreadCrumbV1{
|
||||
Title: "",
|
||||
Item: []models.ItemBreadCrumbV1{
|
||||
{
|
||||
Item: "Dashboard",
|
||||
Url: "/corp/dashboard_pic",
|
||||
},
|
||||
{
|
||||
Item: "Employee Health Medical Analytic",
|
||||
Url: "/corp/dashboard_pic",
|
||||
},
|
||||
{
|
||||
Item: "",
|
||||
Url: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
q := `
|
||||
SELECT
|
||||
Mgm_McuID,
|
||||
Mgm_McuLabel,
|
||||
Mgm_McuFlagRelasiBayarSendiri,
|
||||
Mgm_McuBisaTambahPemeriksaan,
|
||||
Mgm_McuCorporateID,
|
||||
Mgm_McuNumber,
|
||||
Mgm_McuNumberNational,
|
||||
Mgm_McuNote,
|
||||
DATE_FORMAT(Mgm_McuStartDate, '%d-%m-%Y') AS Mgm_McuStartDate,
|
||||
DATE_FORMAT(Mgm_McuEndDate, '%d-%m-%Y') AS Mgm_McuEndDate,
|
||||
Mgm_McuIsActive
|
||||
FROM mgm_mcu
|
||||
WHERE Mgm_McuIsActive = 'Y'
|
||||
AND Mgm_McuID = ?
|
||||
`
|
||||
if err := dbx.Handlex.Get(&mcu, q, id); err != nil {
|
||||
return breadcrumb, err
|
||||
}
|
||||
|
||||
breadcrumb.Title = mcu.Mgm_McuLabel
|
||||
breadcrumb.Item[2].Item = mcu.Mgm_McuLabel
|
||||
|
||||
return breadcrumb, nil
|
||||
}
|
||||
146
services/corporate/mcudetail/tabdaftarpeserta.services.go
Normal file
146
services/corporate/mcudetail/tabdaftarpeserta.services.go
Normal file
@@ -0,0 +1,146 @@
|
||||
package mcu_corporate_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type TabDaftarPesertaServices struct {
|
||||
TabDaftarPesertaStore db.AppStore
|
||||
}
|
||||
|
||||
func NewTabDaftarPesertaServices(uStore db.AppStore) *TabDaftarPesertaServices {
|
||||
return &TabDaftarPesertaServices{
|
||||
TabDaftarPesertaStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
func (tdps *TabDaftarPesertaServices) GetListMcuDaftarPeserta(id string, currentpage int, rowperpage int) ([]models.ModelMcuDaftarPeserta, int, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var listDaftarPeserta []models.ModelMcuDaftarPeserta
|
||||
var totalData int
|
||||
offset := (currentpage - 1) * rowperpage
|
||||
|
||||
querytotal := `SELECT COUNT(*)
|
||||
FROM t_orderheader
|
||||
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID
|
||||
AND M_PatientIsActive = 'Y'
|
||||
WHERE T_OrderHeaderIsActive = 'Y' AND T_OrderHeaderMgm_McuID = ?`
|
||||
|
||||
if err := dbx.Handlex.Get(&totalData, querytotal, id); err != nil {
|
||||
return nil, 0, fmt.Errorf("error querying database: %v", err)
|
||||
}
|
||||
|
||||
query := `SELECT T_OrderHeaderID,
|
||||
T_OrderHeaderDate,
|
||||
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,
|
||||
M_PatientDOB,
|
||||
FLOOR(DATEDIFF(CURDATE(), M_PatientDOB)/ 365.25) AS age
|
||||
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 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)))
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("GET DATA PESERTA",
|
||||
zap.Any("id", id),
|
||||
zap.Any("total data", totalData),
|
||||
zap.Any("peserta", listDaftarPeserta),
|
||||
)
|
||||
|
||||
return listDaftarPeserta, totalPage, nil
|
||||
}
|
||||
|
||||
func (tdps *TabDaftarPesertaServices) GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error) {
|
||||
var ret []models.TabViewReportMcu
|
||||
var data []models.ModelMcuPesertaReport
|
||||
var totalData int
|
||||
|
||||
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 = `
|
||||
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
|
||||
`
|
||||
if err := dbx.Handlex.Select(&data, q, 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"})
|
||||
|
||||
// Non-lab
|
||||
for _, n := range data {
|
||||
var link models.TabViewReportMcu
|
||||
|
||||
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 "Audiometri":
|
||||
link.Name = "Audiometri"
|
||||
link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_audiometri.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&username=adhi&tm=1717726294764"
|
||||
case "Spirometri":
|
||||
link.Name = "Spirometri"
|
||||
link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_spirometri.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)
|
||||
}
|
||||
|
||||
ret = append(ret, models.TabViewReportMcu{Name: "Resume Individu", Link: "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_resume.rptdesign&__format=pdf&PID=" + orderheaderID + "&username=adhi&tm=1717726294764"})
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
207
services/corporate/mcudetail/tabkelainanfisik.services.go
Normal file
207
services/corporate/mcudetail/tabkelainanfisik.services.go
Normal file
@@ -0,0 +1,207 @@
|
||||
package mcu_corporate_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"fmt"
|
||||
"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) GetKelainanFisikBMI(mcuID string) (models.Piechart, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var option models.Piechart
|
||||
var data []models.KelainanFisikDataModel
|
||||
|
||||
q := `
|
||||
SELECT
|
||||
CASE
|
||||
WHEN Mgm_HeaderIsNormal = "Y" THEN "Normal"
|
||||
WHEN Mgm_HeaderIsNormal = "N" THEN Mcu_KelainanName
|
||||
ELSE "Tidak diperiksa" END AS test,
|
||||
COUNT(Mgm_HeaderT_OrderHeaderID) AS total,
|
||||
IFNULL(Mcu_KelainanClasification, "") AS Mcu_KelainanClasification
|
||||
FROM mgm_header
|
||||
LEFT JOIN mgm_detail ON Mgm_DetailMgm_HeaderID = Mgm_HeaderID AND Mgm_DetailIsActive = 'Y'
|
||||
LEFT JOIN mcu_kelainan ON Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
LEFT 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_HeaderNat_TestCode = 'STATUS GIZI'
|
||||
GROUP BY
|
||||
CASE
|
||||
WHEN Mgm_HeaderIsNormal = "Y" THEN "Normal"
|
||||
WHEN Mgm_HeaderIsNormal = "N" THEN Mcu_KelainanName ELSE
|
||||
"Tidak diperiksa" END
|
||||
ORDER BY COUNT(Mgm_HeaderT_OrderHeaderID) DESC
|
||||
`
|
||||
|
||||
if err := dbx.Handlex.Select(&data, q, 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
|
||||
CASE
|
||||
WHEN Mgm_HeaderIsNormal = "Y" THEN "Normal"
|
||||
WHEN Mgm_HeaderIsNormal = "N" THEN Mcu_KelainanName
|
||||
ELSE "Tidak diperiksa" END AS test,
|
||||
COUNT(Mgm_HeaderT_OrderHeaderID) AS total,
|
||||
IFNULL(Mcu_KelainanClasification, "") AS Mcu_KelainanClasification
|
||||
FROM mgm_header
|
||||
LEFT JOIN mgm_detail ON Mgm_DetailMgm_HeaderID = Mgm_HeaderID AND Mgm_DetailIsActive = 'Y'
|
||||
LEFT JOIN mcu_kelainan ON Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
LEFT 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_HeaderNat_TestCode = 'TANDA VITAL'
|
||||
GROUP BY
|
||||
CASE
|
||||
WHEN Mgm_HeaderIsNormal = "Y" THEN "Normal"
|
||||
WHEN Mgm_HeaderIsNormal = "N" THEN Mcu_KelainanName
|
||||
ELSE "Tidak diperiksa" END
|
||||
ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC
|
||||
`
|
||||
if err := dbx.Handlex.Select(&data, q, 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
|
||||
}
|
||||
201
services/corporate/mcudetail/tabkelainanglobal.services.go
Normal file
201
services/corporate/mcudetail/tabkelainanglobal.services.go
Normal file
@@ -0,0 +1,201 @@
|
||||
package mcu_corporate_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"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) {
|
||||
option := models.Barchart{}
|
||||
option.Title = struct {
|
||||
Text string "json:\"text\""
|
||||
}{title}
|
||||
option.Dataset = data
|
||||
option.Grid.ContainLabel = true
|
||||
option.XAxis.Name = "amount"
|
||||
option.YAxis.Type = "category"
|
||||
option.VisualMap.Orient = "horizontal"
|
||||
option.VisualMap.Left = "center"
|
||||
option.VisualMap.Min = 10
|
||||
option.VisualMap.Max = 100
|
||||
option.VisualMap.Show = false
|
||||
option.VisualMap.Dimension = 0
|
||||
option.VisualMap.InRange.Color = []string{"#42aaf5", "#00eaf2", "#035bff"}
|
||||
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: "score",
|
||||
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",
|
||||
},
|
||||
}
|
||||
|
||||
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 _, 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.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
|
||||
}
|
||||
448
services/corporate/mcudetail/tabkelainanlab.services.go
Normal file
448
services/corporate/mcudetail/tabkelainanlab.services.go
Normal file
@@ -0,0 +1,448 @@
|
||||
package mcu_corporate_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"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) {
|
||||
option := models.Barchart{}
|
||||
|
||||
option.Title = struct {
|
||||
Text string "json:\"text\""
|
||||
}{title}
|
||||
option.Dataset = data
|
||||
option.Grid.ContainLabel = true
|
||||
option.XAxis.Name = "amount"
|
||||
option.YAxis.Type = "category"
|
||||
option.VisualMap.Orient = "horizontal"
|
||||
option.VisualMap.Left = "center"
|
||||
option.VisualMap.Min = 1
|
||||
option.VisualMap.Max = 100
|
||||
option.VisualMap.Show = false
|
||||
option.VisualMap.Dimension = 0
|
||||
option.VisualMap.InRange.Color = []string{"#42aaf5", "#00eaf2", "#035bff"}
|
||||
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: "score",
|
||||
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",
|
||||
},
|
||||
}
|
||||
|
||||
return option, nil
|
||||
}
|
||||
|
||||
func (tkl *TabKelainanLabServices) ConfBarchartVertical(title string, data []models.KelainanLabModel) (models.BarchartV2, error) {
|
||||
|
||||
chartData := models.BarDataset{
|
||||
Source: [][]interface{}{
|
||||
{"score", "amount", "product"},
|
||||
},
|
||||
}
|
||||
|
||||
cnt := len(data)
|
||||
for idx, d := range data {
|
||||
chartData.Source = append(chartData.Source, []interface{}{
|
||||
idx, d.Total, d.Mcu_KelainanName,
|
||||
})
|
||||
}
|
||||
|
||||
option := models.BarchartV2{
|
||||
Title: struct {
|
||||
Text string "json:\"text\""
|
||||
}{title},
|
||||
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{"#42aaf5", "#00eaf2", "#035bff"},
|
||||
},
|
||||
},
|
||||
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",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
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_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 = 'L'
|
||||
AND Mgm_HeaderIsNormal = 'N'
|
||||
GROUP BY Mcu_KelainanID ORDER BY COUNT(Mgm_HeaderT_OrderHeaderID) DESC
|
||||
`
|
||||
|
||||
if err := dbx.Handlex.Select(&data, q, mcuID); err != nil {
|
||||
return option, fmt.Errorf("error get total presentase fisik %v", err)
|
||||
}
|
||||
defer logger.Sync()
|
||||
logger.Info("resp data", zap.Any("data", data))
|
||||
|
||||
title := "Data Presentase Kelainan Lab"
|
||||
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 := 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_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 = 'L'
|
||||
AND Mgm_HeaderIsNormal = 'N'
|
||||
AND Mcu_KelainanGroupID = 14
|
||||
GROUP BY Mcu_KelainanID
|
||||
ORDER BY COUNT(Mgm_HeaderT_OrderHeaderID) 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_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 = 'L'
|
||||
AND Mgm_HeaderIsNormal = 'N'
|
||||
AND Mcu_KelainanGroupID = 15
|
||||
GROUP BY Mcu_KelainanID
|
||||
ORDER BY COUNT(Mgm_HeaderT_OrderHeaderID) 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_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 = 'L'
|
||||
AND Mgm_HeaderIsNormal = 'N'
|
||||
AND Mcu_KelainanGroupID = 16
|
||||
GROUP BY Mcu_KelainanID
|
||||
ORDER BY COUNT(Mgm_HeaderT_OrderHeaderID) 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
|
||||
IFNULL(Mcu_KelainanName,'Normal') AS Mcu_KelainanName,
|
||||
COUNT(Mgm_HeaderT_OrderHeaderID) AS total
|
||||
FROM mgm_header
|
||||
LEFT JOIN mgm_detail ON Mgm_DetailMgm_HeaderID = Mgm_HeaderID AND Mgm_DetailIsActive = 'Y'
|
||||
LEFT JOIN mcu_kelainan ON Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
LEFT JOIN mcu_kelainangroup ON Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
WHERE Mgm_HeaderIsActive = 'Y' AND Mgm_HeaderNat_TestCode IN ( '10520300','10520400')
|
||||
AND Mgm_HeaderMgm_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 IFNULL(Mcu_KelainanName,'Normal') AS Mcu_KelainanName,
|
||||
COUNT(Mgm_HeaderT_OrderHeaderID) AS total
|
||||
FROM mgm_header
|
||||
LEFT JOIN mgm_detail ON Mgm_DetailMgm_HeaderID = Mgm_HeaderID AND Mgm_DetailIsActive = 'Y'
|
||||
LEFT JOIN mcu_kelainan ON Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
LEFT JOIN mcu_kelainangroup ON Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
WHERE Mgm_HeaderIsActive = 'Y' AND Mgm_HeaderNat_TestCode = 10540200
|
||||
AND Mgm_HeaderMgm_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
|
||||
}
|
||||
309
services/corporate/mcudetail/tabkelainannonlab.services.go
Normal file
309
services/corporate/mcudetail/tabkelainannonlab.services.go
Normal file
@@ -0,0 +1,309 @@
|
||||
package mcu_corporate_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"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) {
|
||||
option := models.Barchart{}
|
||||
option.Title = struct {
|
||||
Text string "json:\"text\""
|
||||
}{title}
|
||||
option.Dataset = data
|
||||
option.Grid.ContainLabel = true
|
||||
option.XAxis.Name = "amount"
|
||||
option.YAxis.Type = "category"
|
||||
option.VisualMap.Orient = "horizontal"
|
||||
option.VisualMap.Left = "center"
|
||||
option.VisualMap.Min = 10
|
||||
option.VisualMap.Max = 100
|
||||
option.VisualMap.Show = false
|
||||
option.VisualMap.Dimension = 0
|
||||
option.VisualMap.InRange.Color = []string{"#42aaf5", "#00eaf2", "#035bff"}
|
||||
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",
|
||||
},
|
||||
}
|
||||
|
||||
return option, nil
|
||||
}
|
||||
|
||||
func (tknl *TabKelainanNonLabServices) ConfBarchartVertical(title string, data []models.KelNonLabModel) (models.BarchartV2, error) {
|
||||
chartData := models.BarDataset{
|
||||
Source: [][]interface{}{
|
||||
{"score", "amount", "product"},
|
||||
},
|
||||
}
|
||||
|
||||
cnt := len(data)
|
||||
for idx, d := range data {
|
||||
chartData.Source = append(chartData.Source, []interface{}{
|
||||
idx, d.Total, d.Kelainan,
|
||||
})
|
||||
}
|
||||
|
||||
option := models.BarchartV2{
|
||||
Title: struct {
|
||||
Text string "json:\"text\""
|
||||
}{title},
|
||||
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{"#42aaf5", "#00eaf2", "#035bff"},
|
||||
},
|
||||
},
|
||||
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",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
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 concat(Nat_TestName,"/",Mcu_KelainanName) AS kelainan,
|
||||
COUNT(Mgm_HeaderT_OrderHeaderID) AS total
|
||||
FROM mgm_header
|
||||
LEFT JOIN mgm_detail ON Mgm_DetailMgm_HeaderID = Mgm_HeaderID AND Mgm_DetailIsActive = 'Y'
|
||||
LEFT JOIN mcu_kelainan ON Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
LEFT JOIN mcu_kelainangroup ON Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
LEFT JOIN nat_test ON Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
WHERE Mgm_HeaderIsActive = 'Y' AND Mgm_HeaderMgm_McuID = ?
|
||||
AND Mgm_HeaderType = 'NL'
|
||||
AND Mgm_HeaderIsNormal = 'N'
|
||||
GROUP BY Mcu_KelainanID
|
||||
ORDER BY COUNT(Mgm_HeaderT_OrderHeaderID) DESC
|
||||
`
|
||||
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 := "Data Presentase Kelainan Non Lab"
|
||||
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.Kelainan, 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
|
||||
IFNULL(Mcu_KelainanName,'Normal') AS kelainan,
|
||||
COUNT(Mgm_HeaderT_OrderHeaderID) AS total
|
||||
FROM mgm_header
|
||||
LEFT JOIN mgm_detail ON Mgm_DetailMgm_HeaderID = Mgm_HeaderID AND Mgm_DetailIsActive = 'Y'
|
||||
LEFT JOIN mcu_kelainan ON Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
LEFT JOIN mcu_kelainangroup ON Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
WHERE Mgm_HeaderIsActive = 'Y' AND Mgm_HeaderNat_TestCode = 30150100
|
||||
AND Mgm_HeaderIsNormal = 'N' AND Mgm_HeaderMgm_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 data kelainan global mcu %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
|
||||
}
|
||||
250
services/corporate/mcudetail/tabkepesertaan.services.go
Normal file
250
services/corporate/mcudetail/tabkepesertaan.services.go
Normal file
@@ -0,0 +1,250 @@
|
||||
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(mo.Mcu_OrderID) AS peserta,
|
||||
mm.Mgm_McuTotalParticipant
|
||||
FROM mgm_mcu mm
|
||||
LEFT JOIN t_orderheader toh ON toh.T_OrderHeaderMgm_McuID = mm.Mgm_McuID
|
||||
AND T_OrderHeaderIsActive = 'Y'
|
||||
LEFT JOIN mcu_order mo ON mo.Mcu_OrderT_OrderHeaderID = toh.T_OrderHeaderID
|
||||
WHERE mm.Mgm_McuID = ? AND mm.Mgm_McuIsActive = '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.Mgm_McuTotalParticipant)
|
||||
chartData := []models.SeriesData{}
|
||||
|
||||
if data.Mgm_McuTotalParticipant == 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.Mgm_McuTotalParticipant - data.Peserta,
|
||||
Name: "Belum MCU: " + strconv.Itoa(data.Mgm_McuTotalParticipant-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
|
||||
CASE
|
||||
WHEN M_PatientGender = 'male' THEN 'Laki-laki'
|
||||
WHEN M_PatientGender = 'female' THEN 'Perempuan'
|
||||
ELSE M_PatientGender
|
||||
END AS M_PatientGender,
|
||||
COUNT(*) AS Jumlah
|
||||
FROM mcu_order
|
||||
JOIN t_orderheader ON Mcu_OrderT_OrderHeaderID = T_OrderHeaderID
|
||||
AND T_OrderHeaderIsActive = 'Y'
|
||||
LEFT JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID
|
||||
AND M_PatientIsActive = 'Y'
|
||||
WHERE Mcu_OrderMgm_McuID = ?
|
||||
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(Mcu_OrderT_OrderHeaderID) AS total
|
||||
FROM mcu_order
|
||||
JOIN t_orderheader ON Mcu_OrderT_OrderHeaderID = T_OrderHeaderID AND T_OrderHeaderIsActive = 'Y'
|
||||
LEFT JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive = 'Y'
|
||||
WHERE Mcu_OrderMgm_McuID = ?
|
||||
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
|
||||
}
|
||||
232
services/corporate/mcudetail/tabkesimpulan.services.go
Normal file
232
services/corporate/mcudetail/tabkesimpulan.services.go
Normal file
@@ -0,0 +1,232 @@
|
||||
package mcu_corporate_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"fmt"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type TabKesimpulanServices struct {
|
||||
TabKesimpulanStore db.AppStore
|
||||
}
|
||||
|
||||
func NewTabKesimpulanServices(uStore db.AppStore) *TabKesimpulanServices {
|
||||
return &TabKesimpulanServices{
|
||||
TabKesimpulanStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
func (tks *TabKesimpulanServices) GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var listLab []models.ModelKesimpulanLab
|
||||
var dataTot []models.ModelKesimpulanLab
|
||||
|
||||
qryTot := `select '' as nomor,
|
||||
'' as Test, sum(total) as total
|
||||
from(
|
||||
select count(*) as total
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'L'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ) x`
|
||||
|
||||
err := dbx.Handlex.Select(&dataTot, qryTot, id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get total",
|
||||
zap.Any("id", id),
|
||||
zap.Any("total data", dataTot),
|
||||
)
|
||||
// return dataTot, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
// Extracting the Total value
|
||||
var totalLab string
|
||||
if len(dataTot) > 0 {
|
||||
totalLab = dataTot[0].Total
|
||||
}
|
||||
|
||||
logger.Info("data",
|
||||
zap.Any("id", id),
|
||||
zap.Any("cek total", totalLab),
|
||||
)
|
||||
query := `SELECT ROW_NUMBER() OVER (ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC) AS nomor,
|
||||
ifnull(Nat_TestName ,Mcu_KelainanGroupName) as Test,
|
||||
cast(count(Mgm_HeaderT_OrderHeaderID)/?*100 as decimal(2,0)) as total
|
||||
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'L'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC
|
||||
LIMIT 3`
|
||||
|
||||
err = dbx.Handlex.Select(&listLab, query, totalLab, id)
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get data lab",
|
||||
zap.Any("id", id),
|
||||
zap.Any("list data", listLab),
|
||||
)
|
||||
return listLab, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
logger.Info("data",
|
||||
zap.Any("id", id),
|
||||
zap.Any("cekkkk", listLab),
|
||||
)
|
||||
return listLab, nil
|
||||
}
|
||||
|
||||
func (tks *TabKesimpulanServices) GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var listNonLab []models.ModelKesimpulanLab
|
||||
var dataTot []models.ModelKesimpulanLab
|
||||
|
||||
qryTot := `select '' as nomor,
|
||||
'' as Test, sum(total) as total
|
||||
from(
|
||||
select count(*) as total
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'NL'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ) x`
|
||||
|
||||
err := dbx.Handlex.Select(&dataTot, qryTot, id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get total",
|
||||
zap.Any("id", id),
|
||||
zap.Any("total data", dataTot),
|
||||
)
|
||||
// return dataTot, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
// Extracting the Total value
|
||||
var totalLab string
|
||||
if len(dataTot) > 0 {
|
||||
totalLab = dataTot[0].Total
|
||||
}
|
||||
|
||||
logger.Info("data",
|
||||
zap.Any("id", id),
|
||||
zap.Any("cek total", totalLab),
|
||||
)
|
||||
query := `SELECT ROW_NUMBER() OVER (ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC) AS nomor,
|
||||
ifnull(Nat_TestName ,Mcu_KelainanGroupName) as Test,
|
||||
cast(count(Mgm_HeaderT_OrderHeaderID)/?*100 as decimal(2,0)) as total
|
||||
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'NL'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC
|
||||
LIMIT 3`
|
||||
|
||||
err = dbx.Handlex.Select(&listNonLab, query, totalLab, id)
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get data NON lab",
|
||||
zap.Any("id", id),
|
||||
zap.Any("list data", listNonLab),
|
||||
)
|
||||
return listNonLab, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
logger.Info("data",
|
||||
zap.Any("id", id),
|
||||
zap.Any("cekkkk", listNonLab),
|
||||
)
|
||||
return listNonLab, nil
|
||||
}
|
||||
|
||||
func (tks *TabKesimpulanServices) GetListKesimpulanFisik(id string) ([]models.ModelKesimpulanLab, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var listFisik []models.ModelKesimpulanLab
|
||||
var dataTot []models.ModelKesimpulanLab
|
||||
|
||||
qryTot := `select '' as nomor,
|
||||
'' as Test, sum(total) as total
|
||||
from(
|
||||
select count(*) as total
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'F'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ) x`
|
||||
|
||||
err := dbx.Handlex.Select(&dataTot, qryTot, id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get total",
|
||||
zap.Any("id", id),
|
||||
zap.Any("total data", dataTot),
|
||||
)
|
||||
// return dataTot, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
// Extracting the Total value
|
||||
var totalFisik string
|
||||
if len(dataTot) > 0 {
|
||||
totalFisik = dataTot[0].Total
|
||||
}
|
||||
|
||||
logger.Info("data",
|
||||
zap.Any("id", id),
|
||||
zap.Any("cek total", totalFisik),
|
||||
)
|
||||
query := `SELECT ROW_NUMBER() OVER (ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC) AS nomor,
|
||||
ifnull(Nat_TestName ,Mcu_KelainanGroupName) as Test,
|
||||
cast(count(Mgm_HeaderT_OrderHeaderID)/?*100 as decimal(2,0)) as total
|
||||
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'F'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC
|
||||
LIMIT 3`
|
||||
|
||||
err = dbx.Handlex.Select(&listFisik, query, totalFisik, id)
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get data fisik",
|
||||
zap.Any("id", id),
|
||||
zap.Any("list data", listFisik),
|
||||
)
|
||||
return listFisik, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
return listFisik, nil
|
||||
}
|
||||
198
services/corporate/mcudetail/tabkeuangan.services.go
Normal file
198
services/corporate/mcudetail/tabkeuangan.services.go
Normal 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
|
||||
}
|
||||
@@ -1,15 +1,221 @@
|
||||
package corporate_services
|
||||
|
||||
import "cpone/db"
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
|
||||
type ServicesPatient struct {
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type PatientServices struct {
|
||||
PatientStore db.AppStore
|
||||
}
|
||||
|
||||
func NewServicesPatient(uStore db.AppStore) *ServicesPatient {
|
||||
func NewPatientServices(uStore db.AppStore) *PatientServices {
|
||||
|
||||
return &ServicesPatient{
|
||||
return &PatientServices{
|
||||
|
||||
PatientStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
func (sp *PatientServices) GetPatientData(email string) (string, error) {
|
||||
var ret string
|
||||
prmEmail := "%" + email + "%"
|
||||
q := `
|
||||
SELECT
|
||||
M_PatientName
|
||||
FROM m_patient
|
||||
WHERE M_PatientEmail LIKE ?
|
||||
AND M_PatientIsActive = 'Y'
|
||||
`
|
||||
if err := dbx.Handlex.Get(&ret, q, prmEmail); err != nil {
|
||||
return ret, err
|
||||
}
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
func (sp *PatientServices) GetDashboardPatientBreadcrumb(title string) (models.BreadCrumbV1, error) {
|
||||
breadcrumb := models.BreadCrumbV1{
|
||||
Title: title,
|
||||
Item: []models.ItemBreadCrumbV1{
|
||||
{
|
||||
Item: "Dashboard",
|
||||
Url: "/corp/dashboard_pat",
|
||||
},
|
||||
{
|
||||
Item: "PT. ABC",
|
||||
Url: "",
|
||||
},
|
||||
{
|
||||
Item: title,
|
||||
Url: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
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
|
||||
var totalData int
|
||||
|
||||
prmEmail := "%" + email + "%"
|
||||
offset := (currentpage - 1) * rowperpage
|
||||
q := `
|
||||
SELECT COUNT(*)
|
||||
FROM m_patient mp
|
||||
JOIN t_orderheader toh ON toh.T_OrderHeaderM_PatientID = mp.M_PatientID AND toh.T_OrderHeaderIsActive = 'Y'
|
||||
WHERE mp.M_PatientEmail LIKE ?
|
||||
AND mp.M_PatientIsActive = 'Y'
|
||||
`
|
||||
if err := dbx.Handlex.Get(&totalData, q, prmEmail); err != nil {
|
||||
return nil, 0, fmt.Errorf("error query get total data: %v", err)
|
||||
}
|
||||
|
||||
q = `
|
||||
SELECT
|
||||
toh.T_OrderHeaderID,
|
||||
toh.T_OrderHeaderDate,
|
||||
toh.T_OrderHeaderLabNumber,
|
||||
toh.T_OrderHeaderM_PatientID,
|
||||
toh.T_OrderHeaderCorporateID,
|
||||
toh.T_OrderHeaderMgm_McuID,
|
||||
toh.T_OrderHeaderIsActive
|
||||
FROM m_patient mp
|
||||
JOIN t_orderheader toh ON toh.T_OrderHeaderM_PatientID = mp.M_PatientID AND toh.T_OrderHeaderIsActive = 'Y'
|
||||
WHERE mp.M_PatientEmail LIKE ?
|
||||
AND mp.M_PatientIsActive = 'Y'
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
if err := dbx.Handlex.Select(&ret, q, prmEmail, rowperpage, offset); err != nil {
|
||||
return nil, 0, fmt.Errorf("error query get list 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) GetReportMcu(orderheaderID string) ([]models.TabViewReportMcu, error) {
|
||||
var ret []models.TabViewReportMcu
|
||||
var data []models.ModelMcuPesertaReport
|
||||
var totalData int
|
||||
|
||||
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 = `
|
||||
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
|
||||
`
|
||||
if err := dbx.Handlex.Select(&data, q, 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"})
|
||||
|
||||
// Non-lab
|
||||
for _, n := range data {
|
||||
var link models.TabViewReportMcu
|
||||
|
||||
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 "Audiometri":
|
||||
link.Name = "Audiometri"
|
||||
link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_audiometri.rptdesign&__format=pdf&PID=" + strconv.Itoa(n.So_ResultEntryID) + "&username=adhi&tm=1717726294764"
|
||||
case "Spirometri":
|
||||
link.Name = "Spirometri"
|
||||
link.Link = "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/lab/rpt_hasil_so_spirometri.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)
|
||||
}
|
||||
ret = append(ret, models.TabViewReportMcu{Name: "Resume Individu", Link: "https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_resume.rptdesign&__format=pdf&PID=" + orderheaderID + "&username=adhi&tm=1717726294764"})
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
37
services/dev/detailmcu.services.go
Normal file
37
services/dev/detailmcu.services.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package dev_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
type DetailMcuServices struct {
|
||||
DetailMcuStore db.AppStore
|
||||
}
|
||||
|
||||
func NewDetailMcuServices(uStore db.AppStore) *DetailMcuServices {
|
||||
return &DetailMcuServices{
|
||||
DetailMcuStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
func (dmcu *DetailMcuServices) GetBreadcrumb(title string) (models.BreadCrumbV1, error) {
|
||||
breadcrumb := models.BreadCrumbV1{
|
||||
Title: title,
|
||||
Item: []models.ItemBreadCrumbV1{
|
||||
{
|
||||
Item: "Dashboard",
|
||||
Url: "/dev/dashboard",
|
||||
},
|
||||
{
|
||||
Item: "Employee Health Medical Analytic",
|
||||
Url: "/dev/employeeanalytic/",
|
||||
},
|
||||
{
|
||||
Item: title,
|
||||
Url: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
return breadcrumb, nil
|
||||
}
|
||||
@@ -38,8 +38,8 @@ func (ea *EmployeeAnalyticServices) GetEmployeeAnalyticBreadcrumb(title string)
|
||||
return breadcrumb, nil
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticServices) DummyDataTest() ([]models.EmployeeAnalytic, error) {
|
||||
employees := []models.EmployeeAnalytic{
|
||||
func (ea *EmployeeAnalyticServices) DummyDataTest() ([]models.DashboardPic, error) {
|
||||
employees := []models.DashboardPic{
|
||||
{
|
||||
Mgm_McuID: 1,
|
||||
Mgm_McuLabel: "Employee 1",
|
||||
@@ -71,9 +71,9 @@ func (ea *EmployeeAnalyticServices) DummyDataTest() ([]models.EmployeeAnalytic,
|
||||
return employees, nil
|
||||
}
|
||||
|
||||
func (ea *EmployeeAnalyticServices) ListingEmployeeAnalytic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.EmployeeAnalytic, int, error) {
|
||||
func (ea *EmployeeAnalyticServices) ListingEmployeeAnalytic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.DashboardPic, int, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var ret []models.EmployeeAnalytic
|
||||
var ret []models.DashboardPic
|
||||
var totalData int
|
||||
|
||||
if len(startdate) == 0 {
|
||||
|
||||
232
services/dev/kesimpulan.services.go
Normal file
232
services/dev/kesimpulan.services.go
Normal file
@@ -0,0 +1,232 @@
|
||||
package dev_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"fmt"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func NewServicesKesimpulan(uStore db.AppStore) *KesimpulanServices {
|
||||
return &KesimpulanServices{
|
||||
KesimpulanStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
type KesimpulanServices struct {
|
||||
KesimpulanStore db.AppStore
|
||||
}
|
||||
|
||||
func (k *KesimpulanServices) GetListKesimpulanLab(id string) ([]models.ModelKesimpulanLab, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var listLab []models.ModelKesimpulanLab
|
||||
var dataTot []models.ModelKesimpulanLab
|
||||
|
||||
qryTot := `select '' as nomor,
|
||||
'' as Test, sum(total) as total
|
||||
from(
|
||||
select count(*) as total
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'L'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ) x`
|
||||
|
||||
err := dbx.Handlex.Select(&dataTot, qryTot, id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get total",
|
||||
zap.Any("id", id),
|
||||
zap.Any("total data", dataTot),
|
||||
)
|
||||
// return dataTot, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
// Extracting the Total value
|
||||
var totalLab string
|
||||
if len(dataTot) > 0 {
|
||||
totalLab = dataTot[0].Total
|
||||
}
|
||||
|
||||
logger.Info("data",
|
||||
zap.Any("id", id),
|
||||
zap.Any("cek total", totalLab),
|
||||
)
|
||||
query := `SELECT ROW_NUMBER() OVER (ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC) AS nomor,
|
||||
ifnull(Nat_TestName ,Mcu_KelainanGroupName) as Test,
|
||||
cast(count(Mgm_HeaderT_OrderHeaderID)/?*100 as decimal(2,0)) as total
|
||||
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'L'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC
|
||||
LIMIT 3`
|
||||
|
||||
err = dbx.Handlex.Select(&listLab, query, totalLab, id)
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get data lab",
|
||||
zap.Any("id", id),
|
||||
zap.Any("list data", listLab),
|
||||
)
|
||||
return listLab, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
logger.Info("data",
|
||||
zap.Any("id", id),
|
||||
zap.Any("cekkkk", listLab),
|
||||
)
|
||||
return listLab, nil
|
||||
}
|
||||
|
||||
func (k *KesimpulanServices) GetListKesimpulanNonLab(id string) ([]models.ModelKesimpulanLab, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var listNonLab []models.ModelKesimpulanLab
|
||||
var dataTot []models.ModelKesimpulanLab
|
||||
|
||||
qryTot := `select '' as nomor,
|
||||
'' as Test, sum(total) as total
|
||||
from(
|
||||
select count(*) as total
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'NL'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ) x`
|
||||
|
||||
err := dbx.Handlex.Select(&dataTot, qryTot, id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get total",
|
||||
zap.Any("id", id),
|
||||
zap.Any("total data", dataTot),
|
||||
)
|
||||
// return dataTot, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
// Extracting the Total value
|
||||
var totalLab string
|
||||
if len(dataTot) > 0 {
|
||||
totalLab = dataTot[0].Total
|
||||
}
|
||||
|
||||
logger.Info("data",
|
||||
zap.Any("id", id),
|
||||
zap.Any("cek total", totalLab),
|
||||
)
|
||||
query := `SELECT ROW_NUMBER() OVER (ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC) AS nomor,
|
||||
ifnull(Nat_TestName ,Mcu_KelainanGroupName) as Test,
|
||||
cast(count(Mgm_HeaderT_OrderHeaderID)/?*100 as decimal(2,0)) as total
|
||||
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'NL'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC
|
||||
LIMIT 3`
|
||||
|
||||
err = dbx.Handlex.Select(&listNonLab, query, totalLab, id)
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get data NON lab",
|
||||
zap.Any("id", id),
|
||||
zap.Any("list data", listNonLab),
|
||||
)
|
||||
return listNonLab, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
logger.Info("data",
|
||||
zap.Any("id", id),
|
||||
zap.Any("cekkkk", listNonLab),
|
||||
)
|
||||
return listNonLab, nil
|
||||
}
|
||||
|
||||
func (k *KesimpulanServices) GetListKesimpulanFisik(id string) ([]models.ModelKesimpulanLab, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var listFisik []models.ModelKesimpulanLab
|
||||
var dataTot []models.ModelKesimpulanLab
|
||||
|
||||
qryTot := `select '' as nomor,
|
||||
'' as Test, sum(total) as total
|
||||
from(
|
||||
select count(*) as total
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'F'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ) x`
|
||||
|
||||
err := dbx.Handlex.Select(&dataTot, qryTot, id)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get total",
|
||||
zap.Any("id", id),
|
||||
zap.Any("total data", dataTot),
|
||||
)
|
||||
// return dataTot, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
// Extracting the Total value
|
||||
var totalFisik string
|
||||
if len(dataTot) > 0 {
|
||||
totalFisik = dataTot[0].Total
|
||||
}
|
||||
|
||||
logger.Info("data",
|
||||
zap.Any("id", id),
|
||||
zap.Any("cek total", totalFisik),
|
||||
)
|
||||
query := `SELECT ROW_NUMBER() OVER (ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC) AS nomor,
|
||||
ifnull(Nat_TestName ,Mcu_KelainanGroupName) as Test,
|
||||
cast(count(Mgm_HeaderT_OrderHeaderID)/?*100 as decimal(2,0)) as total
|
||||
|
||||
FROM mgm_header
|
||||
join mgm_detail on Mgm_DetailMgm_HeaderID = Mgm_HeaderID and Mgm_DetailIsActive = 'Y'
|
||||
join mcu_kelainan on Mgm_DetailMcu_KelainanID = Mcu_KelainanID
|
||||
join mcu_kelainangroup on Mgm_DetailMcu_KelainanGroupID = Mcu_KelainanGroupID
|
||||
left join nat_test on Nat_TestCode = Mgm_HeaderNat_TestCode
|
||||
|
||||
where Mgm_HeaderIsActive = 'Y' and Mgm_HeaderMgm_McuID = ? AND Mgm_HeaderType = 'F'
|
||||
and Mgm_HeaderIsNormal = 'N'
|
||||
group by Mgm_DetailMcu_KelainanID, Mgm_HeaderType ORDER BY count(Mgm_HeaderT_OrderHeaderID) DESC
|
||||
LIMIT 3`
|
||||
|
||||
err = dbx.Handlex.Select(&listFisik, query, totalFisik, id)
|
||||
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("Error get data fisik",
|
||||
zap.Any("id", id),
|
||||
zap.Any("list data", listFisik),
|
||||
)
|
||||
return listFisik, fmt.Errorf("QUERY_FAILED")
|
||||
}
|
||||
|
||||
return listFisik, nil
|
||||
}
|
||||
74
services/dev/mcudaftarpeserta.services.go
Normal file
74
services/dev/mcudaftarpeserta.services.go
Normal file
@@ -0,0 +1,74 @@
|
||||
package dev_services
|
||||
|
||||
import (
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
dbx "cpone/package/database"
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type McuDaftarPesertaServices struct {
|
||||
McuDaftarPesertaStore db.AppStore
|
||||
}
|
||||
|
||||
func NewMcuDaftarPesertaServices(uStore db.AppStore) *McuDaftarPesertaServices {
|
||||
return &McuDaftarPesertaServices{
|
||||
McuDaftarPesertaStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
func (mdp *McuDaftarPesertaServices) GetListMcuDaftarPeserta(id string, currentPage int, rowPerPage int) ([]models.ModelMcuDaftarPeserta, int, error) {
|
||||
logger, _ := zap.NewProduction()
|
||||
var listDaftarPeserta []models.ModelMcuDaftarPeserta
|
||||
var totalData int
|
||||
offset := (currentPage - 1) * rowPerPage
|
||||
|
||||
querytotal := `SELECT COUNT(*)
|
||||
FROM t_orderheader
|
||||
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID
|
||||
AND M_PatientIsActive = 'Y'
|
||||
WHERE T_OrderHeaderIsActive = 'Y' AND T_OrderHeaderMgm_McuID = ?`
|
||||
|
||||
if err := dbx.Handlex.Get(&totalData, querytotal, id); err != nil {
|
||||
return nil, 0, fmt.Errorf("error querying database: %v", err)
|
||||
}
|
||||
|
||||
query := `SELECT T_OrderHeaderID,
|
||||
T_OrderHeaderDate,
|
||||
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,
|
||||
M_PatientDOB,
|
||||
FLOOR(DATEDIFF(CURDATE(), M_PatientDOB)/ 365.25) AS age
|
||||
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)
|
||||
}
|
||||
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),
|
||||
)
|
||||
|
||||
return listDaftarPeserta, totalPage, nil
|
||||
}
|
||||
@@ -1,6 +1,17 @@
|
||||
package public_services
|
||||
|
||||
import "cpone/db"
|
||||
import (
|
||||
"bytes"
|
||||
"cpone/db"
|
||||
"cpone/models"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type ServicesLogin struct {
|
||||
CompanyStore db.AppStore
|
||||
@@ -12,3 +23,80 @@ func NewServicesLogin(uStore db.AppStore) *ServicesLogin {
|
||||
CompanyStore: uStore,
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
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)
|
||||
|
||||
resp, err := http.PostForm(uri, params)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("error request post", zap.Any("error", 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))
|
||||
return ret, err
|
||||
}
|
||||
|
||||
err = json.Unmarshal(body, &ret)
|
||||
if err != nil {
|
||||
defer logger.Sync()
|
||||
logger.Error("error parse body", zap.Any("error", err))
|
||||
return ret, err
|
||||
}
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
28
utils/chartcolor.utils.go
Normal file
28
utils/chartcolor.utils.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
)
|
||||
|
||||
// InterpolateColor calculates a color between two given colors based on progress (0 to 1)
|
||||
func InterpolateColor(start, end string, progress float64) string {
|
||||
r1, g1, b1 := HexToRGB(start)
|
||||
r2, g2, b2 := HexToRGB(end)
|
||||
|
||||
r := int(math.Round(float64(r1)*(1-progress) + float64(r2)*progress))
|
||||
g := int(math.Round(float64(g1)*(1-progress) + float64(g2)*progress))
|
||||
b := int(math.Round(float64(b1)*(1-progress) + float64(b2)*progress))
|
||||
|
||||
return fmt.Sprintf("#%02x%02x%02x", r, g, b)
|
||||
}
|
||||
|
||||
// Helper function to convert hex to RGB
|
||||
func HexToRGB(hex string) (int, int, int) {
|
||||
var r, g, b int
|
||||
_, err := fmt.Sscanf(hex, "#%02x%02x%02x", &r, &g, &b)
|
||||
if err != nil {
|
||||
return 0, 0, 0
|
||||
}
|
||||
return r, g, b
|
||||
}
|
||||
12
utils/formatRibuan.utils.go
Normal file
12
utils/formatRibuan.utils.go
Normal 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
|
||||
}
|
||||
117
views/corporate/dashboardpic/dashboardpic.templ
Normal file
117
views/corporate/dashboardpic/dashboardpic.templ
Normal file
@@ -0,0 +1,117 @@
|
||||
package corporate_dashboardpic
|
||||
|
||||
import "cpone/layout"
|
||||
import "cpone/component/customtextfield"
|
||||
import "cpone/models"
|
||||
|
||||
templ DashboardPic(
|
||||
listID string,
|
||||
paginationID string,
|
||||
breadcrumb templ.Component,
|
||||
filtercomponent templ.Component,
|
||||
listingcomponent templ.Component,
|
||||
paginationcomponent templ.Component,
|
||||
) {
|
||||
<div class="container-fluid">
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "listID",
|
||||
Name: "listID",
|
||||
Type: "hidden",
|
||||
Value: listID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "paginationID",
|
||||
Name: "paginationID",
|
||||
Type: "hidden",
|
||||
Value: paginationID})
|
||||
<div class="row align-item-center mb-10">
|
||||
<div class="col-md-10 col-sm-12 p-0">
|
||||
@breadcrumb
|
||||
</div>
|
||||
</div>
|
||||
@filtercomponent
|
||||
<div id="loading-parent" class="rounded">
|
||||
@listingcomponent
|
||||
@paginationcomponent
|
||||
<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 JSDashboardPIC() {
|
||||
<script>
|
||||
document.body.addEventListener('htmx:configRequest', function(evt) {
|
||||
const token = localStorage.getItem("token");
|
||||
if (token) {
|
||||
evt.detail.headers['Authentication'] = "Bearer " + token;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
templ CSSDashboardPIC() {
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/poppins.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/publicsans.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/roboto.css"
|
||||
/>
|
||||
<style>
|
||||
body {
|
||||
background-color: white;
|
||||
}
|
||||
#div-chart {
|
||||
margin: 40px 10vw 40px 10vw;
|
||||
}
|
||||
.title {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
#title {
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
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 ShowDashboardPic(
|
||||
title string,
|
||||
cmp templ.Component,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
navbaruser templ.Component,
|
||||
userprofile templ.Component,
|
||||
) {
|
||||
@layout.DashboardLayout(title, css, js, navbaruser, userprofile) {
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
220
views/corporate/dashboardpic/dashboardpic_templ.go
Normal file
220
views/corporate/dashboardpic/dashboardpic_templ.go
Normal file
@@ -0,0 +1,220 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package corporate_dashboardpic
|
||||
|
||||
//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 DashboardPic(
|
||||
listID string,
|
||||
paginationID string,
|
||||
breadcrumb templ.Component,
|
||||
filtercomponent templ.Component,
|
||||
listingcomponent templ.Component,
|
||||
paginationcomponent 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: "listID",
|
||||
Name: "listID",
|
||||
Type: "hidden",
|
||||
Value: listID}).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 = templ_7745c5c3_Buffer.WriteString("<div class=\"row align-item-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = breadcrumb.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
|
||||
}
|
||||
templ_7745c5c3_Err = filtercomponent.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 = listingcomponent.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = paginationcomponent.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 JSDashboardPIC() 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("<script>\r\n\t\tdocument.body.addEventListener('htmx:configRequest', function(evt) {\r\n\t\t\tconst token = localStorage.getItem(\"token\");\r\n\t\t\tif (token) {\r\n\t\t\t\tevt.detail.headers['Authentication'] = \"Bearer \" + token;\r\n\t\t\t}\r\n\t\t});\t\r\n\t</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 CSSDashboardPIC() 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("<link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><style>\r\n body {\r\n background-color: white;\r\n }\r\n #div-chart {\r\n margin: 40px 10vw 40px 10vw;\r\n }\r\n .title {\r\n font-size: 20px;\r\n font-weight: bold;\r\n }\r\n #title {\r\n font-weight: 600;\r\n }\r\n </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 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 ShowDashboardPic(
|
||||
title string,
|
||||
cmp templ.Component,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
navbaruser templ.Component,
|
||||
userprofile 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.DashboardLayout(title, css, js, navbaruser, userprofile).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
|
||||
})
|
||||
}
|
||||
68
views/corporate/dashboardpic/filterdashboardpic.templ
Normal file
68
views/corporate/dashboardpic/filterdashboardpic.templ
Normal file
@@ -0,0 +1,68 @@
|
||||
package corporate_dashboardpic
|
||||
|
||||
templ FilterListing(
|
||||
hxGet string,
|
||||
hxTrigger string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
hxTarget string,
|
||||
hxBeforeRequest templ.ComponentScript,
|
||||
hxAfterRequest templ.ComponentScript,
|
||||
) {
|
||||
<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">
|
||||
<input
|
||||
id="startdateID"
|
||||
name="startdate"
|
||||
class="form-control form-control-lg bg-field border-0 rounded-lg"
|
||||
type="date"
|
||||
autocomplete="off"
|
||||
hx-get={ hxGet }
|
||||
hx-trigger={ hxTrigger }
|
||||
hx-include={ hxInclude }
|
||||
hx-swap={ hxSwap }
|
||||
hx-target={ hxTarget }
|
||||
hx-on::before-request={ hxBeforeRequest }
|
||||
hx-on::after-request={ hxAfterRequest }
|
||||
/>
|
||||
</div>
|
||||
<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">End Date:</label>
|
||||
</div>
|
||||
<div class="col-12 col-sm-9 col-md-2 col-lg-2 col-xl-2 mb-2">
|
||||
<input
|
||||
id="enddateID"
|
||||
name="enddate"
|
||||
class="form-control form-control-lg bg-field border-0 rounded-lg"
|
||||
type="date"
|
||||
autocomplete="off"
|
||||
hx-get={ hxGet }
|
||||
hx-trigger={ hxTrigger }
|
||||
hx-include={ hxInclude }
|
||||
hx-swap={ hxSwap }
|
||||
hx-target={ hxTarget }
|
||||
hx-on::before-request={ hxBeforeRequest }
|
||||
hx-on::after-request={ hxAfterRequest }
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 mb-2">
|
||||
<input
|
||||
id="searchID"
|
||||
name="search"
|
||||
class="form-control form-control-lg bg-field border-0 rounded-lg"
|
||||
type="text"
|
||||
placeholder="nama karyawan"
|
||||
hx-get={ hxGet }
|
||||
hx-trigger={ hxTrigger }
|
||||
hx-include={ hxInclude }
|
||||
hx-swap={ hxSwap }
|
||||
hx-target={ hxTarget }
|
||||
hx-on::before-request={ hxBeforeRequest }
|
||||
hx-on::after-request={ hxAfterRequest }
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
316
views/corporate/dashboardpic/filterdashboardpic_templ.go
Normal file
316
views/corporate/dashboardpic/filterdashboardpic_templ.go
Normal file
@@ -0,0 +1,316 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package corporate_dashboardpic
|
||||
|
||||
//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 FilterListing(
|
||||
hxGet string,
|
||||
hxTrigger string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
hxTarget string,
|
||||
hxBeforeRequest templ.ComponentScript,
|
||||
hxAfterRequest 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-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\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input id=\"startdateID\" name=\"startdate\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"date\" autocomplete=\"off\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 23, Col: 30}
|
||||
}
|
||||
_, 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-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 24, Col: 38}
|
||||
}
|
||||
_, 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(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 25, Col: 38}
|
||||
}
|
||||
_, 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(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 26, Col: 32}
|
||||
}
|
||||
_, 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-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 27, Col: 36}
|
||||
}
|
||||
_, 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 = hxBeforeRequest
|
||||
_, 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 = hxAfterRequest
|
||||
_, 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 class=\"col-12 col-sm-3 col-md-1 col-lg-1 col-xl-1 mb-2\"><label class=\"text-black font-weight-bolder\">End 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
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input id=\"enddateID\" name=\"enddate\" class=\"form-control form-control-lg bg-field border-0 rounded-lg\" type=\"date\" autocomplete=\"off\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 42, Col: 30}
|
||||
}
|
||||
_, 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("\" hx-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 43, Col: 38}
|
||||
}
|
||||
_, 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("\" hx-include=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 44, Col: 38}
|
||||
}
|
||||
_, 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("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 45, Col: 32}
|
||||
}
|
||||
_, 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(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 46, Col: 36}
|
||||
}
|
||||
_, 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-on::before-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 templ.ComponentScript = hxBeforeRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14.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_Var15 templ.ComponentScript = hxAfterRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 mb-2\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxBeforeRequest, hxAfterRequest)
|
||||
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=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 58, Col: 30}
|
||||
}
|
||||
_, 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-trigger=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var17 string
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 59, Col: 38}
|
||||
}
|
||||
_, 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(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 60, Col: 38}
|
||||
}
|
||||
_, 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(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 61, Col: 32}
|
||||
}
|
||||
_, 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("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var20 string
|
||||
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\filterdashboardpic.templ`, Line: 62, Col: 36}
|
||||
}
|
||||
_, 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-on::before-request=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var21 templ.ComponentScript = hxBeforeRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var21.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_Var22 templ.ComponentScript = hxAfterRequest
|
||||
_, 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("\"></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
|
||||
})
|
||||
}
|
||||
48
views/corporate/dashboardpic/listingdashboardpic.templ
Normal file
48
views/corporate/dashboardpic/listingdashboardpic.templ
Normal file
@@ -0,0 +1,48 @@
|
||||
package corporate_dashboardpic
|
||||
|
||||
import "cpone/models"
|
||||
import "strconv"
|
||||
|
||||
templ ListingData(
|
||||
data []models.DashboardPic,
|
||||
listID string,
|
||||
) {
|
||||
<div id={listID} class="align-items-center py-8 flex-column" hx-swap-oob="true">
|
||||
if len(data) == 0 {
|
||||
<div class="text-center">
|
||||
<h4>Data Tidak Ditemukan</h4>
|
||||
</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>
|
||||
}
|
||||
|
||||
templ ItemCard(data models.DashboardPic) {
|
||||
<div class="row d-flex align-items-center">
|
||||
<div class="col-7">
|
||||
<h3 class="text-black">{ data.Mgm_McuLabel }</h3>
|
||||
</div>
|
||||
<div class="col-md col-lg text-right">
|
||||
<span class="text-black font-weight-bolder">{ data.Mgm_McuNote }</span>
|
||||
</div>
|
||||
<div class="col-md col-lg text-right">
|
||||
<span class="text-black font-weight-bolder">{ data.Mgm_McuStartDate } - { data.Mgm_McuEndDate }</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
230
views/corporate/dashboardpic/listingdashboardpic_templ.go
Normal file
230
views/corporate/dashboardpic/listingdashboardpic_templ.go
Normal file
@@ -0,0 +1,230 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package corporate_dashboardpic
|
||||
|
||||
//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"
|
||||
|
||||
func ListingData(
|
||||
data []models.DashboardPic,
|
||||
listID string,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(listID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\dashboardpic\listingdashboardpic.templ`, Line: 10, Col: 19}
|
||||
}
|
||||
_, 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=\"align-items-center py-8 flex-column\" hx-swap-oob=\"true\">")
|
||||
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>")
|
||||
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 ItemCard(data models.DashboardPic) 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 class=\"row d-flex align-items-center\"><div class=\"col-7\"><h3 class=\"text-black\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
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: 38, Col: 54}
|
||||
}
|
||||
_, 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("</h3></div><div class=\"col-md col-lg text-right\"><span class=\"text-black font-weight-bolder\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
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: 41, Col: 74}
|
||||
}
|
||||
_, 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("</span></div><div class=\"col-md col-lg text-right\"><span class=\"text-black font-weight-bolder\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
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: 44, Col: 79}
|
||||
}
|
||||
_, 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(" - ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
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: 44, Col: 105}
|
||||
}
|
||||
_, 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("</span></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
|
||||
})
|
||||
}
|
||||
75
views/corporate/mcu/mcudetail.templ
Normal file
75
views/corporate/mcu/mcudetail.templ
Normal file
@@ -0,0 +1,75 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
import "cpone/layout"
|
||||
|
||||
templ McuDetailScreen(
|
||||
breadcrumb templ.Component,
|
||||
content templ.Component,
|
||||
) {
|
||||
<div class="container-fluid">
|
||||
<div class="row align-item-center mb-10">
|
||||
<div class="col-md-10 col-sm-12 p-0">
|
||||
@breadcrumb
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<div id="loadingcontent"></div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ CSSMcuDetail(
|
||||
CssKesimpulan templ.Component,
|
||||
) {
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/poppins.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/publicsans.css"
|
||||
/>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="assets/css/googlefont/roboto.css"
|
||||
/>
|
||||
<style>
|
||||
body {
|
||||
background-color: white;
|
||||
}
|
||||
#div-chart {
|
||||
margin: 40px 10vw 40px 10vw;
|
||||
}
|
||||
.title {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
#title {
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
@CssKesimpulan
|
||||
}
|
||||
|
||||
templ JSMcuDetail() {
|
||||
<script src="assets/js/echarts-js/echart.min.js"></script>
|
||||
}
|
||||
|
||||
templ ShowMcuDetail(
|
||||
title string,
|
||||
cmp templ.Component,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
navbaruser templ.Component,
|
||||
userprofile templ.Component,
|
||||
) {
|
||||
@layout.DashboardLayout(title, css, js, navbaruser, userprofile) {
|
||||
@cmp
|
||||
}
|
||||
}
|
||||
156
views/corporate/mcu/mcudetail_templ.go
Normal file
156
views/corporate/mcu/mcudetail_templ.go
Normal file
@@ -0,0 +1,156 @@
|
||||
// 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"
|
||||
|
||||
func McuDetailScreen(
|
||||
breadcrumb 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\"><div class=\"row align-item-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = breadcrumb.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></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 = 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 CSSMcuDetail(
|
||||
CssKesimpulan templ.Component,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
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("<link rel=\"stylesheet\" href=\"assets/css/googlefont/poppins.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><style>\r\n body {\r\n background-color: white;\r\n }\r\n #div-chart {\r\n margin: 40px 10vw 40px 10vw;\r\n }\r\n .title {\r\n font-size: 20px;\r\n font-weight: bold;\r\n }\r\n #title {\r\n font-weight: 600;\r\n }\r\n </style>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = CssKesimpulan.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func JSMcuDetail() 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("<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)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func ShowMcuDetail(
|
||||
title string,
|
||||
cmp templ.Component,
|
||||
css templ.Component,
|
||||
js templ.Component,
|
||||
navbaruser templ.Component,
|
||||
userprofile 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.DashboardLayout(title, css, js, navbaruser, userprofile).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
|
||||
})
|
||||
}
|
||||
124
views/corporate/mcu/mcutab/modaldaftarpeserta.templ
Normal file
124
views/corporate/mcu/mcutab/modaldaftarpeserta.templ
Normal file
@@ -0,0 +1,124 @@
|
||||
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>
|
||||
419
views/corporate/mcu/mcutab/modaldaftarpeserta_templ.go
Normal file
419
views/corporate/mcu/mcutab/modaldaftarpeserta_templ.go
Normal file
@@ -0,0 +1,419 @@
|
||||
// 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>
|
||||
85
views/corporate/mcu/mcutab/tabdaftarpeserta.templ
Normal file
85
views/corporate/mcu/mcutab/tabdaftarpeserta.templ
Normal file
@@ -0,0 +1,85 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
208
views/corporate/mcu/mcutab/tabdaftarpeserta_templ.go
Normal file
208
views/corporate/mcu/mcutab/tabdaftarpeserta_templ.go
Normal file
@@ -0,0 +1,208 @@
|
||||
// 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
|
||||
})
|
||||
}
|
||||
46
views/corporate/mcu/mcutab/tabkelainanfisik.templ
Normal file
46
views/corporate/mcu/mcutab/tabkelainanfisik.templ
Normal file
@@ -0,0 +1,46 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
templ Tabkelainanfisik(
|
||||
chartsxs []templ.Component,
|
||||
chartsmd []templ.Component,
|
||||
chartslg []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 Presentase Kelainan Fisik</h2>
|
||||
</div>
|
||||
|
||||
// xs
|
||||
<div class="d-xs-block d-sm-block d-md-none">
|
||||
<div class="row justify-content-center">
|
||||
for _, c := range chartsxs {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// md
|
||||
<div class="d-none d-md-block d-lg-none">
|
||||
<div class="row justify-content-center">
|
||||
for _, c := range chartsmd {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// lg
|
||||
<div class="d-none d-lg-block">
|
||||
<div class="row justify-content-center">
|
||||
for _, c := range chartslg {
|
||||
<div class="col-6 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
93
views/corporate/mcu/mcutab/tabkelainanfisik_templ.go
Normal file
93
views/corporate/mcu/mcutab/tabkelainanfisik_templ.go
Normal file
@@ -0,0 +1,93 @@
|
||||
// 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"
|
||||
|
||||
func Tabkelainanfisik(
|
||||
chartsxs []templ.Component,
|
||||
chartsmd []templ.Component,
|
||||
chartslg []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 Presentase 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 _, c := range chartsxs {
|
||||
_, 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 = ChartCard(c).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 _, c := range chartsmd {
|
||||
_, 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 = ChartCard(c).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 _, c := range chartslg {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-6 my-4\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ChartCard(c).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
|
||||
})
|
||||
}
|
||||
46
views/corporate/mcu/mcutab/tabkelainanglobal.templ
Normal file
46
views/corporate/mcu/mcutab/tabkelainanglobal.templ
Normal file
@@ -0,0 +1,46 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
templ TabKelainanGlobal(
|
||||
chartsxs []templ.Component,
|
||||
chartsmd []templ.Component,
|
||||
chartslg []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 _, c := range chartsxs {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// md
|
||||
<div class="d-none d-md-block d-lg-none">
|
||||
<div class="row justify-content-center">
|
||||
for _, c := range chartsmd {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// lg
|
||||
<div class="d-none d-lg-block">
|
||||
<div class="row justify-content-center">
|
||||
for _, c := range chartslg {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
93
views/corporate/mcu/mcutab/tabkelainanglobal_templ.go
Normal file
93
views/corporate/mcu/mcutab/tabkelainanglobal_templ.go
Normal file
@@ -0,0 +1,93 @@
|
||||
// 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"
|
||||
|
||||
func TabKelainanGlobal(
|
||||
chartsxs []templ.Component,
|
||||
chartsmd []templ.Component,
|
||||
chartslg []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 _, c := range chartsxs {
|
||||
_, 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 = ChartCard(c).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 _, c := range chartsmd {
|
||||
_, 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 = ChartCard(c).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 _, c := range chartslg {
|
||||
_, 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 = ChartCard(c).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
|
||||
})
|
||||
}
|
||||
50
views/corporate/mcu/mcutab/tabkelainanlab.templ
Normal file
50
views/corporate/mcu/mcutab/tabkelainanlab.templ
Normal file
@@ -0,0 +1,50 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
templ TabKelainanLab(
|
||||
chartpresentaselg templ.Component,
|
||||
chartsxs []templ.Component,
|
||||
chartsmd []templ.Component,
|
||||
chartslg []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 _, c := range chartsxs {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// md
|
||||
<div class="d-none d-md-block d-lg-none">
|
||||
<div class="row justify-content-center">
|
||||
for _, c := range chartsmd {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// lg
|
||||
<div class="d-none d-lg-block">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(chartpresentaselg)
|
||||
</div>
|
||||
for _, c := range chartslg{
|
||||
<div class="col-6 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
102
views/corporate/mcu/mcutab/tabkelainanlab_templ.go
Normal file
102
views/corporate/mcu/mcutab/tabkelainanlab_templ.go
Normal file
@@ -0,0 +1,102 @@
|
||||
// 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"
|
||||
|
||||
func TabKelainanLab(
|
||||
chartpresentaselg templ.Component,
|
||||
chartsxs []templ.Component,
|
||||
chartsmd []templ.Component,
|
||||
chartslg []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 _, c := range chartsxs {
|
||||
_, 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 = ChartCard(c).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 _, c := range chartsmd {
|
||||
_, 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 = ChartCard(c).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\"><div class=\"col-12 my-4\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ChartCard(chartpresentaselg).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
|
||||
}
|
||||
for _, c := range chartslg {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-6 my-4\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ChartCard(c).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
|
||||
})
|
||||
}
|
||||
62
views/corporate/mcu/mcutab/tabkelainannonlab.templ
Normal file
62
views/corporate/mcu/mcutab/tabkelainannonlab.templ
Normal file
@@ -0,0 +1,62 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
templ TabKelainanNonLab(
|
||||
// chartpresentase templ.Component,
|
||||
// chartthorax templ.Component,
|
||||
chartsxs []templ.Component,
|
||||
chartsmd []templ.Component,
|
||||
chartslg []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 _, c := range chartsxs {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// md
|
||||
<div class="d-none d-md-block d-lg-none">
|
||||
<div class="row justify-content-center">
|
||||
for _, c := range chartsmd {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// lg
|
||||
<div class="d-none d-lg-block">
|
||||
<div class="row justify-content-center">
|
||||
// <div class="col-12 my-4">
|
||||
// <div class="card shadow p-4" style="display: flex; justify-content: center; align-items: center; height: 100%;">
|
||||
// <div class="d-flex flex-column pt-8">
|
||||
// @chartpresentase
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="col-12 my-4">
|
||||
// <div class="card shadow p-4" style="display: flex; justify-content: center; align-items: center; height: 100%;">
|
||||
// <div class="d-flex flex-column pt-8">
|
||||
// @chartthorax
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
for _, c := range chartslg {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
95
views/corporate/mcu/mcutab/tabkelainannonlab_templ.go
Normal file
95
views/corporate/mcu/mcutab/tabkelainannonlab_templ.go
Normal file
@@ -0,0 +1,95 @@
|
||||
// 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"
|
||||
|
||||
func TabKelainanNonLab(
|
||||
// chartpresentase templ.Component,
|
||||
// chartthorax templ.Component,
|
||||
chartsxs []templ.Component,
|
||||
chartsmd []templ.Component,
|
||||
chartslg []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 _, c := range chartsxs {
|
||||
_, 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 = ChartCard(c).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 _, c := range chartsmd {
|
||||
_, 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 = ChartCard(c).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 _, c := range chartslg {
|
||||
_, 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 = ChartCard(c).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
|
||||
})
|
||||
}
|
||||
56
views/corporate/mcu/mcutab/tabkepesertaan.templ
Normal file
56
views/corporate/mcu/mcutab/tabkepesertaan.templ
Normal file
@@ -0,0 +1,56 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
templ TabKepesertaan(
|
||||
chartsxs []templ.Component,
|
||||
chartsmd []templ.Component,
|
||||
chartslg []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 _, c := range chartsxs {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// md
|
||||
<div class="d-none d-md-block d-lg-none">
|
||||
<div class="row justify-content-center">
|
||||
for _, c := range chartsmd {
|
||||
<div class="col-12 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// lg
|
||||
<div class="d-none d-lg-block">
|
||||
<div class="row justify-content-center">
|
||||
for _, c := range chartslg {
|
||||
<div class="col-6 my-4">
|
||||
@ChartCard(c)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ChartCard(
|
||||
charts templ.Component,
|
||||
) {
|
||||
<div class="card shadow p-4" style="display: flex; justify-content: center; align-items: center; height: 100%;">
|
||||
<div class="d-flex flex-column pt-8">
|
||||
@charts
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
127
views/corporate/mcu/mcutab/tabkepesertaan_templ.go
Normal file
127
views/corporate/mcu/mcutab/tabkepesertaan_templ.go
Normal file
@@ -0,0 +1,127 @@
|
||||
// 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"
|
||||
|
||||
func TabKepesertaan(
|
||||
chartsxs []templ.Component,
|
||||
chartsmd []templ.Component,
|
||||
chartslg []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 _, c := range chartsxs {
|
||||
_, 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 = ChartCard(c).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 _, c := range chartsmd {
|
||||
_, 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 = ChartCard(c).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 _, c := range chartslg {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"col-6 my-4\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ChartCard(c).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 ChartCard(
|
||||
charts 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%;\"><div class=\"d-flex flex-column pt-8\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = charts.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
|
||||
})
|
||||
}
|
||||
55
views/corporate/mcu/mcutab/tabkesimpulan.templ
Normal file
55
views/corporate/mcu/mcutab/tabkesimpulan.templ
Normal file
@@ -0,0 +1,55 @@
|
||||
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() {
|
||||
}
|
||||
116
views/corporate/mcu/mcutab/tabkesimpulan_templ.go
Normal file
116
views/corporate/mcu/mcutab/tabkesimpulan_templ.go
Normal file
@@ -0,0 +1,116 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package corporate_mcudetail
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import (
|
||||
"cpone/component/customtextfield"
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
func MainKesimpulan(
|
||||
tableID string,
|
||||
tablecontent templ.Component,
|
||||
tablecontentnonlab templ.Component,
|
||||
tablecontentfisik templ.Component,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<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 = templ_7745c5c3_Buffer.WriteString("<div class=\"d-flex justify-content-center pt-10 pb-10\"><h2 class=\"title text-black\" style=\"margin-bottom: 0\">Kesimpulan</h2></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tablecontent.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tablecontentnonlab.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tablecontentfisik.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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 CssKesimpulan() templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var2 == nil {
|
||||
templ_7745c5c3_Var2 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<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
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func JsKesimpulan() templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var3 == nil {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
46
views/corporate/mcu/mcutab/tabkesimpulantable.templ
Normal file
46
views/corporate/mcu/mcutab/tabkesimpulantable.templ
Normal file
@@ -0,0 +1,46 @@
|
||||
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>
|
||||
}
|
||||
}
|
||||
181
views/corporate/mcu/mcutab/tabkesimpulantable_templ.go
Normal file
181
views/corporate/mcu/mcutab/tabkesimpulantable_templ.go
Normal file
@@ -0,0 +1,181 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package corporate_mcudetail
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import (
|
||||
"cpone/component/table"
|
||||
"cpone/models"
|
||||
)
|
||||
|
||||
func CardTableKesimpulan(title string, data []models.ModelKesimpulanLab, tableID string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<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}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h3></div><div class=\"card-body\"><div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = TableKesimpulan(data, tableID).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func TableKesimpulan(data []models.ModelKesimpulanLab,
|
||||
tableID string) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var3 == nil {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<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
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
if len(data) == 0 {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td colspan=\"3\" class=\"text-center\">Data Tidak Ditemukan</td></tr>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
for _, v := range data {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.Nomor)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 41, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.Test)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkesimpulantable.templ`, Line: 42, Col: 15}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</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
|
||||
}
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
79
views/corporate/mcu/mcutab/tabkeuangan.templ
Normal file
79
views/corporate/mcu/mcutab/tabkeuangan.templ
Normal file
@@ -0,0 +1,79 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
import "cpone/component/customtextfield"
|
||||
import "cpone/models"
|
||||
|
||||
templ TabKeuanganScreen(
|
||||
tableID string,
|
||||
paginationID string,
|
||||
totalcardcomponent templ.Component,
|
||||
tableandpagination 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,
|
||||
})
|
||||
<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">
|
||||
@totalcardcomponent
|
||||
@tableandpagination
|
||||
<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 KeuanganCard(
|
||||
totalOrder string,
|
||||
totalTagihan string,
|
||||
totalPelunasan string,
|
||||
totalHutang 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">{ totalOrder }</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">{ totalTagihan }</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">{ totalPelunasan }</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">{ totalHutang }</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
156
views/corporate/mcu/mcutab/tabkeuangan_templ.go
Normal file
156
views/corporate/mcu/mcutab/tabkeuangan_templ.go
Normal file
@@ -0,0 +1,156 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package corporate_mcudetail
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import "cpone/component/customtextfield"
|
||||
import "cpone/models"
|
||||
|
||||
func TabKeuanganScreen(
|
||||
tableID string,
|
||||
paginationID string,
|
||||
totalcardcomponent templ.Component,
|
||||
tableandpagination 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 = 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 = totalcardcomponent.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = tableandpagination.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 KeuanganCard(
|
||||
totalOrder string,
|
||||
totalTagihan string,
|
||||
totalPelunasan string,
|
||||
totalHutang 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(totalOrder)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkeuangan.templ`, Line: 50, Col: 76}
|
||||
}
|
||||
_, 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(totalTagihan)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkeuangan.templ`, Line: 58, Col: 78}
|
||||
}
|
||||
_, 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(totalPelunasan)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkeuangan.templ`, Line: 66, Col: 80}
|
||||
}
|
||||
_, 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(totalHutang)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabkeuangan.templ`, Line: 74, Col: 77}
|
||||
}
|
||||
_, 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
|
||||
})
|
||||
}
|
||||
111
views/corporate/mcu/mcutab/tabledaftarpeserta.templ
Normal file
111
views/corporate/mcu/mcutab/tabledaftarpeserta.templ
Normal file
@@ -0,0 +1,111 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
import "cpone/component/table"
|
||||
import "cpone/models"
|
||||
|
||||
|
||||
templ ContentLayout(
|
||||
tablecomponent templ.Component,
|
||||
paginationtable templ.Component,
|
||||
) {
|
||||
<div id="contentlayout" hx-on::load={ AfterRequestContent() }>
|
||||
@tablecomponent
|
||||
@paginationtable
|
||||
</div>
|
||||
}
|
||||
|
||||
templ TableDaftarPeserta(
|
||||
data []models.ModelMcuDaftarPeserta,
|
||||
tableID string,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
) {
|
||||
<div id={ tableID }>
|
||||
@tablecomponent.TableV3([]string{"NOLAB", "NAMA", "JENIS KELAMIN", "UMUR", "KESIMPULAN", "AKSI"},
|
||||
[]string{"15%","20%","10%","10%","30%","15%"},
|
||||
ItemRow(data,
|
||||
hxGet,
|
||||
hxTarget,
|
||||
hxInclude,
|
||||
hxSwap,
|
||||
))
|
||||
</div>
|
||||
}
|
||||
|
||||
templ ItemRow(
|
||||
data []models.ModelMcuDaftarPeserta,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap 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.Age }</td>
|
||||
<td>
|
||||
// <div class="row align-items-center">
|
||||
// <div class="col-2 col-xl-2 col-lg-2 col-md-12 col-sm-12">
|
||||
// if v. == "Nanda Arisu" {
|
||||
// <span class="label label-xl label-rounded label-light-warning" style="width: 50px;">Unfit</span>
|
||||
// } else {
|
||||
// <span class="label label-xl label-rounded label-light-success" style="width: 50px;">Fit</span>
|
||||
// }
|
||||
// </div>
|
||||
// <div class="col-10 col-xl-10 col-lg-10 col-md-12 col-sm-12">
|
||||
// Lorem Ipsum In Dolor Ad Sasum Mara Naka Adhum In Horem
|
||||
// </div>
|
||||
// </div>
|
||||
-
|
||||
</td>
|
||||
<td>
|
||||
@ItemAction(v.T_OrderHeaderID,
|
||||
hxGet,
|
||||
hxTarget,
|
||||
hxInclude,
|
||||
hxSwap,
|
||||
)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
|
||||
templ ItemAction(
|
||||
id string,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap string,
|
||||
) {
|
||||
<div class="row px-5 d-flex justify-content-around">
|
||||
<a
|
||||
type="button"
|
||||
class="btn btn-icon"
|
||||
hx-get={ hxGet +"?idx=" + id }
|
||||
hx-target={ hxTarget }
|
||||
hx-swap={ hxSwap }
|
||||
hx-include={ hxInclude }
|
||||
>
|
||||
<i class="flaticon-doc"></i>
|
||||
</a>
|
||||
// <a
|
||||
// class="btn btn-icon"
|
||||
// >
|
||||
// <i class="flaticon2-edit"></i>
|
||||
// </a>
|
||||
// <a
|
||||
// class="btn btn-icon"
|
||||
// >
|
||||
// <i class="la la-shield icon-xl"></i>
|
||||
// </a>
|
||||
</div>
|
||||
}
|
||||
310
views/corporate/mcu/mcutab/tabledaftarpeserta_templ.go
Normal file
310
views/corporate/mcu/mcutab/tabledaftarpeserta_templ.go
Normal file
@@ -0,0 +1,310 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package corporate_mcudetail
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import "cpone/component/table"
|
||||
import "cpone/models"
|
||||
|
||||
func ContentLayout(
|
||||
tablecomponent templ.Component,
|
||||
paginationtable 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=\"contentlayout\" 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 = tablecomponent.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = paginationtable.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 TableDaftarPeserta(
|
||||
data []models.ModelMcuDaftarPeserta,
|
||||
tableID string,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap 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(tableID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 25, Col: 21}
|
||||
}
|
||||
_, 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{"NOLAB", "NAMA", "JENIS KELAMIN", "UMUR", "KESIMPULAN", "AKSI"},
|
||||
[]string{"15%", "20%", "10%", "10%", "30%", "15%"},
|
||||
ItemRow(data,
|
||||
hxGet,
|
||||
hxTarget,
|
||||
hxInclude,
|
||||
hxSwap,
|
||||
)).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,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap 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\tabledaftarpeserta.templ`, Line: 51, 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\tabledaftarpeserta.templ`, Line: 52, 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\tabledaftarpeserta.templ`, Line: 53, 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.Age)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 54, Col: 23}
|
||||
}
|
||||
_, 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>-\r</td><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = ItemAction(v.T_OrderHeaderID,
|
||||
hxGet,
|
||||
hxTarget,
|
||||
hxInclude,
|
||||
hxSwap,
|
||||
).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 ItemAction(
|
||||
id string,
|
||||
hxGet string,
|
||||
hxTarget string,
|
||||
hxInclude string,
|
||||
hxSwap 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_Var10 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var10 == nil {
|
||||
templ_7745c5c3_Var10 = 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\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet + "?idx=" + id)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 93, Col: 40}
|
||||
}
|
||||
_, 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("\" hx-target=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 94, Col: 32}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 95, Col: 28}
|
||||
}
|
||||
_, 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(hxInclude)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\corporate\mcu\mcutab\tabledaftarpeserta.templ`, Line: 96, Col: 34}
|
||||
}
|
||||
_, 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("\"><i class=\"flaticon-doc\"></i></a></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
|
||||
})
|
||||
}
|
||||
110
views/corporate/mcu/mcutab/tablekeuangan.templ
Normal file
110
views/corporate/mcu/mcutab/tablekeuangan.templ
Normal file
@@ -0,0 +1,110 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
import "cpone/models"
|
||||
import "strconv"
|
||||
import "cpone/utils"
|
||||
|
||||
templ TableAndPagination(
|
||||
tablecomponent templ.Component,
|
||||
paginationcomp templ.Component,
|
||||
) {
|
||||
<div id="tabdanpagi" hx-on::load={ AfterRequestContent() }>
|
||||
@tablecomponent
|
||||
@paginationcomp
|
||||
</div>
|
||||
}
|
||||
|
||||
templ TableKeuangan(
|
||||
data []models.KeuanganModel,
|
||||
tableID string,
|
||||
) {
|
||||
<div id={tableID} 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-3" 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>
|
||||
@RowKeuangan(data)
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
|
||||
// note
|
||||
// row pelunasan -> row tagihan rowspan=len(tab pelunasan)
|
||||
// row sisa ikut ke row pertama tagihan
|
||||
|
||||
templ RowKeuangan(
|
||||
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>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
586
views/corporate/mcu/mcutab/tablekeuangan_templ.go
Normal file
586
views/corporate/mcu/mcutab/tablekeuangan_templ.go
Normal file
@@ -0,0 +1,586 @@
|
||||
// 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/models"
|
||||
import "strconv"
|
||||
import "cpone/utils"
|
||||
|
||||
func TableAndPagination(
|
||||
tablecomponent 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=\"tabdanpagi\" 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 = tablecomponent.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 TableKeuangan(
|
||||
data []models.KeuanganModel,
|
||||
tableID string,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var3 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var3 == nil {
|
||||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<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\tablekeuangan.templ`, Line: 21, Col: 20}
|
||||
}
|
||||
_, 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-3\" 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 = RowKeuangan(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
|
||||
})
|
||||
}
|
||||
|
||||
// note
|
||||
// row pelunasan -> row tagihan rowspan=len(tab pelunasan)
|
||||
// row sisa ikut ke row pertama tagihan
|
||||
func RowKeuangan(
|
||||
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\tablekeuangan.templ`, Line: 60, 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\tablekeuangan.templ`, Line: 61, 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\tablekeuangan.templ`, Line: 63, 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\tablekeuangan.templ`, Line: 64, 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\tablekeuangan.templ`, Line: 67, 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\tablekeuangan.templ`, Line: 71, 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\tablekeuangan.templ`, Line: 72, 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\tablekeuangan.templ`, Line: 73, 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\tablekeuangan.templ`, Line: 75, 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\tablekeuangan.templ`, Line: 75, 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\tablekeuangan.templ`, Line: 76, 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\tablekeuangan.templ`, Line: 76, 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\tablekeuangan.templ`, Line: 78, 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\tablekeuangan.templ`, Line: 79, 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\tablekeuangan.templ`, Line: 81, 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\tablekeuangan.templ`, Line: 82, 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\tablekeuangan.templ`, Line: 82, 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\tablekeuangan.templ`, Line: 86, 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\tablekeuangan.templ`, Line: 87, 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\tablekeuangan.templ`, Line: 88, 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\tablekeuangan.templ`, Line: 90, 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\tablekeuangan.templ`, Line: 90, 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\tablekeuangan.templ`, Line: 91, 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\tablekeuangan.templ`, Line: 91, 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\tablekeuangan.templ`, Line: 93, 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\tablekeuangan.templ`, Line: 94, 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\tablekeuangan.templ`, Line: 96, 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\tablekeuangan.templ`, Line: 97, 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\tablekeuangan.templ`, Line: 97, 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\tablekeuangan.templ`, Line: 102, 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\tablekeuangan.templ`, Line: 103, 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\tablekeuangan.templ`, Line: 105, 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
|
||||
})
|
||||
}
|
||||
71
views/corporate/mcu/mcutabview.templ
Normal file
71
views/corporate/mcu/mcutabview.templ
Normal file
@@ -0,0 +1,71 @@
|
||||
package corporate_mcudetail
|
||||
|
||||
templ TabViewMcuDetail(
|
||||
id string,
|
||||
) {
|
||||
<div>
|
||||
<ul class="nav nav-tabs nav-tabs-line">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#kt_tab_pane_1" hx-get={"/corp/dashboard_pic/detail/" + id +"/tabkepesertaan"} hx-target="#tabkepesertaan" hx-trigger="load">Peserta</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_2" hx-get={"/corp/dashboard_pic/detail/" + id +"/tabkelainanglobal"} hx-target="#tabkelainanglobal" hx-trigger="click">Kelainan global</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_3" hx-get={"/corp/dashboard_pic/detail/" + id +"/tabkelainanlab"} hx-target="#tabkelainanlab" hx-trigger="click">Kelainan Lab</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_4" hx-get={"/corp/dashboard_pic/detail/" + id +"/tabkelainannonlab"} hx-target="#tabkelainannonlab" hx-trigger="click">kelainan Non Lab</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_5" hx-get={"/corp/dashboard_pic/detail/" + id +"/tabkelainanfisik"} hx-target="#tabkelainanfisik" hx-trigger="click">kelainan Fisik</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_6" hx-get={"/corp/dashboard_pic/detail/" + id +"/tabkesimpulan"} hx-target="#tabkesimpulan">Kesimpulan</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_7" hx-get={"/corp/dashboard_pic/detail/" + id +"/tabdaftarpeserta"} hx-target="#tabdaftarpeserta">Daftar Peserta</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_8">Executive Summary</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#kt_tab_pane_9" hx-get={"/corp/dashboard_pic/detail/" + id +"/tabkeuangan"} hx-target="#tabkeuangan">Keuangan</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content mt-5" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="kt_tab_pane_1" role="tabpanel" aria-labelledby="kt_tab_pane_1">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_001.rptdesign&__format=pdf&PID="+id+"&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
<div id="tabkepesertaan"></div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="kt_tab_pane_2" role="tabpanel" aria-labelledby="kt_tab_pane_2">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_002.rptdesign&__format=pdf&PID="+id+"&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
<div id="tabkelainanglobal"></div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="kt_tab_pane_3" role="tabpanel" aria-labelledby="kt_tab_pane_3">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_003.rptdesign&__format=pdf&PID="+id+"&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
<div id="tabkelainanlab"></div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="kt_tab_pane_4" role="tabpanel" aria-labelledby="kt_tab_pane_4" style="height: 800px;">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_004.rptdesign&__format=pdf&PID="+id+"&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
<div id="tabkelainannonlab"></div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="kt_tab_pane_5" role="tabpanel" aria-labelledby="kt_tab_pane_5">
|
||||
// <object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_mcu_graph_005.rptdesign&__format=pdf&PID="+id+"&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
<div id="tabkelainanfisik"></div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="kt_tab_pane_6" role="tabpanel" aria-labelledby="kt_tab_pane_6">
|
||||
<div id="tabkesimpulan"></div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="kt_tab_pane_7" role="tabpanel" aria-labelledby="kt_tab_pane_7">
|
||||
<div id="tabdaftarpeserta"></div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="kt_tab_pane_8" role="tabpanel" aria-labelledby="kt_tab_pane_8" style="height: 800px;">
|
||||
<object data={"https://devcpone.aplikasi.web.id/birt/run?__report=report/one/mcu/rpt_summary_executive.rptdesign&__format=pdf&PID="+id+"&username=adhi&tm=1717726294764"} type="application/pdf" width="100%" height="100%"></object>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="kt_tab_pane_9" role="tabpanel" aria-labelledby="kt_tab_pane_9">
|
||||
<div id="tabkeuangan"></div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user