diff --git a/package.json b/package.json index 7efdb4e9..64834c2b 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@emotion/server": "^11.11.0", "@mantine/carousel": "^7.1.5", "@mantine/core": "^6.0.17", + "@mantine/dates": "^6.0.17", "@mantine/dropzone": "^7.1.3", "@mantine/hooks": "^6.0.17", "@mantine/next": "^6.0.17", @@ -25,6 +26,7 @@ "@types/react-dom": "18.2.7", "@types/uuid": "^9.0.4", "autoprefixer": "10.4.14", + "dayjs": "^1.11.10", "echarts": "^5.4.3", "echarts-for-react": "^3.0.2", "embla-carousel-react": "^8.0.0-rc14", diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 0ba45781..92dc1bda 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -26,6 +26,10 @@ model User { Donasi Donasi[] Donasi_Invoice Donasi_Invoice[] Donasi_Notif Donasi_Notif[] + Event Event[] + Event_Peserta Event_Peserta[] + Voting Voting[] + Voting_Kontributor Voting_Kontributor[] } model MasterUserRole { @@ -478,3 +482,114 @@ model Donasi_PencairanDana { Images Images? @relation(fields: [imagesId], references: [id]) imagesId String? } + +// ========================================= EVENT ========================================= // + +model Event { + id String @id @default(cuid()) + title String + lokasi String + tanggal DateTime + deskripsi String + active Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + catatan String? + + Author User? @relation(fields: [authorId], references: [id]) + authorId String? + EventMaster_Status EventMaster_Status? @relation(fields: [eventMaster_StatusId], references: [id]) + eventMaster_StatusId String? @default("2") + Event_Peserta Event_Peserta[] + EventMaster_TipeAcara EventMaster_TipeAcara? @relation(fields: [eventMaster_TipeAcaraId], references: [id]) + eventMaster_TipeAcaraId Int? +} + +model EventMaster_TipeAcara { + id Int @id @default(autoincrement()) + name String + active Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + Event Event[] +} + +model EventMaster_Status { + id String @id @default(cuid()) + name String + active Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + Event Event[] +} + +model Event_Peserta { + id String @id @default(cuid()) + active Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + Event Event? @relation(fields: [eventId], references: [id]) + eventId String? + User User? @relation(fields: [userId], references: [id]) + userId String? +} + +// ========================================= VOTING ========================================= // + +model Voting { + id String @id @default(cuid()) + isActive Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + title String + deskripsi String + awalVote DateTime + akhirVote DateTime + catatan String? + + Author User @relation(fields: [authorId], references: [id]) + authorId String + Voting_Status Voting_Status? @relation(fields: [voting_StatusId], references: [id]) + voting_StatusId String? @default("2") + Voting_DaftarNamaVote Voting_DaftarNamaVote[] + Voting_Kontributor Voting_Kontributor[] +} + +model Voting_Status { + id String @id @default(cuid()) + name String + isActive Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + Voting Voting[] +} + +model Voting_DaftarNamaVote { + id String @id @default(cuid()) + value String + jumlah Int @default(0) + isActive Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + Voting Voting? @relation(fields: [votingId], references: [id]) + votingId String? + Voting_Kontributor Voting_Kontributor[] +} + +model Voting_Kontributor { + id String @id @default(cuid()) + isActive Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + Voting Voting? @relation(fields: [votingId], references: [id]) + votingId String? + Author User? @relation(fields: [authorId], references: [id]) + authorId String? + Voting_DaftarNamaVote Voting_DaftarNamaVote? @relation(fields: [voting_DaftarNamaVoteId], references: [id]) + voting_DaftarNamaVoteId String? + +} diff --git a/public/aset/Hipmi Business Map.png b/public/aset/Hipmi Business Map.png new file mode 100644 index 00000000..9e61fee7 Binary files /dev/null and b/public/aset/Hipmi Business Map.png differ diff --git a/public/aset/Hipmi Job Vacancy Logo.png b/public/aset/Hipmi Job Vacancy Logo.png new file mode 100644 index 00000000..e42c374b Binary files /dev/null and b/public/aset/Hipmi Job Vacancy Logo.png differ diff --git a/public/aset/Hipmi Project Collaboration.png b/public/aset/Hipmi Project Collaboration.png new file mode 100644 index 00000000..90c4f0f6 Binary files /dev/null and b/public/aset/Hipmi Project Collaboration.png differ diff --git a/public/aset/event/splash-event.png b/public/aset/event/splash-event.png new file mode 100644 index 00000000..b59659fb Binary files /dev/null and b/public/aset/event/splash-event.png differ diff --git a/public/aset/global/upload_icon.png b/public/aset/global/upload_icon.png new file mode 100644 index 00000000..b56be6a9 Binary files /dev/null and b/public/aset/global/upload_icon.png differ diff --git a/public/aset/vote/logo.png b/public/aset/vote/logo.png new file mode 100644 index 00000000..a5e7f056 Binary files /dev/null and b/public/aset/vote/logo.png differ diff --git a/public/portofolio/logo/6fec9ab1-6989-4bb8-8050-ab46ba431d11.png b/public/portofolio/logo/6fec9ab1-6989-4bb8-8050-ab46ba431d11.png new file mode 100644 index 00000000..b59659fb Binary files /dev/null and b/public/portofolio/logo/6fec9ab1-6989-4bb8-8050-ab46ba431d11.png differ diff --git a/public/portofolio/logo/e6be54b3-b536-408d-afcb-da38415cfec1.jpg b/public/portofolio/logo/e6be54b3-b536-408d-afcb-da38415cfec1.jpg new file mode 100644 index 00000000..f046776e Binary files /dev/null and b/public/portofolio/logo/e6be54b3-b536-408d-afcb-da38415cfec1.jpg differ diff --git a/src/app/api/seeder/route.ts b/src/app/api/seeder/route.ts index 9a213b3f..9d67393f 100644 --- a/src/app/api/seeder/route.ts +++ b/src/app/api/seeder/route.ts @@ -13,8 +13,11 @@ import userSeeder from "../../../bin/seeder/user_seeder.json"; import donasi_status from "../../../bin/seeder/donasi/master_status.json"; import donasi_kategori from "../../../bin/seeder/donasi/master_kategori.json"; import donasi_durasi from "../../../bin/seeder/donasi/master_durasi.json"; -import donasi_namaBank from "../../../bin/seeder/donasi/master_bank.json" -import donasi_status_invoice from "../../../bin/seeder/donasi/master_status_invoice.json" +import donasi_namaBank from "../../../bin/seeder/donasi/master_bank.json"; +import donasi_status_invoice from "../../../bin/seeder/donasi/master_status_invoice.json"; +import event_status from "../../../bin/seeder/event/master_status.json"; +import event_tipe_acara from "../../../bin/seeder/event/master_tipe_acara.json"; +import voting_status from "../../../bin/seeder/voting/master_status.json"; export async function GET(req: Request) { const dev = new URL(req.url).searchParams.get("dev"); @@ -264,6 +267,51 @@ export async function GET(req: Request) { }); } + for (let e of event_status) { + await prisma.eventMaster_Status.upsert({ + where: { + id: e.id, + }, + create: { + id: e.id, + name: e.name, + }, + update: { + name: e.name, + }, + }); + } + + for (let e of event_tipe_acara) { + await prisma.eventMaster_TipeAcara.upsert({ + where: { + id: e.id, + }, + create: { + id: e.id, + name: e.name, + }, + update: { + name: e.name, + }, + }); + } + + for (let v of voting_status) { + await prisma.voting_Status.upsert({ + where: { + id: v.id, + }, + create: { + id: v.id, + name: v.name, + }, + update: { + name: v.name, + }, + }); + } + return NextResponse.json({ success: true }); } diff --git a/src/app/dev/admin/event/child/riwayat/page.tsx b/src/app/dev/admin/event/child/riwayat/page.tsx new file mode 100644 index 00000000..8d3dbdd0 --- /dev/null +++ b/src/app/dev/admin/event/child/riwayat/page.tsx @@ -0,0 +1,13 @@ +import { AdminEvent_Riwayat } from "@/app_modules/admin/event"; +import { AdminEvent_getListAllRiwayat } from "@/app_modules/admin/event/fun/get/get_list_all_riwayat"; + +export default async function Page() { + const listRiwayat = await AdminEvent_getListAllRiwayat() + + + return ( + <> + + + ); +} diff --git a/src/app/dev/admin/event/child/tipe_acara/page.tsx b/src/app/dev/admin/event/child/tipe_acara/page.tsx new file mode 100644 index 00000000..b905136e --- /dev/null +++ b/src/app/dev/admin/event/child/tipe_acara/page.tsx @@ -0,0 +1,12 @@ +import { AdminEvent_DetailTipeAcara } from "@/app_modules/admin/event"; +import { AdminEvent_getListTipeAcara } from "@/app_modules/admin/event/fun/get/get_list_tipe_acara"; + +export default async function Page() { + const listTipe = await AdminEvent_getListTipeAcara() + + return ( + <> + + + ); +} diff --git a/src/app/dev/admin/event/main/page.tsx b/src/app/dev/admin/event/main/page.tsx new file mode 100644 index 00000000..f1d4ff3a --- /dev/null +++ b/src/app/dev/admin/event/main/page.tsx @@ -0,0 +1,28 @@ +import { AdminEvent_Main } from "@/app_modules/admin/event"; +import AdminEvent_funCountByStatusId from "@/app_modules/admin/event/fun/count/fun_count_event_by_status_id"; +import { AdminEvent_funCountRiwayat } from "@/app_modules/admin/event/fun/count/fun_count_riwayat"; +import { AdminEvent_funCountTipeAcara } from "@/app_modules/admin/event/fun/count/fun_count_tipe_acara"; + +export default async function Page() { + const countPublish = await AdminEvent_funCountByStatusId("1"); + const countReview = await AdminEvent_funCountByStatusId("2"); + const countDraft = await AdminEvent_funCountByStatusId("3"); + const countReject = await AdminEvent_funCountByStatusId("4"); + const countTipeAcara = await AdminEvent_funCountTipeAcara() + const countRiwayat = await AdminEvent_funCountRiwayat() + + + + return ( + <> + + + ); +} diff --git a/src/app/dev/admin/event/table/publish/page.tsx b/src/app/dev/admin/event/table/publish/page.tsx new file mode 100644 index 00000000..6b7d421f --- /dev/null +++ b/src/app/dev/admin/event/table/publish/page.tsx @@ -0,0 +1,12 @@ +import { AdminEvent_TablePublish } from "@/app_modules/admin/event"; +import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id"; + +export default async function Page() { + const listPublish = await AdminEvent_getListTableByStatusId("1"); + + return ( + <> + + + ); +} diff --git a/src/app/dev/admin/event/table/reject/page.tsx b/src/app/dev/admin/event/table/reject/page.tsx new file mode 100644 index 00000000..74e069b4 --- /dev/null +++ b/src/app/dev/admin/event/table/reject/page.tsx @@ -0,0 +1,10 @@ +import { AdminEvent_TableReject } from "@/app_modules/admin/event"; +import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id"; + +export default async function Page() { + const listReject = await AdminEvent_getListTableByStatusId("4") + + return <> + + +} \ No newline at end of file diff --git a/src/app/dev/admin/event/table/review/page.tsx b/src/app/dev/admin/event/table/review/page.tsx new file mode 100644 index 00000000..d21a34a1 --- /dev/null +++ b/src/app/dev/admin/event/table/review/page.tsx @@ -0,0 +1,10 @@ +import { AdminEvent_TableReview } from "@/app_modules/admin/event"; +import { AdminEvent_getListTableByStatusId } from "@/app_modules/admin/event/fun/get/get_list_table_by_status_id"; + +export default async function Page() { + const listReview = await AdminEvent_getListTableByStatusId("2") + + return <> + + +} \ No newline at end of file diff --git a/src/app/dev/admin/vote/child/riwayat/page.tsx b/src/app/dev/admin/vote/child/riwayat/page.tsx new file mode 100644 index 00000000..5e340dc1 --- /dev/null +++ b/src/app/dev/admin/vote/child/riwayat/page.tsx @@ -0,0 +1,12 @@ +import { AdminVote_Riwayat } from "@/app_modules/admin/vote"; +import { AdminVote_getListTableByStatusId } from "@/app_modules/admin/vote/fun/get/get_list_table_by_status_id"; + +export default async function Page() { + const dataVote = await AdminVote_getListTableByStatusId("0"); + + return ( + <> + + + ); +} diff --git a/src/app/dev/admin/vote/child/table_publish/page.tsx b/src/app/dev/admin/vote/child/table_publish/page.tsx new file mode 100644 index 00000000..05f09fd9 --- /dev/null +++ b/src/app/dev/admin/vote/child/table_publish/page.tsx @@ -0,0 +1,12 @@ +import { AdminVote_TablePublish } from "@/app_modules/admin/vote"; +import { AdminVote_getListTableByStatusId } from "@/app_modules/admin/vote/fun/get/get_list_table_by_status_id"; + +export default async function Page() { + const dataVote = await AdminVote_getListTableByStatusId("1") + + return ( + <> + + + ); +} \ No newline at end of file diff --git a/src/app/dev/admin/vote/child/table_reject/page.tsx b/src/app/dev/admin/vote/child/table_reject/page.tsx new file mode 100644 index 00000000..2eb2d72b --- /dev/null +++ b/src/app/dev/admin/vote/child/table_reject/page.tsx @@ -0,0 +1,11 @@ +import { AdminVote_TableReject } from "@/app_modules/admin/vote"; +import { AdminVote_getListTableByStatusId } from "@/app_modules/admin/vote/fun/get/get_list_table_by_status_id"; + +export default async function Page() { + const dataVote = await AdminVote_getListTableByStatusId("4"); + return ( + <> + + + ); +} diff --git a/src/app/dev/admin/vote/child/table_review/page.tsx b/src/app/dev/admin/vote/child/table_review/page.tsx new file mode 100644 index 00000000..25ff7f2e --- /dev/null +++ b/src/app/dev/admin/vote/child/table_review/page.tsx @@ -0,0 +1,13 @@ +import { AdminVote_TableReview } from "@/app_modules/admin/vote"; +import { AdminVote_getListTableByStatusId } from "@/app_modules/admin/vote/fun/get/get_list_table_by_status_id"; + + +export default async function Page() { + const listVote = await AdminVote_getListTableByStatusId("2") + + return ( + <> + + + ); +} diff --git a/src/app/dev/admin/vote/main/page.tsx b/src/app/dev/admin/vote/main/page.tsx new file mode 100644 index 00000000..6fefc7ff --- /dev/null +++ b/src/app/dev/admin/vote/main/page.tsx @@ -0,0 +1,20 @@ +import { AdminVote_Main } from "@/app_modules/admin/vote"; +import AdminVote_funCountByStatusId from "@/app_modules/admin/vote/fun/count/fun_count_vote_by_status_id"; + +export default async function Page() { + const countPublish = await AdminVote_funCountByStatusId("1"); + const countReview = await AdminVote_funCountByStatusId("2"); + const countDraft = await AdminVote_funCountByStatusId("0"); + const countReject = await AdminVote_funCountByStatusId("4"); + + return ( + <> + + + ); +} diff --git a/src/app/dev/donasi/main/layout.tsx b/src/app/dev/donasi/main/layout.tsx index 3b3c15bf..36134c44 100644 --- a/src/app/dev/donasi/main/layout.tsx +++ b/src/app/dev/donasi/main/layout.tsx @@ -9,9 +9,9 @@ export default async function Layout({ children: React.ReactNode; }) { const userId = await User_getUserId(); - // const dataDonasi = await DOnasi_getList - const isRead = await Donasi_getNotifByUserId(userId).then((res) => - res.map((val: any) => val.isRead) + // console.log(userId) + const isRead = await Donasi_getNotifByUserId(userId).then((res: any) => + res.map((val: any) => val.isRead) ); // console.log(isRead) diff --git a/src/app/dev/event/create/layout.tsx b/src/app/dev/event/create/layout.tsx new file mode 100644 index 00000000..12b7548d --- /dev/null +++ b/src/app/dev/event/create/layout.tsx @@ -0,0 +1,13 @@ +import { LayoutEvent_Create } from "@/app_modules/event"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/event/create/page.tsx b/src/app/dev/event/create/page.tsx new file mode 100644 index 00000000..3bc87a0d --- /dev/null +++ b/src/app/dev/event/create/page.tsx @@ -0,0 +1,11 @@ +import { Event_Create } from "@/app_modules/event"; +import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara"; +import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; +import _ from "lodash"; + +export default async function Page() { + const userId = await User_getUserId() + const listTipeAcara = await Event_getMasterTipeAcara(); + + return ; +} diff --git a/src/app/dev/event/detail/draft/[id]/layout.tsx b/src/app/dev/event/detail/draft/[id]/layout.tsx new file mode 100644 index 00000000..529e8e2e --- /dev/null +++ b/src/app/dev/event/detail/draft/[id]/layout.tsx @@ -0,0 +1,16 @@ +import { LayoutEvent_DetailDraft } from "@/app_modules/event"; +import React from "react"; + +export default async function Page({ + children, + params, +}: { + children: React.ReactNode; + params: { id: string }; +}) { + let eventId = params.id + + return <> + {children}; + +} diff --git a/src/app/dev/event/detail/draft/[id]/page.tsx b/src/app/dev/event/detail/draft/[id]/page.tsx new file mode 100644 index 00000000..ff593528 --- /dev/null +++ b/src/app/dev/event/detail/draft/[id]/page.tsx @@ -0,0 +1,8 @@ +import { Event_DetailDraft } from "@/app_modules/event"; +import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; + +export default async function Page({params}: {params: {id: string}}) { + let eventId = params.id + const dataEvent = await Event_getOneById(eventId) + return ; +} diff --git a/src/app/dev/event/detail/kontribusi/[id]/layout.tsx b/src/app/dev/event/detail/kontribusi/[id]/layout.tsx new file mode 100644 index 00000000..53700a85 --- /dev/null +++ b/src/app/dev/event/detail/kontribusi/[id]/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutEvent_DetailKontribusi } from "@/app_modules/event"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/event/detail/kontribusi/[id]/page.tsx b/src/app/dev/event/detail/kontribusi/[id]/page.tsx new file mode 100644 index 00000000..d2548e5e --- /dev/null +++ b/src/app/dev/event/detail/kontribusi/[id]/page.tsx @@ -0,0 +1,20 @@ +import { Event_DetailKontribusi } from "@/app_modules/event"; +import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id"; +import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id"; +import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; + +export default async function Page({ params }: { params: { id: string } }) { + let eventId = params.id; + const dataEvent = await Event_getOneById(eventId); + const listKontributor = await Event_getListPesertaById(eventId); + const totalPeserta = await Event_countTotalPesertaById(eventId) + return ( + <> + + + ); +} diff --git a/src/app/dev/event/detail/main/[id]/layout.tsx b/src/app/dev/event/detail/main/[id]/layout.tsx new file mode 100644 index 00000000..bafd6a01 --- /dev/null +++ b/src/app/dev/event/detail/main/[id]/layout.tsx @@ -0,0 +1,15 @@ +import { LayoutEvent_DetailMain } from "@/app_modules/event"; +import { AppShell } from "@mantine/core"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/event/detail/main/[id]/page.tsx b/src/app/dev/event/detail/main/[id]/page.tsx new file mode 100644 index 00000000..be2c8a94 --- /dev/null +++ b/src/app/dev/event/detail/main/[id]/page.tsx @@ -0,0 +1,27 @@ +import { Event_DetailMain } from "@/app_modules/event"; +import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id"; +import { Event_CekUserJoinById } from "@/app_modules/event/fun/get/cek_user_join_by_id"; +import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id"; +import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; +import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; + +export default async function Page({ params }: { params: { id: string } }) { + let eventId = params.id; + const dataEvent = await Event_getOneById(eventId); + const listPeserta = await Event_getListPesertaById(eventId); + const userLoginId = await User_getUserId(); + const isJoin = await Event_CekUserJoinById(eventId, userLoginId); + const totalPeserta = await Event_countTotalPesertaById(eventId) + + return ( + <> + + + ); +} diff --git a/src/app/dev/event/detail/publish/[id]/layout.tsx b/src/app/dev/event/detail/publish/[id]/layout.tsx new file mode 100644 index 00000000..852fa2d9 --- /dev/null +++ b/src/app/dev/event/detail/publish/[id]/layout.tsx @@ -0,0 +1,11 @@ + +import { LayoutEvent_DetailPublish } from "@/app_modules/event"; +import React from "react"; + +export default async function Page({ + children, +}: { + children: React.ReactNode; +}) { + return {children}; +} diff --git a/src/app/dev/event/detail/publish/[id]/page.tsx b/src/app/dev/event/detail/publish/[id]/page.tsx new file mode 100644 index 00000000..2e3de6da --- /dev/null +++ b/src/app/dev/event/detail/publish/[id]/page.tsx @@ -0,0 +1,9 @@ +import { Event_DetailPublish } from "@/app_modules/event"; +import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; + +export default async function Page({ params }: { params: { id: string } }) { + let eventId = params.id; + const dataEvent = await Event_getOneById(eventId); + + return ; +} diff --git a/src/app/dev/event/detail/reject/[id]/layout.tsx b/src/app/dev/event/detail/reject/[id]/layout.tsx new file mode 100644 index 00000000..3526df2b --- /dev/null +++ b/src/app/dev/event/detail/reject/[id]/layout.tsx @@ -0,0 +1,11 @@ + +import { LayoutEvent_DetailReject } from "@/app_modules/event"; +import React from "react"; + +export default async function Page({ + children, +}: { + children: React.ReactNode; +}) { + return {children}; +} diff --git a/src/app/dev/event/detail/reject/[id]/page.tsx b/src/app/dev/event/detail/reject/[id]/page.tsx new file mode 100644 index 00000000..5c2feb8b --- /dev/null +++ b/src/app/dev/event/detail/reject/[id]/page.tsx @@ -0,0 +1,9 @@ +import { Event_DetailReject } from "@/app_modules/event"; +import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; + +export default async function Page({params}: {params: {id: string}}) { + let eventId = params.id + const dataEvent = await Event_getOneById(eventId) + + return ; +} diff --git a/src/app/dev/event/detail/review/[id]/layout.tsx b/src/app/dev/event/detail/review/[id]/layout.tsx new file mode 100644 index 00000000..fdf53173 --- /dev/null +++ b/src/app/dev/event/detail/review/[id]/layout.tsx @@ -0,0 +1,11 @@ + +import { LayoutEvent_DetailReview } from "@/app_modules/event"; +import React from "react"; + +export default async function Page({ + children, +}: { + children: React.ReactNode; +}) { + return {children} +} diff --git a/src/app/dev/event/detail/review/[id]/page.tsx b/src/app/dev/event/detail/review/[id]/page.tsx new file mode 100644 index 00000000..ddada325 --- /dev/null +++ b/src/app/dev/event/detail/review/[id]/page.tsx @@ -0,0 +1,10 @@ +import { Event_DetailReview } from "@/app_modules/event"; +import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; + + +export default async function Page({params}: {params: {id: string}}) { + let eventId = params.id + const dataEvent = await Event_getOneById(eventId) + + return ; +} diff --git a/src/app/dev/event/detail/riwayat/[id]/layout.tsx b/src/app/dev/event/detail/riwayat/[id]/layout.tsx new file mode 100644 index 00000000..3d6f81a6 --- /dev/null +++ b/src/app/dev/event/detail/riwayat/[id]/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutEvent_DetailRiwayat } from "@/app_modules/event"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/event/detail/riwayat/[id]/page.tsx b/src/app/dev/event/detail/riwayat/[id]/page.tsx new file mode 100644 index 00000000..5004dfb7 --- /dev/null +++ b/src/app/dev/event/detail/riwayat/[id]/page.tsx @@ -0,0 +1,24 @@ + +import { Event_DetailRiwayat } from "@/app_modules/event"; +import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count_total_peserta_by_id"; +import { Event_CekUserJoinById } from "@/app_modules/event/fun/get/cek_user_join_by_id"; +import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id"; +import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; +import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; + +export default async function Page({ params }: { params: { id: string } }) { + let eventId = params.id; + const dataEvent = await Event_getOneById(eventId); + const listPeserta = await Event_getListPesertaById(eventId); + const totalPeserta = await Event_countTotalPesertaById(eventId); + + return ( + <> + + + ); +} diff --git a/src/app/dev/event/edit/[id]/layout.tsx b/src/app/dev/event/edit/[id]/layout.tsx new file mode 100644 index 00000000..2288974b --- /dev/null +++ b/src/app/dev/event/edit/[id]/layout.tsx @@ -0,0 +1,8 @@ +import { LayoutEvent_Edit } from "@/app_modules/event"; +import React from "react"; + +export default async function Layout({children}: {children: React.ReactNode}) { + return <> + {children} + +} \ No newline at end of file diff --git a/src/app/dev/event/edit/[id]/page.tsx b/src/app/dev/event/edit/[id]/page.tsx new file mode 100644 index 00000000..cf42526f --- /dev/null +++ b/src/app/dev/event/edit/[id]/page.tsx @@ -0,0 +1,27 @@ +import { Event_Edit } from "@/app_modules/event"; +import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; +import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara"; +import { MODEL_EVENT } from "@/app_modules/event/model/interface"; +import _ from "lodash"; + +export default async function Page({ params }: { params: { id: string } }) { + let eventId = params.id; + const data = await Event_getOneById(eventId); + const dataEvent = _.omit(data, [ + "Author", + "EventMaster_Status", + "Event_Peserta", + "createdAt", + "updatedAt", + "active", + ]); + // console.log(dataEvent) + + const listTipeAcara = await Event_getMasterTipeAcara() + + return ( + <> + + + ); +} diff --git a/src/app/dev/event/main/beranda/page.tsx b/src/app/dev/event/main/beranda/page.tsx new file mode 100644 index 00000000..eb5dbac0 --- /dev/null +++ b/src/app/dev/event/main/beranda/page.tsx @@ -0,0 +1,12 @@ +import { Event_Beranda } from "@/app_modules/event"; +import { Event_getListAllPublish } from "@/app_modules/event/fun/get/get_list_all_publish"; + +export default async function Page() { + const dataEvent = await Event_getListAllPublish() + + return ( + <> + + + ); +} diff --git a/src/app/dev/event/main/kontribusi/page.tsx b/src/app/dev/event/main/kontribusi/page.tsx new file mode 100644 index 00000000..5b162130 --- /dev/null +++ b/src/app/dev/event/main/kontribusi/page.tsx @@ -0,0 +1,14 @@ +import { Event_Kontribusi } from "@/app_modules/event"; +import { Event_getListKontibusiByUserId } from "@/app_modules/event/fun/get/get_list_kontribusi_by_user_id"; +import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; + +export default async function Page() { + const userLoginId = await User_getUserId(); + const listKontribusi = await Event_getListKontibusiByUserId(userLoginId) + + return ( + <> + + + ); +} diff --git a/src/app/dev/event/main/layout.tsx b/src/app/dev/event/main/layout.tsx new file mode 100644 index 00000000..f7a4ce5d --- /dev/null +++ b/src/app/dev/event/main/layout.tsx @@ -0,0 +1,8 @@ +import { LayoutEvent_Main } from "@/app_modules/event"; +import React from "react"; + +export default async function Layout({children}:{children: React.ReactNode}) { + return<> + {children} + +} \ No newline at end of file diff --git a/src/app/dev/event/main/riwayat/page.tsx b/src/app/dev/event/main/riwayat/page.tsx new file mode 100644 index 00000000..d896ef42 --- /dev/null +++ b/src/app/dev/event/main/riwayat/page.tsx @@ -0,0 +1,19 @@ +import { Event_Riwayat } from "@/app_modules/event"; +import { Event_getListRiwayatSaya } from "@/app_modules/event/fun/get/get_list_riwayat_saya"; +import { Event_getListSemuaRiwayat } from "@/app_modules/event/fun/get/get_list_semua_riwayat"; +import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id"; +import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; + +export default async function Page({ params }: { params: { id: string } }) { + let eventId = params.id; + const authorId = await User_getUserId(); + const dataSemuaRiwayat = await Event_getListSemuaRiwayat(); + const dataRiwayatSaya = await Event_getListRiwayatSaya(authorId); + + return ( + + ); +} diff --git a/src/app/dev/event/main/status_page/page.tsx b/src/app/dev/event/main/status_page/page.tsx new file mode 100644 index 00000000..6252c986 --- /dev/null +++ b/src/app/dev/event/main/status_page/page.tsx @@ -0,0 +1,21 @@ +import { Event_StatusPage } from "@/app_modules/event"; +import { Event_getByStatusId } from "@/app_modules/event/fun/get/get_event_by_status_id"; +import { User_getUserId } from "@/app_modules/fun_global/get_user_token"; + +export default async function Page() { + const authorId = await User_getUserId(); + const listPublish = await Event_getByStatusId("1", authorId); + const listReview = await Event_getByStatusId("2", authorId); + const listDraft = await Event_getByStatusId("3", authorId); + const listReject = await Event_getByStatusId("4", authorId); + + return ( + + ); +} diff --git a/src/app/dev/event/splash/page.tsx b/src/app/dev/event/splash/page.tsx new file mode 100644 index 00000000..731f1110 --- /dev/null +++ b/src/app/dev/event/splash/page.tsx @@ -0,0 +1,5 @@ +import { Event_SplashScreen } from "@/app_modules/event"; + +export default async function Page() { + return ; +} diff --git a/src/app/dev/vote/create/layout.tsx b/src/app/dev/vote/create/layout.tsx new file mode 100644 index 00000000..3152ab64 --- /dev/null +++ b/src/app/dev/vote/create/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutVote_Create } from "@/app_modules/vote"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/vote/create/page.tsx b/src/app/dev/vote/create/page.tsx new file mode 100644 index 00000000..a1d28226 --- /dev/null +++ b/src/app/dev/vote/create/page.tsx @@ -0,0 +1,9 @@ +import { Vote_Create } from "@/app_modules/vote"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/detail/draft/[id]/layout.tsx b/src/app/dev/vote/detail/draft/[id]/layout.tsx new file mode 100644 index 00000000..ba62a6ef --- /dev/null +++ b/src/app/dev/vote/detail/draft/[id]/layout.tsx @@ -0,0 +1,19 @@ +import { LayoutVote_DetailDraft } from "@/app_modules/vote"; +import React from "react"; + +export default function Layout({ + children, + params, +}: { + children: React.ReactNode; + params: { id: string }; +}) { + let voteId = params.id; + return ( + <> + + {children} + + + ); +} diff --git a/src/app/dev/vote/detail/draft/[id]/page.tsx b/src/app/dev/vote/detail/draft/[id]/page.tsx new file mode 100644 index 00000000..850cb121 --- /dev/null +++ b/src/app/dev/vote/detail/draft/[id]/page.tsx @@ -0,0 +1,13 @@ +import { Vote_DetailDraft } from "@/app_modules/vote"; +import { Vote_getOnebyId } from "@/app_modules/vote/fun/get/get_one_by_id"; + +export default async function Page({ params }: { params: { id: string } }) { + const voteId = params.id; + const dataVote = await Vote_getOnebyId(voteId); + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/detail/kontribusi/[id]/layout.tsx b/src/app/dev/vote/detail/kontribusi/[id]/layout.tsx new file mode 100644 index 00000000..ca76dac8 --- /dev/null +++ b/src/app/dev/vote/detail/kontribusi/[id]/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutVote_DetailKontribusi } from "@/app_modules/vote"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/vote/detail/kontribusi/[id]/page.tsx b/src/app/dev/vote/detail/kontribusi/[id]/page.tsx new file mode 100644 index 00000000..75dd7eb3 --- /dev/null +++ b/src/app/dev/vote/detail/kontribusi/[id]/page.tsx @@ -0,0 +1,19 @@ +import { Vote_DetailKontribusi } from "@/app_modules/vote"; +import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id"; +import { Vote_getOnebyId } from "@/app_modules/vote/fun/get/get_one_by_id"; + +export default async function Page({ params }: { params: { id: string } }) { + let voteId = params.id; + const dataVote = await Vote_getOnebyId(voteId) + const listKontributor = await Vote_getListKontributorById(voteId) + + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/detail/main/[id]/layout.tsx b/src/app/dev/vote/detail/main/[id]/layout.tsx new file mode 100644 index 00000000..6e978bef --- /dev/null +++ b/src/app/dev/vote/detail/main/[id]/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutVote_MainDetail } from "@/app_modules/vote"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/vote/detail/main/[id]/page.tsx b/src/app/dev/vote/detail/main/[id]/page.tsx new file mode 100644 index 00000000..197f4b7e --- /dev/null +++ b/src/app/dev/vote/detail/main/[id]/page.tsx @@ -0,0 +1,29 @@ +import prisma from "@/app/lib/prisma"; +import { Vote_MainDetail } from "@/app_modules/vote"; +import { Vote_getHasilVoteById } from "@/app_modules/vote/fun/get/get_list_hasil_by_id"; +import { Vote_cekKontributorById } from "@/app_modules/vote/fun/get/cek_kontributor_by_id"; +import { Vote_getOnebyId } from "@/app_modules/vote/fun/get/get_one_by_id"; +import { Vote_getOnePilihanVotingByUserId } from "@/app_modules/vote/fun/get/get_one_pilihan_voting_by_user_id"; +import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id"; + +export default async function Page({ params }: { params: { id: string } }) { + const voteId = params.id; + const dataVote = await Vote_getOnebyId(voteId); + const hasilVoting = await Vote_getHasilVoteById(voteId as any); + const isKontributor = await Vote_cekKontributorById(voteId); + const pilihanKontributor = await Vote_getOnePilihanVotingByUserId(voteId); + const listKontributor = await Vote_getListKontributorById(voteId); + + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/detail/publish/[id]/layout.tsx b/src/app/dev/vote/detail/publish/[id]/layout.tsx new file mode 100644 index 00000000..6730430a --- /dev/null +++ b/src/app/dev/vote/detail/publish/[id]/layout.tsx @@ -0,0 +1,10 @@ +import { LayoutVote_DetailPublish } from "@/app_modules/vote"; +import React from "react"; + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/vote/detail/publish/[id]/page.tsx b/src/app/dev/vote/detail/publish/[id]/page.tsx new file mode 100644 index 00000000..a0db9358 --- /dev/null +++ b/src/app/dev/vote/detail/publish/[id]/page.tsx @@ -0,0 +1,18 @@ +import { Vote_DetailPublish } from "@/app_modules/vote"; +import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id"; +import { Vote_getOnebyId } from "@/app_modules/vote/fun/get/get_one_by_id"; + +export default async function Page({ params }: { params: { id: string } }) { + let voteId = params.id; + const dataVote = await Vote_getOnebyId(voteId); + const listKontributor = await Vote_getListKontributorById(voteId); + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/detail/reject/[id]/layout.tsx b/src/app/dev/vote/detail/reject/[id]/layout.tsx new file mode 100644 index 00000000..469f132a --- /dev/null +++ b/src/app/dev/vote/detail/reject/[id]/layout.tsx @@ -0,0 +1,8 @@ +import { LayoutVote_DetailReject } from "@/app_modules/vote"; +import React from "react"; + +export default async function Layout({children}: {children: React.ReactNode}) { + return<> + {children} + +} \ No newline at end of file diff --git a/src/app/dev/vote/detail/reject/[id]/page.tsx b/src/app/dev/vote/detail/reject/[id]/page.tsx new file mode 100644 index 00000000..3f4c1b5f --- /dev/null +++ b/src/app/dev/vote/detail/reject/[id]/page.tsx @@ -0,0 +1,13 @@ +import { Vote_DetailReject } from "@/app_modules/vote"; +import { Vote_getOnebyId } from "@/app_modules/vote/fun/get/get_one_by_id"; + +export default async function Page({ params }: { params: { id: string } }) { + let voteId = params.id; + const dataVote = await Vote_getOnebyId(voteId); + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/detail/review/[id]/layout.tsx b/src/app/dev/vote/detail/review/[id]/layout.tsx new file mode 100644 index 00000000..b749c3df --- /dev/null +++ b/src/app/dev/vote/detail/review/[id]/layout.tsx @@ -0,0 +1,10 @@ +import { LayoutVote_DetailReview } from "@/app_modules/vote"; +import React from "react"; + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/vote/detail/review/[id]/page.tsx b/src/app/dev/vote/detail/review/[id]/page.tsx new file mode 100644 index 00000000..a9dbd486 --- /dev/null +++ b/src/app/dev/vote/detail/review/[id]/page.tsx @@ -0,0 +1,13 @@ +import { Vote_DetailReview } from "@/app_modules/vote"; +import { Vote_getOnebyId } from "@/app_modules/vote/fun/get/get_one_by_id"; + +export default async function Page({ params }: { params: { id: string } }) { + let voteId = params.id; + const dataVote = await Vote_getOnebyId(voteId); + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/detail/riwayat_saya/[id]/layout.tsx b/src/app/dev/vote/detail/riwayat_saya/[id]/layout.tsx new file mode 100644 index 00000000..4d17c867 --- /dev/null +++ b/src/app/dev/vote/detail/riwayat_saya/[id]/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutVote_DetailRiwayatSaya } from "@/app_modules/vote"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/vote/detail/riwayat_saya/[id]/page.tsx b/src/app/dev/vote/detail/riwayat_saya/[id]/page.tsx new file mode 100644 index 00000000..f4542ad0 --- /dev/null +++ b/src/app/dev/vote/detail/riwayat_saya/[id]/page.tsx @@ -0,0 +1,19 @@ +import { Vote_DetailRiwayatSaya } from "@/app_modules/vote"; +import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id"; +import { Vote_getOnePublishbyId } from "@/app_modules/vote/fun/get/get_one_publish_by_id"; + +export default async function Page({params}: {params: {id: string}}) { + let voteId = params.id; + const dataVote = await Vote_getOnePublishbyId(voteId); + const listKontributor = await Vote_getListKontributorById(voteId); + + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/detail/semua_riwayat/[id]/layout.tsx b/src/app/dev/vote/detail/semua_riwayat/[id]/layout.tsx new file mode 100644 index 00000000..4723aa9d --- /dev/null +++ b/src/app/dev/vote/detail/semua_riwayat/[id]/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutVote_DetailSemuaRiwayat } from "@/app_modules/vote"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/vote/detail/semua_riwayat/[id]/page.tsx b/src/app/dev/vote/detail/semua_riwayat/[id]/page.tsx new file mode 100644 index 00000000..6d943acd --- /dev/null +++ b/src/app/dev/vote/detail/semua_riwayat/[id]/page.tsx @@ -0,0 +1,19 @@ +import { Vote_DetailSemuaRiwayat } from "@/app_modules/vote"; +import { Vote_getListKontributorById } from "@/app_modules/vote/fun/get/get_list_kontributor_by_id"; +import { Vote_getOnePublishbyId } from "@/app_modules/vote/fun/get/get_one_publish_by_id"; + + +export default async function Page({params}: {params: {id: string}}) { + let voteId = params.id + const dataVote = await Vote_getOnePublishbyId(voteId) + const listKontributor = await Vote_getListKontributorById(voteId) + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/edit/[id]/layout.tsx b/src/app/dev/vote/edit/[id]/layout.tsx new file mode 100644 index 00000000..c84da67c --- /dev/null +++ b/src/app/dev/vote/edit/[id]/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutVote_Edit } from "@/app_modules/vote"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/vote/edit/[id]/page.tsx b/src/app/dev/vote/edit/[id]/page.tsx new file mode 100644 index 00000000..d43d25e6 --- /dev/null +++ b/src/app/dev/vote/edit/[id]/page.tsx @@ -0,0 +1,20 @@ +import { Vote_Edit } from "@/app_modules/vote"; +import { Vote_getListDaftarNamaById } from "@/app_modules/vote/fun/get/get_list_daftar_vote_by_id"; +import { Vote_getOnebyId } from "@/app_modules/vote/fun/get/get_one_by_id"; +import _ from "lodash"; + +export default async function Page({ params }: { params: { id: string } }) { + let voteId = params.id; + const dataVote = await Vote_getOnebyId(voteId); + const data = _.omit(dataVote, ["Voting_DaftarNamaVote"]); + const listDaftarVote = await Vote_getListDaftarNamaById(voteId); + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/main/beranda/page.tsx b/src/app/dev/vote/main/beranda/page.tsx new file mode 100644 index 00000000..25623b91 --- /dev/null +++ b/src/app/dev/vote/main/beranda/page.tsx @@ -0,0 +1,12 @@ +import { Vote_Beranda } from "@/app_modules/vote"; +import { Vote_getAllListPublish } from "@/app_modules/vote/fun/get/get_all_list_publish"; + +export default async function Page() { + const dataVote = await Vote_getAllListPublish() + + return ( + <> + + + ); +} \ No newline at end of file diff --git a/src/app/dev/vote/main/kontribusi/page.tsx b/src/app/dev/vote/main/kontribusi/page.tsx new file mode 100644 index 00000000..fa11c1b2 --- /dev/null +++ b/src/app/dev/vote/main/kontribusi/page.tsx @@ -0,0 +1,12 @@ +import { Vote_Kontribusi } from "@/app_modules/vote"; +import { Vote_getAllListKontribusiByAuthorId } from "@/app_modules/vote/fun/get/get_list_kontribusi_by_author_id"; + + +export default async function Page() { + const dataKontribusi = await Vote_getAllListKontribusiByAuthorId() + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/main/layout.tsx b/src/app/dev/vote/main/layout.tsx new file mode 100644 index 00000000..6c2e5673 --- /dev/null +++ b/src/app/dev/vote/main/layout.tsx @@ -0,0 +1,14 @@ +import { LayoutVote_Main } from "@/app_modules/vote"; +import React from "react"; + +export default async function Layout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + ); +} diff --git a/src/app/dev/vote/main/riwayat/page.tsx b/src/app/dev/vote/main/riwayat/page.tsx new file mode 100644 index 00000000..76593fd8 --- /dev/null +++ b/src/app/dev/vote/main/riwayat/page.tsx @@ -0,0 +1,17 @@ +import { Vote_Riwayat } from "@/app_modules/vote"; +import { Vote_getAllListRiwayat } from "@/app_modules/vote/fun/get/get_all_list_riwayat"; +import { Vote_getAllListRiwayatSaya } from "@/app_modules/vote/fun/get/get_all_list_riwayat_saya"; + +export default async function Page() { + const listRiwayat = await Vote_getAllListRiwayat(); + const listRiwayatSaya = await Vote_getAllListRiwayatSaya() + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/main/status/page.tsx b/src/app/dev/vote/main/status/page.tsx new file mode 100644 index 00000000..8c612930 --- /dev/null +++ b/src/app/dev/vote/main/status/page.tsx @@ -0,0 +1,21 @@ +import { Vote_Status } from "@/app_modules/vote"; +import { Vote_getListByStatusId } from "@/app_modules/vote/fun/get/get_list_status_by_status_id"; + +export default async function Page() { + const listPublish = await Vote_getListByStatusId("1"); + const listReview = await Vote_getListByStatusId("2"); + const listDraft = await Vote_getListByStatusId("3"); + const listReject = await Vote_getListByStatusId("4"); + + + return ( + <> + + + ); +} diff --git a/src/app/dev/vote/splash/page.tsx b/src/app/dev/vote/splash/page.tsx new file mode 100644 index 00000000..9d5976a3 --- /dev/null +++ b/src/app/dev/vote/splash/page.tsx @@ -0,0 +1,9 @@ +import { Vote_Splash } from "@/app_modules/vote"; + +export default async function Page() { + return ( + <> + + + ); +} diff --git a/src/app/emotion.tsx b/src/app/emotion.tsx index cb3adb61..1215b3ed 100644 --- a/src/app/emotion.tsx +++ b/src/app/emotion.tsx @@ -2,7 +2,7 @@ import AppNotif from "@/app_modules/notif"; // import './globals.css' import { CacheProvider } from "@emotion/react"; -import { MantineProvider, useEmotionCache } from "@mantine/core"; +import { Image, MantineProvider, useEmotionCache } from "@mantine/core"; import { Notifications } from "@mantine/notifications"; import { useServerInsertedHTML } from "next/navigation"; import { ToastContainer, toast } from "react-toastify"; @@ -27,10 +27,13 @@ export default function RootStyleRegistry({ return ( + + HIPMI + - + {children} {/* */} diff --git a/src/app/lib/router_admin/router_admin_event.ts b/src/app/lib/router_admin/router_admin_event.ts new file mode 100644 index 00000000..21daaa87 --- /dev/null +++ b/src/app/lib/router_admin/router_admin_event.ts @@ -0,0 +1,12 @@ +export const RouterAdminEvent = { + main_event: "/dev/admin/event/main", + + // detail + detail_tipe_acara: "/dev/admin/event/child/tipe_acara", + detail_riwayat: "/dev/admin/event/child/riwayat", + + // table + table_review: "/dev/admin/event/table/review", + table_publish: "/dev/admin/event/table/publish", + table_reject: "/dev/admin/event/table/reject", +}; diff --git a/src/app/lib/router_admin/router_admin_vote.ts b/src/app/lib/router_admin/router_admin_vote.ts new file mode 100644 index 00000000..7b90c33f --- /dev/null +++ b/src/app/lib/router_admin/router_admin_vote.ts @@ -0,0 +1,8 @@ +export const RouterAdminVote = { + // main + main: "/dev/admin/vote/main", + table_publish: "/dev/admin/vote/child/table_publish", + table_review: "/dev/admin/vote/child/table_review", + table_reject: "/dev/admin/vote/child/table_reject", + riwayat: "/dev/admin/vote/child/riwayat", +}; diff --git a/src/app/lib/router_hipmi/router_admin.ts b/src/app/lib/router_hipmi/router_admin.ts index 273bf3e0..80747dd1 100644 --- a/src/app/lib/router_hipmi/router_admin.ts +++ b/src/app/lib/router_hipmi/router_admin.ts @@ -15,17 +15,14 @@ export const RouterAdminInvestasi = { }; export const RouterAdminDonasi = { - api_gambar_bukti_transfer: "/api/donasi/gambar_bukti_transfer/", - main_donasi: "/dev/admin/donasi/main", // table table_publish: "/dev/admin/donasi/table/publish", table_review: "/dev/admin/donasi/table/review", table_reject: "/dev/admin/donasi/table/reject", - // detail detail_publish: "/dev/admin/donasi/detail/publish/", detail_review: "/dev/admin/donasi/detail/review/", @@ -33,14 +30,11 @@ export const RouterAdminDonasi = { // proses proses_transaksi: "/dev/admin/donasi/proses_transaksi/", - pencairan_dana :"/dev/admin/donasi/pencairan_dana/", - - - - - + pencairan_dana: "/dev/admin/donasi/pencairan_dana/", }; + + export const RouterAdminAward = { main_award: "/dev/admin/award/main", }; diff --git a/src/app/lib/router_hipmi/router_event.ts b/src/app/lib/router_hipmi/router_event.ts new file mode 100644 index 00000000..833979c2 --- /dev/null +++ b/src/app/lib/router_hipmi/router_event.ts @@ -0,0 +1,29 @@ +export const RouterEvent = { + //main + splash: "/dev/event/splash", + beranda: "/dev/event/main/beranda", + status_page: "/dev/event/main/status_page", + kontribusi: "/dev/event/main/kontribusi", + riwayat: "/dev/event/main/riwayat", + + // status + status_publish: "/dev/event/main/status_page/publish", + status_review: "/dev/event/main/status_page/review", + status_draft: "/dev/event/main/status_page/draft", + status_reject: "/dev/event/main/status_page/reject", + + //create + create: "/dev/event/create", + + // edit + edit: "/dev/event/edit/", + + // detail + detail_main: "/dev/event/detail/main/", + detail_kontribusi: "/dev/event/detail/kontribusi/", + detail_publish: "/dev/event/detail/publish/", + detail_review: "/dev/event/detail/review/", + detail_draft: "/dev/event/detail/draft/", + detail_reject: "/dev/event/detail/reject/", + detail_riwayat: "/dev/event/detail/riwayat/", +}; diff --git a/src/app/lib/router_hipmi/router_vote.ts b/src/app/lib/router_hipmi/router_vote.ts new file mode 100644 index 00000000..9b1e1635 --- /dev/null +++ b/src/app/lib/router_hipmi/router_vote.ts @@ -0,0 +1,24 @@ +export const RouterVote = { + // main + splash: "/dev/vote/splash", + beranda: "/dev/vote/main/beranda", + status: "/dev/vote/main/status", + kontribusi: "/dev/vote/main/kontribusi", + riwayat: "/dev/vote/main/riwayat", + + // create + create: "/dev/vote/create", + + // + edit: "/dev/vote/edit/", + + //detail + main_detail: "/dev/vote/detail/main/", + detail_publish: "/dev/vote/detail/publish/", + detail_review: "/dev/vote/detail/review/", + detail_draft: "/dev/vote/detail/draft/", + detail_reject: "/dev/vote/detail/reject/", + detail_kontribusi: "/dev/vote/detail/kontribusi/", + detail_semua_riwayat: "/dev/vote/detail/semua_riwayat/", + detail_riwayat_saya: "/dev/vote/detail/riwayat_saya/", +}; diff --git a/src/app/makuro/_server/makuro_view.tsx b/src/app/makuro/_server/makuro_view.tsx index 7e222d27..4ff96721 100644 --- a/src/app/makuro/_server/makuro_view.tsx +++ b/src/app/makuro/_server/makuro_view.tsx @@ -1,13 +1,54 @@ -'use client' +"use client"; -import { Button } from "@mantine/core"; +import { Box, Button, Stack, TextInput } from "@mantine/core"; import makuro_test from "./makuro_test"; +import { useState } from "react"; +import _, { forIn } from "lodash"; export default function ViewMakuro() { + const [listnya, setListnya] = useState([ + { + name: "Voting", + value: "", + }, + { name: "Voting", value: "" }, + ]); - return <> + return ( + <> + + {listnya.map((e, k) => ( + + { + const val = _.clone(listnya); + val[k].value = v.currentTarget.value; + setListnya([...val]); + }} + label={e.name} + /> + + ))} + onClick={() => { + // const cek = listnya[listnya.length - 1] + // console.log(cek.id + 1); + + if (listnya.length > 4) return console.log("ga bisa lebih"); + setListnya([...listnya, { name: "Voting", value: "" }]); + }} + > + {" "} + Tambah + + + -} \ No newline at end of file + ); +} diff --git a/src/app_modules/admin/component/header_tamplate.tsx b/src/app_modules/admin/component/header_tamplate.tsx new file mode 100644 index 00000000..211dbc53 --- /dev/null +++ b/src/app_modules/admin/component/header_tamplate.tsx @@ -0,0 +1,14 @@ +"use client"; + +import { Box, Title, Divider, Stack } from "@mantine/core"; + +export default function ComponentAdminGlobal_HeaderTamplate({name}: {name: string}) { + return ( + <> + + {name ? name : null} + + + + ); +} diff --git a/src/app_modules/admin/donasi/global_state/index.ts b/src/app_modules/admin/donasi/global_state/index.ts deleted file mode 100644 index 82788e0b..00000000 --- a/src/app_modules/admin/donasi/global_state/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { atomWithStorage } from "jotai/utils"; - -export const gs_adminDonasi_hotMenu = atomWithStorage("gs_adminDonasi_hotMenu", 0) \ No newline at end of file diff --git a/src/app_modules/admin/event/child/riwayat.tsx b/src/app_modules/admin/event/child/riwayat.tsx new file mode 100644 index 00000000..b0c75959 --- /dev/null +++ b/src/app_modules/admin/event/child/riwayat.tsx @@ -0,0 +1,195 @@ +"use client"; + +import { + Avatar, + Box, + Button, + Center, + Divider, + Grid, + Group, + Loader, + Modal, + Paper, + SimpleGrid, + Spoiler, + Stack, + Table, + Text, + Title, +} from "@mantine/core"; +import ComponentAdminGlobal_HeaderTamplate from "../../component/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 { useState } from "react"; +import { AdminEvent_getListPesertaById } from "../fun/get/get_list_peserta_by_id"; +import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog"; + +export default function AdminEvent_Riwayat({ + listRiwayat, +}: { + listRiwayat: any; +}) { + return ( + <> + + + + + + ); +} + +function DetailRiwayat({ listRiwayat }: { listRiwayat: MODEL_EVENT[] }) { + const [opened, setOpen] = useState(false); + const [peserta, setPeserta] = useState(); + const [eventId, setEventId] = useState(""); + const [loading, setLoading] = useState(false); + + const TableRows = listRiwayat.map((e, i) => ( + + + + + {e.title} + {e.lokasi} + {e.EventMaster_TipeAcara.name} + {e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })} + + {e.tanggal.toLocaleTimeString([], { + hour: "2-digit", + minute: "2-digit", + hour12: false, + })} + + + + {e.deskripsi} + + + + )); + + useShallowEffect(() => { + getAllPeserta(eventId); + }, [eventId]); + + async function getAllPeserta(eventId: string) { + await AdminEvent_getListPesertaById(eventId).then((res: any) => + setPeserta(res) + ); + } + + return ( + <> + setOpen(false)} + size={"md"} + // closeOnClickOutside={false} + withCloseButton={false} + > + + +
+ Daftar Peserta +
+ + {peserta?.map((e) => ( + + + + + + + + {e.User.Profile.name} + + + + + + ))} + +
+
+
+ + + + + RIWAYAT + + + + + + + + + + + + + + + {TableRows} +
+
Aksi
+
+
Judul
+
+
Lokasi
+
Tipe AcaraTanggalJam +
Deskripsi
+
+
+ {_.isEmpty(TableRows) ? ( +
+ Tidak Ada Data +
+ ) : ( + "" + )} +
+
+ + ); +} diff --git a/src/app_modules/admin/event/child/tipe_acara.tsx b/src/app_modules/admin/event/child/tipe_acara.tsx new file mode 100644 index 00000000..78479e1d --- /dev/null +++ b/src/app_modules/admin/event/child/tipe_acara.tsx @@ -0,0 +1,238 @@ +"use client"; + +import { + ActionIcon, + Box, + Button, + Divider, + Group, + List, + Modal, + Paper, + SimpleGrid, + Stack, + Text, + TextInput, + Title, +} from "@mantine/core"; +import ComponentAdminDonasi_TombolKembali from "../../donasi/component/tombol_kembali"; +import ComponentAdminGlobal_HeaderTamplate from "../../component/header_tamplate"; +import { MODEL_DEFAULT_MASTER } 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/component_global/notif_global/notifikasi_peringatan"; +import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil"; +import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_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 { AdminEvent_funEditActivationTipeAcaraById } from "../fun/edit/fun_edit_activation_tipe_acara"; +import { number } from "echarts"; + +export default function AdminEvent_DetailTipeAcara({ + listTipe, +}: { + listTipe: any; +}) { + return ( + <> + + + + + + ); +} + +function DetailTipeAcara({ listTipe }: { listTipe: MODEL_DEFAULT_MASTER[] }) { + const [tipe, setTipe] = useState(listTipe); + const [name, setName] = useState(""); + const [openEditor, setOpenEditor] = useState(false); + const [edit, setEdit] = useState(null); + const [opened, { open, close }] = useDisclosure(false); + const [hapusTipe, setHapusTipe] = useState({ + id: "", + name: "", + }); + + return ( + <> + + + + Anda yakin akan menghapus{" "} + <Text span c={"red"} inherit> + {hapusTipe.name} + </Text>{" "} + ? + + + + + + + + + +
+ + + { + setName(val.target.value); + }} + /> + + + + + +
+ +
+ + + Tipe Acara Yang Tersedia + + {tipe.map((e, i) => ( + + + {e.name} + + { + setOpenEditor(true); + setEdit(e); + }} + > + + {" "} + { + open(); + setHapusTipe({ + ...hapusTipe, + id: e.id, + name: e.name, + }); + }} + > + + + + + + + ))} + + + +
+ +
+ {openEditor ? ( + + + { + setEdit({ + ...(edit as any), + name: val.target.value, + }); + }} + /> + + + + + + + + + ) : ( + "" + )} +
+
+ + ); +} + +async function onSave(name: string, setName: any, setTipe: any) { + if (name === "") + return ComponentGlobal_NotifikasiPeringatan("Isi Tipe Acara"); + + await AdminEvent_funCreateTipeAcara(name).then(async (res) => { + if (res.status === 201) { + await AdminEvent_getListTipeAcara().then((val) => { + setTipe(val); + setName(""); + ComponentGlobal_NotifikasiBerhasil("Berhasil Menyimpan Data"); + }); + } else { + ComponentGlobal_NotifikasiGagal("Gagal Menyimpan Data"); + } + }); +} + +async function onUpdate(id: any, edit: any, setTipe: any, setOpenEditor: any) { + await AdminEvent_funEditTipeAcara(id, edit).then(async (res) => { + if (res.status === 200) { + await AdminEvent_getListTipeAcara().then((val) => { + setTipe(val); + ComponentGlobal_NotifikasiBerhasil(res.message); + setOpenEditor(false); + }); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } + }); +} + +async function onDelete(data: MODEL_DEFAULT_MASTER, close: any, setTipe: any) { + await AdminEvent_funEditActivationTipeAcaraById(data.id as any).then( + async (res) => { + if (res.status === 200) { + const data = await AdminEvent_getListTipeAcara(); + setTipe(data); + ComponentGlobal_NotifikasiBerhasil(res.message); + close(); + } else { + ComponentGlobal_NotifikasiGagal(res.message); + } + } + ); +} diff --git a/src/app_modules/admin/event/fun/count/fun_count_event_by_status_id.ts b/src/app_modules/admin/event/fun/count/fun_count_event_by_status_id.ts new file mode 100644 index 00000000..bcb7c67f --- /dev/null +++ b/src/app_modules/admin/event/fun/count/fun_count_event_by_status_id.ts @@ -0,0 +1,53 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; + +/** + * + * @param statusId | string > 1 - 4 + * @returns jumlah dari donasi per status + */ +export default async function AdminEvent_funCountByStatusId(statusId: string) { + if (statusId === "1") { + const count = await prisma.event.count({ + where: { + eventMaster_StatusId: "1", + tanggal: { + gte: new Date + } + }, + }); + return count; + } + if (statusId === "2") { + const count = await prisma.event.count({ + where: { + eventMaster_StatusId: "2", + }, + }); + return count; + } + if (statusId === "3") { + const count = await prisma.event.count({ + where: { + eventMaster_StatusId: "3", + }, + }); + return count; + } + if (statusId === "4") { + const count = await prisma.event.count({ + where: { + eventMaster_StatusId: "4", + }, + }); + return count; + } + if (statusId === undefined || statusId === null) { + + return { + status: 400, + message: "Parameter tidak sesuai" + } + } +} diff --git a/src/app_modules/admin/event/fun/count/fun_count_riwayat.ts b/src/app_modules/admin/event/fun/count/fun_count_riwayat.ts new file mode 100644 index 00000000..58ec852b --- /dev/null +++ b/src/app_modules/admin/event/fun/count/fun_count_riwayat.ts @@ -0,0 +1,16 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; + +export async function AdminEvent_funCountRiwayat() { + const data = await prisma.event.count({ + where: { + eventMaster_StatusId: "1", + tanggal: { + lte: new Date(), + }, + }, + }); + + return data; +} diff --git a/src/app_modules/admin/event/fun/count/fun_count_tipe_acara.ts b/src/app_modules/admin/event/fun/count/fun_count_tipe_acara.ts new file mode 100644 index 00000000..590dcb98 --- /dev/null +++ b/src/app_modules/admin/event/fun/count/fun_count_tipe_acara.ts @@ -0,0 +1,8 @@ +"use server" + +import prisma from "@/app/lib/prisma" + +export async function AdminEvent_funCountTipeAcara() { + const data = await prisma.eventMaster_TipeAcara.count({}) + return data +} \ No newline at end of file diff --git a/src/app_modules/admin/event/fun/create/fun_create_tipe_acara.ts b/src/app_modules/admin/event/fun/create/fun_create_tipe_acara.ts new file mode 100644 index 00000000..126d10e8 --- /dev/null +++ b/src/app_modules/admin/event/fun/create/fun_create_tipe_acara.ts @@ -0,0 +1,26 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; +import { revalidatePath } from "next/cache"; + +export async function AdminEvent_funCreateTipeAcara(name: string) { + const dataAwal = await prisma.eventMaster_TipeAcara.findFirst({ + orderBy: { + id: "desc", + }, + }); + + const res = await prisma.eventMaster_TipeAcara.create({ + data: { + id: Number(dataAwal?.id) + 1, + name: name, + }, + }); + + if (!res) return { status: 400, message: "Gagal Menambahkan" }; + revalidatePath("/dev/admin/event/detail/tipe_acara"); + return { + status: 201, + message: "Berhasil Menambahkan", + }; +} diff --git a/src/app_modules/admin/event/fun/edit/fun_edit_activation_tipe_acara.ts b/src/app_modules/admin/event/fun/edit/fun_edit_activation_tipe_acara.ts new file mode 100644 index 00000000..86980a97 --- /dev/null +++ b/src/app_modules/admin/event/fun/edit/fun_edit_activation_tipe_acara.ts @@ -0,0 +1,22 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; +import { revalidatePath } from "next/cache"; + +export async function AdminEvent_funEditActivationTipeAcaraById(id: number) { + const updt = await prisma.eventMaster_TipeAcara.update({ + where: { + id: id, + }, + data: { + active: false, + }, + }); + + if(!updt) return {status: 400, message: "Gagal Update"} + revalidatePath("/dev/admin/event/child/tipe_acara"); + return { + status: 200, + message: "Update Berhasil" + } +} diff --git a/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts b/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts new file mode 100644 index 00000000..05e8baab --- /dev/null +++ b/src/app_modules/admin/event/fun/edit/fun_edit_status_publish_by_id.ts @@ -0,0 +1,26 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; +import { revalidatePath } from "next/cache"; + +export async function AdminEvent_funEditStatusPublishById( + eventId: string, + statusId: string +) { + console.log(eventId); + const updt = await prisma.event.update({ + where: { + id: eventId, + }, + data: { + eventMaster_StatusId: statusId, + }, + }); + + if (!updt) return { status: 400, message: "Update Gagal" }; + revalidatePath("/dev/admin/event/main"); + return { + status: 200, + message: "Berhasil Update Status", + }; +} diff --git a/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts b/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts new file mode 100644 index 00000000..ba8603c8 --- /dev/null +++ b/src/app_modules/admin/event/fun/edit/fun_edit_status_reject_by_id.ts @@ -0,0 +1,27 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; +import { MODEL_EVENT } from "@/app_modules/event/model/interface"; +import { revalidatePath } from "next/cache"; + +export async function AdminEvent_funEditCatatanById( + data: MODEL_EVENT, + statudId: string +) { + const updt = await prisma.event.update({ + where: { + id: data.id, + }, + data: { + eventMaster_StatusId: statudId, + catatan: data.catatan + }, + }); + + if (!updt) return { status: 400, message: "Update Gagal" }; + revalidatePath("/dev/admin/event/main"); + return { + status: 200, + message: "Berhasil Update Status", + }; +} diff --git a/src/app_modules/admin/event/fun/edit/fun_edit_tipe_acara.ts b/src/app_modules/admin/event/fun/edit/fun_edit_tipe_acara.ts new file mode 100644 index 00000000..7152f41c --- /dev/null +++ b/src/app_modules/admin/event/fun/edit/fun_edit_tipe_acara.ts @@ -0,0 +1,22 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; +import { revalidatePath } from "next/cache"; + +export async function AdminEvent_funEditTipeAcara(id: number, name: string) { + const updt = await prisma.eventMaster_TipeAcara.update({ + where: { + id: id, + }, + data: { + name: name, + }, + }); + + if(!updt) return {status: 400, message: "Gagal Update"} + revalidatePath("/dev/admin/event/detail/tipe_acara") + return { + status: 200, + message: "Update Berhasil" + } +} diff --git a/src/app_modules/admin/event/fun/get/get_list_all_riwayat.ts b/src/app_modules/admin/event/fun/get/get_list_all_riwayat.ts new file mode 100644 index 00000000..c2bfa4cc --- /dev/null +++ b/src/app_modules/admin/event/fun/get/get_list_all_riwayat.ts @@ -0,0 +1,45 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; +import _ from "lodash"; + +export async function AdminEvent_getListAllRiwayat() { + const data = await prisma.event.findMany({ + orderBy: { + tanggal: "desc", + }, + where: { + eventMaster_StatusId: "1", + tanggal: { + lte: new Date(), + }, + }, + select: { + id: true, + title: true, + lokasi: true, + tanggal: true, + deskripsi: true, + Author: { + select: { + id: true, + username: true, + Profile: { + select: { + name: true, + }, + }, + }, + }, + EventMaster_TipeAcara: { + select: { + id: true, + name: true, + }, + }, + }, + + }); + + return data; +} diff --git a/src/app_modules/admin/event/fun/get/get_list_peserta_by_id.ts b/src/app_modules/admin/event/fun/get/get_list_peserta_by_id.ts new file mode 100644 index 00000000..2b286cba --- /dev/null +++ b/src/app_modules/admin/event/fun/get/get_list_peserta_by_id.ts @@ -0,0 +1,21 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; + +export async function AdminEvent_getListPesertaById(eventId: string) { + const data = await prisma.event_Peserta.findMany({ + where: { + eventId: eventId, + }, + select: { + id: true, + User: { + select: { + Profile: true, + }, + }, + }, + }); + + return data; +} diff --git a/src/app_modules/admin/event/fun/get/get_list_table_by_status_id.ts b/src/app_modules/admin/event/fun/get/get_list_table_by_status_id.ts new file mode 100644 index 00000000..5e04a9a6 --- /dev/null +++ b/src/app_modules/admin/event/fun/get/get_list_table_by_status_id.ts @@ -0,0 +1,146 @@ +"use server"; + +import prisma from "@/app/lib/prisma"; + +export async function AdminEvent_getListTableByStatusId(statudId: string) { + if (statudId === "1") { + const getPublish = await prisma.event.findMany({ + orderBy: { + tanggal: "desc", + }, + where: { + eventMaster_StatusId: "1", + tanggal: { + gte: new Date + } + + }, + select: { + id: true, + title: true, + lokasi: true, + tanggal: true, + deskripsi: true, + Author: { + select: { + id: true, + username: true, + Profile: { + select: { + name: true, + }, + }, + }, + }, + EventMaster_Status: { + select: { + id: true, + name: true, + }, + }, + EventMaster_TipeAcara: { + select: { + id: true, + name: true, + }, + }, + Event_Peserta: true, + }, + }); + return getPublish; + } + if (statudId === "2") { + const getReview = await prisma.event.findMany({ + orderBy: { + createdAt: "desc", + }, + where: { + eventMaster_StatusId: "2", + }, + select: { + id: true, + title: true, + lokasi: true, + tanggal: true, + deskripsi: true, + Author: { + select: { + id: true, + username: true, + Profile: { + select: { + name: true, + }, + }, + }, + }, + EventMaster_Status: { + select: { + id: true, + name: true, + }, + }, + EventMaster_TipeAcara: { + select: { + id: true, + name: true, + }, + }, + }, + }); + return getReview; + } + if (statudId === "3") { + const getDraft = await prisma.event.findMany({ + orderBy: { + updatedAt: "desc", + }, + where: { + eventMaster_StatusId: "3", + }, + }); + return getDraft; + } + if (statudId === "4") { + const getReject = await prisma.event.findMany({ + orderBy: { + updatedAt: "desc", + }, + where: { + eventMaster_StatusId: "4", + }, + select: { + id: true, + title: true, + lokasi: true, + tanggal: true, + deskripsi: true, + Author: { + select: { + id: true, + username: true, + Profile: { + select: { + name: true, + }, + }, + }, + }, + EventMaster_Status: { + select: { + id: true, + name: true, + }, + }, + EventMaster_TipeAcara: { + select: { + id: true, + name: true, + }, + }, + catatan: true, + }, + }); + return getReject; + } +} diff --git a/src/app_modules/admin/event/fun/get/get_list_tipe_acara.ts b/src/app_modules/admin/event/fun/get/get_list_tipe_acara.ts new file mode 100644 index 00000000..9f2ead65 --- /dev/null +++ b/src/app_modules/admin/event/fun/get/get_list_tipe_acara.ts @@ -0,0 +1,15 @@ +"use server" + +import prisma from "@/app/lib/prisma" + +export async function AdminEvent_getListTipeAcara(){ + const data = await prisma.eventMaster_TipeAcara.findMany({ + orderBy:{ + id: "asc" + }, + where: { + active: true + } + }) + return data +} \ No newline at end of file diff --git a/src/app_modules/admin/event/index.tsx b/src/app_modules/admin/event/index.tsx new file mode 100644 index 00000000..ae139303 --- /dev/null +++ b/src/app_modules/admin/event/index.tsx @@ -0,0 +1,15 @@ +import AdminEvent_Main from "./main"; +import AdminEvent_TableReview from "./table_status/table_review"; +import AdminEvent_TablePublish from "./table_status/table_publish"; +import AdminEvent_TableReject from "./table_status/table_reject"; +import AdminEvent_DetailTipeAcara from "./child/tipe_acara"; +import AdminEvent_Riwayat from "./child/riwayat"; + +export { + AdminEvent_Main, + AdminEvent_TableReview, + AdminEvent_TablePublish, + AdminEvent_TableReject, + AdminEvent_DetailTipeAcara, + AdminEvent_Riwayat, +}; diff --git a/src/app_modules/admin/event/main/index.tsx b/src/app_modules/admin/event/main/index.tsx new file mode 100644 index 00000000..e58afff2 --- /dev/null +++ b/src/app_modules/admin/event/main/index.tsx @@ -0,0 +1,148 @@ +"use client"; + +import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event"; + +import { + Stack, + Title, + Divider, + SimpleGrid, + Paper, + Center, + Text, + Box, + Group, + ActionIcon, +} from "@mantine/core"; +import { IconChevronsRight } from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; +import ComponentAdminGlobal_HeaderTamplate from "../../component/header_tamplate"; + +export default function AdminEvent_Main({ + countPublish, + countReview, + countDraft, + countReject, + countTipeAcara, + countRiwayat, +}: { + countPublish: number; + countReview: number; + countDraft: number; + countReject: number; + countTipeAcara: number; + countRiwayat: number +}) { + const router = useRouter(); + + const listStatus = [ + { + id: 1, + name: "Publish", + jumlah: countPublish, + path: RouterAdminEvent.table_publish, + color: "green", + }, + { + id: 2, + name: "Review", + jumlah: countReview, + path: RouterAdminEvent.table_review, + color: "orange", + }, + { + id: 3, + name: "Draft", + jumlah: countDraft, + path: "", + color: "yellow", + }, + { + id: 4, + name: "Reject", + jumlah: countReject, + path: RouterAdminEvent.table_reject, + color: "red", + }, + ]; + + const listBox2 = [ + { + id: 1, + name: "Riwayat Event", + jumlah: countRiwayat, + path: RouterAdminEvent.table_publish, + color: "gray", + }, + { + id: 2, + name: "Tipe Acara", + jumlah: countTipeAcara, + path: RouterAdminEvent.table_publish, + color: "gray", + }, + ]; + + return ( + <> + + + + + {listStatus.map((e, i) => ( + + + + {e.name} + {e.jumlah} + + + + ))} + + + {listBox2.map((e, i) => ( + + + + {e.name} + {e.jumlah} + + + + ))} + + + + ); +} diff --git a/src/app_modules/admin/event/table_status/table_publish.tsx b/src/app_modules/admin/event/table_status/table_publish.tsx new file mode 100644 index 00000000..0f43fd3d --- /dev/null +++ b/src/app_modules/admin/event/table_status/table_publish.tsx @@ -0,0 +1,194 @@ +"use client"; + +import { RouterAdminDonasi } from "@/app/lib/router_hipmi/router_admin"; +import { + ActionIcon, + Avatar, + Box, + Button, + Center, + Divider, + Grid, + Group, + Modal, + Paper, + Spoiler, + Stack, + Table, + Text, + Title, +} from "@mantine/core"; +import { + IconBan, + IconChevronLeft, + IconEyeCheck, + IconEyeShare, + IconShare, +} from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; + +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, + MODEL_EVENT_PESERTA, +} from "@/app_modules/event/model/interface"; +import ComponentAdminGlobal_HeaderTamplate from "../../component/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/component_global/notif_global/notifikasi_berhasil"; +import { AdminEvent_getListTableByStatusId } from "../fun/get/get_list_table_by_status_id"; +import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal"; +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({ + listPublish, +}: { + listPublish: MODEL_EVENT[]; +}) { + return ( + <> + + + + + + ); +} + +function TableStatus({ listPublish }: { listPublish: MODEL_EVENT[] }) { + const router = useRouter(); + const [opened, { open, close }] = useDisclosure(false); + const [data, setData] = useState(listPublish); + const [peserta, setPeserta] = useState(); + const [eventId, setEventId] = useState(""); + const [loading, setLoading] = useState(false); + + const TableRows = data.map((e, i) => ( + + {e.title} + {e.lokasi} + {e.EventMaster_TipeAcara.name} + {e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })} + + {e.tanggal.toLocaleTimeString([], { + hour: "2-digit", + minute: "2-digit", + hour12: false, + })} + + + + {e.deskripsi} + + + + + + + + )); + + return ( + <> + + + +
+ Daftar Peserta +
+ + {peserta?.map((e) => ( + + + + + + + + {e.User.Profile.name} + + + + + + ))} + +
+
+
+ + + + PUBLISH + + + + + + + + + + + + + + + + {TableRows} +
JudulLokasiTipe AcaraTanggalJam +
Deskripsi
+
+
Aksi
+
+
+ {_.isEmpty(TableRows) ? ( +
+ Tidak Ada Data +
+ ) : ( + "" + )} +
+
+ + ); +} diff --git a/src/app_modules/admin/event/table_status/table_reject.tsx b/src/app_modules/admin/event/table_status/table_reject.tsx new file mode 100644 index 00000000..67004ccb --- /dev/null +++ b/src/app_modules/admin/event/table_status/table_reject.tsx @@ -0,0 +1,239 @@ +"use client"; + +import { RouterAdminDonasi } from "@/app/lib/router_hipmi/router_admin"; +import { + ActionIcon, + Box, + Button, + Center, + Flex, + Group, + Modal, + ScrollArea, + Spoiler, + Stack, + Table, + Text, + Textarea, + Title, +} from "@mantine/core"; +import { + IconBan, + IconChevronLeft, + IconEyeCheck, + IconEyeShare, + IconPencilPlus, + IconShare, +} from "@tabler/icons-react"; +import { useRouter } from "next/navigation"; + +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 "../../component/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/component_global/notif_global/notifikasi_berhasil"; +import { AdminEvent_getListTableByStatusId } from "../fun/get/get_list_table_by_status_id"; +import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal"; +import { AdminEvent_funEditCatatanById } from "../fun/edit/fun_edit_status_reject_by_id"; +import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan"; + +export default function AdminEvent_TableReject({ + listReject, +}: { + listReject: MODEL_EVENT[]; +}) { + return ( + <> + + + + + + ); +} + +function TableStatus({ listReject }: { listReject: MODEL_EVENT[] }) { + const router = useRouter(); + const [opened, { open, close }] = useDisclosure(false); + const [data, setData] = useState(listReject); + const [eventId, setEventId] = useState(""); + const [catatan, setCatatan] = useState(""); + + const TableRows = data.map((e, i) => ( + + + {e.Author.Profile.name} + + + {e.title} + + + {e.lokasi} + + + {e.EventMaster_TipeAcara.name} + + + + {e.tanggal.toLocaleString("id-ID", { dateStyle: "full" })} + + + + + {e.tanggal.toLocaleTimeString([], { + hour: "2-digit", + minute: "2-digit", + hour12: false, + })} + + + + + + {e.deskripsi} + + + + + {" "} + + + {e.catatan} + + + + + + + + + )); + + return ( + <> + + +