This commit is contained in:
Malai Raja
2023-12-02 19:22:27 +05:30
parent 2aab086a66
commit 2d7eb690a1
21 changed files with 7495 additions and 146 deletions

View File

@@ -0,0 +1,409 @@
import {
Box, Tab, Tabs,
Chip,
Divider,
Grid,
Link,
List,
ListItem,
ListItemIcon,
ListItemSecondaryAction,
Stack,
Typography,
useMediaQuery,
Avatar,
} from '@mui/material';
import LinearWithLabel from 'components/@extended/progress/LinearWithLabel';
// import { PatternFormat } from 'react-number-format';
import axios from 'axios';
// project import
import MainCard from 'components/MainCard';
import { AimOutlined, EnvironmentOutlined, MailOutlined, PhoneOutlined } from '@ant-design/icons';
import { useEffect ,useState} from 'react';
const Accountsettings = () => {
const matchDownMD = useMediaQuery((theme) => theme.breakpoints.down('md'));
const [info, setInfo] = useState({})
useEffect(() => {
if (localStorage.getItem('tenantid')) {
fetchaccount(localStorage.getItem('tenantid'));
}
}, []);
const fetchaccount = async (tid) => {
await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`)
.then((res) => {
console.log(res)
if (res.data.status) {
setInfo(res.data.details);
}
}).catch((err) => {
console.log(err)
})
}
return <>
<Grid container rowSpacing={4.5} columnSpacing={2.75}>
<Grid item xs={12} sx={{ mb: -2.25 }}>
<Stack direction={{ xs: 'column', md: 'row' }} justifyContent='space-between' alignItems='center' spacing={2}>
<Stack direction='column' alignItems='flex-start' spacing={1}>
<Typography variant="h3">Account Settings</Typography>
</Stack>
</Stack>
</Grid>
<Grid item xs={12}>
<MainCard border={false} boxShadow sx={{height:'100%'}}>
<Box sx={{ borderBottom: 1, borderColor: 'divider', width: '100%',height:'100%' }}>
<Tabs value={0}
// onChange={handleChange}
variant="scrollable" scrollButtons="auto" aria-label="account profile tab">
<Tab label="Account"
// component={Link} to="/apps/profiles/account/basic" icon={<UserOutlined />} iconPosition="start"
/>
</Tabs>
<Grid container spacing={3}
sx={{ mt: 1,height:'100%'}}
>
<Grid item xs={12} sm={5} md={4} xl={3}>
<Grid container spacing={3} sx={{height:'100%'}}>
<Grid item xs={12} sx={{height:'100%'}}>
<MainCard sx={{height:'100%'}}>
<Grid container spacing={3} sx={{height:'100%'}}>
<Grid item xs={12} sx={{height:'100%'}}>
<Stack direction="row" justifyContent="flex-end">
{/* <Chip label="Pro" size="small" color="primary" /> */}
</Stack>
<Stack spacing={2.5} alignItems="center">
<Avatar alt="Avatar 1"
// size="xl"
sx={{width:80,height:80}}
// src={avatarImage(`./default.png`)}
/>
<Stack spacing={0.5} alignItems="center">
<Typography variant="h5">{info.companyname || ''}</Typography>
<Typography color="secondary">{info.registrationno || ''}</Typography>
</Stack>
</Stack>
</Grid>
{/* <Grid item xs={12}>
<Divider />
</Grid>
<Grid item xs={12}>
<Stack direction="row" justifyContent="space-around" alignItems="center">
<Stack spacing={0.5} alignItems="center">
<Typography variant="h5">86</Typography>
<Typography color="secondary">Post</Typography>
</Stack>
<Divider orientation="vertical" flexItem />
<Stack spacing={0.5} alignItems="center">
<Typography variant="h5">40</Typography>
<Typography color="secondary">Project</Typography>
</Stack>
<Divider orientation="vertical" flexItem />
<Stack spacing={0.5} alignItems="center">
<Typography variant="h5">4.5K</Typography>
<Typography color="secondary">Members</Typography>
</Stack>
</Stack>
</Grid>*/}
<Grid item xs={12}>
<Divider />
</Grid>
<Grid item xs={12} sx={{height:'100%'}}>
<List component="nav" aria-label="main mailbox folders" sx={{ py: 0, '& .MuiListItem-root': { p: 0, py: 1 } }}>
<ListItem>
<ListItemIcon>
<MailOutlined />
</ListItemIcon>
<ListItemSecondaryAction>
<Typography align="right">{info.primaryemail || ''}</Typography>
</ListItemSecondaryAction>
</ListItem>
<ListItem>
<ListItemIcon>
<PhoneOutlined />
</ListItemIcon>
<ListItemSecondaryAction>
<Typography align="right">
{/* (+1-876) 8654 239 581 */}
{info.primarycontact || ''}
</Typography>
</ListItemSecondaryAction>
</ListItem>
<ListItem>
<ListItemIcon>
<AimOutlined />
</ListItemIcon>
<ListItemSecondaryAction>
<Typography align="right">
{/* New York */}
{info.city}
</Typography>
</ListItemSecondaryAction>
</ListItem>
<ListItem>
<ListItemIcon>
<EnvironmentOutlined />
</ListItemIcon>
<ListItemSecondaryAction>
{/* <Link align="right" href="https://google.com" target="_blank">
https://anshan.dh.url
</Link> */}
{info.state}
</ListItemSecondaryAction>
</ListItem>
</List>
</Grid>
</Grid>
</MainCard>
</Grid>
{/* <Grid item xs={12}>
<MainCard title="Skills">
<Grid container spacing={1.25}>
<Grid item xs={6}>
<Typography color="secondary">Junior</Typography>
</Grid>
<Grid item xs={6}>
<LinearWithLabel value={30} />
</Grid>
<Grid item xs={6}>
<Typography color="secondary">UX Reseacher</Typography>
</Grid>
<Grid item xs={6}>
<LinearWithLabel value={80} />
</Grid>
<Grid item xs={6}>
<Typography color="secondary">Wordpress</Typography>
</Grid>
<Grid item xs={6}>
<LinearWithLabel value={90} />
</Grid>
<Grid item xs={6}>
<Typography color="secondary">HTML</Typography>
</Grid>
<Grid item xs={6}>
<LinearWithLabel value={30} />
</Grid>
<Grid item xs={6}>
<Typography color="secondary">Graphic Design</Typography>
</Grid>
<Grid item xs={6}>
<LinearWithLabel value={95} />
</Grid>
<Grid item xs={6}>
<Typography color="secondary">Code Style</Typography>
</Grid>
<Grid item xs={6}>
<LinearWithLabel value={75} />
</Grid>
</Grid>
</MainCard>
</Grid> */}
</Grid>
</Grid>
<Grid item xs={12} sm={7} md={8} xl={9} >
<Grid container spacing={3} >
<Grid item xs={12} >
<MainCard title="Other Details" >
<List sx={{ py: 0 }}>
<ListItem divider={!matchDownMD}>
<Grid container spacing={3}>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Name</Typography>
<Typography>{info.tenantname || ''}</Typography>
</Stack>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Registration No</Typography>
<Typography>{info.registrationno || ''}</Typography>
</Stack>
</Grid>
</Grid>
</ListItem>
<ListItem divider={!matchDownMD}>
<Grid container spacing={3}>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Phone</Typography>
<Typography>
{/* (+1-876) <PatternFormat value={8654239581} displayType="text" type="text" format="#### ### ###" /> */}
{info.primarycontact || ''}
</Typography>
</Stack>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">State</Typography>
<Typography>{info.state || ''}</Typography>
</Stack>
</Grid>
</Grid>
</ListItem>
<ListItem divider={!matchDownMD}>
<Grid container spacing={3}>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Email</Typography>
<Typography>{info.primaryemail || ''}</Typography>
</Stack>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">City</Typography>
<Typography>{info.city || ''}</Typography>
</Stack>
</Grid>
</Grid>
</ListItem>
<ListItem divider={!matchDownMD}>
<Grid container spacing={3}>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Suburb</Typography>
<Typography>{info.suburb || ''}</Typography>
</Stack>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Zip Code</Typography>
<Typography>{info.postcode || ''}</Typography>
</Stack>
</Grid>
</Grid>
</ListItem>
<ListItem>
<Stack spacing={0.5}>
<Typography color="secondary">Address</Typography>
<Typography>{info.address || ''}</Typography>
</Stack>
</ListItem>
</List>
</MainCard>
</Grid>
<Grid item xs={12}>
<MainCard title="Info">
<Typography color="secondary">
{info.info || ''}
</Typography>
</MainCard>
</Grid>
{/* <Grid item xs={12}>
<MainCard title="Education">
<List sx={{ py: 0 }}>
<ListItem divider>
<Grid container spacing={matchDownMD ? 0.5 : 3}>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Master Degree (Year)</Typography>
<Typography>2014-2017</Typography>
</Stack>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Institute</Typography>
<Typography>-</Typography>
</Stack>
</Grid>
</Grid>
</ListItem>
<ListItem divider>
<Grid container spacing={matchDownMD ? 0.5 : 3}>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Bachelor (Year)</Typography>
<Typography>2011-2013</Typography>
</Stack>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Institute</Typography>
<Typography>Imperial College London</Typography>
</Stack>
</Grid>
</Grid>
</ListItem>
<ListItem>
<Grid container spacing={matchDownMD ? 0.5 : 3}>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">School (Year)</Typography>
<Typography>2009-2011</Typography>
</Stack>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Institute</Typography>
<Typography>School of London, England</Typography>
</Stack>
</Grid>
</Grid>
</ListItem>
</List>
</MainCard>
</Grid> */}
{/* <Grid item xs={12}>
<MainCard title="Emplyment">
<List sx={{ py: 0 }}>
<ListItem divider>
<Grid container spacing={matchDownMD ? 0.5 : 3}>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Senior</Typography>
<Typography color="secondary">Senior UI/UX designer (Year)</Typography>
</Stack>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Job Responsibility</Typography>
<Typography>
Perform task related to project manager with the 100+ team under my observation. Team management is key role in
this company.
</Typography>
</Stack>
</Grid>
</Grid>f
</ListItem>
<ListItem>
<Grid container spacing={matchDownMD ? 0.5 : 3}>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Trainee cum Project Manager (Year)</Typography>
<Typography>2017-2019</Typography>
</Stack>
</Grid>
<Grid item xs={12} md={6}>
<Stack spacing={0.5}>
<Typography color="secondary">Job Responsibility</Typography>
<Typography>Team management is key role in this company.</Typography>
</Stack>
</Grid>
</Grid>
</ListItem>
</List>
</MainCard>
</Grid> */}
</Grid>
</Grid>
</Grid>
</Box>
</MainCard>
</Grid>
</Grid>
</>
}
export default Accountsettings;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,602 @@
import { useEffect, useState } from 'react';
// material-ui
import { useTheme } from '@mui/material/styles';
import {
Box, Button, FormLabel, Grid, InputLabel,
MenuItem,
Select, Stack, TextField, Typography
} from '@mui/material';
// third-party
// import { PatternFormat } from 'react-number-format';
// project import
import Avatar from 'components/@extended/Avatar';
import MainCard from 'components/MainCard';
import {
// facebookColor, linkedInColor, twitterColor
ThemeMode
} from 'config';
import axios from 'axios';
// assets
import {
// FacebookFilled, LinkedinFilled, TwitterSquareFilled,
CameraOutlined
} from '@ant-design/icons';
import { usePlacesWidget } from "react-google-autocomplete";
import Loader from 'components/Loader';
import Geocode from "react-geocode";
import { enqueueSnackbar } from 'notistack';
import { useNavigate } from 'react-router';
// import { setLocationType } from 'react-geocode';
// const avatarImage = require.context('assets/images/users', true);
// styles & constant
// const ITEM_HEIGHT = 48;
// const ITEM_PADDING_TOP = 8;
// const MenuProps = {
// PaperProps: {
// style: {
// maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP
// }
// }
// };
const Createclient = () => {
const theme = useTheme();
const [selectedImage, setSelectedImage] = useState(undefined);
const [avatar, setAvatar] = useState(
// avatarImage(`./default.png`)
);
const [businessname, setBusinessname] = useState('');
const [businessno, setBusinessno] = useState('');
// const [role, setRole] = useState('');
const [mobilenumber, setMobilenumber] = useState('')
const [emailaddress, setEmailaddress] = useState('')
const [city, setCity] = useState('')
const [zipcode, setZipcode] = useState('');
const [address, setAddress] = useState('');
const [state, setState] = useState('');
const [suburb, setSuburb] = useState('');
const [latlong, setLatlong] = useState({});
const [profiledetails, setProfiledetails] = useState({});
const [primarycontact,setPrimarycontact]=useState('')
const [firstname,setFirstname]=useState('');
const [doorno,setDoorno]=useState('');
const [landmark,setLandmark]=useState('')
const navigate = useNavigate();
Geocode.setApiKey(process.env.REACT_APP_GOOGLE_MAPS_API_KEY);
// Geocode.setApiKey('AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8');
const [loading, setLoading] = useState(false)
useEffect(() => {
// fetchprofiledetails(localStorage.getItem('appuserid'));
// fetchprofiledetails(181);
}, [])
useEffect(() => {
try {
Geocode.fromAddress(address).then(
(response) => {
if (response.status == 'OK') {
const { lat, lng } = response.results[0].geometry.location;
setLatlong({
lat, lng
})
console.log(response);
}
}, (error) => {
console.log(error)
}
);
} catch (err) {
console.log(err)
}
}, [address])
const opentoast = (message) => {
enqueueSnackbar(message, {
variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
autoHideDuration: 2000
})
// console.log(alertmessage)
}
const fetchprofiledetails = async (userid) => {
if (userid) {
setLoading(true)
try {
await axios.get(`${process.env.REACT_APP_URL2}/tenants/getclient?id=${userid}`)
.then((res) => {
console.log(res)
if (res.data.message === 'Successful') {
let res1 = res.data.details;
setProfiledetails(res1)
setBusinessname(res1.tenantname)
setBusinessno(res1.registrationno);
setMobilenumber(res1.contactno);
setPrimarycontact(res1.primarycontact)
setEmailaddress(res1.primaryemail);
setAddress(res1.address);
setCity(res1.city);
setZipcode(res1.postcode);
setState(res1.state);
setSuburb(res1.suburb);
setLatlong({
lat: res1.latitude,
lng: res1.longitude
})
}
setLoading(false)
}).catch((err) => {
console.log(err)
setLoading(false)
})
} catch (err) {
console.log(err)
setLoading(false)
}
}
}
useEffect(() => {
if (selectedImage) {
setAvatar(URL.createObjectURL(selectedImage));
}
}, [selectedImage]);
const { ref: materialRef } = usePlacesWidget({
apiKey: process.env.REACT_APP_GOOGLE_MAPS_API_KEY,
onPlaceSelected: (place) => {
console.log(place)
setAddress(place.formatted_address)
let city1, zipcode1, state1,suburb1;
for (let i = 0; i < place.address_components.length; i++) {
for (let j = 0; j < place.address_components[i].types.length; j++) {
switch (place.address_components[i].types[j]) {
case "locality":
city1 = place.address_components[i].long_name;
break;
case "administrative_area_level_1":
state1 = place.address_components[i].long_name;
break;
case "postal_code":
zipcode1 = place.address_components[i].long_name;
break;
case "sublocality":
suburb1 = place.address_components[i].long_name;
break;
}
}
}
setCity(city1 || '')
setState(state1 || '');
setZipcode(zipcode1 || '');
setSuburb(suburb1 || '')
// setAddress(place.formatted_address)
},
// inputAutocompleteValue: "country",
options: {
// componentRestrictions: 'us',
// types: ["establishment"]
types: ['address' || 'geocode']
},
});
const createprofile = async () => {
console.log('res', businessname, businessno, mobilenumber, emailaddress, address, city, zipcode)
if (!businessname) {
opentoast('Fill Business name')
} else if (!businessno) {
opentoast('Fill Registration No')
} else if (!businessno) {
opentoast('Fill Registration No')
} else if (!firstname) {
opentoast('Fill Full name')
} else if (!mobilenumber) {
opentoast('Fill Mobile Number')
}else if (!emailaddress) {
opentoast('Fill emailaddress')
} else if (!address) {
opentoast('Fill Address')
} else if (!city) {
opentoast('Fill City')
} else if (!zipcode) {
opentoast('Fill post code')
} else if (!suburb) {
opentoast('Fill suburb')
} else if (!emailaddress) {
opentoast('Fill emailaddress')
} else if (!latlong.lat || !latlong.lng) {
opentoast('Choose valid address')
} else {
let obj={
"customerid":0,
"configid":1,
"firstname":firstname,
"applocationid":3,
"profileimage":"",
"dialcode":"+91",
"contactno":mobilenumber,
"devicetype":"",
"deviceid":"",
"customertoken":"",
"address":address,
"suburb":suburb,
"city":city,
"state":state,
"postcode":zipcode,
"landmark":landmark,
"doorno":doorno,
"latitude":latlong.lat.toString(),
"longitude":latlong.lng.toString(),
"tenantid":parseInt(localStorage.getItem('tenantid'))
}
console.log(obj)
setLoading(true)
try {
await axios.post(`${process.env.REACT_APP_URL}/customers/create`,obj)
.then((res) => {
console.log(res)
if (res.data.status) {
enqueueSnackbar(' Created Successfully ', {
variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
autoHideDuration: 2000
})
navigate('/clients')
// setTimeout(()=>{
// fetchprofiledetails(localStorage.getItem('appuserid'));
// },2000)
}else if(res.data.message == "Customer Already available"){
enqueueSnackbar("Customer Already available", {
variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
autoHideDuration: 2000
})
}
setLoading(false)
}).catch((err) => {
console.log(err)
setLoading(false)
})
} catch (err) {
console.log(err)
setLoading(false)
}
}
}
// const [experience, setExperience] = useState('0');
// const handleChange = (event) => {
// setExperience(event.target.value);
// };
return <>
{(loading) && <Loader />}
<Grid item xs={12}
sx={{ mb: 2 }}
>
<Stack direction="row" justifyContent="space-between" alignItems="center">
<Typography variant="h3">Create Client</Typography>
</Stack>
</Grid>
<MainCard>
<Grid container spacing={3}>
<Grid item xs={12} sm={4} >
<MainCard title="Personal Information" sx={{ height: '100%' }}>
<Grid container spacing={3}>
<Grid item xs={12}>
<Stack spacing={2.5} alignItems="center" sx={{ m: 3 }}>
<FormLabel
htmlFor="change-avtar"
sx={{
position: 'relative',
borderRadius: '50%',
overflow: 'hidden',
'&:hover .MuiBox-root': { opacity: 1 },
cursor: 'pointer'
}}
>
<Avatar alt="Avatar 1"
src={avatar}
sx={{ width: 76, height: 76 }} />
<Box
sx={{
position: 'absolute',
top: 0,
left: 0,
backgroundColor: theme.palette.mode === ThemeMode.DARK ? 'rgba(255, 255, 255, .75)' : 'rgba(0,0,0,.65)',
width: '100%',
height: '100%',
opacity: 0,
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}
>
<Stack spacing={0.5} alignItems="center">
<CameraOutlined style={{ color: theme.palette.secondary.lighter, fontSize: '1.5rem' }} />
<Typography sx={{ color: 'secondary.lighter' }} variant="caption">
Upload
</Typography>
</Stack>
</Box>
</FormLabel>
<TextField
type="file"
accept="image/*"
id="change-avtar"
placeholder="Outlined"
variant="outlined"
sx={{ display: 'none' }}
onChange={(e) => setSelectedImage(e.target.files?.[0])}
/>
</Stack>
</Grid>
<Grid item xs={12}
>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-first-name">Business Name</InputLabel>
<TextField fullWidth
id="personal-first-name" placeholder="Business Name" autoFocus
onChange={(e) => setBusinessname(e.target.value)}
value={businessname}
autoComplete='off'
/>
</Stack>
</Grid>
<Grid item xs={12}
>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-last-name">Registration No</InputLabel>
<TextField fullWidth
id="personal-last-name" placeholder="Registration No"
onChange={(e) => setBusinessno(e.target.value)}
value={businessno}
autoComplete='off'
/>
</Stack>
</Grid>
<Grid item xs={12}
>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-last-name">Name</InputLabel>
<TextField fullWidth
id="personal-last-name" placeholder="Name"
onChange={(e) => setFirstname(e.target.value)}
value={firstname}
autoComplete='off'
/>
</Stack>
</Grid>
{/* <Grid item xs={12}
>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-role-name">Role</InputLabel>
<TextField fullWidth
id="personal-role-name" placeholder="Role Name" autoFocus
onChange={(e) => setRole(e.target.value)}
value={role}
autoComplete='off'
/>
</Stack>
</Grid> */}
</Grid>
</MainCard>
</Grid>
<Grid item xs={12} sm={8} >
<MainCard title="Contact Information" sx={{ height: '100%' }}>
<Grid container spacing={3}>
<Grid item xs={12}
>
<Stack spacing={1.25} >
<InputLabel htmlFor="personal-phone">Phone Number</InputLabel>
<Stack direction="row" justifyContent="space-between" alignItems="center"
spacing={2}>
<Select defaultValue="+1" disabled sx={{cursor: 'not-allowed'}}>
<MenuItem value="+1">+91</MenuItem>
</Select>
<TextField
type='number'
id='personal-phone'
// format="##########"
// mask="_"
fullWidth
// customInput={TextField}
placeholder="Phone Number"
// defaultValue="8654239581"
// onBlur={() => { }}
onChange={(e) => {
if(e.target.value.toString().length <= 10){
setMobilenumber(e.target.value)
}
}}
value={mobilenumber}
autoComplete='off'
// disabled
sx={{cursor: 'not-allowed'}}
/>
</Stack>
</Stack>
</Grid>
<Grid item xs={12}
// sm={6}
>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-email">Email Address</InputLabel>
<TextField type="email" fullWidth
// defaultValue="stebin.ben@gmail.com"
id="personal-email" placeholder="Email Address"
onChange={(e) => setEmailaddress(e.target.value)}
value={emailaddress}
autoComplete='off'
/>
</Stack>
</Grid>
<Grid item xs={12}>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-address">Address</InputLabel>
<TextField
fullWidth
// defaultValue="Street 110-B Kalians Bag, Dewan, M.P. New York"
id="personal-address"
placeholder="Address"
value={address}
onChange={(e) => setAddress(e.target.value)}
inputRef={materialRef}
/>
</Stack>
</Grid>
<Grid item xs={12} sm={6}>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-location">Suburb</InputLabel>
<TextField fullWidth
// defaultValue="New York"
id="personal-location" placeholder="Location"
onChange={(e) => setSuburb(e.target.value)}
value={suburb}
autoComplete='off'
/>
</Stack>
</Grid>
<Grid item xs={12} sm={6}>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-zipcode">City</InputLabel>
<TextField fullWidth
// defaultValue="956754"
// type='number'
id="personal-zipcode" placeholder="City"
onChange={(e) => setCity(e.target.value)}
value={city}
autoComplete='off'
/>
</Stack>
</Grid>
<Grid item xs={12} sm={6}>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-location">State</InputLabel>
<TextField fullWidth
// defaultValue="New York"
id="personal-location" placeholder="State"
onChange={(e) => setState(e.target.value)}
value={state}
autoComplete='off'
/>
</Stack>
</Grid>
<Grid item xs={12} sm={6}>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-zipcode">Post Code</InputLabel>
<TextField fullWidth
// defaultValue="956754"
type='number'
id="personal-zipcode" placeholder="Zipcode"
onChange={(e) => setZipcode(e.target.value)}
value={zipcode}
autoComplete='off'
/>
</Stack>
</Grid>
<Grid item xs={12} sm={6}>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-location">Door No</InputLabel>
<TextField fullWidth
// defaultValue="New York"
id="personal-location" placeholder="Door No"
onChange={(e) => setDoorno(e.target.value)}
value={doorno}
autoComplete='off'
/>
</Stack>
</Grid>
<Grid item xs={12} sm={6}>
<Stack spacing={1.25}>
<InputLabel htmlFor="personal-email">Landmark</InputLabel>
<TextField type="email" fullWidth
// defaultValue="stebin.ben@gmail.com"
id="personal-email" placeholder="Landmark"
onChange={(e) => setLandmark(e.target.value)}
value={landmark}
autoComplete='off'
/>
</Stack>
</Grid>
</Grid>
</MainCard>
</Grid>
<Grid item xs={12}>
<Stack direction="row" justifyContent="flex-end" alignItems="center" spacing={2}>
<Button variant="contained"
onClick={() => createprofile()}
>Create</Button>
</Stack>
</Grid>
</Grid>
</MainCard>
</>
}
export default Createclient;

View File

@@ -64,7 +64,7 @@ const Login = () => {
useEffect(() => {
if (localStorage.getItem("authname")
// || localStorage.getItem("appuserid")
// || localStorage.getItem("appuserid")
) {
navigate('/dashboard')
}
@@ -82,30 +82,30 @@ const Login = () => {
// })
await axios.post(`${process.env.REACT_APP_URL}/users/login`, {
"authname": e.target.value,
"configid":1,
"password":'admin'
"configid": 1,
"password": 'admin'
})
.then((res) => {
console.log(res.data)
if (res.data.details.authname === e.target.value) {
.then((res) => {
console.log(res.data)
if (res.data.details.authname === e.target.value) {
setUsername(e.target.value);
setCheckusername(false);
}else{
setCheckusername(true);
setUsername(e.target.value);
setCheckusername(false);
} else {
setCheckusername(true);
}
// if (res.data.authname === e.target.value) {
}
// if (res.data.authname === e.target.value) {
// setUsername(e.target.value);
// setCheckusername(false);
// }
}).catch((err) => {
// if (err.response.data.message === 'No user found') {
// setUsername(e.target.value);
// setCheckusername(false);
// }
}).catch((err) => {
// if (err.response.data.message === 'No user found') {
setCheckusername(true);
// }
})
// }
})
} catch (err) {
console.log(err)
@@ -122,7 +122,7 @@ const Login = () => {
try {
await axios.post(`${process.env.REACT_APP_URL}/users/login`, {
"authname": username,
"configid":1,
"configid": 1,
"password": password
}).then((res) => {
console.log(res.data)
@@ -151,6 +151,7 @@ const Login = () => {
localStorage.setItem("appuserid", res.data.details.userid);
localStorage.setItem("roleid", res.data.details.roleid);
localStorage.setItem("tenantid", res.data.details.tenantid);
navigate('/dashboard');
@@ -218,7 +219,8 @@ const Login = () => {
}}
>
<Grid item xs={12}
sx={{ ml: 3, mt: 3 }}
// sx={{ ml: 3, mt: 3 }}
sx={{ml:3,mt:1}}
>
@@ -234,7 +236,7 @@ const Login = () => {
justifyContent="center"
alignItems="center"
// sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 112px)' } }}
sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 132px)' } }}
sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 140px)' } }}
>
<Grid item>
@@ -406,7 +408,7 @@ const Login = () => {
<Button
disabled={submitting}
onClick={()=>{
onClick={() => {
loginsend()
// navigate('/dashboard')
}}
@@ -430,6 +432,7 @@ const Login = () => {
</Grid>
<Grid item xs={12}
// sx={{ m: 3, mt: 1 }}
sx={{mb:1}}
>
{/* <AuthFooter /> */}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff