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
13565272
Commit
13565272
authored
Oct 02, 2021
by
Hasitha Samarasekara
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT18063288' into 'master'
It18063288 See merge request
!11
parents
cc6ec4b4
799ef536
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
3318 additions
and
171 deletions
+3318
-171
BackEnd/WebBackEnd/models/ClassStudentList.model.js
BackEnd/WebBackEnd/models/ClassStudentList.model.js
+16
-0
BackEnd/WebBackEnd/models/TutorRatingAndReviews.model.js
BackEnd/WebBackEnd/models/TutorRatingAndReviews.model.js
+17
-0
BackEnd/WebBackEnd/models/createClass.model.js
BackEnd/WebBackEnd/models/createClass.model.js
+35
-0
BackEnd/WebBackEnd/models/studentALResult.model.js
BackEnd/WebBackEnd/models/studentALResult.model.js
+2
-1
BackEnd/WebBackEnd/models/tutor.user.model.js
BackEnd/WebBackEnd/models/tutor.user.model.js
+1
-1
BackEnd/WebBackEnd/package-lock.json
BackEnd/WebBackEnd/package-lock.json
+360
-0
BackEnd/WebBackEnd/package.json
BackEnd/WebBackEnd/package.json
+3
-1
BackEnd/WebBackEnd/routes/createClass.route.js
BackEnd/WebBackEnd/routes/createClass.route.js
+163
-0
BackEnd/WebBackEnd/routes/filteredList.route.js
BackEnd/WebBackEnd/routes/filteredList.route.js
+149
-0
BackEnd/WebBackEnd/routes/filteredListNew.route.js
BackEnd/WebBackEnd/routes/filteredListNew.route.js
+164
-0
BackEnd/WebBackEnd/routes/student.route.js
BackEnd/WebBackEnd/routes/student.route.js
+62
-62
BackEnd/WebBackEnd/routes/studentALResult.route.js
BackEnd/WebBackEnd/routes/studentALResult.route.js
+3
-1
BackEnd/WebBackEnd/routes/tutor.route.js
BackEnd/WebBackEnd/routes/tutor.route.js
+20
-19
BackEnd/WebBackEnd/routes/tutorRatings.route.js
BackEnd/WebBackEnd/routes/tutorRatings.route.js
+32
-0
BackEnd/WebBackEnd/server.js
BackEnd/WebBackEnd/server.js
+7
-1
WebFrontEnd/smartcoach-frontend/package-lock.json
WebFrontEnd/smartcoach-frontend/package-lock.json
+23
-0
WebFrontEnd/smartcoach-frontend/package.json
WebFrontEnd/smartcoach-frontend/package.json
+4
-0
WebFrontEnd/smartcoach-frontend/src/App.js
WebFrontEnd/smartcoach-frontend/src/App.js
+2
-0
WebFrontEnd/smartcoach-frontend/src/Components/Admin/Dashboard.js
...End/smartcoach-frontend/src/Components/Admin/Dashboard.js
+7
-4
WebFrontEnd/smartcoach-frontend/src/Components/Admin/StudentRequestForClass.js
...h-frontend/src/Components/Admin/StudentRequestForClass.js
+551
-0
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
...tcoach-frontend/src/Components/Admin/add_class_details.js
+531
-64
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
+464
-10
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorCard.js
.../smartcoach-frontend/src/Components/HomePage/TutorCard.js
+6
-6
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorProfileView.js
...oach-frontend/src/Components/HomePage/TutorProfileView.js
+689
-0
WebFrontEnd/smartcoach-frontend/src/Components/Student/ALResults.js
...d/smartcoach-frontend/src/Components/Student/ALResults.js
+6
-0
WebFrontEnd/smartcoach-frontend/src/Config/config.js
WebFrontEnd/smartcoach-frontend/src/Config/config.js
+1
-1
No files found.
BackEnd/WebBackEnd/models/ClassStudentList.model.js
0 → 100644
View file @
13565272
const
mongoose
=
require
(
'
mongoose
'
);
const
Schema
=
mongoose
.
Schema
;
const
ClassStudentSchema
=
new
Schema
({
class_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
Classes
'
},
student_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
student
'
},
},{
timestamps
:
true
,
});
const
ClassStudentList
=
mongoose
.
model
(
'
ClassStudentList
'
,
ClassStudentSchema
);
module
.
exports
=
ClassStudentList
;
\ No newline at end of file
BackEnd/WebBackEnd/models/TutorRatingAndReviews.model.js
0 → 100644
View file @
13565272
const
mongoose
=
require
(
'
mongoose
'
);
const
Schema
=
mongoose
.
Schema
;
const
TutorRatingSchema
=
new
Schema
({
tutor_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
tutor
'
},
student_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
student
'
},
rating
:
{
type
:
String
},
review
:{
type
:
String
},
version
:{
type
:
String
},
},
{
timestamps
:
true
,
});
const
TutorRatings
=
mongoose
.
model
(
'
TutorRatings
'
,
TutorRatingSchema
);
module
.
exports
=
TutorRatings
;
\ No newline at end of file
BackEnd/WebBackEnd/models/createClass.model.js
0 → 100644
View file @
13565272
const
mongoose
=
require
(
'
mongoose
'
);
const
Schema
=
mongoose
.
Schema
;
const
CreateClassSchema
=
new
Schema
({
tutor_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
tutor
'
},
class_method
:{
type
:
String
},
class_type
:
{
type
:
String
},
institute_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
institute
'
},
batch_no
:
{
type
:
String
},
class_startingDate
:{
type
:
Date
},
subject
:{
type
:
String
},
class_fee
:{
type
:
String
},
student_list
:[{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
student
'
}],
class_fee_option
:
{
type
:
String
},
class_conduct_day
:
{
type
:
String
},
class_conduct_time
:
{
type
:
String
},
AdmissionFee
:
{
type
:
String
},
batchYear
:
{
type
:
String
},
isActiveClass
:
{
type
:
Boolean
,
default
:
true
},
isActiveForStudent
:
{
type
:
Boolean
,
default
:
true
}
},{
timestamps
:
true
,
});
const
Classes
=
mongoose
.
model
(
'
Classes
'
,
CreateClassSchema
);
module
.
exports
=
Classes
;
\ No newline at end of file
BackEnd/WebBackEnd/models/studentALResult.model.js
View file @
13565272
...
...
@@ -3,9 +3,10 @@ const mongoose = require('mongoose');
const
Schema
=
mongoose
.
Schema
;
const
ALResultsSchema
=
new
Schema
({
student_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
Post
'
},
student_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
students
'
},
year
:{
type
:
String
,
required
:
false
},
stream
:
{
type
:
String
,
required
:
true
},
Subjects
:
{
type
:
Object
},
subject01
:{
type
:
String
,
required
:
true
},
subject02
:{
type
:
String
,
required
:
true
},
subject03
:{
type
:
String
,
required
:
true
},
...
...
BackEnd/WebBackEnd/models/tutor.user.model.js
View file @
13565272
...
...
@@ -19,7 +19,7 @@ const userSchema = new Schema({
tutor_main_city
:[{
type
:
String
}],
tutor_medium
:{
type
:
String
},
tutor_qualification
:{
type
:
String
},
tutor_instituteIDList
:[{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
Post
'
}],
tutor_instituteIDList
:[{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
institute
'
}],
},
{
timestamps
:
true
,
});
...
...
BackEnd/WebBackEnd/package-lock.json
View file @
13565272
...
...
@@ -35,11 +35,73 @@
"negotiator"
:
"0.6.2"
}
},
"ajv"
:
{
"version"
:
"6.12.6"
,
"resolved"
:
"https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz"
,
"integrity"
:
"sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="
,
"dev"
:
true
,
"requires"
:
{
"fast-deep-equal"
:
"^3.1.1"
,
"fast-json-stable-stringify"
:
"^2.0.0"
,
"json-schema-traverse"
:
"^0.4.1"
,
"uri-js"
:
"^4.2.2"
}
},
"array-flatten"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz"
,
"integrity"
:
"sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
"asn1"
:
{
"version"
:
"0.2.4"
,
"resolved"
:
"https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz"
,
"integrity"
:
"sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg=="
,
"dev"
:
true
,
"requires"
:
{
"safer-buffer"
:
"~2.1.0"
}
},
"assert-plus"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz"
,
"integrity"
:
"sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
,
"dev"
:
true
},
"asynckit"
:
{
"version"
:
"0.4.0"
,
"resolved"
:
"https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz"
,
"integrity"
:
"sha1-x57Zf380y48robyXkLzDZkdLS3k="
,
"dev"
:
true
},
"aws-sign2"
:
{
"version"
:
"0.7.0"
,
"resolved"
:
"https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz"
,
"integrity"
:
"sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
,
"dev"
:
true
},
"aws4"
:
{
"version"
:
"1.11.0"
,
"resolved"
:
"https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz"
,
"integrity"
:
"sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
,
"dev"
:
true
},
"axios"
:
{
"version"
:
"0.21.4"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz"
,
"integrity"
:
"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg=="
,
"requires"
:
{
"follow-redirects"
:
"^1.14.0"
}
},
"bcrypt-pbkdf"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz"
,
"integrity"
:
"sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4="
,
"dev"
:
true
,
"requires"
:
{
"tweetnacl"
:
"^0.14.3"
}
},
"bl"
:
{
"version"
:
"2.2.1"
,
"resolved"
:
"https://registry.npmjs.org/bl/-/bl-2.2.1.tgz"
,
...
...
@@ -81,6 +143,21 @@
"resolved"
:
"https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz"
,
"integrity"
:
"sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
},
"caseless"
:
{
"version"
:
"0.12.0"
,
"resolved"
:
"https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz"
,
"integrity"
:
"sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
,
"dev"
:
true
},
"combined-stream"
:
{
"version"
:
"1.0.8"
,
"resolved"
:
"https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz"
,
"integrity"
:
"sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="
,
"dev"
:
true
,
"requires"
:
{
"delayed-stream"
:
"~1.0.0"
}
},
"content-disposition"
:
{
"version"
:
"0.5.3"
,
"resolved"
:
"https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz"
,
...
...
@@ -118,6 +195,15 @@
"vary"
:
"^1"
}
},
"dashdash"
:
{
"version"
:
"1.14.1"
,
"resolved"
:
"https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz"
,
"integrity"
:
"sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA="
,
"dev"
:
true
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
}
},
"debug"
:
{
"version"
:
"2.6.9"
,
"resolved"
:
"https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
,
...
...
@@ -126,6 +212,12 @@
"ms"
:
"2.0.0"
}
},
"delayed-stream"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
,
"integrity"
:
"sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
,
"dev"
:
true
},
"denque"
:
{
"version"
:
"1.5.0"
,
"resolved"
:
"https://registry.npmjs.org/denque/-/denque-1.5.0.tgz"
,
...
...
@@ -146,6 +238,16 @@
"resolved"
:
"https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz"
,
"integrity"
:
"sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q=="
},
"ecc-jsbn"
:
{
"version"
:
"0.1.2"
,
"resolved"
:
"https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz"
,
"integrity"
:
"sha1-OoOpBOVDUyh4dMVkt1SThoSamMk="
,
"dev"
:
true
,
"requires"
:
{
"jsbn"
:
"~0.1.0"
,
"safer-buffer"
:
"^2.1.0"
}
},
"ee-first"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz"
,
...
...
@@ -203,6 +305,30 @@
"vary"
:
"~1.1.2"
}
},
"extend"
:
{
"version"
:
"3.0.2"
,
"resolved"
:
"https://registry.npmjs.org/extend/-/extend-3.0.2.tgz"
,
"integrity"
:
"sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
,
"dev"
:
true
},
"extsprintf"
:
{
"version"
:
"1.3.0"
,
"resolved"
:
"https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz"
,
"integrity"
:
"sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
,
"dev"
:
true
},
"fast-deep-equal"
:
{
"version"
:
"3.1.3"
,
"resolved"
:
"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"
,
"integrity"
:
"sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
,
"dev"
:
true
},
"fast-json-stable-stringify"
:
{
"version"
:
"2.1.0"
,
"resolved"
:
"https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz"
,
"integrity"
:
"sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
,
"dev"
:
true
},
"finalhandler"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz"
,
...
...
@@ -217,6 +343,28 @@
"unpipe"
:
"~1.0.0"
}
},
"follow-redirects"
:
{
"version"
:
"1.14.4"
,
"resolved"
:
"https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz"
,
"integrity"
:
"sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g=="
},
"forever-agent"
:
{
"version"
:
"0.6.1"
,
"resolved"
:
"https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
,
"integrity"
:
"sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
,
"dev"
:
true
},
"form-data"
:
{
"version"
:
"2.3.3"
,
"resolved"
:
"https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz"
,
"integrity"
:
"sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ=="
,
"dev"
:
true
,
"requires"
:
{
"asynckit"
:
"^0.4.0"
,
"combined-stream"
:
"^1.0.6"
,
"mime-types"
:
"^2.1.12"
}
},
"forwarded"
:
{
"version"
:
"0.2.0"
,
"resolved"
:
"https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz"
,
...
...
@@ -227,6 +375,31 @@
"resolved"
:
"https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz"
,
"integrity"
:
"sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"getpass"
:
{
"version"
:
"0.1.7"
,
"resolved"
:
"https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz"
,
"integrity"
:
"sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo="
,
"dev"
:
true
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
}
},
"har-schema"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz"
,
"integrity"
:
"sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
,
"dev"
:
true
},
"har-validator"
:
{
"version"
:
"5.1.5"
,
"resolved"
:
"https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz"
,
"integrity"
:
"sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w=="
,
"dev"
:
true
,
"requires"
:
{
"ajv"
:
"^6.12.3"
,
"har-schema"
:
"^2.0.0"
}
},
"http-errors"
:
{
"version"
:
"1.7.2"
,
"resolved"
:
"https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz"
,
...
...
@@ -239,6 +412,17 @@
"toidentifier"
:
"1.0.0"
}
},
"http-signature"
:
{
"version"
:
"1.2.0"
,
"resolved"
:
"https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz"
,
"integrity"
:
"sha1-muzZJRFHcvPZW2WmCruPfBj7rOE="
,
"dev"
:
true
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
,
"jsprim"
:
"^1.2.2"
,
"sshpk"
:
"^1.7.0"
}
},
"iconv-lite"
:
{
"version"
:
"0.4.24"
,
"resolved"
:
"https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz"
,
...
...
@@ -257,11 +441,59 @@
"resolved"
:
"https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz"
,
"integrity"
:
"sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
},
"is-typedarray"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz"
,
"integrity"
:
"sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
,
"dev"
:
true
},
"isarray"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
,
"integrity"
:
"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"isstream"
:
{
"version"
:
"0.1.2"
,
"resolved"
:
"https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"
,
"integrity"
:
"sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
,
"dev"
:
true
},
"jsbn"
:
{
"version"
:
"0.1.1"
,
"resolved"
:
"https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz"
,
"integrity"
:
"sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
,
"dev"
:
true
},
"json-schema"
:
{
"version"
:
"0.2.3"
,
"resolved"
:
"https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz"
,
"integrity"
:
"sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
,
"dev"
:
true
},
"json-schema-traverse"
:
{
"version"
:
"0.4.1"
,
"resolved"
:
"https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz"
,
"integrity"
:
"sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
,
"dev"
:
true
},
"json-stringify-safe"
:
{
"version"
:
"5.0.1"
,
"resolved"
:
"https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz"
,
"integrity"
:
"sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
,
"dev"
:
true
},
"jsprim"
:
{
"version"
:
"1.4.1"
,
"resolved"
:
"https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz"
,
"integrity"
:
"sha1-MT5mvB5cwG5Di8G3SZwuXFastqI="
,
"dev"
:
true
,
"requires"
:
{
"assert-plus"
:
"1.0.0"
,
"extsprintf"
:
"1.3.0"
,
"json-schema"
:
"0.2.3"
,
"verror"
:
"1.10.0"
}
},
"kareem"
:
{
"version"
:
"2.3.2"
,
"resolved"
:
"https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz"
,
...
...
@@ -398,6 +630,12 @@
"integrity"
:
"sha512-YSzu7TLbI+bsjCis/TZlAXBoM4y93HhlIgo0P5oiA2ua9Z4k+E2Fod//ybIzdJxOlXGRcHIh/WaeCBehvxZb/Q=="
,
"dev"
:
true
},
"oauth-sign"
:
{
"version"
:
"0.9.0"
,
"resolved"
:
"https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz"
,
"integrity"
:
"sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
,
"dev"
:
true
},
"object-assign"
:
{
"version"
:
"4.1.1"
,
"resolved"
:
"https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
,
...
...
@@ -426,6 +664,12 @@
"resolved"
:
"https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz"
,
"integrity"
:
"sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"performance-now"
:
{
"version"
:
"2.1.0"
,
"resolved"
:
"https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz"
,
"integrity"
:
"sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
,
"dev"
:
true
},
"process-nextick-args"
:
{
"version"
:
"2.0.1"
,
"resolved"
:
"https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz"
,
...
...
@@ -440,6 +684,18 @@
"ipaddr.js"
:
"1.9.1"
}
},
"psl"
:
{
"version"
:
"1.8.0"
,
"resolved"
:
"https://registry.npmjs.org/psl/-/psl-1.8.0.tgz"
,
"integrity"
:
"sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
,
"dev"
:
true
},
"punycode"
:
{
"version"
:
"2.1.1"
,
"resolved"
:
"https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz"
,
"integrity"
:
"sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
,
"dev"
:
true
},
"qs"
:
{
"version"
:
"6.7.0"
,
"resolved"
:
"https://registry.npmjs.org/qs/-/qs-6.7.0.tgz"
,
...
...
@@ -480,6 +736,42 @@
"resolved"
:
"https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz"
,
"integrity"
:
"sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw=="
},
"request"
:
{
"version"
:
"2.88.2"
,
"resolved"
:
"https://registry.npmjs.org/request/-/request-2.88.2.tgz"
,
"integrity"
:
"sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw=="
,
"dev"
:
true
,
"requires"
:
{
"aws-sign2"
:
"~0.7.0"
,
"aws4"
:
"^1.8.0"
,
"caseless"
:
"~0.12.0"
,
"combined-stream"
:
"~1.0.6"
,
"extend"
:
"~3.0.2"
,
"forever-agent"
:
"~0.6.1"
,
"form-data"
:
"~2.3.2"
,
"har-validator"
:
"~5.1.3"
,
"http-signature"
:
"~1.2.0"
,
"is-typedarray"
:
"~1.0.0"
,
"isstream"
:
"~0.1.2"
,
"json-stringify-safe"
:
"~5.0.1"
,
"mime-types"
:
"~2.1.19"
,
"oauth-sign"
:
"~0.9.0"
,
"performance-now"
:
"^2.1.0"
,
"qs"
:
"~6.5.2"
,
"safe-buffer"
:
"^5.1.2"
,
"tough-cookie"
:
"~2.5.0"
,
"tunnel-agent"
:
"^0.6.0"
,
"uuid"
:
"^3.3.2"
},
"dependencies"
:
{
"qs"
:
{
"version"
:
"6.5.2"
,
"resolved"
:
"https://registry.npmjs.org/qs/-/qs-6.5.2.tgz"
,
"integrity"
:
"sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
,
"dev"
:
true
}
}
},
"safe-buffer"
:
{
"version"
:
"5.1.2"
,
"resolved"
:
"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz"
,
...
...
@@ -561,6 +853,23 @@
"memory-pager"
:
"^1.0.2"
}
},
"sshpk"
:
{
"version"
:
"1.16.1"
,
"resolved"
:
"https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz"
,
"integrity"
:
"sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg=="
,
"dev"
:
true
,
"requires"
:
{
"asn1"
:
"~0.2.3"
,
"assert-plus"
:
"^1.0.0"
,
"bcrypt-pbkdf"
:
"^1.0.0"
,
"dashdash"
:
"^1.12.0"
,
"ecc-jsbn"
:
"~0.1.1"
,
"getpass"
:
"^0.1.1"
,
"jsbn"
:
"~0.1.0"
,
"safer-buffer"
:
"^2.0.2"
,
"tweetnacl"
:
"~0.14.0"
}
},
"statuses"
:
{
"version"
:
"1.5.0"
,
"resolved"
:
"https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz"
,
...
...
@@ -579,6 +888,31 @@
"resolved"
:
"https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz"
,
"integrity"
:
"sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
},
"tough-cookie"
:
{
"version"
:
"2.5.0"
,
"resolved"
:
"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz"
,
"integrity"
:
"sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g=="
,
"dev"
:
true
,
"requires"
:
{
"psl"
:
"^1.1.28"
,
"punycode"
:
"^2.1.1"
}
},
"tunnel-agent"
:
{
"version"
:
"0.6.0"
,
"resolved"
:
"https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz"
,
"integrity"
:
"sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0="
,
"dev"
:
true
,
"requires"
:
{
"safe-buffer"
:
"^5.0.1"
}
},
"tweetnacl"
:
{
"version"
:
"0.14.5"
,
"resolved"
:
"https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz"
,
"integrity"
:
"sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
,
"dev"
:
true
},
"type-is"
:
{
"version"
:
"1.6.18"
,
"resolved"
:
"https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz"
,
...
...
@@ -593,6 +927,15 @@
"resolved"
:
"https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz"
,
"integrity"
:
"sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"uri-js"
:
{
"version"
:
"4.4.1"
,
"resolved"
:
"https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz"
,
"integrity"
:
"sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="
,
"dev"
:
true
,
"requires"
:
{
"punycode"
:
"^2.1.0"
}
},
"util-deprecate"
:
{
"version"
:
"1.0.2"
,
"resolved"
:
"https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
,
...
...
@@ -603,10 +946,27 @@
"resolved"
:
"https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz"
,
"integrity"
:
"sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"uuid"
:
{
"version"
:
"3.4.0"
,
"resolved"
:
"https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz"
,
"integrity"
:
"sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
,
"dev"
:
true
},
"vary"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
,
"integrity"
:
"sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
},
"verror"
:
{
"version"
:
"1.10.0"
,
"resolved"
:
"https://registry.npmjs.org/verror/-/verror-1.10.0.tgz"
,
"integrity"
:
"sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA="
,
"dev"
:
true
,
"requires"
:
{
"assert-plus"
:
"^1.0.0"
,
"core-util-is"
:
"1.0.2"
,
"extsprintf"
:
"^1.2.0"
}
}
}
}
BackEnd/WebBackEnd/package.json
View file @
13565272
...
...
@@ -10,12 +10,14 @@
"author"
:
""
,
"license"
:
"ISC"
,
"dependencies"
:
{
"axios"
:
"^0.21.4"
,
"cors"
:
"^2.8.5"
,
"dotenv"
:
"^10.0.0"
,
"express"
:
"^4.17.1"
,
"mongoose"
:
"^5.12.15"
},
"devDependencies"
:
{
"nodemailer"
:
"^6.6.2"
"nodemailer"
:
"^6.6.2"
,
"request"
:
"^2.88.2"
}
}
BackEnd/WebBackEnd/routes/createClass.route.js
0 → 100644
View file @
13565272
const
router
=
require
(
'
express
'
).
Router
();
let
classes
=
require
(
'
../models/createClass.model
'
);
let
student
=
require
(
'
../models/student.user.model
'
);
let
studentList
=
require
(
'
../models/ClassStudentList.model
'
);
const
mongoose
=
require
(
"
mongoose
"
);
router
.
route
(
'
/add
'
).
post
(
async
(
req
,
res
)
=>
{
console
.
log
(
"
Inside Create Class
"
)
if
(
req
.
body
.
institute_id
!==
""
){
const
tutor_id
=
mongoose
.
Types
.
ObjectId
(
req
.
body
.
tutor_id
);
const
class_method
=
req
.
body
.
class_method
;
const
class_type
=
req
.
body
.
class_type
;
const
institute_id
=
mongoose
.
Types
.
ObjectId
(
req
.
body
.
institute_id
);
const
batch_no
=
req
.
body
.
batch_no
;
const
class_startingDate
=
req
.
body
.
class_startingDate
;
const
subject
=
req
.
body
.
subject
;
const
class_fee
=
req
.
body
.
class_fee
;
const
class_fee_option
=
req
.
body
.
class_fee_option
;
const
isActiveClass
=
req
.
body
.
isActiveClass
;
const
isActiveForStudent
=
req
.
body
.
isActiveForStudent
;
const
class_conduct_day
=
req
.
body
.
class_conduct_day
;
const
class_conduct_time
=
req
.
body
.
class_conduct_time
;
const
AdmissionFee
=
req
.
body
.
AdmissionFee
;
const
batchYear
=
req
.
body
.
batchYear
;
const
newClass
=
new
classes
({
tutor_id
,
class_method
,
class_type
,
batch_no
,
class_startingDate
,
subject
,
class_fee
,
isActiveClass
,
isActiveForStudent
,
institute_id
,
class_fee_option
,
class_conduct_day
,
class_conduct_time
,
AdmissionFee
,
batchYear
});
console
.
log
(
newClass
)
newClass
.
save
().
then
(()
=>
{
res
.
json
(
'
Class Created!
'
);
}).
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
}
else
{
const
tutor_id
=
mongoose
.
Types
.
ObjectId
(
req
.
body
.
tutor_id
);
const
class_method
=
req
.
body
.
class_method
;
const
class_type
=
req
.
body
.
class_type
;
const
batch_no
=
req
.
body
.
batch_no
;
const
class_startingDate
=
req
.
body
.
class_startingDate
;
const
subject
=
req
.
body
.
subject
;
const
class_fee
=
req
.
body
.
class_fee
;
const
class_fee_option
=
req
.
body
.
class_fee_option
;
const
isActiveClass
=
req
.
body
.
isActiveClass
;
const
isActiveForStudent
=
req
.
body
.
isActiveForStudent
;
const
class_conduct_day
=
req
.
body
.
class_conduct_day
;
const
class_conduct_time
=
req
.
body
.
class_conduct_time
;
const
AdmissionFee
=
req
.
body
.
AdmissionFee
;
const
batchYear
=
req
.
body
.
batchYear
;
const
newClass
=
new
classes
({
tutor_id
,
class_method
,
class_type
,
batch_no
,
class_startingDate
,
subject
,
class_fee
,
isActiveClass
,
isActiveForStudent
,
class_fee_option
,
class_conduct_day
,
class_conduct_time
,
AdmissionFee
,
batchYear
});
console
.
log
(
newClass
)
newClass
.
save
().
then
(()
=>
{
res
.
json
(
'
Class Created!
'
);
}).
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
}
});
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
=>
{
///console.log(tutor);
res
.
json
(
tutorsClasses
);
}).
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
router
.
route
(
'
/studentList/update
'
).
post
((
req
,
res
)
=>
{
const
class_id
=
req
.
body
.
_id
;
const
student_nic
=
req
.
body
.
student_nic
;
console
.
log
(
"
classID:
"
+
class_id
);
console
.
log
(
"
student_nic:
"
+
student_nic
);
classes
.
findById
(
class_id
,
function
(
err
,
tutorsClass
){
if
(
!
tutorsClass
)
req
.
status
(
404
).
send
(
"
Sorry Class Could not Found.
"
);
else
{
student
.
find
({
"
student_nic
"
:
student_nic
}).
then
(
student
=>
{
console
.
log
(
student
)
console
.
log
(
student
[
0
].
_id
)
if
(
student
[
0
].
student_nic
===
""
){
req
.
status
(
500
).
send
(
"
Sorry, This Student Not Registered
"
);
}
else
{
const
student_id
=
student
[
0
].
_id
;
const
newClassStudent
=
new
studentList
({
class_id
,
student_id
,
});
newClassStudent
.
save
().
then
(
result
=>
{
res
.
json
(
'
Student added to the Class!
'
);
})
.
catch
(
err
=>
{
res
.
status
(
500
).
send
(
"
Update not possible
"
);
});
}
}).
catch
(
err
=>
res
.
status
(
500
).
json
(
'
Eroor:
'
+
err
));
}
});
});
router
.
route
(
'
/studentList/:id
'
).
get
(
function
(
req
,
res
)
{
let
id
=
req
.
params
.
id
;
console
.
log
(
"
Class ID :
"
+
id
)
studentList
.
find
({
"
class_id
"
:
id
}).
populate
(
'
student_id
'
).
then
(
StudentList
=>
{
console
.
log
(
StudentList
);
res
.
json
(
StudentList
);
}).
catch
(
err
=>
{
console
.
log
(
err
);
res
.
status
(
400
).
json
(
'
Error:
'
+
err
)
});
});
module
.
exports
=
router
;
\ No newline at end of file
BackEnd/WebBackEnd/routes/filteredList.route.js
0 → 100644
View file @
13565272
const
router
=
require
(
'
express
'
).
Router
();
let
tutor
=
require
(
'
../models/tutor.user.model
'
);
let
tutorRating
=
require
(
'
../models/TutorRatingAndReviews.model
'
);
const
mongoose
=
require
(
"
mongoose
"
);
const
express
=
require
(
'
express
'
)
const
request
=
require
(
'
request
'
);
router
.
route
(
'
/getFilteredList
'
).
post
((
req
,
res
)
=>
{
tutor
.
find
({
"
tutor_Stream
"
:
{
'
$regex
'
:
req
.
body
.
selectedStream
,
'
$options
'
:
'
i
'
},
"
tutor_subjects
"
:
{
'
$regex
'
:
req
.
body
.
selectedSubject
,
'
$options
'
:
'
i
'
},
"
tutor_main_district
"
:
{
'
$regex
'
:
req
.
body
.
selectedDistrict
,
'
$options
'
:
'
i
'
},
"
tutor_main_city
"
:
{
'
$regex
'
:
req
.
body
.
selectedCity
,
'
$options
'
:
'
i
'
},
"
tutor_medium
"
:
{
'
$regex
'
:
req
.
body
.
selectedLanguage
,
'
$options
'
:
'
i
'
},
"
tutor_class_type
"
:
{
'
$regex
'
:
req
.
body
.
selectedClassType
,
'
$options
'
:
'
i
'
},
})
.
then
(
async
tutors
=>
{
let
tutorReviewResultsFinal
let
tutorReviewResults
=
[];
async
function
processData
(
callback
)
{
async
function
forLoopRun
(
callback6
)
{
let
payload
let
options
const
promises
=
tutors
.
map
(
async
(
tutor
)
=>
{
await
tutorRating
.
find
({
"
tutor_id
"
:
tutor
.
_id
}).
populate
(
'
tutor_id
'
).
then
(
async
reviews01
=>
{
//console.log("Review Count " + reviews01.length);
if
(
reviews01
.
length
>
0
)
{
let
reviewsList01
=
[];
const
reviewPromises
=
reviews01
.
map
(
async
function
(
oneReview
)
{
reviewsList01
.
push
(
oneReview
.
review
);
return
oneReview
.
review
})
const
reviewsForTutor
=
await
Promise
.
all
(
reviewPromises
);
await
console
.
log
(
reviewsForTutor
);
async
function
getPrevMatches
(
cb
)
{
options
=
{
uri
:
'
http://localhost:5000/review_prediction_for_tutor
'
,
body
:
JSON
.
stringify
(
reviewsList01
),
method
:
'
POST
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
}
request
(
options
,
async
function
(
error
,
response
)
{
// console.log(error, response.body);
//tutor.tutor_main_district = "Test";
//tutorReviewResults.tutor_reviewValue = response.body;
payload
=
{
"
tutor_id
"
:
tutor
.
_id
,
"
tutor_name
"
:
tutor
.
tutor_name
,
"
tutor_nic
"
:
tutor
.
tutor_nic
,
"
tutor_email
"
:
tutor
.
tutor_email
,
"
tutor_phone
"
:
tutor
.
tutor_phone
,
"
tutor_address
"
:
tutor
.
tutor_address
,
"
tutor_password
"
:
tutor
.
tutor_password
,
"
tutor_gender
"
:
tutor
.
tutor_gender
,
"
tutor_status
"
:
tutor
.
tutor_status
,
"
tutor_image
"
:
tutor
.
tutor_image
,
"
tutor_Stream
"
:
tutor
.
tutor_Stream
,
"
tutor_subjects
"
:
tutor
.
tutor_subjects
,
"
tutor_class_type
"
:
tutor
.
tutor_class_type
,
"
tutor_main_district
"
:
tutor
.
tutor_main_district
,
"
tutor_main_city
"
:
tutor
.
tutor_main_city
,
"
tutor_medium
"
:
tutor
.
tutor_medium
,
"
tutor_qualification
"
:
tutor
.
tutor_qualification
,
"
tutor_reviewValue
"
:
JSON
.
parse
(
response
.
body
).
result
,
};
await
tutorReviewResults
.
push
(
payload
);
//console.log(payload)
if
(
response
.
statusCode
===
200
){
cb
(
payload
);
}
});
}
await
getPrevMatches
(
function
(
message777
)
{
console
.
log
(
message777
);
// callback("Done : ProcessData");
});
// module.exports = {
// getPrevMatches: getPrevMatches
// }
//console.log(getPrevMatches);
}
})
return
payload
;
})
tutorReviewResultsFinal
=
await
Promise
.
all
(
promises
);
callback6
(
"
Get Return :
"
+
tutorReviewResultsFinal
);
}
await
forLoopRun
(
async
function
(
message2
)
{
console
.
log
(
message2
);
callback
(
"
Done : ProcessData
"
);
});
}
console
.
log
(
"
Last
"
+
tutorReviewResults
.
length
)
await
processData
(
async
function
(
message
)
{
console
.
log
(
message
);
//console.log("Inside return Fuction");
}).
then
(
async
r
=>
{
console
.
log
(
"
Inside return Function
"
);
//await res.json(tutorReviewResults)
})
;
console
.
log
(
"
End
"
+
tutorReviewResults
.
length
)
res
.
json
(
tutorReviewResults
)
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
});
module
.
exports
=
router
;
BackEnd/WebBackEnd/routes/filteredListNew.route.js
0 → 100644
View file @
13565272
const
router
=
require
(
'
express
'
).
Router
();
let
tutor
=
require
(
'
../models/tutor.user.model
'
);
let
tutorRating
=
require
(
'
../models/TutorRatingAndReviews.model
'
);
const
axios
=
require
(
'
axios
'
);
const
request
=
require
(
'
request
'
);
router
.
route
(
'
/getFilteredList
'
).
post
((
req
,
res
)
=>
{
let
teacherReviewList
=
[];
let
reviewListWithScore
=
[];
tutor
.
find
({
"
tutor_Stream
"
:
{
'
$regex
'
:
req
.
body
.
selectedStream
,
'
$options
'
:
'
i
'
},
"
tutor_subjects
"
:
{
'
$regex
'
:
req
.
body
.
selectedSubject
,
'
$options
'
:
'
i
'
},
"
tutor_main_district
"
:
{
'
$regex
'
:
req
.
body
.
selectedDistrict
,
'
$options
'
:
'
i
'
},
"
tutor_main_city
"
:
{
'
$regex
'
:
req
.
body
.
selectedCity
,
'
$options
'
:
'
i
'
},
"
tutor_medium
"
:
{
'
$regex
'
:
req
.
body
.
selectedLanguage
,
'
$options
'
:
'
i
'
},
"
tutor_class_type
"
:
{
'
$regex
'
:
req
.
body
.
selectedClassType
,
'
$options
'
:
'
i
'
},
})
.
then
(
tutors
=>
{
//console.log(tutors);
tutors
.
reduce
(
async
(
promise
,
tutor
,
idx
)
=>
{
await
promise
;
await
tutorRating
.
find
({
"
tutor_id
"
:
tutor
.
_id
}).
then
((
reviews
)
=>
{
//console.log("i : " + JSON.stringify(reviews));
console
.
log
(
"
idx :
"
+
idx
);
// console.log("tutor : " + tutors);
const
teacherReview
=
{
"
teacher
"
:
tutor
.
_id
,
"
tutor_name
"
:
tutor
.
tutor_name
,
"
tutor_nic
"
:
tutor
.
tutor_nic
,
"
tutor_email
"
:
tutor
.
tutor_email
,
"
tutor_phone
"
:
tutor
.
tutor_phone
,
"
tutor_address
"
:
tutor
.
tutor_address
,
"
tutor_password
"
:
tutor
.
tutor_password
,
"
tutor_gender
"
:
tutor
.
tutor_gender
,
"
tutor_status
"
:
tutor
.
tutor_status
,
"
tutor_image
"
:
tutor
.
tutor_image
,
"
tutor_Stream
"
:
tutor
.
tutor_Stream
,
"
tutor_subjects
"
:
tutor
.
tutor_subjects
,
"
tutor_class_type
"
:
tutor
.
tutor_class_type
,
"
tutor_main_district
"
:
tutor
.
tutor_main_district
,
"
tutor_main_city
"
:
tutor
.
tutor_main_city
,
"
tutor_medium
"
:
tutor
.
tutor_medium
,
"
tutor_qualification
"
:
tutor
.
tutor_qualification
,
"
review
"
:
reviews
.
map
(
review
=>
review
.
review
),
"
ratings
"
:
reviews
.
map
(
review
=>
review
.
rating
)
}
//teacherReviewList.indexOf(teacherReview) === -1 ? teacherReviewList.push(teacherReview) : null;
let
index
=
teacherReviewList
.
findIndex
(
x
=>
x
.
teacher
===
tutor
.
_id
);
if
(
index
===
-
1
)
{
teacherReviewList
.
push
(
teacherReview
);
}
if
(
idx
===
tutors
.
length
-
1
)
{
//console.log(teacherReviewList);
teacherReviewList
.
reduce
(
async
(
promise
,
teacherReview
,
idx
,
teacherReviewList
)
=>
{
await
promise
;
console
.
log
(
"
length
"
+
teacherReview
.
review
.
length
);
if
(
teacherReview
.
review
.
length
>
0
)
{
let
options
=
{
uri
:
'
http://localhost:5000/review_prediction_for_tutor
'
,
body
:
JSON
.
stringify
(
teacherReview
.
review
),
method
:
'
POST
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
}
let
response
=
await
axios
.
post
(
options
.
uri
,
options
.
body
);
let
TotalRating
=
0
;
teacherReview
.
ratings
.
map
(
rate
=>
{
TotalRating
=
TotalRating
+
Number
(
rate
)
})
const
temp
=
{
"
teacher
"
:
teacherReview
.
teacher
,
"
tutor_name
"
:
teacherReview
.
tutor_name
,
"
tutor_nic
"
:
teacherReview
.
tutor_nic
,
"
tutor_email
"
:
teacherReview
.
tutor_email
,
"
tutor_phone
"
:
teacherReview
.
tutor_phone
,
"
tutor_address
"
:
teacherReview
.
tutor_address
,
"
tutor_password
"
:
teacherReview
.
tutor_password
,
"
tutor_gender
"
:
teacherReview
.
tutor_gender
,
"
tutor_status
"
:
teacherReview
.
tutor_status
,
"
tutor_image
"
:
teacherReview
.
tutor_image
,
"
tutor_Stream
"
:
teacherReview
.
tutor_Stream
,
"
tutor_subjects
"
:
teacherReview
.
tutor_subjects
,
"
tutor_class_type
"
:
teacherReview
.
tutor_class_type
,
"
tutor_main_district
"
:
teacherReview
.
tutor_main_district
,
"
tutor_main_city
"
:
teacherReview
.
tutor_main_city
,
"
tutor_medium
"
:
teacherReview
.
tutor_medium
,
"
tutor_qualification
"
:
teacherReview
.
tutor_qualification
,
"
tutor_reviewValue
"
:
response
.
data
.
result
,
"
tutor_avg_rating
"
:
Number
(
TotalRating
/
teacherReview
.
ratings
.
length
),
"
tutor_review_count
"
:
teacherReview
.
review
.
length
}
let
index
=
await
reviewListWithScore
.
findIndex
(
x
=>
x
.
teacher
===
teacherReview
.
teacher
);
if
(
index
===
-
1
)
{
reviewListWithScore
.
push
(
temp
);
}
console
.
log
(
response
.
data
.
result
);
}
else
{
const
temp
=
{
"
teacher
"
:
teacherReview
.
teacher
,
"
tutor_name
"
:
teacherReview
.
tutor_name
,
"
tutor_nic
"
:
teacherReview
.
tutor_nic
,
"
tutor_email
"
:
teacherReview
.
tutor_email
,
"
tutor_phone
"
:
teacherReview
.
tutor_phone
,
"
tutor_address
"
:
teacherReview
.
tutor_address
,
"
tutor_password
"
:
teacherReview
.
tutor_password
,
"
tutor_gender
"
:
teacherReview
.
tutor_gender
,
"
tutor_status
"
:
teacherReview
.
tutor_status
,
"
tutor_image
"
:
teacherReview
.
tutor_image
,
"
tutor_Stream
"
:
teacherReview
.
tutor_Stream
,
"
tutor_subjects
"
:
teacherReview
.
tutor_subjects
,
"
tutor_class_type
"
:
teacherReview
.
tutor_class_type
,
"
tutor_main_district
"
:
teacherReview
.
tutor_main_district
,
"
tutor_main_city
"
:
teacherReview
.
tutor_main_city
,
"
tutor_medium
"
:
teacherReview
.
tutor_medium
,
"
tutor_qualification
"
:
teacherReview
.
tutor_qualification
,
"
tutor_reviewValue
"
:
0
,
"
tutor_avg_rating
"
:
0
}
//reviewListWithScore.push(temp);
//reviewListWithScore.indexOf(temp) === -1 ? reviewListWithScore.push(temp) : null;
let
index
=
reviewListWithScore
.
findIndex
(
x
=>
x
.
teacher
===
teacherReview
.
teacher
);
if
(
index
===
-
1
)
{
reviewListWithScore
.
push
(
temp
);
}
}
if
(
idx
===
teacherReviewList
.
length
-
1
)
{
res
.
json
(
reviewListWithScore
)
// console.log(reviewListWithScore);
}
},
Promise
.
resolve
())
}
});
},
Promise
.
resolve
())
//console.log("Return from here");
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
});
module
.
exports
=
router
;
\ No newline at end of file
BackEnd/WebBackEnd/routes/student.route.js
View file @
13565272
...
...
@@ -89,68 +89,68 @@ router.route('/add').post( async(req,res) =>{
.
then
(
newUser
=>
{
////////////////////////////////////////////////////////////////////////////////////
//
const content = `
//
Hi ${student_name},\n
//
You are Create a Student Account on SmartCoach.\n
//
You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
//
Used your email address as the username : ${user_email}
//
Used given password as the password
//
Thank You,
//
Team SmartCoach
//
`;
//
//
var mail = {
//
from: student_name,
//
to: user_email,
//
subject: 'Email Verification - Student',
//
text: content
//
}
//
//
transporter.sendMail(mail, (err, data) => {
//
if (err) {
//
res.json({
//
msg: 'fail'
//
})
//
} else {
//
res.json({
//
msg: 'success'
//
})
//
}
//
})
//
;
//
//
//
const content_guardian = `
//
Hi ${guardian_name},\n
//
Your student ${student_name} is Create a Student Account on SmartCoach.\n
//
//
You can know student progress through the email.
//
We will send Student attendance, Quiz marks, Assignment Marks and other details through this email.
//
//
Thank You,
//
Team SmartCoach
//
`;
//
//
var mail_guardian = {
//
from: guardian_name,
//
to: guardian_email,
//
subject: 'Student Information on SmartCoach',
//
text: content_guardian
//
}
//
//
transporter.sendMail(mail_guardian, (err, data) => {
//
if (err) {
//
res.json({
//
msg: 'fail'
//
})
//
} else {
//
res.json({
//
msg: 'success'
//
})
//
}
//
})
//
;
const
content
=
`
Hi
${
student_name
}
,\n
You are Create a Student Account on SmartCoach.\n
You can verify your email address click on 'http://localhost:3000/AccountVerified/
${
newUser
.
id
}
'
Used your email address as the username :
${
user_email
}
Used given password as the password
Thank You,
Team SmartCoach
`
;
var
mail
=
{
from
:
student_name
,
to
:
user_email
,
subject
:
'
Email Verification - Student
'
,
text
:
content
}
transporter
.
sendMail
(
mail
,
(
err
,
data
)
=>
{
if
(
err
)
{
res
.
json
({
msg
:
'
fail
'
})
}
else
{
res
.
json
({
msg
:
'
success
'
})
}
})
;
const
content_guardian
=
`
Hi
${
guardian_name
}
,\n
Your student
${
student_name
}
is Create a Student Account on SmartCoach.\n
You can know student progress through the email.
We will send Student attendance, Quiz marks, Assignment Marks and other details through this email.
Thank You,
Team SmartCoach
`
;
var
mail_guardian
=
{
from
:
guardian_name
,
to
:
guardian_email
,
subject
:
'
Student Information on SmartCoach
'
,
text
:
content_guardian
}
transporter
.
sendMail
(
mail_guardian
,
(
err
,
data
)
=>
{
if
(
err
)
{
res
.
json
({
msg
:
'
fail
'
})
}
else
{
res
.
json
({
msg
:
'
success
'
})
}
})
;
/////////////////////////////////////////////////////////////////////////////////////
})
...
...
BackEnd/WebBackEnd/routes/studentALResult.route.js
View file @
13565272
...
...
@@ -13,6 +13,7 @@ router.route('/add').post(async(req,res) =>{
const
student_id
=
mongoose
.
Types
.
ObjectId
(
req
.
body
.
student_id
);
const
year
=
req
.
body
.
year
;
const
stream
=
req
.
body
.
stream
;
const
Subjects
=
req
.
body
.
Subjects
;
const
subject01
=
req
.
body
.
subject01
;
const
subject02
=
req
.
body
.
subject02
;
const
subject03
=
req
.
body
.
subject03
;
...
...
@@ -27,6 +28,7 @@ router.route('/add').post(async(req,res) =>{
student_id
,
year
,
stream
,
Subjects
,
subject01
,
subject02
,
subject03
,
...
...
@@ -49,7 +51,7 @@ router.route('/add').post(async(req,res) =>{
else
{
ALevelResults
.
findById
(
req
.
body
.
student_id
,
function
(
err
,
details
){
if
(
!
details
){
re
q
.
status
(
404
).
send
(
"
data is not found
"
);
re
s
.
status
(
404
).
send
(
"
data is not found
"
);
}
else
{
details
.
year
=
year
;
...
...
BackEnd/WebBackEnd/routes/tutor.route.js
View file @
13565272
...
...
@@ -30,31 +30,32 @@ transporter.verify((error, success) => {
router
.
route
(
'
/
'
).
get
((
req
,
res
)
=>
{
tutor
.
find
()
.
then
(
tutors
=>
res
.
json
(
tutors
))
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
router
.
route
(
'
/getFilteredList
'
).
post
((
req
,
res
)
=>
{
console
.
log
(
req
.
body
);
tutor
.
find
({
"
tutor_Stream
"
:
{
'
$regex
'
:
req
.
body
.
selectedStream
,
'
$options
'
:
'
i
'
},
"
tutor_subjects
"
:
{
'
$regex
'
:
req
.
body
.
selectedSubject
,
'
$options
'
:
'
i
'
},
"
tutor_main_district
"
:
{
'
$regex
'
:
req
.
body
.
selectedDistrict
,
'
$options
'
:
'
i
'
},
"
tutor_main_city
"
:
{
'
$regex
'
:
req
.
body
.
selectedCity
,
'
$options
'
:
'
i
'
},
"
tutor_medium
"
:
{
'
$regex
'
:
req
.
body
.
selectedLanguage
,
'
$options
'
:
'
i
'
},
"
tutor_class_type
"
:
{
'
$regex
'
:
req
.
body
.
selectedClassType
,
'
$options
'
:
'
i
'
},
})
.
then
(
tutors
=>
{
//
console.log(tutors);
console
.
log
(
tutors
);
res
.
json
(
tutors
)
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
router
.
route
(
'
/:id
'
).
get
(
function
(
req
,
res
)
{
let
id
=
req
.
params
.
id
;
//console.log("TutorId : " + id)
tutor
.
findById
(
id
).
populate
([
'
tutor_instituteIDList
'
]).
then
(
tutor
=>
{
///console.log(tutor);
res
.
json
(
tutor
);
}).
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
// router.route('/:id').get(function (req, res) {
// let id = req.params.id;
// console.log("TutorId : " + id)
// tutor.findById(id).populate("tutor_instituteIDList").then(tutor => {
// console.log(tutor);
// res.json(tutor);
// }).catch(err => res.status(400).json('Eroor: '+ err));
// });
router
.
route
(
'
/add
'
).
post
(
async
(
req
,
res
)
=>
{
console
.
log
(
"
Tutor Registration began
"
)
...
...
BackEnd/WebBackEnd/routes/tutorRatings.route.js
0 → 100644
View file @
13565272
const
router
=
require
(
'
express
'
).
Router
();
let
tutorRatingsRoute
=
require
(
'
../models/TutorRatingAndReviews.model
'
);
const
mongoose
=
require
(
"
mongoose
"
);
router
.
route
(
'
/add
'
).
post
(
async
(
req
,
res
)
=>
{
const
tutor_id
=
mongoose
.
Types
.
ObjectId
(
req
.
body
.
tutor_id
);
const
student_id
=
mongoose
.
Types
.
ObjectId
(
req
.
body
.
student_id
);
const
rating
=
req
.
body
.
rating
;
const
review
=
req
.
body
.
review
;
const
version
=
req
.
body
.
version
;
const
newTutorRating
=
new
tutorRatingsRoute
({
tutor_id
,
student_id
,
rating
,
review
,
version
,
});
newTutorRating
.
save
()
.
then
(
()
=>
{
res
.
json
(
'
New Review Added
'
);
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
});
module
.
exports
=
router
;
BackEnd/WebBackEnd/server.js
View file @
13565272
...
...
@@ -4,7 +4,7 @@ const bodyParser = require('body-parser');
const
mongoose
=
require
(
'
mongoose
'
);
require
(
'
dotenv
'
).
config
();
const
app
=
express
();
const
port
=
process
.
env
.
PORT
||
500
0
;
const
port
=
process
.
env
.
PORT
||
500
1
;
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
true
}));
...
...
@@ -29,6 +29,9 @@ const userAccount = require('./routes/userAccount.route');
const
questionManage
=
require
(
'
./routes/question.route
'
);
const
financeRouter
=
require
(
'
./routes/finance.route
'
);
const
studentResult
=
require
(
'
./routes/studentALResult.route
'
);
const
tutorRating
=
require
(
'
./routes/tutorRatings.route
'
);
const
filteredList
=
require
(
'
./routes/filteredListNew.route
'
);
const
createClassRoute
=
require
(
'
./routes/createClass.route
'
);
app
.
use
(
'
/studentSingUp
'
,
studentRouter
);
app
.
use
(
'
/tutorSingUp
'
,
tutorRouter
);
...
...
@@ -37,6 +40,9 @@ app.use('/userAccount',userAccount);
app
.
use
(
'
/questions
'
,
questionManage
);
app
.
use
(
'
/admin/finance
'
,
financeRouter
);
app
.
use
(
'
/studentResults
'
,
studentResult
);
app
.
use
(
'
/tutorRatings
'
,
tutorRating
);
app
.
use
(
'
/filteredList
'
,
filteredList
);
app
.
use
(
'
/createClass
'
,
createClassRoute
);
app
.
listen
(
port
,
()
=>
{
console
.
log
(
`Server is running on Port:
${
port
}
`
);
...
...
WebFrontEnd/smartcoach-frontend/package-lock.json
View file @
13565272
...
...
@@ -3660,6 +3660,11 @@
"resolved"
:
"https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.0.tgz"
,
"integrity"
:
"sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw=="
},
"bootstrap-icons"
:
{
"version"
:
"1.5.0"
,
"resolved"
:
"https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.5.0.tgz"
,
"integrity"
:
"sha512-44feMc7DE1Ccpsas/1wioN8ewFJNquvi5FewA06wLnqct7CwMdGDVy41ieHaacogzDqLfG8nADIvMNp9e4bfbA=="
},
"brace-expansion"
:
{
"version"
:
"1.1.11"
,
"resolved"
:
"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz"
,
...
...
@@ -10176,6 +10181,11 @@
"minimist"
:
"^1.2.5"
}
},
"moment"
:
{
"version"
:
"2.29.1"
,
"resolved"
:
"https://registry.npmjs.org/moment/-/moment-2.29.1.tgz"
,
"integrity"
:
"sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
},
"move-concurrently"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz"
,
...
...
@@ -12344,6 +12354,14 @@
"whatwg-fetch"
:
"^3.4.1"
}
},
"react-bootstrap-icons"
:
{
"version"
:
"1.5.0"
,
"resolved"
:
"https://registry.npmjs.org/react-bootstrap-icons/-/react-bootstrap-icons-1.5.0.tgz"
,
"integrity"
:
"sha512-QC5q4meHQG0cO9RJzeDLSqZ1gbVa9jxFCpONCE3GYl2FkbAKSyJAEsONlzTApbZ8/oG87gPWq0xAyn5SZ/Jafw=="
,
"requires"
:
{
"prop-types"
:
"^15.7.2"
}
},
"react-dev-utils"
:
{
"version"
:
"11.0.4"
,
"resolved"
:
"https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-11.0.4.tgz"
,
...
...
@@ -12473,6 +12491,11 @@
"resolved"
:
"https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.9.tgz"
,
"integrity"
:
"sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew=="
},
"react-icons"
:
{
"version"
:
"4.2.0"
,
"resolved"
:
"https://registry.npmjs.org/react-icons/-/react-icons-4.2.0.tgz"
,
"integrity"
:
"sha512-rmzEDFt+AVXRzD7zDE21gcxyBizD/3NqjbX6cmViAgdqfJ2UiLer8927/QhhrXQV7dEj/1EGuOTPp7JnLYVJKQ=="
},
"react-is"
:
{
"version"
:
"16.13.1"
,
"resolved"
:
"https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
,
...
...
WebFrontEnd/smartcoach-frontend/package.json
View file @
13565272
...
...
@@ -7,9 +7,13 @@
"@testing-library/react"
:
"^11.2.6"
,
"@testing-library/user-event"
:
"^12.8.3"
,
"bootstrap"
:
"^4.6.0"
,
"bootstrap-icons"
:
"^1.5.0"
,
"moment"
:
"^2.29.1"
,
"react"
:
"^17.0.2"
,
"react-bootstrap-icons"
:
"^1.5.0"
,
"react-dom"
:
"^17.0.2"
,
"react-dropdown"
:
"^1.9.2"
,
"react-icons"
:
"^4.2.0"
,
"react-router-dom"
:
"^5.2.0"
,
"react-scripts"
:
"4.0.3"
,
"react-select-search"
:
"^3.0.8"
,
...
...
WebFrontEnd/smartcoach-frontend/src/App.js
View file @
13565272
...
...
@@ -16,6 +16,7 @@ import QuestionDetails from "./Components/IT18050240/question_details"
import
QuestionLayout
from
"
./Components/IT18050240/question_layout
"
//import AdminQuestionManagement from "./Components/IT18050240/admin_question_management.js"
import
QuestionBank
from
"
./Components/IT18050240/question_bank
"
import
TutorProfileView
from
"
./Components/HomePage/TutorProfileView
"
;
function
App
()
{
return
(
...
...
@@ -27,6 +28,7 @@ function App() {
<
Route
path
=
"
/SignUp
"
exact
component
=
{
SignUp
}
/
>
<
Route
path
=
"
/beforeConfirm
"
exact
component
=
{
beforeConfirmation
}
/
>
<
Route
path
=
"
/AccountVerified/:id
"
exact
component
=
{
VerifiedAccount
}
/
>
<
Route
path
=
"
/Home/ViewProfile/:id
"
exact
component
=
{
TutorProfileView
}
/
>
{
/*<Route path="/studentDashboard" exact component={StudentDashboard}/>*/
}
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/Dashboard.js
View file @
13565272
...
...
@@ -6,6 +6,7 @@ import AddFinance from './add_financial_details';
import
ViewFinance
from
'
./view_financial_details
'
;
import
EditFinance
from
'
./edit_financial_details
'
;
import
AddClass
from
'
./add_class_details
'
;
import
studentRequest
from
'
./StudentRequestForClass
'
;
export
default
class
Dashboard
extends
Component
{
render
()
{
...
...
@@ -25,7 +26,7 @@ export default class Dashboard extends Component {
<
div
className
=
"
logo-src
"
/>
<
div
className
=
"
header__pane ml-auto
"
>
<
div
>
<
button
type
=
"
button
"
className
=
"
hamburger close-sidebar-btn hamburger--elastic
"
data
-
class
=
"
closed-sidebar
"
>
<
button
type
=
"
button
"
className
=
"
hamburger close-sidebar-btn hamburger--elastic
"
data
-
class
=
"
closed-sidebar
"
>
<
span
className
=
"
hamburger-box
"
>
<
span
className
=
"
hamburger-inner
"
/>
<
/span
>
...
...
@@ -343,6 +344,7 @@ export default class Dashboard extends Component {
{
/*</Link>*/
}
<
/li
>
<
li
>
<
a
href
=
"
#
"
>
<
i
className
=
"
metismenu-icon fa fa-calendar
"
><
/i
>
...
...
@@ -357,10 +359,10 @@ export default class Dashboard extends Component {
<
/NavLink
>
<
/li
>
<
li
>
<
a
href
=
"
#
"
>
<
NavLink
to
=
{
"
/admin/classes/studentRequests/
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
S
chedule
<
/
a
>
S
tudent
Requests
<
/
NavLink
>
<
/li
>
<
li
>
<
a
href
=
"
#
"
>
...
...
@@ -451,6 +453,7 @@ export default class Dashboard extends Component {
<
Route
path
=
"
/admin/finance/add
"
exact
component
=
{
AddFinance
}
/
>
<
Route
path
=
{
"
/admin/finance/edit/:id
"
}
exact
component
=
{
EditFinance
}
/
>
<
Route
path
=
"
/admin/classes/add
"
exact
component
=
{
AddClass
}
/
>
<
Route
path
=
"
/admin/classes/studentRequests
"
exact
component
=
{
studentRequest
}
/
>
<
/div
>
{
/* Footer */
}
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/StudentRequestForClass.js
0 → 100644
View file @
13565272
import
React
,
{
Component
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
"
../../Config/config
"
;
import
swal
from
"
sweetalert
"
;
import
*
as
Icon
from
"
react-bootstrap-icons
"
;
import
moment
from
"
moment
"
;
export
default
class
StudentRequestForClass
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
tutorID
:
'
6127b1d7ed4ff23bb0344538
'
,
instituteList
:
[],
ClassMethods
:
[],
subjectList
:
[],
selectedClassMethod
:
''
,
isSelectInstitute
:
false
,
HomeClassType
:
[
"
Group Class
"
,
"
Individual Class
"
],
OtherClassTypes
:
[
"
Group Class
"
,
"
Mass Class
"
,
"
Revision Class
"
,
"
Paper Class
"
,
"
Individual Class
"
],
ClassTypes
:[],
TutorClassList
:
[],
selectedClassType
:
''
,
selectedSubject
:
''
,
labelClassMethod
:
''
,
labelClassType
:
''
,
labelClassCreatedDate
:
''
,
labelClassStartingDate
:
''
,
labelSubject
:
''
,
labelClassFee
:
''
,
labelClassFeeOption
:
''
,
labelBatch
:
''
,
labelClassID
:
''
,
typedNIC
:
''
,
ClassStudentList
:[],
}
this
.
onChangeClassMethod
=
this
.
onChangeClassMethod
.
bind
(
this
);
this
.
onChangeClassTypeDropDown
=
this
.
onChangeClassTypeDropDown
.
bind
(
this
);
this
.
onChangeSubjectDropDown
=
this
.
onChangeSubjectDropDown
.
bind
(
this
);
this
.
onSelectOneClass
=
this
.
onSelectOneClass
.
bind
(
this
);
this
.
onChangeTypedNIC
=
this
.
onChangeTypedNIC
.
bind
(
this
);
this
.
onSubmitAddToClass
=
this
.
onSubmitAddToClass
.
bind
(
this
);
this
.
GetStudentList
=
this
.
GetStudentList
.
bind
(
this
);
}
componentDidMount
()
{
axios
.
get
(
configs
.
BASE_URL
+
'
/tutorSingUp/
'
+
this
.
state
.
tutorID
)
.
then
(
response
=>
{
console
.
log
(
response
.
data
);
//console.log(response.data);
this
.
setState
({
instituteList
:
response
.
data
.
tutor_instituteIDList
,
ClassMethods
:
response
.
data
.
tutor_class_type
,
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
},
()
=>
{
})
})
})
})
}
GetStudentList
(){
axios
.
get
(
configs
.
BASE_URL
+
'
/createClass/studentList/
'
+
this
.
state
.
labelClassID
)
.
then
(
response
=>
{
console
.
log
(
response
.
data
);
this
.
setState
({
ClassStudentList
:
response
.
data
},
()
=>
{
console
.
log
(
this
.
state
.
ClassStudentList
);
})
})
}
onSubmitAddToClass
(){
if
(
this
.
state
.
labelClassID
!==
""
){
const
payload
=
{
_id
:
this
.
state
.
labelClassID
,
student_nic
:
this
.
state
.
typedNIC
}
axios
.
post
(
configs
.
BASE_URL
+
'
/createClass/studentList/update
'
,
payload
)
.
then
(
res
=>
{
console
.
log
(
res
)
swal
(
"
success!!!
"
,
res
.
data
,
"
success
"
).
then
(()
=>
{
//e.target.reset();
//window.location.reload();
this
.
GetStudentList
();
});
})
.
catch
(
function
(
error
)
{
if
(
error
.
response
)
{
// The request was made and the server responded with a status code
// that falls out of the range of 2xx
//console.log(error.response.data);
//console.log(error.response.status);
//console.log(error.response.headers);
if
(
error
.
response
.
status
===
500
){
swal
(
"
Sorry!!!
"
,
"
This Student Not Registered
"
,
"
warning
"
).
then
(()
=>
{
//e.target.reset();
//window.location.reload();
});
}
}
else
if
(
error
.
request
)
{
// The request was made but no response was received
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
// http.ClientRequest in node.js
// console.log(error.request);
}
else
{
// Something happened in setting up the request that triggered an Error
//console.log('Error', error.message);
}
//console.log(error.config);
});
}
else
{
swal
(
"
Ops!!!
"
,
"
Please Select a class first
"
,
"
warning
"
);
}
}
onChangeTypedNIC
(
e
){
this
.
setState
({
typedNIC
:
e
.
target
.
value
})
}
onSelectOneClass
(
e
){
//console.log("E : " + e.target);
console
.
log
(
e
.
target
.
value
);
this
.
state
.
TutorClassList
.
map
((
selectedClass
)
=>
{
if
(
selectedClass
.
_id
===
e
.
target
.
value
){
console
.
log
(
"
crated date:
"
+
selectedClass
.
createdAt
)
this
.
setState
({
labelClassMethod
:
selectedClass
.
class_method
,
labelClassType
:
selectedClass
.
class_type
,
labelClassCreatedDate
:
selectedClass
.
createdAt
,
labelClassStartingDate
:
selectedClass
.
class_startingDate
,
labelSubject
:
selectedClass
.
subject
,
labelClassFee
:
selectedClass
.
class_fee
,
labelBatch
:
selectedClass
.
batch_no
,
labelClassFeeOption
:
selectedClass
.
class_fee_option
,
labelClassID
:
selectedClass
.
_id
},()
=>
{
this
.
GetStudentList
();
})
}
})
}
onChangeClassMethod
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
.
target
.
value
);
this
.
setState
({
selectedClassMethod
:
e
.
target
.
value
},()
=>
{
if
(
e
.
target
.
value
===
"
Institute
"
){
this
.
setState
({
isSelectInstitute
:
true
,
ClassTypes
:
this
.
state
.
OtherClassTypes
})
}
else
{
if
(
e
.
target
.
value
===
"
Home Visit
"
){
this
.
setState
({
isSelectInstitute
:
false
,
ClassTypes
:
this
.
state
.
HomeClassType
})
}
else
{
this
.
setState
({
isSelectInstitute
:
false
,
ClassTypes
:
this
.
state
.
OtherClassTypes
})
}
}
})
}
onChangeClassTypeDropDown
(
e
)
{
this
.
setState
({
selectedClassType
:
e
})
}
onChangeSubjectDropDown
(
e
)
{
this
.
setState
({
selectedSubject
:
e
})
}
render
()
{
return
(
<
div
>
<
div
className
=
"
app-page-title
"
>
<
div
className
=
"
page-title-wrapper
"
>
<
div
className
=
"
page-title-heading
"
>
<
div
className
=
"
page-title-icon
"
>
<
i
className
=
"
pe-7s-display1 fa fa-reddit-square
"
><
/i
>
<
/div
>
<
div
>
Student
Request
to
Classes
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
main-card mb card
"
>
<
div
className
=
"
card-body
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
scroll-area
"
style
=
{{
width
:
'
100%
'
,
margin
:
'
20px
'
}}
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
style
=
{{
width
:
'
30%
'
,
paddingLeft
:
'
15px
'
,
paddingBottom
:
'
10px
'
}}
>
<
input
type
=
"
text
"
placeholder
=
"
Search
"
className
=
"
form-control
"
style
=
{{
width
:
'
30%
'
}}
/
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
select
name
=
"
select
"
className
=
"
form-control
"
style
=
{{
width
:
'
100%
'
}}
onChange
=
{
e
=>
this
.
onChangeClassMethod
(
e
)}
>
<
option
value
=
"
0
"
selected
>
Class
Method
<
/option
>
{
this
.
state
.
ClassMethods
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
<
div
className
=
"
col
"
>
<
select
name
=
"
select
"
className
=
"
form-control
"
style
=
{{
width
:
'
100%
'
}}
onChange
=
{
e
=>
this
.
onChangeClassTypeDropDown
(
e
.
target
.
value
)}
>
<
option
value
=
"
0
"
selected
>
Class
Type
<
/option
>
{
this
.
state
.
ClassTypes
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
<
div
className
=
"
col
"
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeSubjectDropDown
(
e
.
target
.
value
)}
>
<
option
value
=
"
0
"
selected
>
Subject
<
/option
>
{
this
.
state
.
subjectList
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
<
div
className
=
"
col
"
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeSubjectDropDown
(
e
.
target
.
value
)}
>
<
option
value
=
"
0
"
selected
>
Status
<
/option
>
<
option
value
=
""
>
Active
<
/option
>
<
option
value
=
""
>
Deactivate
<
/option
>
<
/select
>
<
/div
>
<
div
className
=
"
col
"
>
<
button
className
=
"
form-control
"
style
=
{{
background
:
"
#086232
"
,
color
:
"
white
"
}}
onClick
=
{
this
.
FindTutor
}
><
b
>
Search
<
/b></
button
>
<
/div
>
<
/div
>
<
div
className
=
""
style
=
{{
marginTop
:
'
15px
'
}}
>
<
div
className
=
"
table-dark row
"
>
<
div
className
=
"
col-md-4
"
style
=
{{
textAlign
:
'
left
'
,
paddingLeft
:
'
30px
'
}}
>
<
label
>
Batch
Name
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Starting
Date
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Subject
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Class
Method
/
Type
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
/div
>
{
/*<div className="col">*/
}
{
/* <div className="row">*/
}
{
/* <div className="col"><label>Edit /</label></div>*/
}
{
/* <div className="col"><label>Delete</label></div>*/
}
{
/* </div>*/
}
{
/*</div>*/
}
<
/div
>
{
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
'
}}
>
<
label
style
=
{{
marginLeft
:
'
20px
'
}}
>
{
oneClass
.
batch_no
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
moment
(
oneClass
.
class_startingDate
).
format
(
"
L
"
)
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
oneClass
.
subject
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
oneClass
.
class_method
+
"
-
"
+
oneClass
.
class_type
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
button
className
=
"
rounded
"
style
=
{{
background
:
'
Orange
'
,
padding
:
'
3px
'
,
width
:
'
35px
'
}}
value
=
{
oneClass
.
_id
}
onClick
=
{
e
=>
this
.
onSelectOneClass
(
e
)}
>+<
/button
>
<
/div
>
{
/*<div className="col">*/
}
{
/* <div className="row">*/
}
{
/* <div className="col">*/
}
{
/* <button className="rounded" style={{background:'Orange', padding:'3px', width:'35px'}}><Icon.Pencil color="white" size={20}/></button>*/
}
{
/* </div>*/
}
{
/* <div className="col">*/
}
{
/* <button className="rounded" style={{background:'#8D2828', padding:'3px', width:'35px'}}><Icon.Eraser color="white" size={20}/></button>*/
}
{
/* </div>*/
}
{
/* </div>*/
}
{
/*</div>*/
}
<
/div
>
)
})}
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
b
><
label
style
=
{{
float
:
'
left
'
}}
>
Class
method
<
/label></
b
>
<
label
style
=
{{
float
:
'
right
'
,
paddingRight
:
'
10px
'
}}
>
:
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
float
:
'
left
'
}}
>
{
this
.
state
.
labelClassMethod
}
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
b
><
label
style
=
{{
float
:
'
left
'
}}
>
Class
type
<
/label></
b
>
<
label
style
=
{{
float
:
'
right
'
,
paddingRight
:
'
10px
'
}}
>
:
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
float
:
'
left
'
}}
>
{
this
.
state
.
labelClassType
}
<
/label
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
b
><
label
style
=
{{
float
:
'
left
'
}}
>
Class
created
date
<
/label></
b
>
<
label
style
=
{{
float
:
'
right
'
,
paddingRight
:
'
10px
'
}}
>
:
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
float
:
'
left
'
}}
>
{
moment
(
this
.
state
.
labelClassCreatedDate
).
format
(
"
L
"
)
}
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
b
><
label
style
=
{{
float
:
'
left
'
}}
>
Class
starting
date
<
/label></
b
>
<
label
style
=
{{
float
:
'
right
'
,
paddingRight
:
'
10px
'
}}
>
:
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
float
:
'
left
'
}}
>
{
moment
(
this
.
state
.
labelClassStartingDate
).
format
(
"
L
"
)}
<
/label
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
b
><
label
style
=
{{
float
:
'
left
'
}}
>
Subject
<
/label></
b
>
<
label
style
=
{{
float
:
'
right
'
,
paddingRight
:
'
10px
'
}}
>
:
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
float
:
'
left
'
}}
>
{
this
.
state
.
labelSubject
}
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
b
><
label
style
=
{{
float
:
'
left
'
}}
>
Class
fee
<
/label></
b
>
<
label
style
=
{{
float
:
'
right
'
,
paddingRight
:
'
10px
'
}}
>
:
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
float
:
'
left
'
}}
>
Rs
.{
this
.
state
.
labelClassFee
+
"
"
}{
this
.
state
.
labelClassFeeOption
}
<
/label
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
b
><
label
style
=
{{
float
:
'
left
'
}}
>
Batch
<
/label></
b
>
<
label
style
=
{{
float
:
'
right
'
,
paddingRight
:
'
10px
'
}}
>
:
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
float
:
'
left
'
}}
>
{
this
.
state
.
labelBatch
}
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
style
=
{{
margin
:
'
20px
'
}}
>
<
div
className
=
"
row
"
>
<
h5
>
Student
List
<
/h5
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-
"
>
<
label
style
=
{{
float
:
'
left
'
}}
>
Student
NIC
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
input
type
=
"
text
"
placeholder
=
"
NIC
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeTypedNIC
}
style
=
{{
width
:
'
100%
'
}}
/
>
<
/div
>
<
div
className
=
"
col
"
>
<
button
className
=
"
form-control
"
style
=
{{
background
:
"
#216E9B
"
,
color
:
"
white
"
,
width
:
'
60%
'
}}
onClick
=
{
this
.
onSubmitAddToClass
}
><
b
>
Add
to
Class
<
/b></
button
>
<
/div
>
<
/div
>
<
div
className
=
""
style
=
{{
marginTop
:
'
10px
'
}}
>
<
div
className
=
"
table-dark row
"
>
<
div
className
=
"
col
"
style
=
{{
textAlign
:
'
left
'
}}
>
<
label
>
Student
NIC
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Student
Name
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
input
type
=
"
text
"
placeholder
=
"
Search from NIC
"
className
=
"
form-control
"
style
=
{{
width
:
'
100%
'
,
margin
:
'
3px
'
}}
/
>
<
/div
>
<
/div
>
{
this
.
state
.
ClassStudentList
.
map
((
student
)
=>
{
return
(
<
div
className
=
"
row
"
style
=
{{
background
:
'
#DCDCDC
'
,
paddingBottom
:
'
5px
'
,
paddingTop
:
'
5px
'
,
borderBottom
:
'
inset
'
}}
>
<
div
className
=
"
col-md-4
"
style
=
{{
textAlign
:
'
left
'
}}
>
<
label
>
{
student
.
student_id
.
student_nic
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
student
.
student_id
.
student_name
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
button
className
=
"
rounded
"
style
=
{{
background
:
'
#8D2828
'
,
padding
:
'
3px
'
,
width
:
'
50%
'
,
color
:
'
white
'
}}
>
Remove
<
/button
>
<
/div
>
<
/div
>
)
})}
<
/div
>
<
/div
>
<
div
className
=
"
col
"
style
=
{{
margin
:
'
20px
'
}}
>
<
div
className
=
"
row
"
>
<
h5
>
Students
requests
<
/h5
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-
"
>
<
label
style
=
{{
float
:
'
left
'
}}
>
All
Student
Requests
to
selected
Class
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
""
style
=
{{
marginTop
:
'
10px
'
}}
>
<
div
className
=
"
table-dark row
"
>
<
div
className
=
"
col
"
>
<
label
>
Student
NIC
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Student
Name
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
background
:
'
#DCDCDC
'
,
paddingBottom
:
'
5px
'
,
paddingTop
:
'
5px
'
,
borderBottom
:
'
inset
'
}}
>
<
div
className
=
"
col-md-4
"
style
=
{{
textAlign
:
'
left
'
}}
>
<
label
><
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
><
/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
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
}
}
\ No newline at end of file
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
View file @
13565272
import
React
,
{
Component
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
SelectSearch
,
{
fuzzySearch
}
from
'
react-select-search
'
;
import
*
as
configs
from
"
../../Config/config
"
;
import
swal
from
"
sweetalert
"
;
import
*
as
Icon
from
"
react-bootstrap-icons
"
;
import
moment
from
'
moment
'
const
options
=
[
{
name
:
'
Hasitha
'
,
value
:
'
1
'
},
{
name
:
'
Devinda
'
,
value
:
'
2
'
},
{
name
:
'
Hansaka
'
,
value
:
'
3
'
},
{
name
:
'
Gihan
'
,
value
:
'
4
'
},
];
export
default
class
AddClassDetails
extends
Component
{
export
default
class
AddClassDetails
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
instituteList
:
[
'
Sakya Nugegoda
'
,
'
Montana Kiribathgoda
'
,
'
Wasiti Kiribathgoda
'
]
tutorID
:
'
6127b1d7ed4ff23bb0344538
'
,
instituteList
:
[],
ClassMethods
:
[],
subjectList
:
[],
selectedClassMethod
:
''
,
isSelectInstitute
:
false
,
HomeClassType
:
[
"
Group Class
"
,
"
Individual Class
"
],
OtherClassTypes
:
[
"
Group Class
"
,
"
Mass Class
"
,
"
Revision Class
"
,
"
Paper Class
"
,
"
Individual Class
"
],
ClassTypes
:
[],
selectedClassType
:
''
,
selectedInstitute
:
''
,
batchName
:
''
,
batchYear
:
''
,
classStartingDate
:
Date
,
selectedSubject
:
''
,
ClassFee
:
''
,
isActiveClass
:
false
,
isActiveForStudent
:
false
,
TutorClassList
:
[],
classFeeOptions
:
[
"
Per hour
"
,
"
Per Day
"
,
"
Per Month
"
],
selectedClassFeeOption
:
''
,
days
:
[
"
Monday
"
,
"
TuesDay
"
,
"
Wednesday
"
,
"
Thursday
"
,
"
Friday
"
,
"
Saturday
"
,
"
Sunday
"
],
selectedDay
:
''
,
HoursTime
:
''
,
AdmissionFee
:
''
,
}
this
.
onChangeClassMethod
=
this
.
onChangeClassMethod
.
bind
(
this
);
this
.
onChangeClassTypeDropDown
=
this
.
onChangeClassTypeDropDown
.
bind
(
this
);
this
.
onChangeInstituteDropDown
=
this
.
onChangeInstituteDropDown
.
bind
(
this
);
this
.
onChangeBatchName
=
this
.
onChangeBatchName
.
bind
(
this
);
this
.
onChangeClassStartingDate
=
this
.
onChangeClassStartingDate
.
bind
(
this
);
this
.
onChangeSubjectDropDown
=
this
.
onChangeSubjectDropDown
.
bind
(
this
);
this
.
onChangeClassFee
=
this
.
onChangeClassFee
.
bind
(
this
);
this
.
onChangeIsActiveClass
=
this
.
onChangeIsActiveClass
.
bind
(
this
);
this
.
onChangeIsActiveForStudent
=
this
.
onChangeIsActiveForStudent
.
bind
(
this
);
this
.
onSubmitCreateClass
=
this
.
onSubmitCreateClass
.
bind
(
this
);
this
.
onChangeClassFeeOptions
=
this
.
onChangeClassFeeOptions
.
bind
(
this
);
this
.
onChangeBatchYear
=
this
.
onChangeBatchYear
.
bind
(
this
);
this
.
onChangeDay
=
this
.
onChangeDay
.
bind
(
this
);
this
.
onChangeHours
=
this
.
onChangeHours
.
bind
(
this
);
this
.
onChangeAdmissionFee
=
this
.
onChangeAdmissionFee
.
bind
(
this
);
}
// this.onChangeInstituteDropDown = this.onChangeInstituteDropDown.bind(this);
componentDidMount
()
{
axios
.
get
(
configs
.
BASE_URL
+
'
/instituteSingUp/
'
)
.
then
(
response
=>
{
if
(
response
.
data
.
length
>
0
){
console
.
log
(
response
.
data
);
axios
.
get
(
configs
.
BASE_URL
+
'
/tutorSingUp/
'
+
this
.
state
.
tutorID
)
.
then
(
response
=>
{
console
.
log
(
response
.
data
);
//console.log(response.data);
this
.
setState
({
instituteList
:
response
.
data
.
tutor_instituteIDList
,
ClassMethods
:
response
.
data
.
tutor_class_type
,
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
},
()
=>
{
})
})
})
})
}
onChangeAdmissionFee
(
e
)
{
this
.
setState
({
AdmissionFee
:
e
.
target
.
value
})
}
onChangeHours
(
e
)
{
this
.
setState
({
HoursTime
:
e
.
target
.
value
})
}
onChangeDay
(
e
)
{
this
.
setState
({
selectedDay
:
e
})
}
onChangeClassFeeOptions
(
e
)
{
this
.
setState
({
selectedClassFeeOption
:
e
})
}
onChangeInstituteDropDown
(
e
)
{
this
.
setState
({
selectedInstitute
:
e
.
target
.
value
})
}
onChangeClassTypeDropDown
(
e
)
{
this
.
setState
({
selectedClassType
:
e
})
}
onChangeBatchName
(
e
)
{
this
.
setState
({
batchName
:
e
.
target
.
value
})
}
onChangeBatchYear
(
e
)
{
this
.
setState
({
batchYear
:
e
.
target
.
value
})
}
onChangeClassStartingDate
(
e
)
{
this
.
setState
({
classStartingDate
:
e
.
target
.
value
})
}
onChangeSubjectDropDown
(
e
)
{
this
.
setState
({
selectedSubject
:
e
})
}
onChangeClassFee
(
e
)
{
this
.
setState
({
ClassFee
:
e
.
target
.
value
})
}
onChangeIsActiveClass
(
e
)
{
if
(
this
.
state
.
isActiveClass
)
{
this
.
setState
({
isActiveClass
:
false
})
}
else
{
this
.
setState
({
isActiveClass
:
true
})
}
}
onChangeIsActiveForStudent
(
e
)
{
if
(
this
.
state
.
isActiveForStudent
)
{
this
.
setState
({
isActiveForStudent
:
false
})
}
else
{
this
.
setState
({
isActiveForStudent
:
true
})
}
}
onChangeClassMethod
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
.
target
.
value
);
this
.
setState
({
selectedClassMethod
:
e
.
target
.
value
},
()
=>
{
if
(
e
.
target
.
value
===
"
Institute
"
)
{
this
.
setState
({
isSelectInstitute
:
true
,
ClassTypes
:
this
.
state
.
OtherClassTypes
})
}
else
{
if
(
e
.
target
.
value
===
"
Home Visit
"
)
{
this
.
setState
({
instituteList
:
response
.
data
isSelectInstitute
:
false
,
ClassTypes
:
this
.
state
.
HomeClassType
})
}
else
{
this
.
setState
({
isSelectInstitute
:
false
,
ClassTypes
:
this
.
state
.
OtherClassTypes
})
}
})
}
})
}
onChangeInstituteDropDown
(
value
)
{
this
.
setState
({
newInstitute
:
value
.
target
.
value
onSubmitCreateClass
=
e
=>
{
e
.
preventDefault
();
let
instituteID
=
''
;
this
.
state
.
instituteList
.
map
(
name
=>
{
if
(
this
.
state
.
selectedInstitute
===
name
.
institute_name
)
{
instituteID
=
name
.
_id
;
}
})
const
newClass
=
{
tutor_id
:
this
.
state
.
tutorID
,
class_method
:
this
.
state
.
selectedClassMethod
,
class_type
:
this
.
state
.
selectedClassType
,
institute_id
:
instituteID
,
batch_no
:
this
.
state
.
batchName
,
class_startingDate
:
this
.
state
.
classStartingDate
,
subject
:
this
.
state
.
selectedSubject
,
class_fee
:
this
.
state
.
ClassFee
,
class_fee_option
:
this
.
state
.
selectedClassFeeOption
,
isActiveClass
:
this
.
state
.
isActiveClass
,
isActiveForStudent
:
this
.
state
.
isActiveForStudent
,
class_conduct_day
:
this
.
state
.
selectedDay
,
class_conduct_time
:
this
.
state
.
HoursTime
,
AdmissionFee
:
this
.
state
.
AdmissionFee
,
batchYear
:
this
.
state
.
batchYear
}
axios
.
post
(
configs
.
BASE_URL
+
'
/createClass/add
'
,
newClass
)
.
then
(
res
=>
{
console
.
log
(
res
)
swal
(
"
success!!!
"
,
res
.
data
,
"
success
"
).
then
(()
=>
{
// e.target.reset();
//window.location();
});
//window.location.reload();
})
}
render
()
{
return
(
return
(
<
div
>
<
div
className
=
"
app-page-title
"
>
...
...
@@ -61,74 +271,331 @@ export default class AddClassDetails extends Component{
<
form
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-md-
6
"
>
<
div
className
=
"
col-md-
4
"
>
<
div
className
=
"
card-body
"
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Class
Type
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
>
<
option
>
Select
Class
Type
<
/option
>
<
option
>
Mass
Class
<
/option
>
<
option
>
Revision
Class
<
/option
>
<
option
>
Group
Class
<
/option
>
<
option
>
Individual
Class
<
/option
>
<
label
>
Class
Method
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeClassMethod
(
e
)}
>
<
option
value
=
""
disabled
selected
>
Select
Class
Method
<
/option
>
{
this
.
state
.
ClassMethods
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Institute
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
>
onChange
=
{
e
=>
this
.
onChangeInstituteDropDown
(
e
)}
<
option
value
=
""
disabled
selected
>
Select
Institute
<
/option
>
<
label
>
Class
Type
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeClassTypeDropDown
(
e
.
target
.
value
)}
>
<
option
value
=
""
disabled
selected
>
Select
Class
Type
<
/option
>
{
this
.
state
.
ClassTypes
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
{
this
.
state
.
isSelectInstitute
===
true
?
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Institute
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeInstituteDropDown
(
e
)}
>
<
option
value
=
""
disabled
selected
>
Select
the
Institute
<
/option
>
{
this
.
state
.
instituteList
.
map
((
dis
)
=>
<
option
key
=
{
dis
.
_id
}
id
=
{
dis
.
_id
}
value
=
{
dis
.
institute_name
}
>
{
dis
.
institute_name
}
<
option
value
=
{
dis
.
institute_name
}
>
{
dis
.
institute_name
}
<
/option>
)
}
<
/select
>
<
/div
>
:
<
div
><
/div>
}
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Batch
Name
&
Year
<
/label
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
input
type
=
"
text
"
placeholder
=
"
Batch Name
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeBatchName
}
/
>
<
/div
>
<
div
className
=
"
col
"
>
<
input
type
=
"
Number
"
placeholder
=
"
Year
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeBatchYear
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Subject
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeSubjectDropDown
(
e
.
target
.
value
)}
>
<
option
value
=
""
disabled
selected
>
Select
the
Subject
<
/option
>
{
this
.
state
.
subjectList
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
{
/*<option>Select Institute</option>*/
}
{
/*<option>Sakya Nugegoda</option>*/
}
{
/*<option>Minasko Malabe</option>*/
}
{
/*<option>Rotary Nugegoda</option>*/
}
{
/*<option>Sasip Nugegoda</option>*/
}
<
/select
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Batch
Number
<
/label
>
<
input
type
=
"
text
"
className
=
"
form-control
"
/>
<
label
>
Class
Starting
Date
<
/label
>
<
input
type
=
"
date
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeClassStartingDate
}
/
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Year
<
/label
>
<
input
type
=
"
month
"
className
=
"
form-control
"
/>
<
label
>
Class
Conduct
Day
and
Time
<
/label
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeDay
(
e
.
target
.
value
)}
>
<
option
value
=
""
disabled
selected
>
Select
the
Day
<
/option
>
{
this
.
state
.
days
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
<
div
className
=
"
col
"
>
<
input
type
=
"
text
"
placeholder
=
"
7.00 PM - 9.00 PM
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeHours
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Subject
<
/label
>
<
select
name
=
"
select
"
className
=
"
form-control
"
>
<
option
>
Select
Subject
<
/option
>
<
option
><
/option
>
<
option
><
/option
>
<
option
><
/option
>
<
option
><
/option
>
<
/select
>
<
label
>
Class
Fee
(
Rs
.)
<
/label
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
input
type
=
"
text
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeClassFee
}
/
>
<
/div
>
<
div
className
=
"
col
"
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeClassFeeOptions
(
e
.
target
.
value
)}
>
<
option
value
=
""
disabled
selected
>
Select
Options
<
/option
>
{
this
.
state
.
classFeeOptions
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
label
>
Admission
Fee
<
/label
>
<
div
className
=
"
col
"
>
<
input
type
=
"
text
"
placeholder
=
"
Admission Fee
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeAdmissionFee
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
input
type
=
"
checkbox
"
id
=
"
onlineClass
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeIsActiveClass
}
defaultChecked
=
{
this
.
state
.
isActiveClass
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
float
:
'
left
'
,
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
}}
>
Active
Class
<
/label
>
<
input
type
=
"
checkbox
"
id
=
"
onlineClass
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeIsActiveForStudent
}
defaultChecked
=
{
this
.
state
.
isActiveForStudent
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
float
:
'
left
'
,
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
}}
>
Active
for
Students
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
button
className
=
"
form-control
"
style
=
{{
background
:
"
#216E9B
"
,
color
:
"
white
"
,
margin
:
'
50px
'
,
width
:
'
50%
'
}}
onClick
=
{
this
.
onSubmitCreateClass
}
><
b
>
Create
Class
<
/b></
button
>
<
/div
>
<
/div
>
<
div
className
=
"
col-md-
6
"
>
<
div
className
=
"
col-md-
8
"
>
<
div
className
=
"
card-body
"
>
<
div
className
=
"
position-relative form-group
"
>
<
label
htmlFor
=
"
exampleEmail
"
className
>
Students
<
/label
>
<
SelectSearch
options
=
{
options
}
multiple
search
filterOptions
=
{
fuzzySearch
}
placeholder
=
"
Select students
"
/>
<
label
><
h5
>
Classes
<
/h5></
label
>
<
/div
>
<
div
className
=
"
card-border
"
style
=
{{
background
:
'
lightgray
'
,
padding
:
'
15px
'
}}
>
<
div
className
=
"
row
"
>
<
h5
style
=
{{
marginLeft
:
'
10px
'
}}
>
Filters
<
/h5
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
select
name
=
"
select
"
className
=
"
form-control
"
style
=
{{
width
:
'
100%
'
}}
onChange
=
{
e
=>
this
.
onChangeClassMethod
(
e
)}
>
<
option
value
=
""
disabled
selected
>
Class
Method
<
/option
>
{
this
.
state
.
ClassMethods
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
<
div
className
=
"
col
"
>
<
select
name
=
"
select
"
className
=
"
form-control
"
style
=
{{
width
:
'
100%
'
}}
onChange
=
{
e
=>
this
.
onChangeClassTypeDropDown
(
e
.
target
.
value
)}
>
<
option
value
=
""
disabled
selected
>
Class
Type
<
/option
>
{
this
.
state
.
ClassTypes
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
<
div
className
=
"
col
"
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeSubjectDropDown
(
e
.
target
.
value
)}
>
<
option
value
=
""
disabled
selected
>
Subject
<
/option
>
{
this
.
state
.
subjectList
.
map
((
dis
)
=>
<
option
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
<
/select
>
<
/div
>
<
div
className
=
"
col
"
>
<
select
name
=
"
select
"
className
=
"
form-control
"
onChange
=
{
e
=>
this
.
onChangeSubjectDropDown
(
e
.
target
.
value
)}
>
<
option
value
=
""
disabled
selected
>
Status
<
/option
>
<
option
value
=
""
>
Active
Class
<
/option
>
<
option
value
=
""
>
Active
For
Students
<
/option
>
<
/select
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
10px
'
}}
>
<
div
className
=
"
col-6
"
>
<
input
type
=
"
text
"
placeholder
=
"
Search
"
className
=
"
form-control
"
/>
<
/div
>
<
div
className
=
"
col
"
>
<
button
className
=
"
form-control
"
style
=
{{
background
:
"
#8D4433
"
,
color
:
"
white
"
}}
onClick
=
{
this
.
ResetFilters
}
><
b
>
Reset
<
/b></
button
>
<
/div
>
<
div
className
=
"
col
"
>
<
button
className
=
"
form-control
"
style
=
{{
background
:
"
#086232
"
,
color
:
"
white
"
}}
onClick
=
{
this
.
FindTutor
}
><
b
>
Search
<
/b></
button
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
container
"
style
=
{{
marginTop
:
'
15px
'
}}
>
<
div
className
=
"
table-dark row
"
>
<
div
className
=
"
col-md-4
"
style
=
{{
textAlign
:
'
left
'
}}
>
<
label
>
Batch
Name
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Starting
Date
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Subject
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
Class
Method
/
Type
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
><
label
>
Edit
/<
/label></
div
>
<
div
className
=
"
col
"
><
label
>
Delete
<
/label></
div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
scroll-area-lg
"
style
=
{{
marginLeft
:
'
-15px
'
,
marginRight
:
'
-15px
'
}}
>
{
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
'
,
marginLeft
:
'
10px
'
}}
>
<
label
style
=
{{}}
>
{
oneClass
.
batch_no
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
moment
(
oneClass
.
class_startingDate
).
format
(
"
L
"
)}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
oneClass
.
subject
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
label
>
{
oneClass
.
class_method
+
"
-
"
+
oneClass
.
class_type
}
<
/label
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
button
className
=
"
rounded
"
style
=
{{
background
:
'
Orange
'
,
padding
:
'
3px
'
,
width
:
'
35px
'
}}
><
Icon
.
Pencil
color
=
"
white
"
size
=
{
20
}
/
>
<
/button
>
<
/div
>
<
div
className
=
"
col
"
>
<
button
className
=
"
rounded
"
style
=
{{
background
:
'
#8D2828
'
,
padding
:
'
3px
'
,
width
:
'
35px
'
}}
><
Icon
.
Eraser
color
=
"
white
"
size
=
{
20
}
/
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)
})}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
position-relative row form-group
"
>
<
div
className
=
"
col-sm-12
"
>
<
button
className
=
"
btn btn-primary
"
style
=
{{
width
:
"
150px
"
}}
type
=
"
submit
"
>
Create
Class
<
/button
>
<
/div
>
{
/*<div className="col-sm-12">*/
}
{
/* <button className="btn btn-primary" style={{width:"150px"}} onClick={this.onSubmitCreateClass}>Create Class</button>*/
}
{
/*</div>*/
}
<
/div
>
<
/form
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
View file @
13565272
import
React
,
{
Component
}
from
"
react
"
;
import
Dropdown
from
'
react-dropdown
'
;
import
StarRatingComponent
from
'
react-star-rating-component
'
;
import
'
react-dropdown/style.css
'
;
import
MianImage
from
"
../Images/mainimage2.jpg
"
;
import
RecommendIcon
from
"
../Images/recomended.png
"
;
...
...
@@ -12,9 +10,11 @@ import Location from "../Images/location.png";
import
Star
from
"
../Images/star.png
"
;
import
ReviewImg
from
"
../Images/note.png
"
;
import
Calender
from
"
../Images/calender.png
"
;
import
*
as
Icon
from
'
react-bootstrap-icons
'
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
"
../Config/config
"
;
import
TutorCard
from
"
./HomePage/TutorCard
"
;
import
swal
from
"
sweetalert
"
;
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
...
...
@@ -43,7 +43,18 @@ export default class Home extends Component{
selectedClassType
:
''
,
selectedLanguage
:
''
,
TutorFilteredList
:
[],
TutorFilteredListFinal
:
[],
RVPastResults
:
25
,
RVRatings
:
25
,
RVReviews
:
25
,
RVStudentCount
:
25
,
isRVPastResults
:
true
,
isRVRatings
:
true
,
isRVReviews
:
true
,
isStudentCount
:
true
,
TotalRecommendationCount
:
0
,
passResultsSubCategory
:
2
,
isClickFilterArrow
:
false
,
};
this
.
FindCities
=
this
.
FindCities
.
bind
(
this
);
...
...
@@ -55,6 +66,19 @@ export default class Home extends Component{
this
.
OnChangeCity
=
this
.
OnChangeCity
.
bind
(
this
);
this
.
OnChangeClassType
=
this
.
OnChangeClassType
.
bind
(
this
);
this
.
OnChangeLanguage
=
this
.
OnChangeLanguage
.
bind
(
this
);
this
.
OnChangeIsCRPastResults
=
this
.
OnChangeIsCRPastResults
.
bind
(
this
);
this
.
OnChangeIsCRRatings
=
this
.
OnChangeIsCRRatings
.
bind
(
this
);
this
.
OnChangeIsCRReviews
=
this
.
OnChangeIsCRReviews
.
bind
(
this
);
this
.
OnChangeIsCRStudentCount
=
this
.
OnChangeIsCRStudentCount
.
bind
(
this
);
this
.
OnChangeCRPastResults
=
this
.
OnChangeCRPastResults
.
bind
(
this
);
this
.
OnChangeCRRatings
=
this
.
OnChangeCRRatings
.
bind
(
this
);
this
.
OnChangeCRReviews
=
this
.
OnChangeCRReviews
.
bind
(
this
);
this
.
OnChangeCRStudentCount
=
this
.
OnChangeCRStudentCount
.
bind
(
this
);
this
.
calculateTotalRecommendationCount
=
this
.
calculateTotalRecommendationCount
.
bind
(
this
);
this
.
onChangeRadioButton
=
this
.
onChangeRadioButton
.
bind
(
this
);
this
.
getRecommendation
=
this
.
getRecommendation
.
bind
(
this
);
this
.
onClickFilterArrow
=
this
.
onClickFilterArrow
.
bind
(
this
);
this
.
onClickAddFilter
=
this
.
onClickAddFilter
.
bind
(
this
);
}
componentDidMount
()
{
...
...
@@ -67,6 +91,164 @@ export default class Home extends Component{
})
}
})
this
.
calculateTotalRecommendationCount
();
}
onClickAddFilter
(){
if
(
this
.
state
.
TutorFilteredList
.
length
>
0
){
if
(
this
.
state
.
TotalRecommendationCount
===
100
){
this
.
getRecommendation
();
}
else
{
swal
(
"
Sorry
"
,
"
Total Filter value Count is not correct.
\n
Please Set Total Filter Value as equal to 100.
"
,
"
warning
"
);
}
}
else
{
swal
(
"
Sorry
"
,
"
No Results Founded
\n
Please Find Tutor First.
"
,
"
warning
"
);
}
}
onChangeRadioButton
(
e
){
if
(
e
.
target
.
value
===
"
By pass rate
"
){
this
.
setState
({
passResultsSubCategory
:
1
});
}
else
{
this
.
setState
({
passResultsSubCategory
:
2
});
}
}
onClickFilterArrow
(){
if
(
this
.
state
.
isClickFilterArrow
){
this
.
setState
({
isClickFilterArrow
:
false
})
}
else
{
this
.
setState
({
isClickFilterArrow
:
true
})
}
}
calculateTotalRecommendationCount
(){
let
finalResult
=
this
.
state
.
RVPastResults
+
this
.
state
.
RVRatings
+
this
.
state
.
RVReviews
+
this
.
state
.
RVStudentCount
;
this
.
setState
({
TotalRecommendationCount
:
finalResult
});
}
OnChangeCRPastResults
(
e
)
{
this
.
setState
({
RVPastResults
:
Number
(
e
.
target
.
value
),
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
OnChangeCRRatings
(
e
)
{
this
.
setState
({
RVRatings
:
Number
(
e
.
target
.
value
),
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
OnChangeCRReviews
(
e
)
{
this
.
setState
({
RVReviews
:
Number
(
e
.
target
.
value
),
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
OnChangeCRStudentCount
(
e
)
{
this
.
setState
({
RVStudentCount
:
Number
(
e
.
target
.
value
),
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
OnChangeIsCRPastResults
(
e
)
{
if
(
this
.
state
.
isRVPastResults
){
this
.
setState
({
isRVPastResults
:
false
,
RVPastResults
:
0
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
else
{
this
.
setState
({
isRVPastResults
:
true
});
}
}
OnChangeIsCRRatings
(
e
)
{
if
(
this
.
state
.
isRVRatings
){
this
.
setState
({
isRVRatings
:
false
,
RVRatings
:
0
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
else
{
this
.
setState
({
isRVRatings
:
true
});
}
}
OnChangeIsCRReviews
(
e
)
{
if
(
this
.
state
.
isRVReviews
){
this
.
setState
({
isRVReviews
:
false
,
RVReviews
:
0
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
else
{
this
.
setState
({
isRVReviews
:
true
});
}
}
OnChangeIsCRStudentCount
(
e
)
{
if
(
this
.
state
.
isStudentCount
){
this
.
setState
({
isStudentCount
:
false
,
RVStudentCount
:
0
},()
=>
{
this
.
calculateTotalRecommendationCount
();
});
}
else
{
this
.
setState
({
isStudentCount
:
true
});
}
}
...
...
@@ -130,29 +312,92 @@ export default class Home extends Component{
selectedCity
:
this
.
state
.
selectedCity
,
selectedClassType
:
this
.
state
.
selectedClassType
,
selectedLanguage
:
this
.
state
.
selectedLanguage
,
RVPastResults
:
this
.
state
.
RVPastResults
,
RVRatings
:
this
.
state
.
RVRatings
,
RVReviews
:
this
.
state
.
RVReviews
,
RVStudentCount
:
this
.
state
.
RVStudentCount
,
passResultsSubCategory
:
this
.
state
.
passResultsSubCategory
,
}
if
(
this
.
state
.
selectedStream
!=
""
&&
this
.
state
.
selectedSubject
!
=
""
){
axios
.
post
(
configs
.
BASE_URL
+
'
/
tutorSingUp
/getFilteredList
'
,
Filters
)
if
(
this
.
state
.
selectedStream
!=
=
""
&&
this
.
state
.
selectedSubject
!=
=
""
){
axios
.
post
(
configs
.
BASE_URL
+
'
/
filteredList
/getFilteredList
'
,
Filters
)
.
then
(
res
=>
{
console
.
log
(
res
.
data
);
this
.
setState
({
TutorFilteredList
:
res
.
data
},()
=>
{
this
.
getRecommendation
();
})
// console.log(this.state.TutorFilteredList);
})
}
else
{
alert
(
"
Please at least select Stream and Subject
"
);
swal
(
"
Sorry
"
,
"
Please select Stream and Subject
"
,
"
warning
"
);
// alert("Please at least select Stream and Subject");
}
}
getRecommendation
(){
const
TutorFinalList
=
[]
this
.
state
.
TutorFilteredList
.
map
(
tutor
=>
{
let
finalReviewScore
=
(
Number
(
tutor
.
tutor_reviewValue
)
*
Number
(
this
.
state
.
RVReviews
))
/
100
;
let
valueForRating
=
0
;
if
(
Number
(
tutor
.
tutor_avg_rating
)
===
5
){
valueForRating
=
100
}
else
if
(
Number
(
tutor
.
tutor_avg_rating
)
>
4.75
){
valueForRating
=
75
}
else
if
(
Number
(
tutor
.
tutor_avg_rating
)
>
4
){
valueForRating
=
60
}
else
if
(
Number
(
tutor
.
tutor_avg_rating
)
>
2
){
valueForRating
=
40
}
else
{
valueForRating
=
0
}
let
FinalRatingScore
=
(
valueForRating
*
Number
(
this
.
state
.
RVRatings
))
/
100
;
let
FinalScore
=
finalReviewScore
+
FinalRatingScore
;
const
temp
=
{
tutor_id
:
tutor
.
teacher
,
tutor_name
:
tutor
.
tutor_name
,
tutor_subjects
:
tutor
.
tutor_subjects
,
tutor_class_type
:
tutor
.
tutor_class_type
,
tutor_main_district
:
tutor
.
tutor_main_district
,
tutor_main_city
:
tutor
.
tutor_main_city
,
tutor_medium
:
tutor
.
tutor_medium
,
tutor_qualification
:
tutor
.
tutor_qualification
,
tutor_reviewValue
:
tutor
.
tutor_reviewValue
,
tutor_avg_rating
:
tutor
.
tutor_avg_rating
,
tutor_finalScore
:
FinalScore
,
tutor_review_count
:
tutor
.
tutor_review_count
}
TutorFinalList
.
push
(
temp
);
})
TutorFinalList
.
sort
((
a
,
b
)
=>
b
.
tutor_finalScore
-
a
.
tutor_finalScore
);
this
.
setState
({
TutorFilteredListFinal
:
TutorFinalList
},()
=>
{
if
(
this
.
state
.
TotalRecommendationCount
===
0
){
swal
(
"
Ops!!!
"
,
"
You are not added any Filters...
\n
Please add filters to get correct recommendation
"
,
"
warning
"
);
}
})
}
render
()
{
return
(
...
...
@@ -261,11 +506,220 @@ export default class Home extends Component{
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginRight
:
'
50px
'
,
marginLeft
:
'
50px
'
,
marginTop
:
'
10px
'
,
padding
:
'
10px
'
,
background
:
'
#1E4258
'
}}
>
<
h5
style
=
{{
color
:
"
white
"
,
float
:
'
left
'
}}
>
Customized
Your
Recommendation
<
/h5
>
<
/div
>
{
this
.
state
.
isClickFilterArrow
?
<
div
className
=
"
row
"
style
=
{{
marginRight
:
'
50px
'
,
marginLeft
:
'
50px
'
,
marginTop
:
'
5px
'
,
padding
:
'
5px
'
,
background
:
'
#1E4258
'
}}
>
<
div
className
=
"
col
"
style
=
{{
margin
:
'
5px
'
,
border
:
'
solid
'
,
padding
:
'
10px
'
,
borderColor
:
'
#216E9B
'
}}
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
input
type
=
"
checkbox
"
id
=
"
PastResults
"
className
=
"
form-control
"
defaultChecked
=
{
this
.
state
.
isRVPastResults
}
onChange
=
{
this
.
OnChangeIsCRPastResults
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
float
:
'
left
'
,
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
color
:
"
white
"
}}
>
Past
Results
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
input
type
=
"
number
"
id
=
"
pastResultsTxt
"
className
=
"
form-control
"
value
=
{
this
.
state
.
RVPastResults
}
onChange
=
{
this
.
OnChangeCRPastResults
}
style
=
{{
width
:
'
30%
'
,
marginLeft
:
'
20px
'
}}
required
/>
<
label
style
=
{{
marginTop
:
'
10px
'
,
float
:
'
left
'
,
marginLeft
:
'
10px
'
,
color
:
"
white
"
}}
>%<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
style
=
{{
color
:
'
white
'
,
padding
:
'
8px
'
}}
onChange
=
{
this
.
onChangeRadioButton
}
>
<
input
type
=
"
radio
"
value
=
"
By pass rate
"
name
=
"
results
"
style
=
{{
marginLeft
:
'
11px
'
}}
checked
=
{
this
.
state
.
passResultsSubCategory
===
1
}
/> By pass rat
e
<
br
/>
<
input
type
=
"
radio
"
value
=
"
By grade A
"
name
=
"
results
"
style
=
{{
marginLeft
:
'
12px
'
}}
checked
=
{
this
.
state
.
passResultsSubCategory
===
2
}
/> By grade 'A
'
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
input
type
=
"
checkbox
"
id
=
"
PastResults
"
className
=
"
form-control
"
defaultChecked
=
{
this
.
state
.
isRVRatings
}
onChange
=
{
this
.
OnChangeIsCRRatings
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
float
:
'
left
'
,
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
color
:
"
white
"
}}
>
Ratings
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
input
type
=
"
number
"
id
=
"
pastResultsTxt
"
className
=
"
form-control
"
value
=
{
this
.
state
.
RVRatings
}
onChange
=
{
this
.
OnChangeCRRatings
}
style
=
{{
width
:
'
30%
'
,
marginLeft
:
'
20px
'
}}
required
/>
<
label
style
=
{{
marginTop
:
'
10px
'
,
float
:
'
left
'
,
marginLeft
:
'
10px
'
,
color
:
"
white
"
}}
>%<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
input
type
=
"
checkbox
"
id
=
"
PastResults
"
className
=
"
form-control
"
defaultChecked
=
{
this
.
state
.
isRVReviews
}
onChange
=
{
this
.
OnChangeIsCRReviews
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
float
:
'
left
'
,
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
color
:
"
white
"
}}
>
Reviews
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
input
type
=
"
number
"
id
=
"
pastResultsTxt
"
className
=
"
form-control
"
value
=
{
this
.
state
.
RVReviews
}
onChange
=
{
this
.
OnChangeCRReviews
}
style
=
{{
width
:
'
30%
'
,
marginLeft
:
'
20px
'
}}
required
/>
<
label
style
=
{{
marginTop
:
'
10px
'
,
float
:
'
left
'
,
marginLeft
:
'
10px
'
,
color
:
"
white
"
}}
>%<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
input
type
=
"
checkbox
"
id
=
"
PastResults
"
className
=
"
form-control
"
defaultChecked
=
{
this
.
state
.
isStudentCount
}
onChange
=
{
this
.
OnChangeIsCRStudentCount
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
float
:
'
left
'
,
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
color
:
"
white
"
}}
>
Student
Count
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
input
type
=
"
number
"
id
=
"
pastResultsTxt
"
className
=
"
form-control
"
value
=
{
this
.
state
.
RVStudentCount
}
onChange
=
{
this
.
OnChangeCRStudentCount
}
style
=
{{
width
:
'
30%
'
,
marginLeft
:
'
20px
'
}}
required
/>
<
label
style
=
{{
marginTop
:
'
10px
'
,
float
:
'
left
'
,
marginLeft
:
'
10px
'
,
color
:
"
white
"
}}
>%<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
/div
>
<
/div
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
label
>
<
span
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
,
color
:
"
white
"
}}
>
{
this
.
state
.
TotalRecommendationCount
}
/ 100</
span
>
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
<
button
className
=
"
form-control
"
style
=
{{
background
:
"
#216E9B
"
,
color
:
"
white
"
,
margin
:
'
10px
'
,
width
:
'
50%
'
}}
onClick
=
{
this
.
onClickAddFilter
}
><
b
>
Add
Filter
<
/b></
button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
:
<
div
className
=
"
row
"
style
=
{{
marginRight
:
'
50px
'
,
marginLeft
:
'
50px
'
,
marginTop
:
'
5px
'
,
padding
:
'
5px
'
,
background
:
'
#1E4258
'
}}
>
<
span
><
/span
>
<
/div
>
}
<
div
className
=
"
row
"
style
=
{{
justifyContent
:
'
center
'
}}
>
{
this
.
state
.
isClickFilterArrow
?
<
button
className
=
"
form-control
"
style
=
{{
width
:
'
5%
'
,
height
:
'
50px
'
}}
onClick
=
{
this
.
onClickFilterArrow
}
>
<
span
style
=
{{
margin
:
'
5px
'
,
cursor
:
'
pointer
'
}}
><
Icon
.
ArrowBarUp
color
=
"
#444444
"
size
=
{
35
}
/></
span
>
<
/button
>
:
<
button
className
=
"
form-control
"
style
=
{{
width
:
'
5%
'
,
height
:
'
50px
'
}}
onClick
=
{
this
.
onClickFilterArrow
}
>
<
span
style
=
{{
margin
:
'
5px
'
,
cursor
:
'
pointer
'
}}
><
Icon
.
ArrowBarDown
color
=
"
#444444
"
size
=
{
35
}
/></
span
>
<
/button
>
}
<
/div
>
<
div
className
=
"
row
"
style
=
{{
background
:
'
#F5F4ED
'
,
marginLeft
:
'
50px
'
,
marginRight
:
'
50px
'
,
marginTop
:
'
10px
'
}}
>
<
h5
style
=
{{
margin
:
'
10px
'
}}
>
0
Results
<
/h5
>
<
h5
style
=
{{
margin
:
'
10px
'
}}
>
{
this
.
state
.
TutorFilteredList
.
length
}
Results
<
/h5
>
<
/div
>
<
div
className
=
""
>
{
this
.
state
.
TutorFilteredList
.
length
>
0
?
this
.
state
.
TutorFilteredList
.
map
(
(
card
)
=>
{
return
(
<
TutorCard
data
=
{
card
}
/>
)
}
)
: <div>Empty
</
div
>
}
{
this
.
state
.
TutorFilteredList
Final
.
length
>
0
?
this
.
state
.
TutorFilteredListFinal
.
map
(
(
card
)
=>
{
return
(
<
TutorCard
data
=
{
card
}
/>
)
}
)
: <div>
</
div
>
}
<
/div
>
<
div
className
=
"
app-main__outer
"
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorCard.js
View file @
13565272
...
...
@@ -23,7 +23,7 @@ export default class TutorCard extends Component{
<
img
src
=
{
TestTeacher
}
style
=
{{
width
:
'
90px
'
,
height
:
'
80px
'
}}
/
>
<
div
className
=
"
row
"
style
=
{{
width
:
'
80%
'
,
background
:
'
#216E9B
'
,
marginLeft
:
'
10px
'
,
marginTop
:
'
5px
'
,
justifyContent
:
'
center
'
}}
>
<
h5
style
=
{{
color
:
'
white
'
,
float
:
'
center
'
,
marginBottom
:
'
10px
'
,
marginTop
:
'
5px
'
}}
>
98.5
%
<
/h5
>
<
h5
style
=
{{
color
:
'
white
'
,
float
:
'
center
'
,
marginBottom
:
'
10px
'
,
marginTop
:
'
5px
'
}}
>
<
span
>
{
this
.
props
.
data
.
tutor_finalScore
.
toFixed
(
2
)}
%<
/span>
</
h5
>
<
/div
>
<
/div
>
<
div
className
=
"
col-6
"
style
=
{{
margin
:
'
0px
'
}}
>
...
...
@@ -64,7 +64,7 @@ export default class TutorCard extends Component{
<
img
src
=
{
Star
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
}}
/
>
<
/div
>
<
div
className
=
"
col
"
>
<
h5
style
=
{{
float
:
"
left
"
}}
>
5
<
/h5
>
<
h5
style
=
{{
float
:
"
left
"
}}
>
{
this
.
props
.
data
.
tutor_avg_rating
.
toFixed
(
1
)}
<
/h5
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
...
...
@@ -72,7 +72,7 @@ export default class TutorCard extends Component{
<
img
src
=
{
ReviewImg
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
}}
/
>
<
/div
>
<
div
className
=
"
col
"
>
<
h5
style
=
{{
float
:
"
left
"
}}
>
23
reviews
<
/h5
>
<
h5
style
=
{{
float
:
"
left
"
}}
>
{
this
.
props
.
data
.
tutor_review_count
}
reviews
<
/h5
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
...
...
@@ -84,7 +84,8 @@ export default class TutorCard extends Component{
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
button
className
=
"
form-control
"
style
=
{{
background
:
"
#216E9B
"
,
color
:
"
white
"
,
marginLeft
:
'
15px
'
,
marginRight
:
'
15px
'
}}
><
b
>
View
Profile
<
/b></
button
>
<
button
className
=
"
form-control
"
value
=
{
this
.
props
.
data
.
_id
}
style
=
{{
background
:
"
#216E9B
"
,
color
:
"
white
"
,
marginLeft
:
'
15px
'
,
marginRight
:
'
15px
'
}}
><
b
>
View
Profile
<
/b></
button
>
<
/div
>
<
/div
>
...
...
@@ -97,8 +98,7 @@ export default class TutorCard extends Component{
<
img
src
=
{
RecommendIcon
}
style
=
{{
width
:
'
100px
'
,
height
:
'
90px
'
,
float
:
'
left
'
,
margin
:
'
10px
'
}}
/
>
<
/div
>
<
/div
>
{
/*{console.log("In Tutor Card")}*/
}
{
/*{console.log(this.props)}*/
}
<
/div
>
)
}
...
...
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorProfileView.js
0 → 100644
View file @
13565272
import
React
,
{
Component
}
from
"
react
"
;
import
ItemNav
from
"
../Navbar
"
;
import
TestTeacher
from
"
../../Images/teacher.jpg
"
;
import
{
FaStar
}
from
"
react-icons/fa
"
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
"
../../Config/config
"
;
import
*
as
Icon
from
"
react-bootstrap-icons
"
;
import
moment
from
"
moment
"
;
export
default
class
TutorProfileView
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
tutor_id
:
'
6127b1d7ed4ff23bb0344538
'
,
rating
:
0
,
overRollRating
:
3.5
,
ratingCount
:
20
,
ratingFive
:
4
,
ratingFour
:
2
,
ratingThree
:
5
,
ratingTwo
:
1
,
ratingOne
:
1
,
alreadyRate
:
false
,
review
:
''
,
student_id
:
''
,
version
:
'
1
'
,
TutorClassList
:[],
instituteList
:
[],
ClassMethods
:
[],
subjectList
:
[],
tutor_name
:
''
,
tutor_email
:
''
,
tutor_phone
:
''
,
tutor_address
:
''
,
tutor_gender
:
''
,
tutor_medium
:
''
,
tutor_qualification
:
''
,
OnlineClass
:
''
,
HomeVisit
:
''
,
Institute
:
''
,
tutorManinCities
:
[],
};
this
.
onClickRatingValue
=
this
.
onClickRatingValue
.
bind
(
this
);
this
.
onMouseEnter
=
this
.
onMouseEnter
.
bind
(
this
);
this
.
onMouseOut
=
this
.
onMouseOut
.
bind
(
this
);
this
.
onChangeComment
=
this
.
onChangeComment
.
bind
(
this
);
this
.
onSID
=
this
.
onSID
.
bind
(
this
);
this
.
onTutorID
=
this
.
onTutorID
.
bind
(
this
);
this
.
submitRating
=
this
.
submitRating
.
bind
(
this
);
}
componentDidMount
()
{
axios
.
get
(
configs
.
BASE_URL
+
'
/tutorSingUp/
'
+
this
.
state
.
tutor_id
)
.
then
(
response
=>
{
console
.
log
(
response
.
data
);
//console.log(response.data);
this
.
setState
({
instituteList
:
response
.
data
.
tutor_instituteIDList
,
ClassMethods
:
response
.
data
.
tutor_class_type
,
subjectList
:
response
.
data
.
tutor_subjects
,
tutor_name
:
response
.
data
.
tutor_name
,
tutor_email
:
response
.
data
.
tutor_email
,
tutor_phone
:
response
.
data
.
tutor_phone
,
tutor_address
:
response
.
data
.
tutor_address
,
tutor_gender
:
response
.
data
.
tutor_gender
,
tutor_medium
:
response
.
data
.
tutor_medium
,
tutor_qualification
:
response
.
data
.
tutor_qualification
,
tutorManinCities
:
response
.
data
.
tutor_main_city
},
()
=>
{
this
.
state
.
ClassMethods
.
map
((
type
)
=>
{
if
(
type
===
"
Online class
"
){
this
.
setState
({
OnlineClass
:
type
})
}
else
if
(
type
===
"
Home Visit
"
){
this
.
setState
({
HomeVisit
:
type
})
}
else
if
(
type
===
"
Institute
"
){
this
.
setState
({
Institute
:
type
})
}
})
axios
.
get
(
configs
.
BASE_URL
+
'
/createClass/tutorClass/
'
+
this
.
state
.
tutor_id
)
.
then
(
response
=>
{
console
.
log
(
response
.
data
);
this
.
setState
({
TutorClassList
:
response
.
data
},
()
=>
{
})
})
})
})
}
onClickRatingValue
(
e
)
{
console
.
log
(
e
.
target
.
value
);
this
.
setState
({
rating
:
e
.
target
.
value
})
}
onMouseEnter
(
e
)
{
console
.
log
(
e
);
this
.
setState
({
hover
:
e
})
}
onMouseOut
()
{
this
.
setState
({
hover
:
0
})
}
onChangeComment
(
e
)
{
this
.
setState
({
review
:
e
.
target
.
value
})
}
onSID
(
e
)
{
this
.
setState
({
student_id
:
e
.
target
.
value
})
}
onTutorID
(
e
)
{
this
.
setState
({
tutor_id
:
e
.
target
.
value
})
}
submitRating
()
{
const
payload
=
{
tutor_id
:
this
.
state
.
tutor_id
,
student_id
:
this
.
state
.
student_id
,
rating
:
this
.
state
.
rating
,
review
:
this
.
state
.
review
,
version
:
this
.
state
.
version
}
// console.log("payload");
console
.
log
(
payload
);
axios
.
post
(
configs
.
BASE_URL
+
'
/tutorRatings/add
'
,
payload
)
.
then
(
response
=>
{
alert
(
"
One Review added!!!
"
)
});
}
render
()
{
return
(
<
div
className
=
"
App
"
style
=
{{
padding
:
'
10px
'
,
paddingTop
:
'
0px
'
}}
>
<
div
className
=
"
row
"
style
=
{{
width
:
'
100%
'
}}
>
<
ItemNav
/>
<
/div
>
<
div
className
=
"
App
"
style
=
{{
marginTop
:
'
80px
'
,
paddingTop
:
'
0px
'
}}
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-
"
>
<
img
src
=
{
TestTeacher
}
style
=
{{
width
:
'
160px
'
,
height
:
'
160px
'
,
float
:
'
left
'
,
margin
:
'
30px
'
}}
/
>
<
/div
>
<
div
className
=
"
col
"
style
=
{{
padding
:
'
20px
'
,
float
:
'
left
'
,
marginTop
:
'
20px
'
}}
>
<
div
className
=
"
row
"
>
<
h5
>
{
this
.
state
.
tutor_name
}
<
/h5
>
<
/div
>
<
div
className
=
"
row
"
>
<
label
>
{
this
.
state
.
tutor_qualification
}
<
/label
>
<
/div
>
<
div
className
=
"
row
"
>
{[...
Array
(
5
)].
map
((
star
,
i
)
=>
{
const
ratingValue
=
i
+
1.0
;
return
<
label
style
=
{{
marginLeft
:
'
5px
'
,
faloat
:
'
center
'
}}
>
<
input
type
=
"
radio
"
name
=
"
rating
"
style
=
{{
display
:
"
none
"
,
cursor
:
"
pointer
"
}}
value
=
{
ratingValue
}
//onClick={this.onClickRatingValue}
/
>
<
FaStar
size
=
{
20
}
color
=
{
ratingValue
<=
(
this
.
state
.
overRollRating
)
?
"
#ffc107
"
:
"
#e4e5e9
"
}
//onMouseEnter={() => this.onMouseEnter(i + 1)}
style
=
{{
cursor
:
"
pointer
"
}}
/
>
<
/label
>
})}
<
/div
>
<
div
className
=
"
row
"
>
<
label
>
11
reviews
<
/label
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginLeft
:
'
0px
'
,
paddingLeft
:
'
20px
'
,
paddingTop
:
'
5px
'
,
paddingBottom
:
'
5px
'
,
background
:
'
#022140
'
,
color
:
'
white
'
}}
>
<
h5
>
About
Me
<
/h5
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
textAlign
:
'
justify
'
}}
>
I
graduated
in
2019
from
an
undergraduate
degree
in
English
Literature
from
Cambridge
University
,
and
,
after
working
for
two
years
full
time
as
a
private
tutor
,
am
currently
reading
for
an
MPhil
in
Renaissance
Literature
(
also
at
Cambridge
)
–
my
dissertation
being
an
attempt
to
taxonomise
the
syntactical
forms
of
the
simile
in
Shakespeare
’
s
Complete
Works
,
and
,
with
a
corresponding
database
,
thus
(
I
hope
)
to
chart
its
evolution
.
I
hope
to
continue
in
academia
afterwards
,
and
,
throughout
and
beyond
this
degree
,
to
remain
tutoring
.
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginLeft
:
'
0px
'
,
paddingLeft
:
'
20px
'
,
paddingTop
:
'
5px
'
,
paddingBottom
:
'
5px
'
,
background
:
'
#022140
'
,
color
:
'
white
'
}}
>
<
h5
>
About
My
Class
<
/h5
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
20px
'
}}
>
<
div
className
=
"
col
"
>
<
label
style
=
{{
textAlign
:
'
justify
'
}}
>
I
graduated
in
2019
from
an
undergraduate
degree
in
English
Literature
from
Cambridge
University
,
and
,
after
working
for
two
years
full
time
as
a
private
tutor
,
am
currently
reading
for
an
MPhil
in
Renaissance
Literature
(
also
at
Cambridge
)
–
my
dissertation
being
an
attempt
to
taxonomise
the
syntactical
forms
of
the
simile
in
Shakespeare
’
s
Complete
Works
,
and
,
with
a
corresponding
database
,
thus
(
I
hope
)
to
chart
its
evolution
.
I
hope
to
continue
in
academia
afterwards
,
and
,
throughout
and
beyond
this
degree
,
to
remain
tutoring
.
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginLeft
:
'
0px
'
,
paddingLeft
:
'
20px
'
,
paddingTop
:
'
5px
'
,
paddingBottom
:
'
5px
'
,
background
:
'
#022140
'
,
color
:
'
white
'
}}
>
<
h5
>
Contact
Details
<
/h5
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginLeft
:
'
20px
'
,
marginTop
:
'
20px
'
}}
>
<
div
className
=
"
col-
"
>
<
Icon
.
Telephone
color
=
"
black
"
size
=
{
22
}
/
>
<
/div
>
<
div
className
=
"
col-
"
style
=
{{
float
:
'
left
'
,
marginLeft
:
'
15px
'
}}
>
<
label
>+
94
{
this
.
state
.
tutor_phone
}
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginLeft
:
'
20px
'
,
marginTop
:
'
10px
'
}}
>
<
div
className
=
"
col-
"
>
<
Icon
.
Envelope
color
=
"
black
"
size
=
{
22
}
/
>
<
/div
>
<
div
className
=
"
col-
"
style
=
{{
float
:
'
left
'
,
marginLeft
:
'
15px
'
}}
>
<
label
>
{
this
.
state
.
tutor_email
}
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
20px
'
,
marginLeft
:
'
0px
'
,
paddingLeft
:
'
20px
'
,
paddingTop
:
'
5px
'
,
paddingBottom
:
'
5px
'
,
background
:
'
#022140
'
,
color
:
'
white
'
}}
>
<
h5
>
Tutor
'
s Classes</h5>
</div>
<div className="row" style={{marginLeft:
'
20
px
'
,marginTop:
'
20
px
'
}}>
<div className="col-">
<h6>Language : <b>{this.state.tutor_medium}</b></h6>
</div>
</div>
<div className="row" style={{marginLeft:
'
20
px
'
,marginTop:
'
10
px
'
}}>
<div className="col-">
<h6>Subjects : <b>{this.state.subjectList}</b></h6>
</div>
</div>
<div className="row" style={{marginLeft:
'
20
px
'
, marginTop:
'
10
px
'
}}>
<div className="col-">
{this.state.OnlineClass === "" ?
<Icon.XOctagon color="black" size={18}/>
:
<Icon.Check2Circle color="black" size={18}/>
}
</div>
<div className="col-" style={{float:
'
left
'
, marginLeft:
'
15
px
'
}}>
<label>Online Classes</label>
</div>
</div>
<div className="" style={{marginLeft:
'
20
px
'
}}>
<div className="scroll-area">
<div className="table-dark row">
<div className="col">
<label>Class Type</label>
</div>
<div className="col">
<label>A/L Batch</label>
</div>
<div className="col">
<label>Starting Date</label>
</div>
<div className="col">
<label>Subject</label>
</div>
<div className="col">
<label>Day and Time</label>
</div>
<div className="col">
</div>
</div>
</div>
</div>
{this.state.TutorClassList.map((tutorClass)=>{
if(tutorClass.class_method === "Online class"){
return(
<div className="row" style={{background:
'
#
DCDCDC
'
, paddingBottom:
'
5
px
'
, paddingTop:
'
5
px
'
,marginLeft:
'
5
px
'
, borderBottom:
'
inset
'
}}>
<div className="col">
<label>{tutorClass.class_type}</label>
</div>
<div className="col">
<label>{tutorClass.batchYear}</label>
</div>
<div className="col">
<label>{moment(tutorClass.class_startingDate).format("L") }</label>
</div>
<div className="col">
<label>{tutorClass.subject}</label>
</div>
<div className="col">
<label>{tutorClass.class_conduct_day} - {tutorClass.class_conduct_time}</label>
</div>
<div className="col">
<button className="rounded" style={{background:
'
Orange
'
, padding:
'
3
px
'
, width:
'
35
px
'
}} value={""} onClick={e => this.onSelectOneClass(e)}>+</button>
</div>
</div>
)
}
})}
<div className="row" style={{marginLeft:
'
20
px
'
, marginTop:
'
5
px
'
}}>
<div className="col-">
{this.state.HomeVisit === "" ?
<Icon.XOctagon color="black" size={18}/>
:
<Icon.Check2Circle color="black" size={18}/>
}
</div>
<div className="col-" style={{float:
'
left
'
, marginLeft:
'
15
px
'
}}>
<label>Home Visit</label>
</div>
</div>
<div className="row" style={{marginLeft:
'
20
px
'
, marginTop:
'
0
px
'
}}>
<div className="col-" style={{marginLeft:
'
30
px
'
}}>
<Icon.GeoAlt color="black" size={18}/>
</div>
<div className="col-" style={{float:
'
left
'
, marginLeft:
'
15
px
'
}}>
<label>Home Visit Areas : {this.state.tutorManinCities.map((city)=>{
return(
<span>{city} | </span>
)
})}</label>
</div>
</div>
<div className="row" style={{marginLeft:
'
20
px
'
, marginTop:
'
5
px
'
}}>
{this.state.Institute === "" ?
<Icon.XOctagon color="black" size={18}/>
:
<Icon.Check2Circle color="black" size={18}/>
}
<div className="col-" style={{float:
'
left
'
, marginLeft:
'
15
px
'
}}>
<label>Institutes</label>
</div>
</div>
<div className="row" style={{marginLeft:
'
20
px
'
, marginTop:
'
0
px
'
}}>
<div className="col-" style={{marginLeft:
'
30
px
'
}}>
<Icon.Building color="black" size={18}/>
</div>
<div className="col-" style={{float:
'
left
'
, marginLeft:
'
15
px
'
}}>
<label>Institutes : {this.state.instituteList.map((city)=>{
return(
<span>{city.institute_name} | </span>
)
})}</label>
</div>
</div>
<div className="" style={{marginLeft:
'
20
px
'
}}>
<div className="scroll-area">
<div className="table-dark row">
<div className="col">
<label>Class Type</label>
</div>
<div className="col">
<label>A/L Batch</label>
</div>
<div className="col">
<label>Starting Date</label>
</div>
<div className="col">
<label>Subject</label>
</div>
<div className="col">
<label>Institute</label>
</div>
<div className="col">
<label>Day and Time</label>
</div>
<div className="col">
</div>
</div>
</div>
</div>
{this.state.TutorClassList.map((tutorClass)=>{
if(tutorClass.class_method === "Institute"){
return(
<div className="row" style={{background:
'
#
DCDCDC
'
, paddingBottom:
'
5
px
'
, paddingTop:
'
5
px
'
,marginLeft:
'
5
px
'
, borderBottom:
'
inset
'
}}>
<div className="col">
<label>{tutorClass.class_type}</label>
</div>
<div className="col">
<label>{tutorClass.batchYear}</label>
</div>
<div className="col">
<label>{moment(tutorClass.class_startingDate).format("L") }</label>
</div>
<div className="col">
<label>{tutorClass.subject}</label>
</div>
<div className="col">
<label>{tutorClass.institute_id.institute_name}</label>
</div>
<div className="col">
<label>{tutorClass.class_conduct_day} - {tutorClass.class_conduct_time}</label>
</div>
<div className="col">
<button className="rounded" style={{background:
'
Orange
'
, padding:
'
3
px
'
, width:
'
35
px
'
}} value={""} onClick={e => this.onSelectOneClass(e)}>+</button>
</div>
</div>
)
}
})}
</div>
<div className="col">
<div className="row" style={{marginTop:
'
20
px
'
,marginLeft:
'
0
px
'
, paddingLeft:
'
20
px
'
,paddingTop:
'
5
px
'
,paddingBottom:
'
5
px
'
,
background:
'
#
022140
'
,color:
'
white
'
}}>
<h5>Rating and Reviews</h5>
</div>
<div className="row" style={{margin:
'
20
px
'
}}>
<div className="col">
<div className="row" style={{padding:
'
15
px
'
}}>
<h2 style={{marginLeft:
'
15
px
'
}}><span style={{color:
'
gray
'
}}><b
style={{fontSize:
'
40
px
'
, color: "black"}}>{this.state.overRollRating}</b>/5</span></h2>
</div>
<div className="row">
{[...Array(5)].map((star, i) => {
const ratingValue = i + 1;
return <label style={{marginLeft:
'
10
px
'
, float:
'
left
'
}}>
<input type="radio" name="rating"
style={{display: "none", cursor: "pointer"}}
value={ratingValue}
//onClick={this.onClickRatingValue}
/>
<FaStar size={35}
color={ratingValue <= (this.state.overRollRating) ? "#ffc107" : "#e4e5e9"}
//onMouseEnter={() => this.onMouseEnter(i + 1)}
style={{cursor: "pointer"}}/>
</label>
})}
</div>
<div className="row" style={{padding:
'
15
px
'
}}>
<span style={{marginLeft:
'
15
px
'
}}>{this.state.ratingCount} Ratings</span>
</div>
</div>
<div className="col">
<div className="row" style={{padding:
'
2
px
'
}}>
<div className="col-">
{[...Array(5)].map((star, i) => {
const ratingValue = i + 1;
return <label style={{marginLeft:
'
5
px
'
, float:
'
left
'
}}>
<input type="radio" name="rating"
style={{display: "none", cursor: "pointer"}}
value={ratingValue}
/>
<FaStar size={20}
color={ratingValue <= 5 ? "#ffc107" : "#e4e5e9"}
style={{cursor: "pointer"}}/>
</label>
})}
</div>
<div className="col">
<span style={{float:
'
left
'
, marginLeft:
'
10
px
'
}}>{this.state.ratingFive} rate(s)</span>
</div>
</div>
<div className="row" style={{padding:
'
2
px
'
}}>
<div className="col-">
{[...Array(5)].map((star, i) => {
const ratingValue = i + 1;
return <label style={{marginLeft:
'
5
px
'
, float:
'
left
'
}}>
<input type="radio" name="rating"
style={{display: "none", cursor: "pointer"}}
value={ratingValue}
/>
<FaStar size={20}
color={ratingValue <= 4 ? "#ffc107" : "#e4e5e9"}
style={{cursor: "pointer"}}/>
</label>
})}
</div>
<div className="col">
<span style={{float:
'
left
'
, marginLeft:
'
10
px
'
}}>{this.state.ratingFour} rate(s)</span>
</div>
</div>
<div className="row" style={{padding:
'
2
px
'
}}>
<div className="col-">
{[...Array(5)].map((star, i) => {
const ratingValue = i + 1;
return <label style={{marginLeft:
'
5
px
'
, float:
'
left
'
}}>
<input type="radio" name="rating"
style={{display: "none", cursor: "pointer"}}
value={ratingValue}
/>
<FaStar size={20}
color={ratingValue <= 3 ? "#ffc107" : "#e4e5e9"}
style={{cursor: "pointer"}}/>
</label>
})}
</div>
<div className="col">
<span style={{float:
'
left
'
, marginLeft:
'
10
px
'
}}>{this.state.ratingThree} rate(s)</span>
</div>
</div>
<div className="row" style={{padding:
'
2
px
'
}}>
<div className="col-">
{[...Array(5)].map((star, i) => {
const ratingValue = i + 1;
return <label style={{marginLeft:
'
5
px
'
, float:
'
left
'
}}>
<input type="radio" name="rating"
style={{display: "none", cursor: "pointer"}}
value={ratingValue}
/>
<FaStar size={20}
color={ratingValue <= 2 ? "#ffc107" : "#e4e5e9"}
style={{cursor: "pointer"}}/>
</label>
})}
</div>
<div className="col">
<span style={{float:
'
left
'
, marginLeft:
'
10
px
'
}}>{this.state.ratingTwo} rate(s)</span>
</div>
</div>
<div className="row" style={{padding:
'
2
px
'
}}>
<div className="col-">
{[...Array(5)].map((star, i) => {
const ratingValue = i + 1;
return <label style={{marginLeft:
'
5
px
'
, float:
'
left
'
}}>
<input type="radio" name="rating"
style={{display: "none", cursor: "pointer"}}
value={ratingValue}
/>
<FaStar size={20}
color={ratingValue <= 1 ? "#ffc107" : "#e4e5e9"}
style={{cursor: "pointer"}}/>
</label>
})}
</div>
<div className="col">
<span style={{float:
'
left
'
, marginLeft:
'
10
px
'
}}>{this.state.ratingOne} rate(s)</span>
</div>
</div>
</div>
</div>
<div className="row" style={{margin:
'
20
px
'
}}>
{[...Array(5)].map((star, i) => {
const ratingValue = i + 1;
return <label style={{marginLeft:
'
20
px
'
}}>
<input type="radio" name="rating" style={{display: "none", cursor: "pointer"}}
value={ratingValue}
onClick={this.onClickRatingValue}/>
<FaStar size={40}
color={ratingValue <= (this.state.rating || this.state.hover) ? "#ffc107" : "#e4e5e9"}
onMouseEnter={() => this.onMouseEnter(i + 1)}
style={{cursor: "pointer"}}/>
</label>
})}
</div>
<div className="row" style={{margin:
'
20
px
'
}}>
<span style={{marginLeft:
'
20
px
'
}}>You Rate [{this.state.rating}] stars for the product.</span>
</div>
<div className="row" style={{margin:
'
20
px
'
}}>
<h5 style={{marginLeft:
'
20
px
'
}}>You can review to this Tutor</h5>
</div>
<div className="row" style={{margin:
'
20
px
'
}}>
<input type="text" id="tutorAddress" className="form-control"
placeholder="Tutor ID"
onChange={this.onTutorID}
style={{width:
'
50
%
'
}} required/>
</div>
<div className="row" style={{margin:
'
20
px
'
}}>
<input type="text" id="tutorAddress" className="form-control"
placeholder="SID"
onChange={this.onSID}
style={{width:
'
50
%
'
}} required/>
</div>
<div className="row" style={{margin:
'
20
px
'
}}>
<textarea style={{width:
'
50
%
'
, marginLeft:
'
20
px
'
}} value={this.state.comments}
onChange={this.onChangeComment}/>
</div>
<div className="row" style={{margin:
'
20
px
'
}}>
{this.state.alreadyRate === false ?
<a type="submit" onClick={this.submitRating}
className="profile-edit-btn nav-link btn btn-primary stop-color-final"
name="btnAddMore"
style={{
float:
'
left
'
, marginLeft:
'
20
px
'
, marginTop:
'
00
px
'
, marginBottom:
'
20
px
'
,
backgroundColor:
'
orange
'
, borderColor:
'
orange
'
, fontSize:
'
20
px
'
, width:
'
25
%
'
}}>
Add Comment
</a>
:
<a type="submit" onClick={this.updateRating}
className="profile-edit-btn nav-link btn btn-primary stop-color-final"
name="btnAddMore"
style={{
float:
'
left
'
, marginLeft:
'
20
px
'
, marginTop:
'
00
px
'
, marginBottom:
'
20
px
'
,
backgroundColor:
'
orange
'
, borderColor:
'
orange
'
, fontSize:
'
20
px
'
, width:
'
25
%
'
}}>
Update Comment
</a>
}
</div>
</div>
</div>
</div>
</div>
)
}
}
\ No newline at end of file
WebFrontEnd/smartcoach-frontend/src/Components/Student/ALResults.js
View file @
13565272
...
...
@@ -113,11 +113,17 @@ export default class ALResults extends Component{
onSubmitResults
(
e
){
//let student_id = '60fc1aaf718c264214061846';
let
Subject
=
{
[
this
.
state
.
sub01
]
:
this
.
state
.
sub01Result
,
[
this
.
state
.
sub02
]
:
this
.
state
.
sub02Result
,
[
this
.
state
.
sub03
]
:
this
.
state
.
sub03Result
,
}
const
newResult
=
{
student_id
:
this
.
state
.
studentID
,
year
:
this
.
state
.
year
,
stream
:
this
.
state
.
stream
,
Subjects
:
Subject
,
subject01
:
this
.
state
.
sub01
,
subject02
:
this
.
state
.
sub02
,
subject03
:
this
.
state
.
sub03
,
...
...
WebFrontEnd/smartcoach-frontend/src/Config/config.js
View file @
13565272
const
configs
=
{
BASE_URL
:
'
http://localhost:500
0
'
,
BASE_URL
:
'
http://localhost:500
1
'
,
};
module
.
exports
=
configs
;
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