diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..005449e
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+pjson.js
\ No newline at end of file
diff --git a/lib/api.js b/lib/api.js
index f9d7624..3356ddc 100644
--- a/lib/api.js
+++ b/lib/api.js
@@ -20,3 +20,4 @@ export const AppFile = addr => {
return `${serve}/${addr}`
}
export const AppProduction = 'https://mehriranianco.ir/api/'
+// export const AppProduction = 'http://127.0.0.1:8000/api/'
diff --git a/pages/Gallery.js b/pages/Gallery.js
index 39dd3b7..935bfab 100644
--- a/pages/Gallery.js
+++ b/pages/Gallery.js
@@ -1,93 +1,356 @@
-import React, { useEffect, useState } from 'react'
-import axios from 'axios'
-import AppContainer from './appContainer'
-import { AppFile, AppUrl } from '../lib/api'
-import Image from 'next/image'
-import dynamic from 'next/dynamic'
-import { Suspense } from 'react'
-
-import { MDBBtn, MDBCol, MDBContainer, MDBRow } from 'mdb-react-ui-kit'
-import { LightBox } from 'react-lightbox-pack'
-import { Button, Divider, Tab, TabList, TabPanel, TabPanels, Tabs } from '@chakra-ui/react'
-
-const APV = dynamic(() => import('./components/Videos'), {
- ssr: false
-})
-const shimmer = (w, h) => `
-
-
-
-
-
-
-
-
-
-
-
- `
-
-const toBase64 = str => (typeof window === 'undefined' ? Buffer.from(str).toString('base64') : window.btoa(str))
-
-const Gallery = dataImage => {
- const [Images, SetImages] = useState(dataImage)
- const [justifyActive, setJustifyActive] = React.useState('tab1')
- const [toggle, setToggle] = React.useState(false)
- const [sIndex, setSIndex] = React.useState(0)
- const [filterId, setFilterId] = React.useState(1)
- const Parallax = ({ quality }) => {
- return `../resource/parallax/Gallery.jpg`
- }
-// const Filter = async filter => {
-// const res = await axios.get(AppUrl(`FilterGalleyImages/${filter}`))
-// SetImages({ dataImage: res.data })
-// setFilterId(filter)
-// }
-
-// const AllImage = async () => {
-// const res = await axios.get(AppUrl(`GetGalleyImages`))
-// SetImages({ dataImage: res.data })
-// }
-
- // Handler
-// const lightBoxHandler = (state, sIndex) => {
-// setToggle(state)
-// setSIndex(sIndex)
-// }
-
- const handleJustifyClick = value => {
- if (value === justifyActive) {
- return
- }
-
- setJustifyActive(value)
- }
- return (
-
- )
-}
-export async function getServerSideProps(context) {
- // const res = await axios.get(AppUrl('GetGalleyImages'));
- return {
- props: {
- dataImage: null
- } // will be passed to the page component as props
- }
-}
-export default Gallery
+import fs from 'fs'
+import path from 'path'
+import React, { useEffect, useState } from 'react'
+import Image from 'next/image'
+import AppContainer from './appContainer'
+
+const shimmer = (width, height) => `
+
+
+
+
+
+
+
+
+
+
+
+`
+
+const toBase64 = value =>
+ typeof window === 'undefined' ? Buffer.from(value).toString('base64') : window.btoa(value)
+
+const galleryBannerLoader = () => '/resource/parallax/Gallery.jpg'
+
+const Gallery = ({ images }) => {
+ const [selectedImage, setSelectedImage] = useState(null)
+
+ const closeLightbox = () => setSelectedImage(null)
+
+ const showPreviousImage = () => {
+ setSelectedImage(current => (current === 0 ? images.length - 1 : current - 1))
+ }
+
+ const showNextImage = () => {
+ setSelectedImage(current => (current === images.length - 1 ? 0 : current + 1))
+ }
+
+ useEffect(() => {
+ if (selectedImage === null) return undefined
+
+ const handleKeyDown = event => {
+ if (event.key === 'Escape') setSelectedImage(null)
+ if (event.key === 'ArrowRight') {
+ setSelectedImage(current => (current === images.length - 1 ? 0 : current + 1))
+ }
+ if (event.key === 'ArrowLeft') {
+ setSelectedImage(current => (current === 0 ? images.length - 1 : current - 1))
+ }
+ }
+
+ const previousOverflow = document.body.style.overflow
+ document.body.style.overflow = 'hidden'
+ window.addEventListener('keydown', handleKeyDown)
+
+ return () => {
+ document.body.style.overflow = previousOverflow
+ window.removeEventListener('keydown', handleKeyDown)
+ }
+ }, [selectedImage, images.length])
+
+ return (
+
+
+
+
+
گالری بیمارستان
+
+
+
+
+
+
+
+ {images.map((image, index) => (
+ setSelectedImage(index)}
+ >
+
+
+ ))}
+
+
+
+ {selectedImage !== null && (
+
+
+ ×
+
+
{
+ event.stopPropagation()
+ showPreviousImage()
+ }}
+ >
+ ‹
+
+
event.stopPropagation()}
+ />
+
{
+ event.stopPropagation()
+ showNextImage()
+ }}
+ >
+ ›
+
+
+ {selectedImage + 1} از {images.length}
+
+
+ )}
+
+ )
+}
+
+export async function getStaticProps() {
+ const galleryDirectory = path.join(process.cwd(), 'public', 'resource', 'images', 'gallery')
+ const fileNames = fs
+ .readdirSync(galleryDirectory)
+ .filter(fileName => /\.(jpe?g|png|webp)$/i.test(fileName))
+ .sort((first, second) => first.localeCompare(second, undefined, { numeric: true }))
+
+ const images = fileNames.map((fileName, index) => ({
+ id: fileName,
+ image: `/resource/images/gallery/${encodeURIComponent(fileName)}`,
+ title: `تصویر ${index + 1} از بیمارستان مهر ایرانیان پرند`
+ }))
+
+ return {
+ props: { images }
+ }
+}
+
+export default Gallery
diff --git a/pages/components/Layout/header.js b/pages/components/Layout/header.js
index 079045f..a1db894 100644
--- a/pages/components/Layout/header.js
+++ b/pages/components/Layout/header.js
@@ -215,7 +215,7 @@ export default function App() {
*/}
- واحد تجهیزات پزشکی
-
- */}
+ {/*
- {/*
+
امور سهام
- */}
-
+
+ */}
{/* {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ بیمارستان تخصصی در قلب شهر پرند
+
+
+ همراه مطمئن شما، برای زندگی سالمتر
+
+
+ بیمارستان مهر ایرانیان پرند با تکیه بر زیرساخت درمانی مدرن، بخشهای تخصصی و فضای طراحیشده برای
+ آرامش بیماران، در مسیر تبدیلشدن به یکی از قطبهای سلامت جنوبغرب تهران است.
+
+
+
+
+
+
+
+
+
+ {quickLinks.map(item => {
+ const Icon = item.icon
+ const content = (
+ <>
+
+
+
+
+ {item.title}
+ {item.caption}
+
+ >
+ )
+
+ return item.external ? (
+
+ {content}
+
+ ) : (
+
+ {content}
+
+ )
+ })}
+
+
+
+
+
+
+
+
+
+
+
+
+ ۹۶ تخت
+ ظرفیت فاز نخست بیمارستان
+
+
+
+
+
درباره مهر ایرانیان
+
زیرساختی مدرن برای پاسخ به نیاز درمانی منطقه
+
+ بیمارستان تخصصی مهر ایرانیان در یکی از بهترین موقعیتهای شهر پرند و در مجاورت بزرگترین فرودگاه
+ کشور قرار دارد. این مجموعه با فضای درمانی گسترده، بخشهای تخصصی و فوقتخصصی و دسترسی مناسب، برای
+ خدمترسانی به ساکنان پرند، رباطکریم، نسیمشهر و شهرهای پیرامون طراحی شده است.
+
+
+
+ طراحی بیمارمحور
+
+
+ تجهیزات تخصصی
+
+
+ دسترسی شهری مناسب
+
+
+ پوشش خدمات متنوع
+
+
+
+
+ داستان بیمارستان را بخوانید
+
+
+
+
+
+
+
+ ۲۱,۰۰۰
+ مترمربع فضای درمانی
+
+
+ ۴,۰۰۰
+ مترمربع پارکینگ طبقاتی
+
+
+ ۹۶
+ تخت در فاز نخست
+
+
+ ۱۴+
+ بخش درمانی و تخصصی
+
+
+
+
+
+
+
+
+
+
+ {departments.map(department => (
+
+
+
+
+ {department.title}
+ {department.description}
+
+ ))}
+
+
+
+
+
+
+
+
+
+ {galleryImages.map(image => (
+
+
+
+ ))}
+
+
+
+
+
+
+
+
+
مراقبت بیمارمحور
+
طراحی مسیر درمان با توجه به آرامش و نیازهای بیمار و همراهان
+
+
+
+
+
+
+
+
کیفیت و ایمنی
+
زیرساختهای درمانی مدرن برای ارائه خدمات ایمن و قابلاعتماد
+
+
+
+
+
+
+
+
دسترسی بهتر
+
موقعیت مناسب در پرند و دسترسی آسان برای شهرهای جنوبغرب تهران
+
+
+
+
+
+
+
+
+
+
+
برای راهنمایی و ارتباط با بیمارستان کنار شما هستیم
+
+ تهران، شهر جدید پرند، بلوار شهید قاسم سلیمانی، انتهای فاز ۵، نبش بلوار رسول اکرم (ص)
+
+
+
+
+
+
+
+
+ )
+}
+
+export default Landing
diff --git a/pages/medical-equipment/index.js b/pages/medical-equipment/index.js
index eb71992..c754651 100644
--- a/pages/medical-equipment/index.js
+++ b/pages/medical-equipment/index.js
@@ -16,32 +16,6 @@ const MedicalEquipment = () => {
height={2000}
/>
-
-
-
-
-
-
- اگر به دنبال همکاری با بخش تجهیزات بیمارستان هستید، لطفا با یکی از شمارههای زیر تماس حاصل نمایید تا
- اطلاعات بیشتری در این خصوص از ما دریافت کنید
-
-
-
-
-
-
-
)
}
diff --git a/pages/recruitment/item/request/PersonData.js b/pages/recruitment/item/request/PersonData.js
index decea77..599bad8 100644
--- a/pages/recruitment/item/request/PersonData.js
+++ b/pages/recruitment/item/request/PersonData.js
@@ -1,537 +1,687 @@
-import React, { useContext, useEffect, useRef, useState } from 'react'
-import { Box, Input, Radio, RadioGroup, Select, SimpleGrid, Stack, Textarea, UnorderedList } from '@chakra-ui/react'
+import React, { useContext, useState } from 'react'
+import { Box, Input, Radio, RadioGroup, Select, SimpleGrid, Stack, Textarea, FormControl, FormLabel, FormErrorMessage, InputGroup, InputLeftElement, InputRightElement } from '@chakra-ui/react'
import {
MDBBtn,
- MDBCol,
- MDBContainer,
- MDBFile,
- MDBRadio,
MDBInputGroup,
MDBInputGroupText,
- MDBRow
} from 'mdb-react-ui-kit'
-import { FcApproval } from 'react-icons/fc'
-import { FiCheck, FiUser } from 'react-icons/fi'
-import { useForm } from 'react-hook-form'
+import { FiUser, FiPhone, FiCalendar, FiHome, FiBriefcase, FiHeart } from 'react-icons/fi'
+import { useForm, Controller } from 'react-hook-form'
import { HandleFormReq } from '../../../../lib/HandleFormReq'
import axios from 'axios'
import { AppProduction } from '../../../../lib/api'
+// آیکون سفارشی
+const FieldIcon = ({ icon: Icon }) => (
+
+
+
+)
+
+// کامپوننت فیلد ورودی
+const FormField = ({
+ label,
+ icon: Icon,
+ error,
+ children,
+ isRequired = false,
+ helpText
+}) => (
+
+
+ {label && (
+
+ {label}
+
+ )}
+
+ {Icon && (
+
+
+
+ )}
+ {children}
+
+ {error && (
+
+ {error}
+
+ )}
+ {helpText && !error && (
+
+ {helpText}
+
+ )}
+
+
+)
+
+// کامپوننت Select با Controller - حل مشکل theme
+const FormSelect = ({
+ label,
+ options,
+ error,
+ name,
+ control,
+ placeholder = "انتخاب کنید",
+ isRequired = false,
+ defaultValue = ""
+}) => (
+
+
+ {label && (
+
+ {label}
+
+ )}
+ (
+ field.onChange(e.target.value)}
+ size="md"
+ dir="rtl"
+ borderRadius="md"
+ _focus={{ borderColor: 'teal.500', boxShadow: '0 0 0 1px teal.500' }}
+ >
+ {placeholder}
+ {options.map(opt => (
+
+ {opt.label}
+
+ ))}
+
+ )}
+ />
+ {error && (
+
+ {error}
+
+ )}
+
+
+)
+
+// کامپوننت Radio Group
+const FormRadioGroup = ({
+ label,
+ options,
+ name,
+ control,
+ error
+}) => (
+
+
+ {label && (
+
+ {label}
+
+ )}
+ (
+
+
+ {options.map(opt => (
+
+ {opt.label}
+
+ ))}
+
+
+ )}
+ />
+ {error && (
+
+ {error}
+
+ )}
+
+
+)
+
+// آپشنهای عددی
+const numberOptions = (min, max) => {
+ const options = []
+ for (let i = min; i <= max; i++) {
+ options.push({ value: String(i), label: String(i) })
+ }
+ return options
+}
+
const PersonData = () => {
const { setPage, personData, setpersondata } = useContext(HandleFormReq)
- const [sex, setSex] = useState(personData.gender)
- const [health, setHealth] = React.useState(personData.health)
+ const [sex, setSex] = useState(personData.gender || '1')
+ const [health, setHealth] = useState(personData.health || '1')
+ const [isSubmitting, setIsSubmitting] = useState(false)
+
const {
register,
handleSubmit,
+ control,
watch,
+ setValue,
formState: { errors }
- } = useForm()
- let hasErr = Object.keys(errors).length
- const onSubmit = async data => {
- console.log('dadadada', data)
- if (hasErr === 0) {
- axios
- .post(`${AppProduction}public/jobrequest/nationalcode`, {
- nationalcode: data.national_code
- })
- .then(res => {
- if (res.data.status === false) {
- alert('کد ملی شما قبلا ثبت شده ')
- } else {
- setpersondata(data)
- setPage(2)
- }
- })
- .catch(err => {
- console.log('44324589091', err)
- })
+ } = useForm({
+ defaultValues: {
+ firstname: personData.firstname || '',
+ lastname: personData.lastname || '',
+ fatherName: personData.fatherName || '',
+ wifeJob: personData.wifeJob || '',
+ childIndex: personData.childIndex ?? 0,
+ dependants: personData.dependants ?? 0,
+ Insurance: personData.Insurance || '',
+ national_code: personData.national_code || '',
+ placenational: personData.placenational || '',
+ phone: personData.phone || '',
+ mobile_number: personData.mobile_number || '',
+ birthday: personData.birthday || '',
+ gender: personData.gender || '1',
+ degree: personData.degree || '',
+ marital: personData.marital || '',
+ military: personData.military || '',
+ health: personData.health || '1',
+ healthreason: personData.healthreason || '',
+ address: personData.address || '',
+ }
+ })
- console.log('jsondataperson', JSON.stringify({ personData: personData, scc: personData }))
- } else {
- alert('مقادیر وارد شده معبتر نمی باشد')
+ // گزینهها
+ const insuranceOptions = [
+ { value: '1', label: 'بیمه تامین اجتماعی' },
+ { value: '2', label: 'بیمه خدمات درمانی' },
+ { value: '3', label: 'بیمه سلامت' },
+ { value: '4', label: 'بیمه نیروهای مسلح' },
+ { value: '5', label: 'بدون بیمه' },
+ ]
+
+ const educationOptions = [
+ { value: '0', label: 'زیر دیپلم' },
+ { value: '1', label: 'دیپلم' },
+ { value: '5', label: 'فوق دیپلم' },
+ { value: '2', label: 'لیسانس' },
+ { value: '3', label: 'فوق لیسانس' },
+ { value: '4', label: 'دکتری' },
+ ]
+
+ const maritalOptions = [
+ { value: '1', label: 'مجرد' },
+ { value: '2', label: 'متاهل' },
+ ]
+
+ const militaryOptions = [
+ { value: '1', label: 'معافیت' },
+ { value: '2', label: 'مشمول' },
+ { value: '3', label: 'پایان خدمت' },
+ ]
+
+ const healthOptions = [
+ { value: '1', label: 'ندارم' },
+ { value: '2', label: 'دارم' },
+ ]
+
+ const onSubmit = async data => {
+ setIsSubmitting(true)
+ try {
+ const res = await axios.post(`${AppProduction}public/jobrequest/nationalcode`, {
+ nationalcode: data.national_code
+ })
+
+ if (res.data.status === false) {
+ alert('کد ملی شما قبلاً ثبت شده است')
+ } else {
+ setpersondata(data)
+ setPage(2)
+ }
+ } catch (err) {
+ console.error('خطا در ارسال فرم:', err)
+ alert('خطا در ارتباط با سرور. لطفاً دوباره تلاش کنید.')
+ } finally {
+ setIsSubmitting(false)
}
}
- console.log('personData.lastname', typeof personData.lastname)
+
return (
-