+ As COVID-19 situation evolves, make sure the cancellation policy suits your needs.
+ In reference to the circular letter by the government regarding the spread control of Covid-19, please ensure that you are aware of your booking's refund, cancellation, and reschedule policy.
+
+
+
+
+
+
+
+
+ >
+ )
+}
+
+export default Checkout;
\ No newline at end of file
diff --git a/components/Booking/review.js b/components/Booking/review.js
new file mode 100644
index 0000000..f67bd1e
--- /dev/null
+++ b/components/Booking/review.js
@@ -0,0 +1,154 @@
+import React, { useState } from 'react';
+import * as Icon from 'react-feather';
+
+const Checkout = () => {
+ return (
+ <>
+
+
+
+
+
+
Mohon Periksa Ulang Pesanan Anda
+
+
+
+
+
+
+
+ >
+ )
+}
+
+export default Checkout;
\ No newline at end of file
diff --git a/components/Home/MainBanner.js b/components/Home/MainBanner.js
index 3984c1d..6eb0067 100644
--- a/components/Home/MainBanner.js
+++ b/components/Home/MainBanner.js
@@ -2,7 +2,33 @@ import React from 'react';
import Link from 'next/link';
import * as Icon from 'react-feather';
-const MainBanner = () => {
+import NumberFormat from 'react-number-format';
+
+const MainBanner = function ({ backend, kamar, ...props }) {
+ const kamarContent = kamar.map((data) => {
+ return (
+
+ {kamarContent}
diff --git a/package.json b/package.json
index 74f8c62..13ebb78 100644
--- a/package.json
+++ b/package.json
@@ -10,12 +10,15 @@
},
"author": "EnvyTheme.com",
"dependencies": {
+ "@apollo/client": "^3.3.11",
"@emotion/react": "^11.6.0",
"@emotion/styled": "^11.6.0",
"@mui/material": "^5.1.1",
"animate.css": "^4.1.1",
"axios": "^0.21.1",
+ "cross-fetch": "^3.1.4",
"dotenv": "^10.0.0",
+ "graphql": "^16.0.1",
"next": "^10.0.7",
"nodemailer": "^6.5.0",
"nodemailer-sendgrid-transport": "^0.2.0",
@@ -26,6 +29,7 @@
"react-hook-form": "^6.15.4",
"react-icons": "^4.3.1",
"react-masonry-component": "^6.2.1",
+ "react-number-format": "^4.8.0",
"react-owl-carousel3": "^2.2.5",
"react-redux": "^7.1.0",
"react-slick": "^0.28.0",
@@ -35,6 +39,7 @@
"redux": "^3.6.0",
"redux-devtools-extension": "^2.13.2",
"sass": "^1.32.7",
+ "sweetalert": "^2.1.2",
"sweetalert2": "^10.15.5",
"sweetalert2-react-content": "^3.3.1"
},
diff --git a/pages/api/Booking/CreateBooking.js b/pages/api/Booking/CreateBooking.js
new file mode 100644
index 0000000..5f1e82c
--- /dev/null
+++ b/pages/api/Booking/CreateBooking.js
@@ -0,0 +1,7 @@
+import Booking from "api/Booking/booking";
+
+export default async function handler(req, resp) {
+ var input = req.body;
+ var res = await Booking.AddBooking(input);
+ resp.status(200).json(res);
+}
\ No newline at end of file
diff --git a/pages/checkout.js b/pages/checkout.js
index 73f0314..6f101eb 100644
--- a/pages/checkout.js
+++ b/pages/checkout.js
@@ -1,223 +1,36 @@
import React, { useState } from 'react';
import Navbar from "@/components/_App/NavbarHome";
import Footer from "@/components/_App/Footer";
-import PageBanner from '@/components/Common/PageBanner';
+import CheckoutContent from "@/components/Booking/checkout";
import * as Icon from 'react-feather';
-const Checkout = () => {
+import GetCheckoutItem from "api/Kamar/kamar";
+
+const Checkout = function ({ backend, checkoutItem, ...props }) {
return (
<>
-
-
-
-
-
-
Important Notice
-
- As COVID-19 situation evolves, make sure the cancellation policy suits your needs.
- In reference to the circular letter by the government regarding the spread control of Covid-19, please ensure that you are aware of your booking's refund, cancellation, and reschedule policy.
-
-
-
-
-
-
-
-
+
>
)
}
-export default Checkout;
\ No newline at end of file
+export default Checkout;
+
+export async function getServerSideProps(context) {
+ var {query} = context;
+ var checkoutItem = [];
+ const backend = process.env.BACKEND_SERVER_URI;
+
+ var res = await GetCheckoutItem.GetDetailKamar(query.s||0);
+ if (res["STATUS"] === 1) {
+ checkoutItem = res["DATA"]["jenisKamars"];
+ }
+
+ return {
+ props: { checkoutItem, backend }, // will be passed to the page component as props
+ };
+}
\ No newline at end of file
diff --git a/pages/index.js b/pages/index.js
index dd21543..0d0ee8c 100644
--- a/pages/index.js
+++ b/pages/index.js
@@ -6,12 +6,14 @@ import Facilities from "@/components/Home/Facilities";
import PromoCarousel from "@/components/Home/PromoCarousel";
import Footer from "@/components/_App/Footer";
-const Index = () => {
+import GetKamar from "api/Kamar/kamar.js"
+
+const Index = function ({ backend, kamar, ...props }) {
return (
<>
{/* */}
-
+
@@ -19,4 +21,33 @@ const Index = () => {
)
}
-export default Index;
\ No newline at end of file
+export default Index;
+
+export async function getServerSideProps() {
+ var kamar = [];
+ const backend = process.env.BACKEND_SERVER_URI;
+
+ // var { req, resp } = context;
+ // const cookies = new Cookies(req, resp);
+ // var user = "";
+ // var userObj = (await cookies.get("user"))
+ // ? JSON.parse(await cookies.get("user"))
+ // : null;
+ // if (userObj) {
+ // let sessionId = userObj["partners_login_states"].filter(function (i) {
+ // return (
+ // i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA"
+ // );
+ // });
+ // if (sessionId.length != 0) user = userObj["username"];
+ // }
+
+ var res = await GetKamar.GetKamar();
+ if (res["STATUS"] === 1) {
+ kamar = res["DATA"]["jenisKamars"];
+ }
+
+ return {
+ props: { kamar, backend }, // will be passed to the page component as props
+ };
+}
\ No newline at end of file
diff --git a/pages/review.js b/pages/review.js
index 02406c3..035dfb1 100644
--- a/pages/review.js
+++ b/pages/review.js
@@ -1,157 +1,14 @@
import React, { useState } from 'react';
import Navbar from "@/components/_App/NavbarHome";
import Footer from "@/components/_App/Footer";
-import PageBanner from '@/components/Common/PageBanner';
-import * as Icon from 'react-feather';
+import ReviewContent from '@/components/Booking/review';
const Checkout = () => {
return (
<>