diff --git a/.eslintrc.json b/.eslintrc.json
index aef398db9..0d028e959 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -13,13 +13,9 @@
},
"plugins": ["react", "prettier"],
"rules": {
- "prettier/prettier": [
- "error",
- {
- "endOfLine": "auto"
- }
- ],
+ "prettier/prettier": 0,
"default-param-last": "off",
+ "react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"react/jsx-props-no-spreading": [
diff --git a/.prettierrc.json b/.prettierrc.json
index 40fa8e5f6..a73e1cee9 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -2,7 +2,7 @@
"printWidth": 100,
"trailingComma": "es5",
"tabWidth": 2,
- "semi": true,
+ "semi": false,
"singleQuote": false,
"endOfLine": "auto"
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 000000000..ad92582bd
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "editor.formatOnSave": true
+}
diff --git a/README.md b/README.md
index 491b5e226..9cf9acde5 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ This free MUI & React Dashboard is coming with prebuilt design blocks, so the de
switching from our pages to the real website is very easy to be done.
Special thanks go to:
-- [Nepcha Analytics](https://nepcha.com?ref=readme) for the analytics tool. Nepcha is already integrated with Material Dashboard React. You can use it to gain insights into your sources of traffic.
+- [Nepcha tics](https://nepcha.com?ref=readme) for the analytics tool. Nepcha is already integrated with Material Dashboard React. You can use it to gain insights into your sources of traffic.
**Documentation built by Developers**
diff --git a/dcasn b/dcasn
new file mode 100644
index 000000000..012bce130
--- /dev/null
+++ b/dcasn
@@ -0,0 +1,3 @@
+ doston[m
+* [32mdoston1[m
+ main[m
diff --git a/est b/est
new file mode 100644
index 000000000..66f6f5f30
--- /dev/null
+++ b/est
@@ -0,0 +1 @@
+Token = "tokenType": "Bearer",
\ No newline at end of file
diff --git a/jsconfig.json b/jsconfig.json
index 85a4c9774..3ece5c5e0 100644
--- a/jsconfig.json
+++ b/jsconfig.json
@@ -1,5 +1,6 @@
{
"compilerOptions": {
+ "jsx": "react",
"baseUrl": "src",
"paths": {
"*": ["public/src/*"]
diff --git a/package.json b/package.json
index 8e2cd45b5..e32f72744 100644
--- a/package.json
+++ b/package.json
@@ -17,32 +17,44 @@
"npm": ">=6"
},
"dependencies": {
+ "@date-io/moment": "^1.3.13",
+ "@draft-js-plugins/image": "^4.1.3",
"@emotion/cache": "11.7.1",
- "@emotion/react": "11.7.1",
- "@emotion/styled": "11.6.0",
+ "@emotion/react": "^11.11.1",
+ "@emotion/styled": "^11.11.0",
+ "@material-ui/core": "^4.12.3",
+ "@material-ui/pickers": "^3.3.10",
"@mui/icons-material": "5.4.1",
- "@mui/material": "5.4.1",
+ "@mui/material": "^5.13.5",
"@mui/styled-engine": "5.4.1",
"@testing-library/jest-dom": "5.16.2",
"@testing-library/react": "12.1.2",
"@testing-library/user-event": "13.5.0",
+ "@uiw/react-md-editor": "^3.23.3",
+ "axios": "^1.4.0",
"chart.js": "3.4.1",
"chroma-js": "2.4.2",
+ "draft-js": "^0.11.7",
+ "install": "^0.13.0",
+ "lotin-kirill": "^0.1.3",
+ "npm": "^9.6.7",
"prop-types": "15.8.1",
"react": "17.0.2",
"react-chartjs-2": "3.0.4",
"react-dom": "17.0.2",
"react-github-btn": "1.2.1",
+ "react-icons": "^4.9.0",
"react-router-dom": "6.2.1",
"react-scripts": "5.0.0",
"react-table": "7.7.0",
+ "react-toastify": "^9.1.3",
"stylis": "4.0.13",
"stylis-plugin-rtl": "2.1.1",
"web-vitals": "2.1.4",
"yup": "0.32.11"
},
"scripts": {
- "start": "react-scripts start",
+ "start": "set PORT=3001 && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
diff --git a/public/back.jpg b/public/back.jpg
new file mode 100644
index 000000000..ab64566cf
Binary files /dev/null and b/public/back.jpg differ
diff --git a/public/back_sidebar.jpg b/public/back_sidebar.jpg
new file mode 100644
index 000000000..a9399be35
Binary files /dev/null and b/public/back_sidebar.jpg differ
diff --git a/public/index.html b/public/index.html
index 7ac903b40..c77393eaa 100644
--- a/public/index.html
+++ b/public/index.html
@@ -22,7 +22,7 @@
-
Material Dashboard 2 React
+ Tahlil24
}
{getRoutes(routes)}
+ } />
} />
diff --git a/src/components/MDTypography/index.js b/src/components/MDTypography/index.js
index 4149a3b73..0480dd5ce 100644
--- a/src/components/MDTypography/index.js
+++ b/src/components/MDTypography/index.js
@@ -76,6 +76,8 @@ MDTypography.propTypes = {
"dark",
"text",
"white",
+ "lime",
+ "blue",
]),
fontWeight: PropTypes.oneOf([false, "light", "regular", "medium", "bold"]),
textTransform: PropTypes.oneOf(["none", "capitalize", "uppercase", "lowercase"]),
diff --git a/src/examples/Breadcrumbs/index.js b/src/examples/Breadcrumbs/index.js
index 46d684da0..e078faf28 100644
--- a/src/examples/Breadcrumbs/index.js
+++ b/src/examples/Breadcrumbs/index.js
@@ -1,18 +1,3 @@
-/**
-=========================================================
-* Material Dashboard 2 React - v2.1.0
-=========================================================
-
-* Product Page: https://www.creative-tim.com/product/material-dashboard-react
-* Copyright 2022 Creative Tim (https://www.creative-tim.com)
-
-Coded by www.creative-tim.com
-
- =========================================================
-
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*/
-
// react-router-dom components
import { Link } from "react-router-dom";
diff --git a/src/examples/Navbars/DefaultNavbar/index.js b/src/examples/Navbars/DefaultNavbar/index.js
index 494cacea6..a1f366bcf 100644
--- a/src/examples/Navbars/DefaultNavbar/index.js
+++ b/src/examples/Navbars/DefaultNavbar/index.js
@@ -127,6 +127,7 @@ function DefaultNavbar({ transparent, light, action }) {
name="sign in"
route="/authentication/sign-in"
light={light}
+ Dashboard="sign-in"
/>
{action &&
diff --git a/src/examples/Sidenav/index.js b/src/examples/Sidenav/index.js
index f0d41d2b7..35b72ba02 100644
--- a/src/examples/Sidenav/index.js
+++ b/src/examples/Sidenav/index.js
@@ -1,18 +1,3 @@
-/**
-=========================================================
-* Material Dashboard 2 React - v2.1.0
-=========================================================
-
-* Product Page: https://www.creative-tim.com/product/material-dashboard-react
-* Copyright 2022 Creative Tim (https://www.creative-tim.com)
-
-Coded by www.creative-tim.com
-
- =========================================================
-
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*/
-
import { useEffect } from "react";
// react-router-dom components
@@ -30,7 +15,7 @@ import Icon from "@mui/material/Icon";
// Material Dashboard 2 React components
import MDBox from "components/MDBox";
import MDTypography from "components/MDTypography";
-import MDButton from "components/MDButton";
+// import MDButton from "components/MDButton";
// Material Dashboard 2 React example components
import SidenavCollapse from "examples/Sidenav/SidenavCollapse";
@@ -49,7 +34,7 @@ import {
function Sidenav({ color, brand, brandName, routes, ...rest }) {
const [controller, dispatch] = useMaterialUIController();
- const { miniSidenav, transparentSidenav, whiteSidenav, darkMode, sidenavColor } = controller;
+ const { miniSidenav, transparentSidenav, whiteSidenav, darkMode} = controller;
const location = useLocation();
const collapseName = location.pathname.replace("/", "");
@@ -78,7 +63,6 @@ function Sidenav({ color, brand, brandName, routes, ...rest }) {
// Call the handleMiniSidenav function to set the state with the initial value.
handleMiniSidenav();
-
// Remove event listener on cleanup
return () => window.removeEventListener("resize", handleMiniSidenav);
}, [dispatch, location]);
@@ -179,7 +163,7 @@ function Sidenav({ color, brand, brandName, routes, ...rest }) {
}
/>
{renderRoutes}
-
+ {/*
upgrade to pro
-
+ */}
);
}
diff --git a/src/examples/Tables/DataTable/DataTableHeadCell.js b/src/examples/Tables/DataTable/DataTableHeadCell.js
index d15457fff..84e0f3b8a 100644
--- a/src/examples/Tables/DataTable/DataTableHeadCell.js
+++ b/src/examples/Tables/DataTable/DataTableHeadCell.js
@@ -43,10 +43,10 @@ function DataTableHeadCell({ width, children, sorted, align, ...rest }) {
{...rest}
position="relative"
textAlign={align}
- color={darkMode ? "white" : "secondary"}
+ color={darkMode ? "red" : "dark"}
opacity={0.7}
sx={({ typography: { size, fontWeightBold } }) => ({
- fontSize: size.xxs,
+ fontSize: size.xxa,
fontWeight: fontWeightBold,
textTransform: "uppercase",
cursor: sorted && "pointer",
diff --git a/src/layouts/analysis24/FileUpload/FUStyles.js b/src/layouts/analysis24/FileUpload/FUStyles.js
new file mode 100644
index 000000000..f1712909e
--- /dev/null
+++ b/src/layouts/analysis24/FileUpload/FUStyles.js
@@ -0,0 +1,55 @@
+import styled from "@emotion/styled"
+
+const FUStyles = styled.div`
+ width: 100%;
+ form {
+ position: relative;
+
+ .loading {
+ position: absolute;
+ top: -10px;
+ left: -10px;
+ padding-left: 15px;
+ height: 100%;
+ width: 110%;
+ background: rgba(255, 255, 255, 0.25);
+ box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
+ backdrop-filter: blur(4px);
+ border: 1px solid rgba(255, 255, 255, 0.18);
+ /* loading */
+ .lds-ripple {
+ display: inline-block;
+ position: relative;
+ width: 80px;
+ height: 80px;
+ }
+ .lds-ripple div {
+ position: absolute;
+ border: 4px solid #3f51b5;
+ opacity: 1;
+ border-radius: 50%;
+ animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
+ }
+ .lds-ripple div:nth-child(2) {
+ animation-delay: -0.5s;
+ }
+ @keyframes lds-ripple {
+ 0% {
+ top: 36px;
+ left: 36px;
+ width: 0;
+ height: 0;
+ opacity: 1;
+ }
+ 100% {
+ top: 0px;
+ left: 0px;
+ width: 72px;
+ height: 72px;
+ opacity: 0;
+ }
+ }
+ }
+ }
+`
+export default FUStyles
diff --git a/src/layouts/analysis24/FileUpload/index.js b/src/layouts/analysis24/FileUpload/index.js
new file mode 100644
index 000000000..bba34f189
--- /dev/null
+++ b/src/layouts/analysis24/FileUpload/index.js
@@ -0,0 +1,134 @@
+import { Button } from "@material-ui/core"
+import React, { useEffect, useState } from "react"
+import axios from "axios"
+import { MdAddAPhoto } from "react-icons/md"
+import { AiOutlineCloudUpload } from "react-icons/ai"
+import FUStyles from "./FUStyles"
+
+function FileUpload({ callback, clearBool }) {
+ const [fileImage, setFileImage] = useState("")
+ const [fileName, setFilename] = useState(null)
+ const [load, setLoad] = useState(false)
+ const [viewBool, setViewBool] = useState(false)
+ const [isUploaded, setIsUploaded] = useState(false)
+ const [nameImage, setNameImage] = useState("")
+
+ const getImage = (e) => {
+ console.log("getImage", e.target.files[0], e.target.files[0].nameImage)
+ setFileImage(e.target.files[0])
+ const objectUrl = URL.createObjectURL(e.target.files[0])
+ setNameImage(e.target.files[0].nameImage)
+ setFilename(objectUrl)
+ setViewBool(true)
+ }
+
+ useEffect(() => {
+ if (clearBool) {
+ setFileImage("")
+ setFilename(null)
+ setViewBool(false)
+ setIsUploaded(false)
+ }
+ }, [clearBool])
+
+ const setImage = async (body) => {
+ const url = `http://165.232.85.45:1988/koinot/attachment/uploadPhotoFileList/NEWS?requestMethod=POST`
+ const config = {
+ headers: {
+ "Content-type": "multipart/form-data",
+ Authorization:
+ "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIzIiwiaWF0IjoxNjg2MDcyNjYwLCJleHAiOjE2ODc4MDA2NjB9.m8116Hfe7CamK9cHHAdhpv9ZRvi9Kg-CxTabAjtydfXVLamgr6sArqzOEscN7swspNjOzlw62XgOhPy3aB-lAw",
+ },
+ }
+ try {
+ const res = axios.post(url, body, config)
+ setFilename(res.data.object[0].link)
+ callback(res)
+ console.log("resresresres", res)
+ setLoad(false)
+ setIsUploaded(true)
+ return res
+ } catch (error) {
+ setLoad(false)
+ console.error(error)
+ return { error: true }
+ }
+ }
+
+ const onSubmit = async (e) => {
+ e.preventDefault()
+ const formData1 = new FormData()
+ formData1.append("file", fileImage, nameImage)
+ console.log("formData1", formData1)
+ setImage(formData1)
+ setLoad(true)
+ }
+
+ return (
+
+
+
+ {/*
+
+
*/}
+
+ )
+}
+
+export default FileUpload
diff --git a/src/layouts/analysis24/FileUploadCHild/index.js b/src/layouts/analysis24/FileUploadCHild/index.js
new file mode 100644
index 000000000..e69de29bb
diff --git a/src/layouts/analysis24/Tabs/taben/TextEn.js b/src/layouts/analysis24/Tabs/taben/TextEn.js
new file mode 100644
index 000000000..cb81879d6
--- /dev/null
+++ b/src/layouts/analysis24/Tabs/taben/TextEn.js
@@ -0,0 +1,52 @@
+import React from "react"
+import MDEditor from "@uiw/react-md-editor"
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+import { Button } from "@material-ui/core"
+import MDInput from "components/MDInput"
+
+function TextEn({ engTitle, setEngtitle, engText, setEngtext }) {
+
+ console.log(engText)
+ console.log(engText)
+ return (
+ <>
+
+
+ Analysis24 : English
+
+
+
+
+
+
+ setEngtitle(e.target.value)}
+ rows="1"
+ />
+
+
+
+
+ >
+ )
+}
+export default TextEn
diff --git a/src/layouts/analysis24/Tabs/tabru/TextRu.js b/src/layouts/analysis24/Tabs/tabru/TextRu.js
new file mode 100644
index 000000000..661976577
--- /dev/null
+++ b/src/layouts/analysis24/Tabs/tabru/TextRu.js
@@ -0,0 +1,54 @@
+import React from "react"
+import { Button } from "@material-ui/core"
+import MDEditor from "@uiw/react-md-editor"
+
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+import MDInput from "components/MDInput"
+
+function TextRu({ ruText, setRutext, ruTitle, setRutitle }) {
+ console.log(ruText)
+ console.log(ruTitle)
+
+ return (
+ <>
+
+
+ Analysis24 : Ruscha
+
+
+
+
+
+
+ setRutitle(e.target.value)}
+ rows="1"
+ />
+
+
+
+
+ >
+ )
+}
+
+export default TextRu
diff --git a/src/layouts/analysis24/Tabs/tabuz/TextUz.js b/src/layouts/analysis24/Tabs/tabuz/TextUz.js
new file mode 100644
index 000000000..dcf0716fd
--- /dev/null
+++ b/src/layouts/analysis24/Tabs/tabuz/TextUz.js
@@ -0,0 +1,589 @@
+import { useState, useEffect } from "react"
+import MDEditor from "@uiw/react-md-editor"
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+import DateMomentUtils from "@date-io/moment"
+
+import {
+ MdOutlineAddCircleOutline,
+ MdRadioButtonUnchecked,
+ MdRadioButtonChecked,
+ MdOutlineDownloadDone,
+} from "react-icons/md"
+import {
+ Button,
+ Card,
+ FormControl,
+ IconButton,
+ InputLabel,
+ MenuItem,
+ Select,
+} from "@material-ui/core"
+import { Box, Grid } from "@mui/material"
+import MDSnackbar from "components/MDSnackbar"
+import AddModal from "layouts/dashboard copy/modals/addModal"
+import MDInput from "components/MDInput"
+import ModalKoinot from "layouts/analysis24/modalKoinot"
+import { DatePicker, MuiPickersUtilsProvider } from "@material-ui/pickers"
+import FileUpload from "layouts/analysis24/FileUpload"
+import { ToastContainer, toast } from "react-toastify"
+import axios from "axios"
+
+function TextUz() {
+ // -------------important------------
+ const [important, setImportant] = useState(false)
+ // ----------------tags------------
+ const [tags, setTag] = useState([])
+ const [rece, setRece] = useState([])
+ // categories
+ const [cats, setCats] = useState([])
+ const [categ, setCateg] = useState(1)
+
+ // ---------time ------
+ const [evTime, setEvTime] = useState(null)
+ const [viewTime, setViewTime] = useState(null)
+ // ----------textlink-----------
+ const [textlink, setTextlink] = useState("")
+ const [uzText, setUztext] = useState("")
+ const [uzTitle, setUztitle] = useState("")
+ console.log(uzText)
+ console.log(uzTitle)
+ console.log(textlink)
+ // ---------img id---------
+ const [img, setImg] = useState(null)
+ const [clearImgBool, setClearImgBool] = useState(false)
+
+ const pictureId = (value) => {
+ setImg(value.data.object[0].fileId)
+ }
+
+ // function CPFunction(content) {
+ // return content
+ // }
+
+ const setChildData = async (body, success, successCallback) => {
+ const url = `http://165.232.85.45:1988/koinot/newsChild`
+ const headers = {
+ headers: {
+ Authorization:
+ "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIzIiwiaWF0IjoxNjg2MDcyNjYwLCJleHAiOjE2ODc4MDA2NjB9.m8116Hfe7CamK9cHHAdhpv9ZRvi9Kg-CxTabAjtydfXVLamgr6sArqzOEscN7swspNjOzlw62XgOhPy3aB-lAw",
+ },
+ }
+ try {
+ const res = await axios.post(url, body, headers)
+ success(true)
+ successCallback(`Post o'zgartirildi`, "s")
+ return res
+ } catch (error) {
+ successCallback(`Logout qilib qayta kiring`, "e")
+ console.error(error)
+ return { error: true }
+ }
+ }
+
+ const setData = async (body, path, callback, model) => {
+ const url = `http://165.232.85.45:1988/koinot/news`
+ const token = localStorage.getItem("Token")
+ const headers = {
+ headers: { Authorization: `Bearer ${token}` },
+ }
+ try {
+ const res = await axios.post(url, body, headers)
+
+ if (path !== "news") {
+ callback("d-block", res.data.object)
+ model(`Post ${res.data.object.id} muvaffaqiyatli joylandi`, res.data)
+ } else {
+ callback("d-block", "child")
+ model("Post tarkibi muvaffaqiyatli joylandi")
+ }
+ return res
+ } catch (error) {
+ callback("d-block")
+ model("Post joylashda xatolik! Maydonlarni to'liq to'ldirmagan bo'lishingiz mumkin")
+ console.error(error)
+ return { error: true }
+ }
+ }
+
+ // upload by draftjs
+ const uploadImageCallBack = (file) => {
+ const token = localStorage.getItem("Token")
+ return new Promise((resolve, reject) => {
+ const xhr = new XMLHttpRequest()
+ xhr.open(
+ "POST",
+ "http://165.232.85.45:1988/koinot/attachment/uploadPhotoFileList/NEWS_CHILD?requestMethod=POST"
+ )
+ xhr.setRequestHeader("Authorization", `Bearer ${token}`)
+ const data = new FormData()
+ data.append("image", file)
+ xhr.send(data)
+ xhr.addEventListener("load", () => {
+ const response = JSON.parse(xhr.responseText)
+ console.log(response.object[0].link)
+ resolve({
+ data: {
+ link: response.object[0].link,
+ },
+ })
+ })
+ xhr.addEventListener("error", () => {
+ const error = JSON.parse(xhr.responseText)
+ console.log(error)
+ reject(error)
+ })
+ })
+ }
+
+ // ----------- finish --------
+ const [modal, setModal] = useState("d-none")
+ const [modalContent, setModalConent] = useState()
+ const [poster, setPoster] = useState(null)
+
+ const closeModal = (val) => {
+ setModal(val)
+ }
+
+ const finallyResult = () => {
+ const setupModal = (value, data) => {
+ setModal(value)
+ if (data !== "child") setPoster(data)
+ }
+ const contentModal = (value) => {
+ setModalConent(value)
+ }
+ const cleanFields = () => {
+ setUztitle()
+ setUztext()
+ setTag([])
+ setTextlink()
+ setEvTime(null)
+ setViewTime(null)
+ setCateg(null)
+ }
+ console.log("poster", poster)
+ if (poster !== null) {
+ const object = {
+ fileId: img,
+ link: textlink,
+ newsId: poster.id,
+ textUz: uzText,
+ titleUz: uzTitle,
+ }
+ setChildData(object)
+ setClearImgBool(false)
+
+ // const conf = confirm("Yana tarkib qushasizmi ?")
+
+ toast.success("Yana tarkib qushasizmi ?")
+ if (toast.success) {
+ setImg(null)
+ setClearImgBool(true)
+ cleanFields()
+ } else {
+ // CPFunction(true)
+ cleanFields()
+ setPoster(null)
+ setClearImgBool(true)
+ setImg(null)
+ }
+ } else {
+ const objectKoinot = {
+ attachmentId: img,
+ categoryId: categ,
+ tagIds: tags.map((v) => v.id),
+ status: important !== true ? "IMPORTANT" : "UNIMPORTANT",
+ link: textlink,
+ textUz: uzText,
+ timeToView: viewTime,
+ eventTime: evTime,
+ titleUz: uzTitle,
+ }
+ if (img !== null) {
+ const PermissionChild = async () => {
+ await setData(objectKoinot, "news", setupModal, contentModal)
+ }
+ PermissionChild()
+ } else {
+ setModalConent("Rasm joylashtiring")
+ setModal("d-block")
+ }
+ }
+ }
+
+ // Succes Notification
+ const [categoriesRef, setCategoriesRef] = useState(false)
+
+ const [successSB, setSuccessSB] = useState({ open: false, message: "" })
+ const openSuccessSB = (mes) => setSuccessSB({ open: true, message: mes })
+ const closeSuccessSB = () => setSuccessSB({ open: false })
+ // Error Notification
+ const [errorSB, setErrorSB] = useState({ open: false, message: "" })
+ const openErrorSB = (errorMes) => setErrorSB({ open: true, message: errorMes })
+ const closeErrorSB = () => setErrorSB({ open: false })
+
+ // Add Category
+ const addCategory = (add) => {
+ console.log(add)
+ const myHeaders = new Headers()
+ const token = localStorage.getItem("Token")
+ myHeaders.append("Content-Type", "application/json")
+ myHeaders.append("Authorization", `Bearer access_${token}`)
+
+ const raw = JSON.stringify({
+ textEn: add.addEng,
+ textRu: add.addRus,
+ textUz: add.addUzb,
+ textUzK: add.addUzbK,
+ })
+
+ const requestOptions = {
+ method: "POST",
+ headers: myHeaders,
+ body: raw,
+ redirect: "follow",
+ }
+
+ fetch("http://165.232.85.45:1988/koinot/category", requestOptions)
+ .then((response) => response.text())
+ .then((result) => {
+ const res = JSON.parse(result)
+ console.log(typeof res.message, res.success)
+ if (res.success === 200) {
+ openSuccessSB("Category added successfully")
+ setCategoriesRef(!categoriesRef)
+ }
+ })
+ .catch((error) => {
+ console.log(error)
+ openErrorSB(`Category not added ${error}`)
+ })
+ }
+ // If the add new tag
+ const tagcontrolAdd = (tag) => {
+ console.log(tag)
+ const myHeaders = new Headers()
+ const token = localStorage.getItem("Token")
+ myHeaders.append("Content-Type", "application/json")
+ myHeaders.append("Authorization", `Bearer ${token}`)
+
+ const raw = JSON.stringify({
+ textEn: tag.addEng,
+ textRu: tag.addRus,
+ textUz: tag.addUzb,
+ textUzK: tag.addUzbK,
+ })
+
+ const requestOptions = {
+ method: "POST",
+ headers: myHeaders,
+ body: raw,
+ redirect: "follow",
+ }
+
+ fetch("http://165.232.85.45:1988/koinot/tag", requestOptions)
+ .then((response) => response.json())
+ .then((res) => {
+ console.log(typeof res.message, res.success)
+ if (res.success === 200) {
+ openSuccessSB("TagController addtag successfully")
+ setCategoriesRef(!categoriesRef)
+ }
+ })
+ .catch((error) => {
+ console.log(error)
+ openErrorSB(`TagController not Addtag ${error}`)
+ })
+ }
+ // get tags from teh server
+ useEffect(() => {
+ const requestOptions = {
+ method: "GET",
+ }
+
+ fetch("http://165.232.85.45:1988/koinot/tag", requestOptions)
+ .then((response) => response.json())
+ .then((data) => {
+ setTag(data.objectKoinot)
+ })
+ }, [categoriesRef])
+
+ const setTags = (id) => {
+ const recArray = [...rece]
+ const oneTag = recArray.filter((v) => v.id === id)
+ const array = [...tags, oneTag[0]]
+ setTag(array)
+
+ const recarray = [...rece]
+ const item = recarray.find((e) => e.id === id)
+ recarray.splice(rece.indexOf(item), 1)
+
+ setRece(recarray)
+ }
+
+ const returnTags = (id) => {
+ // qowilgan taglardan idga togri keladigani olib bazdan keganlagan qowildi
+ const tag = [...tags]
+ const oneTag = tag.filter((v) => v.id === id)[0]
+ const array = [...rece]
+ array.unshift(oneTag)
+ setRece(array)
+
+ // qowilgan taglardan id-ga tori keladigani olib tawlandi
+ const tagsarray = [...tags]
+ const index = tags.map((x) => x.id).indexOf(id)
+ tagsarray.splice(index, 1)
+ setTag(tagsarray)
+ }
+
+ // Categories information api
+ useEffect(() => {
+ const requestOptions = {
+ method: "GET",
+ headers: { "Content-Type": "application/json" },
+ }
+ fetch("http://165.232.85.45:1988/koinot/category", requestOptions)
+ .then((response) => response.json())
+ .then((data) => setCats(data.objectKoinot))
+ }, [categoriesRef])
+
+ // Notifications
+ const renderSuccessSB = (
+
+ )
+ const renderErrorSB = (
+
+ )
+
+ return (
+ <>
+
+
+ Analysis24 : Uzbek
+
+
+
+
+
+
+
+ setUztitle(e.target.value)}
+ rows="1"
+ />
+
+
+
+ Status
+
+
+
+
+ uploadImageCallBack()}
+ // CPFunction={CPFunction}
+ value={uzText}
+ onChange={(e) => setUztext(e)}
+ />
+
+
+ setTextlink(e.target.value)}
+ rows="1"
+ />
+
+ tagcontrolAdd(e)} />
+
+
+
+
+ {/* tags -------- DON'T TOUCH IT---------- */}
+
+ Postga qushilgan teglar{" "}
+
+
+ {tags.length !== 0
+ ? tags.map((teg) => (
+
+ ))
+ : "hali teg qo'shmadingiz"}
+
+
+ {/* Bazada bor teglar
*/}
+ Bazada bor teglar
+
+ {rece.map((red) => (
+
+ ))}
+
+
+ {/* tags -------- DON'T TOUCH IT---------- */}
+
+
+
+
+ Categories
+
+
+
+ addCategory(e)} />
+
+ {/* modal */}
+
+
+
+
+
+
+
+
+ setEvTime(e.format("yyyy.MM.DD HH:mm"))}
+ autoOk
+ ampm={false}
+ label="Hodisa bo'lgan vaqti"
+ inputVariant="outlined"
+ format="yyyy.MM.DD HH:mm"
+ />
+
+
+ setViewTime(e.format("yyyy.MM.DD HH:mm"))}
+ autoOk
+ ampm={false}
+ label="Saytga ko'rinish vaqti"
+ inputVariant="outlined"
+ format="yyyy.MM.DD HH:mm"
+ />
+
+
+
+
+
+
+
+ {renderErrorSB}
+ {renderSuccessSB}
+
+ >
+ )
+}
+export default TextUz
diff --git a/src/layouts/analysis24/Tabs/tabuzk/TextUzk.js b/src/layouts/analysis24/Tabs/tabuzk/TextUzk.js
new file mode 100644
index 000000000..fb9490526
--- /dev/null
+++ b/src/layouts/analysis24/Tabs/tabuzk/TextUzk.js
@@ -0,0 +1,53 @@
+import React from "react"
+import { Button } from "@material-ui/core"
+import MDEditor from "@uiw/react-md-editor"
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+import MDInput from "components/MDInput"
+
+function TextUzk({ uzKirile, setUzKirile, uzkText, setUzkText }) {
+ console.log(uzKirile)
+ console.log(uzkText)
+ return (
+ <>
+
+
+ Analysis24 : Kirilcha
+
+
+
+
+
+
+ setUzKirile(e.target.value)}
+ rows="1"
+ />
+
+
+
+
+ >
+ )
+}
+
+export default TextUzk
diff --git a/src/layouts/analysis24/index.js b/src/layouts/analysis24/index.js
new file mode 100644
index 000000000..5ef7e278b
--- /dev/null
+++ b/src/layouts/analysis24/index.js
@@ -0,0 +1,105 @@
+import React from "react"
+
+import { makeStyles } from "@material-ui/core/styles"
+import AppBar from "@material-ui/core/AppBar"
+import Tabs from "@material-ui/core/Tabs"
+import Tab from "@material-ui/core/Tab"
+import Typography from "@material-ui/core/Typography"
+import Box from "@material-ui/core/Box"
+import DashboardLayout from "examples/LayoutContainers/DashboardLayout"
+import TextRu from "./Tabs/tabru/TextRu"
+import TextUzk from "./Tabs/tabuzk/TextUzk"
+import TextUz from "./Tabs/tabuz/TextUz"
+import TextEn from "./Tabs/taben/TextEn"
+
+function TabPanel(props) {
+ const { children, value, index, ...other } = props
+
+ return (
+
+ {value === index && (
+
+ {children}
+
+ )}
+
+ )
+}
+
+function a11yProps(index) {
+ return {
+ id: `simple-tab-${index}`,
+ "aria-controls": `simple-tabpanel-${index}`,
+ }
+}
+
+const useStyles = makeStyles((theme) => ({
+ root: {
+ flexGrow: 1,
+ backgroundColor: theme.palette.background.paper,
+ },
+}))
+
+export default function SimpleTabs() {
+ const classes = useStyles()
+ const [value, setValue] = React.useState(0)
+
+ const [uzText, setUztext] = React.useState("")
+ const [uzTitle, setUztitle] = React.useState("")
+
+ const [uzkvalue, setUzKValue] = React.useState("")
+ const [uzktext, setUzktext] = React.useState("")
+
+ const [ruTitle, setRUTitle] = React.useState("")
+ const [rutext, setRUText] = React.useState("")
+
+ const [engText, setEngText] = React.useState("")
+ const [engtitle, setEngTitle] = React.useState("")
+
+ const handleChange = (newValue) => {
+ setValue(newValue)
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
diff --git a/src/layouts/analysis24/modalKoinot/index.js b/src/layouts/analysis24/modalKoinot/index.js
new file mode 100644
index 000000000..1dd6563d1
--- /dev/null
+++ b/src/layouts/analysis24/modalKoinot/index.js
@@ -0,0 +1,23 @@
+import { Modal } from "@material-ui/core"
+import React from "react"
+
+function ModalKoinot({ display, content, callback }) {
+ return (
+
+
+
+
+
{content}
+
+
+
+
+
+
+
+ )
+}
+
+export default ModalKoinot
diff --git a/src/layouts/authentication/components/CoverLayout/index.js b/src/layouts/authentication/components/CoverLayout/index.js
index 11604fbfe..649184c1e 100644
--- a/src/layouts/authentication/components/CoverLayout/index.js
+++ b/src/layouts/authentication/components/CoverLayout/index.js
@@ -43,13 +43,13 @@ function CoverLayout({ coverHeight, image, children }) {
light
/>
image &&
@@ -62,7 +62,7 @@ function CoverLayout({ coverHeight, image, children }) {
backgroundRepeat: "no-repeat",
}}
/>
-
+
{children}
diff --git a/src/layouts/authentication/sign-in/index.js b/src/layouts/authentication/sign-in/index.js
index 6bdfb72ab..d046c9bc9 100644
--- a/src/layouts/authentication/sign-in/index.js
+++ b/src/layouts/authentication/sign-in/index.js
@@ -1,50 +1,78 @@
-/**
-=========================================================
-* Material Dashboard 2 React - v2.1.0
-=========================================================
-
-* Product Page: https://www.creative-tim.com/product/material-dashboard-react
-* Copyright 2022 Creative Tim (https://www.creative-tim.com)
-
-Coded by www.creative-tim.com
-
- =========================================================
-
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*/
-
-import { useState } from "react";
+import { useState } from "react"
// react-router-dom components
-import { Link } from "react-router-dom";
-
+import { Link, useNavigate } from "react-router-dom"
// @mui material components
-import Card from "@mui/material/Card";
-import Switch from "@mui/material/Switch";
-import Grid from "@mui/material/Grid";
-import MuiLink from "@mui/material/Link";
+import Card from "@mui/material/Card"
+import Switch from "@mui/material/Switch"
+import Grid from "@mui/material/Grid"
+import MuiLink from "@mui/material/Link"
// @mui icons
-import FacebookIcon from "@mui/icons-material/Facebook";
-import GitHubIcon from "@mui/icons-material/GitHub";
-import GoogleIcon from "@mui/icons-material/Google";
+import FacebookIcon from "@mui/icons-material/Facebook"
+import GitHubIcon from "@mui/icons-material/GitHub"
+import GoogleIcon from "@mui/icons-material/Google"
// Material Dashboard 2 React components
-import MDBox from "components/MDBox";
-import MDTypography from "components/MDTypography";
-import MDInput from "components/MDInput";
-import MDButton from "components/MDButton";
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+import MDInput from "components/MDInput"
+import MDButton from "components/MDButton"
// Authentication layout components
-import BasicLayout from "layouts/authentication/components/BasicLayout";
+import BasicLayout from "layouts/authentication/components/BasicLayout"
// Images
-import bgImage from "assets/images/bg-sign-in-basic.jpeg";
+import bgImage from "assets/images/bg-sign-in-basic.jpeg"
+import { FormControl, IconButton, InputAdornment, InputLabel, OutlinedInput } from "@mui/material"
+import { Visibility, VisibilityOff } from "@mui/icons-material"
function Basic() {
- const [rememberMe, setRememberMe] = useState(false);
+ const [rememberMe, setRememberMe] = useState(false)
+
+ // Password onchange button
+ const [showPassword, setShowPassword] = useState(false)
+
+ const handleClickShowPassword = () => setShowPassword((show) => !show)
- const handleSetRememberMe = () => setRememberMe(!rememberMe);
+ const handleMouseDownPassword = (event: MouseEvent) => {
+ event.preventDefault()
+ }
+
+ const history = useNavigate()
+
+ const [passwordN, setPasswordN] = useState("")
+ const [phoneNum, setPhoneNum] = useState("")
+
+ const handleSetRememberMe = () => setRememberMe(!rememberMe)
+ const Login = () => {
+ console.log(passwordN)
+ console.log(phoneNum)
+
+ const requestOptions = {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ password: passwordN,
+ phoneNumber:phoneNum
+ }),
+ }
+
+ fetch("http://165.232.85.45:1988/koinot/auth/login", requestOptions)
+ .then((response) => response.json())
+ .then((data) => {
+ if (data?.objectKoinot?.accessToken?.length > 0 && data.success === 200) {
+ history("/dashboard")
+ localStorage.setItem("Token", data.objectKoinot.accessToken)
+ }
+ })
+ }
+
+ const OnSignup = () => {
+ console.log("on change sign-up")
+ }
return (
@@ -84,10 +112,35 @@ function Basic() {
-
+ setPhoneNum(e.target.value)}
+ />
-
+
+ Password
+
+
+ {showPassword ? : }
+
+
+ }
+ label="Password"
+ onChange={(e) => setPasswordN(e.target.value)}
+ />
+
@@ -101,13 +154,14 @@ function Basic() {
Remember me
-
+
+ Login()}>
sign in
-
+ OnSignup()}>
Don't have an account?{" "}
- );
+ )
}
-export default Basic;
+export default Basic
diff --git a/src/layouts/authentication/sign-up/index.js b/src/layouts/authentication/sign-up/index.js
index b77eefa0e..f071db593 100644
--- a/src/layouts/authentication/sign-up/index.js
+++ b/src/layouts/authentication/sign-up/index.js
@@ -14,25 +14,63 @@ Coded by www.creative-tim.com
*/
// react-router-dom components
-import { Link } from "react-router-dom";
+import { Link, useNavigate } from "react-router-dom"
// @mui material components
-import Card from "@mui/material/Card";
-import Checkbox from "@mui/material/Checkbox";
+import Card from "@mui/material/Card"
+import Checkbox from "@mui/material/Checkbox"
// Material Dashboard 2 React components
-import MDBox from "components/MDBox";
-import MDTypography from "components/MDTypography";
-import MDInput from "components/MDInput";
-import MDButton from "components/MDButton";
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+import MDInput from "components/MDInput"
+import MDButton from "components/MDButton"
// Authentication layout components
-import CoverLayout from "layouts/authentication/components/CoverLayout";
+import CoverLayout from "layouts/authentication/components/CoverLayout"
// Images
-import bgImage from "assets/images/bg-sign-up-cover.jpeg";
+import bgImage from "assets/images/bg-sign-up-cover.jpeg"
+import { useState } from "react"
function Cover() {
+ const history = useNavigate()
+ const [firstN, setFirstN] = useState("")
+ const [lastN, setLastN] = useState("")
+ const [email, setEmail] = useState("")
+ const [password, setPassword] = useState("")
+
+ const handleSingup = () => {
+ console.log("bosildi")
+ const myHeaders = new Headers()
+ myHeaders.append("Content-Type", "application/json")
+
+ const raw = JSON.stringify({
+ firstName: firstN,
+ lastName: lastN,
+ password: email,
+ phoneNumber: password,
+ })
+
+ const requestOptions = {
+ method: "POST",
+ headers: myHeaders,
+ body: raw,
+ redirect: "follow",
+ }
+
+ fetch("https://bazark.uz/api/auth/v1/register", requestOptions)
+ .then((response) => response.json())
+ .then((result) => {
+ if (result) history("/authentication/sign-in")
+ alert(`You are registered`)
+ })
+ .catch((error) => {
+ console.log(error)
+ alert(`You are not registered ${error}`)
+ })
+ }
+
return (
@@ -54,16 +92,43 @@ function Cover() {
Enter your email and password to register
-
+
-
-
+
+ setFirstN(e.target.value)}
+ type="text"
+ label="firstName"
+ variant="standard"
+ fullWidth
+ />
-
-
+
+ setLastN(e.target.value)}
+ type="text"
+ label="lastName"
+ variant="standard"
+ fullWidth
+ />
-
-
+
+ setEmail(e.target.value)}
+ type="password"
+ label="Password"
+ variant="standard"
+ fullWidth
+ />
+
+
+ setPassword(e.target.value)}
+ type="email"
+ label="PhoneNumber"
+ variant="standard"
+ fullWidth
+ />
@@ -86,12 +151,12 @@ function Cover() {
Terms and Conditions
-
-
+
+ handleSingup()} variant="gradient" color="info" fullWidth>
sign in
-
+
Already have an account?{" "}
- );
+ )
}
-export default Cover;
+export default Cover
diff --git a/src/layouts/billing/components/PaymentMethod/index.js b/src/layouts/billing/components/PaymentMethod/index.js
index 689f001a1..7d144f363 100644
--- a/src/layouts/billing/components/PaymentMethod/index.js
+++ b/src/layouts/billing/components/PaymentMethod/index.js
@@ -30,6 +30,7 @@ import visaLogo from "assets/images/logos/visa.png";
// Material Dashboard 2 React context
import { useMaterialUIController } from "context";
+import React from "react";
function PaymentMethod() {
const [controller] = useMaterialUIController();
diff --git a/src/layouts/contreller/index.js b/src/layouts/contreller/index.js
new file mode 100644
index 000000000..0407a8a02
--- /dev/null
+++ b/src/layouts/contreller/index.js
@@ -0,0 +1,164 @@
+import { Card, Grid } from "@mui/material"
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+import DashboardLayout from "examples/LayoutContainers/DashboardLayout"
+import DataTable from "examples/Tables/DataTable"
+import DashboardNavbar from "examples/Navbars/DashboardNavbar"
+import React, { useEffect, useState } from "react"
+
+function Countress() {
+ const [admin, setAdmin] = useState([])
+ // const [division, setDivision] = useState([])
+
+ // Admin Divisions
+ // useEffect(async () => {
+ // const url = "https://wft-geo-db.p.rapidapi.com/v1/geo/adminDivisions"
+ // const options = {
+ // method: "GET",
+ // headers: {
+ // "X-RapidAPI-Key": "83bd21f0aemshd5af6d15ff0ea43p1391d3jsnf3d61450bbe3",
+ // "X-RapidAPI-Host": "wft-geo-db.p.rapidapi.com",
+ // },
+ // }
+
+ // try {
+ // const response = await fetch(url, options)
+ // const result = await response.json()
+ // setAdmin(result.data)
+ // } catch (error) {
+ // console.error(error)
+ // }
+ // }, [])
+
+ // Admin Divisions Near Divisions
+ // useEffect(async () => {
+ // const url =
+ // "https://wft-geo-db.p.rapidapi.com/v1/geo/adminDivisions/Q104994/nearbyDivisions?radius=100"
+ // const options = {
+ // method: "GET",
+ // headers: {
+ // "X-RapidAPI-Key": "83bd21f0aemshd5af6d15ff0ea43p1391d3jsnf3d61450bbe3",
+ // "X-RapidAPI-Host": "wft-geo-db.p.rapidapi.com",
+ // },
+ // }
+
+ // try {
+ // const response = await fetch(url, options)
+ // const result = await response.json()
+ // setAdmin(result.data)
+ // } catch (error) {
+ // console.error(error)
+ // }
+ // }, [])
+
+
+useEffect(async () => {
+ const url = 'https://wft-geo-db.p.rapidapi.com/v1/geo/locations/33.832213-118.387099/nearbyDivisions?radius=100';
+ const options = {
+ method: 'GET',
+ headers: {
+ 'X-RapidAPI-Key': '83bd21f0aemshd5af6d15ff0ea43p1391d3jsnf3d61450bbe3',
+ 'X-RapidAPI-Host': 'wft-geo-db.p.rapidapi.com'
+ }
+ };
+
+ try {
+ const response = await fetch(url, options);
+ const result = await response.json();
+ setAdmin(result.data);
+ } catch (error) {
+ console.error(error);
+ }
+},[])
+console.log(admin)
+ // Columns port
+ const columns = [
+ { Header: "United Arab Emirates", accessor: "country", width: "10%", align: "left" },
+ { Header: "Afg'aniston", accessor: "countryCode", width: "10%", align: "left" },
+ { Header: "Afg'aniston", accessor: "name", width: "10%", align: "left" },
+ { Header: "Afg'aniston", accessor: "region", width: "10%", align: "left" },
+ { Header: "Afg'aniston", accessor: "regionCode", width: "10%", align: "left" },
+ { Header: "Afg'aniston", accessor: "regionWdId", width: "10%", align: "left" },
+ { Header: "Afg'aniston", accessor: "wikiDataId", width: "10%", align: "left" },
+ ]
+ const rows = admin?.map((data) => ({
+ country: (
+
+ {data.country}
+
+ ),
+ countryCode: (
+
+ {data.countryCode}
+
+ ),
+ name: (
+
+ {data.name}
+
+ ),
+ region: (
+
+ {data.region}
+
+ ),
+ regionCode: (
+
+ {data.regionCode}
+
+ ),
+ regionWdId: (
+
+ {data.regionWdId}
+
+ ),
+ wikiDataId: (
+
+ {data.wikiDataId}
+
+ ),
+ }))
+
+
+ return (
+
+
+
+
+
+
+
+
+ United Arab Emirates
+
+
+
+
+
+
+
+
+
+
+ )
+}
+
+export default Countress
diff --git a/src/layouts/rtl/components/OrdersOverview/index.js b/src/layouts/dashboard copy/components/OrdersOverview/index.js
similarity index 76%
rename from src/layouts/rtl/components/OrdersOverview/index.js
rename to src/layouts/dashboard copy/components/OrdersOverview/index.js
index ddeeef50c..3b8dcc587 100644
--- a/src/layouts/rtl/components/OrdersOverview/index.js
+++ b/src/layouts/dashboard copy/components/OrdersOverview/index.js
@@ -29,7 +29,7 @@ function OrdersOverview() {
- نظرة عامة على الطلبات
+ Orders overview
@@ -40,7 +40,7 @@ function OrdersOverview() {
24%
{" "}
- هذا الشهر
+ this month
@@ -48,32 +48,32 @@ function OrdersOverview() {
diff --git a/src/layouts/rtl/components/Projects/data/index.js b/src/layouts/dashboard copy/components/Projects/data/index.js
similarity index 71%
rename from src/layouts/rtl/components/Projects/data/index.js
rename to src/layouts/dashboard copy/components/Projects/data/index.js
index 3947a5184..a05abf933 100644
--- a/src/layouts/rtl/components/Projects/data/index.js
+++ b/src/layouts/dashboard copy/components/Projects/data/index.js
@@ -17,8 +17,6 @@ Coded by www.creative-tim.com
// @mui material components
import Tooltip from "@mui/material/Tooltip";
-
-// Material Dashboard 2 React components
import MDBox from "components/MDBox";
import MDTypography from "components/MDTypography";
import MDAvatar from "components/MDAvatar";
@@ -37,8 +35,8 @@ import team3 from "assets/images/team-3.jpg";
import team4 from "assets/images/team-4.jpg";
export default function data() {
- const avatars = (أعضاء) =>
- أعضاء.map(([image, name]) => (
+ const avatars = (members) =>
+ members.map(([image, name]) => (
- ),
- أعضاء: (
+ companies: ,
+ members: (
{avatars([
[team1, "Ryan Tompson"],
@@ -110,20 +90,20 @@ Coded by www.creative-tim.com
])}
),
- ميزانية: (
+ budget: (
$14,000
),
- إكمال: (
+ completion: (
),
},
{
- المشروع: ,
- أعضاء: (
+ companies: ,
+ members: (
{avatars([
[team2, "Romina Hadid"],
@@ -131,20 +111,20 @@ Coded by www.creative-tim.com
])}
),
- ميزانية: (
+ budget: (
$3,000
),
- إكمال: (
+ completion: (
),
},
{
- المشروع: ,
- أعضاء: (
+ companies: ,
+ members: (
{avatars([
[team1, "Ryan Tompson"],
@@ -152,20 +132,20 @@ Coded by www.creative-tim.com
])}
),
- ميزانية: (
+ budget: (
- غير مضبوط
+ Not set
),
- إكمال: (
+ completion: (
),
},
{
- المشروع: ,
- أعضاء: (
+ companies: ,
+ members: (
{avatars([
[team4, "Jessica Doe"],
@@ -175,38 +155,38 @@ Coded by www.creative-tim.com
])}
),
- ميزانية: (
+ budget: (
$20,500
),
- إكمال: (
+ completion: (
),
},
{
- المشروع: ,
- أعضاء: (
+ companies: ,
+ members: (
{avatars([[team4, "Jessica Doe"]])}
),
- ميزانية: (
+ budget: (
$500
),
- إكمال: (
+ completion: (
),
},
{
- المشروع: ,
- أعضاء: (
+ companies: ,
+ members: (
{avatars([
[team1, "Ryan Tompson"],
@@ -214,12 +194,12 @@ Coded by www.creative-tim.com
])}
),
- ميزانية: (
+ budget: (
$2,000
),
- إكمال: (
+ completion: (
diff --git a/src/layouts/rtl/components/Projects/index.js b/src/layouts/dashboard copy/components/Projects/index.js
similarity index 87%
rename from src/layouts/rtl/components/Projects/index.js
rename to src/layouts/dashboard copy/components/Projects/index.js
index f73c3b88a..4e022aa0d 100644
--- a/src/layouts/rtl/components/Projects/index.js
+++ b/src/layouts/dashboard copy/components/Projects/index.js
@@ -24,10 +24,12 @@ import MenuItem from "@mui/material/MenuItem";
// Material Dashboard 2 React components
import MDBox from "components/MDBox";
import MDTypography from "components/MDTypography";
+
+// Material Dashboard 2 React examples
import DataTable from "examples/Tables/DataTable";
// Data
-import data from "layouts/rtl/components/Projects/data";
+import data from "layouts/dashboard/components/Projects/data";
function Projects() {
const { columns, rows } = data();
@@ -51,9 +53,9 @@ function Projects() {
open={Boolean(menu)}
onClose={closeMenu}
>
-
-
-
+
+
+
);
@@ -62,7 +64,7 @@ function Projects() {
- المشاريع
+ Projects
- 30 انتهى هذا الشهر
+ 30 done this month
diff --git a/src/layouts/rtl/data/reportsBarChartData.js b/src/layouts/dashboard copy/data/reportsBarChartData.js
similarity index 100%
rename from src/layouts/rtl/data/reportsBarChartData.js
rename to src/layouts/dashboard copy/data/reportsBarChartData.js
diff --git a/src/layouts/rtl/data/reportsLineChartData.js b/src/layouts/dashboard copy/data/reportsLineChartData.js
similarity index 100%
rename from src/layouts/rtl/data/reportsLineChartData.js
rename to src/layouts/dashboard copy/data/reportsLineChartData.js
diff --git a/src/layouts/dashboard copy/index.js b/src/layouts/dashboard copy/index.js
new file mode 100644
index 000000000..8508f2ab2
--- /dev/null
+++ b/src/layouts/dashboard copy/index.js
@@ -0,0 +1,269 @@
+import Card from "@mui/material/Card"
+import Grid from "@mui/material/Grid"
+import DashboardLayout from "examples/LayoutContainers/DashboardLayout"
+
+// @mui material components
+
+// Material Dashboard 2 React components
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+import MDSnackbar from "components/MDSnackbar"
+// Material Dashboard 2 React example components
+import Tooltip from "@mui/material/Tooltip"
+import DashboardNavbar from "examples/Navbars/DashboardNavbar"
+import DataTable from "examples/Tables/DataTable"
+import { useEffect, useState } from "react"
+
+import AddModal from "./modals/addModal"
+import DeleteModal from "./modals/deleteModal"
+import EditModal from "./modals/editModal"
+
+function Categoreis() {
+ const [categories, setCategories] = useState([])
+ const [categoriesRef, setCategoriesRef] = useState(false)
+ // Succes Notification
+ const [successSB, setSuccessSB] = useState({ open: false, message: "" })
+ const openSuccessSB = (mes) => setSuccessSB({ open: true, message: mes })
+ const closeSuccessSB = () => setSuccessSB({ open: false })
+ // Error Notification
+ const [errorSB, setErrorSB] = useState({ open: false, message: "" })
+ const openErrorSB = (errorMes) => setErrorSB({ open: true, message: errorMes })
+ const closeErrorSB = () => setErrorSB({ open: false })
+
+ // Categories information api
+ useEffect(() => {
+ const requestOptions = {
+ method: "GET",
+ headers: { "Content-Type": "application/json" },
+ }
+ fetch("http://165.232.85.45:1988/koinot/category", requestOptions)
+ .then((response) => response.json())
+ .then((data) => setCategories(data.objectKoinot))
+ }, [categoriesRef])
+
+ // Delete Category
+ const deleteCategory = (id) => {
+ const Token = localStorage.getItem("Token")
+ const myHeaders = new Headers()
+ myHeaders.append("Content-Type", "application/json")
+ myHeaders.append("Authorization", `Bearer ${Token}`)
+ const requestOptions = {
+ method: "DELETE",
+ headers: myHeaders,
+ redirect: "follow",
+ }
+
+ fetch(`http://165.232.85.45:1988/koinot/category/${id}`, requestOptions)
+ .then((response) => response.text())
+ .then((result) => {
+ const res = JSON.parse(result)
+ console.log(typeof res.message, res.success)
+ if (res.success === 200) {
+ openSuccessSB("Category deleted successfully")
+ setCategoriesRef(!categoriesRef)
+ }
+ })
+ .catch((error) => {
+ console.log(error)
+ openErrorSB(`Category not deleted ${error}`)
+ })
+ }
+ // Edit Category
+ const editCategory = (edit) => {
+ console.log(edit)
+ const myHeaders = new Headers()
+ myHeaders.append("Content-Type", "application/json")
+
+ const raw = JSON.stringify({
+ id: edit.id,
+ textEn: edit.textEn,
+ textRu: edit.textRu,
+ textUz: edit.textUz,
+ textUzK: edit.textUzK,
+ })
+
+ const requestOptions = {
+ method: "POST",
+ headers: myHeaders,
+ body: raw,
+ redirect: "follow",
+ }
+
+ fetch("http://165.232.85.45:1988/koinot/category", requestOptions)
+ .then((response) => response.json())
+ .then((res) => {
+ console.log(typeof res.message, res.success)
+ if (res.success === 200) {
+ openSuccessSB("Category edit successfully")
+ setCategoriesRef(!categoriesRef)
+ }
+ })
+ .catch((error) => {
+ console.log(error)
+ openErrorSB(`Category not Edit ${error}`)
+ })
+ }
+
+ // Add Category
+ const addCategory = (add) => {
+ console.log(add)
+ const myHeaders = new Headers()
+ const token = localStorage.getItem("Token")
+ myHeaders.append("Content-Type", "application/json")
+ myHeaders.append("Authorization", `Bearer access_${token}`)
+
+ const raw = JSON.stringify({
+ textEn: add.addEng,
+ textRu: add.addRus,
+ textUz: add.addUzb,
+ textUzK: add.addUzbK,
+ })
+
+ const requestOptions = {
+ method: "POST",
+ headers: myHeaders,
+ body: raw,
+ redirect: "follow",
+ }
+
+ fetch("http://165.232.85.45:1988/koinot/category", requestOptions)
+ .then((response) => response.text())
+ .then((result) => {
+ const res = JSON.parse(result)
+ console.log(typeof res.message, res.success)
+ if (res.success === 200) {
+ openSuccessSB("Category added successfully")
+ setCategoriesRef(!categoriesRef)
+ }
+ })
+ .catch((error) => {
+ console.log(error)
+ openErrorSB(`Category not added ${error}`)
+ })
+ }
+
+ // Notifications
+ const renderSuccessSB = (
+
+ )
+ const renderErrorSB = (
+
+ )
+
+ // Columns port
+ const columns = [
+ { Header: "Uzb", accessor: "uzbek", width: "20%", align: "left" },
+ { Header: "UzK", accessor: "kiril", width: "20%", align: "left" },
+ { Header: "Rus", accessor: "ruscha", width: "20%", align: "left" },
+ { Header: "Eng", accessor: "english", width: "20%", align: "left" },
+ { Header: "Edit", accessor: "edit", width: "20%", align: "right" },
+ { Header: "Delete", accessor: "delete", width: "20%", align: "right" },
+ ]
+
+ // Rows categories
+ const rows = categories.map((item) => ({
+ uzbek: (
+
+ {item.textUz}
+
+ ),
+ kiril: (
+
+ {item.textUzK}
+
+ ),
+ ruscha: (
+
+ {item.textRu}
+
+ ),
+ english: (
+
+ {item.textEn}
+
+ ),
+ edit: (
+
+ editCategory(e)}
+ />
+
+ ),
+ delete: (
+
+
+ deleteCategory(e)} />
+
+
+ ),
+ }))
+
+ return (
+
+ Category
+
+
+
+
+
+
+
+ Category Table
+
+ addCategory(e)} />
+
+
+
+
+
+
+
+
+ {renderSuccessSB}
+ {renderErrorSB}
+
+ )
+}
+
+export default Categoreis
diff --git a/src/layouts/dashboard copy/modals/addModal/index.js b/src/layouts/dashboard copy/modals/addModal/index.js
new file mode 100644
index 000000000..859cde32a
--- /dev/null
+++ b/src/layouts/dashboard copy/modals/addModal/index.js
@@ -0,0 +1,83 @@
+import * as React from "react"
+import Box from "@mui/material/Box"
+import MDButton from "components/MDButton"
+import Typography from "@mui/material/Typography"
+import Modal from "@mui/material/Modal"
+import Icon from "@mui/material/Icon"
+import MDInput from "components/MDInput"
+
+export default function AddModal({ saveBtn, title, tagtitle }) {
+ const style = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ transform: "translate(-50%, -50%)",
+ width: 400,
+ bgcolor: "background.paper",
+ border: "2px solid #000",
+ boxShadow: 24,
+ p: 4,
+ display: "flex",
+ flexDirection: "column",
+ height: "390px",
+ justifyContent: "space-between",
+ }
+
+ const [open, setOpen] = React.useState(false)
+ const [textUzb, setTextUzb] = React.useState("")
+ const [textUzbK, setTextUzbK] = React.useState("")
+ const [textRus, setTextRus] = React.useState("")
+ const [textEng, setTextEng] = React.useState("")
+ const handleOpen = () => setOpen(true)
+ const handleClose = () => {
+ setOpen(false)
+ setTextUzb("")
+ setTextUzbK("")
+ setTextRus("")
+ setTextEng("")
+ }
+ const handleAdd = () => {
+ saveBtn({
+ addUzb: textUzb,
+ addUzbK: textUzbK,
+ addRus: textRus,
+ addEng: textEng,
+ })
+ setOpen(false)
+ setTextUzb("")
+ setTextUzbK("")
+ setTextRus("")
+ setTextEng("")
+ }
+ return (
+
+
+ add
+ {title}
+ {tagtitle}
+
+
+
+
+ Kategorya qushish
+
+ setTextUzb(e.target.value)} />
+ setTextUzbK(e.target.value)} />
+ setTextRus(e.target.value)} />
+ setTextEng(e.target.value)} />
+
+ Save
+
+
+ Close
+
+
+
+
+ )
+}
diff --git a/src/layouts/dashboard copy/modals/deleteModal/index.js b/src/layouts/dashboard copy/modals/deleteModal/index.js
new file mode 100644
index 000000000..87793082a
--- /dev/null
+++ b/src/layouts/dashboard copy/modals/deleteModal/index.js
@@ -0,0 +1,61 @@
+import DeleteIcon from "@mui/icons-material/Delete"
+import { Tooltip } from "@mui/material"
+import Box from "@mui/material/Box"
+import Modal from "@mui/material/Modal"
+import Typography from "@mui/material/Typography"
+import MDButton from "components/MDButton"
+import { useState } from "react"
+
+export default function DeleteModal({ deleteBtn, itemData }) {
+ const style = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ transform: "translate(-50%, -50%)",
+ width: 400,
+ bgcolor: "background.paper",
+ border: "2px solid #000",
+ boxShadow: 24,
+ p: 4,
+ display: "flex",
+ flexDirection: "column",
+ height: "200px",
+ justifyContent: "space-between",
+ }
+
+ const [open, setOpen] = useState(false)
+ const handleOpen = () => setOpen(true)
+ const handleClose = () => setOpen(false)
+ const handleDelete = (value) => {
+ deleteBtn(value)
+ setOpen(false)
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
+ Kategorya ochirmoqchimisiz?
+
+ handleDelete(itemData.id)} variant="gradient" color="dark">
+ Xa
+
+
+ Yuq
+
+
+
+
+ )
+}
diff --git a/src/layouts/dashboard copy/modals/editModal/index.js b/src/layouts/dashboard copy/modals/editModal/index.js
new file mode 100644
index 000000000..624d12ab2
--- /dev/null
+++ b/src/layouts/dashboard copy/modals/editModal/index.js
@@ -0,0 +1,87 @@
+import Box from "@mui/material/Box"
+import Modal from "@mui/material/Modal"
+import Typography from "@mui/material/Typography"
+import MDButton from "components/MDButton"
+import MDInput from "components/MDInput"
+import Tooltip from "@mui/material/Tooltip"
+import * as React from "react"
+import { EditRounded } from "@mui/icons-material"
+
+export default function EditModal({id, nameUzb, nameUzbK, nameRus, nameEng, saveAllName }) {
+ const style = {
+ position: "absolute",
+ top: "50%",
+ left: "50%",
+ transform: "translate(-50%, -50%)",
+ width: 400,
+ bgcolor: "background.paper",
+ border: "2px solid #000",
+ boxShadow: 24,
+ p: 4,
+ display: "flex",
+ flexDirection: "column",
+ height: "390px",
+ justifyContent: "space-between",
+ }
+ const [open, setOpen] = React.useState(false)
+ const [textUz, setTextUzb] = React.useState(nameUzb)
+ const [textUzK, setTextUzbK] = React.useState(nameUzbK)
+ const [textRu, setTextRus] = React.useState(nameRus)
+ const [textEn, setTextEng] = React.useState(nameEng)
+ const handleOpen = () => setOpen(true)
+ const handleClose = () => setOpen(false)
+ const handleSave = () => {
+ saveAllName({id, textUz, textUzK, textRu, textEn })
+ setOpen(false)
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ Kategorya uzgartirish
+
+ setTextUzb(e.target.value)}
+ />
+ setTextUzbK(e.target.value)}
+ />
+ setTextEng(e.target.value)}
+ />
+ setTextRus(e.target.value)}
+ />
+ handleSave()} variant="gradient" color="dark">
+ Save
+
+
+ Close
+
+
+
+
+ )
+}
diff --git a/src/layouts/feedback controller/feedmodal/feedlook/index.js b/src/layouts/feedback controller/feedmodal/feedlook/index.js
new file mode 100644
index 000000000..34688a26f
--- /dev/null
+++ b/src/layouts/feedback controller/feedmodal/feedlook/index.js
@@ -0,0 +1,82 @@
+import Box from "@mui/material/Box"
+import Modal from "@mui/material/Modal"
+import Typography from "@mui/material/Typography"
+import MDBox from "components/MDBox"
+import MDInput from "components/MDInput"
+import * as React from "react"
+import { FormControl, IconButton } from "@mui/material"
+import { Visibility, VisibilityOff } from "@mui/icons-material"
+
+export default function FeedlookModal({ name, email, phoneNumber, title }) {
+ const style = {
+ position: "absolute",
+ top: "50%",
+ left: "55%",
+ transform: "translate(-50%, -50%)",
+ width: "70%",
+ bgcolor: "background.paper",
+ border: "2px solid #000",
+ boxShadow: 24,
+ p: 4,
+ display: "flex",
+ flexDirection: "column",
+ height: "auto",
+ justifyContent: "space-between",
+ borderRadius: "10px",
+ }
+
+ const [checked, setChecked] = React.useState(false)
+ const handleClose = () => setChecked(false)
+
+ const handleClickShowPassword = () => {
+ setChecked((prev) => !prev)
+ }
+
+ const handleMouseDownPassword = () => {}
+
+ return (
+
+
+
+ {setChecked ? : }
+
+
+
+
+
+ Xabarni kuring
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Fikir:
+
+
+ {title}
+
+
+
+
+
+ )
+}
diff --git a/src/layouts/feedback controller/index.js b/src/layouts/feedback controller/index.js
new file mode 100644
index 000000000..471394b87
--- /dev/null
+++ b/src/layouts/feedback controller/index.js
@@ -0,0 +1,172 @@
+// @mui material components
+import Grid from "@mui/material/Grid"
+import Card from "@mui/material/Card"
+
+// Material Dashboard 2 React components
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+import MDButton from "components/MDButton"
+
+// Material Dashboard 2 React example components
+import DashboardLayout from "examples/LayoutContainers/DashboardLayout"
+import DashboardNavbar from "examples/Navbars/DashboardNavbar"
+import Footer from "examples/Footer"
+import DataTable from "examples/Tables/DataTable"
+// Dat
+import { AddTask } from "@mui/icons-material"
+import { IconButton } from "@mui/material"
+import { useEffect, useState } from "react"
+import MDInput from "components/MDInput"
+import FeedlookModal from "./feedmodal/feedlook"
+
+function FeedbackController() {
+ const [openfeed, setOpenFeed] = useState([])
+ const [swichFeedBack, setSwichFeedBack] = useState(false)
+ const [refrFeedBack, setRefrFeedBack] = useState(false)
+
+ useEffect(() => {
+ const requestOptions = {
+ method: "GET",
+ redirect: "follow",
+ }
+
+ fetch(`http://165.232.85.45:1988/koinot/feedback?active=${swichFeedBack}`, requestOptions)
+ .then((response) => response.json())
+ .then((result) => setOpenFeed(result.object.content))
+ .catch((error) => console.log("error", error))
+ }, [swichFeedBack,refrFeedBack])
+
+ const handleSaveFeedback = (id) => {
+ console.log(id, "id")
+ const requestOptions = {
+ method: "PUT",
+ redirect: "follow",
+ }
+
+ fetch(
+ `http://165.232.85.45:1988/koinot/feedback/changeActive/${id}?active=${!swichFeedBack}`,
+ requestOptions
+ )
+ .then((response) => response.json())
+ .then(() => setRefrFeedBack(!refrFeedBack))
+ .catch((error) => console.log("error", error))
+ }
+
+ const columns = [
+ { Header: "Name", accessor: "fullname", width: "35%", align: "left" },
+ { Header: "PhoneNumber", accessor: "number", width: "35%", align: "left" },
+ { Header: "information", accessor: "information", width: "45%", align: "left" },
+ { Header: "hide", accessor: "hide", width: "35%", align: "left" },
+ ]
+ const rows = openfeed?.map((data) => ({
+ fullname: (
+
+
+ {data.fullName}
+
+
+ ),
+ number: (
+
+
+ {data.phoneNumber}
+
+
+ ),
+ information: (
+
+
+
+ ),
+ hide: (
+
+ handleSaveFeedback(data.id)}>
+
+
+
+ ),
+ }))
+
+ return (
+
+
+
+
+
+
+
+
+ Feedback controller {swichFeedBack ? "o'qilmadi" : "o'qildi"}
+
+
+
+ setSwichFeedBack(true)}
+ >
+ uqilmadi
+
+
+
+ setSwichFeedBack(false)}
+ >
+ UQILDI
+
+
+
+ Soni:{openfeed.length}
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
+
+export default FeedbackController
diff --git a/src/layouts/new-chaild-controller/index.js b/src/layouts/new-chaild-controller/index.js
new file mode 100644
index 000000000..d0e049d32
--- /dev/null
+++ b/src/layouts/new-chaild-controller/index.js
@@ -0,0 +1,64 @@
+// @mui material components
+import Grid from "@mui/material/Grid"
+import Card from "@mui/material/Card"
+// Material Dashboard 2 React components
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+
+// Material Dashboard 2 React example components
+import DashboardLayout from "examples/LayoutContainers/DashboardLayout"
+import DashboardNavbar from "examples/Navbars/DashboardNavbar"
+import Footer from "examples/Footer"
+import DataTable from "examples/Tables/DataTable"
+
+// Data
+import authorsTableData from "layouts/tables/data/authorsTableData"
+
+
+
+function NewChaildController() {
+ const { columns, rows } = authorsTableData()
+
+
+
+
+ return (
+
+
+
+
+
+
+
+
+ Authors Table
+
+
+
+
+
+
+
+
+
+
+
+ )
+}
+
+export default NewChaildController
diff --git a/src/layouts/rtl/index.js b/src/layouts/rtl/index.js
deleted file mode 100644
index 67b9216d1..000000000
--- a/src/layouts/rtl/index.js
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
-=========================================================
-* Material Dashboard 2 React - v2.1.0
-=========================================================
-
-* Product Page: https://www.creative-tim.com/product/material-dashboard-react
-* Copyright 2022 Creative Tim (https://www.creative-tim.com)
-
-Coded by www.creative-tim.com
-
- =========================================================
-
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*/
-
-import { useEffect } from "react";
-
-// @mui material components
-import Grid from "@mui/material/Grid";
-
-// Material Dashboard 2 React components
-import MDBox from "components/MDBox";
-
-// Material Dashboard 2 React example components
-import DashboardLayout from "examples/LayoutContainers/DashboardLayout";
-import DashboardNavbar from "examples/Navbars/DashboardNavbar";
-import Footer from "examples/Footer";
-import ReportsBarChart from "examples/Charts/BarCharts/ReportsBarChart";
-import ReportsLineChart from "examples/Charts/LineCharts/ReportsLineChart";
-import ComplexStatisticsCard from "examples/Cards/StatisticsCards/ComplexStatisticsCard";
-
-// Data
-import reportsBarChartData from "layouts/rtl/data/reportsBarChartData";
-import reportsLineChartData from "layouts/rtl/data/reportsLineChartData";
-
-// RTL components
-import Projects from "layouts/rtl/components/Projects";
-import OrdersOverview from "layouts/rtl/components/OrdersOverview";
-
-// Material Dashboard 2 React contexts
-import { useMaterialUIController, setDirection } from "context";
-
-function RTL() {
- const [, dispatch] = useMaterialUIController();
- const { sales, tasks } = reportsLineChartData;
-
- // Changing the direction to rtl
- useEffect(() => {
- setDirection(dispatch, "rtl");
-
- return () => setDirection(dispatch, "ltr");
- }, []);
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- (+15%) زيادة في مبيعات اليوم..
- >
- }
- date="تم التحديث منذ 4 دقائق"
- chart={sales}
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
-
-export default RTL;
diff --git a/src/layouts/tables/data/authorsTableData.js b/src/layouts/tables/data/authorsTableData.js
index b561b8be3..ece2739e1 100644
--- a/src/layouts/tables/data/authorsTableData.js
+++ b/src/layouts/tables/data/authorsTableData.js
@@ -1,30 +1,16 @@
/* eslint-disable react/prop-types */
/* eslint-disable react/function-component-definition */
-/**
-=========================================================
-* Material Dashboard 2 React - v2.1.0
-=========================================================
-
-* Product Page: https://www.creative-tim.com/product/material-dashboard-react
-* Copyright 2022 Creative Tim (https://www.creative-tim.com)
-
-Coded by www.creative-tim.com
-
- =========================================================
-
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*/
// Material Dashboard 2 React components
-import MDBox from "components/MDBox";
-import MDTypography from "components/MDTypography";
-import MDAvatar from "components/MDAvatar";
-import MDBadge from "components/MDBadge";
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+import MDAvatar from "components/MDAvatar"
+import MDBadge from "components/MDBadge"
// Images
-import team2 from "assets/images/team-2.jpg";
-import team3 from "assets/images/team-3.jpg";
-import team4 from "assets/images/team-4.jpg";
+import team2 from "assets/images/team-2.jpg"
+import team3 from "assets/images/team-3.jpg"
+import team4 from "assets/images/team-4.jpg"
export default function data() {
const Author = ({ image, name, email }) => (
@@ -37,7 +23,7 @@ export default function data() {
{email}
- );
+ )
const Job = ({ title, description }) => (
@@ -46,7 +32,7 @@ export default function data() {
{description}
- );
+ )
return {
columns: [
@@ -173,5 +159,5 @@ export default function data() {
),
},
],
- };
+ }
}
diff --git a/src/layouts/tag-controller/index.js b/src/layouts/tag-controller/index.js
new file mode 100644
index 000000000..155bfb277
--- /dev/null
+++ b/src/layouts/tag-controller/index.js
@@ -0,0 +1,276 @@
+// @mui material components
+import Grid from "@mui/material/Grid"
+import Card from "@mui/material/Card"
+
+// Material Dashboard 2 React components
+import MDBox from "components/MDBox"
+import MDTypography from "components/MDTypography"
+
+// Material Dashboard 2 React example components
+import DashboardLayout from "examples/LayoutContainers/DashboardLayout"
+import DashboardNavbar from "examples/Navbars/DashboardNavbar"
+import DataTable from "examples/Tables/DataTable"
+
+import { useEffect, useState } from "react"
+import AddModal from "layouts/dashboard copy/modals/addModal"
+import DeleteModal from "layouts/dashboard copy/modals/deleteModal"
+import EditModal from "layouts/dashboard copy/modals/editModal"
+import MDSnackbar from "components/MDSnackbar"
+
+function TagController() {
+ const [tagcontrol, setTagControl] = useState([])
+ const [categoriesRef, setCategoriesRef] = useState(false)
+ // Succes Notification
+ const [successSB, setSuccessSB] = useState({ open: false, message: "" })
+ const openSuccessSB = (mes) => setSuccessSB({ open: true, message: mes })
+ const closeSuccessSB = () => setSuccessSB({ open: false })
+ // Error Notification
+ const [errorSB, setErrorSB] = useState({ open: false, message: "" })
+ const openErrorSB = (errorMes) => setErrorSB({ open: true, message: errorMes })
+ const closeErrorSB = () => setErrorSB({ open: false })
+
+ useEffect(() => {
+ const requestOptions = {
+ method: "GET",
+ }
+
+ fetch("http://165.232.85.45:1988/koinot/tag", requestOptions)
+ .then((response) => response.json())
+ .then((data) => {
+ setTagControl(data.objectKoinot)
+ })
+ }, [categoriesRef])
+
+ // If the add new tag
+ const tagcontrolAdd = (tag) => {
+ console.log(tag)
+ const myHeaders = new Headers()
+ const token = localStorage.getItem("Token")
+ myHeaders.append("Content-Type", "application/json")
+ myHeaders.append("Authorization", `Bearer ${token}`)
+
+ const raw = JSON.stringify({
+ textEn: tag.addEng,
+ textRu: tag.addRus,
+ textUz: tag.addUzb,
+ textUzK: tag.addUzbK,
+ })
+
+ const requestOptions = {
+ method: "POST",
+ headers: myHeaders,
+ body: raw,
+ redirect: "follow",
+ }
+
+ fetch("http://165.232.85.45:1988/koinot/tag", requestOptions)
+ .then((response) => response.json())
+ .then((res) => {
+ console.log(typeof res.message, res.success)
+ if (res.success === 200) {
+ openSuccessSB("TagController addtag successfully")
+ setCategoriesRef(!categoriesRef)
+ }
+ })
+ .catch((error) => {
+ console.log(error)
+ openErrorSB(`TagController not Addtag ${error}`)
+ })
+ }
+
+ // If the request is successful edit the tag and return
+ const updateTagControl = (item) => {
+ console.log("item", item)
+ const myHeaders = new Headers()
+ const token = localStorage.getItem("Token")
+ myHeaders.append("Content-Type", "application/json")
+ myHeaders.append("Authorization", `Bearer ${token}`)
+
+ const raw = JSON.stringify({
+ textEn: item.textUz,
+ textRu: item.textRu,
+ textUz: item.textUz,
+ textUzK: item.textUzK,
+ })
+
+ const requestOptions = {
+ method: "PUT",
+ headers: myHeaders,
+ body: raw,
+ redirect: "follow",
+ }
+
+ fetch(`http://165.232.85.45:1988/koinot/tag/${item.id}`, requestOptions)
+ .then((response) => response.json())
+ .then((res) => {
+ console.log(typeof res.message, res.success)
+ if (res.success === 200) {
+ openSuccessSB("TagController edit successfully")
+ setCategoriesRef(!categoriesRef)
+ }
+ })
+ .catch((error) => {
+ console.log(error)
+ openErrorSB(`TagController not Edit ${error}`)
+ })
+ }
+
+ // If it is already delete, then remove it from the list
+ const tagDelete = (id) => {
+ console.log(id)
+ const myHeaders = new Headers()
+ const token = localStorage.getItem("Token")
+ myHeaders.append("Content-Type", "application/json")
+ myHeaders.append("Authorization", `Bearer ${token}`)
+
+ const raw = ""
+
+ const requestOptions = {
+ method: "DELETE",
+ headers: myHeaders,
+ body: raw,
+ redirect: "follow",
+ }
+
+ fetch(`http://165.232.85.45:1988/koinot/tag/${id}`, requestOptions)
+ .then((response) => response.json())
+ .then((res) => {
+ console.log(typeof res.message, res.success)
+ if (res.success === 200) {
+ openSuccessSB("Category delete successfully")
+ setCategoriesRef(!categoriesRef)
+ }
+ })
+ .catch((error) => {
+ console.log(error)
+ openErrorSB(`Category not Delete ${error}`)
+ })
+ }
+
+ // Notifications
+ const renderSuccessSB = (
+
+ )
+ const renderErrorSB = (
+
+ )
+
+ // Columns port
+ const columns = [
+ { Header: "Uzb", accessor: "uzbek", width: "20%", align: "left" },
+ { Header: "UzK", accessor: "kiril", width: "20%", align: "left" },
+ { Header: "Rus", accessor: "ruscha", width: "20%", align: "left" },
+ { Header: "Eng", accessor: "english", width: "20%", align: "left" },
+ { Header: "Data", accessor: "data", width: "20%", align: "left" },
+ { Header: "Edit", accessor: "edit", width: "20%", align: "right" },
+ { Header: "Delete", accessor: "delete", width: "20%", align: "right" },
+ ]
+
+ const rows = tagcontrol.map((tag) => ({
+ uzbek: (
+
+ {tag.textUz}
+
+ ),
+ kiril: (
+
+ {tag.textUzK}
+
+ ),
+ ruscha: (
+
+ {tag.textRu}
+
+ ),
+ english: (
+
+ {tag.textEn}
+
+ ),
+ data: (
+
+ {tag.updatedAt}
+
+ ),
+ edit: (
+
+ updateTagControl(e)}
+ />
+
+ ),
+ delete: (
+
+ tagDelete(e)} />
+
+ ),
+ }))
+
+ return (
+
+
+
+
+
+
+
+
+ TagController Table
+
+ tagcontrolAdd(e)} />
+
+
+
+
+
+
+
+
+ {renderSuccessSB}
+ {renderErrorSB}
+
+ )
+}
+
+export default TagController
diff --git a/src/routes.js b/src/routes.js
index 160f2fed7..837d9aacf 100644
--- a/src/routes.js
+++ b/src/routes.js
@@ -1,18 +1,3 @@
-/**
-=========================================================
-* Material Dashboard 2 React - v2.1.0
-=========================================================
-
-* Product Page: https://www.creative-tim.com/product/material-dashboard-react
-* Copyright 2022 Creative Tim (https://www.creative-tim.com)
-
-Coded by www.creative-tim.com
-
- =========================================================
-
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*/
-
/**
All of the routes for the Material Dashboard 2 React are added here,
You can add a new route, customize the routes and delete the routes here.
@@ -36,17 +21,26 @@ Coded by www.creative-tim.com
*/
// Material Dashboard 2 React layouts
-import Dashboard from "layouts/dashboard";
-import Tables from "layouts/tables";
-import Billing from "layouts/billing";
-import RTL from "layouts/rtl";
-import Notifications from "layouts/notifications";
-import Profile from "layouts/profile";
-import SignIn from "layouts/authentication/sign-in";
-import SignUp from "layouts/authentication/sign-up";
+
+import Dashboard from "layouts/dashboard"
+import Categoreis from "layouts/dashboard copy"
+import Tables from "layouts/tables"
+import Billing from "layouts/billing"
+// import RTL from "layouts/RTL";
+import Notifications from "layouts/notifications"
+import Profile from "layouts/profile"
+import SignIn from "layouts/authentication/sign-in"
+import SignUp from "layouts/authentication/sign-up"
// @mui icons
-import Icon from "@mui/material/Icon";
+import Icon from "@mui/material/Icon"
+import React from "react"
+import TagConTroller from "layouts/tag-controller"
+import NewChaildController from "layouts/new-chaild-controller"
+import Countress from "layouts/contreller"
+import FeedbackController from "layouts/feedback controller"
+import Analysis24 from "layouts/analysis24"
+
const routes = [
{
@@ -57,6 +51,55 @@ const routes = [
route: "/dashboard",
component: ,
},
+ {
+ type: "collapse",
+ name: "Categoreis",
+ key: "categories",
+ icon: Categoreis,
+ route: "/categories",
+ component: ,
+ },
+ {
+ type: "collapse",
+ name: "TagConTroller",
+ key: "tagcontroller",
+ icon: TagConTroller,
+ route: "/tag-controller",
+ component: ,
+ },
+ {
+ type: "collapse",
+ name: "Feedback Controller",
+ key: "feedbackcontroller",
+ icon: Feedback Controller,
+ route: "/feedback-controller",
+ component: ,
+ },
+ {
+ type: "collapse",
+ name: "Analysis24",
+ key: "analysis24",
+ icon: Analysis24,
+ route: "/analysis-24",
+ component: ,
+ },
+
+ {
+ type: "collapse",
+ name: "NewChaldController",
+ key: "newchaildcontroller",
+ icon: NewChaildController,
+ route: "/new-chald-tag-controller",
+ component: ,
+ },
+ {
+ type: "collapse",
+ name: "Countress",
+ key: "countress",
+ icon: Countress,
+ route: "/countryeis",
+ component: ,
+ },
{
type: "collapse",
name: "Tables",
@@ -73,14 +116,14 @@ const routes = [
route: "/billing",
component: ,
},
- {
- type: "collapse",
- name: "RTL",
- key: "rtl",
- icon: format_textdirection_r_to_l,
- route: "/rtl",
- component: ,
- },
+ // {
+ // type: "collapse",
+ // name: "RTL",
+ // key: "rtl",
+ // icon: format_textdirection_r_to_l,
+ // route: "/rtl",
+ // component: ,
+ // },
{
type: "collapse",
name: "Notifications",
@@ -99,7 +142,7 @@ const routes = [
},
{
type: "collapse",
- name: "Sign In",
+ name: "Sign in",
key: "sign-in",
icon: login,
route: "/authentication/sign-in",
@@ -113,6 +156,6 @@ const routes = [
route: "/authentication/sign-up",
component: ,
},
-];
+]
-export default routes;
+export default routes