@ -16,67 +16,150 @@ import { connect } from "react-redux";
import MobileRegister from './mobile'
import persian from "react-date-object/calendars/persian"
import persian _fa from "react-date-object/locales/persian_fa"
import DatePicker from "react-multi-date-picker" ;
import DatePicker , { DateObject } from "react-multi-date-picker" ;
import "react-multi-date-picker/styles/colors/red.css"
import Checkbox from "../../components/Checkbox" ;
import { ostan } from "../../constants/states" ;
import { cities } from "../../constants/cities" ;
import _onInput from "../../utils/onInput" ;
import { publicApi , user } from "../../redux/actions" ;
import { VscDebugBreakpointUnsupported } from "react-icons/vsc" ;
const Register = ( { activeLogin , isMobile } ) => {
const Register = ( { activeLogin , isMobile , setProfile , getProvince , getCity , province , city , user } ) => {
const [ steps , setSteps ] = useState ( 0 ) ;
const [ index , setIndex ] = useState ( 1 ) ;
const [ register , setRegister ] = useState ( false ) ;
const timeoutRef = useRef ( null ) ;
const [ activeStep , setActiveStep ] = useState ( [ true , false , false , false ] ) ;
const [ error , setError ] = useState ( '' ) ;
useEffect ( ( ) => {
getProvince ( ) ;
getCity ( ) ;
} , [ ] )
useEffect ( ( ) => {
if ( user ? . firstName !== null ) {
setUserInfo ( { ... userInfo ,
firstName : user . firstName ,
lastName : user . lastName ,
nationalId : user . nationalId ,
// birthDate: user.birthDate.toLocaleDateString('fa-IR'),
gender : user . gender ,
previousSchoolName : user . previousSchoolName ,
previousSchoolType : user . previousSchoolType ,
zone : user . zone ,
familyMemberCount : user . familyMemberCount ,
phone : user . phone ,
address : user . address
} )
}
} , [ user ] )
useEffect ( ( ) => {
window . scrollTo ( 0 , 0 ) ;
} , [ steps ] )
const madraks = [
{
id : 0 ,
title : 'مدرک تحصیلی'
} ,
{
id : 1 ,
title : 'ابتدایی'
} ,
{
id : 2 ,
title : 'راهنمایی'
} ,
{
id : 3 ,
title : 'دیپلم'
} ,
{
id : 4 ,
title : 'فوق دیپلم'
} ,
{
id : 5 ,
title : 'کارشناسی'
} ,
{
id : 6 ,
title : 'کارشناسی ارشد'
} ,
{
id : 7 ,
title : 'دکتری عمومی'
} ,
{
id : 8 ,
title : 'دکترای حرفه ای'
} ,
{
id : 9 ,
title : 'دکترای تخصصی'
} ,
{
id : 10 ,
title : 'فوق تخصص'
} ,
]
const [ userInfo , setUserInfo ] = useState ( {
name : null ,
familyName : null ,
firstN ame: null ,
last Name: null ,
nationalId : null ,
birthDate : null ,
sex : null ,
grade : null ,
schoolName : null ,
city : null ,
state : null ,
fatherName : null ,
fatherNationalId : null ,
fatherFamilyName : null ,
fatherJob : null ,
fatherMajor : null ,
fatherPhoneNumber : null ,
fatherJobAddress : null ,
fatherJobPhoneNumber : null ,
motherName : null ,
motherNationalId : null ,
motherFamilyName : null ,
motherJob : null ,
motherMajor : null ,
motherPhoneNumber : null ,
motherJobAddress : null ,
motherJobPhoneNumber : null ,
familyNumber : null ,
gender : null ,
gradeIds : null ,
previousSchoolName : null ,
previousSchoolType : null ,
cityId : null ,
provinceId : null ,
zone : null ,
fatherInfo : {
firstName : null ,
nationalId : null ,
lastName : null ,
job : null ,
education : null ,
cellphone : null ,
workPlace : null ,
workPhone : null ,
} ,
motherInfo : {
firstName : null ,
nationalId : null ,
lastName : null ,
job : null ,
education : null ,
cellphone : null ,
workPlace : null ,
workPhone : null ,
} ,
familyMemberCount : null ,
address : null ,
homePhoneNumber : null ,
phone : null ,
rulesAccepted : false ,
} ) ;
const finalViewInfo = [
{
title : 'نام' ,
value : userInfo . name
value : userInfo . firstN ame
} ,
{
title : 'نام خانوادگی' ,
value : userInfo . familyName
value : userInfo . last Name
} ,
{
title : 'جنسیت' ,
value : userInfo . sex
value : userInfo . gender
} ,
{
title : 'کد ملی' ,
@ -84,87 +167,87 @@ const Register = ({ activeLogin, isMobile }) => {
} ,
{
title : 'تاریخ تولد' ,
value : userInfo . birthDate
value : userInfo . birthDate ? . toLocaleDateString ( 'fa-IR' )
} ,
{
title : 'نام مدرسه ' ,
value : userInfo . schoolName
value : userInfo . previou sS choolName
} ,
{
title : 'شهر' ,
value : userInfo . city
value : userInfo . cityId
} ,
{
title : 'منطقه' ,
value : userInfo . stat e
value : userInfo . zon e
} ,
{
title : 'نام' ,
value : userInfo . fatherName
value : userInfo . fatherInfo . first Name
} ,
{
title : 'نام خانوادگی' ,
value : userInfo . fatherFamily Name
value : userInfo . fatherInfo . last Name
} ,
{
title : 'کدملی' ,
value : userInfo . fatherN ationalId
value : userInfo . fatherInfo . n ationalId
} ,
{
title : 'مدرک تحصیلی' ,
value : userInfo . fatherMajor
value : madraks . find ( itm => itm . id == userInfo . fatherInfo . education ) ? . title
} ,
{
title : 'تلفن همراه' ,
value : userInfo . fatherPhoneNumber
value : userInfo . fatherInfo . cellphone
} ,
{
title : 'شغل' ,
value : userInfo . fatherJ ob
value : userInfo . fatherInfo . j ob
} ,
{
title : 'محل کار' ,
value : userInfo . fatherJobAddress
value : userInfo . fatherInfo . workPlace
} ,
{
title : 'تلفن محل کار' ,
value : userInfo . fatherJobPhoneNumber
value : userInfo . fatherInfo . workPhone
} ,
{
title : 'نام' ,
value : userInfo . motherName
value : userInfo . motherInfo . first Name
} ,
{
title : 'نام خانوادگی' ,
value : userInfo . motherFamily Name
value : userInfo . motherInfo . last Name
} ,
{
title : 'کدملی' ,
value : userInfo . motherN ationalId
value : userInfo . motherInfo . n ationalId
} ,
{
title : 'مدرک تحصیلی' ,
value : userInfo . motherMajor
value : madraks . find ( itm => itm . id == userInfo . motherInfo . education ) ? . title
} ,
{
title : 'تلفن همراه' ,
value : userInfo . motherPhoneNumber
value : userInfo . motherInfo . cellphone
} ,
{
title : 'شغل' ,
value : userInfo . motherJ ob
value : userInfo . motherInfo . j ob
} ,
{
title : 'محل کار' ,
value : userInfo . motherJobAddress
value : userInfo . motherInfo . workPlace
} ,
{
title : 'تلفن محل کار' ,
value : userInfo . motherJobPhoneNumber
value : userInfo . motherInfo . workPhone
} ,
{
title : 'تعداد افراد خانواده' ,
value : userInfo . familyNumber
value : userInfo . familyMemberCount
} ,
{
title : 'نشانی محل سکونت' ,
@ -172,7 +255,7 @@ const Register = ({ activeLogin, isMobile }) => {
} ,
{
title : 'تلفن ثابت' ,
value : userInfo . homePhoneNumber
value : userInfo . phone
} ,
] ;
@ -279,11 +362,11 @@ const Register = ({ activeLogin, isMobile }) => {
} ,
{
id : 1 ,
title : 'مذکر ' ,
title : 'آقا ' ,
} ,
{
id : 2 ,
title : 'مونث ' ,
title : 'خانم ' ,
}
]
const CostumeDatePickerInput = ( { openCalendar , value , handleValueChange , title } ) => {
@ -293,42 +376,13 @@ const Register = ({ activeLogin, isMobile }) => {
value = { value }
onChange = { handleValueChange }
title = { title }
className = "w-52"
className = "w-52 mx-1"
// type='date'
id = { 3 }
/ >
)
}
const madraks = [
{
id : 0 ,
title : 'مدرک تحصیلی'
} ,
{
id : 1 ,
title : 'ابتدایی'
} ,
{
id : 2 ,
title : 'دیپلم'
} ,
{
id : 3 ,
title : 'فوق دیپلم'
} ,
{
id : 4 ,
title : 'کارشناسی'
} ,
{
id : 5 ,
title : 'کارشناسی ارشد'
} ,
{
id : 6 ,
title : 'دکتری'
} ,
]
const [ selectedState , setSelectedState ] = useState ( null ) ;
const [ selectedCity , setSelectedCity ] = useState ( null ) ;
@ -340,7 +394,7 @@ const Register = ({ activeLogin, isMobile }) => {
{ /* form */ }
{ console . log ( userInfo ) }
< div className = "flex w-1/5 border-0 border-l border-solid border flex-col items-center p-6" >
< div className = "flex w-1/5 border-0 border-l border-solid flex-col items-center p-6" >
{ /* <img src={logo} className="w-1/2 m-4 mt-0" /> */ }
< div className = "flex flex-col items-center justify-start leading-normal" >
@ -382,6 +436,7 @@ const Register = ({ activeLogin, isMobile }) => {
< / d i v >
< / d i v >
{ /* Content */ }
< div className = "w-4/5 mx-10 flex flex-col items-start text-right b" >
@ -393,31 +448,50 @@ const Register = ({ activeLogin, isMobile }) => {
< h1 className = "font-black" > مشخصات هویتی دانش آموز < / h 1 >
< p className = "font-bold text-gray-400 mt-2 leading-normal text-sm" > اطلاعات هویتی دانش آموز را با دقت تکمیل و عکس مدارک را بارگزاری نمایید < / p >
< / d i v >
< div className = "flex" >
< div className = "flex w-2/5 flex-wrap justify-between " >
< div className = "flex justify-between " >
< div className = "flex w-3/5 flex-wrap justify-start " >
< Input className = { 'w-52' } title = "نام" borderType = "rounded" gapSize = "8" direction = 'rtl' id = { 0 } value = { userInfo . n ame} onChange = { ( e ) => setUserInfo ( { ... userInfo , n ame: e . target . value } ) } / >
< Input className = { 'w-52' } title = "نام خانوادگی" borderType = "rounded" id = { 1 } direction = 'rtl' value = { userInfo . family Name} onChange = { ( e ) => setUserInfo ( { ... userInfo , family Name: e . target . value } ) } / >
< Input className = { 'w-52' } title = "کدملی" borderType = "rounded" gapSize = "12" id = { 2 } type = 'textNumber' max = { 10 } value = { userInfo . nationalId } onChange = { e => setUserInfo ( { ... userInfo , nationalId : e . target . value } ) } / >
< Input className = { 'w-52 mx-1 ' } title = "نام" borderType = "rounded" gapSize = "8" direction = 'rtl' id = { 0 } value = { userInfo . firstN ame} onChange = { ( e ) => setUserInfo ( { ... userInfo , firstN ame: _onInput . noNumber ( e . target . value ) } ) } / >
< Input className = { 'w-52 mx-1 ' } title = "نام خانوادگی" borderType = "rounded" id = { 1 } direction = 'rtl' value = { userInfo . last Name} onChange = { ( e ) => setUserInfo ( { ... userInfo , last Name: _onInput . noNumber ( e . target . value ) } ) } / >
< Input className = { 'w-52 mx-1 ' } title = "کدملی" borderType = "rounded" gapSize = "12" id = { 2 } type = 'textNumber' max = { 10 } value = { userInfo . nationalId } onChange = { e => setUserInfo ( { ... userInfo , nationalId : _onInput . numberOnly ( e . target . value ) } ) } / >
{ /* <Input className={'w-52'} title="تاریخ تولد" borderType="rounded" gapSize="16" id={3} type='number' /> */ }
< DatePicker
format = "YYYY/MM/DD"
onChange = { ( e ) => setUserInfo ( { ... userInfo , birthDate : e . day } ) }
onChange = { ( e ) => {
// console.log(e)
var s = new Date ( e . unix * 1000 )
// console.log(date)
setUserInfo ( { ... userInfo , birthDate : s } )
} }
calendar = { persian }
className = "red"
locale = { persian _fa }
renderButton = { ( direction , handleClick ) => (
< button className = "text-blue-500 font-bold mx-2" onClick = { handleClick } >
maxDate = "1396/01/01"
currentDate = {
new DateObject ( {
year : 2017 ,
month : 1 ,
day : 1
} )
}
renderButton = { ( direction , handleClick ) =>
{
return < p className = "text-red-500 cursor-pointer font-bold mx-2"
onClick = { ( ) => handleClick ( ) }
>
{ direction === "right" ? ">" : "<" }
< / b u t t o n >
) }
< / p >
}
}
render = { < CostumeDatePickerInput title = 'تاریخ تولد' / > }
/ >
< select className = "bg-white border border-solid border-gray-200 w-52 px-3 rounded text-gray-400 outline-red52 py-1 h-12 mt-6" >
< select
onChange = { e => setUserInfo ( { ... userInfo , gender : e . target . value } ) }
className = "bg-white border border-solid border-gray-200 w-52 px-3 mx-1 rounded text-gray-400 outline-red52 py-1 h-12 mt-6" >
{ genders . map ( ( item ) => (
< option key = { ` gender ${ item . id } ` } > { item . title } < / o p t i o n >
< option key = { ` gender ${ item . id } ` } value = { item . id } > { item . title } < / o p t i o n >
) ) }
< / s e l e c t >
@ -427,13 +501,14 @@ const Register = ({ activeLogin, isMobile }) => {
< / d i v >
< div className = "w-3/5 flex flex-wrap justify-between" >
< div className = "w-2/5 mx-4" >
< div className = " flex justify-between" >
< div className = "mx-1 ml-2" >
< FileInput title = "بارگزاری صفحه اول شناسنامه" id = { 1 } / >
< / d i v >
< div className = "w-2/5 mx-4" >
< FileInput title = "بارگزاری عکس پرسنلی" id = { 2 } / >
< / d i v >
< / d i v >
@ -444,44 +519,54 @@ const Register = ({ activeLogin, isMobile }) => {
< h1 className = "font-black" > پایه تحصیلی < / h 1 >
< p className = "font-bold text-gray-400 mt-2 leading-normal text-sm" > لطفا پایه تحصیلی دانش آموز را وارد کنید < / p >
< / d i v >
< select className = "bg-white border border-solid border-gray-300 w-48 p-3 rounded-lg text-gray-400 outline-red52 mx-6" >
< select
onChange = { e => setUserInfo ( { ... userInfo , gradeIds : e . target . value } ) }
className = "bg-white border border-solid border-gray-300 w-48 p-3 rounded-lg text-gray-400 outline-red52 mx-6" >
{ grades . map ( ( item ) => (
< option key = { ` Grade__ ${ item . id } ` } > { item . title } < / o p t i o n >
< option key = { ` Grade__ ${ item . id } ` } value = { item . id } > { item . title } < / o p t i o n >
) ) }
< / s e l e c t >
< / d i v >
< div className = "w-full px-10 py-8 flex flex-col " >
< div className = "mb-4" >
< h1 className = "font-black" > مشخصات هویتی دانش آموز < / h 1 >
< p className = "font-bold text-gray-400 mt-2 leading-normal text-sm" > اطلاعات هویتی دانش آموز را با دقت تکمیل و عکس مدارک را بارگزاری نمای ید< / p >
< h1 className = "font-black" > اطلاعات محل تحصیل < / h 1 >
< p className = "font-bold text-gray-400 mt-2 leading-normal text-sm" > لطفا اطلاعات مربوط به محل تحصیل دانش آموز را وارد کن ید< / p >
< / d i v >
< div className = "flex justify-start flex-wrap items-center" >
< Input className = { 'w-64' } title = "نام مدرسه" borderType = "rounded" gapSize = "20" direction = 'rtl' id = { 4 } value = { userInfo . schoolName } onChange = { e => setUserInfo ( { ... userInfo , schoolName : e . target . value } ) } / >
< Input className = { 'w-64' } title = "نام مدرسه" borderType = "rounded" gapSize = "20" direction = 'rtl' id = { 4 } value = { userInfo . previou sS choolName} onChange = { e => setUserInfo ( { ... userInfo , previou sS choolName: e . target . value } ) } / >
< select
className = "bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-6 ml-3 mt-6"
onChange = { e => { setSelectedState ( e . target . value ) ; setUserInfo ( { ... userInfo , state : e . target . value } ) } } >
className = "bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-3 mt-6"
onChange = { e => { setSelectedState ( e . target . value ) ; setUserInfo ( { ... userInfo , previousSchoolType : e . target . value } ) } } >
< option value = { null } > نوع مدرسه < / o p t i o n >
< option value = { 1 } > دولتی < / o p t i o n >
< option value = { 2 } > نیمه دولتی < / o p t i o n >
< option value = { 3 } > غیر انتفاعی < / o p t i o n >
< option value = { 4 } > تیزهوشان < / o p t i o n >
< / s e l e c t >
< select
className = "bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-3 mr-0 mt-6"
onChange = { e => { setSelectedState ( e . target . value ) ; setUserInfo ( { ... userInfo , provinceId : e . target . value } ) } } >
< option value = { null } > استان < / o p t i o n >
{
ostan . map ( ( item ) => < option value = { item . id } > { item . name } < / o p t i o n > )
province ? . map ( ( item ) => < option value = { item . id } > { item . name } < / o p t i o n > )
}
< / s e l e c t >
{
selectedState !== null &&
< select
className = "bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-6 mr-3 mt-6"
onChange = { ( e ) => { setSelectedCity ( e . target . value ) ; setUserInfo ( { ... userInfo , city : e . target . value } ) } } >
className = "bg-white border border-solid border-gray-200 w-48 p-3 rounded-md text-gray-400 outline-red52 mx-3 mr-0 mt-6"
onChange = { ( e ) => { setSelectedCity ( e . target . value ) ; setUserInfo ( { ... userInfo , cityId : e . target . value } ) } } >
< option value = { null } >
شهر
< / o p t i o n >
{
cities . filter ( itm => itm . ostan == selectedState ) . map ( ( city ) => < option value = { city . id } > { city . name } < / o p t i o n > )
city ? . filter ( itm => itm . provinceId == selectedState ) . map ( ( city ) => < option value = { city . id } > { city . name } < / o p t i o n > )
}
< / s e l e c t >
}
{
selectedCity !== null && < Input className = { 'w-64' } title = "منطقه" borderType = "rounded" gapSize = "12" id = { 5 } type = 'number' / >
}
< Input className = { 'w-20' } title = "منطقه" borderType = "rounded" gapSize = "12" id = { 5 } type = 'number' value = { userInfo . zone } onChange = { ( e ) => setUserInfo ( { ... userInfo , zone : e . target . value } ) } / >
< / d i v >
< div className = "flex pt-10 justify-end" >
< div className = "w-40" >
@ -514,14 +599,28 @@ const Register = ({ activeLogin, isMobile }) => {
< div className = "flex flex-wrap justify-between" >
< Input className = { 'w-52' } title = "نام" borderType = "rounded" gapSize = "8" direction = 'rtl' id = { 0 } value = { userInfo . fatherName } onChange = { e => setUserInfo ( { ... userInfo , fatherName : e . target . value } ) } / >
< Input className = { 'w-52' } title = "کدملی" borderType = "rounded" gapSize = "12" id = { 1 } type = 'number' value = { userInfo . fatherNationalId } onChange = { e => setUserInfo ( { ... userInfo , fatherNationalId : e . target . value } ) } / >
< Input className = { 'w-52' } title = "نام خانوادگی" borderType = "rounded" id = { 2 } direction = 'rtl' value = { userInfo . fatherFamilyName } onChange = { e => setUserInfo ( { ... userInfo , fatherFamilyName : e . target . value } ) } / >
< select className = "bg-white border border-solid border-gray-200 w-52 px-3 rounded text-gray-400 outline-red52 py-1 h-12 mt-6" >
< Input className = { 'w-52' } title = "نام" borderType = "rounded" gapSize = "8" direction = 'rtl' id = { 0 }
value = { userInfo . fatherInfo . firstName }
onChange = { e => setUserInfo ( {
... userInfo , fatherInfo : {
... userInfo . fatherInfo ,
firstName : _onInput . noNumber ( e . target . value )
}
} ) } / >
< Input className = { 'w-52' } title = "نام خانوادگی" borderType = "rounded" id = { 1 } direction = 'rtl' value = { userInfo . fatherInfo . lastName }
onChange = { e => setUserInfo ( { ... userInfo , fatherInfo : { ... userInfo . fatherInfo , lastName : _onInput . noNumber ( e . target . value ) } } ) } / >
< Input className = { 'w-52' } title = "کدملی" borderType = "rounded" gapSize = "12" id = { 2 } type = 'text' max = { 10 } value = { userInfo . fatherInfo . nationalId }
onChange = { e => setUserInfo ( { ... userInfo , fatherInfo : {
... userInfo . fatherInfo ,
nationalId : _onInput . numberOnly ( e . target . value )
} } ) } / >
< select className = "bg-white border border-solid border-gray-200 w-52 px-3 rounded text-gray-400 outline-red52 py-1 h-12 mt-6"
onChange = { e => setUserInfo ( { ... userInfo , fatherInfo : {
... userInfo . fatherInfo ,
education : e . target . value
} } ) } >
{ madraks . map ( ( item ) => (
< option key = { ` madraks ${ item . id } ` } > { item . title } < / o p t i o n >
< option key = { ` madraks ${ item . id } ` } value = { item . id } > { item . title } < / o p t i o n >
) ) }
< / s e l e c t >
@ -532,12 +631,19 @@ const Register = ({ activeLogin, isMobile }) => {
< div className = "flex flex-wrap justify-between" >
< Input className = { 'w-52' } title = "تلفن همراه" borderType = "rounded" type = 'number' id = { 3 } value = { userInfo . fatherPhoneNumber } onChange = { e => setUserInfo ( { ... userInfo , fatherPhoneNumber : e . target . value } ) } / >
< Input className = { 'w-52' } title = "شغل" borderType = "rounded" direction = 'rtl' gapSize = "8" id = { 4 } value = { userInfo . fatherJob } onChange = { e => setUserInfo ( { ... userInfo , fatherJob : e . target . value } ) } / >
< Input className = { 'w-52' } title = "تلفن همراه" borderType = "rounded" max = { 11 } id = { 3 } value = { userInfo . fatherInfo . cellphone } onChange = { e => setUserInfo ( { ... userInfo , fatherInfo : {
... userInfo . fatherInfo ,
cellphone : _onInput . phonenumber ( e . target . value )
} } ) } / >
< Input className = { 'w-52' } title = "شغل" borderType = "rounded" direction = 'rtl' gapSize = "8" id = { 4 } value = { userInfo . fatherInfo . job }
onChange = { e => setUserInfo ( { ... userInfo , fatherInfo : { ... userInfo . fatherInfo , job : e . target . value } } ) } / >
< Input className = { 'w-52' } title = "محل کار" borderType = "rounded" id = { 5 } direction = 'rtl' value = { userInfo . fatherInfo . workPlace }
< Input className = { 'w-52' } title = "محل کار" borderType = "rounded" id = { 5 } direction = 'rtl' value = { userInfo . fatherJobAddress } onChange = { e => setUserInfo ( { ... userInfo , fatherJobAddress : e . target . value } ) } / >
< Input className = { 'w-52' } title = "تلفن محل کار" borderType = "rounded" gapSize = "28" id = { 6 } type = 'number' value = { userInfo . fatherJobPhoneNumber } onChange = { e => setUserInfo ( { ... userInfo , fatherJobPhoneNumber : e . target . value } ) } / >
onChange = { e => setUserInfo ( { ... userInfo , fatherInfo : { ... userInfo . fatherInfo , workPlace : e . target . value } } ) } / >
< Input className = { 'w-52' } title = "تلفن محل کار" borderType = "rounded" gapSize = "28" id = { 6 } type = 'text' max = { 11 } value = { userInfo . fatherInfo . workPhone }
onChange = { e => setUserInfo ( { ... userInfo , fatherInfo : { ... userInfo . fatherInfo , workPhone : _onInput . numberOnly ( e . target . value ) } } ) } / >
@ -555,14 +661,23 @@ const Register = ({ activeLogin, isMobile }) => {
< div className = "flex flex-wrap justify-between" >
< Input className = { 'w-52' } title = "نام" borderType = "rounded" gapSize = "8" direction = 'rtl' id = { 7 } value = { userInfo . motherName } onChange = { e => setUserInfo ( { ... userInfo , motherName : e . target . value } ) } / >
< Input className = { 'w-52' } title = "کدملی" borderType = "rounded" gapSize = "12" id = { 8 } type = 'number' value = { userInfo . motherNationalId } onChange = { e => setUserInfo ( { ... userInfo , motherNationalId : e . target . value } ) } / >
< Input className = { 'w-52' } title = "نام" borderType = "rounded" gapSize = "8" direction = 'rtl' id = { 7 } value = { userInfo . motherInfo . firstName }
onChange = { e => setUserInfo ( { ... userInfo , motherInfo : { ... userInfo . motherInfo , firstName : _onInput . noNumber ( e . target . value ) } } ) } / >
< Input className = { 'w-52' } title = "نام خانوادگی" borderType = "rounded" id = { 8 } direction = 'rtl' value = { userInfo . motherInfo . lastName }
onChange = { e => setUserInfo ( { ... userInfo , motherInfo : { ... userInfo . motherInfo , lastName : _onInput . noNumber ( e . target . value ) } } ) } / >
< Input className = { 'w-52' } title = "کدملی" borderType = "rounded" gapSize = "12" id = { 9 } type = 'text' max = { 10 } value = { userInfo . motherInfo . nationalId }
onChange = { e => setUserInfo ( { ... userInfo , motherInfo : { ... userInfo . motherInfo , nationalId : _onInput . numberOnly ( e . target . value ) } } ) } / >
< Input className = { 'w-52' } title = "نام خانوادگی" borderType = "rounded" id = { 9 } direction = 'rtl' value = { userInfo . motherFamilyName } onChange = { e => setUserInfo ( { ... userInfo , motherFamilyName : e . target . value } ) } / >
< select className = "bg-white border border-solid border-gray-200 w-52 px-3 rounded text-gray-400 outline-red52 py-1 h-12 mt-6" >
< select className = "bg-white border border-solid border-gray-200 w-52 px-3 rounded text-gray-400 outline-red52 py-1 h-12 mt-6"
onChange = { e => setUserInfo ( { ... userInfo , motherInfo : {
... userInfo . motherInfo ,
education : e . target . value
} } ) } >
{ madraks . map ( ( item ) => (
< option key = { ` madraks ${ item . id } ` } > { item . title } < / o p t i o n >
< option key = { ` madraks ${ item . id } ` } value = { item . id } > { item . title } < / o p t i o n >
) ) }
< / s e l e c t >
@ -573,12 +688,30 @@ const Register = ({ activeLogin, isMobile }) => {
< div className = "flex flex-wrap justify-between" >
< Input className = { 'w-52' } title = "تلفن همراه" borderType = "rounded" type = 'number' id = { 10 } value = { userInfo . motherPhoneNumber } onChange = { e => setUserInfo ( { ... userInfo , motherPhoneNumber : e . target . value } ) } / >
< Input className = { 'w-52' } title = "شغل" borderType = "rounded" direction = 'rtl' gapSize = "8" id = { 11 } value = { userInfo . motherJob } onChange = { e => setUserInfo ( { ... userInfo , motherJob : e . target . value } ) } / >
< Input className = { 'w-52' } title = "تلفن همراه" borderType = "rounded" type = 'text' id = { 10 } max = { 11 } value = { userInfo . motherInfo . cellphone }
onChange = { e => setUserInfo ( { ... userInfo , motherInfo : {
... userInfo . motherInfo ,
cellphone : _onInput . phonenumber ( e . target . value )
} } ) } / >
< Input className = { 'w-52' } title = "شغل" borderType = "rounded" direction = 'rtl' gapSize = "8" id = { 11 } value = { userInfo . motherInfo . job }
onChange = { e => setUserInfo ( { ... userInfo , motherInfo : {
... userInfo . motherInfo ,
job : e . target . value
} } ) } / >
< Input className = { 'w-52' } title = "محل کار" borderType = "rounded" id = { 12 } direction = 'rtl' value = { userInfo . motherJobAddress } onChange = { e => setUserInfo ( { ... userInfo , motherJobAddress : e . target . value } ) } / >
< Input className = { 'w-52' } title = "تلفن محل کار" borderType = "rounded" gapSize = "28" id = { 13 } type = 'number' value = { userInfo . motherJobPhoneNumber } onChange = { e => setUserInfo ( { ... userInfo , motherJobPhoneNumber : e . target . value } ) } / >
< Input className = { 'w-52' } title = "محل کار" borderType = "rounded" id = { 12 } direction = 'rtl'
value = { userInfo . motherInfo . workPlace }
onChange = { e => setUserInfo ( { ... userInfo , motherInfo : {
... userInfo . motherInfo ,
workPlace : e . target . value
} } ) } / >
< Input className = { 'w-52' } title = "تلفن محل کار" borderType = "rounded" gapSize = "28" id = { 13 } type = 'text' max = { 11 }
value = { userInfo . motherInfo . workPhone }
onChange = { e => setUserInfo ( { ... userInfo , motherInfo : {
... userInfo . motherInfo ,
workPhone : _onInput . numberOnly ( e . target . value )
} } ) } / >
@ -595,10 +728,10 @@ const Register = ({ activeLogin, isMobile }) => {
< div className = "flex flex-wrap justify-start items-center" >
< Input className = { 'w-64 ml-2' } title = "تعداد افراد خانواده" borderType = "rounded" type = 'number' gapSize = "40" direction = 'rtl' id = { 14 } value = { userInfo . familyNumber } onChange = { e => setUserInfo ( { ... userInfo , familyNumber : e . target . value } ) } / >
< Input className = { 'w-64' } title = "تلفن ثابت" borderType = "rounded" type = 'number' gapSize = "40" direction = 'rtl' id = { 15 } value = { userInfo . homePhoneNumber } onChange = { e => setUserInfo ( { ... userInfo , homePhoneNumber : e . target . value } ) } / >
< Input className = { 'w-64 ml-2' } title = "تعداد افراد خانواده" borderType = "rounded" type = 'number' gapSize = "40" direction = 'rtl' id = { 14 } value = { userInfo . familyMemberCount } onChange = { e => setUserInfo ( { ... userInfo , familyMemberCount : e . target . value } ) } / >
< Input className = { 'w-64' } title = "تلفن ثابت" borderType = "rounded" gapSize = "40" direction = 'rtl' id = { 15 } max = { 11 } value = { userInfo . phone } onChange = { e => setUserInfo ( { ... userInfo , phone : _onInput . numberOnly ( e . target . value ) } ) } / >
< Input title = "نشانی محل سکونت" borderType = "rounded" gapSize = "40" id = { 16 } value = { userInfo . address } onChange = { e => setUserInfo ( { ... userInfo , address : e . target . value } ) } / >
< Input title = "نشانی محل سکونت" borderType = "rounded" gapSize = "40" id = { 16 } direction = 'rtl' value = { userInfo . address } onChange = { e => setUserInfo ( { ... userInfo , address : e . target . value } ) } / >
@ -648,7 +781,7 @@ const Register = ({ activeLogin, isMobile }) => {
< p className = "font-bold text-gray-400 mt-2 leading-normal text-sm" > لطفا قوانین و مقررات را مطالعه فرمایید < / p >
< / d i v >
< p className = "text-gray-500" >
< p className = "text-gray-500 text-justify " >
بند اول : موارد مربوط به آموزش مخاطبین
پیر مردی هر روز تو محله می دید پسر کی با کفش های پاره و پای برهنه با توپ پلاستیکی فوتبال بازی می کند ، روزی رفت ی کتانی نو خرید و اومد و به پسرک گفت بیا این کفشا رو بپوش … پسرک کفشا رو پوشید و خوشحال رو به پیر مرد کرد و گفت : شما خدایید ؟ ! پیر مرد لبش را گزید و گفت نه ! پسرک گفت پس دوست خدایی ، چون من دیشب فقط به خدا گفتم كه کفش ندارم
هر نفسی که فرو می بریم ، مرگی را که مدام به ما دست اندازی می کند پس می زند ... در نهایت این مرگ است که باید پیروز شود ، زیرا از هنگام تولد بخشی از سرنوشت ما شده و فقط مدت کوتاهی پیش از بلعیدن طعمه اش ، با آن بازی می کند . با این همه ، ما تا آنجا که ممکن است ، با علاقه فراوان و دلواپسی زیاد به زندگی ادامه می دهیم ، همان طور که تا آنجا که ممکن است طولانی تر در یک حباب صابون می دمیم تا بزرگتر شود ، گر چه با قطعیتی تمام می دانیم که خواهد ترکید .
@ -666,14 +799,19 @@ const Register = ({ activeLogin, isMobile }) => {
< / d i v >
< div className = "flex items-center px-10 py-6" >
{ /* <input type="checkbox" className="w-6 h-6" />*/ }
< Checkbox name = { 'PARENTS_CHECKED' } / >
< Checkbox name = { 'PARENTS_CHECKED' } onChange = { e =>
e . target . checked ? setUserInfo ( { ... userInfo , rulesAccepted : true } )
: setUserInfo ( { ... userInfo , rulesAccepted : false } )
} / >
< label className = "mr-4 font-bold text-gray-500" >
اینجانبان
< span className = "text-red52 font-bold" > { userInfo . fatherName } { userInfo . fatherFamilyName } < / s p a n >
< span className = "text-red52 font-bold" > { userInfo . fatherInfo . first Name } { userInfo . fatherInfo . last Name } < / s p a n >
و
< span className = "text-red52 font-bold" > { userInfo . motherName } { userInfo . motherFamilyName } < / s p a n >
< span className = "text-red52 font-bold" > { userInfo . motherInfo . first Name } { userInfo . motherInfo . last Name } < / s p a n >
سرپرست های دانش آموز
< span className = "text-red52 font-bold" > { userInfo . n ame} { userInfo . family Name} < / s p a n >
< span className = "text-red52 font-bold" > { userInfo . firstN ame} { userInfo . last Name} < / s p a n >
با قوانین و مقررات موافقت نموده و تمامی موارد به عهده اینجانب میباشد
< / l a b e l >
< / d i v >
@ -706,8 +844,8 @@ const Register = ({ activeLogin, isMobile }) => {
< p className = "font-bold text-gray-400 mt-2 leading-normal text-sm" > لطفا اطلاعاتی که وارد کرده اید را چک کنید < / p >
< / d i v >
< div className = "flex flex-col border-b border-solid border-gray-300 leading-7 pb -6" >
< div className = "w-full flex flex-wrap" >
< div className = "flex flex-col w-1/2 border-b border-solid border-gray-300 leading-7 py -6" >
< h1 className = "font-bold mb-2 text-lg" > مشخصات دانش آموز < / h 1 >
{
finalViewInfo . slice ( 0 , 8 ) . map ( item => (
@ -717,7 +855,7 @@ const Register = ({ activeLogin, isMobile }) => {
) )
}
< / d i v >
< div className = "flex flex-col border-b border-solid border-gray-300 leading-7 py-6" >
< div className = "flex w-1/2 flex-col border-b border-solid border-gray-300 leading-7 py-6" >
< h1 className = "font-bold mb-2 text-lg" > مشخصات پدر دانش آموز < / h 1 >
{
finalViewInfo . slice ( 8 , 16 ) . map ( item => (
@ -727,7 +865,7 @@ const Register = ({ activeLogin, isMobile }) => {
) )
}
< / d i v >
< div className = "flex flex-col border-b border-solid border-gray-300 leading-7 py-6" >
< div className = "flex w-1/2 flex-col border-b border-solid border-gray-300 leading-7 py-6" >
< h1 className = "font-bold mb-2 text-lg" > مشخصات مادر دانش آموز < / h 1 >
{
finalViewInfo . slice ( 16 , 24 ) . map ( item => (
@ -737,7 +875,7 @@ const Register = ({ activeLogin, isMobile }) => {
) )
}
< / d i v >
< div className = "flex flex-col border-b border-solid border-gray-300 leading-7 py-6" >
< div className = "flex w-1/2 flex-col border-b border-solid border-gray-300 leading-7 py-6" >
< h1 className = "font-bold mb-2 text-lg" > مشخصات خانواده دانش آموز < / h 1 >
{
finalViewInfo . slice ( 24 , 27 ) . map ( item => (
@ -748,6 +886,7 @@ const Register = ({ activeLogin, isMobile }) => {
}
< / d i v >
< / d i v >
< / d i v >
< div className = "w-full flex pt-10 justify-end" >
< div className = "w-40 mx-4" >
@ -758,8 +897,9 @@ const Register = ({ activeLogin, isMobile }) => {
< / d i v >
< div className = "w-40" >
< Button borderType = 'rounded' title = 'ورود' to = '/dashboard' onClick = { ( ) =>
activeLogin ( )
< Button borderType = 'rounded' title = 'تایید' to = '/' onClick = { ( ) =>
// activeLogin()
setProfile ( userInfo )
} / >
< / d i v >
< / d i v >
@ -780,7 +920,15 @@ const Register = ({ activeLogin, isMobile }) => {
} ;
const mapStateToProps = ( state ) => ( {
isMobile : state . publicApi . isMobile ,
province : state . publicApi . province ,
city : state . publicApi . city ,
user : state . user . status ,
} )
const mapDispatchToProps = {
setProfile : user . setProfile ,
getProvince : publicApi . getProvince ,
getCity : publicApi . getCity ,
}
export default connect ( mapStateToProps ) ( Register ) ;
export default connect ( mapStateToProps , mapDispatchToProps ) ( Register ) ;