Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-257
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-257
2022-257
Commits
df860b1c
Commit
df860b1c
authored
Oct 10, 2022
by
Sachintha Nipun M.M. it19046594
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report generation
parent
c247698d
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
648 additions
and
192 deletions
+648
-192
Backend/src/controller/user.controller.js
Backend/src/controller/user.controller.js
+27
-25
bussifinder/package-lock.json
bussifinder/package-lock.json
+255
-0
bussifinder/package.json
bussifinder/package.json
+1
-0
bussifinder/src/components/Auth/SignIn.js
bussifinder/src/components/Auth/SignIn.js
+53
-9
bussifinder/src/components/Auth/SignUp.js
bussifinder/src/components/Auth/SignUp.js
+76
-5
bussifinder/src/components/Footer.js
bussifinder/src/components/Footer.js
+147
-143
bussifinder/src/components/MultipleResult.js
bussifinder/src/components/MultipleResult.js
+1
-1
bussifinder/src/components/ResponsiveAppBar.js
bussifinder/src/components/ResponsiveAppBar.js
+8
-6
bussifinder/src/components/Results.js
bussifinder/src/components/Results.js
+52
-2
bussifinder/src/features/business.js
bussifinder/src/features/business.js
+28
-1
No files found.
Backend/src/controller/user.controller.js
View file @
df860b1c
...
...
@@ -138,22 +138,24 @@ const createUser = async (req, res) => {
transporter
.
sendMail
(
mailOptions
,
function
(
error
,
info
)
{
if
(
error
)
{
console
.
log
(
"
error
"
,
error
)
res
.
status
(
500
).
send
(
error
);
}
else
{
console
.
log
(
"
Verification email is sent to your account
"
)
console
.
log
(
"
Verification email is sent to your email address
"
)
console
.
log
(
data
);
res
.
status
(
200
).
send
({
data
:
data
,
message
:
"
Verification email is sent to your email address
"
});
}
})
console
.
log
(
data
);
res
.
status
(
200
).
send
(
data
);
}
catch
(
err
)
{
console
.
log
(
err
);
res
.
send
(
err
);
res
.
s
tatus
(
500
).
s
end
(
err
);
}
});
});
}
else
{
res
.
send
({
message
:
"
User Already Exist
"
});
res
.
s
tatus
(
500
).
s
end
({
message
:
"
User Already Exist
"
});
}
}
});
...
...
@@ -194,7 +196,7 @@ const createGoogleUser = async (req, res) => {
});
});
}
else
{
res
.
send
({
message
:
"
User Already Exist
"
});
res
.
s
tatus
(
500
).
s
end
({
message
:
"
User Already Exist
"
});
}
}
});
...
...
@@ -206,31 +208,31 @@ const validateUser = async (req, res) => {
console
.
log
(
req
);
let
user
=
await
User
.
findOne
({
email
:
req
.
body
.
email
},
(
err
,
user
)
=>
{
if
(
!
user
.
isVerified
)
{
return
res
.
status
(
400
).
send
(
"
Please Verify your E-mail Address
"
);
}
if
(
err
)
{
console
.
log
(
err
);
res
.
status
(
500
).
send
(
err
);
}
else
{
if
(
user
==
null
)
return
res
.
status
(
500
).
send
(
"
User Not Found
"
);
if
(
user
==
null
)
return
res
.
status
(
500
).
send
(
{
message
:
"
User Not Found
"
}
);
else
{
if
(
!
user
.
isVerified
)
{
bcrypt
.
compare
(
req
.
body
.
password
,
user
.
password
,
function
(
err
,
result
)
{
if
(
result
)
{
const
token
=
jwt
.
sign
({
email
:
user
.
email
,
fullName
:
user
.
fullName
,
},
process
.
env
.
JWT_SECRET
)
res
.
status
(
200
).
send
({
user
:
token
});
}
else
{
console
.
log
(
"
Credentials Does Not Matched
"
);
res
.
status
(
500
).
send
(
"
Credentials Does Not Matched
"
);
}
});
return
res
.
status
(
400
).
send
({
message
:
"
Please Verify your E-mail Address
"
});
}
else
{
bcrypt
.
compare
(
req
.
body
.
password
,
user
.
password
,
function
(
err
,
result
)
{
if
(
result
)
{
const
token
=
jwt
.
sign
({
email
:
user
.
email
,
fullName
:
user
.
fullName
,
},
process
.
env
.
JWT_SECRET
)
res
.
status
(
200
).
send
({
user
:
token
});
}
else
{
console
.
log
(
"
Credentials Does Not Matched
"
);
res
.
status
(
500
).
send
({
message
:
"
Credentials Does Not Matched
"
});
}
});
}
}
...
...
@@ -294,7 +296,7 @@ const verifyEmail = async (req, res) => {
user
.
emailToken
=
null
user
.
isVerified
=
true
await
user
.
save
()
res
.
status
(
200
).
redirect
(
'
http://localhost:3000/signIn
'
);
}
else
{
...
...
bussifinder/package-lock.json
View file @
df860b1c
This diff is collapsed.
Click to expand it.
bussifinder/package.json
View file @
df860b1c
...
...
@@ -22,6 +22,7 @@
"chart.js"
:
"^3.9.1"
,
"export-to-csv-file"
:
"^0.2.2"
,
"gapi-script"
:
"^1.2.0"
,
"jspdf"
:
"^2.5.1"
,
"jwt-decode"
:
"^3.1.2"
,
"mdb-react-ui-kit"
:
"^4.2.0"
,
"react"
:
"^18.1.0"
,
...
...
bussifinder/src/components/Auth/SignIn.js
View file @
df860b1c
...
...
@@ -30,6 +30,15 @@ import API from '../../api';
import
jwt_decode
from
"
jwt-decode
"
;
import
{
useSelector
,
useDispatch
}
from
'
react-redux
'
;
import
{
login
}
from
'
../../features/user
'
;
import
Snackbar
from
'
@mui/material/Snackbar
'
;
import
MuiAlert
,
{
AlertProps
}
from
'
@mui/material/Alert
'
;
const
Alert
=
React
.
forwardRef
(
function
Alert
(
props
,
ref
,
)
{
return
<
MuiAlert
elevation
=
{
6
}
ref
=
{
ref
}
variant
=
"
filled
"
{...
props
}
/>
;
});
const
FacebookButton
=
styled
(
Button
)(()
=>
({
transitionProperty
:
"
box-shadow
"
,
...
...
@@ -135,6 +144,8 @@ export default function SignIn() {
const
dispatch
=
useDispatch
();
const
userDetails
=
useSelector
((
state
)
=>
state
.
user
)
const
clientId
=
'
380810221970-6p2h323ibdoknuaddgrb432skkdm157o.apps.googleusercontent.com
'
const
[
error
,
setError
]
=
React
.
useState
(
false
);
const
[
errorMsg
,
setErrorMsg
]
=
React
.
useState
(
"
Error
"
);
useEffect
(()
=>
{
console
.
log
(
"
userDetails
"
,
userDetails
);
...
...
@@ -156,6 +167,16 @@ export default function SignIn() {
console
.
log
(
"
FB
"
,
response
);
}
const
handleError
=
()
=>
{
setError
(
true
);
};
const
handleCloseError
=
(
event
,
reason
)
=>
{
if
(
reason
===
'
clickaway
'
)
{
return
;
}
setError
(
false
);
}
const
onSuccess
=
(
res
)
=>
{
console
.
log
(
"
LOGIN SUCCESS!
"
,
res
.
profileObj
)
...
...
@@ -187,11 +208,15 @@ export default function SignIn() {
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
setErrorMsg
(
error
.
response
.
data
.
message
)
handleError
()
});
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
setErrorMsg
(
error
.
response
.
data
.
message
)
handleError
()
});
}
else
{
API
.
post
(
'
user/validate
'
,
body
).
then
(
function
(
result
)
{
...
...
@@ -206,18 +231,24 @@ export default function SignIn() {
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
setErrorMsg
(
error
.
response
.
data
.
message
)
handleError
()
});
}
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
setErrorMsg
(
error
.
response
.
data
.
message
)
handleError
()
});
}
}
const
onFailure
=
(
res
)
=>
{
console
.
log
(
"
LOGIN FAILED!
"
,
res
)
setErrorMsg
(
"
Google Login Failed
"
)
handleError
()
}
useEffect
(()
=>
{
...
...
@@ -239,15 +270,25 @@ export default function SignIn() {
email
:
data
.
get
(
'
email
'
),
password
:
data
.
get
(
'
password
'
)
}
const
result
=
await
API
.
post
(
'
user/validate
'
,
body
)
console
.
log
(
"
result
"
,
result
)
let
decodedToken
=
jwt_decode
(
result
.
data
.
user
)
console
.
log
(
"
decodedToken
"
,
decodedToken
)
localStorage
.
setItem
(
'
token
'
,
result
.
data
.
user
)
dispatch
(
login
({
'
fullName
'
:
decodedToken
.
fullName
,
'
email
'
:
decodedToken
.
email
}))
dispatch
(
addHeader
({
'
header
'
:
true
,
'
footer
'
:
true
}))
navigate
(
'
/
'
)
try
{
const
result
=
await
API
.
post
(
'
user/validate
'
,
body
)
console
.
log
(
"
result
"
,
result
)
let
decodedToken
=
jwt_decode
(
result
.
data
.
user
)
console
.
log
(
"
decodedToken
"
,
decodedToken
)
localStorage
.
setItem
(
'
token
'
,
result
.
data
.
user
)
dispatch
(
login
({
'
fullName
'
:
decodedToken
.
fullName
,
'
email
'
:
decodedToken
.
email
}))
dispatch
(
addHeader
({
'
header
'
:
true
,
'
footer
'
:
true
}))
navigate
(
'
/
'
)
}
catch
(
error
)
{
console
.
log
(
"
errrrr
"
,
error
)
setErrorMsg
(
error
.
response
.
data
.
message
)
handleError
()
}
};
return
(
...
...
@@ -262,6 +303,9 @@ export default function SignIn() {
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
}}
>
<
Snackbar
open
=
{
error
}
autoHideDuration
=
{
6000
}
onClose
=
{
handleCloseError
}
>
<
Alert
onClose
=
{
handleCloseError
}
severity
=
"
error
"
>
{
errorMsg
}
<
/Alert
>
<
/Snackbar
>
<
ThemeProvider
theme
=
{
theme
}
>
<
div
style
=
{{
paddingTop
:
'
50px
'
,
...
...
bussifinder/src/components/Auth/SignUp.js
View file @
df860b1c
import
React
,
{
useEffect
,
useState
}
from
'
react
'
;
import
React
,
{
useEffect
,
useState
,
useRef
}
from
'
react
'
;
import
Avatar
from
'
@mui/material/Avatar
'
;
import
Button
from
'
@mui/material/Button
'
;
import
CssBaseline
from
'
@mui/material/CssBaseline
'
;
...
...
@@ -22,6 +22,15 @@ import { makeStyles } from '@mui/styles';
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
Logo
from
'
./../../images/logo.png
'
import
API
from
'
../../api
'
;
import
Snackbar
from
'
@mui/material/Snackbar
'
;
import
MuiAlert
,
{
AlertProps
}
from
'
@mui/material/Alert
'
;
const
Alert
=
React
.
forwardRef
(
function
Alert
(
props
,
ref
,
)
{
return
<
MuiAlert
elevation
=
{
6
}
ref
=
{
ref
}
variant
=
"
filled
"
{...
props
}
/>
;
});
function
Copyright
(
props
)
{
return
(
...
...
@@ -58,11 +67,41 @@ const useStyles = makeStyles({
})
export
default
function
SignUp
()
{
const
[
open
,
setOpen
]
=
React
.
useState
(
false
);
const
[
error
,
setError
]
=
React
.
useState
(
false
);
const
[
errorMsg
,
setErrorMsg
]
=
React
.
useState
(
"
Error
"
);
const
[
successMsg
,
setSuccessMsg
]
=
React
.
useState
(
"
Successful
"
);
let
navigate
=
useNavigate
();
const
dispatch
=
useDispatch
();
const
headerVisibility
=
useSelector
((
state
)
=>
state
.
header
)
const
classes
=
useStyles
();
const
inputFNameRef
=
useRef
()
const
inputLNameRef
=
useRef
()
const
inputEmailRef
=
useRef
()
const
inputPasswordRef
=
useRef
()
const
handleClick
=
()
=>
{
setOpen
(
true
);
};
const
handleClose
=
(
event
,
reason
)
=>
{
if
(
reason
===
'
clickaway
'
)
{
return
;
}
setOpen
(
false
);
};
const
handleError
=
()
=>
{
setError
(
true
);
};
const
handleCloseError
=
(
event
,
reason
)
=>
{
if
(
reason
===
'
clickaway
'
)
{
return
;
}
setError
(
false
);
}
useEffect
(()
=>
{
dispatch
(
addHeader
({
'
header
'
:
false
,
'
footer
'
:
false
}))
},
[]);
...
...
@@ -87,9 +126,30 @@ export default function SignUp() {
password
:
data
.
get
(
'
password
'
),
role
:
'
user
'
}
const
result
=
await
API
.
post
(
'
user/create
'
,
body
)
navigate
(
'
/signIn
'
)
console
.
log
(
"
result
"
,
result
)
try
{
const
result
=
await
API
.
post
(
'
user/create
'
,
body
)
console
.
log
(
"
hh
"
,
result
)
setSuccessMsg
(
result
.
data
.
message
)
handleClick
()
// navigate('/signIn')
console
.
log
(
"
result
"
,
result
)
if
(
inputFNameRef
.
current
||
inputLNameRef
.
current
||
inputEmailRef
.
current
||
inputPasswordRef
.
current
)
{
inputFNameRef
.
current
.
value
=
""
;
inputLNameRef
.
current
.
value
=
""
;
inputEmailRef
.
current
.
value
=
""
;
inputPasswordRef
.
current
.
value
=
""
;
}
}
catch
(
error
)
{
setErrorMsg
(
error
.
response
.
data
.
message
)
handleError
()
console
.
log
(
"
error
"
,
error
.
response
.
data
.
message
)
if
(
inputFNameRef
.
current
||
inputLNameRef
.
current
||
inputEmailRef
.
current
||
inputPasswordRef
.
current
)
{
inputFNameRef
.
current
.
value
=
""
;
inputLNameRef
.
current
.
value
=
""
;
inputEmailRef
.
current
.
value
=
""
;
inputPasswordRef
.
current
.
value
=
""
;
}
}
};
return
(
...
...
@@ -104,7 +164,14 @@ export default function SignUp() {
justifyContent
:
'
center
'
,
alignItems
:
'
center
'
}}
>
<
Snackbar
open
=
{
open
}
autoHideDuration
=
{
10000
}
onClose
=
{
handleClose
}
>
<
Alert
onClose
=
{
handleClose
}
severity
=
"
success
"
sx
=
{{
width
:
'
100%
'
}}
>
{
successMsg
}
<
/Alert
>
<
/Snackbar
>
<
Snackbar
open
=
{
error
}
autoHideDuration
=
{
6000
}
onClose
=
{
handleCloseError
}
>
<
Alert
onClose
=
{
handleCloseError
}
severity
=
"
error
"
>
{
errorMsg
}
<
/Alert
>
<
/Snackbar
>
<
img
src
=
{
Logo
}
onClick
=
{()
=>
{
navigate
(
`/`
);
dispatch
(
addHeader
({
'
header
'
:
true
,
'
footer
'
:
true
}))
}}
style
=
{{
cursor
:
'
pointer
'
,
position
:
'
absolute
'
,
left
:
'
0
'
,
top
:
'
0
'
,
width
:
'
180px
'
}}
/
>
<
ThemeProvider
theme
=
{
theme
}
>
<
div
style
=
{{
...
...
@@ -160,6 +227,7 @@ export default function SignUp() {
id
=
"
firstName
"
label
=
"
First Name
"
autoFocus
inputRef
=
{
inputFNameRef
}
/
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
sm
=
{
6
}
>
...
...
@@ -170,6 +238,7 @@ export default function SignUp() {
label
=
"
Last Name
"
name
=
"
lastName
"
autoComplete
=
"
family-name
"
inputRef
=
{
inputLNameRef
}
/
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
>
...
...
@@ -180,6 +249,7 @@ export default function SignUp() {
label
=
"
Email Address
"
name
=
"
email
"
autoComplete
=
"
email
"
inputRef
=
{
inputEmailRef
}
/
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
>
...
...
@@ -191,6 +261,7 @@ export default function SignUp() {
type
=
"
password
"
id
=
"
password
"
autoComplete
=
"
new-password
"
inputRef
=
{
inputPasswordRef
}
/
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
>
...
...
bussifinder/src/components/Footer.js
View file @
df860b1c
This diff is collapsed.
Click to expand it.
bussifinder/src/components/MultipleResult.js
View file @
df860b1c
...
...
@@ -354,7 +354,7 @@ const MultipleResult = () => {
}}
>
<
BsFilePlus
className
=
{
classes
.
addMoreBtn
}
/
>
<
div
onClick
=
{()
=>
compareLocation
()}
className
=
{
classes
.
addMoreBtnTxt
}
>
Compare
With
Another
Location
<
/div
>
<
div
className
=
{
classes
.
addMoreBtnTxt
}
>
Compare
With
Another
Location
<
/div
>
<
/Box
>
<
/Box
>
...
...
bussifinder/src/components/ResponsiveAppBar.js
View file @
df860b1c
...
...
@@ -16,7 +16,7 @@ import { useNavigate } from "react-router-dom";
import
Switch
,
{
SwitchProps
}
from
'
@mui/material/Switch
'
;
import
{
useDispatch
}
from
"
react-redux
"
;
import
{
useSelector
}
from
"
react-redux
"
;
import
Logo
from
'
./../images/logo.png
'
import
Logo
from
'
./../images/logo
-new
.png
'
import
{
darkMode
,
lightMode
}
from
"
../features/theme
"
;
import
{
styled
}
from
'
@mui/material/styles
'
;
import
AccountMenu
from
'
./AccountMenu
'
;
...
...
@@ -76,7 +76,6 @@ const ResponsiveAppBar = () => {
setAnchorElUser
(
null
);
};
const
handleChange
=
(
event
)
=>
{
if
(
event
.
target
.
checked
)
{
console
.
log
(
"
dark
"
)
...
...
@@ -99,7 +98,7 @@ const ResponsiveAppBar = () => {
<
Container
maxWidth
=
"
xl
"
>
<
Toolbar
disableGutters
>
<
Box
onClick
=
{()
=>
{
navigate
(
`/`
)
}}
{
/* <Box
sx={{
display: { xs: 'none', md: 'flex' },
mr: 1,
...
...
@@ -112,7 +111,9 @@ const ResponsiveAppBar = () => {
cursor: 'pointer',
}}
/
>
}} /> */
}
<
img
onClick
=
{()
=>
{
navigate
(
`/`
)
}}
src
=
{
Logo
}
style
=
{{
width
:
'
200px
'
,
cursor
:
'
pointer
'
}}
alt
=
"
logo
"
/>
...
...
@@ -153,7 +154,7 @@ const ResponsiveAppBar = () => {
))}
<
/Menu
>
<
/Box
>
<
Box
onClick
=
{()
=>
{
navigate
(
`/`
)
}}
{
/*
<Box onClick={() => { navigate(`/`) }}
sx={{
display: { xs: 'flex', md: 'none' },
height: '70px',
...
...
@@ -164,7 +165,8 @@ const ResponsiveAppBar = () => {
backgroundPosition: 'center',
cursor: 'pointer',
}}
/
>
}} /> */
}
<
Box
sx
=
{{
flexGrow
:
1
,
display
:
{
xs
:
'
none
'
,
md
:
'
flex
'
}
}}
>
{
pages
.
map
((
page
)
=>
(
<
Button
...
...
bussifinder/src/components/Results.js
View file @
df860b1c
...
...
@@ -41,6 +41,7 @@ import Grow from '@mui/material/Grow';
import
{
useSelector
,
useDispatch
}
from
'
react-redux
'
;
import
{
compareBusiness
}
from
'
../features/business
'
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
jsPDF
}
from
"
jspdf
"
;
ChartJS
.
register
(
CategoryScale
,
...
...
@@ -282,6 +283,55 @@ const Results = () => {
}
const
downloadReport
=
()
=>
{
const
doc
=
new
jsPDF
();
if
(
businessDetails
.
value
[
0
].
type
==
'
hotel
'
)
{
doc
.
setFontSize
(
22
);
doc
.
setFont
(
"
courier
"
,
"
bolditalic
"
);
doc
.
text
(
"
Hotel Success Precentage Prediction
"
,
105
,
8
,
null
,
null
,
"
center
"
);
doc
.
setFont
(
"
helvetica
"
,
"
normal
"
);
doc
.
setFontSize
(
16
);
doc
.
text
(
`Type :
${
businessDetails
.
value
[
0
].
type
}
`
,
20
,
30
);
doc
.
text
(
`Latitude :
${
businessDetails
.
value
[
0
].
latitude
}
`
,
20
,
40
);
doc
.
text
(
`Longitude :
${
businessDetails
.
value
[
0
].
longitude
}
`
,
20
,
50
);
doc
.
text
(
`AttractionPlaces Count :
${
businessDetails
.
value
[
0
].
locationFeatures
.
attractionPlacesCount
}
`
,
20
,
60
);
doc
.
text
(
`Transportation Modes Count :
${
businessDetails
.
value
[
0
].
locationFeatures
.
transportationModesCount
}
`
,
20
,
70
);
doc
.
text
(
`Nearby Hotel Review Count :
${
businessDetails
.
value
[
0
].
locationFeatures
.
nearByHotelReviewCount
}
`
,
20
,
80
);
doc
.
setFont
(
"
helvetica
"
,
"
bold
"
);
doc
.
text
(
`Final Prediction :
${
businessDetails
.
value
[
0
].
ml_result
}
%`
,
20
,
90
);
doc
.
save
(
"
Report.pdf
"
);
}
else
if
(
businessDetails
.
value
[
0
].
type
==
'
restaurant
'
){
doc
.
setFontSize
(
22
);
doc
.
setFont
(
"
courier
"
,
"
bolditalic
"
);
doc
.
text
(
"
Restaurant Success Percentage Prediction
"
,
105
,
8
,
null
,
null
,
"
center
"
);
doc
.
setFont
(
"
helvetica
"
,
"
normal
"
);
doc
.
setFontSize
(
16
);
doc
.
text
(
`Type :
${
businessDetails
.
value
[
0
].
type
}
`
,
20
,
30
);
doc
.
setFont
(
"
helvetica
"
,
"
normal
"
);
doc
.
setFontSize
(
16
);
doc
.
text
(
`Type :
${
businessDetails
.
value
[
0
].
type
}
`
,
20
,
30
);
doc
.
text
(
`Latitude :
${
businessDetails
.
value
[
0
].
latitude
}
`
,
20
,
40
);
doc
.
text
(
`Longitude :
${
businessDetails
.
value
[
0
].
longitude
}
`
,
20
,
50
);
doc
.
text
(
`Distance to city :
${
businessDetails
.
value
[
0
].
locationFeatures
.
distanceToCity
}
km`
,
20
,
60
);
doc
.
text
(
`Education Related Places Count :
${
businessDetails
.
value
[
0
].
locationFeatures
.
educationRelatedPlacesCount
}
`
,
20
,
70
);
doc
.
text
(
`Office Related Places Count :
${
businessDetails
.
value
[
0
].
locationFeatures
.
workPlacesCount
}
`
,
20
,
80
);
doc
.
text
(
`Shopping Malls Count :
${
businessDetails
.
value
[
0
].
locationFeatures
.
shoppingMallsCount
}
`
,
20
,
90
);
doc
.
text
(
`Competitors Count :
${
businessDetails
.
value
[
0
].
locationFeatures
.
competitors
}
`
,
20
,
100
);
doc
.
setFont
(
"
helvetica
"
,
"
bold
"
);
doc
.
text
(
`Final Prediction :
${
businessDetails
.
value
[
0
].
ml_result
}
%`
,
20
,
110
);
doc
.
save
(
"
Report.pdf
"
);
}
}
return
(
<
Box
sx
=
{{
width
:
"
100%
"
,
...
...
@@ -323,7 +373,7 @@ const Results = () => {
boxSizing
:
"
border-box
"
,
}}
>
<
div
className
=
{
classes
.
subTitleTxt
}
>
The
predicted
success
percentage
for
a
{
businessDetails
&&
businessDetails
.
value
[
0
].
type
==
'
hotel
'
?
`Hotel`
:
businessDetails
.
value
[
0
].
type
==
'
restaurant
'
?
`Restaurant`
:
businessDetails
.
value
[
0
].
type
==
'
pharmacy
'
?
`Pharmacy`
:
`Grocery`
}
<
/div
>
<
div
className
=
{
classes
.
bodyTxt
}
>
All
the
resuts
are
given
based
on
the
location
you
have
given
<
/div
>
<
div
className
=
{
classes
.
bodyTxt
}
>
All
the
resu
l
ts
are
given
based
on
the
location
you
have
given
<
/div
>
{
isLoaded
&&
<
GoogleMap
// onClick={e => setClickedLatLng(e.latLng.toJSON())}
...
...
@@ -501,7 +551,7 @@ const Results = () => {
boxSizing
:
"
border-box
"
,
}}
>
<
CompareBtn
onClick
=
{()
=>
compareLocation
()}
>
Compare
With
Another
Location
<
ArrowForwardIosIcon
/><
/CompareBtn
>
<
DownloadBtn
>
Download
Report
<
SystemUpdateAltRoundedIcon
/><
/DownloadBtn
>
<
DownloadBtn
onClick
=
{()
=>
downloadReport
()}
>
Download
Report
<
SystemUpdateAltRoundedIcon
/><
/DownloadBtn
>
<
/Box
>
<
/Box
>
...
...
bussifinder/src/features/business.js
View file @
df860b1c
...
...
@@ -3,7 +3,34 @@ import { createSlice } from '@reduxjs/toolkit'
export
const
businessSlice
=
createSlice
({
name
:
"
business
"
,
initialState
:
{
value
:
[
value
:
[{
"
type
"
:
"
hotel
"
,
"
latitude
"
:
6.704581206797783
,
"
longitude
"
:
81.27638881048588
,
"
serviceDetails
"
:
{
"
pool
"
:
true
,
"
beach
"
:
true
,
"
wifi
"
:
true
,
"
ac
"
:
false
,
"
parking
"
:
false
},
"
locationFeatures
"
:
{
"
attractionPlacesCount
"
:
1
,
"
transportationModesCount
"
:
0
,
"
nearByHotelReviewCount
"
:
0
,
"
competitors
"
:
0
},
"
businessCount
"
:
{
"
atmCount
"
:
0
,
"
restaurantCount
"
:
0
,
"
hospitalCount
"
:
0
,
"
pharmacyCount
"
:
0
,
"
gasStationCount
"
:
0
,
"
movieTheaterCount
"
:
0
,
"
hotelCount
"
:
0
},
"
ml_result
"
:
48.6782
}
]
},
reducers
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment