Compare commits

..

37 Commits

Author SHA1 Message Date
Hanan Askarim
c904391833 fisik slicing 2024-06-13 19:19:44 +07:00
Hanan Askarim
c4ba3fbd5e fis kesimpulan 2024-06-13 19:11:14 +07:00
Hanan Askarim
ac1547699e add fisik 2024-06-13 18:59:24 +07:00
Hanan Askarim
ac0c6dfc21 add kesimpulan non lab 2024-06-13 18:44:09 +07:00
Hanan Askarim
6479f4f44d add listing lab 2024-06-13 17:53:17 +07:00
Hanan Askarim
c9d0a93930 label keterangan 2024-06-13 11:21:21 +07:00
Hanan Askarim
5914f1557e fisik 2024-06-13 10:21:18 +07:00
Hanan Askarim
dd4d6526d0 add accordion 2024-06-13 08:46:05 +07:00
Hanan Askarim
1642a5ec1b slicing fisik 2024-06-12 16:52:45 +07:00
Hanan Askarim
b7ddacd4fe kesimpulan dan saran 2024-06-11 14:03:43 +07:00
2058220370 fix pagination 2024-06-10 11:55:23 +07:00
6045c459da add styling 2024-06-10 11:40:07 +07:00
86264a05e2 add filter listing employee health medic analytic 2024-06-10 10:12:41 +07:00
ae807c1615 listing card data 2024-06-08 09:48:39 +07:00
88596ac6d9 add routes home + fix container footer 2024-06-07 09:36:57 +07:00
sindhu
c7a66aae8d add koneksi ke cpone_log 2024-06-05 13:54:26 +07:00
sindhu
a4319bee07 change parameter terminology 2024-05-30 15:30:37 +07:00
sindhu
dbead529fe modify sql null string terminology model 2024-05-30 15:29:46 +07:00
sindhu
1ed188e3ff add get terminology list in app services 2024-05-30 11:55:07 +07:00
Sas Andy
1e978188ee modal xl 2024-05-30 09:37:09 +07:00
2c183a43cc add error log 2024-05-29 15:58:22 +07:00
2909b06966 add edit func sample station 2024-05-29 15:58:22 +07:00
f2d0db174e modal with func add data 2024-05-29 15:58:21 +07:00
42f24d1c77 modal sample station 2024-05-29 15:58:21 +07:00
ada2ae9052 fix rebase conflict 2024-05-29 15:58:21 +07:00
ac4feb51c1 refactor sample station + loading 2024-05-29 15:58:21 +07:00
44eca754f5 add sample station handler, services, model 2024-05-29 15:58:21 +07:00
sindhu
6e7a84f4aa step 4 : delete group result 2024-05-29 15:58:21 +07:00
sindhu
f6296003c9 step 3 : edit data group result 2024-05-29 15:58:21 +07:00
sindhu
c6c61c7caf step 2 : add data group result with form validation 2024-05-29 15:58:20 +07:00
sindhu
1b0522146c step 1 : listing, search and pagination group result 2024-05-29 15:58:20 +07:00
d92cc9727c listing data minus pagination + bug dislpay group name 2024-05-29 15:58:20 +07:00
b947c1c6c4 add sample station handler, services, model 2024-05-29 15:58:20 +07:00
59a3f87644 add templ for md-sample-station 2024-05-29 15:58:20 +07:00
3719cbff71 Merge branch 'mike' 2024-05-29 14:24:00 +07:00
fb29e251d9 Merge branch 'mike' 2024-05-29 11:33:08 +07:00
sindhu
275205f5dd add model radio button 2024-05-29 11:22:49 +07:00
46 changed files with 12473 additions and 89 deletions

4978
assets/hanan/fisik-2.html Normal file

File diff suppressed because it is too large Load Diff

View 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>

View File

@@ -376,7 +376,7 @@ func CustomDropdownFilter(
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(idCmp)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 80, Col: 12}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 81, Col: 12}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
if templ_7745c5c3_Err != nil {
@@ -389,7 +389,7 @@ func CustomDropdownFilter(
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(hxName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 81, Col: 15}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 82, Col: 15}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
if templ_7745c5c3_Err != nil {
@@ -402,7 +402,7 @@ func CustomDropdownFilter(
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(hxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 82, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 83, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25))
if templ_7745c5c3_Err != nil {
@@ -415,7 +415,7 @@ func CustomDropdownFilter(
var templ_7745c5c3_Var26 string
templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(hxGet)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 83, Col: 16}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 84, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
if templ_7745c5c3_Err != nil {
@@ -428,7 +428,7 @@ func CustomDropdownFilter(
var templ_7745c5c3_Var27 string
templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 84, Col: 18}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 85, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
if templ_7745c5c3_Err != nil {
@@ -441,7 +441,7 @@ func CustomDropdownFilter(
var templ_7745c5c3_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(hxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 85, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 86, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil {
@@ -454,7 +454,7 @@ func CustomDropdownFilter(
var templ_7745c5c3_Var29 string
templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(hxTrigger)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 86, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 87, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
if templ_7745c5c3_Err != nil {
@@ -518,7 +518,7 @@ func CustomDropdownForm(
var templ_7745c5c3_Var33 string
templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Label)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 97, Col: 87}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 98, Col: 87}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
if templ_7745c5c3_Err != nil {
@@ -546,7 +546,7 @@ func CustomDropdownForm(
var templ_7745c5c3_Var34 string
templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Placeholder)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 106, Col: 26}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 107, Col: 26}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
if templ_7745c5c3_Err != nil {
@@ -559,7 +559,7 @@ func CustomDropdownForm(
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 109, Col: 18}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 110, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
if templ_7745c5c3_Err != nil {
@@ -572,7 +572,7 @@ func CustomDropdownForm(
var templ_7745c5c3_Var36 string
templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 110, Col: 14}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 111, Col: 14}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
if templ_7745c5c3_Err != nil {
@@ -593,7 +593,7 @@ func CustomDropdownForm(
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 115, Col: 17}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customdropdown\customdropdown.templ`, Line: 116, Col: 17}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
if templ_7745c5c3_Err != nil {

View File

@@ -28,3 +28,32 @@ templ Modal(modalID string, modalTitle string, modalBody templ.Component, modalA
</div>
</div>
}
templ ModalXL(modalID string, modalTitle string, modalBody templ.Component, modalAction 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 class="modal-footer border-top-0">
@modalAction
</div>
</div>
</div>
</div>
}

View File

@@ -83,3 +83,77 @@ func Modal(modalID string, modalTitle string, modalBody templ.Component, modalAc
return templ_7745c5c3_Err
})
}
func ModalXL(modalID string, modalTitle string, modalBody templ.Component, modalAction 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_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"modal fade\" style=\"display: none\" id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(modalID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal.templ`, Line: 36, Col: 14}
}
_, 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("\" 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_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(modalTitle)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\modal\modal.templ`, Line: 46, Col: 18}
}
_, 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("</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 class=\"modal-footer border-top-0\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalAction.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
})
}

View File

@@ -40,6 +40,50 @@ templ Navbar(dataUser models.User) {
</div>
}
templ NavbarWithLogo(dataUser models.User) {
<div id="kt_header" class="header">
<!--begin::Container-->
<div class="container-fluid d-flex align-items-stretch justify-content-between">
<!--begin::Header Menu Wrapper-->
<div class="header-menu-wrapper header-menu-wrapper-left" id="kt_header_menu_wrapper">
<a class="navbar-brand" href="#">
<img
src="/asset-corporate-portal/media/landingpage/logo.png"
width="126"
height="40"
class="d-inline-block align-top"
alt="Your Brand"
/>
</a>
</div>
<!--end::Header Menu Wrapper-->
<!--begin::Topbar-->
<div class="topbar">
<!--begin::User-->
<div class="topbar-item">
<div
class="btn btn-icon btn-icon-mobile w-auto btn-clean d-flex align-items-center btn-lg px-2"
id="kt_quick_user_toggle"
>
<span
class="text-muted font-weight-bold font-size-base d-none d-md-inline mr-1"
>Hi,</span>
<span
class="text-dark-50 font-weight-bolder font-size-base d-none d-md-inline mr-3"
>{ dataUser.Username }</span>
<span class="bg-primary-transparent p-3" style="border-radius: 50%; width: 40px; height: 40px;">
<span class="iconify text-primary" data-icon="gravity-ui:person"></span>
</span>
</div>
</div>
<!--end::User-->
</div>
<!--end::Topbar-->
</div>
<!--end::Container-->
</div>
}
templ NavbarMenu(datamenu []models.Menu) {
<div class="aside-menu-wrapper flex-column-fluid" id="kt_aside_menu_wrapper">
<!--begin::Menu Container-->

View File

@@ -53,7 +53,7 @@ func Navbar(dataUser models.User) templ.Component {
})
}
func NavbarMenu(datamenu []models.Menu) templ.Component {
func NavbarWithLogo(dataUser models.User) 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 {
@@ -66,6 +66,43 @@ func NavbarMenu(datamenu []models.Menu) templ.Component {
templ_7745c5c3_Var3 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"kt_header\" class=\"header\"><!--begin::Container--><div class=\"container-fluid d-flex align-items-stretch justify-content-between\"><!--begin::Header Menu Wrapper--><div class=\"header-menu-wrapper header-menu-wrapper-left\" id=\"kt_header_menu_wrapper\"><a class=\"navbar-brand\" href=\"#\"><img src=\"/asset-corporate-portal/media/landingpage/logo.png\" width=\"126\" height=\"40\" class=\"d-inline-block align-top\" alt=\"Your Brand\"></a></div><!--end::Header Menu Wrapper--><!--begin::Topbar--><div class=\"topbar\"><!--begin::User--><div class=\"topbar-item\"><div class=\"btn btn-icon btn-icon-mobile w-auto btn-clean d-flex align-items-center btn-lg px-2\" id=\"kt_quick_user_toggle\"><span class=\"text-muted font-weight-bold font-size-base d-none d-md-inline mr-1\">Hi,</span> <span class=\"text-dark-50 font-weight-bolder font-size-base d-none d-md-inline mr-3\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(dataUser.Username)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\navbar\navbar.templ`, Line: 73, Col: 26}
}
_, 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("</span> <span class=\"bg-primary-transparent p-3\" style=\"border-radius: 50%; width: 40px; height: 40px;\"><span class=\"iconify text-primary\" data-icon=\"gravity-ui:person\"></span></span></div></div><!--end::User--></div><!--end::Topbar--></div><!--end::Container--></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 NavbarMenu(datamenu []models.Menu) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"aside-menu-wrapper flex-column-fluid\" id=\"kt_aside_menu_wrapper\"><!--begin::Menu Container--><div id=\"kt_aside_menu\" class=\"aside-menu my-4 \" data-menu-vertical=\"1\" data-menu-scroll=\"1\" data-menu-dropdown-timeout=\"500\"><!--begin::Menu Nav--><ul class=\"menu-nav \">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err

10
go.mod
View File

@@ -4,17 +4,18 @@ go 1.21.0
require (
github.com/a-h/templ v0.2.663
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/jmoiron/sqlx v1.4.0
github.com/labstack/echo/v4 v4.12.0
github.com/spf13/viper v1.18.2
golang.org/x/text v0.14.0
)
require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
@@ -24,7 +25,6 @@ require (
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
@@ -36,7 +36,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/gommon v0.4.2 // indirect
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
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect

40
go.sum
View File

@@ -3,10 +3,13 @@ filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4
github.com/a-h/templ v0.2.663 h1:aa0WMm27InkYHGjimcM7us6hJ6BLhg98ZbfaiDPyjHE=
github.com/a-h/templ v0.2.663/go.mod h1:SA7mtYwVEajbIXFRh3vKdYm/4FYyLQAtPH1+KxzGPA8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/glebarez/go-sqlite v1.22.0 h1:uAcMJhaA6r3LHMTFgP0SifzgXg46yJkgxqyuyec+ruQ=
@@ -25,33 +28,36 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
github.com/labstack/echo/v4 v4.11.3 h1:Upyu3olaqSHkCjs1EJJwQ3WId8b8b1hxbogyommKktM=
github.com/labstack/echo/v4 v4.11.3/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrPqiEBfPYws=
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/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.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0=
github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
@@ -69,7 +75,6 @@ github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMV
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
@@ -78,43 +83,34 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/libc v1.37.6 h1:orZH3c5wmhIQFTXF+Nt+eeauyd+ZIt2BX6ARe+kD+aw=

View File

@@ -0,0 +1,180 @@
package dev_handlers
import (
breadcrumadmin "cpone/component/breadcrumbadmin"
navbarmenu "cpone/component/navbar"
"cpone/component/pagination"
sidebaruserprofile "cpone/component/sidebar_user_profile"
"cpone/models"
"cpone/services"
"cpone/utils"
dev_employeeanalytic "cpone/views/dev/employeeanalytic"
"strconv"
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
"go.uber.org/zap"
)
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)
}
type EmployeeAnalyticHandler struct {
EmployeeAnalyticServices EmployeeAnalyticServices
}
func NewEmployeeAnalyticHandler(ea EmployeeAnalyticServices) *EmployeeAnalyticHandler {
return &EmployeeAnalyticHandler{
EmployeeAnalyticServices: ea,
}
}
func (ea *EmployeeAnalyticHandler) HandleShowEmployeeAnalyticScreen(c echo.Context) error {
logger, _ := zap.NewProduction()
title := "PT. Sadhana Abiyasa Sampoerna"
listID := utils.GenerateRandomID("listid")
paginationID := utils.GenerateRandomID("paginationid")
user, err := services.GetUserLogin()
if err != nil {
defer logger.Sync()
logger.Info("Error get user dev", zap.Any("error", err))
return err
}
dataBreadcrumb, err := ea.EmployeeAnalyticServices.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.EmployeeAnalyticServices.ListingEmployeeAnalytic("", "", "", 1, 5)
if err != nil {
defer logger.Sync()
logger.Info("Error get listing data", zap.Any("error", err), zap.Any("total", totalPage))
return err
}
listingcomponent := dev_employeeanalytic.ListingData(listingData, listID)
paginationcomponent := pagination.PaginationV3(
totalPage,
1,
"/dev/employeeanalytic/changepage",
paginationID,
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
"#"+paginationID,
"outerHTML", "", "",
dev_employeeanalytic.BeforeRequestContent(),
dev_employeeanalytic.AfterRequestContent(),
)
filtercomponent := dev_employeeanalytic.FilterListing(
"/dev/employeeanalytic/filter",
"input changed delay:500ms",
"#searchID, #startdateID, #enddateID, #listID, #paginationID",
"outerHTML",
"#"+paginationID,
dev_employeeanalytic.BeforeRequestContent(),
dev_employeeanalytic.AfterRequestContent(),
)
content := dev_employeeanalytic.EmployeeAnalyticScreen(
listID,
paginationID,
breadcrumb,
filtercomponent,
listingcomponent,
paginationcomponent,
)
css := dev_employeeanalytic.CSSEmployeeAnalytic()
js := dev_employeeanalytic.JSEmployeeAnalytic()
view := dev_employeeanalytic.ShowEmployeeAnalytic(title, content, css, js, navbaruser, sidbaruser)
return utils.View(c, view)
}
func (ea *EmployeeAnalyticHandler) 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.EmployeeAnalyticServices.ListingEmployeeAnalytic(search, startdate, enddate, page, 5)
if err != nil {
defer logger.Sync()
logger.Info("Error convert page param")
return err
}
listcomponent := dev_employeeanalytic.ListingData(listdata, listID)
paginationcomponent := pagination.PaginationV3(
totalPage,
page,
"/dev/employeeanalytic/changepage",
paginationID,
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
"#"+paginationID,
"outerHTML", "", "",
dev_employeeanalytic.BeforeRequestContent(),
dev_employeeanalytic.AfterRequestContent(),
)
retVal = append(retVal, listcomponent)
retVal = append(retVal, paginationcomponent)
return utils.ViewMulti(c, retVal)
}
func (ea *EmployeeAnalyticHandler) 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.EmployeeAnalyticServices.ListingEmployeeAnalytic(search, startdate, enddate, 1, 5)
if err != nil {
defer logger.Sync()
logger.Info("Error Get Listing Data", zap.Any("error", err))
return err
}
listcomponent := dev_employeeanalytic.ListingData(dataList, listID)
paginationcomponent := pagination.PaginationV3(
totalPage, 1,
"/dev/employeeanalytic/changepage",
paginationID,
"#listID, #paginationID, #searchID, #startdateID, #enddateID",
"#"+paginationID, "outerHTML", "", "",
dev_employeeanalytic.BeforeRequestContent(),
dev_employeeanalytic.AfterRequestContent(),
)
var retval []templ.Component
retval = append(retval, listcomponent)
retval = append(retval, paginationcomponent)
return utils.ViewMulti(c, retval)
}

View File

@@ -411,10 +411,9 @@ func (lh *GroupResultHandler) HandlerShowGroupResultV1(c echo.Context) error {
Link: "/dev/groupresult/delete",
HxTarget: "#" + dialogdeleteBodyID,
HxSwap: "outerHTML",
// HxInclude: "#tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogDeleteID, #" + searchID + ", #currpage" + paginationID,
HxInclude: "#tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogDeleteID, #" + searchID + ", #currpage" + paginationID + ", #dialogEditBodyID, #dialogEditID",
ModalID: dialogdeleteID,
ModalTitle: "Delete-User Group",
HxInclude: "#tableID, #paginationID, #searchID,#dialogDeleteBodyID, #dialogDeleteID, #" + searchID + ", #currpage" + paginationID,
ModalID: dialogdeleteID,
ModalTitle: "Delete-User Group",
DialogBody: groupresult.DeleteConfirmationBody(
models.CustomTextFieldv2Prm{Type: "hidden", Value: "0", Name: "groupresultid"},
dialogdeleteBodyID, "Apakah anda yakin menghapus user group berikut ?",
@@ -1250,7 +1249,6 @@ func (lh *GroupResultHandler) HandleDeleteForm(c echo.Context) error {
id := c.QueryParam("id")
dialogDeleteID := c.QueryParam("dialogDeleteID")
dialogDeleteBodyID := c.QueryParam("dialogDeleteBodyID")
dataGroupList, err := lh.GroupResultService.GetGroupResultByIDV1(id)
if err != nil {
// test := mastermenuusergrouptryandy.DialogNewBody(code, name, "", "Name cannot empty")
@@ -1265,6 +1263,7 @@ func (lh *GroupResultHandler) HandleDeleteForm(c echo.Context) error {
customtoastv2.CustomToastV2Show("Error", err.Error(), "danger"),
test})
return coba
}
form := groupresult.DeleteConfirmationBody(

View 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)
}

File diff suppressed because it is too large Load Diff

View File

@@ -66,6 +66,7 @@ func SetupRoutesPublic(app *echo.Echo, appStore db.AppStore) {
l := public_services.NewServicesLandingPage(public_services.LandingPage{}, 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)
@@ -232,20 +233,12 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
// clientgroup.GET("/usergroup/edit", mastermenuusergroupHandler.ChangeFormEdit)
// clientgroup.GET("/usergroup/pagination", mastermenuusergroupHandler.HandleChangePage)
//New User Group
devMdUserGroupServices := dev_services.NewMdUserGroupServices(appStore)
devMdUserGroupHandlers := dev_handlers.NewMdUserGroupHandler(devMdUserGroupServices)
dev.GET("/md/usergroupv2", devMdUserGroupHandlers.HandleShowMdUserGroupScreen)
dev.GET("/md/usergroupv2/filter", devMdUserGroupHandlers.HandleFilterMdUserGroup)
dev.GET("/md/usergroupv2/changepage", devMdUserGroupHandlers.HandleChangePageMdUserGroup)
dev.POST("/md/usergroupv2/closeaddform", devMdUserGroupHandlers.HandleCloseFormAdd)
dev.POST("/md/usergroupv2/add", devMdUserGroupHandlers.HandleAddUserGroup)
dev.GET("/md/usergroupv2/openedit", devMdUserGroupHandlers.HandleOpenEditForm)
dev.POST("/md/usergroupv2/closeeditform", devMdUserGroupHandlers.HandleCloseFormEdit)
dev.POST("/md/usergroupv2/edit", devMdUserGroupHandlers.HandleEditUserGroup)
dev.GET("/md/usergroupv2/opendelete", devMdUserGroupHandlers.HandleOpenDeleteForm)
dev.POST("/md/usergroupv2/closedeleteform", devMdUserGroupHandlers.HandleCloseFormDelete)
dev.POST("/md/usergroupv2/delete", devMdUserGroupHandlers.HandleDeleteUserGroup)
// 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)
// group result
devGRServices := dev_services.NewServicesGroupResult(appStore)
@@ -262,6 +255,37 @@ func SetupRoutesDev(app *echo.Echo, appStore db.AppStore) {
dev.POST("/groupresult/add", devGRhandlers.AddGroupResult)
dev.POST("/groupresult/edit", devGRhandlers.EditGroupResult)
dev.POST("/groupresult/delete", devGRhandlers.DeleteGroupResult)
//New User Group
devMdUserGroupServices := dev_services.NewMdUserGroupServices(appStore)
devMdUserGroupHandlers := dev_handlers.NewMdUserGroupHandler(devMdUserGroupServices)
dev.GET("/md/usergroupv2", devMdUserGroupHandlers.HandleShowMdUserGroupScreen)
dev.GET("/md/usergroupv2/filter", devMdUserGroupHandlers.HandleFilterMdUserGroup)
dev.GET("/md/usergroupv2/changepage", devMdUserGroupHandlers.HandleChangePageMdUserGroup)
dev.POST("/md/usergroupv2/closeaddform", devMdUserGroupHandlers.HandleCloseFormAdd)
dev.POST("/md/usergroupv2/add", devMdUserGroupHandlers.HandleAddUserGroup)
dev.GET("/md/usergroupv2/openedit", devMdUserGroupHandlers.HandleOpenEditForm)
dev.POST("/md/usergroupv2/closeeditform", devMdUserGroupHandlers.HandleCloseFormEdit)
dev.POST("/md/usergroupv2/edit", devMdUserGroupHandlers.HandleEditUserGroup)
dev.GET("/md/usergroupv2/opendelete", devMdUserGroupHandlers.HandleOpenDeleteForm)
dev.POST("/md/usergroupv2/closedeleteform", devMdUserGroupHandlers.HandleCloseFormDelete)
dev.POST("/md/usergroupv2/delete", devMdUserGroupHandlers.HandleDeleteUserGroup)
// md sample station
devMDSampleStationServices := dev_services.NewMDSampleStationServices(appStore)
devMDSampleStationHandlers := dev_handlers.NewMDSampleStationHandler(devMDSampleStationServices)
dev.GET("/md/samplestation", devMDSampleStationHandlers.HandleShowMDSampleStationScreen)
dev.GET("/md/samplestation/filter", devMDSampleStationHandlers.HandleFilterMDSS)
dev.GET("/md/samplestation/changepage", devMDSampleStationHandlers.HandleChangePageSampleStation)
dev.POST("/md/samplestation/add", devMDSampleStationHandlers.HandleAddMDSampleStation)
dev.POST("/md/samplestation/closeaddform", devMDSampleStationHandlers.HandleCloseFormAdd)
dev.GET("/md/samplestation/opendelete", devMDSampleStationHandlers.HandleOpenDeleteForm)
dev.POST("/md/samplestation/closedeleteform", devMDSampleStationHandlers.HandleCloseFormDelete)
dev.POST("/md/samplestation/delete", devMDSampleStationHandlers.HandleDeleteMDSS)
dev.GET("/md/samplestation/openedit", devMDSampleStationHandlers.HandleOpenEditForm)
dev.POST("/md/samplestation/edit", devMDSampleStationHandlers.HandleEditMDSS)
dev.POST("/md/samplestation/closeeditform", devMDSampleStationHandlers.HandleCloseEditForm)
// masterdata nat unit
devMdNatUnitServices := dev_services.NewMdNatUnitServices(appStore)
devMdNatUnitHandlers := dev_handlers.NeWMdNatUnitHandler(devMdNatUnitServices)
@@ -305,4 +329,9 @@ 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)
}

View File

@@ -0,0 +1,174 @@
package layout
templ EmployeeAnalyticLayout(
title string,
css templ.Component,
js templ.Component,
navbaruser templ.Component,
sidebaruser templ.Component,
) {
<!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="assets/css/googlefont/publicsans.css"
/>
<link
rel="stylesheet"
href="assets/css/googlefont/roboto.css"
/>
<!-- slick -->
<link
rel="stylesheet"
type="text/css"
href="assets/css/slick/slick.css"
/>
<link
rel="stylesheet"
type="text/css"
href="assets/css/slick/slick-theme.css"
/>
@css
</head>
<!--end::Head-->
<!--begin::Body-->
<body id="kt_body" class="header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading bg-white">
<script src="assets/js/htmx/htmx.min.js"></script>
<!--start::Navbar Mobile-->
<div id="kt_header_mobile" class="header-mobile align-items-center header-mobile-fixed ">
<!--begin::Logo-->
<a href="index.html">
<img alt="Logo" src="asset-corporate-portal/media/logo/logo.png" style="object-fit: contain;height: 4vh;"/>
</a>
<!--end::Logo-->
<!--begin::Toolbar-->
<div class="d-flex align-items-center">
<!--begin::Topbar Mobile Toggle-->
<button class="btn btn-hover-text-primary p-0 ml-2" id="kt_header_mobile_topbar_toggle">
<span class="svg-icon svg-icon-xl">
<!--begin::Svg Icon | path:/assets/media/svg/icons/General/User.svg-->
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="24px"
height="24px"
viewBox="0 0 24 24"
version="1.1"
>
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<polygon points="0 0 24 0 24 24 0 24"></polygon>
<path
d="M12,11 C9.790861,11 8,9.209139 8,7 C8,4.790861 9.790861,3 12,3 C14.209139,3 16,4.790861 16,7 C16,9.209139 14.209139,11 12,11 Z"
fill="#000000"
fill-rule="nonzero"
opacity="0.3"
></path>
<path
d="M3.00065168,20.1992055 C3.38825852,15.4265159 7.26191235,13 11.9833413,13 C16.7712164,13 20.7048837,15.2931929 20.9979143,20.2 C21.0095879,20.3954741 20.9979143,21 20.2466999,21 C16.541124,21 11.0347247,21 3.72750223,21 C3.47671215,21 2.97953825,20.45918 3.00065168,20.1992055 Z"
fill="#000000"
fill-rule="nonzero"
></path>
</g>
</svg><!--end::Svg Icon-->
</span>
</button>
<!--end::Topbar Mobile Toggle-->
</div>
<!--end::Toolbar-->
</div>
<!--start::Navbar Mobile-->
<!--start::Navbar Laptop With Sidebar-->
<div class="mb-24 mt-8" style="padding-left: 10vw; padding-right: 10vw;">
<div class="align-item-center">
@navbaruser
</div>
<div class="mt-16">
{ children... }
</div>
</div>
<!--end::Navbar Laptop With Sidebar-->
@sidebaruser
<!--begin::Global Config(global config for global JS scripts)-->
<script src="asset-corporate-portal/js/ktappsetting.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>
<!--end::Global Theme Bundle-->
<script src="assets/js/iconify/iconify.min.js"></script>
// bootstrap datepicker
<script src="assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js"></script>
@js
<!--end::Page Scripts-->
</body>
</html>
}

View File

@@ -0,0 +1,94 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package layout
//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 EmployeeAnalyticLayout(
title string,
css templ.Component,
js templ.Component,
navbaruser templ.Component,
sidebaruser 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("<!doctype html><html lang=\"en\"><!--begin::Head--><head><base href=\"/\"><meta charset=\"utf-8\"><title>Company Portal | ")
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: `layout\layout_employee_analytic.templ`, Line: 16, Col: 34}
}
_, 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("</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=\"assets/css/googlefont/publicsans.css\"><link rel=\"stylesheet\" href=\"assets/css/googlefont/roboto.css\"><!-- slick --><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/slick/slick.css\"><link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/slick/slick-theme.css\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = css.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</head><!--end::Head--><!--begin::Body--><body id=\"kt_body\" class=\"header-fixed header-mobile-fixed subheader-enabled subheader-fixed subheader-mobile-fixed aside-enabled aside-fixed aside-minimize-hoverable page-loading bg-white\"><script src=\"assets/js/htmx/htmx.min.js\"></script><!--start::Navbar Mobile--><div id=\"kt_header_mobile\" class=\"header-mobile align-items-center header-mobile-fixed \"><!--begin::Logo--><a href=\"index.html\"><img alt=\"Logo\" src=\"asset-corporate-portal/media/logo/logo.png\" style=\"object-fit: contain;height: 4vh;\"></a><!--end::Logo--><!--begin::Toolbar--><div class=\"d-flex align-items-center\"><!--begin::Topbar Mobile Toggle--><button class=\"btn btn-hover-text-primary p-0 ml-2\" id=\"kt_header_mobile_topbar_toggle\"><span class=\"svg-icon svg-icon-xl\"><!--begin::Svg Icon | path:/assets/media/svg/icons/General/User.svg--><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" version=\"1.1\"><g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><polygon points=\"0 0 24 0 24 24 0 24\"></polygon> <path d=\"M12,11 C9.790861,11 8,9.209139 8,7 C8,4.790861 9.790861,3 12,3 C14.209139,3 16,4.790861 16,7 C16,9.209139 14.209139,11 12,11 Z\" fill=\"#000000\" fill-rule=\"nonzero\" opacity=\"0.3\"></path> <path d=\"M3.00065168,20.1992055 C3.38825852,15.4265159 7.26191235,13 11.9833413,13 C16.7712164,13 20.7048837,15.2931929 20.9979143,20.2 C21.0095879,20.3954741 20.9979143,21 20.2466999,21 C16.541124,21 11.0347247,21 3.72750223,21 C3.47671215,21 2.97953825,20.45918 3.00065168,20.1992055 Z\" fill=\"#000000\" fill-rule=\"nonzero\"></path></g></svg><!--end::Svg Icon--></span></button><!--end::Topbar Mobile Toggle--></div><!--end::Toolbar--></div><!--start::Navbar Mobile--><!--start::Navbar Laptop With Sidebar--><div class=\"mb-24 mt-8\" style=\"padding-left: 10vw; padding-right: 10vw;\"><div class=\"align-item-center\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = navbaruser.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"mt-16\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div><!--end::Navbar Laptop With Sidebar-->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = sidebaruser.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--begin::Global Config(global config for global JS scripts)--><script src=\"asset-corporate-portal/js/ktappsetting.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><!--end::Global Theme Bundle--><script src=\"assets/js/iconify/iconify.min.js\"></script><script src=\"assets/js/pages/crud/forms/widgets/bootstrap-datepicker.js\"></script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = js.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!--end::Page Scripts--></body></html>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -3,18 +3,6 @@ package layout
// LAYOUT PLAYGROUND
templ PlaygroundLayout(title string, css templ.Component, js templ.Component) {
<!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>

View File

@@ -24,14 +24,14 @@ func PlaygroundLayout(title string, css templ.Component, js templ.Component) tem
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><!--\r\n\t\tTemplate Name: Metronic - Bootstrap 4 HTML, React, Angular 9 & VueJS Admin Dashboard Theme\r\n\t\tAuthor: KeenThemes\r\n\t\tWebsite: http://www.keenthemes.com/\r\n\t\tContact: support@keenthemes.com\r\n\t\tFollow: www.twitter.com/keenthemes\r\n\t\tDribbble: www.dribbble.com/keenthemes\r\n\t\tLike: www.facebook.com/keenthemes\r\n\t\tPurchase: https://1.envato.market/EA4JP\r\n\t\tRenew Support: https://1.envato.market/EA4JP\r\n\t\tLicense: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.\r\n\t\t--><html lang=\"en\"><!--begin::Head--><head><base href=\"/\"><meta charset=\"utf-8\"><title>Company Portal | ")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html lang=\"en\"><!--begin::Head--><head><base href=\"/\"><meta charset=\"utf-8\"><title>Company Portal | ")
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: `layout\playground_layout.templ`, Line: 23, Col: 34}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `layout\playground_layout.templ`, Line: 11, Col: 34}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil {

View File

@@ -0,0 +1,16 @@
package models
type CustomRadioButtonv1Prm struct {
HxTarget string `default:"hxTarget"`
HxGet string `default:"hxGet"`
HxIndicator string `default:"hxIndicator"`
HxInclude string `default:"hxInclude"`
HxTrigger string `default:"hxTrigger"`
Label string `default:"Label"`
Name string `default:"name"`
Text string `default:"text"`
// Type string `default:"text"`
Value string `default:""`
ErrorMsg string `default:""`
ID string
}

View File

@@ -0,0 +1,15 @@
package models
type EmployeeAnalytic struct {
Mgm_McuID int `db:"Mgm_McuID"`
Mgm_McuLabel string `db:"Mgm_McuLabel"`
Mgm_McuFlagRelasiBayarSendiri string `db:"Mgm_McuFlagRelasiBayarSendiri"`
Mgm_McuBisaTambahPemeriksaan string `db:"Mgm_McuBisaTambahPemeriksaan"`
Mgm_McuCorporateID int `db:"Mgm_McuCorporateID"`
Mgm_McuNumber string `db:"Mgm_McuNumber"`
Mgm_McuNumberNational string `db:"Mgm_McuNumberNational"`
Mgm_McuNote string `db:"Mgm_McuNote"`
Mgm_McuStartDate string `db:"Mgm_McuStartDate"`
Mgm_McuEndDate string `db:"Mgm_McuEndDate"`
Mgm_McuIsActive string `db:"Mgm_McuIsActive"`
}

View File

@@ -0,0 +1,7 @@
package models
type ModelKesimpulanLab struct {
Nomor string `db:"nomor"`
Test string `db:"Test"`
Total string `db:"total"`
}

View File

@@ -0,0 +1,47 @@
package models
import "github.com/a-h/templ"
type MDSampleStation struct {
T_SampleStationID int `db:"T_SampleStationID"`
T_SampleStationCode string `db:"T_SampleStationCode"`
T_SampleStationName string `db:"T_SampleStationName"`
T_SampleStationNat_GroupID string `db:"T_SampleStationNat_GroupID"`
T_SampleStationIsNonLab string `db:"T_SampleStationIsNonLab"`
T_SampleStationIsActive string `db:"T_SampleStationIsActive"`
}
type MDSampleStationForm struct {
IDComponent string
Link string
HxTarget string
HxSwap string
HxInclude string
ModalID string
ModalTitle string
InputID CustomTextFieldv2Prm
InputCode CustomTextFieldv2Prm
InputName CustomTextFieldv2Prm
InputGroup CustomDropdownv1Prm
DialogBody templ.Component
DialogAction templ.Component
ButtonClose templ.Component
}
type MDSampleStationConfirmation struct {
IDComponent string
Link string
HxTarget string
HxSwap string
HxInclude string
ModalID string
ModalTitle string
DialogBody templ.Component
DialogAction templ.Component
ButtonClose templ.Component
}
type MDSampleStationGroup struct {
ID int `default:"id"`
Group string `default:"group"`
}

View File

@@ -0,0 +1,29 @@
package models
import "database/sql"
type TerminologyV0 struct {
ResourceType string `db:"resource_type"`
AttributePath string `db:"attribute_path"`
Code string `db:"code"`
ParentCode string `db:"parent_code"`
Display string `db:"display"`
DisplayEn string `db:"display_en"`
CodeSystem string `db:"code_system"`
OrderNo uint `db:"order_no"`
FtIndex sql.NullString `db:"ft_index"`
UseInd bool `db:"use_ind"`
Description sql.NullString `db:"description"`
StatusCd string `db:"status_cd"`
CreatedDttm string `db:"created_dttm"`
CreatedUserID uint `db:"created_user_id"`
UpdatedDttm string `db:"updated_dttm"`
UpdatedUserID uint `db:"updated_user_id"`
NullifiedDttm string `db:"nullified_dttm"`
NullifiedUserID uint `db:"nullified_user_id"`
}
type TerminologyParamv0 struct {
AttributePath string `json:"AttributePath"`
CodeSystem string `json:"CodeSystem"`
}

View File

@@ -16,6 +16,10 @@ import (
var Handle *sql.DB
var Handlex *sqlx.DB
// log
var HandleLog *sql.DB
var HandlexLog *sqlx.DB
func InitDB() {
println(config.Data.Get("DBhost"))
if config.Data.Get("DBhost") == "" {
@@ -28,6 +32,15 @@ func InitDB() {
}
Handle = handle
// log handle
handlelog, err := sql.Open("sqlite", config.Data.Get("DBnamelog"))
if err != nil {
// log.Fatalf("🔥 failed to connect to the database: %s", err.Error())
log.Panic(err)
}
HandleLog = handlelog
// log handle
db, err := sqlx.Open("sqlite", config.Data.Get("DBname"))
if err != nil {
@@ -35,6 +48,16 @@ func InitDB() {
}
Handlex = db
// log
dblog, err := sqlx.Open("sqlite", config.Data.Get("DBnamelog"))
if err != nil {
log.Fatal(err)
}
HandlexLog = dblog
// log
} else {
println("mysql")
dsn := config.Data.Get("DBuser") + ":" + config.Data.Get("DBpass") + "@tcp(" + config.Data.Get("DBhost") + ":" + config.Data.Get("DBport") + ")/" + config.Data.Get("DBname")
@@ -50,6 +73,21 @@ func InitDB() {
}
Handle = handle
// log
dsnlog := config.Data.Get("DBuser") + ":" + config.Data.Get("DBpass") + "@tcp(" + config.Data.Get("DBhost") + ":" + config.Data.Get("DBport") + ")/" + config.Data.Get("DBnamelog")
println(dsnlog)
handlelog, err := sql.Open("mysql", dsnlog)
if err != nil {
log.Panic(err)
}
if err = handlelog.Ping(); err != nil {
log.Panic(err)
}
HandleLog = handlelog
// log
// sqlx
db, err := sqlx.Open("mysql", dsn)
@@ -59,6 +97,16 @@ func InitDB() {
Handlex = db
// log
dblog, err := sqlx.Open("mysql", dsnlog)
if err != nil {
log.Fatal(err)
}
HandlexLog = dblog
// log
}
log.Println("🚀 Connected Successfully to the Database")

View File

@@ -1,8 +1,14 @@
package services
import "cpone/models"
import (
"cpone/models"
dbx "cpone/package/database"
"fmt"
//Func get menu sidebar
"go.uber.org/zap"
)
// Func get menu sidebar
func GetMenu() ([]models.Menu, error) {
// dummyBreadcrumb := []Breadcrumb{
@@ -515,6 +521,30 @@ func GetUserLogin() (models.User, error) {
return a, nil
}
func GetTerminology(attributePath string, codeSystem string) {
func GetTerminologyList(inp models.TerminologyParamv0) ([]models.TerminologyV0, error) {
logger, _ := zap.NewProduction()
defer logger.Sync()
var term []models.TerminologyV0
query := `
SELECT
*
FROM terminology
WHERE status_cd = 'normal'
AND code_system = ?
AND attribute_path = ?
`
logger.Info("QUERY SEARCH TERMINOLOGY",
zap.String("query search", query),
)
if err := dbx.Handlex.Select(&term, query,
inp.CodeSystem,
inp.AttributePath); err != nil {
return nil, fmt.Errorf("error querying database terminology: %v", err)
}
return term, nil
}

View File

@@ -0,0 +1,128 @@
package dev_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"fmt"
"math"
"go.uber.org/zap"
)
type EmployeeAnalyticServices struct {
EmployeeAnalyticStore db.AppStore
}
func NewEmployeeAnalyticServices(uStore db.AppStore) *EmployeeAnalyticServices {
return &EmployeeAnalyticServices{
EmployeeAnalyticStore: uStore,
}
}
func (ea *EmployeeAnalyticServices) GetEmployeeAnalyticBreadcrumb(title string) (models.BreadCrumbV1, error) {
breadcrumb := models.BreadCrumbV1{
Title: title,
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Employee Health Medical Analytic",
Url: "",
},
},
}
return breadcrumb, nil
}
func (ea *EmployeeAnalyticServices) DummyDataTest() ([]models.EmployeeAnalytic, error) {
employees := []models.EmployeeAnalytic{
{
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 *EmployeeAnalyticServices) ListingEmployeeAnalytic(search string, startdate string, enddate string, currentpage int, rowperpage int) ([]models.EmployeeAnalytic, int, error) {
logger, _ := zap.NewProduction()
var ret []models.EmployeeAnalytic
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
}

View 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
}

View File

@@ -0,0 +1,277 @@
package dev_services
import (
"cpone/db"
"cpone/models"
dbx "cpone/package/database"
"fmt"
"math"
"strconv"
"strings"
"go.uber.org/zap"
)
func NewMDSampleStationServices(uStore db.AppStore) *MDSampleStationServices {
return &MDSampleStationServices{
MDSampleStationStore: uStore,
}
}
type MDSampleStationServices struct {
MDSampleStationStore db.AppStore
}
func (ss *MDSampleStationServices) GetMDSampleStationBreadcrumb() (models.BreadCrumbV1, error) {
var ret models.BreadCrumbV1
Breadcrumb := models.BreadCrumbV1{
Title: "Master Sample Station",
Item: []models.ItemBreadCrumbV1{
{
Item: "Dashboard",
Url: "/dev/dashboard",
},
{
Item: "Master",
Url: "/dev/master",
},
{
Item: "Sample Stasion",
Url: "",
},
},
}
ret = Breadcrumb
return ret, nil
}
func (ss *MDSampleStationServices) GetListSampleStation(search string, currentPage int, rowPerPage int) ([]models.MDSampleStation, int, error) {
var sampleStationList []models.MDSampleStation
var totalData int
offset := (currentPage - 1) * rowPerPage
prm := "%" + strings.TrimSpace(search) + "%"
querytotal := `
SELECT COUNT(*)
FROM t_samplestation
WHERE T_SampleStationIsActive = 'Y' AND (T_SampleStationCode LIKE ? OR T_SampleStationName LIKE ?)
`
if err := dbx.Handlex.Get(&totalData, querytotal, prm, prm); err != nil {
return nil, 0, fmt.Errorf("error query get total data: %v", err)
}
query := `
SELECT
T_SampleStationID,
T_SampleStationCode,
T_SampleStationName,
T_SampleStationNat_GroupID,
T_SampleStationIsNonLab,
T_SampleStationIsActive
FROM t_samplestation
WHERE T_SampleStationIsActive = 'Y'
AND (T_SampleStationCode LIKE ? OR T_SampleStationName LIKE ?)
ORDER BY T_SampleStationID ASC
LIMIT ? OFFSET ?
`
if err := dbx.Handlex.Select(&sampleStationList, query, prm, prm, rowPerPage, offset); err != nil {
return nil, 0, fmt.Errorf("error query database: %v", err)
}
for i := range sampleStationList {
if len(sampleStationList[i].T_SampleStationIsNonLab) == 0 {
sampleStationList[i].T_SampleStationIsNonLab = "LAB"
}
}
totalPage := int(math.Ceil(float64(totalData) / float64(rowPerPage)))
return sampleStationList, totalPage, nil
}
func (ss *MDSampleStationServices) GetMDSampleStationByID(id string) (models.MDSampleStation, error) {
logger, _ := zap.NewProduction()
var ret models.MDSampleStation
q := `
SELECT
T_SampleStationID,
T_SampleStationCode,
T_SampleStationName,
T_SampleStationNat_GroupID,
T_SampleStationIsNonLab,
T_SampleStationIsActive
FROM t_samplestation
WHERE T_SampleStationID = ?`
err := dbx.Handlex.Get(&ret, q, id)
if err != nil {
defer logger.Sync()
logger.Error("Error get data by ID", zap.String("ID", id), zap.Error(err))
return ret, fmt.Errorf("query get data by id failed")
}
if len(ret.T_SampleStationIsNonLab) == 0 {
ret.T_SampleStationIsNonLab = "LAB"
}
return ret, nil
}
func (ss *MDSampleStationServices) GetListGroupSampleStation() ([]models.MDSampleStationGroup, error) {
data := []models.MDSampleStationGroup{
{
ID: 1,
Group: "RADIODIAGNOSTIC",
},
{
ID: 2,
Group: "ELEKTROMEDIS",
},
{
ID: 3,
Group: "LAB",
},
{
ID: 4,
Group: "OTHERS",
},
}
return data, nil
}
func (ss *MDSampleStationServices) AddMDSampleStation(code string, name string, group string) (models.MDSampleStation, error) {
logger, _ := zap.NewProduction()
var data models.MDSampleStation
if strings.ToUpper(group) == "LAB" {
group = " "
}
// cek existing code & name
var count int
var prmCode = "%" + code + "%"
var prmName = "%" + name + "%"
q := `
SELECT COUNT(*)
FROM t_samplestation
WHERE (T_SampleStationCode LIKE ? OR T_SampleStationName LIKE ?)
AND T_SampleStationIsActive = 'Y'
`
err := dbx.Handlex.Get(&count, q, prmCode, prmName)
if err != nil {
defer logger.Sync()
logger.Error("cek duplicate", zap.Any("code", prmCode), zap.Any("name", prmName))
return data, fmt.Errorf("query failed to cek duplicate")
}
if count > 0 {
defer logger.Sync()
logger.Error("duplicate data", zap.Any("code", code), zap.Any("name", name))
return data, fmt.Errorf("duplicate code or name")
}
q = `
INSERT INTO t_samplestation (
T_SampleStationCode,
T_SampleStationName,
T_SampleStationIsNonLab,
T_SampleStationCreated,
T_SampleStationCreatedUserID
) VALUES (?,?,?,NOW(),1);
`
rst := dbx.Handlex.MustExec(q, code, name, group)
insertedID, err := rst.LastInsertId()
if err != nil {
defer logger.Sync()
logger.Error("error insert data", zap.Any("code", code), zap.Any("name", name), zap.Any("group", group))
return data, fmt.Errorf("query failed insert data")
}
s := strconv.Itoa(int(insertedID))
return ss.GetMDSampleStationByID(s)
}
func (ss *MDSampleStationServices) EditMDSampleStation(id string, code string, name string, group string) (models.MDSampleStation, error) {
logger, _ := zap.NewProduction()
var ret models.MDSampleStation
if strings.ToUpper(group) == "LAB" {
group = " "
}
// cek existeing code & name
var count int
var prmCode = "%" + code + "%"
var prmName = "%" + name + "%"
q := `
SELECT COUNT(*)
FROM t_samplestation
WHERE (T_SampleStationCode LIKE ? OR T_SampleStationName LIKE ?)
AND T_SampleStationIsActive = 'Y'
AND T_SampleStationID <> ?
`
err := dbx.Handlex.Get(&count, q, prmCode, prmName, id)
if err != nil {
defer logger.Sync()
logger.Error("cek duplicate", zap.Any("code", code), zap.Any("name", name))
return ret, fmt.Errorf("query failed to cek duplicate")
}
if count > 0 {
defer logger.Sync()
logger.Error("duplicate data", zap.Any("code", code), zap.Any("name", name))
return ret, fmt.Errorf("duplicate code or name")
}
// update data
q = `
UPDATE t_samplestation SET
T_SampleStationCode = ?,
T_SampleStationName = ?,
T_SampleStationIsNonLab = ?,
T_SampleStationLastUpdated = NOW(),
T_SampleStationLastUpdatedUserID = 1
WHERE T_SampleStationID = ?;
`
updt := dbx.Handlex.MustExec(q, code, name, group, id)
_, err = updt.RowsAffected()
if err != nil {
defer logger.Sync()
logger.Error("error update data", zap.Any("code", code), zap.Any("name", name), zap.Any("group", group))
return ret, fmt.Errorf("query failed to update data")
}
return ss.GetMDSampleStationByID(id)
}
func (ss *MDSampleStationServices) DeleteMDSampleStation(id string) (models.MDSampleStation, error) {
logger, _ := zap.NewProduction()
var ret models.MDSampleStation
q := `
UPDATE t_samplestation
SET
T_SampleStationIsActive = 'N',
T_SampleStationDeleted = NOW(),
T_SampleStationDeletedUserID = '1'
WHERE T_SampleStationID = ?;
`
dlt := dbx.Handlex.MustExec(q, id)
_, err := dlt.RowsAffected()
if err != nil {
defer logger.Sync()
logger.Error("Error delete sample station", zap.String("id", id))
return ret, fmt.Errorf("query failed")
}
ret, err = ss.GetMDSampleStationByID(id)
if err != nil {
defer logger.Sync()
logger.Error("Error get sample station id", zap.String("id", id))
return ret, fmt.Errorf("query failed")
}
return ret, nil
}

View File

@@ -0,0 +1,181 @@
package dev_employeeanalytic
import "cpone/layout"
import "cpone/component/customtextfield"
import "cpone/models"
templ EmployeeAnalyticScreen(
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 CSSEmployeeAnalytic() {
<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>
}
templ JSEmployeeAnalytic() {
<script>
document.addEventListener('htmx:afterSwap', function(event) {
// Reinitialize selectpicker after HTMX content swap
$('.selectpicker').selectpicker('refresh');
});
document.addEventListener('htmx:beforeRequest', function(event) {
console.log("Before Request")
console.log(event.detail.xhr)
console.log(event.detail.target)
});
document.addEventListener('htmx:afterRequest', function(event) {
console.log("After Request")
console.log(event.detail.xhr)
console.log(event.detail.target)
});
document.addEventListener('htmx:historyCacheError', function(event) {
console.log("Error History Cache Error")
console.log(event.detail.cause)
});
document.addEventListener('htmx:historyCacheMissError', function(event) {
console.log("Error History Cache Miss Error")
console.log(event.detail.xhr)
console.log(event.detail.path)
});
document.addEventListener('htmx:oobErrorNoTarget', function(event) {
console.log("Error OOB No Target")
console.log(event.detail.content)
});
document.addEventListener('htmx:onLoadError', function(event) {
console.log("Error On Load")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log(event.detail.target)
console.log(event.detail.exception)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:responseError', function(event) {
console.log("Error Response")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:sendError', function(event) {
console.log("Error Send Error")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:sseError', function(event) {
console.log("Error Sse ")
console.log(event.detail.xhr)
console.log(event.detail.error)
console.log(event.detail.source)
});
document.addEventListener('htmx:swapError', function(event) {
console.log("Error Swap Error")
console.log(event.detail.xhr)
console.log(event.detail.elt)
console.log("Target Swap: "+event.detail.target)
console.log(event.detail.requestConfig)
});
document.addEventListener('htmx:targetError', function(event) {
console.log("Error target")
console.log(event.detail.elt)
console.log("Target ID: "+event.detail.target)
});
</script>
}
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 ShowEmployeeAnalytic(
title string,
cmp templ.Component,
css templ.Component,
js templ.Component,
navbaruser templ.Component,
userprofile templ.Component,
) {
@layout.EmployeeAnalyticLayout(title, css, js, navbaruser, userprofile) {
@cmp
}
}

View File

@@ -0,0 +1,220 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_employeeanalytic
//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 EmployeeAnalyticScreen(
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 CSSEmployeeAnalytic() 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
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func JSEmployeeAnalytic() 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>\r\n\t\tdocument.addEventListener('htmx:afterSwap', function(event) {\r\n\t\t\t// Reinitialize selectpicker after HTMX content swap\r\n\t\t\t$('.selectpicker').selectpicker('refresh');\r\n\t\t});\r\n \r\n document.addEventListener('htmx:beforeRequest', function(event) {\r\n console.log(\"Before Request\")\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.target)\r\n \r\n });\r\n\r\n document.addEventListener('htmx:afterRequest', function(event) {\r\n console.log(\"After Request\")\r\n console.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.target)\r\n });\r\n document.addEventListener('htmx:historyCacheError', function(event) {\r\n console.log(\"Error History Cache Error\")\r\n console.log(event.detail.cause)\r\n\t\t\t\r\n });\r\n document.addEventListener('htmx:historyCacheMissError', function(event) {\r\n console.log(\"Error History Cache Miss Error\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.path)\r\n\t\t\t\r\n });\r\n document.addEventListener('htmx:oobErrorNoTarget', function(event) {\r\n console.log(\"Error OOB No Target\")\r\n console.log(event.detail.content)\r\n });\r\n document.addEventListener('htmx:onLoadError', function(event) {\r\n console.log(\"Error On Load\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(event.detail.target)\r\n console.log(event.detail.exception)\r\n console.log(event.detail.requestConfig)\r\n });\r\n document.addEventListener('htmx:responseError', function(event) {\r\n console.log(\"Error Response\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(event.detail.requestConfig)\r\n });\r\n document.addEventListener('htmx:sendError', function(event) {\r\n console.log(\"Error Send Error\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(event.detail.requestConfig)\r\n });\r\n document.addEventListener('htmx:sseError', function(event) {\r\n console.log(\"Error Sse \")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.error)\r\n console.log(event.detail.source)\r\n });\r\n\t\tdocument.addEventListener('htmx:swapError', function(event) {\r\n console.log(\"Error Swap Error\")\r\n console.log(event.detail.xhr)\r\n console.log(event.detail.elt)\r\n console.log(\"Target Swap: \"+event.detail.target)\r\n console.log(event.detail.requestConfig)\r\n });\r\n\t\tdocument.addEventListener('htmx:targetError', function(event) {\r\n console.log(\"Error target\")\r\n console.log(event.detail.elt)\r\n console.log(\"Target ID: \"+event.detail.target)\r\n });\r\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func 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 ShowEmployeeAnalytic(
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.EmployeeAnalyticLayout(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
})
}

View File

@@ -0,0 +1,68 @@
package dev_employeeanalytic
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>
}

View File

@@ -0,0 +1,316 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_employeeanalytic
//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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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\dev\employeeanalytic\filteremployeeanalytic.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
})
}

View File

@@ -0,0 +1,41 @@
package dev_employeeanalytic
import "cpone/models"
import "strconv"
templ ListingData(
data []models.EmployeeAnalytic,
listID string,
) {
<div id={listID} class="align-items-center pt-8 flex-column" hx-swap-oob="true">
<div class="bg-field rounded">
<div class="p-8">
for i, d := range data {
if i == (len(data) - 1) {
<div id={ strconv.Itoa(int(d.Mgm_McuID)) } class="card shadow p-8">
@ItemCard(d)
</div>
} else {
<div id={ strconv.Itoa(int(d.Mgm_McuID)) } class="card shadow p-8 mb-8">
@ItemCard(d)
</div>
}
}
</div>
</div>
</div>
}
templ ItemCard(data models.EmployeeAnalytic) {
<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>
}

View File

@@ -0,0 +1,189 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_employeeanalytic
//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.EmployeeAnalytic,
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\dev\employeeanalytic\listingemployeeanalytic.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 pt-8 flex-column\" hx-swap-oob=\"true\"><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\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 15, Col: 64}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"card shadow p-8\">")
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_Var4 string
templ_7745c5c3_Var4, 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\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 19, Col: 64}
}
_, 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=\"card shadow p-8 mb-8\">")
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></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.EmployeeAnalytic) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div 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_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuLabel)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 32, Col: 54}
}
_, 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("</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_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuNote)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 35, Col: 74}
}
_, 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("</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_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuStartDate)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 38, Col: 79}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(" - ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.Mgm_McuEndDate)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\employeeanalytic\listingemployeeanalytic.templ`, Line: 38, Col: 105}
}
_, 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>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,282 @@
package dev_kesimpulan
import (
"cpone/layout"
"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() {
<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>
#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>
}
templ JsKesimpulan() {
}
templ ShowKesimpulan(title string, cmp templ.Component, css templ.Component, js templ.Component) {
@layout.PlaygroundLayout(title, css, js) {
@cmp
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,46 @@
package dev_kesimpulan
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 } hx-swap-oob="true">
@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>
}
}

View File

@@ -0,0 +1,181 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_kesimpulan
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import (
"cpone/component/table"
"cpone/models"
)
func 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\dev\kesimpulan\tableKesimpulan.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\dev\kesimpulan\tableKesimpulan.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("\" hx-swap-oob=\"true\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NO", "PEMERIKSAAN", "PERSENTASE"},
[]string{"5%", "70%", "25%"},
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\dev\kesimpulan\tableKesimpulan.templ`, Line: 41, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.Test)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\kesimpulan\tableKesimpulan.templ`, Line: 42, Col: 15}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(v.Total)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\kesimpulan\tableKesimpulan.templ`, Line: 43, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,185 @@
package dev_mdsamplestationview
import (
"cpone/layout"
"cpone/component/customtextfield"
"cpone/models"
)
templ ContentMDSampleStation(
tableID string,
paginationID string,
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filtercomponent templ.Component,
paginationtable templ.Component,
modalAddForm templ.Component,
modalEditForm templ.Component,
modalDeleteForm 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: "searchID",
Name: "searchID",
Type: "hidden",
Value: searchID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddID",
Name: "dialogAddID",
Type: "hidden",
Value: dialogAddID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddBodyID",
Name: "dialogAddBodyID",
Type: "hidden",
Value: dialogAddBodyID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditID",
Name: "dialogEditID",
Type: "hidden",
Value: dialogEditID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditBodyID",
Name: "dialogEditBodyID",
Type: "hidden",
Value: dialogEditBodyID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteID",
Name: "dialogDeleteID",
Type: "hidden",
Value: dialogDeleteID})
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteBodyID",
Name: "dialogDeleteBodyID",
Type: "hidden",
Value: dialogDeleteBodyID})
<div class="row align-item-center mb-10">
<div class="col-md-10 col-sm-12 p-0">
@breadcrumb
</div>
<div class="col-md-2 d-none d-lg-block d-xl-block d-md-block d-sm-none">
<div class="d-flex justify-content-end">
<button
type="button"
class="btn btn-primary"
data-toggle="modal"
data-target={ "#" + dialogAddID }>Add New</button>
</div>
</div>
<div class="col-md-2 d-block d-lg-none d-xl-none d-md-none d-sm-block justify-content-center px-5">
<button
type="button"
class="btn btn-primary btn-block"
data-toggle="modal"
data-target={ "#" + dialogAddID }>Add New</button>
</div>
</div>
@filtercomponent
<div id="loading-parent" class="rounded">
@tablecontent
@paginationtable
@modalAddForm
@modalEditForm
@modalDeleteForm
<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 CSSMDSampleStation() {
<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>
}
templ JSMDSampleStation() {
<script>
document.addEventListener('htmx:beforeRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
console.log(event.detail.xhr)
console.log(event.detail.elt)
if (indicator) {
console.log('loading start');
}
});
document.addEventListener('htmx:afterRequest', function(event) {
var indicator = document.querySelector('#loadingcontent');
if (indicator) {
console.log('loading end');
}
});
</script>
}
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 ShowMDSampleStation(
title string,
cmp templ.Component,
css templ.Component,
js templ.Component,
navbarmenu templ.Component,
navbaruser templ.Component,
userprofile templ.Component) {
@layout.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile) {
@cmp
}
}

View File

@@ -0,0 +1,319 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdsamplestationview
//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/layout"
"cpone/models"
)
func ContentMDSampleStation(
tableID string,
paginationID string,
searchID string,
dialogAddID string,
dialogAddBodyID string,
dialogEditID string,
dialogEditBodyID string,
dialogDeleteID string,
dialogDeleteBodyID string,
breadcrumb templ.Component,
tablecontent templ.Component,
filtercomponent templ.Component,
paginationtable templ.Component,
modalAddForm templ.Component,
modalEditForm templ.Component,
modalDeleteForm 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: "searchID",
Name: "searchID",
Type: "hidden",
Value: searchID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddID",
Name: "dialogAddID",
Type: "hidden",
Value: dialogAddID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogAddBodyID",
Name: "dialogAddBodyID",
Type: "hidden",
Value: dialogAddBodyID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditID",
Name: "dialogEditID",
Type: "hidden",
Value: dialogEditID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogEditBodyID",
Name: "dialogEditBodyID",
Type: "hidden",
Value: dialogEditBodyID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteID",
Name: "dialogDeleteID",
Type: "hidden",
Value: dialogDeleteID}).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "dialogDeleteBodyID",
Name: "dialogDeleteBodyID",
Type: "hidden",
Value: dialogDeleteBodyID}).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 class=\"col-md-2 d-none d-lg-block d-xl-block d-md-block d-sm-none\"><div class=\"d-flex justify-content-end\"><button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogAddID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestation.templ`, Line: 74, Col: 55}
}
_, 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("\">Add New</button></div></div><div class=\"col-md-2 d-block d-lg-none d-xl-none d-md-none d-sm-block justify-content-center px-5\"><button type=\"button\" class=\"btn btn-primary btn-block\" data-toggle=\"modal\" data-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogAddID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestation.templ`, Line: 82, Col: 51}
}
_, 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("\">Add New</button></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 = tablecontent.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 = modalAddForm.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalEditForm.Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalDeleteForm.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 CSSMDSampleStation() templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
if templ_7745c5c3_Var4 == nil {
templ_7745c5c3_Var4 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<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 JSMDSampleStation() templ.Component {
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
if !templ_7745c5c3_IsBuffer {
templ_7745c5c3_Buffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
}
ctx = templ.InitializeContext(ctx)
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
if templ_7745c5c3_Var5 == nil {
templ_7745c5c3_Var5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<script>\r\n document.addEventListener('htmx:beforeRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n\t\t\tconsole.log(event.detail.xhr)\r\n\t\t\tconsole.log(event.detail.elt)\r\n if (indicator) {\r\n console.log('loading start');\r\n }\r\n });\r\n\r\n document.addEventListener('htmx:afterRequest', function(event) {\r\n var indicator = document.querySelector('#loadingcontent');\r\n if (indicator) {\r\n console.log('loading end');\r\n }\r\n }); \r\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func 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 ShowMDSampleStation(
title string,
cmp templ.Component,
css templ.Component,
js templ.Component,
navbarmenu 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_Var6 := templ.GetChildren(ctx)
if templ_7745c5c3_Var6 == nil {
templ_7745c5c3_Var6 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Var7 := 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.CorporateLayout(title, css, js, navbarmenu, navbaruser, userprofile).Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,200 @@
package dev_mdsamplestationview
import "cpone/models"
import "cpone/component/modal"
import "cpone/component/customtextfield"
import "cpone/component/customdropdown"
import "strconv"
templ MDSampleStationForm(data models.MDSampleStationForm) {
<div class="">
<form
id={ data.IDComponent }
hx-post={ data.Link }
class="form"
hx-target={ data.HxTarget }
hx-swap={ data.HxSwap }
hx-include={ data.HxInclude }
hx-indicator=".formloading"
hx-on::before-request={ HandleFormBeforeRequest() }
hx-on::after-request={ HandleFormAfterRequest() }
>
@modalcomponent.Modal(data.ModalID,
data.ModalTitle,
data.DialogBody,
data.DialogAction,
data.ButtonClose,
)
</form>
</div>
}
script HandleFormBeforeRequest() {
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].setAttribute('disabled', 'true');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].setAttribute('disabled', 'true');
}
}
script HandleFormAfterRequest() {
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].removeAttribute('disabled');
}
}
templ BodyFormMDSampleStation(
componentID string,
inputID models.CustomTextFieldv2Prm,
inputCode models.CustomTextFieldv2Prm,
inputName models.CustomTextFieldv2Prm,
inputGroup models.CustomDropdownv1Prm,
listGroup templ.Component,
hxOnLoad templ.ComponentScript,
) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
@customtextfield.CustomTextFieldv2(inputID)
@customtextfield.CustomTextFieldv2(inputCode)
@customtextfield.CustomTextFieldv2(inputName)
@customdropdown.MainCustomDropdownInput(inputGroup, listGroup)
</div>
<script>
document.addEventListener('htmx:afterSwap', function(event) {
$('.selectpicker').selectpicker('refresh');
})
</script>
}
templ ItemGroupDropdown(itemGroup []models.MDSampleStationGroup, selectedId int) {
if len(itemGroup) == 0 {
<option value="0" disabled selected>Tidak Ada Data</option>
} else {
for _, v := range itemGroup {
if (selectedId == v.ID) {
<option value={ strconv.Itoa(v.ID) } selected>{ v.Group }</option>
} else {
<option value={ strconv.Itoa(v.ID) }>{ v.Group }</option>
}
}
}
}
script JSHideModal(modalID string) {
$(modalID).modal('hide')
}
script JSShowModal(modalID string) {
$(modalID).modal('show')
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].removeAttribute('disabled');
}
}
templ ActionFormMDSampleStation(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<div>
<button
hx-on::after-request={ JSHideModal(modalID) }
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
hx-indicator=".cancelloading"
type="button"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel"
data-dismiss="modal"
>
<span class="htmx-indicator spinner-border spinner-border-sm cancelloading" role="status" aria-hidden="true"></span>
Batal
</button>
<button
type="submit"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata"
>
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
Simpan
</button>
</div>
}
templ BtnCloseFormMDSampleStation(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<button
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
type="button"
hx-on::after-request={ JSHideModal(modalID) }
class="close btnactcancel"
data-dismiss="modal"
aria-label="Close"
>
<i aria-hidden="true" class="ki ki-close"></i>
</button>
}
templ DeleteConfirmationBody(
inputID models.CustomTextFieldv2Prm,
componentID string,
message string,
dataHeader []string,
dataText []string,
hxOnLoad templ.ComponentScript,
) {
<div id={ componentID } hx-on::load={ hxOnLoad }>
<p>{ message }</p>
<div class="card rounded-lg">
<div class="card-body d-flex flex-row">
<div class="d-flex flex-column">
for _, v := range dataHeader {
<div class="mb-1 mt-1 text-disabled font-weight-bold mr-5">{ v }</div>
}
</div>
<div class="d-flex flex-column">
for _, v := range dataText {
<div class="mb-1 mt-1 font-weight-bold">{ v }</div>
}
</div>
</div>
</div>
@customtextfield.CustomTextFieldv2(inputID)
</div>
}
templ ActionFormMDSampleStationDelete(LinkClose string, targetClose string, hxSwapClose string, modalID string) {
<div>
<button
hx-on::after-request={ JSHideModal(modalID) }
hx-post={ LinkClose }
hx-target={ targetClose }
hx-swap={ hxSwapClose }
hx-indicator=".cancelloading"
type="button"
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel"
data-dismiss="modal"
>
<span class="htmx-indicator spinner-border spinner-border-sm cancelloading" role="status" aria-hidden="true"></span>
Batal
</button>
<button
type="submit"
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata"
>
<span class="htmx-indicator spinner-border spinner-border-sm formloading" role="status" aria-hidden="true"></span>
Yakin
</button>
</div>
}

View File

@@ -0,0 +1,740 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdsamplestationview
//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 "cpone/component/modal"
import "cpone/component/customtextfield"
import "cpone/component/customdropdown"
import "strconv"
func MDSampleStationForm(data models.MDSampleStationForm) 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=\"\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleFormBeforeRequest(), HandleFormAfterRequest())
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(data.IDComponent)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 12, Col: 33}
}
_, 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-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(data.Link)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 13, Col: 31}
}
_, 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=\"form\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(data.HxTarget)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 15, Col: 37}
}
_, 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(data.HxSwap)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 16, Col: 33}
}
_, 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-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(data.HxInclude)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 17, Col: 39}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\".formloading\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 templ.ComponentScript = HandleFormBeforeRequest()
_, 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 = HandleFormAfterRequest()
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = modalcomponent.Modal(data.ModalID,
data.ModalTitle,
data.DialogBody,
data.DialogAction,
data.ButtonClose,
).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</form></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func HandleFormBeforeRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormBeforeRequest_7bdf`,
Function: `function __templ_HandleFormBeforeRequest_7bdf(){const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].setAttribute('disabled', 'true');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].setAttribute('disabled', 'true');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormBeforeRequest_7bdf`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormBeforeRequest_7bdf`),
}
}
func HandleFormAfterRequest() templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleFormAfterRequest_cc6f`,
Function: `function __templ_HandleFormAfterRequest_cc6f(){const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_HandleFormAfterRequest_cc6f`),
CallInline: templ.SafeScriptInline(`__templ_HandleFormAfterRequest_cc6f`),
}
}
func BodyFormMDSampleStation(
componentID string,
inputID models.CustomTextFieldv2Prm,
inputCode models.CustomTextFieldv2Prm,
inputName models.CustomTextFieldv2Prm,
inputGroup models.CustomDropdownv1Prm,
listGroup 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_Var9 := templ.GetChildren(ctx)
if templ_7745c5c3_Var9 == nil {
templ_7745c5c3_Var9 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, 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_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 65, Col: 25}
}
_, 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-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputID).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputCode).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputName).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = customdropdown.MainCustomDropdownInput(inputGroup, listGroup).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><script>\r\n document.addEventListener('htmx:afterSwap', function(event) {\r\n $('.selectpicker').selectpicker('refresh');\r\n })\r\n </script>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func ItemGroupDropdown(itemGroup []models.MDSampleStationGroup, selectedId int) 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_Var12 := templ.GetChildren(ctx)
if templ_7745c5c3_Var12 == nil {
templ_7745c5c3_Var12 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
if len(itemGroup) == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"0\" disabled selected>Tidak Ada Data</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
for _, v := range itemGroup {
if selectedId == v.ID {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 84, Col: 50}
}
_, 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("\" selected>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 84, Col: 71}
}
_, 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("</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
} else {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<option value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(v.ID))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 86, Col: 50}
}
_, 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("\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(v.Group)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 86, Col: 62}
}
_, 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("</option>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
}
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func JSHideModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JSHideModal_4530`,
Function: `function __templ_JSHideModal_4530(modalID){$(modalID).modal('hide')
}`,
Call: templ.SafeScript(`__templ_JSHideModal_4530`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JSHideModal_4530`, modalID),
}
}
func JSShowModal(modalID string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_JSShowModal_658d`,
Function: `function __templ_JSShowModal_658d(modalID){$(modalID).modal('show')
const btnActCancel = document.querySelectorAll('.btnactcancel');
const btnActSaveData = document.querySelectorAll('.btnactsavedata');
for (let i = 0; i < btnActCancel.length; i++) {
btnActCancel[i].removeAttribute('disabled');
}
for (let i = 0; i < btnActSaveData.length; i++) {
btnActSaveData[i].removeAttribute('disabled');
}
}`,
Call: templ.SafeScript(`__templ_JSShowModal_658d`, modalID),
CallInline: templ.SafeScriptInline(`__templ_JSShowModal_658d`, modalID),
}
}
func ActionFormMDSampleStation(LinkClose string, targetClose string, hxSwapClose 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_Var17 := templ.GetChildren(ctx)
if templ_7745c5c3_Var17 == nil {
templ_7745c5c3_Var17 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, JSHideModal(modalID))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 templ.ComponentScript = JSHideModal(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 113, Col: 31}
}
_, 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(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 114, Col: 35}
}
_, 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-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var21 string
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 115, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-indicator=\".cancelloading\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel\" data-dismiss=\"modal\"><span class=\"htmx-indicator spinner-border spinner-border-sm cancelloading\" role=\"status\" aria-hidden=\"true\"></span> Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata\"><span class=\"htmx-indicator spinner-border spinner-border-sm formloading\" role=\"status\" aria-hidden=\"true\"></span> Simpan\r</button></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func BtnCloseFormMDSampleStation(LinkClose string, targetClose string, hxSwapClose 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_Var22 := templ.GetChildren(ctx)
if templ_7745c5c3_Var22 == nil {
templ_7745c5c3_Var22 = 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 hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 136, Col: 27}
}
_, 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("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var24 string
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 137, Col: 31}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var25 string
templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 138, Col: 29}
}
_, 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("\" type=\"button\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var26 templ.ComponentScript = JSHideModal(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var26.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"close btnactcancel\" data-dismiss=\"modal\" aria-label=\"Close\"><i aria-hidden=\"true\" class=\"ki ki-close\"></i></button>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}
func DeleteConfirmationBody(
inputID models.CustomTextFieldv2Prm,
componentID string,
message string,
dataHeader []string,
dataText []string,
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_Var27 := templ.GetChildren(ctx)
if templ_7745c5c3_Var27 == nil {
templ_7745c5c3_Var27 = 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_Var28 string
templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(componentID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 157, Col: 25}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var29 templ.ComponentScript = hxOnLoad
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var29.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><p>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var30 string
templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 158, Col: 20}
}
_, 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("</p><div class=\"card rounded-lg\"><div class=\"card-body d-flex flex-row\"><div class=\"d-flex flex-column\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataHeader {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 text-disabled font-weight-bold mr-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var31 string
templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 163, Col: 86}
}
_, 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>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><div class=\"d-flex flex-column\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
for _, v := range dataText {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"mb-1 mt-1 font-weight-bold\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var32 string
templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(v)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 168, Col: 67}
}
_, 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("</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
}
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(inputID).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 ActionFormMDSampleStationDelete(LinkClose string, targetClose string, hxSwapClose 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_Var33 := templ.GetChildren(ctx)
if templ_7745c5c3_Var33 == nil {
templ_7745c5c3_Var33 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
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 hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var34 templ.ComponentScript = JSHideModal(modalID)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-post=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var35 string
templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(LinkClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 181, Col: 31}
}
_, 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("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var36 string
templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(targetClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 182, Col: 35}
}
_, 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("\" hx-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var37 string
templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapClose)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationmodal.templ`, Line: 183, Col: 33}
}
_, 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("\" hx-indicator=\".cancelloading\" type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnactcancel\" data-dismiss=\"modal\"><span class=\"htmx-indicator spinner-border spinner-border-sm cancelloading\" role=\"status\" aria-hidden=\"true\"></span> Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnactsavedata\"><span class=\"htmx-indicator spinner-border spinner-border-sm formloading\" role=\"status\" aria-hidden=\"true\"></span> Yakin\r</button></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if !templ_7745c5c3_IsBuffer {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
}
return templ_7745c5c3_Err
})
}

View File

@@ -0,0 +1,129 @@
package dev_mdsamplestationview
import "cpone/models"
import "cpone/component/table"
import "strconv"
templ TableSampleStation(data []models.MDSampleStation,
tableID string,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) {
<div id={ tableID } hx-swap-oob="true">
@tablecomponent.TableV3([]string{"KODE", "NAMA STATION", "GROUP", "AKSI"},
[]string{"20%", "30%", "30%", "20%"},
ItemRow(data,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
))
</div>
}
templ ItemRow(data []models.MDSampleStation,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) {
if len(data) == 0 {
<tr>
<td colspan="4" class="text-center">Data Tidak Ditemukan</td>
</tr>
}
for _, v := range data {
<tr>
<td>{ v.T_SampleStationCode }</td>
<td>{ v.T_SampleStationName }</td>
<td>{ v.T_SampleStationIsNonLab }</td>
<td>
@ItemAction(v.T_SampleStationID,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
)
</td>
</tr>
}
}
templ ItemAction(
id int,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete string,
) {
<div class="row px-5 d-flex justify-content-around">
<a
type="button"
class="btnactionmdss col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2 btn-sm"
hx-get={ hxGetEdit +"?id=" + strconv.Itoa(id) }
hx-target={ hxTargetEdit }
hx-swap={ hxSwapEdit }
hx-include={ hxIncludeEdit }
hx-indicator={ "#spnredt" + strconv.Itoa(id) }
hx-on::before-request={ HandleBeforeRequestRow(strconv.Itoa(id)) }
hx-on::after-request={ HandleAfterRequestRow(strconv.Itoa(id)) }
>
<span id={ "spnredt" + strconv.Itoa(id) } class="htmx-indicator spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Edit
</a>
<a
type="button"
class="btnactionmdss col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2 btn-sm"
hx-get={ hxGetDelete +"?id=" + strconv.Itoa(id) }
hx-target={ hxTargetDelete }
hx-swap={ hxSwapDelete }
hx-include={ hxIncludeDelete }
hx-indicator={ "#spnrdel" + strconv.Itoa(id) }
hx-on::before-request={ HandleBeforeRequestRow(strconv.Itoa(id)) }
hx-on::after-request={ HandleAfterRequestRow(strconv.Itoa(id)) }
>
<span id={ "spnrdel" + strconv.Itoa(id) } class="htmx-indicator spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
Hapus
</a>
</div>
}
script HandleBeforeRequestRow(id string) {
var cusid_ele = document.getElementsByClassName('btnactionmdss');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.add('disabled');
}
console.log(id)
}
script HandleAfterRequestRow(id string) {
var cusid_ele = document.getElementsByClassName('btnactionmdss');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.remove('disabled');
}
console.log(id)
}

View File

@@ -0,0 +1,450 @@
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.2.663
package dev_mdsamplestationview
//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 "cpone/component/table"
import "strconv"
func TableSampleStation(data []models.MDSampleStation,
tableID string,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete 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(tableID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 18, Col: 21}
}
_, 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-swap-oob=\"true\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"KODE", "NAMA STATION", "GROUP", "AKSI"},
[]string{"20%", "30%", "30%", "20%"},
ItemRow(data,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
)).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.MDSampleStation,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete 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)
if len(data) == 0 {
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr><td colspan=\"4\" 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_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.T_SampleStationCode)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 51, Col: 39}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v.T_SampleStationName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 52, Col: 39}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.T_SampleStationIsNonLab)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 53, Col: 43}
}
_, 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
}
templ_7745c5c3_Err = ItemAction(v.T_SampleStationID,
hxGetEdit,
hxTargetEdit,
hxSwapEdit,
hxIncludeEdit,
hxGetDelete,
hxTargetDelete,
hxSwapDelete,
hxIncludeDelete,
).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 int,
hxGetEdit string,
hxTargetEdit string,
hxSwapEdit string,
hxIncludeEdit string,
hxGetDelete string,
hxTargetDelete string,
hxSwapDelete string,
hxIncludeDelete 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_7745c5c3_Buffer.WriteString("<div class=\"row px-5 d-flex justify-content-around\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(id)), HandleAfterRequestRow(strconv.Itoa(id)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btnactionmdss col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-tosca mb-2 btn-sm\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetEdit + "?id=" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 85, 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("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 86, Col: 36}
}
_, 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-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 87, Col: 32}
}
_, 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(hxIncludeEdit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 88, 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-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs("#spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 89, Col: 56}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::before-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 templ.ComponentScript = HandleBeforeRequestRow(strconv.Itoa(id))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13.Call)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::after-request=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 templ.ComponentScript = HandleAfterRequestRow(strconv.Itoa(id))
_, 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("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs("spnredt" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 93, Col: 51}
}
_, 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("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Edit\r</a> ")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, HandleBeforeRequestRow(strconv.Itoa(id)), HandleAfterRequestRow(strconv.Itoa(id)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a type=\"button\" class=\"btnactionmdss col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2 btn-sm\" hx-get=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetDelete + "?id=" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 99, Col: 59}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-target=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 100, 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-swap=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 101, Col: 34}
}
_, 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-include=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 102, Col: 40}
}
_, 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-indicator=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var20 string
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs("#spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 103, Col: 56}
}
_, 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 = HandleBeforeRequestRow(strconv.Itoa(id))
_, 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 = HandleAfterRequestRow(strconv.Itoa(id))
_, 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("\"><span id=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var23 string
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs("spnrdel" + strconv.Itoa(id))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdsamplestation\mdsamplestationtable.templ`, Line: 107, Col: 51}
}
_, 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("\" class=\"htmx-indicator spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span> Hapus\r</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
})
}
func HandleBeforeRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleBeforeRequestRow_027b`,
Function: `function __templ_HandleBeforeRequestRow_027b(id){var cusid_ele = document.getElementsByClassName('btnactionmdss');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.add('disabled');
}
console.log(id)
}`,
Call: templ.SafeScript(`__templ_HandleBeforeRequestRow_027b`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleBeforeRequestRow_027b`, id),
}
}
func HandleAfterRequestRow(id string) templ.ComponentScript {
return templ.ComponentScript{
Name: `__templ_HandleAfterRequestRow_792d`,
Function: `function __templ_HandleAfterRequestRow_792d(id){var cusid_ele = document.getElementsByClassName('btnactionmdss');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
item.classList.remove('disabled');
}
console.log(id)
}`,
Call: templ.SafeScript(`__templ_HandleAfterRequestRow_792d`, id),
CallInline: templ.SafeScriptInline(`__templ_HandleAfterRequestRow_792d`, id),
}
}

View File

@@ -35,25 +35,25 @@ templ MainLandingPage(medicalServiceComponent templ.Component, listAdvantageComp
@medicalServiceComponent
<!-- Our Medical Service END -->
<!-- Why Westerindo START belum fix di ukuran < 1400 -->
<div class="container p-0 mt-5 ">
<div class="row">
// <div class="container p-0 mt-5 ">
<div class="row mt-5">
@HeaderSection("Why Westerindo", "With a dedicated team of professionals were committed to providing medical attention tailored to your needs, ensuring a journey to optimal health and vitality.")
</div>
@listAdvantageComponent
</div>
// </div>
<!-- Why Westerindo END -->
<!-- Promotion START -->
<div class="container mt-4">
<div class="row">
// <div class="container mt-4">
<div class="row mt-4">
@HeaderSection("Promotions", "Seize This Opportunity to Enhance Your Health")
</div>
@listPromotion
</div>
// </div>
<!-- Promotion END -->
<!-- footer START -->
@footer
<!-- footer END -->
</div>
<!-- footer START -->
@footer
<!-- footer END -->
}
templ CssLandingPage() {

View File

@@ -51,7 +51,7 @@ func MainLandingPage(medicalServiceComponent templ.Component, listAdvantageCompo
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Our Medical Service END --><!-- Why Westerindo START belum fix di ukuran < 1400 --><div class=\"container p-0 mt-5 \"><div class=\"row\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Our Medical Service END --><!-- Why Westerindo START belum fix di ukuran < 1400 --><div class=\"row mt-5\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -67,7 +67,7 @@ func MainLandingPage(medicalServiceComponent templ.Component, listAdvantageCompo
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Why Westerindo END --><!-- Promotion START --><div class=\"container mt-4\"><div class=\"row\">")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Why Westerindo END --><!-- Promotion START --><div class=\"row mt-4\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -83,7 +83,7 @@ func MainLandingPage(medicalServiceComponent templ.Component, listAdvantageCompo
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><!-- Promotion END --><!-- footer START -->")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- Promotion END --></div><!-- footer START -->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -91,7 +91,7 @@ func MainLandingPage(medicalServiceComponent templ.Component, listAdvantageCompo
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- footer END --></div>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!-- footer END -->")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}