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
9d1c9166
Commit
9d1c9166
authored
Oct 11, 2022
by
Sachintha Nipun M.M. it19046594
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT19023410' into 'master'
It19023410 See merge request
!25
parents
f12776b0
114ab18c
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
873 additions
and
19 deletions
+873
-19
Backend/src/controller/pharmacy.controller.js
Backend/src/controller/pharmacy.controller.js
+40
-11
ML_Backend/app.py
ML_Backend/app.py
+23
-7
ML_Backend/model/pharmacyPred.pickle
ML_Backend/model/pharmacyPred.pickle
+0
-0
ML_Backend/model/pharmacyPrediction.pickle
ML_Backend/model/pharmacyPrediction.pickle
+0
-0
bussifinder/src/App.js
bussifinder/src/App.js
+2
-0
bussifinder/src/components/InputPharmacyDetails.js
bussifinder/src/components/InputPharmacyDetails.js
+26
-0
bussifinder/src/components/PharmacyInputs/InputDetails.js
bussifinder/src/components/PharmacyInputs/InputDetails.js
+343
-0
bussifinder/src/components/PharmacyInputs/LocationDetails.js
bussifinder/src/components/PharmacyInputs/LocationDetails.js
+111
-0
bussifinder/src/components/PharmacyInputs/Review.js
bussifinder/src/components/PharmacyInputs/Review.js
+115
-0
bussifinder/src/components/PharmacyInputs/ServiceDetailsForm.js
...inder/src/components/PharmacyInputs/ServiceDetailsForm.js
+206
-0
bussifinder/src/components/PropertyType.js
bussifinder/src/components/PropertyType.js
+7
-1
No files found.
Backend/src/controller/pharmacy.controller.js
View file @
9d1c9166
...
...
@@ -9,18 +9,46 @@ const getMedicalPlaces = async (req, res) => {
const
latitude
=
req
.
body
.
latitude
;
const
longitude
=
req
.
body
.
longitude
;
var
config
=
{
var
config
Hospitals
=
{
method
:
'
get
'
,
url
:
`https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=hospital&location=
${
latitude
}
,
${
longitude
}
&radius=500&type=hospital&keyword=&key=
${
process
.
env
.
API_KEY_SECRET
}
`
,
url
:
`https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=hospital&location=
${
latitude
}
,
${
longitude
}
&radius=500&type=hospital
s
&keyword=&key=
${
process
.
env
.
API_KEY_SECRET
}
`
,
headers
:
{
}
};
axios
(
config
)
axios
(
config
Hospitals
)
.
then
(
function
(
response
)
{
res
.
status
(
200
).
send
({
"
MediPlacesCount
"
:
Object
.
keys
(
response
.
data
.
results
).
length
});
//res.status(200).send(response.data.results);
//res.status(200).send(Object.keys(response.data.results).length);
console
.
log
(
Object
.
keys
(
response
.
data
.
results
).
length
,
"
Medical related places
"
)
const
hospitalCount
=
response
.
data
.
results
.
length
;
console
.
log
(
hospitalCount
,
"
hospitals
"
)
var
configLab
=
{
method
:
'
get
'
,
url
:
`https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=medical laboratory&location=
${
latitude
}
,
${
longitude
}
&radius=500&type=medical laboratory&keyword=&key=
${
process
.
env
.
API_KEY_SECRET
}
`
,
headers
:
{
}
};
axios
(
configLab
)
.
then
(
function
(
response
)
{
const
labCount
=
response
.
data
.
results
.
length
;
console
.
log
(
labCount
,
"
labs
"
)
var
configClinic
=
{
method
:
'
get
'
,
url
:
`https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=medical clinic&location=
${
latitude
}
,
${
longitude
}
&radius=500&type=medical clinic&keyword=&key=
${
process
.
env
.
API_KEY_SECRET
}
`
,
headers
:
{
}
};
axios
(
configClinic
)
.
then
(
function
(
response
)
{
const
clinicCount
=
response
.
data
.
results
.
length
;
console
.
log
(
clinicCount
,
"
clinics
"
)
const
medicalPlacesCount
=
hospitalCount
+
labCount
+
clinicCount
;
res
.
status
(
200
).
send
({
"
MediPlacesCount
"
:
medicalPlacesCount
});
})
.
catch
(
function
(
error
)
{
res
.
send
(
error
);
});
})
.
catch
(
function
(
error
)
{
res
.
send
(
error
);
});
})
.
catch
(
function
(
error
)
{
res
.
send
(
error
);
...
...
@@ -31,21 +59,22 @@ const getMedicalPlaces = async (req, res) => {
//get nearest bus station and get the distance between user given location and the bus station
const
getDistanceToBusStation
=
async
(
req
,
res
)
=>
{
if
(
req
.
body
)
{
console
.
log
(
"
distance
"
,
req
.
body
)
if
(
!
req
.
body
.
latitude
)
return
res
.
status
(
500
).
send
(
"
latitude is missing
"
);
if
(
!
req
.
body
.
longitude
)
return
res
.
status
(
500
).
send
(
"
longitude is missing
"
);
const
latitude
=
req
.
body
.
latitude
;
const
longitude
=
req
.
body
.
longitude
;
console
.
log
(
"
eeeee
"
,
latitude
,
longitude
)
var
config
=
{
method
:
'
get
'
,
url
:
`https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=bus station&location=
${
latitude
}
,
${
longitude
}
&radius=
2
00&type=bus station&keyword=&key=
${
process
.
env
.
API_KEY_SECRET
}
`
,
url
:
`https://maps.googleapis.com/maps/api/place/nearbysearch/json?keyword=bus station&location=
${
latitude
}
,
${
longitude
}
&radius=
100
00&type=bus station&keyword=&key=
${
process
.
env
.
API_KEY_SECRET
}
`
,
headers
:
{
}
};
axios
(
config
)
.
then
(
function
(
response
)
{
console
.
log
(
"
23232xcc
"
,
response
.
data
.
results
)
let
newlongitude
=
response
.
data
.
results
[
0
].
geometry
.
location
.
lat
;
let
newlatitude
=
response
.
data
.
results
[
0
].
geometry
.
location
.
lng
;
console
.
log
(
"
Nearest Bus station latitude:
"
,
newlatitude
);
...
...
ML_Backend/app.py
View file @
9d1c9166
...
...
@@ -206,7 +206,7 @@ def restaurantLB():
#Pharmacy API
def
predictionPharmacy
(
lst
):
filename
=
'model/pharmacyPred.pickle'
filename
=
'model/pharmacyPred
iction
.pickle'
with
open
(
filename
,
'rb'
)
as
file
:
model
=
pickle
.
load
(
file
)
pred_value
=
model
.
predict
([
lst
])
.
tolist
()
...
...
@@ -217,13 +217,29 @@ def predictionPharmacy(lst):
def
pharmacy
():
pred
=
0
if
request
.
method
==
'POST'
:
Medi_Places_Count
=
request
.
json
[
'Medi_Places_Count'
]
Distance_toStation
=
request
.
json
[
'Distance_toStation'
]
if
(
isinstance
(
Medi_Places_Count
,
int
)
and
isinstance
(
Distance_toStation
,
int
)
):
# Medi_Places_Count = request.json['Medi_Places_Count']
# Distance_toStation = request.json['Distance_toStation']
medicalPlaces
=
request
.
json
[
'medicalPlaces'
]
distanceToBus
=
request
.
json
[
'distanceToBus'
]
OpenHours
=
request
.
json
[
'OpenHours'
]
deliver
=
request
.
json
[
'deliver'
]
WhlChairEntrance
=
request
.
json
[
'WhlChairEntrance'
]
WhlChairPark
=
request
.
json
[
'WhlChairPark'
]
cashPay
=
request
.
json
[
'cashPay'
]
cardPay
=
request
.
json
[
'cardPay'
]
if
(
isinstance
(
medicalPlaces
,
int
)
and
isinstance
(
distanceToBus
,
int
)
):
feature_list
=
[]
feature_list
.
append
(
int
(
Medi_Places_Count
))
feature_list
.
append
(
int
(
Distance_toStation
))
feature_list
.
append
(
int
(
medicalPlaces
))
feature_list
.
append
(
int
(
distanceToBus
))
feature_list
.
append
(
int
(
OpenHours
))
feature_list
.
append
(
int
(
deliver
))
feature_list
.
append
(
int
(
WhlChairEntrance
))
feature_list
.
append
(
int
(
WhlChairPark
))
feature_list
.
append
(
int
(
cashPay
))
feature_list
.
append
(
int
(
cardPay
))
pred
=
predictionPharmacy
(
feature_list
)
print
(
pred
)
...
...
@@ -231,7 +247,7 @@ def pharmacy():
return
jsonify
({
'data'
:
pred
[
0
]})
else
:
if
(
not
isinstance
(
Medi_Places_Count
,
int
)):
if
(
not
isinstance
(
medicalPlaces
,
int
)):
return
jsonify
({
'Error'
:
"Medical Places Count Missing !"
})
else
:
return
jsonify
({
'Error'
:
"Distance to Busstation Missing!"
})
...
...
ML_Backend/model/pharmacyPred.pickle
deleted
100644 → 0
View file @
f12776b0
File deleted
ML_Backend/model/pharmacyPrediction.pickle
0 → 100644
View file @
9d1c9166
File added
bussifinder/src/App.js
View file @
9d1c9166
...
...
@@ -17,6 +17,7 @@ import businessReducer from "./features/business";
import
headerReducer
from
"
./features/header
"
;
import
userReducer
from
"
./features/user
"
;
import
InputHotelDetails
from
'
./components/InputHotelDetails
'
;
import
InputPharmacyDetails
from
'
./components/InputPharmacyDetails
'
;
import
Results
from
'
./components/Results
'
;
import
Pricing
from
'
./components/Pricing
'
;
import
SignUp
from
'
./components/Auth/SignUp
'
;
...
...
@@ -50,6 +51,7 @@ function App() {
<
Route
path
=
"
/createHotel
"
element
=
{
<
CreateHotelDataset
/>
}
/
>
<
Route
path
=
"
/result
"
element
=
{
<
Results
/>
}
/
>
<
Route
path
=
"
/inputHotel
"
element
=
{
<
InputHotelDetails
/>
}
/
>
<
Route
path
=
"
/inputPharmacy
"
element
=
{
<
InputPharmacyDetails
/>
}
/
>
<
Route
path
=
"
/pricing
"
element
=
{
<
Pricing
/>
}
/
>
<
Route
path
=
"
/signUp
"
element
=
{
<
SignUp
/>
}
/
>
<
Route
path
=
"
/signIn
"
element
=
{
<
SignIn
/>
}
/
>
...
...
bussifinder/src/components/InputPharmacyDetails.js
0 → 100644
View file @
9d1c9166
import
React
from
'
react
'
import
InputDetailsPharmacy
from
'
./PharmacyInputs/InputDetails
'
import
{
Box
}
from
'
@mui/system
'
const
InputPharmacyDetails
=
()
=>
{
return
(
<
Box
sx
=
{{
width
:
"
100%
"
,
height
:
"
100%
"
,
backgroundColor
:
'
#E4E6F1
'
,
boxSizing
:
"
border-box
"
,
backgroundImage
:
`url(
${
require
(
'
../images/about-shape-2.svg
'
).
default
}
)`
,
padding
:
"
0px
"
,
backgroundRepeat
:
'
repeat
'
,
backgroundSize
:
'
contain
'
,
}}
>
<
InputDetailsPharmacy
/>
<
/Box
>
)
}
export
default
InputPharmacyDetails
\ No newline at end of file
bussifinder/src/components/PharmacyInputs/InputDetails.js
0 → 100644
View file @
9d1c9166
This diff is collapsed.
Click to expand it.
bussifinder/src/components/PharmacyInputs/LocationDetails.js
0 → 100644
View file @
9d1c9166
import
*
as
React
from
'
react
'
;
import
Grid
from
'
@mui/material/Grid
'
;
import
Typography
from
'
@mui/material/Typography
'
;
import
TextField
from
'
@mui/material/TextField
'
;
import
FormControlLabel
from
'
@mui/material/FormControlLabel
'
;
import
Checkbox
from
'
@mui/material/Checkbox
'
;
import
Map
from
'
../Map
'
export
default
function
LocationDetails
()
{
return
(
<
React
.
Fragment
>
<
Typography
variant
=
"
h6
"
gutterBottom
>
Location
Selection
<
/Typography
>
<
div
>
<
Map
/>
{
/* <Grid item xs={12} sm={6}>
<TextField
required
id="firstName"
name="firstName"
label="First name"
fullWidth
autoComplete="given-name"
variant="standard"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
required
id="lastName"
name="lastName"
label="Last name"
fullWidth
autoComplete="family-name"
variant="standard"
/>
</Grid>
<Grid item xs={12}>
<TextField
required
id="address1"
name="address1"
label="Address line 1"
fullWidth
autoComplete="shipping address-line1"
variant="standard"
/>
</Grid>
<Grid item xs={12}>
<TextField
id="address2"
name="address2"
label="Address line 2"
fullWidth
autoComplete="shipping address-line2"
variant="standard"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
required
id="city"
name="city"
label="City"
fullWidth
autoComplete="shipping address-level2"
variant="standard"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
id="state"
name="state"
label="State/Province/Region"
fullWidth
variant="standard"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
required
id="zip"
name="zip"
label="Zip / Postal code"
fullWidth
autoComplete="shipping postal-code"
variant="standard"
/>
</Grid>
<Grid item xs={12} sm={6}>
<TextField
required
id="country"
name="country"
label="Country"
fullWidth
autoComplete="shipping country"
variant="standard"
/>
</Grid>
<Grid item xs={12}>
<FormControlLabel
control={<Checkbox color="secondary" name="saveAddress" value="yes" />}
label="Use this address for payment details"
/>
</Grid> */
}
<
/div
>
<
/React.Fragment
>
);
}
\ No newline at end of file
bussifinder/src/components/PharmacyInputs/Review.js
0 → 100644
View file @
9d1c9166
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
Typography
from
'
@mui/material/Typography
'
;
import
List
from
'
@mui/material/List
'
;
import
ListItem
from
'
@mui/material/ListItem
'
;
import
ListItemText
from
'
@mui/material/ListItemText
'
;
import
Grid
from
'
@mui/material/Grid
'
;
import
{
useLoadScript
,
GoogleMap
,
MarkerF
,
InfoWindow
}
from
"
@react-google-maps/api
"
;
import
{
useSelector
,
useDispatch
}
from
'
react-redux
'
;
import
{
addBusiness
}
from
'
../../features/business
'
;
import
{
FaRegCreditCard
}
from
'
react-icons/fa
'
;
import
{
BsFillClockFill
}
from
'
react-icons/bs
'
;
import
{
FaWheelchair
}
from
'
react-icons/fa
'
;
import
{
GrWheelchairActive
}
from
'
react-icons/gr
'
;
import
{
BsCashCoin
}
from
'
react-icons/bs
'
;
import
{
TbTruckDelivery
}
from
'
react-icons/tb
'
export
default
function
Review
()
{
const
businessDetails
=
useSelector
((
state
)
=>
state
.
business
)
const
[
center
,
setCenter
]
=
useState
({
lat
:
businessDetails
&&
businessDetails
.
value
[
0
].
latitude
?
businessDetails
.
value
[
0
].
latitude
:
''
,
lng
:
businessDetails
&&
businessDetails
.
value
[
0
].
longitude
?
businessDetails
.
value
[
0
].
longitude
:
''
,
});
const
[
position
,
setPosition
]
=
useState
({
lat
:
businessDetails
&&
businessDetails
.
value
[
0
].
latitude
?
businessDetails
.
value
[
0
].
latitude
:
''
,
lng
:
businessDetails
&&
businessDetails
.
value
[
0
].
longitude
?
businessDetails
.
value
[
0
].
longitude
:
''
,
});
const
[
zoom
,
setZoom
]
=
useState
(
9
);
const
[
clickedLatLng
,
setClickedLatLng
]
=
useState
(
null
);
const
dispatch
=
useDispatch
();
useEffect
(()
=>
{
if
(
businessDetails
&&
businessDetails
.
value
.
length
>
0
)
{
console
.
log
(
"
businessDetails
"
,
businessDetails
.
value
)
}
},
[
businessDetails
]);
const
{
isLoaded
}
=
useLoadScript
({
googleMapsApiKey
:
"
AIzaSyDzvpMhG1TmXhpoCfPCq-G4snf-R0vSWF4
"
});
return
(
<
React
.
Fragment
>
<
Typography
variant
=
"
h6
"
gutterBottom
>
Summary
<
/Typography
>
{
businessDetails
&&
businessDetails
.
value
[
0
].
type
==
'
pharmacy
'
?
<
List
disablePadding
sx
=
{{
paddingInline
:
2
}}
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
BsFillClockFill
style
=
{{
color
:
'
#ff802f
'
,
fontSize
:
'
18px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="Open 24 Hours" /
>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
open
?
`Available`
:
`Not Available`
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
TbTruckDelivery
style
=
{{
color
:
'
#800040
'
,
fontSize
:
'
20px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="Delivery Service" /
>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
deliver
?
`Available`
:
`Not Available`
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
FaWheelchair
style
=
{{
color
:
'
#344ab1
'
,
fontSize
:
'
20px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="Wheel Chair Accesible Entrance" /
>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
whlentrence
?
`Available`
:
`Not Available`
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
GrWheelchairActive
style
=
{{
color
:
'
#9370db
'
,
fontSize
:
'
20px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="Wheel Chair Accesible Car Park" /
>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
whlpark
?
`Available`
:
`Not Available`
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
BsCashCoin
style
=
{{
color
:
'
#34b13f
'
,
fontSize
:
'
20px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="Cash Payment" /
>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
cash
?
`Available`
:
`Not Available`
}
<
/Typography
>
<
/ListItem
>
<
ListItem
sx
=
{{
py
:
1
,
px
:
0
}}
>
<
FaRegCreditCard
style
=
{{
color
:
'
#006400
'
,
fontSize
:
'
20px
'
,
marginRight
:
'
8px
'
}}
/> <ListItemText primary="Card Payment" /
>
<
Typography
variant
=
"
subtitle1
"
sx
=
{{
fontWeight
:
500
}}
>
{
businessDetails
.
value
[
0
].
serviceDetails
.
card
?
`Available`
:
`Not Available`
}
<
/Typography
>
<
/ListItem
>
<
/List>
:
<
div
><
/div>
}
<
Grid
container
spacing
=
{
2
}
>
<
Grid
item
xs
=
{
12
}
>
<
Typography
variant
=
"
h6
"
gutterBottom
sx
=
{{
mt
:
2
,
display
:
'
flex
'
,
alignItems
:
'
center
'
,
gap
:
'
5px
'
}}
>
Location
{
position
&&
(
<
div
style
=
{{
fontSize
:
"
12px
"
,
marginTop
:
'
5px
'
,
color
:
'
#c4c2c0
'
,
fontStyle
:
'
italic
'
}}
>
({
position
.
lat
},
{
position
.
lng
})
<
/div
>
)}
<
/Typography
>
<
div
>
{
isLoaded
?
<
div
>
<
GoogleMap
center
=
{
center
}
zoom
=
{
zoom
}
mapContainerStyle
=
{{
height
:
"
35vh
"
,
}}
>
{
position
&&
<
MarkerF
position
=
{
position
}
/>
}
<
/GoogleMap
>
<
/div> : <div>Loading...</
div
>
}
<
/div
>
<
/Grid
>
<
/Grid
>
<
/React.Fragment
>
);
}
\ No newline at end of file
bussifinder/src/components/PharmacyInputs/ServiceDetailsForm.js
0 → 100644
View file @
9d1c9166
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
Typography
from
'
@mui/material/Typography
'
;
import
Grid
from
'
@mui/material/Grid
'
;
import
TextField
from
'
@mui/material/TextField
'
;
import
Radio
from
'
@mui/material/Radio
'
;
import
RadioGroup
from
'
@mui/material/RadioGroup
'
;
import
FormControlLabel
from
'
@mui/material/FormControlLabel
'
;
import
FormControl
from
'
@mui/material/FormControl
'
;
import
FormLabel
from
'
@mui/material/FormLabel
'
;
import
Checkbox
from
'
@mui/material/Checkbox
'
;
import
{
alpha
,
styled
}
from
'
@mui/material/styles
'
;
import
{
pink
}
from
'
@mui/material/colors
'
;
import
Switch
from
'
@mui/material/Switch
'
;
import
{
useSelector
,
useDispatch
}
from
'
react-redux
'
;
import
{
addBusiness
}
from
'
./../../features/business
'
;
import
{
FaRegCreditCard
}
from
'
react-icons/fa
'
;
import
{
BsFillClockFill
}
from
'
react-icons/bs
'
;
import
{
FaWheelchair
}
from
'
react-icons/fa
'
;
import
{
GrWheelchairActive
}
from
'
react-icons/gr
'
;
import
{
BsCashCoin
}
from
'
react-icons/bs
'
;
import
{
TbTruckDelivery
}
from
'
react-icons/tb
'
const
IOSSwitch
=
styled
((
props
)
=>
(
<
Switch
focusVisibleClassName
=
"
.Mui-focusVisible
"
disableRipple
{...
props
}
/
>
))(({
theme
})
=>
({
width
:
50
,
height
:
26
,
padding
:
0
,
'
& .MuiSwitch-switchBase
'
:
{
padding
:
0
,
margin
:
2
,
transitionDuration
:
'
300ms
'
,
'
&.Mui-checked
'
:
{
transform
:
'
translateX(16px)
'
,
color
:
'
#fff
'
,
'
& + .MuiSwitch-track
'
:
{
backgroundColor
:
theme
.
palette
.
mode
===
'
dark
'
?
'
#2ECA45
'
:
'
#65C466
'
,
opacity
:
1
,
border
:
0
,
},
'
&.Mui-disabled + .MuiSwitch-track
'
:
{
opacity
:
0.5
,
},
},
'
&.Mui-focusVisible .MuiSwitch-thumb
'
:
{
color
:
'
#33cf4d
'
,
border
:
'
6px solid #fff
'
,
},
'
&.Mui-disabled .MuiSwitch-thumb
'
:
{
color
:
theme
.
palette
.
mode
===
'
light
'
?
theme
.
palette
.
grey
[
100
]
:
theme
.
palette
.
grey
[
600
],
},
'
&.Mui-disabled + .MuiSwitch-track
'
:
{
opacity
:
theme
.
palette
.
mode
===
'
light
'
?
0.7
:
0.3
,
},
},
'
& .MuiSwitch-thumb
'
:
{
boxSizing
:
'
border-box
'
,
width
:
22
,
height
:
22
,
},
'
& .MuiSwitch-track
'
:
{
borderRadius
:
26
/
2
,
backgroundColor
:
theme
.
palette
.
mode
===
'
light
'
?
'
#E9E9EA
'
:
'
#39393D
'
,
opacity
:
1
,
transition
:
theme
.
transitions
.
create
([
'
background-color
'
],
{
duration
:
500
,
}),
},
}));
const
label
=
{
inputProps
:
{
'
aria-label
'
:
'
Color switch demo
'
}
};
export
default
function
ServiceDetailsForm
()
{
const
businessDetails
=
useSelector
((
state
)
=>
state
.
business
)
const
[
pharmacyServiceDetails
,
setPharmcyServiceDetails
]
=
useState
({
open
:
businessDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
.
open
?
businessDetails
.
value
[
0
].
serviceDetails
.
open
:
false
,
whlentrence
:
businessDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
.
whlentrence
?
businessDetails
.
value
[
0
].
serviceDetails
.
whlentrence
:
false
,
whlpark
:
businessDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
.
whlpark
?
businessDetails
.
value
[
0
].
serviceDetails
.
whlpark
:
false
,
cash
:
businessDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
.
cash
?
businessDetails
.
value
[
0
].
serviceDetails
.
cash
:
false
,
card
:
businessDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
.
card
?
businessDetails
.
value
[
0
].
serviceDetails
.
card
:
false
,
deliver
:
businessDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
&&
businessDetails
.
value
[
0
].
serviceDetails
.
deliver
?
businessDetails
.
value
[
0
].
serviceDetails
.
deliver
:
false
,
})
const
dispatch
=
useDispatch
();
useEffect
(()
=>
{
if
(
businessDetails
&&
businessDetails
.
value
.
length
>
0
)
{
console
.
log
(
"
businessDetails
"
,
businessDetails
.
value
)
setPharmcyServiceDetails
(
businessDetails
.
value
[
0
].
serviceDetails
);
}
},
[
businessDetails
]);
useEffect
(()
=>
{
console
.
log
(
"
serviceDetails
"
,
pharmacyServiceDetails
)
dispatch
(
addBusiness
({
...
businessDetails
.
value
[
0
],
serviceDetails
:
pharmacyServiceDetails
}))
},
[
pharmacyServiceDetails
]);
const
handlePharmacyChanges
=
e
=>
{
const
{
name
,
checked
}
=
e
.
target
;
setPharmcyServiceDetails
({
...
pharmacyServiceDetails
,
[
name
]:
checked
});
}
return
(
businessDetails
&&
businessDetails
.
value
[
0
].
type
==
'
pharmacy
'
?
<
React
.
Fragment
>
<
Typography
variant
=
"
h6
"
gutterBottom
>
Availability
of
the
services
<
/Typography
>
<
Grid
container
spacing
=
{
3
}
>
<
Grid
item
xs
=
{
12
}
md
=
{
6
}
>
<
div
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
,
justifyContent
:
'
flex-start
'
}}
>
<
BsFillClockFill
style
=
{{
color
:
'
#ff802f
'
,
fontSize
:
'
28px
'
}}
/
>
<
FormControlLabel
control
=
{
<
IOSSwitch
sx
=
{{
m
:
1
,}}
name
=
"
open
"
onChange
=
{
handlePharmacyChanges
}
checked
=
{
pharmacyServiceDetails
.
open
}
/
>
}
label
=
"
Open 24 Hours
"
labelPlacement
=
"
start
"
/>
<
/div
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
md
=
{
6
}
>
<
div
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
,
justifyContent
:
'
flex-start
'
}}
>
<
TbTruckDelivery
style
=
{{
color
:
'
#800040
'
,
fontSize
:
'
40px
'
}}
/
>
<
FormControlLabel
control
=
{
<
IOSSwitch
sx
=
{{
m
:
1
}}
name
=
"
deliver
"
onChange
=
{
handlePharmacyChanges
}
checked
=
{
pharmacyServiceDetails
.
deliver
}
/>
}
label
=
"
Delivery Service
"
labelPlacement
=
"
start
"
/>
<
/div
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
md
=
{
6
}
>
<
div
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
,
justifyContent
:
'
flex-start
'
}}
>
<
FaWheelchair
style
=
{{
color
:
'
#344ab1
'
,
fontSize
:
'
45px
'
}}
/
>
<
FormControlLabel
control
=
{
<
IOSSwitch
sx
=
{{
m
:
1
}}
name
=
"
whlentrence
"
onChange
=
{
handlePharmacyChanges
}
checked
=
{
pharmacyServiceDetails
.
whlentrence
}
/>
}
label
=
"
Wheel Chair Accesible Entrance
"
labelPlacement
=
"
start
"
/>
<
/div
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
md
=
{
6
}
>
<
div
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
,
justifyContent
:
'
flex-start
'
}}
>
<
GrWheelchairActive
style
=
{{
color
:
'
#9370db
'
,
fontSize
:
'
45px
'
}}
/
>
<
FormControlLabel
control
=
{
<
IOSSwitch
sx
=
{{
m
:
1
}}
name
=
"
whlpark
"
onChange
=
{
handlePharmacyChanges
}
checked
=
{
pharmacyServiceDetails
.
whlpark
}
/>
}
label
=
"
Wheel Chair Accesible Car Park
"
labelPlacement
=
"
start
"
/>
<
/div
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
md
=
{
6
}
>
<
div
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
,
justifyContent
:
'
flex-start
'
}}
>
<
BsCashCoin
style
=
{{
color
:
'
#34b13f
'
,
fontSize
:
'
30px
'
}}
/
>
<
FormControlLabel
control
=
{
<
IOSSwitch
sx
=
{{
m
:
1
}}
name
=
"
cash
"
onChange
=
{
handlePharmacyChanges
}
checked
=
{
pharmacyServiceDetails
.
cash
}
/>
}
label
=
"
Cash Payment
"
labelPlacement
=
"
start
"
/>
<
/div
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
md
=
{
6
}
>
<
div
style
=
{{
display
:
'
flex
'
,
alignItems
:
'
center
'
,
justifyContent
:
'
flex-start
'
}}
>
<
FaRegCreditCard
style
=
{{
color
:
'
#006400
'
,
fontSize
:
'
30px
'
}}
/
>
<
FormControlLabel
control
=
{
<
IOSSwitch
sx
=
{{
m
:
1
}}
name
=
"
card
"
onChange
=
{
handlePharmacyChanges
}
checked
=
{
pharmacyServiceDetails
.
card
}
/>
}
label
=
"
Card Payment
"
labelPlacement
=
"
start
"
/>
<
/div
>
<
/Grid
>
<
/Grid
>
<
/React.Fragment
>
:
<
div
><
/div
>
);
}
\ No newline at end of file
bussifinder/src/components/PropertyType.js
View file @
9d1c9166
...
...
@@ -126,6 +126,12 @@ const PropertyType = () => {
navigate
(
`/inputHotel`
)
}
//Navigate to pharmacy input forms in home
const
pharmacyInputFormNavigation
=
()
=>
{
dispatch
(
addBusiness
({
'
type
'
:
'
pharmacy
'
}))
navigate
(
`/inputPharmacy`
)
}
//Grocery navigation
const
groceryNavigate
=
()
=>
{
dispatch
(
addBusiness
({
'
type
'
:
'
Grocery
'
}))
...
...
@@ -239,7 +245,7 @@ const PropertyType = () => {
<
/Box
>
<
/Zoom
>
<
Zoom
in
=
{
checked
}
style
=
{{
transitionDelay
:
checked
?
'
300ms
'
:
'
0ms
'
}}
>
<
Box
className
=
{
classes
.
typeBox
}
onClick
=
{()
=>
navigateToRInputForm
()}
>
<
Box
className
=
{
classes
.
typeBox
}
onClick
=
{()
=>
pharmacyInputFormNavigation
()}
>
<
div
className
=
{
classes
.
typeClip
}
>
<
div
className
=
{
classes
.
backClip
}
><
/div
>
<
div
className
=
{
classes
.
frontClip
}
><
MdOutlineMedicalServices
className
=
{
classes
.
iconClip
}
/></
div
>
...
...
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