fix: Admin
Deskripsi: - Penambahan field nama rekening di db bank - Optimalisasi event ## No Issue
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.9 KiB |
33
src/app/api/investasi/bukti-transfer/[id]/route.ts
Normal file
33
src/app/api/investasi/bukti-transfer/[id]/route.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
import fs from "fs";
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
|
||||||
|
export async function GET(
|
||||||
|
req: NextRequest,
|
||||||
|
{ params }: { params: { id: string } }
|
||||||
|
) {
|
||||||
|
const data = await prisma.images.findUnique({
|
||||||
|
where: {
|
||||||
|
id: params.id,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
url: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!fs.existsSync(`./public/investasi/invoice/${data?.url}`)) {
|
||||||
|
const fl = fs.readFileSync(`./public/aset/no-img.png`);
|
||||||
|
return new NextResponse(fl, {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "image/png",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const fl = fs.readFileSync(`./public/investasi/invoice/${data?.url}`);
|
||||||
|
return new NextResponse(fl, {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "image/png",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { AdminAppInformation_MainView } from "@/app_modules/admin/app_info";
|
|
||||||
import adminAppInformation_getMasterBank from "@/app_modules/admin/app_info/fun/master/get_list_bank";
|
import adminAppInformation_getMasterBank from "@/app_modules/admin/app_info/fun/master/get_list_bank";
|
||||||
import adminAppInformation_getNomorAdmin from "@/app_modules/admin/app_info/fun/master/get_nomor_admin";
|
import adminAppInformation_getNomorAdmin from "@/app_modules/admin/app_info/fun/master/get_nomor_admin";
|
||||||
|
import { AdminAppInformation_UiMain } from "@/app_modules/admin/app_info/ui";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const nomorAdmin = await adminAppInformation_getNomorAdmin();
|
const nomorAdmin = await adminAppInformation_getNomorAdmin();
|
||||||
@@ -8,10 +8,7 @@ export default async function Page() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AdminAppInformation_MainView
|
<AdminAppInformation_UiMain nomorAdmin={nomorAdmin} listBank={listBank} />
|
||||||
nomorAdmin={nomorAdmin}
|
|
||||||
listBank={listBank}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentAdminGlobal_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentAdminGlobal_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentAdminGlobal_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentAdminGlobal_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
import { AdminEvent_Riwayat } from "@/app_modules/admin/event";
|
import { AdminEvent_Riwayat } from "@/app_modules/admin/event";
|
||||||
import { AdminEvent_getListAllRiwayat } from "@/app_modules/admin/event/fun/get/get_list_all_riwayat";
|
import { adminEvent_funGetListAllRiwayat } from "@/app_modules/admin/event/fun/get/get_list_all_riwayat";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const listRiwayat = await AdminEvent_getListAllRiwayat()
|
const listRiwayat = await adminEvent_funGetListAllRiwayat({ page: 1 });
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
3
src/app/dev/admin/event/detail/main-detail/page.tsx
Normal file
3
src/app/dev/admin/event/detail/main-detail/page.tsx
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export default function Page({ params }: { params: { id: string } }) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
13
src/app/dev/admin/event/detail/peserta/[id]/page.tsx
Normal file
13
src/app/dev/admin/event/detail/peserta/[id]/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { AdminEvent_UiDetailPeserta } from "@/app_modules/admin/event/_ui";
|
||||||
|
import { adminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
||||||
|
|
||||||
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
|
const eventId = params.id;
|
||||||
|
const dataPeserta = await adminEvent_getListPesertaById({ eventId, page: 1 });
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<AdminEvent_UiDetailPeserta dataPeserta={dataPeserta} eventId={eventId} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentAdminGlobal_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import { AdminEvent_TablePublish } from "@/app_modules/admin/event";
|
import { AdminEvent_TablePublish } from "@/app_modules/admin/event";
|
||||||
|
import { adminEvent_funGetListPublish } from "@/app_modules/admin/event/fun";
|
||||||
import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id";
|
import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const listPublish = await AdminEvent_getListTableByStatusId("1");
|
const listPublish = await adminEvent_funGetListPublish({page: 1});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import { AdminEvent_TableReject } from "@/app_modules/admin/event";
|
import { AdminEvent_TableReject } from "@/app_modules/admin/event";
|
||||||
import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id";
|
import { adminEvent_funGetListReject } from "@/app_modules/admin/event/fun";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const listReject = await AdminEvent_getListTableByStatusId("4")
|
const listReject = await adminEvent_funGetListReject({ page: 1 });
|
||||||
|
|
||||||
return <>
|
return (
|
||||||
<AdminEvent_TableReject listReject={listReject as any}/>
|
<>
|
||||||
|
<AdminEvent_TableReject listReject={listReject as any} />
|
||||||
</>
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
import { AdminEvent_TableReview } from "@/app_modules/admin/event";
|
import { AdminEvent_TableReview } from "@/app_modules/admin/event";
|
||||||
|
import { adminEvent_funGetListReview } from "@/app_modules/admin/event/fun";
|
||||||
import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id";
|
import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const listReview = await AdminEvent_getListTableByStatusId("2")
|
const listReview = await adminEvent_funGetListReview({ page: 1 });
|
||||||
|
|
||||||
return <>
|
return (
|
||||||
<AdminEvent_TableReview listReview={listReview as any}/>
|
<>
|
||||||
|
<AdminEvent_TableReview listData={listReview as any} />
|
||||||
</>
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentAdminGlobal_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
10
src/app/dev/admin/investasi/bukti-transfer/[id]/page.tsx
Normal file
10
src/app/dev/admin/investasi/bukti-transfer/[id]/page.tsx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { AdminInvestasi_DetailBuktiTransfer } from "@/app_modules/admin/investasi/detail";
|
||||||
|
|
||||||
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
|
const imageId = params.id;
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<AdminInvestasi_DetailBuktiTransfer imageId={imageId} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import { Admin_LayoutBuktiTransferInvestasi } from "@/app_modules/admin/investasi";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default async function Layout({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Admin_LayoutBuktiTransferInvestasi>
|
|
||||||
{children}
|
|
||||||
</Admin_LayoutBuktiTransferInvestasi>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import { Admin_BuktiTransferInvestasi } from "@/app_modules/admin/investasi";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Admin_BuktiTransferInvestasi />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,27 @@
|
|||||||
import { AdminInvestasi_DetailPublish } from "@/app_modules/admin/investasi";
|
import { AdminInvestasi_DetailPublish } from "@/app_modules/admin/investasi";
|
||||||
|
import {
|
||||||
|
adminInvestasi_funGetAllTransaksiById,
|
||||||
|
adminInvestasi_getStatusInvestasi,
|
||||||
|
} from "@/app_modules/admin/investasi/fun";
|
||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
|
|
||||||
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
|
|
||||||
export default async function Page({params}: {params: {id: string}}) {
|
|
||||||
const investasiId = params.id;
|
const investasiId = params.id;
|
||||||
const dataInvestasi = await getOneInvestasiById(investasiId);
|
const dataInvestasi = await getOneInvestasiById(investasiId);
|
||||||
|
const statusTransaksi = await adminInvestasi_getStatusInvestasi();
|
||||||
|
const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
|
||||||
|
investasiId,
|
||||||
|
page: 1,
|
||||||
|
});
|
||||||
|
|
||||||
return<>
|
return (
|
||||||
<AdminInvestasi_DetailPublish data={dataInvestasi as any}/>
|
<>
|
||||||
|
<AdminInvestasi_DetailPublish
|
||||||
|
data={dataInvestasi as any}
|
||||||
|
dataTransaksi={dataTransaksi as any}
|
||||||
|
statusTransaksi={statusTransaksi}
|
||||||
|
investasiId={investasiId as any}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentAdminGlobal_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentAdminGlobal_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/_admin_global/loading_admin_page";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentAdminGlobal_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { StatusTransaksiInvestasi } from "@/app_modules/investasi";
|
||||||
|
import { investasi_funGetInvoiceById } from "@/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id";
|
||||||
|
import { Investasi_UiTransaksiBerhasil } from "@/app_modules/investasi/_ui";
|
||||||
|
|
||||||
|
export default async function Page({params}: {params: {id: string}}) {
|
||||||
|
const invoiceId = params.id;
|
||||||
|
const dataTransaksi = await investasi_funGetInvoiceById({ invoiceId });
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Investasi_UiTransaksiBerhasil dataTransaksi={dataTransaksi} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
18
src/app/dev/investasi/status-transaksi/gagal/[id]/page.tsx
Normal file
18
src/app/dev/investasi/status-transaksi/gagal/[id]/page.tsx
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { funGlobal_getNomorAdmin } from "@/app_modules/_global/fun/get";
|
||||||
|
import { investasi_funGetInvoiceById } from "@/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id";
|
||||||
|
import { Investasi_UiTransaksiGagal } from "@/app_modules/investasi/_ui/status_transaksi/ui_transaksi_gagal";
|
||||||
|
|
||||||
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
|
const invoiceId = params.id;
|
||||||
|
const dataTransaksi = await investasi_funGetInvoiceById({ invoiceId });
|
||||||
|
const nomorAdmin = await funGlobal_getNomorAdmin();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Investasi_UiTransaksiGagal
|
||||||
|
dataTransaksi={dataTransaksi}
|
||||||
|
nomorAdmin={nomorAdmin as any}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
|
|
||||||
import { LayoutStatusTransaksiInvestasi } from "@/app_modules/investasi";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default async function Layout({children}: {children: React.ReactNode}) {
|
|
||||||
return<>
|
|
||||||
<LayoutStatusTransaksiInvestasi>{children}</LayoutStatusTransaksiInvestasi>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import { StatusTransaksiInvestasi } from "@/app_modules/investasi";
|
|
||||||
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return<>
|
|
||||||
<StatusTransaksiInvestasi/>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import { LayoutStatusTransaksiInvestasi_Gagal } from "@/app_modules/investasi";
|
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export default async function Layout({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<LayoutStatusTransaksiInvestasi_Gagal>
|
|
||||||
{children}
|
|
||||||
</LayoutStatusTransaksiInvestasi_Gagal>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { StatusTransaksiInvestasi_Gagal } from "@/app_modules/investasi";
|
|
||||||
import getTransaksiByIdInvestasi from "@/app_modules/investasi/fun/get_transaksi_investasi";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
|
||||||
// console.log(params.id)
|
|
||||||
const dataTransaksi = await getTransaksiByIdInvestasi(params.id);
|
|
||||||
// console.log(dataTransaksi);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<StatusTransaksiInvestasi_Gagal dataTransaksi={dataTransaksi as any} />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { investasi_funGetInvoiceById } from "@/app_modules/investasi/_fun/get/fun_get_invoice_by_id";
|
import { investasi_funGetInvoiceById } from "@/app_modules/investasi/_fun/get/fun_get_one_invoice_by_id";
|
||||||
import { Investasi_UiInvoice } from "@/app_modules/investasi/_ui";
|
import { Investasi_UiInvoice } from "@/app_modules/investasi/_ui";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ export const RouterAdminEvent = {
|
|||||||
main_event: "/dev/admin/event/main",
|
main_event: "/dev/admin/event/main",
|
||||||
|
|
||||||
// detail
|
// detail
|
||||||
|
detail_peserta: "/dev/admin/event/detail/peserta/",
|
||||||
|
|
||||||
|
// child
|
||||||
detail_tipe_acara: "/dev/admin/event/child/tipe_acara",
|
detail_tipe_acara: "/dev/admin/event/child/tipe_acara",
|
||||||
detail_riwayat: "/dev/admin/event/child/riwayat",
|
detail_riwayat: "/dev/admin/event/child/riwayat",
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
export const RouterAdminInvestasi = {
|
export const RouterAdminInvestasi = {
|
||||||
|
// API
|
||||||
|
api_bukti_transfer: "/api/investasi/bukti-transfer/",
|
||||||
|
|
||||||
main: "/dev/admin/investasi/main",
|
main: "/dev/admin/investasi/main",
|
||||||
table_publish: "/dev/admin/investasi/sub-menu/publish",
|
table_publish: "/dev/admin/investasi/sub-menu/publish",
|
||||||
table_review: "/dev/admin/investasi/sub-menu/review",
|
table_review: "/dev/admin/investasi/sub-menu/review",
|
||||||
@@ -8,4 +11,5 @@ export const RouterAdminInvestasi = {
|
|||||||
detail_publish: "/dev/admin/investasi/detail/publish/",
|
detail_publish: "/dev/admin/investasi/detail/publish/",
|
||||||
detail_review: "/dev/admin/investasi/detail/review/",
|
detail_review: "/dev/admin/investasi/detail/review/",
|
||||||
detail_reject: "/dev/admin/investasi/detail/reject/",
|
detail_reject: "/dev/admin/investasi/detail/reject/",
|
||||||
|
bukti_transfer: "/dev/admin/investasi/bukti-transfer/",
|
||||||
};
|
};
|
||||||
@@ -5,9 +5,13 @@ export const NEW_RouterInvestasi = {
|
|||||||
invoice: "/dev/investasi/transaksi/invoice/",
|
invoice: "/dev/investasi/transaksi/invoice/",
|
||||||
proses_transaksi: "/dev/investasi/transaksi/proses-transaksi/",
|
proses_transaksi: "/dev/investasi/transaksi/proses-transaksi/",
|
||||||
|
|
||||||
|
// stasus transaksi
|
||||||
|
transaksi_gagal: "/dev/investasi/status-transaksi/gagal/",
|
||||||
|
transaksi_berhasil: "/dev/investasi/status-transaksi/berhasil/",
|
||||||
|
|
||||||
// file view
|
// file view
|
||||||
file_view: "/dev/investasi/file-view/",
|
file_view: "/dev/investasi/file-view/",
|
||||||
}
|
};
|
||||||
|
|
||||||
export const RouterInvestasi_OLD = {
|
export const RouterInvestasi_OLD = {
|
||||||
api_gambar: "/api/investasi/gambar/",
|
api_gambar: "/api/investasi/gambar/",
|
||||||
@@ -32,7 +36,7 @@ export const RouterInvestasi_OLD = {
|
|||||||
proses_investasi: "/dev/investasi/proses_investasi/",
|
proses_investasi: "/dev/investasi/proses_investasi/",
|
||||||
proses_transaksi: "/dev/investasi/proses_transaksi/",
|
proses_transaksi: "/dev/investasi/proses_transaksi/",
|
||||||
status_transaksi: "/dev/investasi/status_transaksi/berhasil",
|
status_transaksi: "/dev/investasi/status_transaksi/berhasil",
|
||||||
status_pesanan:"/dev/investasi/status_pesanan/",
|
status_pesanan: "/dev/investasi/status_pesanan/",
|
||||||
status_transaksi_gagal: "/dev/investasi/status_transaksi/gagal/",
|
status_transaksi_gagal: "/dev/investasi/status_transaksi/gagal/",
|
||||||
metode_transfer: "/dev/investasi/metode_transfer/",
|
metode_transfer: "/dev/investasi/metode_transfer/",
|
||||||
|
|
||||||
@@ -64,5 +68,3 @@ export const RouterInvestasi_OLD = {
|
|||||||
upload_prospektus: "/dev/investasi/upload_prospektus/",
|
upload_prospektus: "/dev/investasi/upload_prospektus/",
|
||||||
upload_dokumen: "/dev/investasi/upload_dokumen/",
|
upload_dokumen: "/dev/investasi/upload_dokumen/",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
28
src/app_modules/_global/component/comp_tampilan_rupiah.tsx
Normal file
28
src/app_modules/_global/component/comp_tampilan_rupiah.tsx
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { Text } from "@mantine/core";
|
||||||
|
|
||||||
|
export default function ComponentGlobal_TampilanRupiah({
|
||||||
|
nominal,
|
||||||
|
color,
|
||||||
|
fontSize,
|
||||||
|
}: {
|
||||||
|
nominal: number;
|
||||||
|
color?: string;
|
||||||
|
fontSize?: number;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Text
|
||||||
|
fz={fontSize ? fontSize : "md"}
|
||||||
|
style={{
|
||||||
|
color: color ? color : "black",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", { maximumFractionDigits: 10 }).format(
|
||||||
|
nominal
|
||||||
|
)}
|
||||||
|
</Text>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
3
src/app_modules/_global/component/index.ts
Normal file
3
src/app_modules/_global/component/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import ComponentGlobal_TampilanRupiah from "./comp_tampilan_rupiah";
|
||||||
|
|
||||||
|
export { ComponentGlobal_TampilanRupiah };
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { Group, Title, TextInput } from "@mantine/core";
|
||||||
|
import { IconSearch } from "@tabler/icons-react";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export function ComponentAdminGlobal_TitlePage({
|
||||||
|
name,
|
||||||
|
color,
|
||||||
|
component,
|
||||||
|
}: {
|
||||||
|
name: string;
|
||||||
|
color?: string;
|
||||||
|
component?: React.ReactNode;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Group
|
||||||
|
position="apart"
|
||||||
|
bg={color ? color : "gray.4"}
|
||||||
|
p={"xs"}
|
||||||
|
style={{ borderRadius: "6px" }}
|
||||||
|
>
|
||||||
|
<Title order={4}>{name}</Title>
|
||||||
|
{component ? component : ""}
|
||||||
|
</Group>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -17,8 +17,6 @@ export default function ComponentAdminGlobal_BackButton({
|
|||||||
<>
|
<>
|
||||||
<Group>
|
<Group>
|
||||||
<Button
|
<Button
|
||||||
// loaderPosition="center"
|
|
||||||
// loading={isLoading ? true : false}
|
|
||||||
c={"gray"}
|
c={"gray"}
|
||||||
leftIcon={
|
leftIcon={
|
||||||
isLoading ? (
|
isLoading ? (
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { Text } from "@mantine/core";
|
||||||
|
|
||||||
|
export function ComponentAdminGlobal_TampilanRupiah({
|
||||||
|
nominal,
|
||||||
|
color,
|
||||||
|
fontSize,
|
||||||
|
}: {
|
||||||
|
nominal: number;
|
||||||
|
color?: string;
|
||||||
|
fontSize?: number;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Text
|
||||||
|
fz={fontSize ? fontSize : "md"}
|
||||||
|
style={{
|
||||||
|
color: color ? color : "black",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", { maximumFractionDigits: 10 }).format(
|
||||||
|
nominal
|
||||||
|
)}
|
||||||
|
</Text>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
5
src/app_modules/admin/_admin_global/index.ts
Normal file
5
src/app_modules/admin/_admin_global/index.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { ComponentAdminGlobal_TitlePage } from "./_component/title_page";
|
||||||
|
import { ComponentAdminGlobal_TampilanRupiah } from "./comp_admin_teampilan_rupiah";
|
||||||
|
|
||||||
|
export { ComponentAdminGlobal_TampilanRupiah };
|
||||||
|
export { ComponentAdminGlobal_TitlePage };
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import {
|
|
||||||
Box,
|
|
||||||
Center,
|
|
||||||
Group,
|
|
||||||
LoadingOverlay,
|
|
||||||
Skeleton,
|
|
||||||
Text,
|
|
||||||
} from "@mantine/core";
|
|
||||||
|
|
||||||
export default function ComponentAdminGlobal_LoadingPage() {
|
|
||||||
const listhHuruf = [
|
|
||||||
{
|
|
||||||
huruf: "H",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
huruf: "I",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
huruf: "P",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
huruf: "M",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
huruf: "I",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
const customLOader = (
|
|
||||||
<Center h={"90vh"}>
|
|
||||||
<Group>
|
|
||||||
{listhHuruf.map((e, i) => (
|
|
||||||
<Center key={i} h={"100%"}>
|
|
||||||
<Skeleton height={50} circle radius={"100%"} />
|
|
||||||
<Text sx={{ position: "absolute" }} c={"gray.4"} fw={"bold"}>
|
|
||||||
{e.huruf}
|
|
||||||
</Text>
|
|
||||||
</Center>
|
|
||||||
))}
|
|
||||||
</Group>
|
|
||||||
</Center>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{/* <LoadingOverlay visible loader={customLOader} /> */}
|
|
||||||
<Box>
|
|
||||||
{customLOader}
|
|
||||||
</Box>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
3
src/app_modules/admin/app_info/component/index.tsx
Normal file
3
src/app_modules/admin/app_info/component/index.tsx
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import { AdminAppInformation_ComponentTitlePageBank } from "./info_bank/comp_title_page";
|
||||||
|
|
||||||
|
export { AdminAppInformation_ComponentTitlePageBank };
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global";
|
||||||
|
import { Button } from "@mantine/core";
|
||||||
|
import { IconCirclePlus } from "@tabler/icons-react";
|
||||||
|
|
||||||
|
export function AdminAppInformation_ComponentTitlePageBank({
|
||||||
|
onEventListener,
|
||||||
|
}: {
|
||||||
|
onEventListener: (val: any) => void;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ComponentAdminGlobal_TitlePage
|
||||||
|
name="Informasi Bank"
|
||||||
|
component={
|
||||||
|
<Button
|
||||||
|
w={120}
|
||||||
|
leftIcon={<IconCirclePlus />}
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => {
|
||||||
|
onEventListener({
|
||||||
|
isCreate: true,
|
||||||
|
isUpdate: false,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Tambah
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { MODEL_MASTER_BANK } from "@/app_modules/investasi/_lib/interface";
|
||||||
|
|
||||||
export default async function adminAppInformation_createBank({
|
export default async function adminAppInformation_createBank({
|
||||||
data,
|
data,
|
||||||
}: {
|
}: {
|
||||||
data: any;
|
data: MODEL_MASTER_BANK;
|
||||||
}) {
|
}) {
|
||||||
const count = await prisma.masterBank.count({});
|
const count = await prisma.masterBank.count({});
|
||||||
const idBank = count + 1;
|
const idBank = count + 1;
|
||||||
@@ -13,8 +14,8 @@ export default async function adminAppInformation_createBank({
|
|||||||
const create = await prisma.masterBank.create({
|
const create = await prisma.masterBank.create({
|
||||||
data: {
|
data: {
|
||||||
id: idBank.toString(),
|
id: idBank.toString(),
|
||||||
namaBank: data.name,
|
namaBank: data.namaBank,
|
||||||
namaAkun: data.akun,
|
namaAkun: data.namaAkun,
|
||||||
norek: data.norek,
|
norek: data.norek,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ export default async function adminAppInformation_updateStatusBankById({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!updt) return { status: 400, message: "Gagal update" };
|
if (!updt) return { status: 400, message: "Gagal update" };
|
||||||
return { status: 200, message: "Berhasil update" };
|
return { status: 200, message: "Berhasil update" };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export default async function adminAppInformation_updateDataBankById({
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
namaBank: data.namaBank,
|
namaBank: data.namaBank,
|
||||||
|
namaAkun: data.namaAkun,
|
||||||
norek: data.norek,
|
norek: data.norek,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
import AdminAppInformation_MainView from "./main";
|
|
||||||
export { AdminAppInformation_MainView };
|
|
||||||
3
src/app_modules/admin/app_info/ui/index.tsx
Normal file
3
src/app_modules/admin/app_info/ui/index.tsx
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import AdminAppInformation_UiMain from "./ui_main";
|
||||||
|
|
||||||
|
export { AdminAppInformation_UiMain };
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import {
|
import { Space, Stack } from "@mantine/core";
|
||||||
Space,
|
|
||||||
Stack
|
|
||||||
} from "@mantine/core";
|
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||||
import InformasiBank from "./info_bank";
|
import {
|
||||||
import InformasiWhatApps from "./info_whatsapp";
|
AdminAppInformation_ViewInfoBank,
|
||||||
|
AdminAppInformation_ViewInformasiWhatApps,
|
||||||
|
} from "../view";
|
||||||
|
|
||||||
export default function AdminAppInformation_MainView({
|
export default function AdminAppInformation_UiMain({
|
||||||
nomorAdmin,
|
nomorAdmin,
|
||||||
listBank,
|
listBank,
|
||||||
}: {
|
}: {
|
||||||
@@ -19,9 +18,9 @@ export default function AdminAppInformation_MainView({
|
|||||||
<>
|
<>
|
||||||
<Stack h={"100%"}>
|
<Stack h={"100%"}>
|
||||||
<ComponentAdminGlobal_HeaderTamplate name="App Information" />
|
<ComponentAdminGlobal_HeaderTamplate name="App Information" />
|
||||||
<InformasiWhatApps nomorAdmin={nomorAdmin} />
|
<AdminAppInformation_ViewInformasiWhatApps nomorAdmin={nomorAdmin} />
|
||||||
<Space h={50} />
|
<Space h={50} />
|
||||||
<InformasiBank listBank={listBank} />
|
<AdminAppInformation_ViewInfoBank listBank={listBank} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
5
src/app_modules/admin/app_info/view/index.tsx
Normal file
5
src/app_modules/admin/app_info/view/index.tsx
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import AdminAppInformation_ViewInfoBank from "./view_info_bank";
|
||||||
|
import AdminAppInformation_ViewInformasiWhatApps from "./view_info_whatsapp";
|
||||||
|
|
||||||
|
export { AdminAppInformation_ViewInformasiWhatApps };
|
||||||
|
export { AdminAppInformation_ViewInfoBank };
|
||||||
@@ -16,12 +16,9 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
TextInput,
|
TextInput,
|
||||||
Title,
|
Title,
|
||||||
Tooltip
|
Tooltip,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
import { IconCirclePlus, IconEdit } from "@tabler/icons-react";
|
||||||
IconCirclePlus,
|
|
||||||
IconEdit
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
|
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
|
||||||
@@ -30,23 +27,29 @@ import adminAppInformation_createBank from "../fun/create/fun_create_new_bank";
|
|||||||
import adminAppInformation_getMasterBank from "../fun/master/get_list_bank";
|
import adminAppInformation_getMasterBank from "../fun/master/get_list_bank";
|
||||||
import adminAppInformation_updateStatusBankById from "../fun/update/fun_udpate_status_bank";
|
import adminAppInformation_updateStatusBankById from "../fun/update/fun_udpate_status_bank";
|
||||||
import adminAppInformation_updateDataBankById from "../fun/update/fun_update_data_bank";
|
import adminAppInformation_updateDataBankById from "../fun/update/fun_update_data_bank";
|
||||||
|
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global";
|
||||||
|
import { AdminAppInformation_ComponentTitlePageBank } from "../component";
|
||||||
|
|
||||||
export default function InformasiBank({
|
export default function AdminAppInformation_ViewInfoBank({
|
||||||
listBank,
|
listBank,
|
||||||
}: {
|
}: {
|
||||||
listBank: MODEL_MASTER_BANK[];
|
listBank: MODEL_MASTER_BANK[];
|
||||||
}) {
|
}) {
|
||||||
const [data, setData] = useState(listBank);
|
const [data, setData] = useState(listBank);
|
||||||
const [isCreate, setIsCreate] = useState(false);
|
const [isCreate, setIsCreate] = useState(false);
|
||||||
const [newData, setNewData] = useState({
|
const [isLoadingCreate, setLoadingCreate] = useState(false);
|
||||||
name: "",
|
|
||||||
|
const [newData, setNewData] = useState<any>({
|
||||||
|
namaBank: "",
|
||||||
|
namaAkun: "",
|
||||||
norek: "",
|
norek: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const [isUpdate, setIsUpdate] = useState(false);
|
const [isUpdate, setIsUpdate] = useState(false);
|
||||||
const [updateData, setUpdateData] = useState({
|
const [updateData, setUpdateData] = useState({
|
||||||
id: "",
|
id: "",
|
||||||
name: "",
|
namaBank: "",
|
||||||
|
namaAkun: "",
|
||||||
norek: "",
|
norek: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -56,14 +59,18 @@ export default function InformasiBank({
|
|||||||
active: "",
|
active: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const [checked, setChecked] = useState(false);
|
|
||||||
|
|
||||||
async function onCreate() {
|
async function onCreate() {
|
||||||
const create = await adminAppInformation_createBank({ data: newData });
|
const create = await adminAppInformation_createBank({ data: newData });
|
||||||
if (create.status === 200) {
|
if (create.status === 200) {
|
||||||
|
try {
|
||||||
const loadData = await adminAppInformation_getMasterBank();
|
const loadData = await adminAppInformation_getMasterBank();
|
||||||
setData(loadData);
|
setData(loadData);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
setLoadingCreate(true);
|
||||||
ComponentAdminGlobal_NotifikasiBerhasil(create.message);
|
ComponentAdminGlobal_NotifikasiBerhasil(create.message);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ComponentAdminGlobal_NotifikasiGagal(create.message);
|
ComponentAdminGlobal_NotifikasiGagal(create.message);
|
||||||
}
|
}
|
||||||
@@ -93,11 +100,13 @@ export default function InformasiBank({
|
|||||||
}) {
|
}) {
|
||||||
const data = {
|
const data = {
|
||||||
id: id,
|
id: id,
|
||||||
active: value,
|
isActive: value,
|
||||||
};
|
};
|
||||||
|
|
||||||
const updt = await adminAppInformation_updateStatusBankById({
|
const updt = await adminAppInformation_updateStatusBankById({
|
||||||
data: data as any,
|
data: data as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (updt.status === 200) {
|
if (updt.status === 200) {
|
||||||
const loadData = await adminAppInformation_getMasterBank();
|
const loadData = await adminAppInformation_getMasterBank();
|
||||||
setData(loadData);
|
setData(loadData);
|
||||||
@@ -118,15 +127,10 @@ export default function InformasiBank({
|
|||||||
data.map((e, i) => (
|
data.map((e, i) => (
|
||||||
<tr key={i}>
|
<tr key={i}>
|
||||||
<td>
|
<td>
|
||||||
<Center>
|
<Center w={150}>
|
||||||
<Text>{e?.namaBank}</Text>
|
<Text>{e?.namaBank}</Text>
|
||||||
</Center>
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<Center>
|
|
||||||
<Text>{e?.norek}</Text>
|
|
||||||
</Center>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<Center>
|
<Center>
|
||||||
<Switch
|
<Switch
|
||||||
@@ -144,6 +148,17 @@ export default function InformasiBank({
|
|||||||
/>
|
/>
|
||||||
</Center>
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>
|
||||||
|
<Text>{e?.namaAkun}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>
|
||||||
|
<Text>{e?.norek}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<Stack align="center" justify="center">
|
<Stack align="center" justify="center">
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
@@ -154,7 +169,8 @@ export default function InformasiBank({
|
|||||||
setIsCreate(false);
|
setIsCreate(false);
|
||||||
setUpdateData({
|
setUpdateData({
|
||||||
id: e?.id,
|
id: e?.id,
|
||||||
name: e?.namaBank,
|
namaBank: e?.namaBank,
|
||||||
|
namaAkun: e?.namaAkun,
|
||||||
norek: e?.norek,
|
norek: e?.norek,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
@@ -172,13 +188,15 @@ export default function InformasiBank({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"xs"}>
|
<Stack spacing={"xs"}>
|
||||||
<Group
|
<AdminAppInformation_ComponentTitlePageBank
|
||||||
position="apart"
|
onEventListener={(val: { isCreate: any; isUpdate: any }) => {
|
||||||
bg={"gray.4"}
|
setIsCreate(val.isCreate);
|
||||||
p={"xs"}
|
setIsUpdate(val.isUpdate);
|
||||||
style={{ borderRadius: "6px" }}
|
}}
|
||||||
>
|
/>
|
||||||
<Title order={4}>Informasi Bank</Title>
|
{/* <ComponentAdminGlobal_TitlePage
|
||||||
|
name="Informasi Bank"
|
||||||
|
component={
|
||||||
<Button
|
<Button
|
||||||
w={120}
|
w={120}
|
||||||
leftIcon={<IconCirclePlus />}
|
leftIcon={<IconCirclePlus />}
|
||||||
@@ -190,32 +208,36 @@ export default function InformasiBank({
|
|||||||
>
|
>
|
||||||
Tambah
|
Tambah
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
}
|
||||||
|
/> */}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={"auto"}>
|
<Grid.Col span={9}>
|
||||||
<Paper p={"md"} withBorder shadow="lg" h={"50vh"}>
|
<Paper p={"md"} withBorder shadow="lg" h={"50vh"}>
|
||||||
<ScrollArea w={"100%"} h={"90%"} offsetScrollbars>
|
<ScrollArea w={"100%"} h={"90%"} offsetScrollbars>
|
||||||
<Table
|
<Table
|
||||||
verticalSpacing={"xs"}
|
verticalSpacing={"xs"}
|
||||||
horizontalSpacing={"md"}
|
horizontalSpacing={"md"}
|
||||||
p={"md"}
|
p={"md"}
|
||||||
w={"100%"}
|
w={1000}
|
||||||
striped
|
striped
|
||||||
highlightOnHover
|
highlightOnHover
|
||||||
>
|
>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
<Center>Nama Bank</Center>
|
<Center w={150}>Bank</Center>
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<Center>Nomor Rekening</Center>
|
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
<Center>Status</Center>
|
<Center>Status</Center>
|
||||||
</th>
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Nama Rekening</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Nomor Rekening</Center>
|
||||||
|
</th>
|
||||||
<th>
|
<th>
|
||||||
<Center>Aksi</Center>
|
<Center>Aksi</Center>
|
||||||
</th>
|
</th>
|
||||||
@@ -224,36 +246,39 @@ export default function InformasiBank({
|
|||||||
<tbody>{rowTable}</tbody>
|
<tbody>{rowTable}</tbody>
|
||||||
</Table>
|
</Table>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
{/* <Center mt={"xl"}>
|
|
||||||
<Pagination
|
|
||||||
total={10}
|
|
||||||
// value={isActivePage}
|
|
||||||
// total={isNPage}
|
|
||||||
// onChange={(val) => {
|
|
||||||
// onPageClick(val);
|
|
||||||
// }}
|
|
||||||
/>
|
|
||||||
</Center> */}
|
|
||||||
</Paper>
|
</Paper>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
|
||||||
<Grid.Col span={4}>
|
<Grid.Col span={3}>
|
||||||
{isCreate ? (
|
{isCreate ? (
|
||||||
<Paper p={"md"} withBorder shadow="lg">
|
<Paper p={"md"} withBorder shadow="lg">
|
||||||
<Stack>
|
<Stack>
|
||||||
<Center>
|
<Center>
|
||||||
<Title order={5}>Tambah Daftar Bank</Title>
|
<Title order={5}>Tambah Daftar Bank</Title>
|
||||||
</Center>
|
</Center>
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
label={"Nama Bank"}
|
label={"Nama Bank"}
|
||||||
placeholder="Masukan nama bank"
|
placeholder="Masukan nama bank"
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
setNewData({
|
setNewData({
|
||||||
...newData,
|
...newData,
|
||||||
name: val.currentTarget.value,
|
namaBank: val.currentTarget.value,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
label={"Nama Rekening"}
|
||||||
|
placeholder="Masukan nama rekening"
|
||||||
|
onChange={(val) => {
|
||||||
|
setNewData({
|
||||||
|
...newData,
|
||||||
|
namaAkun: val.currentTarget.value,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
label={"Nomor Rekening Bank"}
|
label={"Nomor Rekening Bank"}
|
||||||
placeholder=" Masukan nomor rekening bank"
|
placeholder=" Masukan nomor rekening bank"
|
||||||
@@ -275,6 +300,8 @@ export default function InformasiBank({
|
|||||||
Batal
|
Batal
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
loading={isLoadingCreate}
|
||||||
|
loaderPosition="center"
|
||||||
style={{ transition: "0.5s" }}
|
style={{ transition: "0.5s" }}
|
||||||
disabled={_.values(newData).includes("") ? true : false}
|
disabled={_.values(newData).includes("") ? true : false}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
@@ -291,6 +318,7 @@ export default function InformasiBank({
|
|||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isUpdate ? (
|
{isUpdate ? (
|
||||||
<Paper p={"md"} withBorder shadow="lg">
|
<Paper p={"md"} withBorder shadow="lg">
|
||||||
<Stack>
|
<Stack>
|
||||||
@@ -300,12 +328,23 @@ export default function InformasiBank({
|
|||||||
<TextInput
|
<TextInput
|
||||||
label={"Nama Bank"}
|
label={"Nama Bank"}
|
||||||
placeholder="Masukan nama bank"
|
placeholder="Masukan nama bank"
|
||||||
value={updateData.name}
|
value={updateData.namaBank}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
const value = val.currentTarget.value;
|
const value = val.currentTarget.value;
|
||||||
setUpdateData({ ...updateData, name: value });
|
setUpdateData({ ...updateData, namaBank: value });
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
label={"Nama Rekening"}
|
||||||
|
placeholder="Masukan nama rekening"
|
||||||
|
value={updateData.namaAkun}
|
||||||
|
onChange={(val) => {
|
||||||
|
const value = val.currentTarget.value;
|
||||||
|
setUpdateData({ ...updateData, namaAkun: value });
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
label={"Nomor Rekening Bank"}
|
label={"Nomor Rekening Bank"}
|
||||||
placeholder=" Masukan nomor rekening bank"
|
placeholder=" Masukan nomor rekening bank"
|
||||||
@@ -328,7 +367,9 @@ export default function InformasiBank({
|
|||||||
<Button
|
<Button
|
||||||
style={{ transition: "0.5s" }}
|
style={{ transition: "0.5s" }}
|
||||||
disabled={
|
disabled={
|
||||||
updateData?.name === "" || updateData?.norek === ""
|
updateData?.namaBank === "" ||
|
||||||
|
updateData?.namaAkun === "" ||
|
||||||
|
updateData?.norek === ""
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
@@ -338,7 +379,7 @@ export default function InformasiBank({
|
|||||||
onUpdate();
|
onUpdate();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Simpan
|
Update
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -3,12 +3,13 @@
|
|||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Button,
|
Button,
|
||||||
|
Collapse,
|
||||||
Group,
|
Group,
|
||||||
Paper,
|
Paper,
|
||||||
Stack,
|
Stack,
|
||||||
TextInput,
|
TextInput,
|
||||||
Title,
|
Title,
|
||||||
Tooltip
|
Tooltip,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconEdit, IconPhone } from "@tabler/icons-react";
|
import { IconEdit, IconPhone } from "@tabler/icons-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -16,11 +17,17 @@ import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/adm
|
|||||||
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
|
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
|
||||||
import adminAppInformation_getNomorAdmin from "../fun/master/get_nomor_admin";
|
import adminAppInformation_getNomorAdmin from "../fun/master/get_nomor_admin";
|
||||||
import adminAppInformation_funUpdateNomorAdmin from "../fun/update/fun_update_nomor";
|
import adminAppInformation_funUpdateNomorAdmin from "../fun/update/fun_update_nomor";
|
||||||
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function InformasiWhatApps({ nomorAdmin }: { nomorAdmin: any }) {
|
export default function AdminAppInformation_ViewInformasiWhatApps({
|
||||||
const [disabled, setDisable] = useState(true);
|
nomorAdmin,
|
||||||
|
}: {
|
||||||
|
nomorAdmin: any;
|
||||||
|
}) {
|
||||||
const [dataNomor, setDataNomor] = useState(nomorAdmin);
|
const [dataNomor, setDataNomor] = useState(nomorAdmin);
|
||||||
const [updateNomor, setUpdateNomor] = useState("");
|
const [updateNomor, setUpdateNomor] = useState("");
|
||||||
|
const [opened, { toggle }] = useDisclosure(false);
|
||||||
|
|
||||||
async function onUpdate() {
|
async function onUpdate() {
|
||||||
const newNumber = (dataNomor.nomor = updateNomor);
|
const newNumber = (dataNomor.nomor = updateNomor);
|
||||||
@@ -33,14 +40,10 @@ export default function InformasiWhatApps({ nomorAdmin }: { nomorAdmin: any }) {
|
|||||||
data: dataNomor,
|
data: dataNomor,
|
||||||
});
|
});
|
||||||
if (updt.status === 200) {
|
if (updt.status === 200) {
|
||||||
setDisable(true);
|
|
||||||
setUpdateNomor("");
|
|
||||||
const loadDdata = await adminAppInformation_getNomorAdmin();
|
const loadDdata = await adminAppInformation_getNomorAdmin();
|
||||||
setDataNomor(loadDdata);
|
setDataNomor(loadDdata);
|
||||||
if (loadDdata) {
|
toggle();
|
||||||
ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
|
ComponentAdminGlobal_NotifikasiBerhasil(updt.message);
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
ComponentAdminGlobal_NotifikasiGagal(updt.message);
|
ComponentAdminGlobal_NotifikasiGagal(updt.message);
|
||||||
}
|
}
|
||||||
@@ -68,29 +71,31 @@ export default function InformasiWhatApps({ nomorAdmin }: { nomorAdmin: any }) {
|
|||||||
<Tooltip label={"Edit"}>
|
<Tooltip label={"Edit"}>
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
style={{ transition: "0.2s" }}
|
style={{ transition: "0.2s" }}
|
||||||
variant="subtle"
|
variant="transparent"
|
||||||
disabled={disabled ? false : true}
|
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDisable(false);
|
toggle();
|
||||||
setUpdateNomor(dataNomor.nomor);
|
setUpdateNomor(dataNomor.nomor);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IconEdit
|
<IconEdit
|
||||||
style={{ transition: "0.2s" }}
|
style={{
|
||||||
color={disabled ? "green" : "gray"}
|
transition: "0.2s",
|
||||||
|
}}
|
||||||
|
color={MainColor.darkblue}
|
||||||
/>
|
/>
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Group>
|
</Group>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
{disabled ? (
|
<Collapse
|
||||||
""
|
in={opened}
|
||||||
) : (
|
transitionDuration={300}
|
||||||
|
transitionTimingFunction="linear"
|
||||||
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<TextInput
|
<TextInput
|
||||||
disabled={disabled ? true : false}
|
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="Update nomor admin"
|
placeholder="Update nomor admin"
|
||||||
icon={<IconPhone />}
|
icon={<IconPhone />}
|
||||||
@@ -103,18 +108,16 @@ export default function InformasiWhatApps({ nomorAdmin }: { nomorAdmin: any }) {
|
|||||||
<Group position="right">
|
<Group position="right">
|
||||||
<Button
|
<Button
|
||||||
style={{ transition: "0.2s" }}
|
style={{ transition: "0.2s" }}
|
||||||
disabled={disabled ? true : false}
|
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDisable(true);
|
toggle();
|
||||||
setUpdateNomor("");
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Batal
|
Batal
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
style={{ transition: "0.2s" }}
|
style={{ transition: "0.2s" }}
|
||||||
disabled={disabled || updateNomor === "" ? true : false}
|
disabled={updateNomor === "" ? true : false}
|
||||||
color="green"
|
color="green"
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -125,7 +128,7 @@ export default function InformasiWhatApps({ nomorAdmin }: { nomorAdmin: any }) {
|
|||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
</Collapse>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
</Stack>
|
</Stack>
|
||||||
3
src/app_modules/admin/event/_ui/index.ts
Normal file
3
src/app_modules/admin/event/_ui/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import { AdminEvent_UiDetailPeserta } from "./ui_detail_peserta";
|
||||||
|
|
||||||
|
export { AdminEvent_UiDetailPeserta };
|
||||||
28
src/app_modules/admin/event/_ui/ui_detail_peserta.tsx
Normal file
28
src/app_modules/admin/event/_ui/ui_detail_peserta.tsx
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { Stack } from "@mantine/core";
|
||||||
|
import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button";
|
||||||
|
import { AdminEvent_ViewDetailPeserta } from "../_view";
|
||||||
|
import { MODEL_EVENT_PESERTA } from "@/app_modules/event/model/interface";
|
||||||
|
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global";
|
||||||
|
|
||||||
|
export function AdminEvent_UiDetailPeserta({
|
||||||
|
dataPeserta,
|
||||||
|
eventId,
|
||||||
|
}: {
|
||||||
|
dataPeserta: any;
|
||||||
|
eventId: string
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack>
|
||||||
|
<ComponentAdminGlobal_BackButton />
|
||||||
|
<ComponentAdminGlobal_TitlePage name="Detail Peserta" />
|
||||||
|
<AdminEvent_ViewDetailPeserta
|
||||||
|
dataPeserta={dataPeserta as any}
|
||||||
|
eventId={eventId}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
3
src/app_modules/admin/event/_view/index.ts
Normal file
3
src/app_modules/admin/event/_view/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import { AdminEvent_ViewDetailPeserta } from "./view_detail_peserta";
|
||||||
|
|
||||||
|
export { AdminEvent_ViewDetailPeserta };
|
||||||
112
src/app_modules/admin/event/_view/view_detail_peserta.tsx
Normal file
112
src/app_modules/admin/event/_view/view_detail_peserta.tsx
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { MODEL_EVENT_PESERTA } from "@/app_modules/event/model/interface";
|
||||||
|
import {
|
||||||
|
Button,
|
||||||
|
Center,
|
||||||
|
Pagination,
|
||||||
|
Paper,
|
||||||
|
ScrollArea,
|
||||||
|
Stack,
|
||||||
|
Table,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { adminEvent_getListPesertaById } from "../fun";
|
||||||
|
import _ from "lodash";
|
||||||
|
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
|
||||||
|
|
||||||
|
export function AdminEvent_ViewDetailPeserta({
|
||||||
|
dataPeserta,
|
||||||
|
eventId,
|
||||||
|
}: {
|
||||||
|
dataPeserta: any;
|
||||||
|
eventId: string;
|
||||||
|
}) {
|
||||||
|
const [data, setData] = useState<MODEL_EVENT_PESERTA[]>(dataPeserta.data);
|
||||||
|
const [isNPage, setNPage] = useState(dataPeserta.nPage);
|
||||||
|
const [isActivePage, setActivePage] = useState(1);
|
||||||
|
|
||||||
|
async function onPageClick(p: any) {
|
||||||
|
setActivePage(p);
|
||||||
|
const loadData = await adminEvent_getListPesertaById({
|
||||||
|
eventId: eventId,
|
||||||
|
page: p,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
const tableRow = _.isEmpty(data)
|
||||||
|
? []
|
||||||
|
: data.map((e, i) => (
|
||||||
|
<tr key={i}>
|
||||||
|
<td>
|
||||||
|
<Center>{e?.User?.username}</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>{e?.User?.Profile?.name}</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>+{e?.User?.nomor}</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>{e?.User?.Profile?.email}</Center>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper p={"md"} withBorder shadow="lg" h={"75vh"}>
|
||||||
|
<ScrollArea w={"100%"} h={"90%"}>
|
||||||
|
<Table
|
||||||
|
verticalSpacing={"md"}
|
||||||
|
horizontalSpacing={"md"}
|
||||||
|
p={"md"}
|
||||||
|
w={"100%"}
|
||||||
|
striped
|
||||||
|
highlightOnHover
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<Center>Username</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Name</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Nomor</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Email</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{tableRow}</tbody>
|
||||||
|
</Table>
|
||||||
|
{_.isEmpty(data) ? (
|
||||||
|
<ComponentAdminGlobal_IsEmptyData
|
||||||
|
text="Tidak ada peserta"
|
||||||
|
marginTop={100}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
</ScrollArea>
|
||||||
|
|
||||||
|
<Center mt={"xl"}>
|
||||||
|
<Pagination
|
||||||
|
value={isActivePage}
|
||||||
|
total={isNPage}
|
||||||
|
onChange={(val) => {
|
||||||
|
onPageClick(val);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Paper>
|
||||||
|
|
||||||
|
{/* <pre>{JSON.stringify(dataPeserta, null, 2)}</pre> */}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,36 +1,36 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
|
import {
|
||||||
|
MODEL_EVENT,
|
||||||
|
MODEL_EVENT_PESERTA,
|
||||||
|
} from "@/app_modules/event/model/interface";
|
||||||
import {
|
import {
|
||||||
Avatar,
|
Avatar,
|
||||||
Box,
|
|
||||||
Button,
|
Button,
|
||||||
Center,
|
Center,
|
||||||
Divider,
|
Divider,
|
||||||
Grid,
|
Grid,
|
||||||
Group,
|
Group,
|
||||||
Loader,
|
|
||||||
Modal,
|
Modal,
|
||||||
|
Pagination,
|
||||||
Paper,
|
Paper,
|
||||||
SimpleGrid,
|
ScrollArea,
|
||||||
Spoiler,
|
Spoiler,
|
||||||
Stack,
|
Stack,
|
||||||
Table,
|
Table,
|
||||||
Text,
|
Text,
|
||||||
|
TextInput,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
|
||||||
import {
|
|
||||||
MODEL_EVENT,
|
|
||||||
MODEL_EVENT_PESERTA,
|
|
||||||
} from "@/app_modules/event/model/interface";
|
|
||||||
import { data } from "autoprefixer";
|
|
||||||
import _ from "lodash";
|
|
||||||
import moment from "moment";
|
|
||||||
import { IconEyeShare } from "@tabler/icons-react";
|
|
||||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||||
|
import { IconCircleCheck, IconSearch } from "@tabler/icons-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { AdminEvent_getListPesertaById } from "../fun/get/get_list_peserta_by_id";
|
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
import { adminEvent_funGetListAllRiwayat } from "../fun";
|
||||||
|
import { adminEvent_getListPesertaById } from "../fun/get/get_list_peserta_by_id";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||||
|
|
||||||
export default function AdminEvent_Riwayat({
|
export default function AdminEvent_Riwayat({
|
||||||
listRiwayat,
|
listRiwayat,
|
||||||
@@ -47,68 +47,192 @@ export default function AdminEvent_Riwayat({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DetailRiwayat({ listRiwayat }: { listRiwayat: MODEL_EVENT[] }) {
|
function DetailRiwayat({ listRiwayat }: { listRiwayat: any }) {
|
||||||
const [opened, setOpen] = useState(false);
|
const router = useRouter();
|
||||||
|
const [opened, { open, close }] = useDisclosure(false);
|
||||||
const [peserta, setPeserta] = useState<MODEL_EVENT_PESERTA[]>();
|
const [peserta, setPeserta] = useState<MODEL_EVENT_PESERTA[]>();
|
||||||
const [eventId, setEventId] = useState("");
|
const [eventId, setEventId] = useState("");
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const TableRows = listRiwayat.map((e, i) => (
|
const [data, setData] = useState<MODEL_EVENT[]>(listRiwayat.data);
|
||||||
<tr key={e.id}>
|
const [isNPage, setNPage] = useState(listRiwayat.nPage);
|
||||||
|
const [isActivePage, setActivePage] = useState(1);
|
||||||
|
const [isSearch, setSearch] = useState("");
|
||||||
|
|
||||||
|
async function onSearch(s: string) {
|
||||||
|
setSearch(s);
|
||||||
|
const loadData = await adminEvent_funGetListAllRiwayat({
|
||||||
|
page: 1,
|
||||||
|
search: s,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onPageClick(p: any) {
|
||||||
|
setActivePage(p);
|
||||||
|
const loadData = await adminEvent_funGetListAllRiwayat({
|
||||||
|
search: isSearch,
|
||||||
|
page: p,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
const TableRows = data.map((e, i) => (
|
||||||
|
<tr key={i}>
|
||||||
<td>
|
<td>
|
||||||
<Button
|
<Button
|
||||||
loading={e.id === eventId ? (loading === true ? true : false) : false}
|
loading={e.id === eventId && loading ? true : false}
|
||||||
color={"green"}
|
color={"green"}
|
||||||
leftIcon={<IconEyeShare />}
|
leftIcon={<IconCircleCheck />}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={async () => {
|
onClick={() => {
|
||||||
setEventId(e.id);
|
router.push(RouterAdminEvent.detail_peserta + e.id);
|
||||||
setLoading(true);
|
// setEventId(e.id);
|
||||||
await new Promise((r) => setTimeout(r, 500));
|
// setLoading(true);
|
||||||
await AdminEvent_getListPesertaById(e.id).then((res: any) => {
|
// await new Promise((v) => setTimeout(v, 500));
|
||||||
setLoading(false);
|
// await AdminEvent_getListPesertaById(e.id).then((res: any) => {
|
||||||
setPeserta(res);
|
// setPeserta(res);
|
||||||
});
|
// setLoading(false);
|
||||||
setOpen(true);
|
// });
|
||||||
|
// open();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Peserta
|
Lihat Peserta
|
||||||
</Button>
|
</Button>
|
||||||
</td>
|
</td>
|
||||||
<td>{e?.Author?.Profile?.name}</td>
|
|
||||||
<td>{e?.title}</td>
|
|
||||||
<td>{e?.lokasi}</td>
|
|
||||||
<td>{e?.EventMaster_TipeAcara?.name}</td>
|
|
||||||
<td>{e?.tanggal.toLocaleString("id-ID", { dateStyle: "full" })}</td>
|
|
||||||
<td>
|
<td>
|
||||||
{e.tanggal.toLocaleTimeString([], {
|
<Center w={200}>
|
||||||
hour: "2-digit",
|
<Text>{e?.Author?.username}</Text>
|
||||||
minute: "2-digit",
|
</Center>
|
||||||
})}
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text lineClamp={2}>{e.title}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text>{e.lokasi}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text>{e.EventMaster_TipeAcara.name}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
{e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })}
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
{e.tanggal.toLocaleTimeString([], {
|
||||||
|
timeStyle: "short",
|
||||||
|
hourCycle: "h24",
|
||||||
|
})}
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={400}>
|
||||||
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
||||||
{e.deskripsi}
|
{e.deskripsi}
|
||||||
</Spoiler>
|
</Spoiler>
|
||||||
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
));
|
));
|
||||||
|
|
||||||
useShallowEffect(() => {
|
// useShallowEffect(() => {
|
||||||
getAllPeserta(eventId);
|
// getAllPeserta(eventId);
|
||||||
}, [eventId]);
|
// }, [eventId]);
|
||||||
|
|
||||||
async function getAllPeserta(eventId: string) {
|
// async function getAllPeserta(eventId: string) {
|
||||||
await AdminEvent_getListPesertaById(eventId).then((res: any) =>
|
// await adminEvent_getListPesertaById(eventId).then((res: any) =>
|
||||||
setPeserta(res)
|
// setPeserta(res)
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Stack spacing={"xs"} h={"100%"}>
|
||||||
|
<Group
|
||||||
|
position="apart"
|
||||||
|
bg={"gray.4"}
|
||||||
|
p={"xs"}
|
||||||
|
style={{ borderRadius: "6px" }}
|
||||||
|
>
|
||||||
|
<Title order={4}>Riwayat</Title>
|
||||||
|
<TextInput
|
||||||
|
icon={<IconSearch size={20} />}
|
||||||
|
radius={"xl"}
|
||||||
|
placeholder="Masukan judul"
|
||||||
|
onChange={(val) => {
|
||||||
|
onSearch(val.currentTarget.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
|
||||||
|
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||||
|
<ScrollArea w={"100%"} h={"90%"}>
|
||||||
|
<Table
|
||||||
|
verticalSpacing={"md"}
|
||||||
|
horizontalSpacing={"md"}
|
||||||
|
p={"md"}
|
||||||
|
w={"100%"}
|
||||||
|
striped
|
||||||
|
highlightOnHover
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<Center>Aksi</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Username</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Judul</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Lokasi</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Tipe Acara</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Tanggal</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Jam</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Deskripsi</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{TableRows}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
|
||||||
|
<Center mt={"xl"}>
|
||||||
|
<Pagination
|
||||||
|
value={isActivePage}
|
||||||
|
total={isNPage}
|
||||||
|
onChange={(val) => {
|
||||||
|
onPageClick(val);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Paper>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
opened={opened}
|
opened={opened}
|
||||||
onClose={() => setOpen(false)}
|
onClose={close}
|
||||||
size={"md"}
|
size={"md"}
|
||||||
// closeOnClickOutside={false}
|
// closeOnClickOutside={false}
|
||||||
withCloseButton={false}
|
withCloseButton={false}
|
||||||
@@ -145,55 +269,6 @@ function DetailRiwayat({ listRiwayat }: { listRiwayat: MODEL_EVENT[] }) {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Box>
|
|
||||||
<Box bg={"gray.1"} p={"xs"}>
|
|
||||||
<Title order={6} c={"gray"}>
|
|
||||||
RIWAYAT
|
|
||||||
</Title>
|
|
||||||
</Box>
|
|
||||||
<Table
|
|
||||||
withBorder
|
|
||||||
verticalSpacing={"md"}
|
|
||||||
horizontalSpacing={"xl"}
|
|
||||||
p={"md"}
|
|
||||||
striped
|
|
||||||
highlightOnHover
|
|
||||||
>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>
|
|
||||||
<Center>Aksi</Center>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<Center>Author</Center>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<Center>Judul</Center>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<Center>Lokasi</Center>
|
|
||||||
</th>
|
|
||||||
<th>Tipe Acara</th>
|
|
||||||
<th>Tanggal</th>
|
|
||||||
<th>Jam</th>
|
|
||||||
<th>
|
|
||||||
<Center>Deskripsi</Center>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>{TableRows}</tbody>
|
|
||||||
</Table>
|
|
||||||
<Center>
|
|
||||||
{_.isEmpty(TableRows) ? (
|
|
||||||
<Center h={"50vh"}>
|
|
||||||
<Title order={6}>Tidak Ada Data</Title>
|
|
||||||
</Center>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Center>
|
|
||||||
</Box>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
|
import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/interface";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Box,
|
|
||||||
Button,
|
Button,
|
||||||
Divider,
|
Divider,
|
||||||
Group,
|
Group,
|
||||||
List,
|
|
||||||
Modal,
|
Modal,
|
||||||
Paper,
|
Paper,
|
||||||
SimpleGrid,
|
SimpleGrid,
|
||||||
@@ -15,20 +17,14 @@ import {
|
|||||||
TextInput,
|
TextInput,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import ComponentAdminDonasi_TombolKembali from "../../donasi/component/tombol_kembali";
|
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
|
||||||
import { MODEL_DEFAULT_MASTER_OLD } from "@/app_modules/model_global/interface";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { AdminEvent_funCreateTipeAcara } from "../fun/create/fun_create_tipe_acara";
|
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
|
||||||
import { AdminEvent_getListTipeAcara } from "../fun/get/get_list_tipe_acara";
|
|
||||||
import { IconEditCircle, IconTrash } from "@tabler/icons-react";
|
|
||||||
import { AdminEvent_funEditTipeAcara } from "../fun/edit/fun_edit_tipe_acara";
|
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
|
import { IconCirclePlus, IconEditCircle, IconTrash } from "@tabler/icons-react";
|
||||||
|
import { useState } from "react";
|
||||||
|
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||||
|
import { AdminEvent_funCreateTipeAcara } from "../fun/create/fun_create_tipe_acara";
|
||||||
import { AdminEvent_funEditActivationTipeAcaraById } from "../fun/edit/fun_edit_activation_tipe_acara";
|
import { AdminEvent_funEditActivationTipeAcaraById } from "../fun/edit/fun_edit_activation_tipe_acara";
|
||||||
import { number } from "echarts";
|
import { AdminEvent_funEditTipeAcara } from "../fun/edit/fun_edit_tipe_acara";
|
||||||
|
import { AdminEvent_getListTipeAcara } from "../fun/get/get_list_tipe_acara";
|
||||||
|
|
||||||
export default function AdminEvent_DetailTipeAcara({
|
export default function AdminEvent_DetailTipeAcara({
|
||||||
listTipe,
|
listTipe,
|
||||||
@@ -38,14 +34,19 @@ export default function AdminEvent_DetailTipeAcara({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ComponentAdminGlobal_HeaderTamplate name="Event: Tipe Acara" />
|
<ComponentAdminGlobal_HeaderTamplate name="Event" />
|
||||||
|
|
||||||
<DetailTipeAcara listTipe={listTipe} />
|
<DetailTipeAcara listTipe={listTipe} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DetailTipeAcara({ listTipe }: { listTipe: MODEL_DEFAULT_MASTER_OLD[] }) {
|
function DetailTipeAcara({
|
||||||
|
listTipe,
|
||||||
|
}: {
|
||||||
|
listTipe: MODEL_DEFAULT_MASTER_OLD[];
|
||||||
|
}) {
|
||||||
const [tipe, setTipe] = useState(listTipe);
|
const [tipe, setTipe] = useState(listTipe);
|
||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
const [openEditor, setOpenEditor] = useState(false);
|
const [openEditor, setOpenEditor] = useState(false);
|
||||||
@@ -55,6 +56,7 @@ function DetailTipeAcara({ listTipe }: { listTipe: MODEL_DEFAULT_MASTER_OLD[] })
|
|||||||
id: "",
|
id: "",
|
||||||
name: "",
|
name: "",
|
||||||
});
|
});
|
||||||
|
const [openCreate, setOpenCreate] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -79,8 +81,28 @@ function DetailTipeAcara({ listTipe }: { listTipe: MODEL_DEFAULT_MASTER_OLD[] })
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
<Group
|
||||||
|
position="apart"
|
||||||
|
bg={"gray.4"}
|
||||||
|
p={"xs"}
|
||||||
|
style={{ borderRadius: "6px" }}
|
||||||
|
>
|
||||||
|
<Title order={4}>Tipe Acara</Title>
|
||||||
|
<Button
|
||||||
|
leftIcon={<IconCirclePlus />}
|
||||||
|
radius={"xl"}
|
||||||
|
color="green"
|
||||||
|
onClick={() => {
|
||||||
|
setOpenCreate(true);
|
||||||
|
setOpenEditor(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Tambah
|
||||||
|
</Button>
|
||||||
|
</Group>
|
||||||
|
|
||||||
<SimpleGrid
|
<SimpleGrid
|
||||||
cols={3}
|
cols={2}
|
||||||
spacing="lg"
|
spacing="lg"
|
||||||
breakpoints={[
|
breakpoints={[
|
||||||
{ maxWidth: "62rem", cols: 4, spacing: "lg" },
|
{ maxWidth: "62rem", cols: 4, spacing: "lg" },
|
||||||
@@ -88,26 +110,6 @@ function DetailTipeAcara({ listTipe }: { listTipe: MODEL_DEFAULT_MASTER_OLD[] })
|
|||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<div>
|
|
||||||
<Paper p={"sm"} shadow="lg" withBorder>
|
|
||||||
<Stack>
|
|
||||||
<TextInput
|
|
||||||
value={name ? name : ""}
|
|
||||||
label="Masukan Tipe"
|
|
||||||
placeholder="Contoh: Seminar, Workshop, dll."
|
|
||||||
onChange={(val) => {
|
|
||||||
setName(val.target.value);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Group position="right">
|
|
||||||
<Button onClick={() => onSave(name, setName, setTipe)}>
|
|
||||||
Tambah
|
|
||||||
</Button>
|
|
||||||
</Group>
|
|
||||||
</Stack>
|
|
||||||
</Paper>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Paper p={"md"} shadow="lg" withBorder>
|
<Paper p={"md"} shadow="lg" withBorder>
|
||||||
<Stack>
|
<Stack>
|
||||||
@@ -122,6 +124,7 @@ function DetailTipeAcara({ listTipe }: { listTipe: MODEL_DEFAULT_MASTER_OLD[] })
|
|||||||
variant="transparent"
|
variant="transparent"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOpenEditor(true);
|
setOpenEditor(true);
|
||||||
|
setOpenCreate(false);
|
||||||
setEdit(e);
|
setEdit(e);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -150,27 +153,67 @@ function DetailTipeAcara({ listTipe }: { listTipe: MODEL_DEFAULT_MASTER_OLD[] })
|
|||||||
</Paper>
|
</Paper>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{openCreate ? (
|
||||||
|
<div>
|
||||||
|
<Paper p={"sm"} shadow="lg" withBorder>
|
||||||
|
<Stack>
|
||||||
|
<TextInput
|
||||||
|
value={name ? name : ""}
|
||||||
|
label="Masukan Tipe"
|
||||||
|
placeholder="Contoh: Seminar, Workshop, dll."
|
||||||
|
onChange={(val) => {
|
||||||
|
setName(val.currentTarget.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Group position="right">
|
||||||
|
<Button radius={"xl"} onClick={() => setOpenCreate(false)}>
|
||||||
|
Batal
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
disabled={!name}
|
||||||
|
style={{
|
||||||
|
transition: "all 0.5s ease",
|
||||||
|
}}
|
||||||
|
color="green"
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => onSave(name, setName, setTipe)}
|
||||||
|
>
|
||||||
|
Simpan
|
||||||
|
</Button>
|
||||||
|
</Group>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{openEditor ? (
|
{openEditor ? (
|
||||||
<Paper p={"sm"} shadow="lg" withBorder>
|
<Paper p={"sm"} shadow="lg" withBorder>
|
||||||
<Stack>
|
<Stack>
|
||||||
<TextInput
|
<TextInput
|
||||||
value={edit?.name ? edit?.name : ""}
|
value={edit?.name ? edit?.name : ""}
|
||||||
label="Edit Tipe Event"
|
label="Edit Tipe"
|
||||||
placeholder="Contoh: Ramah Tamah, dll"
|
placeholder="Contoh: Ramah Tamah, dll"
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
setEdit({
|
setEdit({
|
||||||
...(edit as any),
|
...(edit as any),
|
||||||
name: val.target.value,
|
namaBank: val.target.value,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Group position="right">
|
<Group position="right">
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Button color="red" onClick={() => setOpenEditor(false)}>
|
<Button radius={"xl"} onClick={() => setOpenEditor(false)}>
|
||||||
Batal
|
Batal
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
disabled={!edit?.name}
|
||||||
|
style={{
|
||||||
|
transition: "all 0.5s ease",
|
||||||
|
}}
|
||||||
|
radius={"xl"}
|
||||||
color="green"
|
color="green"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
onUpdate(edit?.id, edit?.name, setTipe, setOpenEditor)
|
onUpdate(edit?.id, edit?.name, setTipe, setOpenEditor)
|
||||||
@@ -222,7 +265,11 @@ async function onUpdate(id: any, edit: any, setTipe: any, setOpenEditor: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onDelete(data: MODEL_DEFAULT_MASTER_OLD, close: any, setTipe: any) {
|
async function onDelete(
|
||||||
|
data: MODEL_DEFAULT_MASTER_OLD,
|
||||||
|
close: any,
|
||||||
|
setTipe: any
|
||||||
|
) {
|
||||||
await AdminEvent_funEditActivationTipeAcaraById(data.id as any).then(
|
await AdminEvent_funEditActivationTipeAcaraById(data.id as any).then(
|
||||||
async (res) => {
|
async (res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
|||||||
@@ -1,10 +1,21 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import _ from "lodash";
|
import _, { ceil } from "lodash";
|
||||||
|
|
||||||
|
export async function adminEvent_funGetListAllRiwayat({
|
||||||
|
page,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
page: number;
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
let takeData = 10;
|
||||||
|
let skipData = page * takeData - takeData;
|
||||||
|
|
||||||
export async function AdminEvent_getListAllRiwayat() {
|
|
||||||
const data = await prisma.event.findMany({
|
const data = await prisma.event.findMany({
|
||||||
|
skip: skipData,
|
||||||
|
take: takeData,
|
||||||
orderBy: {
|
orderBy: {
|
||||||
tanggal: "desc",
|
tanggal: "desc",
|
||||||
},
|
},
|
||||||
@@ -13,13 +24,12 @@ export async function AdminEvent_getListAllRiwayat() {
|
|||||||
tanggal: {
|
tanggal: {
|
||||||
lte: new Date(),
|
lte: new Date(),
|
||||||
},
|
},
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
},
|
},
|
||||||
select: {
|
},
|
||||||
id: true,
|
include: {
|
||||||
title: true,
|
|
||||||
lokasi: true,
|
|
||||||
tanggal: true,
|
|
||||||
deskripsi: true,
|
|
||||||
Author: {
|
Author: {
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
@@ -31,15 +41,28 @@ export async function AdminEvent_getListAllRiwayat() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
EventMaster_TipeAcara: {
|
EventMaster_Status: true,
|
||||||
select: {
|
EventMaster_TipeAcara: true,
|
||||||
id: true,
|
|
||||||
name: true,
|
|
||||||
},
|
},
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return data;
|
const nCount = await prisma.event.count({
|
||||||
|
where: {
|
||||||
|
eventMaster_StatusId: "1",
|
||||||
|
tanggal: {
|
||||||
|
lte: new Date(),
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allData = {
|
||||||
|
data: data,
|
||||||
|
nPage: ceil(nCount / takeData),
|
||||||
|
};
|
||||||
|
|
||||||
|
return allData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,45 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { ceil } from "lodash";
|
||||||
|
|
||||||
|
export async function adminEvent_getListPesertaById({
|
||||||
|
eventId,
|
||||||
|
page,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
eventId: string;
|
||||||
|
page: number;
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
let takeData = 10;
|
||||||
|
let skipData = page * takeData - takeData;
|
||||||
|
|
||||||
export async function AdminEvent_getListPesertaById(eventId: string) {
|
|
||||||
const data = await prisma.event_Peserta.findMany({
|
const data = await prisma.event_Peserta.findMany({
|
||||||
|
skip: skipData,
|
||||||
|
take: takeData,
|
||||||
where: {
|
where: {
|
||||||
eventId: eventId,
|
eventId: eventId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
|
||||||
User: {
|
User: {
|
||||||
select: {
|
include: {
|
||||||
Profile: true,
|
Profile: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return data;
|
const nCount = await prisma.event_Peserta.count({
|
||||||
|
where: {
|
||||||
|
eventId: eventId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allData = {
|
||||||
|
data: data,
|
||||||
|
nPage: ceil(nCount / takeData),
|
||||||
|
};
|
||||||
|
|
||||||
|
return allData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { ceil } from "lodash";
|
||||||
|
|
||||||
|
export async function adminEvent_funGetListPublish({
|
||||||
|
page,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
page: number;
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
let takeData = 10;
|
||||||
|
let skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
const data = await prisma.event.findMany({
|
||||||
|
skip: skipData,
|
||||||
|
take: takeData,
|
||||||
|
orderBy: {
|
||||||
|
tanggal: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
eventMaster_StatusId: "1",
|
||||||
|
tanggal: {
|
||||||
|
gte: new Date(),
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
Author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
Profile: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
EventMaster_Status: true,
|
||||||
|
EventMaster_TipeAcara: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const nCount = await prisma.event.count({
|
||||||
|
where: {
|
||||||
|
eventMaster_StatusId: "1",
|
||||||
|
tanggal: {
|
||||||
|
gte: new Date(),
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allData = {
|
||||||
|
data: data,
|
||||||
|
nPage: ceil(nCount / takeData),
|
||||||
|
};
|
||||||
|
|
||||||
|
return allData;
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { ceil } from "lodash";
|
||||||
|
|
||||||
|
export async function adminEvent_funGetListReject({
|
||||||
|
page,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
page: number;
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
let takeData = 10;
|
||||||
|
let skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
const data = await prisma.event.findMany({
|
||||||
|
skip: skipData,
|
||||||
|
take: takeData,
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
eventMaster_StatusId: "4",
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
Author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
Profile: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
EventMaster_Status: true,
|
||||||
|
EventMaster_TipeAcara: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const nCount = await prisma.event.count({
|
||||||
|
orderBy: {
|
||||||
|
tanggal: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
eventMaster_StatusId: "4",
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allData = {
|
||||||
|
data: data,
|
||||||
|
nPage: ceil(nCount / takeData),
|
||||||
|
};
|
||||||
|
|
||||||
|
return allData;
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { ceil } from "lodash";
|
||||||
|
|
||||||
|
export async function adminEvent_funGetListReview({
|
||||||
|
page,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
page: number;
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
let takeData = 10;
|
||||||
|
let skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
const data = await prisma.event.findMany({
|
||||||
|
skip: skipData,
|
||||||
|
take: takeData,
|
||||||
|
orderBy: {
|
||||||
|
tanggal: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
eventMaster_StatusId: "2",
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
Author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
Profile: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
EventMaster_Status: true,
|
||||||
|
EventMaster_TipeAcara: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const nCount = await prisma.event.count({
|
||||||
|
orderBy: {
|
||||||
|
tanggal: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
eventMaster_StatusId: "2",
|
||||||
|
title: {
|
||||||
|
contains: search,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allData = {
|
||||||
|
data: data,
|
||||||
|
nPage: ceil(nCount / takeData),
|
||||||
|
};
|
||||||
|
|
||||||
|
return allData;
|
||||||
|
}
|
||||||
11
src/app_modules/admin/event/fun/index.ts
Normal file
11
src/app_modules/admin/event/fun/index.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { adminEvent_funGetListAllRiwayat } from "./get/get_list_all_riwayat";
|
||||||
|
import { adminEvent_getListPesertaById } from "./get/get_list_peserta_by_id";
|
||||||
|
import { adminEvent_funGetListPublish } from "./get/status/fun_get_list_publish";
|
||||||
|
import { adminEvent_funGetListReject } from "./get/status/fun_get_list_reject";
|
||||||
|
import { adminEvent_funGetListReview } from "./get/status/fun_get_list_review";
|
||||||
|
|
||||||
|
export { adminEvent_funGetListReview };
|
||||||
|
export { adminEvent_funGetListReject };
|
||||||
|
export { adminEvent_funGetListPublish };
|
||||||
|
export { adminEvent_funGetListAllRiwayat };
|
||||||
|
export { adminEvent_getListPesertaById };
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
|
||||||
Avatar,
|
Avatar,
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
@@ -11,99 +9,137 @@ import {
|
|||||||
Grid,
|
Grid,
|
||||||
Group,
|
Group,
|
||||||
Modal,
|
Modal,
|
||||||
|
Pagination,
|
||||||
Paper,
|
Paper,
|
||||||
|
ScrollArea,
|
||||||
Spoiler,
|
Spoiler,
|
||||||
Stack,
|
Stack,
|
||||||
Table,
|
Table,
|
||||||
Text,
|
Text,
|
||||||
|
TextInput,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
import { IconCircleCheck, IconEyeShare, IconSearch } from "@tabler/icons-react";
|
||||||
IconBan,
|
|
||||||
IconChevronLeft,
|
|
||||||
IconEyeCheck,
|
|
||||||
IconEyeShare,
|
|
||||||
IconShare,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
|
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
import { useState } from "react";
|
|
||||||
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
|
||||||
import ComponentAdminDonasi_TombolKembali from "../../donasi/component/tombol_kembali";
|
|
||||||
import {
|
import {
|
||||||
MODEL_EVENT,
|
MODEL_EVENT,
|
||||||
MODEL_EVENT_PESERTA,
|
MODEL_EVENT_PESERTA,
|
||||||
} from "@/app_modules/event/model/interface";
|
} from "@/app_modules/event/model/interface";
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
|
||||||
import moment from "moment";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id";
|
import { useState } from "react";
|
||||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { adminEvent_getListPesertaById } from "../fun/get/get_list_peserta_by_id";
|
||||||
import { AdminEvent_getListTableByStatusId } from "../fun/get/get_list_table_by_status_id";
|
import { adminEvent_funGetListPublish } from "../fun";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
|
||||||
import { AdminEvent_getListPesertaById } from "../fun/get/get_list_peserta_by_id";
|
|
||||||
|
|
||||||
export default function AdminEvent_TablePublish({
|
export default function AdminEvent_TablePublish({
|
||||||
listPublish,
|
listPublish,
|
||||||
}: {
|
}: {
|
||||||
listPublish: MODEL_EVENT[];
|
listPublish: any;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ComponentAdminGlobal_HeaderTamplate name="Event: Table Publish" />
|
<ComponentAdminGlobal_HeaderTamplate name="Event" />
|
||||||
<TableStatus listPublish={listPublish} />
|
<TableStatus listPublish={listPublish} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function TableStatus({ listPublish }: { listPublish: MODEL_EVENT[] }) {
|
function TableStatus({ listPublish }: { listPublish: any }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [opened, { open, close }] = useDisclosure(false);
|
const [opened, { open, close }] = useDisclosure(false);
|
||||||
const [data, setData] = useState(listPublish);
|
const [data, setData] = useState<MODEL_EVENT[]>(listPublish.data);
|
||||||
|
const [isNPage, setNPage] = useState(listPublish.nPage);
|
||||||
|
const [isActivePage, setActivePage] = useState(1);
|
||||||
|
const [isSearch, setSearch] = useState("");
|
||||||
|
|
||||||
const [peserta, setPeserta] = useState<MODEL_EVENT_PESERTA[]>();
|
const [peserta, setPeserta] = useState<MODEL_EVENT_PESERTA[]>();
|
||||||
const [eventId, setEventId] = useState("");
|
const [eventId, setEventId] = useState("");
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
async function onSearch(s: string) {
|
||||||
|
setSearch(s);
|
||||||
|
const loadData = await adminEvent_funGetListPublish({
|
||||||
|
page: 1,
|
||||||
|
search: s,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onPageClick(p: any) {
|
||||||
|
setActivePage(p);
|
||||||
|
const loadData = await adminEvent_funGetListPublish({
|
||||||
|
search: isSearch,
|
||||||
|
page: p,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
const TableRows = data.map((e, i) => (
|
const TableRows = data.map((e, i) => (
|
||||||
<tr key={i}>
|
<tr key={i}>
|
||||||
<td>{e?.Author?.Profile?.name}</td>
|
|
||||||
<td>{e?.title}</td>
|
|
||||||
<td>{e?.lokasi}</td>
|
|
||||||
<td>{e?.EventMaster_TipeAcara?.name}</td>
|
|
||||||
<td>{e?.tanggal.toLocaleString("id-ID", { dateStyle: "full" })}</td>
|
|
||||||
<td>
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text>{e?.Author?.username}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text lineClamp={2}>{e.title}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text>{e.lokasi}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text>{e.EventMaster_TipeAcara.name}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
{e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })}
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
{e.tanggal.toLocaleTimeString([], {
|
{e.tanggal.toLocaleTimeString([], {
|
||||||
timeStyle: "short",
|
timeStyle: "short",
|
||||||
hourCycle: "h24",
|
hourCycle: "h24",
|
||||||
})}
|
})}
|
||||||
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<Center w={400}>
|
||||||
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
||||||
{e.deskripsi}
|
{e.deskripsi}
|
||||||
</Spoiler>
|
</Spoiler>
|
||||||
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<Button
|
<Button
|
||||||
loading={e.id === eventId ? (loading === true ? true : false) : false}
|
loading={e.id === eventId ? (loading === true ? true : false) : false}
|
||||||
color={"green"}
|
color={"green"}
|
||||||
leftIcon={<IconEyeShare />}
|
leftIcon={<IconCircleCheck />}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
setEventId(e.id);
|
router.push(RouterAdminEvent.detail_peserta + e.id);
|
||||||
setLoading(true);
|
// setEventId(e.id);
|
||||||
await new Promise((v) => setTimeout(v, 500));
|
// setLoading(true);
|
||||||
await AdminEvent_getListPesertaById(e.id).then((res: any) => {
|
// await new Promise((v) => setTimeout(v, 500));
|
||||||
setPeserta(res);
|
// await adminEvent_getListPesertaById(e.id).then((res: any) => {
|
||||||
setLoading(false);
|
// setPeserta(res);
|
||||||
});
|
// setLoading(false);
|
||||||
open();
|
// });
|
||||||
|
// open();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Lihat Peserta
|
Lihat Peserta
|
||||||
@@ -114,6 +150,78 @@ function TableStatus({ listPublish }: { listPublish: MODEL_EVENT[] }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Stack spacing={"xs"} h={"100%"}>
|
||||||
|
<Group
|
||||||
|
position="apart"
|
||||||
|
bg={"green.4"}
|
||||||
|
p={"xs"}
|
||||||
|
style={{ borderRadius: "6px" }}
|
||||||
|
>
|
||||||
|
<Title order={4}>Publish</Title>
|
||||||
|
<TextInput
|
||||||
|
icon={<IconSearch size={20} />}
|
||||||
|
radius={"xl"}
|
||||||
|
placeholder="Masukan judul"
|
||||||
|
onChange={(val) => {
|
||||||
|
onSearch(val.currentTarget.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
|
||||||
|
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||||
|
<ScrollArea w={"100%"} h={"90%"}>
|
||||||
|
<Table
|
||||||
|
verticalSpacing={"md"}
|
||||||
|
horizontalSpacing={"md"}
|
||||||
|
p={"md"}
|
||||||
|
w={1500}
|
||||||
|
striped
|
||||||
|
highlightOnHover
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<Center>Username</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Judul</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Lokasi</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Tipe Acara</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Tanggal</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Jam</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Deskripsi</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Aksi</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{TableRows}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
|
||||||
|
<Center mt={"xl"}>
|
||||||
|
<Pagination
|
||||||
|
value={isActivePage}
|
||||||
|
total={isNPage}
|
||||||
|
onChange={(val) => {
|
||||||
|
onPageClick(val);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Paper>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
<Modal opened={opened} onClose={close}>
|
<Modal opened={opened} onClose={close}>
|
||||||
<Paper>
|
<Paper>
|
||||||
<Stack>
|
<Stack>
|
||||||
@@ -153,49 +261,6 @@ function TableStatus({ listPublish }: { listPublish: MODEL_EVENT[] }) {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
</Modal>
|
</Modal>
|
||||||
<Box>
|
|
||||||
<Box bg={"green.1"} p={"xs"}>
|
|
||||||
<Title order={6} c={"green"}>
|
|
||||||
PUBLISH
|
|
||||||
</Title>
|
|
||||||
</Box>
|
|
||||||
<Table
|
|
||||||
withBorder
|
|
||||||
verticalSpacing={"md"}
|
|
||||||
horizontalSpacing={"xl"}
|
|
||||||
p={"md"}
|
|
||||||
striped
|
|
||||||
highlightOnHover
|
|
||||||
>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Author</th>
|
|
||||||
<th>Judul</th>
|
|
||||||
<th>Lokasi</th>
|
|
||||||
<th>Tipe Acara</th>
|
|
||||||
<th>Tanggal</th>
|
|
||||||
<th>Jam</th>
|
|
||||||
<th>
|
|
||||||
<Center>Deskripsi</Center>
|
|
||||||
</th>
|
|
||||||
|
|
||||||
<th>
|
|
||||||
<Center>Aksi</Center>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>{TableRows}</tbody>
|
|
||||||
</Table>
|
|
||||||
<Center>
|
|
||||||
{_.isEmpty(TableRows) ? (
|
|
||||||
<Center h={"50vh"}>
|
|
||||||
<Title order={6}>Tidak Ada Data</Title>
|
|
||||||
</Center>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Center>
|
|
||||||
</Box>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,112 +1,138 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
|
||||||
Box,
|
|
||||||
Button,
|
Button,
|
||||||
Center,
|
Center,
|
||||||
Flex,
|
|
||||||
Group,
|
Group,
|
||||||
Modal,
|
Modal,
|
||||||
|
Pagination,
|
||||||
|
Paper,
|
||||||
ScrollArea,
|
ScrollArea,
|
||||||
Spoiler,
|
Spoiler,
|
||||||
Stack,
|
Stack,
|
||||||
Table,
|
Table,
|
||||||
Text,
|
|
||||||
Textarea,
|
Textarea,
|
||||||
|
TextInput,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
import { IconPencilPlus, IconSearch } from "@tabler/icons-react";
|
||||||
IconBan,
|
|
||||||
IconChevronLeft,
|
|
||||||
IconEyeCheck,
|
|
||||||
IconEyeShare,
|
|
||||||
IconPencilPlus,
|
|
||||||
IconShare,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
|
|
||||||
import { useState } from "react";
|
|
||||||
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
|
||||||
import ComponentAdminDonasi_TombolKembali from "../../donasi/component/tombol_kembali";
|
|
||||||
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
|
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
|
||||||
import moment from "moment";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id";
|
|
||||||
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { AdminEvent_getListTableByStatusId } from "../fun/get/get_list_table_by_status_id";
|
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
|
||||||
|
import { useState } from "react";
|
||||||
|
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||||
|
import { adminEvent_funGetListReject } from "../fun";
|
||||||
import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id";
|
import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
|
||||||
|
|
||||||
export default function AdminEvent_TableReject({
|
export default function AdminEvent_TableReject({
|
||||||
listReject,
|
listReject,
|
||||||
}: {
|
}: {
|
||||||
listReject: MODEL_EVENT[];
|
listReject: any;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ComponentAdminGlobal_HeaderTamplate name="Event: Table Reject" />
|
<ComponentAdminGlobal_HeaderTamplate name="Event" />
|
||||||
<TableStatus listReject={listReject} />
|
<TableStatus listReject={listReject} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function TableStatus({ listReject }: { listReject: MODEL_EVENT[] }) {
|
function TableStatus({ listReject }: { listReject: any }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const [data, setData] = useState<MODEL_EVENT[]>(listReject.data);
|
||||||
|
const [isNPage, setNPage] = useState(listReject.nPage);
|
||||||
|
const [isActivePage, setActivePage] = useState(1);
|
||||||
|
const [isSearch, setSearch] = useState("");
|
||||||
|
|
||||||
const [opened, { open, close }] = useDisclosure(false);
|
const [opened, { open, close }] = useDisclosure(false);
|
||||||
const [data, setData] = useState(listReject);
|
|
||||||
const [eventId, setEventId] = useState("");
|
const [eventId, setEventId] = useState("");
|
||||||
const [catatan, setCatatan] = useState("");
|
const [catatan, setCatatan] = useState("");
|
||||||
|
|
||||||
|
async function onSearch(s: string) {
|
||||||
|
setSearch(s);
|
||||||
|
const loadData = await adminEvent_funGetListReject({
|
||||||
|
page: 1,
|
||||||
|
search: s,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onPageClick(p: any) {
|
||||||
|
setActivePage(p);
|
||||||
|
const loadData = await adminEvent_funGetListReject({
|
||||||
|
search: isSearch,
|
||||||
|
page: p,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onUpdate(eventId: string, catatan: string) {
|
||||||
|
const body = {
|
||||||
|
id: eventId,
|
||||||
|
catatan: catatan,
|
||||||
|
};
|
||||||
|
const res = await AdminEvent_funEditCatatanById(body as any, "4");
|
||||||
|
if (res.status === 200) {
|
||||||
|
const loadData = await adminEvent_funGetListReject({
|
||||||
|
search: isSearch,
|
||||||
|
page: isActivePage,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
close();
|
||||||
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const TableRows = data.map((e, i) => (
|
const TableRows = data.map((e, i) => (
|
||||||
<tr key={i}>
|
<tr key={i}>
|
||||||
<td>
|
<td>
|
||||||
<Box w={200}>{e?.Author?.Profile?.name}</Box>
|
<Center w={200}>{e?.Author?.username}</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Box w={200}>{e.title}</Box>
|
<Center w={200}>{e.title}</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Box w={200}>{e.lokasi}</Box>
|
<Center w={200}>{e.lokasi}</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Box w={200}>{e.EventMaster_TipeAcara.name}</Box>
|
<Center w={200}>{e.EventMaster_TipeAcara.name}</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Box w={200}>
|
<Center w={200}>
|
||||||
{e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })}
|
{e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })}
|
||||||
</Box>
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Box w={100}>
|
<Center w={100}>
|
||||||
{e.tanggal.toLocaleTimeString([], {
|
{e.tanggal.toLocaleTimeString([], {
|
||||||
timeStyle: "short",
|
timeStyle: "short",
|
||||||
hourCycle: "h24",
|
hourCycle: "h24",
|
||||||
})}
|
})}
|
||||||
</Box>
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Box w={500}>
|
<Center w={500}>
|
||||||
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
||||||
{e.deskripsi}
|
{e.deskripsi}
|
||||||
</Spoiler>
|
</Spoiler>
|
||||||
</Box>
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{" "}
|
{" "}
|
||||||
<Box w={400}>
|
<Center w={400}>
|
||||||
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
||||||
{e.catatan}
|
{e.catatan}
|
||||||
</Spoiler>
|
</Spoiler>
|
||||||
</Box>
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
@@ -128,12 +154,87 @@ function TableStatus({ listReject }: { listReject: MODEL_EVENT[] }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<Stack spacing={"xs"} h={"100%"}>
|
||||||
|
<Group
|
||||||
|
position="apart"
|
||||||
|
bg={"red.4"}
|
||||||
|
p={"xs"}
|
||||||
|
style={{ borderRadius: "6px" }}
|
||||||
|
>
|
||||||
|
<Title order={4}>Reject</Title>
|
||||||
|
<TextInput
|
||||||
|
icon={<IconSearch size={20} />}
|
||||||
|
radius={"xl"}
|
||||||
|
placeholder="Masukan judul"
|
||||||
|
onChange={(val) => {
|
||||||
|
onSearch(val.currentTarget.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
|
||||||
|
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||||
|
<ScrollArea w={"100%"} h={"90%"}>
|
||||||
|
<Table
|
||||||
|
verticalSpacing={"md"}
|
||||||
|
horizontalSpacing={"md"}
|
||||||
|
p={"md"}
|
||||||
|
w={1500}
|
||||||
|
striped
|
||||||
|
highlightOnHover
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<Center>Username</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Judul</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Lokasi</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Tipe Acara</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Tanggal</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Jam</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Cacatan</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Deskripsi</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Aksi</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{TableRows}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
|
||||||
|
<Center mt={"xl"}>
|
||||||
|
<Pagination
|
||||||
|
value={isActivePage}
|
||||||
|
total={isNPage}
|
||||||
|
onChange={(val) => {
|
||||||
|
onPageClick(val);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Paper>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
opened={opened}
|
opened={opened}
|
||||||
onClose={close}
|
onClose={close}
|
||||||
centered
|
centered
|
||||||
withCloseButton={false}
|
withCloseButton={false}
|
||||||
size={"lg"}
|
size={"md"}
|
||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Textarea
|
<Textarea
|
||||||
@@ -152,7 +253,7 @@ function TableStatus({ listReject }: { listReject: MODEL_EVENT[] }) {
|
|||||||
<Button
|
<Button
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onUpdate(eventId, catatan, close as any, setData);
|
onUpdate(eventId, catatan);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Simpan
|
Simpan
|
||||||
@@ -160,79 +261,6 @@ function TableStatus({ listReject }: { listReject: MODEL_EVENT[] }) {
|
|||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Box>
|
|
||||||
<Box bg={"red.1"} p={"xs"}>
|
|
||||||
<Title order={6} c={"red"}>
|
|
||||||
REJECT
|
|
||||||
</Title>
|
|
||||||
</Box>
|
|
||||||
<ScrollArea w={"100%"}>
|
|
||||||
<Table
|
|
||||||
w={2000}
|
|
||||||
withBorder
|
|
||||||
verticalSpacing={"md"}
|
|
||||||
horizontalSpacing={"xl"}
|
|
||||||
p={"md"}
|
|
||||||
striped
|
|
||||||
highlightOnHover
|
|
||||||
>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Author</th>
|
|
||||||
<th>Judul</th>
|
|
||||||
<th>Lokasi</th>
|
|
||||||
<th>Tipe Acara</th>
|
|
||||||
<th>Tanggal</th>
|
|
||||||
<th>Jam</th>
|
|
||||||
<th>
|
|
||||||
<Center>Deskripsi</Center>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<Center>Catatan</Center>
|
|
||||||
</th>
|
|
||||||
|
|
||||||
<th>
|
|
||||||
<Center>Aksi</Center>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>{TableRows}</tbody>
|
|
||||||
</Table>
|
|
||||||
</ScrollArea>
|
|
||||||
<Center>
|
|
||||||
{_.isEmpty(TableRows) ? (
|
|
||||||
<Center h={"50vh"}>
|
|
||||||
<Title order={6}>Tidak Ada Data</Title>
|
|
||||||
</Center>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Center>
|
|
||||||
</Box>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onUpdate(
|
|
||||||
eventId: string,
|
|
||||||
catatan: string,
|
|
||||||
close: any,
|
|
||||||
setData: any
|
|
||||||
) {
|
|
||||||
const body = {
|
|
||||||
id: eventId,
|
|
||||||
catatan: catatan,
|
|
||||||
};
|
|
||||||
await AdminEvent_funEditCatatanById(body as any, "4").then(async (res) => {
|
|
||||||
if (res.status === 200) {
|
|
||||||
await AdminEvent_getListTableByStatusId("4").then((val) => {
|
|
||||||
setData(val);
|
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
|
||||||
close();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,185 +1,88 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import {
|
|
||||||
Box,
|
|
||||||
Button,
|
|
||||||
Center,
|
|
||||||
Group,
|
|
||||||
Modal,
|
|
||||||
Spoiler,
|
|
||||||
Stack,
|
|
||||||
Table,
|
|
||||||
Textarea,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { IconBan, IconEyeShare } from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
|
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
|
||||||
|
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
|
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
|
||||||
import mqtt_client from "@/util/mqtt_client";
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
import _ from "lodash";
|
import {
|
||||||
|
Button,
|
||||||
|
Center,
|
||||||
|
Group,
|
||||||
|
Modal,
|
||||||
|
Pagination,
|
||||||
|
Paper,
|
||||||
|
ScrollArea,
|
||||||
|
Spoiler,
|
||||||
|
Stack,
|
||||||
|
Table,
|
||||||
|
Text,
|
||||||
|
Textarea,
|
||||||
|
TextInput,
|
||||||
|
Title,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
|
import { IconBan, IconCircleCheck, IconSearch } from "@tabler/icons-react";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiBerhasil } from "../../_admin_global/admin_notifikasi/notifikasi_berhasil";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiGagal } from "../../_admin_global/admin_notifikasi/notifikasi_gagal";
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||||
import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
|
import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
|
||||||
|
import { adminEvent_funGetListReview } from "../fun";
|
||||||
import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id";
|
import { AdminEvent_funEditStatusPublishById } from "../fun/edit/fun_edit_status_publish_by_id";
|
||||||
import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id";
|
import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id";
|
||||||
import { AdminEvent_getListTableByStatusId } from "../fun/get/get_list_table_by_status_id";
|
|
||||||
export default function AdminEvent_TableReview({
|
export default function AdminEvent_TableReview({
|
||||||
listReview,
|
listData,
|
||||||
}: {
|
}: {
|
||||||
listReview: MODEL_EVENT[];
|
listData: any;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<ComponentAdminGlobal_HeaderTamplate name="Event: Table Review" />
|
<ComponentAdminGlobal_HeaderTamplate name="Event" />
|
||||||
<TableStatus listReview={listReview} />
|
<TableStatus listData={listData} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function TableStatus({ listReview }: { listReview: MODEL_EVENT[] }) {
|
function TableStatus({ listData }: { listData: any }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const [data, setData] = useState<MODEL_EVENT[]>(listData.data);
|
||||||
|
const [isNPage, setNPage] = useState(listData.nPage);
|
||||||
|
const [isActivePage, setActivePage] = useState(1);
|
||||||
|
const [isSearch, setSearch] = useState("");
|
||||||
|
|
||||||
const [opened, { open, close }] = useDisclosure(false);
|
const [opened, { open, close }] = useDisclosure(false);
|
||||||
const [data, setData] = useState(listReview);
|
|
||||||
const [catatan, setCatatan] = useState("");
|
const [catatan, setCatatan] = useState("");
|
||||||
const [eventId, setEventId] = useState("");
|
const [eventId, setEventId] = useState("");
|
||||||
|
|
||||||
const TableRows = data.map((e, i) => (
|
// const dataEvent = {} as Prisma.UserUncheckedCreateInput;
|
||||||
<tr key={i}>
|
|
||||||
<td>{e?.Author?.Profile?.name}</td>
|
|
||||||
<td>{e.title}</td>
|
|
||||||
<td>{e.lokasi}</td>
|
|
||||||
<td>{e.EventMaster_TipeAcara.name}</td>
|
|
||||||
<td>{e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })}</td>
|
|
||||||
<td>
|
|
||||||
{e.tanggal.toLocaleTimeString([], {
|
|
||||||
timeStyle: "short",
|
|
||||||
hourCycle: "h24",
|
|
||||||
})}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
|
||||||
{e.deskripsi}
|
|
||||||
</Spoiler>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>
|
async function onSearch(s: string) {
|
||||||
<Stack>
|
setSearch(s);
|
||||||
<Button
|
const loadData = await adminEvent_funGetListReview({
|
||||||
color={"green"}
|
page: 1,
|
||||||
leftIcon={<IconEyeShare />}
|
search: s,
|
||||||
radius={"xl"}
|
});
|
||||||
onClick={() => onPublish(e.id, setData, e.tanggal)}
|
setData(loadData.data as any);
|
||||||
>
|
setNPage(loadData.nPage);
|
||||||
Publish
|
}
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
color={"red"}
|
|
||||||
leftIcon={<IconBan />}
|
|
||||||
radius={"xl"}
|
|
||||||
onClick={() => {
|
|
||||||
open();
|
|
||||||
setEventId(e.id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Reject
|
|
||||||
</Button>
|
|
||||||
</Stack>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
));
|
|
||||||
|
|
||||||
return (
|
async function onPageClick(p: any) {
|
||||||
<>
|
setActivePage(p);
|
||||||
<Modal
|
const loadData = await adminEvent_funGetListReview({
|
||||||
opened={opened}
|
search: isSearch,
|
||||||
onClose={close}
|
page: p,
|
||||||
centered
|
});
|
||||||
withCloseButton={false}
|
setData(loadData.data as any);
|
||||||
size={"lg"}
|
setNPage(loadData.nPage);
|
||||||
>
|
}
|
||||||
<Stack>
|
|
||||||
<Textarea
|
|
||||||
minRows={2}
|
|
||||||
maxRows={5}
|
|
||||||
maxLength={300}
|
|
||||||
autosize
|
|
||||||
label="Masukan Alasan Penolakan"
|
|
||||||
placeholder="Contoh: Karena deskripsi kurang lengkap, dll"
|
|
||||||
onChange={(val) => {
|
|
||||||
setCatatan(val.target.value);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Group position="right">
|
|
||||||
<Button
|
|
||||||
radius={"xl"}
|
|
||||||
onClick={() => {
|
|
||||||
onReject(eventId, catatan, setData, close);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Simpan
|
|
||||||
</Button>
|
|
||||||
</Group>
|
|
||||||
</Stack>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
<Box>
|
async function onPublish(eventId: string, tanggal: Date) {
|
||||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
|
||||||
<Box bg={"orange.1"} p={"xs"}>
|
|
||||||
<Title order={6} c={"orange"}>
|
|
||||||
REVIEW
|
|
||||||
</Title>
|
|
||||||
</Box>
|
|
||||||
<Table
|
|
||||||
withBorder
|
|
||||||
verticalSpacing={"md"}
|
|
||||||
horizontalSpacing={"xl"}
|
|
||||||
p={"md"}
|
|
||||||
striped
|
|
||||||
highlightOnHover
|
|
||||||
>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Author</th>
|
|
||||||
<th>Judul</th>
|
|
||||||
<th>Lokasi</th>
|
|
||||||
<th>Tipe Acara</th>
|
|
||||||
<th>Tanggal</th>
|
|
||||||
<th>Jam</th>
|
|
||||||
<th>
|
|
||||||
<Center>Deskripsi</Center>
|
|
||||||
</th>
|
|
||||||
|
|
||||||
<th>
|
|
||||||
<Center>Aksi</Center>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>{TableRows}</tbody>
|
|
||||||
</Table>
|
|
||||||
<Center>
|
|
||||||
{_.isEmpty(TableRows) ? (
|
|
||||||
<Center h={"50vh"}>
|
|
||||||
<Title order={6}>Tidak Ada Data</Title>
|
|
||||||
</Center>
|
|
||||||
) : (
|
|
||||||
""
|
|
||||||
)}
|
|
||||||
</Center>
|
|
||||||
</Box>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onPublish(eventId: string, setData: any, tanggal: Date) {
|
|
||||||
if (moment(tanggal).diff(Date.now(), "minutes") < 0)
|
if (moment(tanggal).diff(Date.now(), "minutes") < 0)
|
||||||
return ComponentGlobal_NotifikasiPeringatan(
|
return ComponentGlobal_NotifikasiPeringatan(
|
||||||
"Waktu acara telah lewat, Report untuk memberitahu user !"
|
"Waktu acara telah lewat, Report untuk memberitahu user !"
|
||||||
@@ -207,21 +110,19 @@ async function onPublish(eventId: string, setData: any, tanggal: Date) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await AdminEvent_getListTableByStatusId("2").then((res) => {
|
const loadData = await adminEvent_funGetListReview({
|
||||||
setData(res);
|
search: isSearch,
|
||||||
ComponentGlobal_NotifikasiBerhasil("Berhasil update status");
|
page: isActivePage,
|
||||||
});
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
ComponentAdminGlobal_NotifikasiBerhasil("Berhasil update status");
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
async function onReject(
|
async function onReject(eventId: string, catatan: string) {
|
||||||
eventId: string,
|
|
||||||
catatan: string,
|
|
||||||
setData: any,
|
|
||||||
close: any
|
|
||||||
) {
|
|
||||||
if (catatan === "")
|
if (catatan === "")
|
||||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Catatan");
|
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Catatan");
|
||||||
const body = {
|
const body = {
|
||||||
@@ -251,12 +152,199 @@ async function onReject(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await AdminEvent_getListTableByStatusId("2").then((val) => {
|
const loadData = await adminEvent_funGetListReview({
|
||||||
setData(val);
|
search: isSearch,
|
||||||
|
page: isActivePage,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
close();
|
close();
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const TableRows = data.map((e, i) => (
|
||||||
|
<tr key={i}>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text>{e?.Author?.username}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text lineClamp={2}>{e.title}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text>{e.lokasi}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
<Text>{e.EventMaster_TipeAcara.name}</Text>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
{e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })}
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={200}>
|
||||||
|
{e.tanggal.toLocaleTimeString([], {
|
||||||
|
timeStyle: "short",
|
||||||
|
hourCycle: "h24",
|
||||||
|
})}
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center w={400}>
|
||||||
|
<Spoiler hideLabel="sembunyikan" maxHeight={50} showLabel="tampilkan">
|
||||||
|
{e.deskripsi}
|
||||||
|
</Spoiler>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<Center>
|
||||||
|
<Stack>
|
||||||
|
<Button
|
||||||
|
color={"green"}
|
||||||
|
leftIcon={<IconCircleCheck />}
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => onPublish(e.id, e.tanggal)}
|
||||||
|
>
|
||||||
|
Publish
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
color={"red"}
|
||||||
|
leftIcon={<IconBan />}
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => {
|
||||||
|
open();
|
||||||
|
setEventId(e.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Reject
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack spacing={"xs"} h={"100%"}>
|
||||||
|
<Group
|
||||||
|
position="apart"
|
||||||
|
bg={"orange.4"}
|
||||||
|
p={"xs"}
|
||||||
|
style={{ borderRadius: "6px" }}
|
||||||
|
>
|
||||||
|
<Title order={4}>Review</Title>
|
||||||
|
<TextInput
|
||||||
|
icon={<IconSearch size={20} />}
|
||||||
|
radius={"xl"}
|
||||||
|
placeholder="Masukan judul"
|
||||||
|
onChange={(val) => {
|
||||||
|
onSearch(val.currentTarget.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
|
||||||
|
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||||
|
<ScrollArea w={"100%"} h={"90%"}>
|
||||||
|
<Table
|
||||||
|
verticalSpacing={"md"}
|
||||||
|
horizontalSpacing={"md"}
|
||||||
|
p={"md"}
|
||||||
|
w={1500}
|
||||||
|
striped
|
||||||
|
highlightOnHover
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<Center>Username</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Judul</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Lokasi</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Tipe Acara</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Tanggal</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Jam</Center>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Deskripsi</Center>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th>
|
||||||
|
<Center>Aksi</Center>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>{TableRows}</tbody>
|
||||||
|
</Table>
|
||||||
|
</ScrollArea>
|
||||||
|
|
||||||
|
<Center mt={"xl"}>
|
||||||
|
<Pagination
|
||||||
|
value={isActivePage}
|
||||||
|
total={isNPage}
|
||||||
|
onChange={(val) => {
|
||||||
|
onPageClick(val);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Center>
|
||||||
|
</Paper>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
<Modal
|
||||||
|
opened={opened}
|
||||||
|
onClose={close}
|
||||||
|
centered
|
||||||
|
withCloseButton={false}
|
||||||
|
size={"md"}
|
||||||
|
>
|
||||||
|
<Stack>
|
||||||
|
<Textarea
|
||||||
|
minRows={2}
|
||||||
|
maxRows={5}
|
||||||
|
maxLength={300}
|
||||||
|
autosize
|
||||||
|
label="Masukan Alasan Penolakan"
|
||||||
|
placeholder="Contoh: Karena deskripsi kurang lengkap, dll"
|
||||||
|
onChange={(val) => {
|
||||||
|
setCatatan(val.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Group position="right">
|
||||||
|
<Button radius={"xl"} onClick={close}>
|
||||||
|
Batal
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => {
|
||||||
|
onReject(eventId, catatan);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Simpan
|
||||||
|
</Button>
|
||||||
|
</Group>
|
||||||
|
</Stack>
|
||||||
|
</Modal>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import { Group, Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core";
|
import { Group, Paper, SimpleGrid, Stack, Text, Title } from "@mantine/core";
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||||
import ComponentAdminGlobal_LoadingPage from "../../_admin_global/loading_admin_page";
|
|
||||||
|
|
||||||
export default function AdminForum_Main({
|
export default function AdminForum_Main({
|
||||||
countPublish,
|
countPublish,
|
||||||
@@ -23,7 +22,6 @@ export default function AdminForum_Main({
|
|||||||
countLaporanKomentar={countLaporanKomentar}
|
countLaporanKomentar={countLaporanKomentar}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
{/* <ComponentAdminGlobal_LoadingPage /> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { Button } from "@mantine/core";
|
||||||
|
import { adminInvestasi_funAcceptTransaksiById, adminInvestasi_funGetAllTransaksiById } from "../../fun";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
export function AdminInvestasi_ComponentButtonBandingTransaksi({
|
||||||
|
invoiceId,
|
||||||
|
investasiId,
|
||||||
|
onLoadData,
|
||||||
|
}: {
|
||||||
|
invoiceId: string;
|
||||||
|
investasiId: string
|
||||||
|
onLoadData: (val: any) => void;
|
||||||
|
}) {
|
||||||
|
const [isLoading, setLoading] = useState(false)
|
||||||
|
async function onAccept() {
|
||||||
|
const res = await adminInvestasi_funAcceptTransaksiById({ invoiceId });
|
||||||
|
|
||||||
|
if (res.status == 200) {
|
||||||
|
try {
|
||||||
|
const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
|
||||||
|
investasiId,
|
||||||
|
page: 1,
|
||||||
|
});
|
||||||
|
onLoadData(dataTransaksi);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
setLoading(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Button
|
||||||
|
radius={"xl"}
|
||||||
|
color="orange"
|
||||||
|
onClick={() => {
|
||||||
|
onAccept();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Banding Diterima
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
|
import { Button } from "@mantine/core";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
export function AdminInvestasi_ComponentCekBuktiTransfer({
|
||||||
|
imagesId,
|
||||||
|
}: {
|
||||||
|
imagesId: string;
|
||||||
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
|
const [isLoading, setLoading] = useState(false)
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Button
|
||||||
|
loaderPosition="center"
|
||||||
|
loading={isLoading}
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => {
|
||||||
|
setLoading(true);
|
||||||
|
router.push(RouterAdminInvestasi.bukti_transfer + `${imagesId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Cek
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
import { Button, Stack } from "@mantine/core";
|
||||||
|
import {
|
||||||
|
adminInvestasi_funAcceptTransaksiById,
|
||||||
|
adminInvestasi_funGetAllTransaksiById,
|
||||||
|
adminInvestasi_funRejectInvoiceById,
|
||||||
|
} from "../../fun";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { IconCircleCheck } from "@tabler/icons-react";
|
||||||
|
import { IconBan } from "@tabler/icons-react";
|
||||||
|
|
||||||
|
export function AdminInvestasi_ComponentButtonKonfirmasiTransaksi({
|
||||||
|
invoiceId,
|
||||||
|
investasiId,
|
||||||
|
onLoadData,
|
||||||
|
}: {
|
||||||
|
invoiceId: string;
|
||||||
|
investasiId: string;
|
||||||
|
onLoadData: (val: any) => void;
|
||||||
|
}) {
|
||||||
|
const [isLoadingAccpet, setLoadingAccept] = useState(false);
|
||||||
|
const [isLoadingReject, setLoadingReject] = useState(false);
|
||||||
|
|
||||||
|
async function onReject() {
|
||||||
|
const res = await adminInvestasi_funRejectInvoiceById({ invoiceId });
|
||||||
|
if (res.status == 200) {
|
||||||
|
try {
|
||||||
|
const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
|
||||||
|
investasiId,
|
||||||
|
page: 1,
|
||||||
|
});
|
||||||
|
onLoadData(dataTransaksi);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
setLoadingReject(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onAccept() {
|
||||||
|
const res = await adminInvestasi_funAcceptTransaksiById({ invoiceId });
|
||||||
|
|
||||||
|
if (res.status == 200) {
|
||||||
|
try {
|
||||||
|
const dataTransaksi = await adminInvestasi_funGetAllTransaksiById({
|
||||||
|
investasiId,
|
||||||
|
page: 1,
|
||||||
|
});
|
||||||
|
onLoadData(dataTransaksi);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
setLoadingAccept(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack>
|
||||||
|
<Button
|
||||||
|
loaderPosition="center"
|
||||||
|
loading={isLoadingAccpet}
|
||||||
|
leftIcon={<IconCircleCheck />}
|
||||||
|
radius={"xl"}
|
||||||
|
color="green"
|
||||||
|
onClick={() => {
|
||||||
|
onAccept();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Terima
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
loaderPosition="center"
|
||||||
|
loading={isLoadingReject}
|
||||||
|
leftIcon={<IconBan />}
|
||||||
|
radius={"xl"}
|
||||||
|
color="red"
|
||||||
|
onClick={() => onReject()}
|
||||||
|
>
|
||||||
|
Tolak
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
7
src/app_modules/admin/investasi/_component/index.ts
Normal file
7
src/app_modules/admin/investasi/_component/index.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { AdminInvestasi_ComponentButtonBandingTransaksi } from "./button/button_banding_transaksi";
|
||||||
|
import { AdminInvestasi_ComponentCekBuktiTransfer } from "./button/button_cek_bukti_transaksi";
|
||||||
|
import { AdminInvestasi_ComponentButtonKonfirmasiTransaksi } from "./button/button_konfirmasi_transaksi";
|
||||||
|
|
||||||
|
export { AdminInvestasi_ComponentButtonKonfirmasiTransaksi };
|
||||||
|
export { AdminInvestasi_ComponentButtonBandingTransaksi };
|
||||||
|
export { AdminInvestasi_ComponentCekBuktiTransfer };
|
||||||
5
src/app_modules/admin/investasi/_lib/global_state.ts
Normal file
5
src/app_modules/admin/investasi/_lib/global_state.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { atomWithStorage } from "jotai/utils";
|
||||||
|
|
||||||
|
const gs_admin_invetasi_menu_publish = atomWithStorage("gs_admin_invetasi_menu_publish", "1")
|
||||||
|
|
||||||
|
export { gs_admin_invetasi_menu_publish }
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
|
import { Center, Image, Paper, Text } from "@mantine/core";
|
||||||
|
|
||||||
|
export function AdminInvestasi_ViewBuktiTransfer({
|
||||||
|
imageId,
|
||||||
|
}: {
|
||||||
|
imageId: string;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Center>
|
||||||
|
<Paper withBorder p={"md"}>
|
||||||
|
<Image
|
||||||
|
width={300}
|
||||||
|
alt="Foto"
|
||||||
|
src={RouterAdminInvestasi.api_bukti_transfer + imageId}
|
||||||
|
/>
|
||||||
|
</Paper>
|
||||||
|
</Center>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,38 +1,84 @@
|
|||||||
import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
import { ComponentAdminGlobal_TampilanRupiah } from "@/app_modules/admin/_admin_global";
|
||||||
import { MODEL_DONASI_INVOICE } from "@/app_modules/donasi/model/interface";
|
import {
|
||||||
|
MODEL_INVOICE_INVESTASI,
|
||||||
|
MODEL_STATUS_INVOICE_INVESTASI,
|
||||||
|
} from "@/app_modules/investasi/_lib/interface";
|
||||||
import {
|
import {
|
||||||
Stack,
|
|
||||||
Group,
|
|
||||||
Title,
|
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Select,
|
|
||||||
Paper,
|
|
||||||
ScrollArea,
|
|
||||||
Table,
|
|
||||||
Center,
|
|
||||||
Pagination,
|
|
||||||
Badge,
|
Badge,
|
||||||
Button,
|
Button,
|
||||||
|
Center,
|
||||||
|
Group,
|
||||||
|
Pagination,
|
||||||
|
Paper,
|
||||||
|
ScrollArea,
|
||||||
|
Select,
|
||||||
|
Stack,
|
||||||
|
Table,
|
||||||
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconReload } from "@tabler/icons-react";
|
import { IconReload } from "@tabler/icons-react";
|
||||||
|
import { isEmpty } from "lodash";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import {
|
||||||
|
AdminInvestasi_ComponentButtonBandingTransaksi,
|
||||||
|
AdminInvestasi_ComponentButtonKonfirmasiTransaksi,
|
||||||
|
AdminInvestasi_ComponentCekBuktiTransfer,
|
||||||
|
} from "../../_component";
|
||||||
|
import { adminInvestasi_funGetAllTransaksiById } from "../../fun";
|
||||||
|
|
||||||
export function AdminInvestasi_ViewDaftarTransaksi({
|
export function AdminInvestasi_ViewDaftarTransaksi({
|
||||||
dataTransaksi,
|
dataTransaksi,
|
||||||
|
statusTransaksi,
|
||||||
|
investasiId,
|
||||||
}: {
|
}: {
|
||||||
dataTransaksi: any;
|
dataTransaksi: any;
|
||||||
|
statusTransaksi: MODEL_STATUS_INVOICE_INVESTASI[];
|
||||||
|
investasiId: string;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [isLoading, setLoading] = useState(false);
|
const [isLoading, setLoading] = useState(false);
|
||||||
const [idData, setIdData] = useState("");
|
const [idData, setIdData] = useState("");
|
||||||
const [data, setData] = useState<MODEL_DONASI_INVOICE[]>(
|
const [listStatsus, setListStatus] = useState(statusTransaksi);
|
||||||
|
|
||||||
|
const [data, setData] = useState<MODEL_INVOICE_INVESTASI[]>(
|
||||||
dataTransaksi.data
|
dataTransaksi.data
|
||||||
);
|
);
|
||||||
const [isNPage, setNPage] = useState(dataTransaksi.nPage);
|
const [isNPage, setNPage] = useState(dataTransaksi.nPage);
|
||||||
const [isActivePage, setActivePage] = useState(1);
|
const [isActivePage, setActivePage] = useState(1);
|
||||||
const [isSelect, setSelect] = useState("");
|
const [selectedStatus, setSelectedStatus] = useState("");
|
||||||
|
|
||||||
|
async function onPageClick(p: any) {
|
||||||
|
setActivePage(p);
|
||||||
|
const loadData = await adminInvestasi_funGetAllTransaksiById({
|
||||||
|
investasiId: investasiId,
|
||||||
|
page: p,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onSelected(selectStatus: any) {
|
||||||
|
setSelectedStatus(selectStatus);
|
||||||
|
const loadData = await adminInvestasi_funGetAllTransaksiById({
|
||||||
|
investasiId: investasiId,
|
||||||
|
page: isActivePage,
|
||||||
|
selectStatus: selectStatus,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function onReload() {
|
||||||
|
const loadData = await adminInvestasi_funGetAllTransaksiById({
|
||||||
|
investasiId: investasiId,
|
||||||
|
page: 1,
|
||||||
|
});
|
||||||
|
setData(loadData.data as any);
|
||||||
|
setNPage(loadData.nPage);
|
||||||
|
}
|
||||||
|
|
||||||
const tableRows = data?.map((e, i) => (
|
const tableRows = data?.map((e, i) => (
|
||||||
<tr key={i}>
|
<tr key={i}>
|
||||||
@@ -40,11 +86,18 @@ export function AdminInvestasi_ViewDaftarTransaksi({
|
|||||||
<Center>{e?.Author.username}</Center>
|
<Center>{e?.Author.username}</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Center>{e?.DonasiMaster_Bank?.name}</Center>
|
<Center>{e?.MasterBank.namaBank}</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Center>
|
<Center>
|
||||||
<TampilanRupiahDonasi nominal={+e?.nominal} />
|
<ComponentAdminGlobal_TampilanRupiah nominal={+e?.nominal} />
|
||||||
|
</Center>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Center>
|
||||||
|
{new Intl.NumberFormat("id-ID", { maximumFractionDigits: 10 }).format(
|
||||||
|
+e?.lembarTerbeli
|
||||||
|
)}
|
||||||
</Center>
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -56,63 +109,62 @@ export function AdminInvestasi_ViewDaftarTransaksi({
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Center>
|
<Center>
|
||||||
<Badge w={150} variant="dot">
|
<Badge
|
||||||
{e?.DonasiMaster_StatusInvoice?.name}
|
w={150}
|
||||||
|
variant="light"
|
||||||
|
color={
|
||||||
|
e.statusInvoiceId === "1"
|
||||||
|
? "green"
|
||||||
|
: e.statusInvoiceId === "4"
|
||||||
|
? "red"
|
||||||
|
: "blue"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{e?.StatusInvoice?.name}
|
||||||
</Badge>
|
</Badge>
|
||||||
</Center>
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Center>
|
<Center>
|
||||||
{e?.donasiMaster_StatusInvoiceId === "1" ||
|
{e?.statusInvoiceId !== "3" ? (
|
||||||
e?.donasiMaster_StatusInvoiceId === "2" ? (
|
<AdminInvestasi_ComponentCekBuktiTransfer imagesId={e?.imagesId} />
|
||||||
<Button
|
|
||||||
radius={"xl"}
|
|
||||||
onClick={() =>
|
|
||||||
router.push(
|
|
||||||
RouterAdminDonasi.transfer_invoice + `${e?.imagesId}`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Cek
|
|
||||||
</Button>
|
|
||||||
) : (
|
) : (
|
||||||
"-"
|
"-"
|
||||||
)}
|
)}
|
||||||
</Center>
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
test
|
<Center>
|
||||||
{/* <Center>
|
{e.statusInvoiceId === "1" && "-"}
|
||||||
{e?.donasiMaster_StatusInvoiceId === "1" ? (
|
{e.statusInvoiceId === "2" && (
|
||||||
<Button radius={"xl"} disabled>
|
<AdminInvestasi_ComponentButtonKonfirmasiTransaksi
|
||||||
Selesai
|
invoiceId={e.id}
|
||||||
</Button>
|
investasiId={investasiId}
|
||||||
) : e?.DonasiMaster_StatusInvoice?.id === "2" ? (
|
onLoadData={(val) => {
|
||||||
<ButtonAccept
|
setData(val.data);
|
||||||
invoiceId={e?.id}
|
|
||||||
donasiId={dataDonasi?.id}
|
|
||||||
nominal={+e?.nominal}
|
|
||||||
danaTerkumpul={+dataDonasi?.terkumpul}
|
|
||||||
target={+dataDonasi?.target}
|
|
||||||
onSuccessDonasi={(val) => {
|
|
||||||
onSuccessDonasi(val);
|
|
||||||
}}
|
|
||||||
onSuccessDonatur={(val) => {
|
|
||||||
setListDonatur(val.data);
|
|
||||||
setNPage(val.nPage);
|
setNPage(val.nPage);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
|
||||||
<Text>-</Text>
|
|
||||||
)}
|
)}
|
||||||
</Center> */}
|
{e.statusInvoiceId === "3" && "-"}
|
||||||
|
{e.statusInvoiceId === "4" && (
|
||||||
|
<AdminInvestasi_ComponentButtonBandingTransaksi
|
||||||
|
invoiceId={e.id}
|
||||||
|
investasiId={investasiId}
|
||||||
|
onLoadData={(val) => {
|
||||||
|
setData(val.data);
|
||||||
|
setNPage(val.nPage);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Center>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
));
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"xs"} h={"100%"}>
|
<Stack spacing={"xs"} h={"100%"}>
|
||||||
{/* <pre>{JSON.stringify(dataDonasi, null, 2)}</pre> */}
|
|
||||||
<Group
|
<Group
|
||||||
position="apart"
|
position="apart"
|
||||||
bg={"gray.4"}
|
bg={"gray.4"}
|
||||||
@@ -126,22 +178,25 @@ export function AdminInvestasi_ViewDaftarTransaksi({
|
|||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
variant="light"
|
variant="light"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// onRelaod();
|
onReload();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IconReload />
|
<IconReload />
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
<Select
|
<Select
|
||||||
placeholder="Pilih status"
|
placeholder="Pilih status"
|
||||||
value={isSelect}
|
value={selectedStatus}
|
||||||
data={[]}
|
data={
|
||||||
// data={listMasterStatus.map((e) => ({
|
isEmpty(listStatsus)
|
||||||
// value: e.id,
|
? []
|
||||||
// label: e.name,
|
: listStatsus.map((e) => ({
|
||||||
// }))}
|
value: e.id,
|
||||||
// onChange={(val) => {
|
label: e.name,
|
||||||
// onSelect(val);
|
}))
|
||||||
// }}
|
}
|
||||||
|
onChange={(val: any) => {
|
||||||
|
onSelected(val);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -167,6 +222,9 @@ export function AdminInvestasi_ViewDaftarTransaksi({
|
|||||||
<th>
|
<th>
|
||||||
<Center>Jumlah Investasi</Center>
|
<Center>Jumlah Investasi</Center>
|
||||||
</th>
|
</th>
|
||||||
|
<th>
|
||||||
|
<Center>Lembar Terbeli</Center>
|
||||||
|
</th>
|
||||||
<th>
|
<th>
|
||||||
<Center>Tanggal</Center>
|
<Center>Tanggal</Center>
|
||||||
</th>
|
</th>
|
||||||
@@ -190,7 +248,7 @@ export function AdminInvestasi_ViewDaftarTransaksi({
|
|||||||
value={isActivePage}
|
value={isActivePage}
|
||||||
total={isNPage}
|
total={isNPage}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
// onPageClick(val);
|
onPageClick(val);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Center>
|
</Center>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { AdminInvestasi_ViewBuktiTransfer } from "./detail/view_bukti_transfer";
|
||||||
import { AdminInvestasi_ViewDaftarInvestor } from "./detail/view_daftar_investor";
|
import { AdminInvestasi_ViewDaftarInvestor } from "./detail/view_daftar_investor";
|
||||||
import { AdminInvestasi_ViewDaftarTransaksi } from "./detail/view_daftar_transaksi";
|
import { AdminInvestasi_ViewDaftarTransaksi } from "./detail/view_daftar_transaksi";
|
||||||
import { AdminInvestasi_ViewDetailData } from "./detail/view_detail_data";
|
import { AdminInvestasi_ViewDetailData } from "./detail/view_detail_data";
|
||||||
@@ -5,3 +6,4 @@ import { AdminInvestasi_ViewDetailData } from "./detail/view_detail_data";
|
|||||||
export { AdminInvestasi_ViewDetailData };
|
export { AdminInvestasi_ViewDetailData };
|
||||||
export { AdminInvestasi_ViewDaftarTransaksi };
|
export { AdminInvestasi_ViewDaftarTransaksi };
|
||||||
export { AdminInvestasi_ViewDaftarInvestor };
|
export { AdminInvestasi_ViewDaftarInvestor };
|
||||||
|
export { AdminInvestasi_ViewBuktiTransfer };
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { IconChevronRight } from "@tabler/icons-react";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
export default function Admin_BuktiTransferInvestasi() {
|
export default function Admin_BuktiTransferInvestasi() {
|
||||||
const router = useRouter()
|
const router = useRouter();
|
||||||
const listUsername = [
|
const listUsername = [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@@ -41,7 +41,13 @@ export default function Admin_BuktiTransferInvestasi() {
|
|||||||
<>
|
<>
|
||||||
{/* Box Username */}
|
{/* Box Username */}
|
||||||
{listUsername.map((e) => (
|
{listUsername.map((e) => (
|
||||||
<Paper key={e.id} bg={"gray"} p={"md"} mb={"xs"} onClick={() => router.push(RouterAdminInvestasi_OLD.status_transfer)}>
|
<Paper
|
||||||
|
key={e.id}
|
||||||
|
bg={"gray"}
|
||||||
|
p={"md"}
|
||||||
|
mb={"xs"}
|
||||||
|
onClick={() => router.push(RouterAdminInvestasi_OLD.status_transfer)}
|
||||||
|
>
|
||||||
<Grid align="center">
|
<Grid align="center">
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Text>Username</Text>
|
<Text>Username</Text>
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { Stack } from "@mantine/core";
|
||||||
|
import ComponentAdminGlobal_BackButton from "../../_admin_global/back_button";
|
||||||
|
import { AdminInvestasi_ViewBuktiTransfer } from "../_view";
|
||||||
|
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global";
|
||||||
|
|
||||||
|
export function AdminInvestasi_DetailBuktiTransfer({ imageId }: { imageId: string }) {
|
||||||
|
return (
|
||||||
|
<Stack>
|
||||||
|
<ComponentAdminGlobal_BackButton />
|
||||||
|
<ComponentAdminGlobal_TitlePage name="Bukti Transfer" />
|
||||||
|
<AdminInvestasi_ViewBuktiTransfer imageId={imageId} />
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -10,13 +10,21 @@ import {
|
|||||||
AdminInvestasi_ViewDaftarTransaksi,
|
AdminInvestasi_ViewDaftarTransaksi,
|
||||||
AdminInvestasi_ViewDetailData,
|
AdminInvestasi_ViewDetailData,
|
||||||
} from "../_view";
|
} from "../_view";
|
||||||
|
import { useAtom } from "jotai";
|
||||||
|
import { gs_admin_invetasi_menu_publish } from "../_lib/global_state";
|
||||||
|
|
||||||
export function AdminInvestasi_DetailPublish({
|
export function AdminInvestasi_DetailPublish({
|
||||||
data,
|
data,
|
||||||
|
dataTransaksi,
|
||||||
|
statusTransaksi,
|
||||||
|
investasiId,
|
||||||
}: {
|
}: {
|
||||||
data: MODEL_INVESTASI;
|
data: MODEL_INVESTASI;
|
||||||
|
dataTransaksi: any[];
|
||||||
|
statusTransaksi: any[];
|
||||||
|
investasiId: string;
|
||||||
}) {
|
}) {
|
||||||
const [selectPage, setSelectPage] = useState("1");
|
const [selectPage, setSelectPage] = useAtom(gs_admin_invetasi_menu_publish);
|
||||||
const listPage = [
|
const listPage = [
|
||||||
{
|
{
|
||||||
id: "1",
|
id: "1",
|
||||||
@@ -37,7 +45,7 @@ export function AdminInvestasi_DetailPublish({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack px={"lg"}>
|
<Stack >
|
||||||
<ComponentAdminGlobal_BackButton />
|
<ComponentAdminGlobal_BackButton />
|
||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
@@ -60,9 +68,13 @@ export function AdminInvestasi_DetailPublish({
|
|||||||
<AdminInvestasi_ViewDetailData data={data} />
|
<AdminInvestasi_ViewDetailData data={data} />
|
||||||
) : null}
|
) : null}
|
||||||
{selectPage == "2" ? (
|
{selectPage == "2" ? (
|
||||||
<AdminInvestasi_ViewDaftarTransaksi dataTransaksi={{}} />
|
<AdminInvestasi_ViewDaftarTransaksi
|
||||||
|
dataTransaksi={dataTransaksi}
|
||||||
|
statusTransaksi={statusTransaksi}
|
||||||
|
investasiId={investasiId}
|
||||||
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{selectPage == "3" ? <AdminInvestasi_ViewDaftarInvestor /> : null}
|
{/* {selectPage == "3" ? <AdminInvestasi_ViewDaftarInvestor /> : null} */}
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
3
src/app_modules/admin/investasi/detail/index.ts
Normal file
3
src/app_modules/admin/investasi/detail/index.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import { AdminInvestasi_DetailBuktiTransfer } from "./detail_bukti_transfer";
|
||||||
|
|
||||||
|
export { AdminInvestasi_DetailBuktiTransfer };
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
|
export async function adminInvestasi_funAcceptTransaksiById({
|
||||||
|
invoiceId,
|
||||||
|
}: {
|
||||||
|
invoiceId: string;
|
||||||
|
}) {
|
||||||
|
const updt = await prisma.investasi_Invoice.update({
|
||||||
|
where: {
|
||||||
|
id: invoiceId,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
statusInvoiceId: "1",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!updt) return { status: 400, message: "Gagal Update" };
|
||||||
|
revalidatePath(RouterAdminInvestasi.detail_publish);
|
||||||
|
return {
|
||||||
|
status: 200,
|
||||||
|
message: "Update Berhasil",
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { RouterAdminInvestasi } from "@/app/lib/router_admin/router_admin_investasi";
|
||||||
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
|
export async function adminInvestasi_funRejectInvoiceById({
|
||||||
|
invoiceId,
|
||||||
|
}: {
|
||||||
|
invoiceId: string;
|
||||||
|
}) {
|
||||||
|
const updt = await prisma.investasi_Invoice.update({
|
||||||
|
where: {
|
||||||
|
id: invoiceId,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
statusInvoiceId: "4",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!updt) return { status: 400, message: "Gagal Update" };
|
||||||
|
revalidatePath(RouterAdminInvestasi.detail_publish);
|
||||||
|
return {
|
||||||
|
status: 200,
|
||||||
|
message: "Update Berhasil",
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { ceil } from "lodash";
|
||||||
|
|
||||||
|
export async function adminInvestasi_funGetAllTransaksiById({
|
||||||
|
investasiId,
|
||||||
|
page,
|
||||||
|
selectStatus,
|
||||||
|
}: {
|
||||||
|
investasiId: string;
|
||||||
|
page: number;
|
||||||
|
selectStatus?: string;
|
||||||
|
}) {
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
const data = await prisma.investasi_Invoice.findMany({
|
||||||
|
take: takeData,
|
||||||
|
skip: skipData,
|
||||||
|
orderBy: [
|
||||||
|
{
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
where: {
|
||||||
|
investasiId: investasiId,
|
||||||
|
isActive: true,
|
||||||
|
statusInvoiceId: {
|
||||||
|
contains: selectStatus,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
Author: true,
|
||||||
|
Images: true,
|
||||||
|
StatusInvoice: true,
|
||||||
|
MasterBank: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const nCount = await prisma.investasi_Invoice.count({
|
||||||
|
where: {
|
||||||
|
investasiId: investasiId,
|
||||||
|
isActive: true,
|
||||||
|
statusInvoiceId: {
|
||||||
|
contains: selectStatus,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const allData = {
|
||||||
|
data: data,
|
||||||
|
nPage: ceil(nCount / takeData),
|
||||||
|
};
|
||||||
|
|
||||||
|
return allData;
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
export async function adminInvestasi_funGetOneTransaksiById({
|
||||||
|
invoiceId,
|
||||||
|
}: {
|
||||||
|
invoiceId: string;
|
||||||
|
}) {}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
|
||||||
|
export async function adminInvestasi_getStatusInvestasi() {
|
||||||
|
const data = await prisma.investasiMaster_StatusInvoice.findMany({
|
||||||
|
where: {
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
}
|
||||||
9
src/app_modules/admin/investasi/fun/index.ts
Normal file
9
src/app_modules/admin/investasi/fun/index.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { adminInvestasi_funAcceptTransaksiById } from "./edit/fun_accept_invoice_by_id";
|
||||||
|
import { adminInvestasi_funRejectInvoiceById } from "./edit/fun_reject_invoice_by_id";
|
||||||
|
import { adminInvestasi_funGetAllTransaksiById } from "./get/fun_get_all_transaksi_by_id";
|
||||||
|
import { adminInvestasi_getStatusInvestasi } from "./get/fun_get_status_transaksi";
|
||||||
|
|
||||||
|
export { adminInvestasi_getStatusInvestasi };
|
||||||
|
export { adminInvestasi_funGetAllTransaksiById };
|
||||||
|
export { adminInvestasi_funRejectInvoiceById };
|
||||||
|
export { adminInvestasi_funAcceptTransaksiById };
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
|
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
|
||||||
import { AdminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
import { adminEvent_getListPesertaById } from "@/app_modules/admin/event/fun/get/get_list_peserta_by_id";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import {
|
import {
|
||||||
MODEL_EVENT,
|
MODEL_EVENT,
|
||||||
|
|||||||
124
src/app_modules/admin/map/component/comp_detail_data_drawer.tsx
Normal file
124
src/app_modules/admin/map/component/comp_detail_data_drawer.tsx
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
import { RouterMap } from "@/app/lib/router_hipmi/router_map";
|
||||||
|
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
|
||||||
|
import {
|
||||||
|
Stack,
|
||||||
|
AspectRatio,
|
||||||
|
Box,
|
||||||
|
Grid,
|
||||||
|
Image,
|
||||||
|
Text,
|
||||||
|
Button,
|
||||||
|
Center,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
|
import {
|
||||||
|
IconBuildingSkyscraper,
|
||||||
|
IconListDetails,
|
||||||
|
IconPhoneCall,
|
||||||
|
IconMapPin,
|
||||||
|
IconPinned,
|
||||||
|
} from "@tabler/icons-react";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { adminMap_funGetOneById } from "../fun/fun_get_one_by_id";
|
||||||
|
|
||||||
|
export function ComponentAdminMap_DetailDataDrawer({
|
||||||
|
mapId,
|
||||||
|
}: {
|
||||||
|
mapId: string;
|
||||||
|
}) {
|
||||||
|
const [data, setData] = useState<MODEL_MAP>();
|
||||||
|
|
||||||
|
useShallowEffect(() => {
|
||||||
|
onLoadMap(mapId);
|
||||||
|
}, [mapId]);
|
||||||
|
|
||||||
|
async function onLoadMap(mapId: string) {
|
||||||
|
try {
|
||||||
|
const res = await adminMap_funGetOneById({ mapId: mapId });
|
||||||
|
setData(res as any);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack>
|
||||||
|
<AspectRatio ratio={1 / 1} mah={300}>
|
||||||
|
<Image
|
||||||
|
radius={"md"}
|
||||||
|
width={300}
|
||||||
|
alt="Foto"
|
||||||
|
src={RouterMap.api_foto + data?.imageMapId}
|
||||||
|
/>
|
||||||
|
</AspectRatio>
|
||||||
|
|
||||||
|
<Box>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconBuildingSkyscraper />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Text>{data?.Portofolio.namaBisnis}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconListDetails />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Text>{data?.Portofolio.MasterBidangBisnis.name}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconPhoneCall />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Text>+{data?.Portofolio.tlpn}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconMapPin />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Text>{data?.Portofolio.alamatKantor}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconPinned />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Text>{data?.Portofolio.deskripsi}</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
{data ? (
|
||||||
|
<Center>
|
||||||
|
<Button
|
||||||
|
radius={"xl"}
|
||||||
|
onClick={() => {
|
||||||
|
window.open(
|
||||||
|
`https://maps.google.com?q=${data?.latitude},${data?.longitude}`,
|
||||||
|
"_blank",
|
||||||
|
"width=800,height=600,noopener,noreferrer"
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Buka Google Map
|
||||||
|
</Button>
|
||||||
|
</Center>
|
||||||
|
) : (
|
||||||
|
<Center>
|
||||||
|
<Button radius={"xl"} disabled>
|
||||||
|
Buka Google Map
|
||||||
|
</Button>
|
||||||
|
</Center>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
65
src/app_modules/admin/map/component/comp_skeleton_drawer.tsx
Normal file
65
src/app_modules/admin/map/component/comp_skeleton_drawer.tsx
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import { Box, Button, Center, Grid, Skeleton, Stack } from "@mantine/core";
|
||||||
|
import {
|
||||||
|
IconBuildingSkyscraper,
|
||||||
|
IconListDetails,
|
||||||
|
IconMapPin,
|
||||||
|
IconPhoneCall,
|
||||||
|
IconPinned,
|
||||||
|
} from "@tabler/icons-react";
|
||||||
|
|
||||||
|
export function ComponentAdminMap_SkeletonDrawer() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack>
|
||||||
|
<Skeleton h={300} width={300} />
|
||||||
|
<Box>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconBuildingSkyscraper />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Skeleton radius={"xl"} h={10} />
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconListDetails />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Skeleton radius={"xl"} h={10} />
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconPhoneCall />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Skeleton radius={"xl"} h={10} />
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconMapPin />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Skeleton radius={"xl"} h={10} />
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<IconPinned />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={"auto"}>
|
||||||
|
<Skeleton radius={"xl"} h={10} />
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Box>
|
||||||
|
<Center>
|
||||||
|
<Button radius={"xl"} disabled>
|
||||||
|
Buka Google Map
|
||||||
|
</Button>
|
||||||
|
</Center>
|
||||||
|
</Stack>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterMap } from "@/app/lib/router_hipmi/router_map";
|
||||||
|
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
|
||||||
import {
|
import {
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Box,
|
Box,
|
||||||
@@ -9,21 +11,20 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { ComponentAdmin_UIDrawerNotifikasi } from "../../notifikasi/ui_drawer_notifikasi";
|
|
||||||
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
|
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { adminMap_funGetOneById } from "../fun/fun_get_one_by_id";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { RouterMap } from "@/app/lib/router_hipmi/router_map";
|
|
||||||
import {
|
import {
|
||||||
IconBuildingSkyscraper,
|
IconBuildingSkyscraper,
|
||||||
IconListDetails,
|
IconListDetails,
|
||||||
IconPhoneCall,
|
|
||||||
IconMapPin,
|
IconMapPin,
|
||||||
|
IconPhoneCall,
|
||||||
IconPinned,
|
IconPinned,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { adminMap_funGetOneById } from "../fun/fun_get_one_by_id";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { ComponentAdminMap_SkeletonDrawer } from "./comp_skeleton_drawer";
|
||||||
|
import { ComponentAdminMap_DetailDataDrawer } from "./comp_detail_data_drawer";
|
||||||
|
|
||||||
export function ComponentAdminMap_Drawer({
|
export function ComponentAdminMap_Drawer({
|
||||||
opened,
|
opened,
|
||||||
@@ -41,8 +42,12 @@ export function ComponentAdminMap_Drawer({
|
|||||||
}, [mapId]);
|
}, [mapId]);
|
||||||
|
|
||||||
async function onLoadMap(mapId: string) {
|
async function onLoadMap(mapId: string) {
|
||||||
|
try {
|
||||||
const res = await adminMap_funGetOneById({ mapId: mapId });
|
const res = await adminMap_funGetOneById({ mapId: mapId });
|
||||||
setData(res as any);
|
setData(res as any);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -60,59 +65,12 @@ export function ComponentAdminMap_Drawer({
|
|||||||
position="right"
|
position="right"
|
||||||
size={"sm"}
|
size={"sm"}
|
||||||
>
|
>
|
||||||
<Stack>
|
{_.isEmpty(data) ? (
|
||||||
<AspectRatio ratio={1 / 1} mah={300}>
|
<ComponentAdminMap_SkeletonDrawer />
|
||||||
<Image
|
) : (
|
||||||
radius={"md"}
|
<ComponentAdminMap_DetailDataDrawer mapId={mapId} />
|
||||||
width={300}
|
)}
|
||||||
alt="Foto"
|
|
||||||
src={RouterMap.api_foto + data?.imageMapId}
|
|
||||||
/>
|
|
||||||
</AspectRatio>
|
|
||||||
|
|
||||||
<Box>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={2}>
|
|
||||||
<IconBuildingSkyscraper />
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text>{data?.Portofolio.namaBisnis}</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={2}>
|
|
||||||
<IconListDetails />
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text>{data?.Portofolio.MasterBidangBisnis.name}</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={2}>
|
|
||||||
<IconPhoneCall />
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text>+{data?.Portofolio.tlpn}</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={2}>
|
|
||||||
<IconMapPin />
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text>{data?.Portofolio.alamatKantor}</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={2}>
|
|
||||||
<IconPinned />
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={"auto"}>
|
|
||||||
<Text >{data?.Portofolio.deskripsi}</Text>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
</Box>
|
|
||||||
</Stack>
|
|
||||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||||
</Drawer>
|
</Drawer>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
import { ComponentAdminMap_DetailDataDrawer } from "./comp_detail_data_drawer";
|
||||||
|
import { ComponentAdminMap_SkeletonDrawer } from "./comp_skeleton_drawer";
|
||||||
import { ComponentAdminMap_Drawer } from "./drawer_detail_map";
|
import { ComponentAdminMap_Drawer } from "./drawer_detail_map";
|
||||||
|
|
||||||
export { ComponentAdminMap_Drawer };
|
export { ComponentAdminMap_Drawer };
|
||||||
|
export { ComponentAdminMap_SkeletonDrawer };
|
||||||
|
export { ComponentAdminMap_DetailDataDrawer };
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ export async function adminMap_funGetAllMaps() {
|
|||||||
where: {
|
where: {
|
||||||
isActive: true,
|
isActive: true,
|
||||||
},
|
},
|
||||||
|
include: {
|
||||||
|
ImagePin: true,
|
||||||
|
Portofolio: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
defaultLatLong,
|
defaultLatLong,
|
||||||
defaultMapZoom,
|
defaultMapZoom,
|
||||||
} from "@/app_modules/map/lib/default_lat_long";
|
} from "@/app_modules/map/lib/default_lat_long";
|
||||||
import { Image, Paper, Stack, Text } from "@mantine/core";
|
import { Avatar, Image, Paper, Stack, Text } from "@mantine/core";
|
||||||
import "mapbox-gl/dist/mapbox-gl.css";
|
import "mapbox-gl/dist/mapbox-gl.css";
|
||||||
import Map, {
|
import Map, {
|
||||||
AttributionControl,
|
AttributionControl,
|
||||||
@@ -16,6 +16,9 @@ import Map, {
|
|||||||
ScaleControl,
|
ScaleControl,
|
||||||
} from "react-map-gl";
|
} from "react-map-gl";
|
||||||
import { ComponentAdminMap_Drawer } from "../component";
|
import { ComponentAdminMap_Drawer } from "../component";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
|
import { RouterMap } from "@/app/lib/router_hipmi/router_map";
|
||||||
|
|
||||||
export function UiAdminMap_MapBoxView({
|
export function UiAdminMap_MapBoxView({
|
||||||
mapboxToken,
|
mapboxToken,
|
||||||
@@ -77,25 +80,19 @@ export function UiAdminMap_MapBoxView({
|
|||||||
setOpenDrawer(true);
|
setOpenDrawer(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Image
|
<Avatar
|
||||||
w={"100%"}
|
alt="Logo"
|
||||||
alt="image"
|
|
||||||
src="https://cdn-icons-png.flaticon.com/512/5860/5860579.png"
|
|
||||||
/>
|
|
||||||
<Text
|
|
||||||
fz={"xs"}
|
|
||||||
bg={"dark"}
|
|
||||||
c={"white"}
|
|
||||||
align="center"
|
|
||||||
style={{
|
style={{
|
||||||
borderRadius: "5px",
|
border: `2px solid ${AccentColor.softblue}`,
|
||||||
padding: "5px",
|
borderRadius: "100%",
|
||||||
width: 50,
|
backgroundColor: "white",
|
||||||
}}
|
}}
|
||||||
lineClamp={2}
|
src={
|
||||||
>
|
e.imagePinId === null
|
||||||
{e.namePin}
|
? RouterPortofolio.api_logo_porto + e.Portofolio.logoId
|
||||||
</Text>
|
: RouterMap.api_custom_pin + e.imagePinId
|
||||||
|
}
|
||||||
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Marker>
|
</Marker>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamp
|
|||||||
import { adminMap_funGetAllMaps } from "../fun/fun_get_all_maps";
|
import { adminMap_funGetAllMaps } from "../fun/fun_get_all_maps";
|
||||||
import { UiAdminMap_MapBoxView } from "../ui";
|
import { UiAdminMap_MapBoxView } from "../ui";
|
||||||
|
|
||||||
|
|
||||||
const mapboxToken = process.env.MAPBOX_TOKEN!;
|
const mapboxToken = process.env.MAPBOX_TOKEN!;
|
||||||
export async function AdminMap_View() {
|
export async function AdminMap_View() {
|
||||||
const dataMap = await adminMap_funGetAllMaps();
|
const dataMap = await adminMap_funGetAllMaps();
|
||||||
@@ -10,7 +9,6 @@ export async function AdminMap_View() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ComponentAdminGlobal_HeaderTamplate name="Maps" />
|
<ComponentAdminGlobal_HeaderTamplate name="Maps" />
|
||||||
|
|
||||||
<UiAdminMap_MapBoxView
|
<UiAdminMap_MapBoxView
|
||||||
mapboxToken={mapboxToken}
|
mapboxToken={mapboxToken}
|
||||||
dataMap={dataMap as any}
|
dataMap={dataMap as any}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export default function AdminUserAccess_View({ listUser }: { listUser: any }) {
|
|||||||
<Center>{e.username}</Center>
|
<Center>{e.username}</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Center>{e.nomor}</Center>
|
<Center>+{e.nomor}</Center>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{e.active === false ? (
|
{e.active === false ? (
|
||||||
@@ -120,7 +120,6 @@ export default function AdminUserAccess_View({ listUser }: { listUser: any }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack spacing={"xs"} h={"90vh"}>
|
<Stack spacing={"xs"} h={"90vh"}>
|
||||||
{/* <pre>{JSON.stringify(listUser, null, 2)}</pre> */}
|
|
||||||
<Group
|
<Group
|
||||||
position="apart"
|
position="apart"
|
||||||
bg={"blue.4"}
|
bg={"blue.4"}
|
||||||
@@ -138,8 +137,8 @@ export default function AdminUserAccess_View({ listUser }: { listUser: any }) {
|
|||||||
/>
|
/>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Paper p={"md"} withBorder shadow="lg" h={"100%"}>
|
<Paper p={"md"} withBorder shadow="lg" h={"80vh"}>
|
||||||
<ScrollArea>
|
<ScrollArea w={"100%"} h={"90%"}>
|
||||||
<Table
|
<Table
|
||||||
verticalSpacing={"xs"}
|
verticalSpacing={"xs"}
|
||||||
horizontalSpacing={"md"}
|
horizontalSpacing={"md"}
|
||||||
|
|||||||
@@ -32,6 +32,16 @@ export function Investasi_ComponentCardDaftarTransaksi({
|
|||||||
invoiceId: string;
|
invoiceId: string;
|
||||||
statusInvoiceId: string;
|
statusInvoiceId: string;
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
|
// Berhasil
|
||||||
|
if (statusInvoiceId === "1") {
|
||||||
|
setVisible(true);
|
||||||
|
return router.push(NEW_RouterInvestasi.transaksi_berhasil + invoiceId, {
|
||||||
|
scroll: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Proses
|
// Proses
|
||||||
if (statusInvoiceId === "2") {
|
if (statusInvoiceId === "2") {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
@@ -48,6 +58,13 @@ export function Investasi_ComponentCardDaftarTransaksi({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (statusInvoiceId === "4") {
|
||||||
|
setVisible(true);
|
||||||
|
return router.push(NEW_RouterInvestasi.transaksi_gagal + invoiceId, {
|
||||||
|
scroll: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ComponentGlobal_NotifikasiPeringatan("Status Belum Tersedia");
|
ComponentGlobal_NotifikasiPeringatan("Status Belum Tersedia");
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export async function investasi_funGetTransaksiByUserId({
|
|||||||
take: takeData,
|
take: takeData,
|
||||||
skip: skipData,
|
skip: skipData,
|
||||||
orderBy: {
|
orderBy: {
|
||||||
createdAt: "desc",
|
updatedAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
authorId: authorId,
|
authorId: authorId,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user