Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
sujata
/
advithconsulting.io-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit fba5ef14
authored
2025-10-29 12:37:55 +0530
by
Aman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
annual-reports page added
1 parent
4253a47a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
199 additions
and
31 deletions
components/reuseables/CallBackRequest.js
container/Contact/ContactForm.js
layout/Footer.js
pages/annual-reports.js
pages/api/submitZoho.js
components/reuseables/CallBackRequest.js
View file @
fba5ef1
...
@@ -61,37 +61,11 @@ const CallBackRequest = () => {
...
@@ -61,37 +61,11 @@ const CallBackRequest = () => {
console
.
error
(
error
);
console
.
error
(
error
);
}
}
await
fetch
(
"/api/submitZoho"
,
{
// zoho form
method
:
"POST"
,
headers
:
{
"Content-Type"
:
"application/json"
},
// try {
body
:
JSON
.
stringify
(
leadData
),
// const zohoFormUrl =
});
// "https://forms.zohopublic.in/services10/form/ContactUs/formperma/bJVh0UBQ6gjwfELMYAzkqMf5pfIyed3eJcjfSaEXmVg/htmlRecords/submit";
// const zohoForm = new FormData();
// zohoForm.append("zf_referrer_name", ""); // optional
// zohoForm.append("zf_redirect_url", ""); // optional
// zohoForm.append("zc_gad", ""); // optional
// zohoForm.append("Name_First", data.Name || "");
// zohoForm.append("Name_Last", "text"); // optional
// zohoForm.append("Email", data.Email || "");
// zohoForm.append("SingleLine", data.service || "");
// zohoForm.append("SingleLine1", data.Mobile || "");
// zohoForm.append("MultiLine", "text");
// zohoForm.append("SingleLine1", data.Mobile || "");
// await fetch(zohoFormUrl, {
// method: "POST",
// body: zohoForm,
// });
// console.log("✅ Submitted to Zoho Form");
// } catch (error) {
// console.error("❌ Zoho submission failed:", error);
// }
try
{
try
{
const
response
=
await
axios
.
post
(
"/api/homegooglesheet"
,
leadData
,
{
const
response
=
await
axios
.
post
(
"/api/homegooglesheet"
,
leadData
,
{
...
...
container/Contact/ContactForm.js
View file @
fba5ef1
...
@@ -43,6 +43,8 @@ const ContactForm = () => {
...
@@ -43,6 +43,8 @@ const ContactForm = () => {
},
},
};
};
console
.
log
(
"strapiData"
,
strapiData
);
console
.
log
(
"strapiData"
,
strapiData
);
finaldata
.
append
(
"data"
,
JSON
.
stringify
(
strapiData
));
finaldata
.
append
(
"data"
,
JSON
.
stringify
(
strapiData
));
...
@@ -56,6 +58,14 @@ const ContactForm = () => {
...
@@ -56,6 +58,14 @@ const ContactForm = () => {
},
},
};
};
await
fetch
(
"/api/submitZoho"
,
{
method
:
"POST"
,
headers
:
{
"Content-Type"
:
"application/json"
},
body
:
JSON
.
stringify
(
leadData
),
});
try
{
try
{
const
response
=
await
axios
.
post
(
const
response
=
await
axios
.
post
(
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/contact-forms`
,
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/contact-forms`
,
...
@@ -86,6 +96,7 @@ const ContactForm = () => {
...
@@ -86,6 +96,7 @@ const ContactForm = () => {
error
.
response
?
error
.
response
.
data
:
error
.
message
error
.
response
?
error
.
response
.
data
:
error
.
message
);
);
}
}
const
sendEmaill
=
(
data
)
=>
{
const
sendEmaill
=
(
data
)
=>
{
fetch
(
"/api/sendEmail"
,
{
fetch
(
"/api/sendEmail"
,
{
...
...
layout/Footer.js
View file @
fba5ef1
...
@@ -49,6 +49,9 @@ const Footer = () => {
...
@@ -49,6 +49,9 @@ const Footer = () => {
<
li
>
<
li
>
<
Link
href
=
"/contact"
>
Contact
Us
<
/Link
>
<
Link
href
=
"/contact"
>
Contact
Us
<
/Link
>
<
/li
>
<
/li
>
<
li
>
<
Link
href
=
"/annual-reports"
>
Annual
Reports
<
/Link
>
<
/li
>
<
/ul
>
<
/ul
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
pages/annual-reports.js
0 → 100644
View file @
fba5ef1
import
React
from
"react"
;
import
PageBanner
from
"@/components/reuseables/PageBanner"
;
import
{
cleanImage
}
from
"@/layout/imageHandling"
;
import
axios
from
"axios"
;
import
qs
from
"qs"
;
import
Seo
from
"@/components/reuseables/Seo/Seo"
;
import
Heading
from
"@/components/reuseables/Heading"
;
export
default
function
Contact
({
Contactpage
,
conversionData
})
{
console
.
log
(
"conatct"
,
Contactpage
);
console
.
log
({
Contactpage
});
const
banners
=
[
{
imageSrc
:
cleanImage
(
Contactpage
?.
Banner
?.
Image
?.
url
),
pageTitle
:
Contactpage
?.
Banner
?.
Heading
,
homePageUrl
:
"/"
,
homePageText
:
"Home"
,
activePageText
:
Contactpage
?.
Banner
?.
Heading
,
},
];
const
seo
=
Contactpage
?.
seo
;
const
Listing
=
Contactpage
.
Listing
;
console
.
log
({
Listing
});
return
(
<>
<
Seo
seo
=
{
seo
}
/
>
<
PageBanner
banners
=
{
banners
}
/
>
<
div
className
=
"container py-5"
>
{
Listing
.
map
((
item
,
index
)
=>
(
<
div
key
=
{
item
.
id
}
className
=
{
`card mb-3 border-0
${
index
!==
Listing
.
length
-
1
?
"border-bottom pb-2"
:
""
}
`}
style={{
borderBottomColor: "#dee2e6", // Bootstrap default border color
borderBottomWidth: index !== Listing.length - 1 ? "1px" : "0",
borderBottomStyle: "solid",
}}
>
<div className="card-body">
<div className="mb-4">
<Heading el="h2" heading={item.Title} />
</div>
{/* GRID layout */}
<div className="row">
{item.category.map((cat) => (
<div key={cat.id} className="col-12 col-md-4 mb-3">
<a
href={cleanImage(cat?.img?.url)}
download
target="_blank"
rel="noopener noreferrer"
className="text-decoration-underline d-flex gap-2 text-dark"
style={{ cursor: "pointer" }}
>
<p>{cat.name}</p> <span className="text-danger">(PDF)</span>
</a>
</div>
))}
</div>
</div>
</div>
))}
</div>
</>
);
}
export async function getServerSideProps() {
try {
const query1 = {
populate: [
"Banner.Image",
"seo",
"seo.metaImage",
"seo.schema",
"Listing",
"Listing.category",
"Listing.category.img",
],
};
const query2 = {
populate: ["conversion"],
};
const query1String = qs.stringify(query1, {
encodeValuesOnly: true,
});
const query12String = qs.stringify(query2, {
encodeValuesOnly: true,
});
const endpoint1 = `
$
{
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/annual-reports?
${
query1String
}
`
;
const
endpoint2
=
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/google-manger?
${
query12String
}
`
;
// console.log(`Final url: ${endpoint1}`);
const
[
response1
,
response2
]
=
await
Promise
.
all
([
axios
.
get
(
endpoint1
),
axios
.
get
(
endpoint2
),
]);
const
Contactpage
=
response1
.
data
.
data
;
const
conversionData
=
response2
.
data
.
data
;
return
{
props
:
{
Contactpage
,
conversionData
},
};
}
catch
(
error
)
{
console
.
log
(
"Error"
,
error
);
}
}
pages/api/submitZoho.js
0 → 100644
View file @
fba5ef1
export
default
async
function
handler
(
req
,
res
)
{
if
(
req
.
method
!==
"POST"
)
{
return
res
.
status
(
405
).
json
({
error
:
"Method not allowed"
});
}
try
{
const
zohoFormUrl
=
"https://forms.zohopublic.in/services10/form/ContactUs/formperma/bJVh0UBQ6gjwfELMYAzkqMf5pfIyed3eJcjfSaEXmVg/htmlRecords/submit"
;
// Ensure values exist
const
{
name
=
""
,
email
=
""
,
mobilenumber
=
""
,
service
=
""
,
// AdditionalMessage = "-",
message
=
"-"
,
}
=
req
.
body
||
{};
console
.
log
(
req
.
body
);
// Build form data (URL encoded, required by Zoho)
const
formData
=
new
URLSearchParams
();
formData
.
append
(
"zf_referrer_name"
,
"Website Contact Form"
);
formData
.
append
(
"zf_redirect_url"
,
""
);
// leave blank if no redirect
formData
.
append
(
"zc_gad"
,
""
);
formData
.
append
(
"Name_First"
,
name
);
formData
.
append
(
"Name_Last"
,
"-"
);
formData
.
append
(
"Email"
,
email
);
formData
.
append
(
"SingleLine"
,
service
);
formData
.
append
(
"SingleLine1"
,
mobilenumber
);
formData
.
append
(
"MultiLine"
,
message
);
const
zohoResponse
=
await
fetch
(
zohoFormUrl
,
{
method
:
"POST"
,
headers
:
{
"Content-Type"
:
"application/x-www-form-urlencoded"
,
},
body
:
formData
.
toString
(),
redirect
:
"manual"
,
// prevents auto-following 302
});
// Zoho usually replies 302 (redirect), we treat that as success
if
(
zohoResponse
.
status
===
200
||
zohoResponse
.
status
===
302
)
{
return
res
.
status
(
200
)
.
json
({
success
:
true
,
status
:
zohoResponse
.
status
});
}
else
{
const
text
=
await
zohoResponse
.
text
();
console
.
error
(
"Zoho response not OK:"
,
zohoResponse
.
status
,
text
);
return
res
.
status
(
zohoResponse
.
status
).
json
({
success
:
false
,
status
:
zohoResponse
.
status
,
message
:
text
,
});
}
}
catch
(
error
)
{
console
.
error
(
"Zoho submission error:"
,
error
);
return
res
.
status
(
500
).
json
({
success
:
false
,
error
:
error
.
message
});
}
}
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment