Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-049
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
2021-049
2021-049
Commits
90d14588
Commit
90d14588
authored
Oct 13, 2021
by
Hasitha Samarasekara
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT18063288' into 'master'
It18063288 See merge request
!12
parents
13565272
bed0e292
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
348 additions
and
174 deletions
+348
-174
BackEnd/WebBackEnd/routes/createClass.route.js
BackEnd/WebBackEnd/routes/createClass.route.js
+1
-1
BackEnd/WebBackEnd/routes/institute.route.js
BackEnd/WebBackEnd/routes/institute.route.js
+30
-30
BackEnd/WebBackEnd/routes/tutor.route.js
BackEnd/WebBackEnd/routes/tutor.route.js
+30
-30
BackEnd/WebBackEnd/routes/tutorRatings.route.js
BackEnd/WebBackEnd/routes/tutorRatings.route.js
+10
-0
WebFrontEnd/smartcoach-frontend/src/Components/Admin/StudentRequestForClass.js
...h-frontend/src/Components/Admin/StudentRequestForClass.js
+26
-5
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
...tcoach-frontend/src/Components/Admin/add_class_details.js
+23
-10
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
+7
-1
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorCard.js
.../smartcoach-frontend/src/Components/HomePage/TutorCard.js
+3
-2
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorProfileView.js
...oach-frontend/src/Components/HomePage/TutorProfileView.js
+215
-92
WebFrontEnd/smartcoach-frontend/src/Components/SignUp.js
WebFrontEnd/smartcoach-frontend/src/Components/SignUp.js
+3
-3
WebFrontEnd/smartcoach-frontend/src/Images/defaultimageicon.jpg
...ntEnd/smartcoach-frontend/src/Images/defaultimageicon.jpg
+0
-0
WebFrontEnd/smartcoach-frontend/src/Images/defaultimageicon.png
...ntEnd/smartcoach-frontend/src/Images/defaultimageicon.png
+0
-0
No files found.
BackEnd/WebBackEnd/routes/createClass.route.js
View file @
90d14588
...
...
@@ -94,7 +94,7 @@ router.route('/add').post(async(req,res) =>{
router
.
route
(
'
/tutorClass/:id
'
).
get
(
function
(
req
,
res
)
{
let
id
=
req
.
params
.
id
;
//console.log("TutorId : " + id)
classes
.
find
({
"
tutor_id
"
:
id
}).
populate
(
'
institute_id
'
).
then
(
tutorsClasses
=>
{
classes
.
find
({
"
tutor_id
"
:
id
,
"
isActiveForStudent
"
:
true
}).
populate
(
'
institute_id
'
).
then
(
tutorsClasses
=>
{
///console.log(tutor);
res
.
json
(
tutorsClasses
);
}).
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
...
...
BackEnd/WebBackEnd/routes/institute.route.js
View file @
90d14588
...
...
@@ -85,36 +85,36 @@ router.route('/add').post(async(req,res) =>{
.
then
(
newUser
=>
{
////////////////////////////////////////////////////////////////////////////////////
//
const content = `
//
Hi ${institute_name},\n
//
You are Create a Institute Account on SmartCoach.\n
//
You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
//
Used institute email address as the username : ${user_email}
//
Used given password as the password
//
Thank You,
//
Team SmartCoach
//
`;
//
//
var mail = {
//
from: institute_name,
//
to: user_email,
//
subject: 'Email Verification - Institute',
//
text: content
//
}
//
//
transporter.sendMail(mail, (err, data) => {
//
if (err) {
//
res.json({
//
msg: 'fail'
//
})
//
} else {
//
res.json({
//
msg: 'success'
//
})
//
}
//
})
//
;
const
content
=
`
Hi
${
institute_name
}
,\n
You are Create a Institute Account on SmartCoach.\n
You can verify your email address click on 'http://localhost:3000/AccountVerified/
${
newUser
.
id
}
'
Used institute email address as the username :
${
user_email
}
Used given password as the password
Thank You,
Team SmartCoach
`
;
var
mail
=
{
from
:
institute_name
,
to
:
user_email
,
subject
:
'
Email Verification - Institute
'
,
text
:
content
}
transporter
.
sendMail
(
mail
,
(
err
,
data
)
=>
{
if
(
err
)
{
res
.
json
({
msg
:
'
fail
'
})
}
else
{
res
.
json
({
msg
:
'
success
'
})
}
})
;
/////////////////////////////////////////////////////////////////////////////////////
})
...
...
BackEnd/WebBackEnd/routes/tutor.route.js
View file @
90d14588
...
...
@@ -133,41 +133,41 @@ router.route('/add').post(async(req,res) =>{
.
then
(
newUser
=>
{
console
.
log
(
"
Inside the Email Send part
"
)
////////////////////////////////////////////////////////////////////////////////////
//
const content = `
//
Hi ${tutor_name},\n
//
You are Create a Tutor Account on SmartCoach.\n
//
You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
//
Used your email address as username : ${user_email}
//
Thank You,
//
Team SmartCoach
//
`;
//
//
var mail = {
//
from: tutor_name,
//
to: user_email,
//
subject: 'Email Verification - Tutor',
//
text: content
//
}
//
//
transporter.sendMail(mail, (err, data) => {
//
if (err) {
//
res.json({
//
msg: 'fail'
//
})
//
} else {
//
res.json({
//
msg: 'success'
//
})
//
}
//
})
//
;
const
content
=
`
Hi
${
tutor_name
}
,\n
You are Create a Tutor Account on SmartCoach.\n
You can verify your email address click on 'http://localhost:3000/AccountVerified/
${
newUser
.
id
}
'
Used your email address as username :
${
user_email
}
Thank You,
Team SmartCoach
`
;
var
mail
=
{
from
:
tutor_name
,
to
:
user_email
,
subject
:
'
Email Verification - Tutor
'
,
text
:
content
}
transporter
.
sendMail
(
mail
,
(
err
,
data
)
=>
{
if
(
err
)
{
res
.
json
({
msg
:
'
fail
'
})
}
else
{
res
.
json
({
msg
:
'
success
'
})
}
})
;
/////////////////////////////////////////////////////////////////////////////////////
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
//
res.json('Tutor Successfully Added....');
res
.
json
(
'
Tutor Successfully Added....
'
);
...
...
BackEnd/WebBackEnd/routes/tutorRatings.route.js
View file @
90d14588
...
...
@@ -29,4 +29,14 @@ router.route('/add').post(async(req,res) =>{
});
router
.
route
(
'
/:id
'
).
get
(
function
(
req
,
res
)
{
let
id
=
req
.
params
.
id
;
//console.log("TutorId : " + id)
tutorRatingsRoute
.
find
({
"
tutor_id
"
:
id
}).
populate
(
'
student_id
'
).
then
(
tutorReview
=>
{
///console.log(tutor);
res
.
json
(
tutorReview
);
}).
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
module
.
exports
=
router
;
WebFrontEnd/smartcoach-frontend/src/Components/Admin/StudentRequestForClass.js
View file @
90d14588
...
...
@@ -307,9 +307,12 @@ export default class StudentRequestForClass extends Component{
<
div
className
=
""
style
=
{{
marginTop
:
'
15px
'
}}
>
<
div
className
=
"
table-dark row
"
>
<
div
className
=
"
col
-md-4
"
style
=
{{
textAlign
:
'
left
'
,
paddingLeft
:
'
30px
'
}}
>
<
div
className
=
"
col
"
style
=
{{
textAlign
:
'
left
'
,
paddingLeft
:
'
30px
'
}}
>
<
label
>
Batch
Name
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Year
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Starting
Date
<
/label
>
<
/div
>
...
...
@@ -335,9 +338,12 @@ export default class StudentRequestForClass extends Component{
{
this
.
state
.
TutorClassList
.
map
((
oneClass
)
=>
{
return
(
<
div
className
=
"
row
"
style
=
{{
background
:
'
#DCDCDC
'
,
paddingBottom
:
'
5px
'
,
paddingTop
:
'
5px
'
,
borderBottom
:
'
inset
'
}}
>
<
div
className
=
"
col
-md-4
"
style
=
{{
textAlign
:
'
left
'
}}
>
<
div
className
=
"
col
"
style
=
{{
textAlign
:
'
left
'
}}
>
<
label
style
=
{{
marginLeft
:
'
20px
'
}}
>
{
oneClass
.
batch_no
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
oneClass
.
batchYear
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
moment
(
oneClass
.
class_startingDate
).
format
(
"
L
"
)
}
<
/label
>
<
/div
>
...
...
@@ -525,16 +531,31 @@ export default class StudentRequestForClass extends Component{
<
div
className
=
"
row
"
style
=
{{
background
:
'
#DCDCDC
'
,
paddingBottom
:
'
5px
'
,
paddingTop
:
'
5px
'
,
borderBottom
:
'
inset
'
}}
>
<
div
className
=
"
col-md-4
"
style
=
{{
textAlign
:
'
left
'
}}
>
<
label
><
/label
>
<
label
>
200114712426
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Amila
Thenuwara
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
button
className
=
"
rounded
"
style
=
{{
background
:
'
#086232
'
,
padding
:
'
3px
'
,
width
:
'
35px
'
}}
><
Icon
.
ArrowLeftCircle
color
=
"
white
"
size
=
{
20
}
/></
button
>
<
button
className
=
"
rounded
"
style
=
{{
background
:
'
#8D2828
'
,
padding
:
'
3px
'
,
width
:
'
35px
'
,
marginLeft
:
'
10px
'
}}
><
Icon
.
Eraser
color
=
"
white
"
size
=
{
20
}
/></
button
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
background
:
'
#DCDCDC
'
,
paddingBottom
:
'
5px
'
,
paddingTop
:
'
5px
'
,
borderBottom
:
'
inset
'
}}
>
<
div
className
=
"
col-md-4
"
style
=
{{
textAlign
:
'
left
'
}}
>
<
label
>
200177014551
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
><
/label
>
<
label
>
Supun
Malshan
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
button
className
=
"
rounded
"
style
=
{{
background
:
'
#086232
'
,
padding
:
'
3px
'
,
width
:
'
35px
'
}}
><
Icon
.
ArrowLeftCircle
color
=
"
white
"
size
=
{
20
}
/></
button
>
<
button
className
=
"
rounded
"
style
=
{{
background
:
'
#8D2828
'
,
padding
:
'
3px
'
,
width
:
'
35px
'
}}
><
Icon
.
Eraser
color
=
"
white
"
size
=
{
20
}
/></
button
>
<
button
className
=
"
rounded
"
style
=
{{
background
:
'
#8D2828
'
,
padding
:
'
3px
'
,
width
:
'
35px
'
,
marginLeft
:
'
10px
'
}}
><
Icon
.
Eraser
color
=
"
white
"
size
=
{
20
}
/></
button
>
<
/div
>
<
/div
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
View file @
90d14588
...
...
@@ -52,6 +52,7 @@ export default class AddClassDetails extends Component {
this
.
onChangeDay
=
this
.
onChangeDay
.
bind
(
this
);
this
.
onChangeHours
=
this
.
onChangeHours
.
bind
(
this
);
this
.
onChangeAdmissionFee
=
this
.
onChangeAdmissionFee
.
bind
(
this
);
this
.
GetTutorClasses
=
this
.
GetTutorClasses
.
bind
(
this
);
}
...
...
@@ -68,26 +69,31 @@ export default class AddClassDetails extends Component {
subjectList
:
response
.
data
.
tutor_subjects
,
},
()
=>
{
axios
.
get
(
configs
.
BASE_URL
+
'
/createClass/tutorClass/
'
+
this
.
state
.
tutorID
)
.
then
(
response
=>
{
console
.
log
(
response
.
data
);
this
.
setState
({
TutorClassList
:
response
.
data
this
.
GetTutorClasses
();
})
},
()
=>
{
})
}
GetTutorClasses
(){
axios
.
get
(
configs
.
BASE_URL
+
'
/createClass/tutorClass/
'
+
this
.
state
.
tutorID
)
.
then
(
response
=>
{
console
.
log
(
response
.
data
);
})
this
.
setState
({
TutorClassList
:
response
.
data
},
()
=>
{
})
})
})
}
onChangeAdmissionFee
(
e
)
{
this
.
setState
({
AdmissionFee
:
e
.
target
.
value
...
...
@@ -241,6 +247,7 @@ export default class AddClassDetails extends Component {
.
then
(
res
=>
{
console
.
log
(
res
)
swal
(
"
success!!!
"
,
res
.
data
,
"
success
"
).
then
(()
=>
{
this
.
GetTutorClasses
();
// e.target.reset();
//window.location();
});
...
...
@@ -514,9 +521,12 @@ export default class AddClassDetails extends Component {
<
div
className
=
"
container
"
style
=
{{
marginTop
:
'
15px
'
}}
>
<
div
className
=
"
table-dark row
"
>
<
div
className
=
"
col
-md-4
"
style
=
{{
textAlign
:
'
left
'
}}
>
<
div
className
=
"
col
"
style
=
{{
textAlign
:
'
left
'
}}
>
<
label
>
Batch
Name
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Year
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Starting
Date
<
/label
>
<
/div
>
...
...
@@ -546,9 +556,12 @@ export default class AddClassDetails extends Component {
paddingTop
:
'
5px
'
,
borderBottom
:
'
inset
'
}}
>
<
div
className
=
"
col
-md-4
"
style
=
{{
textAlign
:
'
left
'
,
marginLeft
:
'
10px
'
}}
>
<
div
className
=
"
col
"
style
=
{{
textAlign
:
'
left
'
,
marginLeft
:
'
10px
'
}}
>
<
label
style
=
{{}}
>
{
oneClass
.
batch_no
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
oneClass
.
batchYear
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
moment
(
oneClass
.
class_startingDate
).
format
(
"
L
"
)}
<
/label
>
<
/div
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
View file @
90d14588
...
...
@@ -356,9 +356,15 @@ export default class Home extends Component{
valueForRating
=
100
}
else
if
(
Number
(
tutor
.
tutor_avg_rating
)
>
4.75
){
valueForRating
=
75
valueForRating
=
90
}
else
if
(
Number
(
tutor
.
tutor_avg_rating
)
>
4.25
){
valueForRating
=
80
}
else
if
(
Number
(
tutor
.
tutor_avg_rating
)
>
4
){
valueForRating
=
70
}
else
if
(
Number
(
tutor
.
tutor_avg_rating
)
>
3.5
){
valueForRating
=
60
}
else
if
(
Number
(
tutor
.
tutor_avg_rating
)
>
2
){
...
...
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorCard.js
View file @
90d14588
...
...
@@ -5,6 +5,7 @@ import Star from "../../Images/star.png";
import
ReviewImg
from
"
../../Images/note.png
"
;
import
Calender
from
"
../../Images/calender.png
"
;
import
RecommendIcon
from
"
../../Images/recomended.png
"
;
import
{
Link
}
from
"
react-router-dom
"
;
export
default
class
TutorCard
extends
Component
{
...
...
@@ -84,8 +85,8 @@ export default class TutorCard extends Component{
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
button
className
=
"
form-control
"
value
=
{
this
.
props
.
data
.
_id
}
style
=
{{
background
:
"
#216E9B
"
,
color
:
"
white
"
,
marginLeft
:
'
15px
'
,
marginRight
:
'
15px
'
}}
><
b
>
View
Profile
<
/b></
button
>
<
Link
to
=
{
`/Home/ViewProfile/
${
this
.
props
.
data
.
tutor_id
}
`
}
>
<
button
className
=
"
form-control
"
style
=
{{
background
:
"
#216E9B
"
,
color
:
"
white
"
,
marginLeft
:
'
15px
'
,
marginRight
:
'
15px
'
}}
><
b
>
View
Profile
<
/b></
button
><
/Link
>
<
/div
>
<
/div
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorProfileView.js
View file @
90d14588
This diff is collapsed.
Click to expand it.
WebFrontEnd/smartcoach-frontend/src/Components/SignUp.js
View file @
90d14588
...
...
@@ -580,7 +580,7 @@ export default class SignUp extends Component {
else
{
axios
.
post
(
configs
.
BASE_URL
+
'
/studentSingUp/add
'
,
student
)
.
then
(
res
=>
{
console
.
log
(
"
Inside Then
"
)
//
console.log("Inside Then")
window
.
location
=
'
/beforeConfirm
'
})
.
catch
(
function
(
error
)
{
...
...
@@ -664,7 +664,7 @@ export default class SignUp extends Component {
axios
.
post
(
configs
.
BASE_URL
+
'
/tutorSingUp/add
'
,
Tutor
)
.
then
(
res
=>
{
console
.
log
(
"
Inside Then
"
)
//
console.log("Inside Then")
window
.
location
=
'
/beforeConfirm
'
})
.
catch
(
function
(
error
)
{
...
...
@@ -716,7 +716,7 @@ export default class SignUp extends Component {
axios
.
post
(
configs
.
BASE_URL
+
'
/instituteSingUp/add
'
,
institute
)
.
then
(
res
=>
{
console
.
log
(
"
Inside Then
"
)
//
console.log("Inside Then")
window
.
location
=
'
/beforeConfirm
'
})
.
catch
(
function
(
error
)
{
...
...
WebFrontEnd/smartcoach-frontend/src/Images/defaultimageicon.jpg
0 → 100644
View file @
90d14588
44.3 KB
WebFrontEnd/smartcoach-frontend/src/Images/defaultimageicon.png
0 → 100644
View file @
90d14588
11.2 KB
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