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
efb09f29
Commit
efb09f29
authored
Aug 21, 2021
by
Gihan76
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c294ea34
b8298554
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
1123 additions
and
192 deletions
+1123
-192
BackEnd/WebBackEnd/.env
BackEnd/WebBackEnd/.env
+3
-1
BackEnd/WebBackEnd/email-config/config.js
BackEnd/WebBackEnd/email-config/config.js
+4
-0
BackEnd/WebBackEnd/email/email.controller.js
BackEnd/WebBackEnd/email/email.controller.js
+66
-0
BackEnd/WebBackEnd/email/email.msgs.js
BackEnd/WebBackEnd/email/email.msgs.js
+7
-0
BackEnd/WebBackEnd/email/email.send.js
BackEnd/WebBackEnd/email/email.send.js
+45
-0
BackEnd/WebBackEnd/email/email.templates.js
BackEnd/WebBackEnd/email/email.templates.js
+20
-0
BackEnd/WebBackEnd/models/institute.user.model.js
BackEnd/WebBackEnd/models/institute.user.model.js
+1
-1
BackEnd/WebBackEnd/models/tutor.user.model.js
BackEnd/WebBackEnd/models/tutor.user.model.js
+5
-3
BackEnd/WebBackEnd/models/userAccount.user.model.js
BackEnd/WebBackEnd/models/userAccount.user.model.js
+20
-0
BackEnd/WebBackEnd/package-lock.json
BackEnd/WebBackEnd/package-lock.json
+6
-0
BackEnd/WebBackEnd/package.json
BackEnd/WebBackEnd/package.json
+3
-0
BackEnd/WebBackEnd/routes/institute.route.js
BackEnd/WebBackEnd/routes/institute.route.js
+112
-16
BackEnd/WebBackEnd/routes/student.route.js
BackEnd/WebBackEnd/routes/student.route.js
+157
-29
BackEnd/WebBackEnd/routes/tutor.route.js
BackEnd/WebBackEnd/routes/tutor.route.js
+152
-25
BackEnd/WebBackEnd/routes/userAccount.route.js
BackEnd/WebBackEnd/routes/userAccount.route.js
+37
-0
BackEnd/WebBackEnd/server.js
BackEnd/WebBackEnd/server.js
+2
-0
WebFrontEnd/smartcoach-frontend/package-lock.json
WebFrontEnd/smartcoach-frontend/package-lock.json
+10
-0
WebFrontEnd/smartcoach-frontend/package.json
WebFrontEnd/smartcoach-frontend/package.json
+2
-1
WebFrontEnd/smartcoach-frontend/src/App.js
WebFrontEnd/smartcoach-frontend/src/App.js
+4
-0
WebFrontEnd/smartcoach-frontend/src/Components/AccountVerified.js
...End/smartcoach-frontend/src/Components/AccountVerified.js
+64
-0
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
+9
-0
WebFrontEnd/smartcoach-frontend/src/Components/Login.js
WebFrontEnd/smartcoach-frontend/src/Components/Login.js
+84
-69
WebFrontEnd/smartcoach-frontend/src/Components/SignUp.js
WebFrontEnd/smartcoach-frontend/src/Components/SignUp.js
+213
-47
WebFrontEnd/smartcoach-frontend/src/Components/beforeConfirmation.js
.../smartcoach-frontend/src/Components/beforeConfirmation.js
+97
-0
WebFrontEnd/smartcoach-frontend/src/Images/confirmemail.png
WebFrontEnd/smartcoach-frontend/src/Images/confirmemail.png
+0
-0
WebFrontEnd/smartcoach-frontend/src/Images/verified.png
WebFrontEnd/smartcoach-frontend/src/Images/verified.png
+0
-0
No files found.
BackEnd/WebBackEnd/.env
View file @
efb09f29
ATLAS_URI = mongodb+srv://admin:admin@cluster0.wmb3b.mongodb.net/SmartCoach?retryWrites=true&w=majority
\ No newline at end of file
ATLAS_URI = mongodb+srv://admin:admin@cluster0.wmb3b.mongodb.net/SmartCoach?retryWrites=true&w=majority
MAIL_USER=onlineshoppingwebsite18@gmail.com
MAIL_PASS=Sliit@123
\ No newline at end of file
BackEnd/WebBackEnd/email-config/config.js
0 → 100644
View file @
efb09f29
module
.
exports
=
{
USER
:
'
smartcoach.smteam@gmail.com
'
,
PASS
:
'
Sliit@123
'
}
BackEnd/WebBackEnd/email/email.controller.js
0 → 100644
View file @
efb09f29
const
User
=
require
(
'
../models/userAccount.user.model
'
);
const
sendEmail
=
require
(
'
./email.send
'
);
const
msgs
=
require
(
'
./email.msgs
'
);
const
templates
=
require
(
'
./email.templates
'
);
exports
.
collectEmail
=
(
req
,
res
)
=>
{
const
{
email
}
=
req
.
body
User
.
findOne
({
email
})
.
then
(
user
=>
{
// We have a new user! Send them a confirmation email.
if
(
!
user
)
{
User
.
create
({
email
})
.
then
(
newUser
=>
sendEmail
(
newUser
.
email
,
templates
.
confirm
(
newUser
.
_id
)))
.
then
(()
=>
res
.
json
({
msg
:
msgs
.
confirm
}))
.
catch
(
err
=>
console
.
log
(
err
))
}
// We have already seen this email address. But the user has not
// clicked on the confirmation link. Send another confirmation email.
else
if
(
user
&&
!
user
.
confirmed
)
{
sendEmail
(
user
.
email
,
templates
.
confirm
(
user
.
_id
))
.
then
(()
=>
res
.
json
({
msg
:
msgs
.
resend
}))
}
// The user has already confirmed this email address
else
{
res
.
json
({
msg
:
msgs
.
alreadyConfirmed
})
}
})
.
catch
(
err
=>
console
.
log
(
err
))
}
// The callback that is invoked when the user visits the confirmation
// url on the client and a fetch request is sent in componentDidMount.
exports
.
confirmEmail
=
(
req
,
res
)
=>
{
const
{
id
}
=
req
.
params
User
.
findById
(
id
)
.
then
(
user
=>
{
// A user with that id does not exist in the DB. Perhaps some tricky
// user tried to go to a different url than the one provided in the
// confirmation email.
if
(
!
user
)
{
res
.
json
({
msg
:
msgs
.
couldNotFind
})
}
// The user exists but has not been confirmed. We need to confirm this
// user and let them know their email address has been confirmed.
else
if
(
user
&&
!
user
.
confirmed
)
{
User
.
findByIdAndUpdate
(
id
,
{
confirmed
:
true
})
.
then
(()
=>
res
.
json
({
msg
:
msgs
.
confirmed
}))
.
catch
(
err
=>
console
.
log
(
err
))
}
// The user has already confirmed this email address.
else
{
res
.
json
({
msg
:
msgs
.
alreadyConfirmed
})
}
})
.
catch
(
err
=>
console
.
log
(
err
))
}
\ No newline at end of file
BackEnd/WebBackEnd/email/email.msgs.js
0 → 100644
View file @
efb09f29
module
.
exports
=
{
confirm
:
'
Email sent, please check your inbox to confirm
'
,
confirmed
:
'
Your email is confirmed!
'
,
resend
:
'
Confirmation email resent, maybe check your spam?
'
,
couldNotFind
:
'
Could not find you!
'
,
alreadyConfirmed
:
'
Your email was already confirmed
'
}
\ No newline at end of file
BackEnd/WebBackEnd/email/email.send.js
0 → 100644
View file @
efb09f29
const
nodemailer
=
require
(
'
nodemailer
'
)
// The credentials for the email account you want to send mail from.
const
credentials
=
{
host
:
'
smtp.gmail.com
'
,
port
:
465
,
secure
:
true
,
auth
:
{
// These environment variables will be pulled from the .env file
user
:
process
.
env
.
MAIL_USER
,
pass
:
process
.
env
.
MAIL_PASS
}
}
// Getting Nodemailer all setup with the credentials for when the 'sendEmail()'
// function is called.
const
transporter
=
nodemailer
.
createTransport
(
credentials
)
// exporting an 'async' function here allows 'await' to be used
// as the return value of this function.
module
.
exports
=
async
(
to
,
content
)
=>
{
// The from and to addresses for the email that is about to be sent.
const
contacts
=
{
from
:
process
.
env
.
MAIL_USER
,
to
}
// Combining the content and contacts into a single object that can
// be passed to Nodemailer.
const
email
=
Object
.
assign
({},
content
,
contacts
)
// This file is imported into the controller as 'sendEmail'. Because
// 'transporter.sendMail()' below returns a promise we can write code like this
// in the contoller when we are using the sendEmail() function.
//
// sendEmail()
// .then(() => doSomethingElse())
//
// If you are running into errors getting Nodemailer working, wrap the following
// line in a try/catch. Most likely is not loading the credentials properly in
// the .env file or failing to allow unsafe apps in your gmail settings.
await
transporter
.
sendMail
(
email
)
}
\ No newline at end of file
BackEnd/WebBackEnd/email/email.templates.js
0 → 100644
View file @
efb09f29
const
{
CLIENT_ORIGIN
}
=
'
http://localhost:3000/beforeConfirm
'
// This file is exporting an Object with a single key/value pair.
// However, because this is not a part of the logic of the application
// it makes sense to abstract it to another file. Plus, it is now easily
// extensible if the application needs to send different email templates
// (eg. unsubscribe) in the future.
module
.
exports
=
{
confirm
:
id
=>
({
subject
:
'
React Confirm Email
'
,
html
:
`
<a href='
${
CLIENT_ORIGIN
}
/confirm/
${
id
}
'>
click to confirm email
</a>
`
,
text
:
`Copy and paste this link:
${
CLIENT_ORIGIN
}
/confirm/
${
id
}
`
})
}
\ No newline at end of file
BackEnd/WebBackEnd/models/institute.user.model.js
View file @
efb09f29
...
...
@@ -5,7 +5,7 @@ const Schema = mongoose.Schema;
const
userSchema
=
new
Schema
({
institute_name
:{
type
:
String
,
required
:
true
},
institute_email
:
{
type
:
String
,
required
:
true
},
institute_phones
:
{
type
:
String
,
required
:
true
}
,
institute_phones
:
[{
type
:
String
,
required
:
true
}]
,
institute_address
:{
type
:
String
,
required
:
true
},
institute_city
:{
type
:
String
,
required
:
true
},
institute_password
:{
type
:
String
,
required
:
true
},
...
...
BackEnd/WebBackEnd/models/tutor.user.model.js
View file @
efb09f29
...
...
@@ -13,12 +13,14 @@ const userSchema = new Schema({
tutor_status
:{
type
:
String
},
tutor_image
:{
type
:
String
},
tutor_Stream
:{
type
:
String
},
tutor_subjects
:{
type
:
String
},
tutor_class_types
:{
type
:
String
},
tutor_subjects
:[{
type
:
String
}],
isOnlineClass
:{
type
:
Boolean
},
isHomeVisit
:{
type
:
Boolean
},
isInstitute
:{
type
:
Boolean
},
tutor_main_district
:{
type
:
String
},
tutor_main_city
:{
type
:
String
},
tutor_medium
:{
type
:
String
},
tutor_instituteID
:{
type
:
String
}
,
tutor_instituteID
List
:[{
type
:
String
}]
,
},
{
timestamps
:
true
,
});
...
...
BackEnd/WebBackEnd/models/userAccount.user.model.js
0 → 100644
View file @
efb09f29
const
mongoose
=
require
(
'
mongoose
'
);
const
Schema
=
mongoose
.
Schema
;
const
userSchema
=
new
Schema
({
user_id
:{
type
:
String
,
required
:
true
},
user_nic
:{
type
:
String
,
required
:
false
},
user_email
:
{
type
:
String
,
required
:
true
},
user_password
:{
type
:
String
,
required
:
true
},
user_type
:{
type
:
String
,
required
:
true
},
confirmed
:
{
type
:
Boolean
,
default
:
true
}
});
const
UserAccount
=
mongoose
.
model
(
'
UserAccount
'
,
userSchema
);
module
.
exports
=
UserAccount
;
\ No newline at end of file
BackEnd/WebBackEnd/package-lock.json
View file @
efb09f29
...
...
@@ -392,6 +392,12 @@
"resolved"
:
"https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz"
,
"integrity"
:
"sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
},
"nodemailer"
:
{
"version"
:
"6.6.2"
,
"resolved"
:
"https://registry.npmjs.org/nodemailer/-/nodemailer-6.6.2.tgz"
,
"integrity"
:
"sha512-YSzu7TLbI+bsjCis/TZlAXBoM4y93HhlIgo0P5oiA2ua9Z4k+E2Fod//ybIzdJxOlXGRcHIh/WaeCBehvxZb/Q=="
,
"dev"
:
true
},
"object-assign"
:
{
"version"
:
"4.1.1"
,
"resolved"
:
"https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
,
...
...
BackEnd/WebBackEnd/package.json
View file @
efb09f29
...
...
@@ -14,5 +14,8 @@
"dotenv"
:
"^10.0.0"
,
"express"
:
"^4.17.1"
,
"mongoose"
:
"^5.12.15"
},
"devDependencies"
:
{
"nodemailer"
:
"^6.6.2"
}
}
BackEnd/WebBackEnd/routes/institute.route.js
View file @
efb09f29
const
router
=
require
(
'
express
'
).
Router
();
let
institute
=
require
(
'
../models/institute.user.model
'
);
let
userAccount
=
require
(
'
../models/userAccount.user.model
'
);
const
nodemailer
=
require
(
'
nodemailer
'
);
const
cred
=
require
(
'
../email-config/config
'
);
////////////////////////////////////////////////////////////////////////////////////////
var
transport
=
{
host
:
'
smtp.gmail.com
'
,
auth
:
{
user
:
cred
.
USER
,
pass
:
cred
.
PASS
}
}
var
transporter
=
nodemailer
.
createTransport
(
transport
);
transporter
.
verify
((
error
,
success
)
=>
{
if
(
error
)
{
console
.
log
(
error
);
}
else
{
console
.
log
(
'
Server is ready to take messages of Institute
'
);
}
});
/////////////////////////////////////////////////////////////////////////////////////////////
router
.
route
(
'
/
'
).
get
((
req
,
res
)
=>
{
institute
.
find
()
.
then
(
students
=>
res
.
json
(
student
s
))
.
then
(
Institutes
=>
res
.
json
(
Institute
s
))
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
router
.
route
(
'
/add
'
).
post
((
req
,
res
)
=>
{
router
.
route
(
'
/add
'
).
post
(
async
(
req
,
res
)
=>
{
const
institute_name
=
req
.
body
.
institute_name
;
const
institute_email
=
req
.
body
.
institute_email
;
const
institute_phones
=
req
.
body
.
institute_phones
;
...
...
@@ -18,20 +46,88 @@ router.route('/add').post((req,res) =>{
const
institute_image
=
req
.
body
.
institute_image
;
const
newInstitute
=
new
institute
({
institute_name
,
institute_email
,
institute_phones
,
institute_address
,
institute_city
,
institute_password
,
institute_registrationNo
,
institute_image
});
newInstitute
.
save
()
.
then
(()
=>
res
.
json
(
'
Institute Successfully Added....
'
))
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
//checking if the user is already exist in the database
const
user
=
await
institute
.
findOne
({
institute_email
:
req
.
body
.
institute_email
})
if
(
!
user
){
const
newInstitute
=
new
institute
({
institute_name
,
institute_email
,
institute_phones
,
institute_address
,
institute_city
,
institute_password
,
institute_registrationNo
,
institute_image
});
newInstitute
.
save
()
.
then
(
Institute
=>
{
const
user_id
=
Institute
.
id
.
toString
();
const
user_nic
=
""
;
const
user_email
=
req
.
body
.
institute_email
;
const
user_password
=
req
.
body
.
institute_password
;
const
user_type
=
"
Institute
"
;
const
newUser
=
new
userAccount
({
user_id
,
user_nic
,
user_email
,
user_password
,
user_type
});
newUser
.
save
()
.
then
(
newUser
=>
{
////////////////////////////////////////////////////////////////////////////////////
// const content = `
// Hi ${institute_name},\n
// You are Create a Institute Account on SmartCoach.\n
// You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
// Used institute email address as the username : ${user_email}
// Used given password as the password
// Thank You,
// Team SmartCoach
// `;
//
// var mail = {
// from: institute_name,
// to: user_email,
// subject: 'Email Verification - Institute',
// text: content
// }
//
// transporter.sendMail(mail, (err, data) => {
// if (err) {
// res.json({
// msg: 'fail'
// })
// } else {
// res.json({
// msg: 'success'
// })
// }
// })
// ;
/////////////////////////////////////////////////////////////////////////////////////
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
}
else
{
return
res
.
status
(
500
).
json
(
'
Email already exit
'
);
}
});
...
...
BackEnd/WebBackEnd/routes/student.route.js
View file @
efb09f29
const
router
=
require
(
'
express
'
).
Router
();
let
student
=
require
(
'
../models/student.user.model
'
);
let
userAccount
=
require
(
'
../models/userAccount.user.model
'
);
const
nodemailer
=
require
(
'
nodemailer
'
);
const
cred
=
require
(
'
../email-config/config
'
);
////////////////////////////////////////////////////////////////////////////////////////
var
transport
=
{
host
:
'
smtp.gmail.com
'
,
auth
:
{
user
:
cred
.
USER
,
pass
:
cred
.
PASS
}
}
var
transporter
=
nodemailer
.
createTransport
(
transport
);
transporter
.
verify
((
error
,
success
)
=>
{
if
(
error
)
{
console
.
log
(
error
);
}
else
{
console
.
log
(
'
Server is ready to take messages to Student
'
);
}
});
/////////////////////////////////////////////////////////////////////////////////////////////
router
.
route
(
'
/
'
).
get
((
req
,
res
)
=>
{
student
.
find
()
...
...
@@ -7,35 +31,139 @@ router.route('/').get((req,res) =>{
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
router
.
route
(
'
/add
'
).
post
((
req
,
res
)
=>
{
const
student_name
=
req
.
body
.
student_name
;
const
student_nic
=
req
.
body
.
student_nic
;
const
student_email
=
req
.
body
.
student_email
;
const
student_phone
=
req
.
body
.
student_phone
;
const
student_address
=
req
.
body
.
student_address
;
const
student_password
=
req
.
body
.
student_password
;
const
student_gender
=
req
.
body
.
student_gender
;
const
student_image
=
req
.
body
.
student_image
;
const
guardian_name
=
req
.
body
.
guardian_name
;
const
guardian_email
=
req
.
body
.
guardian_email
;
const
guardian_relationship
=
req
.
body
.
guardian_relationship
;
const
newStudent
=
new
student
({
student_name
,
student_nic
,
student_email
,
student_phone
,
student_address
,
student_password
,
student_gender
,
student_image
,
guardian_name
,
guardian_email
,
guardian_relationship
});
newStudent
.
save
()
.
then
(()
=>
res
.
json
(
'
Student Successfully Added....
'
))
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
router
.
route
(
'
/add
'
).
post
(
async
(
req
,
res
)
=>
{
//checking if the user is already exist in the database
const
user
=
await
student
.
findOne
({
student_email
:
req
.
body
.
student_email
})
if
(
!
user
){
const
student_name
=
req
.
body
.
student_name
;
const
student_nic
=
req
.
body
.
student_nic
;
const
student_email
=
req
.
body
.
student_email
;
const
student_phone
=
req
.
body
.
student_phone
;
const
student_address
=
req
.
body
.
student_address
;
const
student_password
=
req
.
body
.
student_password
;
const
student_gender
=
req
.
body
.
student_gender
;
const
student_image
=
req
.
body
.
student_image
;
const
guardian_name
=
req
.
body
.
guardian_name
;
const
guardian_email
=
req
.
body
.
guardian_email
;
const
guardian_relationship
=
req
.
body
.
guardian_relationship
;
const
newStudent
=
new
student
({
student_name
,
student_nic
,
student_email
,
student_phone
,
student_address
,
student_password
,
student_gender
,
student_image
,
guardian_name
,
guardian_email
,
guardian_relationship
});
newStudent
.
save
()
.
then
(
Student
=>
{
const
user_id
=
Student
.
id
.
toString
();
const
user_nic
=
student_nic
;
const
user_email
=
student_email
;
const
user_password
=
student_password
;
const
user_type
=
"
Student
"
;
const
newUser
=
new
userAccount
({
user_id
,
user_nic
,
user_email
,
user_password
,
user_type
});
newUser
.
save
()
.
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'
// })
// }
// })
// ;
/////////////////////////////////////////////////////////////////////////////////////
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
}
else
{
return
res
.
status
(
500
).
json
(
'
Email already exit
'
);
}
});
...
...
BackEnd/WebBackEnd/routes/tutor.route.js
View file @
efb09f29
const
router
=
require
(
'
express
'
).
Router
();
let
tutor
=
require
(
'
../models/tutor.user.model
'
);
let
userAccount
=
require
(
'
../models/userAccount.user.model
'
);
const
nodemailer
=
require
(
'
nodemailer
'
);
const
cred
=
require
(
'
../email-config/config
'
);
////////////////////////////////////////////////////////////////////////////////////////
var
transport
=
{
host
:
'
smtp.gmail.com
'
,
auth
:
{
user
:
cred
.
USER
,
pass
:
cred
.
PASS
}
}
var
transporter
=
nodemailer
.
createTransport
(
transport
);
transporter
.
verify
((
error
,
success
)
=>
{
if
(
error
)
{
console
.
log
(
error
);
}
else
{
console
.
log
(
'
Server is ready to take messages of User
'
);
}
});
/////////////////////////////////////////////////////////////////////////////////////////////
router
.
route
(
'
/
'
).
get
((
req
,
res
)
=>
{
tutor
.
find
()
...
...
@@ -7,7 +33,9 @@ router.route('/').get((req,res) =>{
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Eroor:
'
+
err
));
});
router
.
route
(
'
/add
'
).
post
((
req
,
res
)
=>
{
router
.
route
(
'
/add
'
).
post
(
async
(
req
,
res
)
=>
{
console
.
log
(
"
Tutor Registration began
"
)
const
tutor_name
=
req
.
body
.
tutor_name
;
const
tutor_nic
=
req
.
body
.
tutor_nic
;
const
tutor_email
=
req
.
body
.
tutor_email
;
...
...
@@ -19,35 +47,134 @@ router.route('/add').post((req,res) =>{
const
tutor_image
=
req
.
body
.
tutor_image
;
const
tutor_Stream
=
req
.
body
.
tutor_Stream
;
const
tutor_subjects
=
req
.
body
.
tutor_subjects
;
const
tutor_class_types
=
req
.
body
.
tutor_class_types
;
const
isOnlineClass
=
req
.
body
.
isOnlineClass
;
const
isHomeVisit
=
req
.
body
.
isHomeVisit
;
const
isInstitute
=
req
.
body
.
isInstitute
;
const
tutor_main_district
=
req
.
body
.
tutor_main_district
;
const
tutor_main_city
=
req
.
body
.
tutor_main_city
;
const
tutor_medium
=
req
.
body
.
tutor_medium
;
const
tutor_instituteID
=
req
.
body
.
tutor_instituteID
;
const
newTutor
=
new
tutor
({
tutor_name
,
tutor_nic
,
tutor_email
,
tutor_phone
,
tutor_address
,
tutor_password
,
tutor_gender
,
tutor_status
,
tutor_image
,
tutor_Stream
,
tutor_subjects
,
tutor_class_types
,
tutor_main_district
,
tutor_main_city
,
tutor_medium
,
tutor_instituteID
});
newTutor
.
save
()
.
then
(()
=>
res
.
json
(
'
Tutor Successfully Added....
'
))
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
const
tutor_instituteIDList
=
req
.
body
.
tutor_instituteIDList
;
//checking if the user is already exist in the database
const
user
=
await
tutor
.
findOne
({
tutor_email
:
req
.
body
.
tutor_email
})
if
(
!
user
){
const
newTutor
=
new
tutor
({
tutor_name
,
tutor_nic
,
tutor_email
,
tutor_phone
,
tutor_address
,
tutor_password
,
tutor_gender
,
tutor_status
,
tutor_image
,
tutor_Stream
,
tutor_subjects
,
isOnlineClass
,
isHomeVisit
,
isInstitute
,
tutor_main_district
,
tutor_main_city
,
tutor_medium
,
tutor_instituteIDList
});
newTutor
.
save
()
.
then
(
tutor
=>
{
console
.
log
(
"
Inside the New User
"
)
console
.
log
(
tutor
.
id
)
const
user_id
=
tutor
.
id
.
toString
();
const
user_nic
=
req
.
body
.
tutor_nic
;
const
user_email
=
req
.
body
.
tutor_email
;
const
user_password
=
req
.
body
.
tutor_password
;
const
user_type
=
"
Tutor
"
;
const
newUser
=
new
userAccount
({
user_id
,
user_nic
,
user_email
,
user_password
,
user_type
});
console
.
log
(
newUser
);
newUser
.
save
()
.
then
(
newUser
=>
{
console
.
log
(
"
Inside the Email Send part
"
)
////////////////////////////////////////////////////////////////////////////////////
// const content = `
// Hi ${tutor_name},\n
// You are Create a Tutor Account on SmartCoach.\n
// You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
// Used your email address as username : ${user_email}
// Thank You,
// Team SmartCoach
// `;
//
// var mail = {
// from: tutor_name,
// to: user_email,
// subject: 'Email Verification - Tutor',
// text: content
// }
//
// transporter.sendMail(mail, (err, data) => {
// if (err) {
// res.json({
// msg: 'fail'
// })
// } else {
// res.json({
// msg: 'success'
// })
// }
// })
// ;
/////////////////////////////////////////////////////////////////////////////////////
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
// res.json('Tutor Successfully Added....');
})
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
}
else
{
return
res
.
status
(
500
).
json
(
'
Email already exit
'
);
}
});
// router.route('/update/:id').post((req,res) =>{
// userAccount.findById(req.params.id, function(err, details){
// if(!details){
// req.status(404).send("data is not found");
// }
// else {
// details.confirmed = true;
//
// details.save().then( () => {
// res.json('Item update!');
// })
// .catch(err => {
// res.status(400).send("Update not possible");
// });
// }
// })
// });
module
.
exports
=
router
;
BackEnd/WebBackEnd/routes/userAccount.route.js
0 → 100644
View file @
efb09f29
const
router
=
require
(
'
express
'
).
Router
();
let
userAccount
=
require
(
'
../models/userAccount.user.model
'
);
router
.
route
(
'
/update/:id
'
).
post
((
req
,
res
)
=>
{
userAccount
.
findById
(
req
.
params
.
id
,
function
(
err
,
details
){
if
(
!
details
){
req
.
status
(
404
).
send
(
"
data is not found
"
);
}
else
{
details
.
confirmed
=
true
;
details
.
save
().
then
(
()
=>
{
res
.
json
(
'
Item update!
'
);
})
.
catch
(
err
=>
{
res
.
status
(
400
).
send
(
"
Update not possible
"
);
});
}
})
});
router
.
route
(
'
/getCredentials
'
).
post
((
req
,
res
)
=>
{
const
email
=
req
.
body
.
user_email
;
const
password
=
req
.
body
.
user_password
;
userAccount
.
find
({
user_email
:
email
,
user_password
:
password
},
function
(
err
,
User
)
{
}).
then
(
User
=>
res
.
json
(
User
))
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error:
'
+
err
));
});
module
.
exports
=
router
;
BackEnd/WebBackEnd/server.js
View file @
efb09f29
...
...
@@ -25,12 +25,14 @@ connection.once('open',() => {
const
studentRouter
=
require
(
'
./routes/student.route
'
);
const
tutorRouter
=
require
(
'
./routes/tutor.route
'
);
const
instituteRouter
=
require
(
'
./routes/institute.route
'
);
const
userAccount
=
require
(
'
./routes/userAccount.route
'
);
const
questionManage
=
require
(
'
./routes/question.route
'
);
const
financeRouter
=
require
(
'
./routes/finance.route
'
);
app
.
use
(
'
/studentSingUp
'
,
studentRouter
);
app
.
use
(
'
/tutorSingUp
'
,
tutorRouter
);
app
.
use
(
'
/instituteSingUp
'
,
instituteRouter
);
app
.
use
(
'
/userAccount
'
,
userAccount
);
app
.
use
(
'
/questions
'
,
questionManage
);
app
.
use
(
'
/admin/finance
'
,
financeRouter
);
...
...
WebFrontEnd/smartcoach-frontend/package-lock.json
View file @
efb09f29
...
...
@@ -12472,6 +12472,16 @@
"resolved"
:
"https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz"
,
"integrity"
:
"sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
"react-notify-toast"
:
{
"version"
:
"0.5.1"
,
"resolved"
:
"https://registry.npmjs.org/react-notify-toast/-/react-notify-toast-0.5.1.tgz"
,
"integrity"
:
"sha512-VCTuvykAj3IBVX1ecVRxpo8csBJVGhKdJF4qk8c59nxbE4FPWmNpSAzyAMNNd0Mnxfwk8DA6Z0x8C/S0wCbbqg=="
,
"dev"
:
true
,
"requires"
:
{
"object-assign"
:
"^4.0.0"
,
"prop-types"
:
"^15.5.8"
}
},
"react-refresh"
:
{
"version"
:
"0.8.3"
,
"resolved"
:
"https://registry.npmjs.org/react-refresh/-/react-refresh-0.8.3.tgz"
,
...
...
WebFrontEnd/smartcoach-frontend/package.json
View file @
efb09f29
...
...
@@ -41,6 +41,7 @@
]
},
"devDependencies"
:
{
"axios"
:
"^0.21.1"
"axios"
:
"^0.21.1"
,
"react-notify-toast"
:
"^0.5.1"
}
}
WebFrontEnd/smartcoach-frontend/src/App.js
View file @
efb09f29
...
...
@@ -8,6 +8,8 @@ import Login from "./Components/Login";
import
ItemNav
from
"
./Components/Navbar
"
;
import
Home
from
"
./Components/Home
"
;
import
SignUp
from
"
./Components/SignUp
"
;
import
beforeConfirmation
from
"
./Components/beforeConfirmation
"
;
import
VerifiedAccount
from
"
./Components/AccountVerified
"
;
import
Dashboard
from
"
./Components/Admin/Dashboard
"
;
import
QuestionDetails
from
"
./Components/IT18050240/question_details
"
import
QuestionLayout
from
"
./Components/IT18050240/question_layout
"
...
...
@@ -22,6 +24,8 @@ function App() {
<
Route
path
=
"
/UserLogin
"
exact
component
=
{
Login
}
/
>
<
Route
path
=
"
/Home
"
exact
component
=
{
Home
}
/
>
<
Route
path
=
"
/SignUp
"
exact
component
=
{
SignUp
}
/
>
<
Route
path
=
"
/beforeConfirm
"
exact
component
=
{
beforeConfirmation
}
/
>
<
Route
path
=
"
/AccountVerified/:id
"
exact
component
=
{
VerifiedAccount
}
/
>
{
/*<Route path="/" exact component={Dashboard}/>*/
}
<
Switch
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/AccountVerified.js
0 → 100644
View file @
efb09f29
import
React
,
{
Component
}
from
"
react
"
;
import
VerifiedIcon
from
"
../Images/verified.png
"
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
"
../Config/config
"
;
export
default
class
AccountVerified
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
id
:
''
};
}
componentDidMount
()
{
console
.
log
(
this
.
props
.
match
.
params
.
id
)
this
.
setState
({
id
:
this
.
props
.
match
.
params
.
id
},
()
=>
{
axios
.
post
(
configs
.
BASE_URL
+
'
/userAccount/update/
'
+
this
.
state
.
id
)
})
}
render
()
{
return
(
<
div
className
=
"
container
"
style
=
{{
padding
:
'
10px
'
}}
>
<
div
style
=
{{
width
:
'
50%
'
,
margin
:
'
auto
'
,
marginTop
:
'
7%
'
,
padding
:
'
10px
'
,
paddingBottom
:
'
30px
'
,
border
:
'
solid
'
,
borderColor
:
'
#216E9B
'
}}
>
<
div
className
=
"
row
"
style
=
{{
display
:
'
contents
'
}}
>
<
img
src
=
{
VerifiedIcon
}
style
=
{{
width
:
'
80px
'
,
height
:
'
90px
'
}}
/
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
10px
'
,
marginBottom
:
'
0px
'
,
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
h2
style
=
{{
fontFamily
:
'
emoji
'
,
color
:
'
#265077
'
,
margin
:
'
0px
'
,
textAlign
:
'
center
'
}}
>
Your
Email
is
Verified
<
/h2
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
5px
'
,
marginBottom
:
'
0px
'
,
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
br
/>
<
span
>
Your
Account
has
been
successfully
verified
.
Thank
you
for
join
with
SmartCoach
.
Now
you
can
start
tutoring
in
SmartCoach
.
<
/span
>
<
br
/>
<
span
>
You
can
login
with
your
credentials
.
<
/span
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
20px
'
,
marginBottom
:
'
0px
'
,
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
a
href
=
"
/UserLogin
"
type
=
"
submit
"
className
=
"
profile-edit-btn nav-link btn btn-primary
"
name
=
"
btnAddMore
"
style
=
{{
marginTop
:
'
20px
'
,
marginBottom
:
'
30px
'
,
width
:
'
50%
'
,
backgroundColor
:
'
#265077
'
,
borderColor
:
'
#216E9B
'
,
fontSize
:
'
12px
'
}}
>
Sign
In
<
/a
>
<
/div
>
<
/div
>
<
/div
>
)
}
}
\ No newline at end of file
WebFrontEnd/smartcoach-frontend/src/Components/Home.js
View file @
efb09f29
...
...
@@ -9,6 +9,7 @@ import Star from "../Images/star.png";
import
ReviewImg
from
"
../Images/note.png
"
;
import
Calender
from
"
../Images/calender.png
"
;
import
StarBackGround
from
"
../Images/starboarder.png
"
;
import
ItemNav
from
"
./Navbar
"
;
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
...
...
@@ -62,8 +63,16 @@ export default class Home extends Component{
render
()
{
return
(
<
div
className
=
"
App
"
style
=
{{
padding
:
'
10px
'
,
paddingTop
:
'
0px
'
}}
>
<
div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
width
:
'
100%
'
}}
>
<
ItemNav
/>
<
/div
>
<
div
className
=
"
row
"
>
<
img
src
=
{
MianImage
}
style
=
{{
width
:
'
100%
'
,
height
:
'
250px
'
}}
/
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginRight
:
'
50px
'
,
marginLeft
:
'
50px
'
,
padding
:
'
5px
'
,
background
:
'
#1E4258
'
}}
>
<
div
className
=
"
col-4
"
style
=
{{
margin
:
'
5px
'
,
border
:
'
solid
'
,
padding
:
'
10px
'
,
borderColor
:
'
#216E9B
'
}}
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Login.js
View file @
efb09f29
import
React
,
{
Component
}
from
"
react
"
;
import
ItemNav
from
"
./Navbar
"
;
import
axios
from
"
axios
"
;
export
default
class
Login
extends
Component
{
...
...
@@ -21,29 +22,40 @@ export default class Login extends Component{
e
.
preventDefault
();
const
LogUser
=
{
email
:
this
.
state
.
email
,
password
:
this
.
state
.
password
user_
email
:
this
.
state
.
email
,
user_
password
:
this
.
state
.
password
}
const
email
=
this
.
state
.
email
;
// axios.post('http://localhost:5000/newUser/getCredentials', LogUser)
// .then(response => {
// console.log(response.data);
// if (response.data.length > 0) {
// console.log(response.data);
// console.log(response.data.password);
//
// localStorage.setItem("Name",response.data[0].name);
// localStorage.setItem("userID",response.data[0].id);
// window.location = '/Places';
// }
// else {
// alert("Email or Password Invalid!!!")
// }
//
//
// });
axios
.
post
(
'
http://localhost:5000/userAccount/getCredentials
'
,
LogUser
)
.
then
(
response
=>
{
console
.
log
(
response
.
data
);
if
(
response
.
data
.
length
>
0
)
{
console
.
log
(
response
.
data
);
console
.
log
(
response
.
data
.
password
);
// localStorage.setItem("Name",response.data[0].name);
// localStorage.setItem("userID",response.data[0].id);
if
(
response
.
data
[
0
].
user_type
===
'
Student
'
){
window
.
location
=
'
/Home
'
;
}
else
if
(
response
.
data
[
0
].
user_type
===
'
Tutor
'
){
window
.
location
=
'
/admin
'
;
}
else
if
(
response
.
data
[
0
].
user_type
===
'
Institute
'
){
window
.
location
=
'
/admin
'
;
}
//window.location = '/Places';
}
else
{
alert
(
"
Email or Password Invalid!!!
"
)
}
});
}
...
...
@@ -62,69 +74,72 @@ export default class Login extends Component{
render
()
{
return
(
<
div
className
=
"
container
"
style
=
{{
padding
:
'
10px
'
}}
>
<
div
>
<
div
style
=
{{
width
:
'
30%
'
,
margin
:
'
auto
'
,
marginTop
:
'
7%
'
,
padding
:
'
0px
'
,
paddingBottom
:
'
30px
'
,
border
:
'
solid
'
,
borderColor
:
'
#216E9B
'
}}
>
<
form
onSubmit
=
{
this
.
onSubmit
}
id
=
"
login
"
name
=
"
login
"
className
=
"
login
"
>
<
div
className
=
"
row
"
>
<
br
/>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
h3
style
=
{{
fontFamily
:
'
emoji
'
,
color
:
'
#265077
'
,
margin
:
'
20px
'
,
textAlign
:
'
center
'
}}
><
b
>
Login
<
/b></
h3
>
<
/div
>
<
div
>
<
div
className
=
"
row
"
style
=
{{
width
:
'
100%
'
,
margin
:
'
0px
'
}}
>
<
ItemNav
/>
<
/div
>
<
div
className
=
"
container
"
style
=
{{
padding
:
'
10px
'
}}
>
<
div
style
=
{{
width
:
'
35%
'
,
margin
:
'
auto
'
,
marginTop
:
'
7%
'
,
padding
:
'
0px
'
,
paddingBottom
:
'
30px
'
,
border
:
'
solid
'
,
borderColor
:
'
#216E9B
'
}}
>
<
form
onSubmit
=
{
this
.
onSubmit
}
id
=
"
login
"
name
=
"
login
"
className
=
"
login
"
>
<
div
className
=
"
row
"
>
<
br
/>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
h3
style
=
{{
fontFamily
:
'
emoji
'
,
color
:
'
#265077
'
,
margin
:
'
20px
'
,
textAlign
:
'
center
'
}}
><
b
>
Login
<
/b></
h3
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
label
style
=
{{
fontFamily
:
'
emoji
'
,
color
:
'
#A9BCC8
'
}}
>
Use
your
credentials
to
login
<
/label
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
5px
'
}}
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
10px
'
,
marginBottom
:
'
10px
'
}}
>
<
div
className
=
"
col-1
"
>
<
div
className
=
"
row
"
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
label
style
=
{{
fontFamily
:
'
emoji
'
,
color
:
'
#A9BCC8
'
}}
>
Use
your
credentials
to
login
<
/label
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
margin
:
'
5px
'
}}
>
<
/div
>
<
div
className
=
"
col-10
"
>
<
input
type
=
"
email
"
id
=
"
email
"
className
=
"
form-control
"
placeholder
=
"
UserName
"
onChange
=
{
this
.
onChangeEmail
}
required
/>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
10px
'
,
marginBottom
:
'
10px
'
}}
>
<
div
className
=
"
col-1
"
>
<
/div
>
<
div
className
=
"
col-10
"
>
<
input
type
=
"
email
"
id
=
"
email
"
className
=
"
form-control
"
placeholder
=
"
UserName
"
onChange
=
{
this
.
onChangeEmail
}
required
/>
<
/div
>
<
div
className
=
"
col-1
"
>
<
/div
>
<
/div
>
<
div
className
=
"
col-1
"
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
10px
'
,
marginBottom
:
'
10px
'
}}
>
<
div
className
=
"
col-1
"
>
<
/div
>
<
div
className
=
"
col-10
"
>
<
input
type
=
"
password
"
id
=
"
password
"
className
=
"
form-control
"
placeholder
=
"
Password
"
onChange
=
{
this
.
onChangePassword
}
required
/>
<
/div
>
<
div
className
=
"
col-1
"
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
10px
'
,
marginBottom
:
'
10px
'
}}
>
<
div
className
=
"
col-1
"
>
<
div
className
=
"
row
"
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
label
style
=
{{
fontFamily
:
'
emoji
'
,
color
:
'
#2353BA
'
}}
>
Forgot
Password
???
<
/label
>
<
/div
>
<
div
className
=
"
col-10
"
>
<
input
type
=
"
password
"
id
=
"
password
"
className
=
"
form-control
"
placeholder
=
"
Password
"
onChange
=
{
this
.
onChangePassword
}
required
/
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
5px
'
,
marginBottom
:
'
5px
'
,
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
button
type
=
"
submit
"
className
=
"
btn btn-primary
"
style
=
{{
width
:
'
50%
'
,
marginTop
:
'
0px
'
,
backgroundColor
:
'
#265077
'
,
borderColor
:
'
#216E9B
'
}}
><
b
>
Sign
In
<
/b></
button
>
<
/div
>
<
div
className
=
"
col-1
"
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
0px
'
,
marginBottom
:
'
5px
'
,
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
a
href
=
"
/SignUp
"
type
=
"
submit
"
className
=
"
profile-edit-btn nav-link btn btn-primary
"
name
=
"
btnAddMore
"
style
=
{{
marginTop
:
'
0px
'
,
marginBottom
:
'
20px
'
,
width
:
'
50%
'
,
backgroundColor
:
'
#2D5F5D
'
,
borderColor
:
'
#216E9B
'
,
fontSize
:
'
12px
'
}}
>
Sign
Up
<
/a
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
label
style
=
{{
fontFamily
:
'
emoji
'
,
color
:
'
#2353BA
'
}}
>
Forgot
Password
???
<
/label
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
5px
'
,
marginBottom
:
'
5px
'
,
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
button
type
=
"
submit
"
className
=
"
btn btn-primary
"
style
=
{{
width
:
'
50%
'
,
marginTop
:
'
0px
'
,
backgroundColor
:
'
#265077
'
,
borderColor
:
'
#216E9B
'
}}
><
b
>
Sign
In
<
/b></
button
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
marginTop
:
'
0px
'
,
marginBottom
:
'
5px
'
,
display
:
'
flex
'
,
justifyContent
:
'
center
'
}}
>
<
a
href
=
"
/SignUp
"
type
=
"
submit
"
className
=
"
profile-edit-btn nav-link btn btn-primary
"
name
=
"
btnAddMore
"
style
=
{{
marginTop
:
'
0px
'
,
marginBottom
:
'
20px
'
,
width
:
'
50%
'
,
backgroundColor
:
'
#2D5F5D
'
,
borderColor
:
'
#216E9B
'
,
fontSize
:
'
12px
'
}}
>
Sign
Up
<
/a
>
<
/div
>
<
/form
>
<
/div
>
<
/form
>
<
/div
>
<
/div
>
<
/div
>
)
...
...
WebFrontEnd/smartcoach-frontend/src/Components/SignUp.js
View file @
efb09f29
import
React
,
{
Component
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
"
../Config/config
"
;
import
ItemNav
from
"
./Navbar
"
;
export
default
class
SignUp
extends
Component
{
...
...
@@ -58,6 +59,10 @@ export default class SignUp extends Component {
tutorStream
:
''
,
city
:
''
,
medium
:
''
,
InstituteCity
:
''
,
InstituteStreet
:
''
,
InstituteApartment
:
''
,
InstituteRegistrationNo
:
''
,
}
...
...
@@ -96,10 +101,22 @@ export default class SignUp extends Component {
this
.
onChangeInstituteHomeVisitCheckBox
=
this
.
onChangeInstituteHomeVisitCheckBox
.
bind
(
this
);
this
.
onChangeStream
=
this
.
onChangeStream
.
bind
(
this
);
this
.
OnChangeMedium
=
this
.
OnChangeMedium
.
bind
(
this
);
this
.
OnChangeInstituteApartment
=
this
.
OnChangeInstituteApartment
.
bind
(
this
);
this
.
OnChangeInstituteStreet
=
this
.
OnChangeInstituteStreet
.
bind
(
this
);
this
.
OnChangeInstituteCity
=
this
.
OnChangeInstituteCity
.
bind
(
this
);
this
.
OnChangeInstituteRegistrationNo
=
this
.
OnChangeInstituteRegistrationNo
.
bind
(
this
);
}
componentDidMount
()
{
axios
.
get
(
configs
.
BASE_URL
+
'
/instituteSingUp/
'
)
.
then
(
response
=>
{
if
(
response
.
data
.
length
>
0
){
console
.
log
(
response
.
data
);
this
.
setState
({
instituteList
:
response
.
data
})
}
})
}
...
...
@@ -188,8 +205,11 @@ export default class SignUp extends Component {
onChangeInstituteDropDown
(
value
)
{
// console.log(value);
// console.log(value.target);
// console.log(value.id);
this
.
setState
({
newInstitute
:
value
newInstitute
:
value
.
target
.
value
})
}
...
...
@@ -212,7 +232,7 @@ export default class SignUp extends Component {
})
console
.
log
(
"
Subject List :
"
+
oldInstitute
);
console
.
log
(
"
Institute List :
"
+
this
.
state
.
userSelectedInstitutes
);
}
}
...
...
@@ -407,31 +427,57 @@ export default class SignUp extends Component {
}
onChangeStatus
(
e
){
this
.
setState
({
marriageStatus
:
e
.
target
.
value
marriageStatus
:
e
});
}
OnChangeCity
(
e
){
this
.
setState
({
city
:
e
.
target
.
value
city
:
e
});
}
onChangeStream
(
e
){
this
.
setState
({
tutorStream
:
e
.
target
.
value
tutorStream
:
e
});
}
OnChangeMedium
(
e
){
this
.
setState
({
medium
:
e
.
target
.
value
medium
:
e
});
}
OnChangeInstituteApartment
(
e
){
this
.
setState
({
InstituteApartment
:
e
.
target
.
value
});
}
OnChangeInstituteStreet
(
e
){
this
.
setState
({
InstituteStreet
:
e
.
target
.
value
});
}
OnChangeInstituteCity
(
e
){
this
.
setState
({
InstituteCity
:
e
.
target
.
value
});
}
OnChangeInstituteRegistrationNo
(
e
){
this
.
setState
({
InstituteRegistrationNo
:
e
.
target
.
value
});
}
SetToDefault
(){
...
...
@@ -448,6 +494,12 @@ export default class SignUp extends Component {
guardian_email
:
''
,
guardian_relationship
:
''
,
isConditionChecked
:
false
,
institutePhoneNoOnChange
:
''
,
tempInstitutePhoneList
:
''
,
InstituteApartment
:
''
,
InstituteStreet
:
''
,
InstituteCity
:
''
,
})
...
...
@@ -471,15 +523,64 @@ export default class SignUp extends Component {
}
axios
.
post
(
configs
.
BASE_URL
+
'
/studentSingUp/add
'
,
student
)
.
then
(
res
=>
console
.
log
(
res
.
data
));
if
(
this
.
state
.
email
===
this
.
state
.
guardianEmail
){
alert
(
"
Please give guardian correct email address...
"
);
}
else
{
axios
.
post
(
configs
.
BASE_URL
+
'
/studentSingUp/add
'
,
student
)
.
then
(
res
=>
{
console
.
log
(
"
Inside Then
"
)
window
.
location
=
'
/beforeConfirm
'
})
.
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
){
alert
(
"
Your Email Already Registered.
"
)
}
}
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);
});
}
}
onSubmitTutor
(
e
){
e
.
preventDefault
();
const
student
=
{
const
instituteIDs
=
[];
if
(
this
.
state
.
userSelectedInstitutes
.
length
>
0
){
this
.
state
.
userSelectedInstitutes
.
map
(
inst
=>
{
this
.
state
.
instituteList
.
map
(
name
=>
{
if
(
inst
===
name
.
institute_name
){
instituteIDs
.
push
(
name
.
_id
);
}
})
}
)
}
console
.
log
(
'
ID Lists :
'
+
instituteIDs
)
const
Tutor
=
{
tutor_name
:
this
.
state
.
name
,
tutor_nic
:
this
.
state
.
nic
,
tutor_email
:
this
.
state
.
email
,
...
...
@@ -491,44 +592,109 @@ export default class SignUp extends Component {
tutor_image
:
''
,
tutor_Stream
:
this
.
state
.
tutorStream
,
tutor_subjects
:
this
.
state
.
tempSubjectList
,
guardian_email
:
this
.
state
.
guardianEmail
,
guardian_relationship
:
this
.
state
.
relationship
,
isOnlineClass
:
this
.
state
.
isCheckedInstituteOnlineClass
,
isHomeVisit
:
this
.
state
.
isCheckedInstituteHomeVisit
,
isInstitute
:
this
.
state
.
isCheckedInstitute
,
tutor_instituteIDList
:
instituteIDs
,
tutor_main_district
:
this
.
state
.
district
,
tutor_main_city
:
this
.
state
.
city
,
tutor_medium
:
this
.
state
.
medium
}
console
.
log
(
Tutor
)
axios
.
post
(
configs
.
BASE_URL
+
'
/tutorSingUp/add
'
,
Tutor
)
.
then
(
res
=>
{
console
.
log
(
"
Inside Then
"
)
window
.
location
=
'
/beforeConfirm
'
})
.
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
){
alert
(
"
Your Email Already Registered.
"
)
}
axios
.
post
(
configs
.
BASE_URL
+
'
/studentSingUp/add
'
,
student
)
.
then
(
res
=>
console
.
log
(
res
.
data
));
}
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);
});
}
onSubmitInstitute
(
e
){
e
.
preventDefault
();
const
student
=
{
student_name
:
this
.
state
.
name
,
student_nic
:
this
.
state
.
nic
,
student_email
:
this
.
state
.
email
,
student_phone
:
this
.
state
.
phoneNo
,
student_address
:
this
.
state
.
address
,
student_password
:
this
.
state
.
password
,
student_gender
:
this
.
state
.
gender
,
student_image
:
''
,
guardian_name
:
this
.
state
.
guardianName
,
guardian_email
:
this
.
state
.
guardianEmail
,
guardian_relationship
:
this
.
state
.
relationship
,
const
instAddress
=
this
.
state
.
InstituteApartment
+
"
,
"
+
this
.
state
.
InstituteStreet
+
"
,
"
+
this
.
state
.
InstituteCity
;
const
institute
=
{
institute_name
:
this
.
state
.
name
,
institute_email
:
this
.
state
.
email
,
institute_phones
:
this
.
state
.
uerAddedInstitutePhoneList
,
institute_address
:
instAddress
,
institute_city
:
this
.
state
.
InstituteCity
,
institute_password
:
this
.
state
.
password
,
institute_registrationNo
:
this
.
state
.
InstituteRegistrationNo
,
institute_image
:
''
,
}
this
.
SetToDefault
();
console
.
log
(
institute
);
axios
.
post
(
configs
.
BASE_URL
+
'
/instituteSingUp/add
'
,
institute
)
.
then
(
res
=>
{
console
.
log
(
"
Inside Then
"
)
window
.
location
=
'
/beforeConfirm
'
})
.
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
){
alert
(
"
Your Email Already Registered.
"
)
}
}
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);
});
axios
.
post
(
configs
.
BASE_URL
+
'
/studentSingUp/add
'
,
student
)
.
then
(
res
=>
console
.
log
(
res
.
data
));
}
render
()
{
return
(
<
div
className
=
"
container
"
style
=
{{
paddingTop
:
'
50px
'
}}
>
<
div
>
<
div
>
<
div
className
=
"
row
"
style
=
{{
width
:
'
100%
'
,
margin
:
'
0px
'
}}
>
<
ItemNav
/>
<
/div
>
<
div
className
=
"
container
"
style
=
{{
paddingTop
:
'
50px
'
}}
>
<
div
style
=
{{
width
:
'
50%
'
,
...
...
@@ -1091,7 +1257,7 @@ export default class SignUp extends Component {
<
/div
>
<
div
className
=
"
col-10
"
style
=
{{
textAlign
:
'
-webkit-center
'
}}
>
<
input
type
=
"
text
"
id
=
"
stdpsw
"
className
=
"
form-control
"
<
input
type
=
"
password
"
id
=
"
stdpsw
"
className
=
"
form-control
"
placeholder
=
"
password
"
onChange
=
{
this
.
onChangePassword
}
style
=
{{
width
:
'
90%
'
}}
required
/>
<
/div
>
...
...
@@ -1221,7 +1387,7 @@ export default class SignUp extends Component {
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
required
/>
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
}}
>
Online
Class
<
/label
>
<
/div
>
...
...
@@ -1236,7 +1402,7 @@ export default class SignUp extends Component {
marginLeft
:
'
25px
'
,
marginTop
:
'
15px
'
}}
required
/>
/
>
<
label
style
=
{{
marginTop
:
'
15px
'
,
float
:
'
left
'
,
marginLeft
:
'
20px
'
}}
>
Home
Visit
<
/label
>
<
/div
>
...
...
@@ -1259,7 +1425,7 @@ export default class SignUp extends Component {
marginLeft
:
'
25px
'
,
marginTop
:
'
0px
'
}}
required
/>
/
>
<
label
style
=
{{
marginTop
:
'
0px
'
,
float
:
'
left
'
,
...
...
@@ -1291,11 +1457,11 @@ export default class SignUp extends Component {
<
/div
>
<
div
className
=
"
col-8
"
style
=
{{
textAlign
:
'
-webkit-center
'
}}
>
<
select
className
=
"
form-control
"
style
=
{{
width
:
'
90%
'
}}
onChange
=
{
e
=>
this
.
onChangeInstituteDropDown
(
e
.
target
.
value
)}
>
onChange
=
{
e
=>
this
.
onChangeInstituteDropDown
(
e
)}
>
<
option
value
=
""
disabled
selected
>
Select
Institute
(
s
)
<
/option
>
{
this
.
state
.
instituteList
.
map
((
dis
)
=>
<
option
key
=
{
dis
}
value
=
{
dis
}
>
{
dis
}
<
/option>
)
}
{
this
.
state
.
instituteList
.
map
((
dis
)
=>
<
option
key
=
{
dis
.
_id
}
id
=
{
dis
.
_id
}
value
=
{
dis
.
institute_name
}
>
{
dis
.
institute_name
}
<
/option>
)
}
<
/select
>
<
/div
>
<
div
className
=
"
col-3
"
>
...
...
@@ -1457,7 +1623,7 @@ export default class SignUp extends Component {
:
<
div
>
<
form
onSubmit
=
{
this
.
onSubmit
}
id
=
"
signup
"
name
=
"
signup
"
className
=
"
signup
"
>
<
form
onSubmit
=
{
this
.
onSubmit
Institute
}
id
=
"
signup
"
name
=
"
signup
"
className
=
"
signup
"
>
<
div
className
=
"
row
"
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
,
marginTop
:
'
0px
'
}}
>
<
h5
style
=
{{
marginTop
:
'
30px
'
,
color
:
'
#8c8c8c
'
}}
>
INSTITUTE
DETAILS
<
/h5
>
...
...
@@ -1480,7 +1646,7 @@ export default class SignUp extends Component {
<
/div
>
<
div
className
=
"
col-10
"
style
=
{{
textAlign
:
'
-webkit-center
'
}}
>
<
input
type
=
"
text
"
id
=
"
InstituteName
"
className
=
"
form-control
"
placeholder
=
"
Name of Institute
"
onChange
=
{
this
.
onChange
Email
}
placeholder
=
"
Name of Institute
"
onChange
=
{
this
.
onChange
Name
}
style
=
{{
width
:
'
90%
'
}}
required
/>
<
/div
>
<
div
className
=
"
col-1
"
>
...
...
@@ -1569,7 +1735,7 @@ export default class SignUp extends Component {
<
/div
>
<
div
className
=
"
col-10
"
style
=
{{
textAlign
:
'
-webkit-center
'
}}
>
<
input
type
=
"
email
"
id
=
"
instEmail
"
className
=
"
form-control
"
placeholder
=
"
Email
"
onChange
=
{
this
.
onChange
Password
}
placeholder
=
"
Email
"
onChange
=
{
this
.
onChange
Email
}
style
=
{{
width
:
'
90%
'
}}
required
/>
<
/div
>
<
div
className
=
"
col-1
"
>
...
...
@@ -1593,7 +1759,7 @@ export default class SignUp extends Component {
<
/div
>
<
div
className
=
"
col-10
"
style
=
{{
textAlign
:
'
-webkit-center
'
}}
>
<
input
type
=
"
text
"
id
=
"
stdAddress
"
className
=
"
form-control
"
placeholder
=
"
Apartment #
"
onChange
=
{
this
.
onChangePassword
}
placeholder
=
"
Apartment #
"
onChange
=
{
this
.
OnChangeInstituteApartment
}
style
=
{{
width
:
'
90%
'
}}
required
/>
<
/div
>
<
div
className
=
"
col-1
"
>
...
...
@@ -1606,7 +1772,7 @@ export default class SignUp extends Component {
<
/div
>
<
div
className
=
"
col-10
"
style
=
{{
textAlign
:
'
-webkit-center
'
}}
>
<
input
type
=
"
text
"
id
=
"
stdAddress
"
className
=
"
form-control
"
placeholder
=
"
Street
"
onChange
=
{
this
.
onChangePassword
}
placeholder
=
"
Street
"
onChange
=
{
this
.
OnChangeInstituteStreet
}
style
=
{{
width
:
'
90%
'
}}
required
/>
<
/div
>
<
div
className
=
"
col-1
"
>
...
...
@@ -1619,7 +1785,7 @@ export default class SignUp extends Component {
<
/div
>
<
div
className
=
"
col-10
"
style
=
{{
textAlign
:
'
-webkit-center
'
}}
>
<
input
type
=
"
text
"
id
=
"
stdAddress
"
className
=
"
form-control
"
placeholder
=
"
City
"
onChange
=
{
this
.
onChangePassword
}
placeholder
=
"
City
"
onChange
=
{
this
.
OnChangeInstituteCity
}
style
=
{{
width
:
'
90%
'
}}
required
/>
<
/div
>
<
div
className
=
"
col-1
"
>
...
...
@@ -1643,7 +1809,7 @@ export default class SignUp extends Component {
<
/div
>
<
div
className
=
"
col-10
"
style
=
{{
textAlign
:
'
-webkit-center
'
}}
>
<
input
type
=
"
text
"
id
=
"
regNo
"
className
=
"
form-control
"
placeholder
=
"
Company Registration Number
"
onChange
=
{
this
.
onChangePassword
}
placeholder
=
"
Company Registration Number
"
onChange
=
{
this
.
OnChangeInstituteRegistrationNo
}
style
=
{{
width
:
'
90%
'
}}
required
/>
<
/div
>
<
div
className
=
"
col-1
"
>
...
...
@@ -1666,7 +1832,7 @@ export default class SignUp extends Component {
<
/div
>
<
div
className
=
"
col-10
"
style
=
{{
textAlign
:
'
-webkit-center
'
}}
>
<
input
type
=
"
text
"
id
=
"
stdpsw
"
className
=
"
form-control
"
<
input
type
=
"
password
"
id
=
"
stdpsw
"
className
=
"
form-control
"
placeholder
=
"
password
"
onChange
=
{
this
.
onChangePassword
}
style
=
{{
width
:
'
90%
'
}}
required
/>
<
/div
>
...
...
@@ -1681,7 +1847,7 @@ export default class SignUp extends Component {
<
/div
>
<
div
className
=
"
col-10
"
>
<
input
type
=
"
checkbox
"
id
=
"
condition
"
className
=
"
form-control
"
onChange
=
{
this
.
onChange
Password
}
onChange
=
{
this
.
onChange
ConditionCheckBox
}
style
=
{{
width
:
'
20px
'
,
height
:
'
20px
'
,
...
...
WebFrontEnd/smartcoach-frontend/src/Components/beforeConfirmation.js
0 → 100644
View file @
efb09f29
import
React
,
{
Component
}
from
"
react
"
;
import
ItemNav
from
"
./Navbar
"
;
import
ConfirmEmail
from
"
../Images/confirmemail.png
"
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
"
../Config/config
"
;
export
default
class
beforeConfirmation
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
sNameList
:
[
'
Saman Deshapriya
'
,
'
Kamal Perera
'
,
'
asiri Deshapriya
'
,
'
Kelumsiri Perera
'
,
'
sahan Perera
'
,
'
Shaminda Perera
'
,
'
Kelum Perera
'
,
'
Kamal Surawera
'
,
'
damith madushan
'
,
'
kithmal Perera
'
,
'
banuka Perera
'
,
'
Kelumsiri Deshapriya
'
,
'
sahan Deshapriya
'
,
'
Shaminda Rajapaksha
'
,
'
Kelum Rajapaksha
'
,
'
Sunil madushan
'
,
'
kithmal Perera
'
,
'
Sumin Perera
'
,
'
asiri Rajapaksha
'
,
'
banuka Rajapaksha
'
,
'
Shamin Rajapaksha
'
,
'
Kelum Deshapriya
'
,
'
Sunil Akalanka
'
,
'
kithmal Akalanka
'
,
'
Sumin Akalanka
'
,
'
asiri Akalanka
'
,
'
banuka Akalanka
'
,
'
Shamin Akalanka
'
,
'
Kelum Athukorala
'
,
'
Sunil Athukorala
'
,
'
kithmal Athukorala
'
,
'
Sumin Athukorala
'
,
'
asiri Athukorala
'
,
'
banuka Athukorala
'
,
'
Shamin Athukorala
'
,
'
Kelum Pandula
'
,
'
Sunil Pandula
'
,
'
kithmal Pandula
'
,
'
Sumin Pandula
'
,
'
asiri Pandula
'
,
'
banuka Pandula
'
,
'
Shamin Pandula
'
,
'
Nuwan Pandula
'
,
'
Deemantha Pandula
'
,
'
Eashan Yoshitha
'
,
'
Madura Fernando
'
,
'
asiri Fernando
'
,
'
banuka Fernando
'
,
'
Shamin Fernando
'
,
'
Nuwan Fernando
'
,
'
Deemantha Fernando
'
,
'
Eashan Fernando
'
,
'
Madura Perera
'
,
'
Dasun Shanaka
'
,
'
Dinuka Fernando
'
,
'
Amal Fernando
'
],
sNameList2
:
[
'
Hemal Perera
'
,
'
Kithmal weeraraththne
'
,
'
Chaitha Dias
'
],
};
this
.
onSubmitStudent
=
this
.
onSubmitStudent
.
bind
(
this
);
}
onSubmitStudent
(){
let
NIC
=
981617300
;
const
fnameList
=
[
'
Lasitha
'
,
'
Thusitha
'
,
'
Bathika
'
,
'
Sameera
'
,
'
Kalana
'
,
'
Hirusha
'
,
'
Nipuna
'
,
'
Umesh
'
,
'
Rahal
'
,
'
Sachintha
'
,
'
Lasan
'
,
'
Kishara
'
,
'
Rasitha
'
,
'
Yehan
'
,
'
Yenuka
'
,
'
Thisara
'
,
'
Malindu
'
,
'
Milinda
'
,
'
Tharaka
'
,
'
Hansaka
'
,]
const
girlsList
=
[
'
Sammani
'
,
'
Tharaki
'
,
'
Tinali
'
,
'
Shanu
'
,
'
Divyani
'
,
'
Thakshila
'
,
'
Surangi
'
,
'
Sandani
'
,
'
Samadhi
'
,
'
Kavisha
'
,
'
Dilhani
'
,
'
Anusari
'
,
'
Kethaki
'
,
'
Gayathra
'
,
'
Ishanka
'
,
'
Samudhi
'
,
'
Shehani
'
,
'
Tharumini
'
,
'
Kasuni
'
,
'
Kalani
'
]
const
lName
=
'
Kempitiya
'
girlsList
.
map
(
name
=>
{
let
studentNIC
=
NIC
+
'
V
'
;
let
studentName
=
name
+
'
'
+
lName
;
const
res
=
studentName
.
replace
(
/ /g
,
''
)
let
studentEmail
=
res
.
toLowerCase
()
+
'
@gmail.com
'
;
let
studentPsw
=
'
Abc@123
'
;
const
student
=
{
student_name
:
studentName
,
student_nic
:
studentNIC
,
student_email
:
studentEmail
,
student_phone
:
'
0719855824
'
,
student_address
:
'
Colombo
'
,
student_password
:
studentPsw
,
student_gender
:
'
Female
'
,
student_image
:
''
,
guardian_name
:
'
ABC
'
,
guardian_email
:
'
abc@gmail.com
'
,
guardian_relationship
:
'
Mother
'
,
}
axios
.
post
(
configs
.
BASE_URL
+
'
/studentSingUp/add
'
,
student
)
.
then
(
res
=>
{
//console.log("Inside Then")
setTimeout
(()
=>
{
console
.
log
(
"
World!
"
);
},
2000
);
})
setTimeout
(()
=>
{
console
.
log
(
"
World!
"
);
},
2000
);
NIC
=
NIC
+
1
;
})
}
render
()
{
return
(
<
div
>
<
div
className
=
"
row
"
style
=
{{
width
:
'
100%
'
}}
>
<
ItemNav
/>
<
/div
>
<
div
style
=
{{
width
:
'
50%
'
,
margin
:
'
auto
'
,
marginTop
:
'
7%
'
,
padding
:
'
10px
'
,
paddingBottom
:
'
30px
'
,
border
:
'
solid
'
,
borderColor
:
'
#216E9B
'
}}
>
<
div
className
=
"
row
"
style
=
{{
display
:
'
contents
'
}}
>
<
img
src
=
{
ConfirmEmail
}
style
=
{{
width
:
'
300
'
,
height
:
'
300px
'
}}
/
>
<
/div
>
<
div
className
=
"
row
"
style
=
{{
padding
:
'
40px
'
}}
>
<
span
>
Your
Account
has
been
successfully
registered
.
To
complete
the
process
please
check
your
email
for
a
validation
request
<
/span
>
<
/div
>
{
/*<form onSubmit={this.onSubmitStudent}>*/
}
{
/* <div className="row" style={{padding: '40px'}}>*/
}
{
/* <button type="submit" className="btn btn-primary">Register</button>*/
}
{
/* </div>*/
}
{
/*</form>*/
}
<
/div
>
<
/div
>
)
}
}
\ No newline at end of file
WebFrontEnd/smartcoach-frontend/src/Images/confirmemail.png
0 → 100644
View file @
efb09f29
35.9 KB
WebFrontEnd/smartcoach-frontend/src/Images/verified.png
0 → 100644
View file @
efb09f29
31.2 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment