diff --git a/src/App.js b/src/App.js
index 70a19f2..bd10e63 100644
--- a/src/App.js
+++ b/src/App.js
@@ -6,14 +6,10 @@ import Submittedform from "./Pages/Client/NewMember/Submittedform";
import Submittedpayment from "./Pages/Client/NewMember/Submittedpayment";
import Login from "./Pages/Client/ExistingMember/Login";
-import AdminGC from "./Pages/Admin/AdminGC";
-import AdminAO from "./Pages/Admin/AdminAO";
-import AdminCEO from "./Pages/Admin/AdminCEO";
-import AdminOB from "./Pages/Admin/AdminOB";
-import AdminMC from "./Pages/Admin/AdminMC";
-
import Home from "./Pages/Admin/Home";
import Analysis from "./Pages/Admin/Analysis";
+import LoginAdmin from "./Pages/Admin/LoginAdmin";
+import Allmembers from "./Pages/Admin/Allmembers";
function App() {
return (
@@ -30,13 +26,9 @@ function App() {
{/* Admin */}
- } />
- } />
- } />
- } />
- } />
- } />
-
+ } />
+ } />
+ } />
} />
diff --git a/src/Components/ATable.jsx b/src/Components/ATable.jsx
new file mode 100644
index 0000000..b161890
--- /dev/null
+++ b/src/Components/ATable.jsx
@@ -0,0 +1,9 @@
+import React from 'react'
+
+const ATable = () => {
+ return (
+
ATable
+ )
+}
+
+export default ATable
\ No newline at end of file
diff --git a/src/Components/BTable.jsx b/src/Components/BTable.jsx
new file mode 100644
index 0000000..30c3cd4
--- /dev/null
+++ b/src/Components/BTable.jsx
@@ -0,0 +1,7 @@
+import React from "react";
+
+const BTable = () => {
+ return BTable
;
+};
+
+export default BTable;
diff --git a/src/Components/CTable.jsx b/src/Components/CTable.jsx
new file mode 100644
index 0000000..1a6ae69
--- /dev/null
+++ b/src/Components/CTable.jsx
@@ -0,0 +1,7 @@
+import React from "react";
+
+const CTable = () => {
+ return CTable
;
+};
+
+export default CTable;
diff --git a/src/Pages/Admin/AdminAO.jsx b/src/Pages/Admin/AdminAO.jsx
deleted file mode 100644
index cafdc24..0000000
--- a/src/Pages/Admin/AdminAO.jsx
+++ /dev/null
@@ -1,230 +0,0 @@
-import { useMemo } from "react";
-import {
- MRT_GlobalFilterTextInput,
- MRT_ToggleFiltersButton,
- MantineReactTable,
- useMantineReactTable,
-} from "mantine-react-table";
-import { Box, Button, Flex, Menu, Text, Title } from "@mantine/core";
-import { IconUserCircle, IconSend } from "@tabler/icons-react";
-import { formData } from "./makeData";
-
-const Example = () => {
- const columns = useMemo(
- () => [
- {
- id: "employee", //id used to define `group` column
- header: "Employee",
- columns: [
- {
- accessorFn: (row) => `${row.firstName} ${row.lastName}`, //accessorFn used to join multiple data into a single cell
- id: "name", //id is still required when using accessorFn instead of accessorKey
- header: "Name",
- size: 250,
- filterVariant: "autocomplete",
- Cell: ({ renderedCellValue, row }) => (
-
-
- {renderedCellValue}
-
- ),
- },
- {
- accessorKey: "email", //accessorKey used to define `data` column. `id` gets set to accessorKey automatically
- enableClickToCopy: true,
- header: "Email",
- size: 300,
- },
- ],
- },
- {
- id: "id",
- header: "Job Info",
- columns: [
- {
- accessorKey: "salary",
- header: "Salary",
- size: 200,
- filterVariant: "range-slider",
- mantineFilterRangeSliderProps: {
- color: "indigo",
- label: (value) =>
- value?.toLocaleString?.("en-US", {
- style: "currency",
- currency: "USD",
- minimumFractionDigits: 0,
- maximumFractionDigits: 0,
- }),
- },
- //custom conditional format and styling
- Cell: ({ cell }) => (
- ({
- backgroundColor:
- cell.getValue() < 50_000
- ? theme.colors.red[9]
- : cell.getValue() >= 50_000 && cell.getValue() < 75_000
- ? theme.colors.yellow[9]
- : theme.colors.green[9],
- borderRadius: "4px",
- color: "#fff",
- maxWidth: "9ch",
- padding: "4px",
- })}
- >
- {cell.getValue()?.toLocaleString?.("en-US", {
- style: "currency",
- currency: "USD",
- minimumFractionDigits: 0,
- maximumFractionDigits: 0,
- })}
-
- ),
- },
- {
- accessorKey: "jobTitle", //hey a simple column for once
- header: "Job Title",
- filterVariant: "multi-select",
- size: 350,
- },
- {
- accessorFn: (row) => {
- //convert to Date for sorting and filtering
- const sDay = new Date(row.startDate);
- sDay.setHours(0, 0, 0, 0); // remove time from date (useful if filter by equals exact date)
- return sDay;
- },
- id: "startDate",
- header: "Start Date",
- filterVariant: "date-range",
- sortingFn: "datetime",
- enableColumnFilterModes: false, //keep this as only date-range filter with between inclusive filterFn
- Cell: ({ cell }) => cell.getValue()?.toLocaleDateString(), //render Date as a string
- Header: ({ column }) => {column.columnDef.header}, //custom header markup
- },
- ],
- },
- ],
- []
- );
-
- const table = useMantineReactTable({
- columns,
- data,
- enableColumnFilterModes: true,
- enableColumnOrdering: true,
- enableFacetedValues: true,
- enableGrouping: true,
- enablePinning: true,
- enableRowActions: true,
- enableRowSelection: true,
- initialState: { showColumnFilters: true, showGlobalFilter: true },
- paginationDisplayMode: "pages",
- positionToolbarAlertBanner: "bottom",
- mantinePaginationProps: {
- radius: "xl",
- size: "lg",
- },
- mantineSearchTextInputProps: {
- placeholder: "Search Employees",
- },
- renderDetailPanel: ({ row }) => (
-
-
-
- Signature Catch Phrase:
- "{row.original.signatureCatchPhrase}"
-
-
- ),
- renderRowActionMenuItems: () => (
- <>
- }>View Profile
- }>Send Email
- >
- ),
- renderTopToolbar: ({ table }) => {
- const handleDeactivate = () => {
- table.getSelectedRowModel().flatRows.map((row) => {
- alert("deactivating " + row.getValue("name"));
- });
- };
-
- const handleActivate = () => {
- table.getSelectedRowModel().flatRows.map((row) => {
- alert("activating " + row.getValue("name"));
- });
- };
-
- const handleContact = () => {
- table.getSelectedRowModel().flatRows.map((row) => {
- alert("contact " + row.getValue("name"));
- });
- };
-
- return (
-
-
- {/* import MRT sub-components */}
-
-
-
-
-
-
-
-
-
- );
- },
- });
-
- return ;
-};
-
-export default Example;
diff --git a/src/Pages/Admin/AdminCEO.jsx b/src/Pages/Admin/AdminCEO.jsx
deleted file mode 100644
index c90c5ff..0000000
--- a/src/Pages/Admin/AdminCEO.jsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import React from 'react'
-
-const AdminCEO = () => {
- return (
- AdminCEO
- )
-}
-
-export default AdminCEO
\ No newline at end of file
diff --git a/src/Pages/Admin/AdminGC.jsx b/src/Pages/Admin/AdminGC.jsx
deleted file mode 100644
index 0756058..0000000
--- a/src/Pages/Admin/AdminGC.jsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import React, { useState } from "react";
-
-const AdminGC = () => {
- const [popup, setPopup] = useState(false);
- const [rejectingRecord, setRejectingRecord] = useState({});
- const [reason, setReason] = useState("");
-
- return (
- <>
- {popup && (
-
-
-
Popup
-
- Please Provide the reason to Reject the application of{" "}
- {rejectingRecord["Nameofapplicant"]}
-
-
-
- )}
-
-
- Table Pending
-
-
-
-
-
- Sno
- |
-
- Applicant Name
- |
-
- Verified/Not Verified
- |
-
- Accept/Reject
- |
-
-
- Status Admitted
- |
-
-
-
-
- 1 |
-
-
- John Doe
-
- |
- Approved by OB |
-
-
-
- |
-
-
- 2 |
-
-
- Jane Smith
-
- |
- rejected |
-
-
- Reason for rejection
-
- |
-
-
-
- >
- );
-};
-
-export default AdminGC;
diff --git a/src/Pages/Admin/AdminMC.jsx b/src/Pages/Admin/AdminMC.jsx
deleted file mode 100644
index 3194b04..0000000
--- a/src/Pages/Admin/AdminMC.jsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import React from 'react'
-
-const AdminMC = () => {
- return (
- AdminMC
- )
-}
-
-export default AdminMC
\ No newline at end of file
diff --git a/src/Pages/Admin/AdminOB.jsx b/src/Pages/Admin/AdminOB.jsx
deleted file mode 100644
index 65b2ad1..0000000
--- a/src/Pages/Admin/AdminOB.jsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from "react";
-
-const AdminOB = () => {
- return AdminOB
;
-};
-
-export default AdminOB;
diff --git a/src/Pages/Admin/Allmembers.jsx b/src/Pages/Admin/Allmembers.jsx
new file mode 100644
index 0000000..ca5ead5
--- /dev/null
+++ b/src/Pages/Admin/Allmembers.jsx
@@ -0,0 +1,139 @@
+import { useMemo, useState, useEffect } from "react";
+import { MantineReactTable, useMantineReactTable } from "mantine-react-table";
+import { Button, Modal } from "@mantine/core";
+import { IconEye } from "@tabler/icons-react";
+
+const toReadableHeader = (key) => {
+ let result = key.replace(/(_[a-z])/g, (group) =>
+ group.toUpperCase().replace("_", "")
+ );
+ result = result.replace(/([A-Z])/g, " $1");
+ return result.charAt(0).toUpperCase() + result.slice(1);
+};
+
+const Allmembers = () => {
+ const [data, setData] = useState([]);
+ const [modalOpened, setModalOpened] = useState(false);
+ const [currentFileUrl, setCurrentFileUrl] = useState("");
+
+ useEffect(() => {
+ const fetchData = async () => {
+ try {
+ const response = await fetch(
+ "http://192.168.169.17:8000/membershipform/"
+ );
+ const jsonData = await response.json();
+ setData(jsonData);
+ console.log(jsonData);
+ } catch (error) {
+ console.error(error);
+ }
+ };
+
+ fetchData();
+ }, []);
+
+ const columns = useMemo(() => {
+ const baseColumns = [];
+
+ if (data.length > 0) {
+ const keys = Object.keys(data[0]);
+
+ keys.forEach((key) => {
+ baseColumns.push({
+ accessorKey: key,
+ header: toReadableHeader(key),
+ });
+ });
+
+ const fileFields = [
+ "e_sign",
+ "IncomeandExpenditure",
+ "incometaxtpan",
+ "FactoryRegistrationCertificate",
+ "MemorandumArticleofAssociation",
+ "GSTINRegistrationCopy",
+ "IECodeCertificate",
+ "ProfessionalCertificate",
+ "CopyofLandDocument",
+ "LandHolding",
+ "passportsizephoto",
+ "DirectorsPartners",
+ ];
+
+ fileFields.forEach((field) => {
+ baseColumns.push({
+ id: `${field}_view`,
+ header: toReadableHeader(field),
+ cell: ({ row }) =>
+ row.original[field] ? (
+ }
+ onClick={() => {
+ setCurrentFileUrl(row.original[field]);
+ setModalOpened(true);
+ }}
+ >
+ View
+
+ ) : null,
+ });
+ });
+ }
+
+ return baseColumns;
+ }, [data]);
+
+ const table = useMantineReactTable({
+ columns,
+ data,
+ initialState: {
+ pageIndex: 0,
+ pageSize: 10,
+ },
+ manualPagination: false,
+ manualSorting: false,
+ manualFiltering: false,
+ enableColumnOrdering: true,
+ enableGlobalFilter: true,
+ enableSorting: true,
+ enablePagination: true,
+ enableRowSelection: false,
+ onPaginationChange: (pagination) => {
+ console.log("Pagination changed:", pagination);
+ },
+ onSortingChange: (sorting) => {
+ console.log("Sorting changed:", sorting);
+ },
+ onGlobalFilterChange: (filter) => {
+ console.log("Global filter changed:", filter);
+ },
+
+ state: {
+ globalFilter: "",
+ },
+ // Add other configurations as needed...
+ });
+
+ return (
+ <>
+
+ setModalOpened(false)}
+ title="File Viewer"
+ size="lg"
+ >
+ {currentFileUrl && (
+
+ )}
+
+ >
+ );
+};
+
+export default Allmembers;
diff --git a/src/Pages/Admin/LoginAdmin.jsx b/src/Pages/Admin/LoginAdmin.jsx
new file mode 100644
index 0000000..2bf0f3d
--- /dev/null
+++ b/src/Pages/Admin/LoginAdmin.jsx
@@ -0,0 +1,94 @@
+import React, { useState } from "react";
+import { Link, useNavigate } from "react-router-dom";
+import icci from "../../Assets/icci.jpg";
+import axios from "axios";
+
+const LoginAdmin = () => {
+ const navigate = useNavigate();
+ const [error, setError] = useState(null);
+
+ const handleSubmit = async (e) => {
+ e.preventDefault();
+ const formData = new FormData(e.target);
+ const username = formData.get("username");
+ const password = formData.get("password");
+
+ try {
+ const response = await axios.post("http://192.168.169.17:8000/login/", {
+ username,
+ password,
+ });
+ const token = response.data.token;
+ localStorage.setItem("token", token);
+
+ navigate("/admin");
+ } catch (error) {
+ setError("Invalid username or password");
+ }
+ };
+
+ return (
+
+
+
+
+
+ Log in to admin account
+
+
+
+
+
+ );
+};
+
+export default LoginAdmin;
diff --git a/src/Pages/Admin/Navbar.jsx b/src/Pages/Admin/Navbar.jsx
index b9d9de0..b9192f9 100644
--- a/src/Pages/Admin/Navbar.jsx
+++ b/src/Pages/Admin/Navbar.jsx
@@ -38,7 +38,7 @@ const Navbar = () => {
-
@@ -47,7 +47,7 @@ const Navbar = () => {
-
Admin
diff --git a/src/Pages/Admin/makeData.jsx b/src/Pages/Admin/makeData.jsx
deleted file mode 100644
index f772376..0000000
--- a/src/Pages/Admin/makeData.jsx
+++ /dev/null
@@ -1,64 +0,0 @@
-const formData = {
- NameofApplicant: "John Doe",
- constitution: "Individual",
- profession1: "Software Developer",
- YearofEstablishment: "2010",
- Businessactivity: "Software Development and Consulting",
- Registerofficeaddress: "1234 Software St, Tech City",
- Addressforcommunication_office: "1234 Software St, Tech City",
- Addressforcommunication_work: "5678 Development Ave, Tech Park",
- Communicationdetails_landline: "123-456-7890",
- Communicationdetails_mobile: "098-765-4321",
- Communicationdetails_email: "contact@techcompany.com",
- Communicationdetails_web: "https://www.techcompany.com",
- Legalinfo_aadhar: "123456789101",
- Legalinfo_pancard: "ABCDE1234F",
- Legalinfo_GSTNo: "22AAAAA0000A1Z5",
- Legalinfo_CompanyFirmRegNo: "C12345678901234",
- Legalinfo_SocietyAssociationRegNo: "12345678901234",
- Personauthorized_Name: "Jane Doe",
- Personauthorized_Designation: "CTO",
- personauthorized_pan: "BCDEA1234G",
- personauthorized_aadhar: "432167890123",
- personauthorized_phone: "098-765-4321",
- personauthorized_email: "jane.doe@techcompany.com",
- Maincategory: "IT and Software",
- Subcategory: "Software Development",
- Cateringtomarket: "Global",
- Percentageofimports: "10%",
- Percentageofexports: "50%",
- Foreigncollaboration_country: "USA",
- Foreigncollaboration_collaborator: "GlobalTech Inc",
- Classificationofindustry: "Large",
- Annualturnover_year1: "10",
- Annualturnover_year2: "1200000",
- Annualturnover_year3: "150",
- Noofpersonsemployed_direct: "50",
- Noofpersonsemployed_works: "200",
- Noofpersonsemployed_indirect: "100",
- Noofpersonsemployed_outsourced: "30",
- ESIC: "Yes",
- EPF: "Yes",
- Detailsofbranches: "Tech City, Tech Park",
- Memberofanyother: "Yes",
- association_name: "Tech Industry Association",
- is_office_bearer: "No",
- association_position: "",
- reason_for_joining_chamber: "Networking and Business Opportunities",
- e_sign: null,
- IncomeandExpenditure: null,
- incometaxtpan: null,
- FactoryRegistrationCertificate: null,
- MemorandumArticleofAssociation: null,
- GSTINRegistrationCopy: null,
- IECodeCertificate: null,
- ProfessionalCertificate: null,
- CopyofLandDocument: null,
- LandHolding: null,
- passportsizephoto: null,
- DirectorsPartners: null,
- form_status: "pending",
- Reasonforrejection: "",
-};
-
-export default formData;
diff --git a/src/Pages/Client/NewMember/Membershipform.jsx b/src/Pages/Client/NewMember/Membershipform.jsx
index 594048c..bae1425 100644
--- a/src/Pages/Client/NewMember/Membershipform.jsx
+++ b/src/Pages/Client/NewMember/Membershipform.jsx
@@ -218,18 +218,23 @@ const Membershipform = () => {
};
const handleSubmit = async (e) => {
- e.preventDefault();
+ try {
+ e.preventDefault();
- const response = await axios.post(
- "http://192.168.169.17:8000/membershipform/",
- formData,
- {
- headers: {
- "Content-Type": "multipart/form-data",
- },
- }
- );
- console.log(response);
+ const response = await axios.post(
+ "http://192.168.169.17:8000/membershipform/",
+ formData,
+ {
+ headers: {
+ "Content-Type": "multipart/form-data",
+ },
+ }
+ );
+ console.log(response);
+ navigate("/adminhome");
+ } catch (error) {
+ console.log(error);
+ }
};
return (