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
477ad330
Commit
477ad330
authored
Oct 13, 2021
by
Hasitha Samarasekara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create User Login - Tutor DashBoard
parent
3fbdd6ff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
35 deletions
+126
-35
BackEnd/WebBackEnd/routes/userAccount.route.js
BackEnd/WebBackEnd/routes/userAccount.route.js
+3
-2
WebFrontEnd/smartcoach-frontend/src/Components/Admin/Dashboard.js
...End/smartcoach-frontend/src/Components/Admin/Dashboard.js
+41
-3
WebFrontEnd/smartcoach-frontend/src/Components/Admin/StudentRequestForClass.js
...h-frontend/src/Components/Admin/StudentRequestForClass.js
+44
-18
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
...tcoach-frontend/src/Components/Admin/add_class_details.js
+38
-12
No files found.
BackEnd/WebBackEnd/routes/userAccount.route.js
View file @
477ad330
...
...
@@ -58,13 +58,14 @@ router.route('/getCredentials').post((req, res) => {
res
.
json
(
payload
)
})
}
else
if
(
User
.
user_type
===
"
Tutor
"
){
else
if
(
User
[
0
].
user_type
===
"
Tutor
"
){
console
.
log
(
"
inside Tutor
"
)
TutorAccount
.
findById
(
User
[
0
].
user_id
).
then
(
result
=>
{
payload
.
user_name
=
result
.
tutor_name
res
.
json
(
payload
)
})
}
else
if
(
User
.
user_type
===
"
Institute
"
){
else
if
(
User
[
0
]
.
user_type
===
"
Institute
"
){
InstituteAccount
.
findById
(
User
[
0
].
user_id
).
then
(
result
=>
{
payload
.
user_name
=
result
.
institute_name
res
.
json
(
payload
)
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/Dashboard.js
View file @
477ad330
...
...
@@ -7,8 +7,45 @@ import ViewFinance from './view_financial_details';
import
EditFinance
from
'
./edit_financial_details
'
;
import
AddClass
from
'
./add_class_details
'
;
import
studentRequest
from
'
./StudentRequestForClass
'
;
import
TestTeacher
from
"
../../Images/defaultimageicon.jpg
"
;
export
default
class
Dashboard
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
user_email
:
''
,
user_id
:
''
,
user_name
:
''
,
user_type
:
''
,
isLogged
:
false
}
}
componentDidMount
()
{
const
user_email
=
localStorage
.
getItem
(
"
email
"
);
const
user_id
=
localStorage
.
getItem
(
"
userID
"
);
const
user_name
=
localStorage
.
getItem
(
"
userName
"
);
const
user_type
=
localStorage
.
getItem
(
"
userType
"
);
if
(
user_id
!==
"
"
){
this
.
setState
({
isLogged
:
true
})
}
this
.
setState
({
user_email
:
user_email
,
user_id
:
user_id
,
user_name
:
user_name
,
user_type
:
user_type
})
}
render
()
{
return
(
...
...
@@ -72,19 +109,20 @@ export default class Dashboard extends Component {
<
div
className
=
"
widget-content-left
"
>
<
div
className
=
"
btn-group
"
>
<
div
className
=
"
dropdown1
"
>
<
img
width
=
"
42
"
className
=
"
rounded-circle
"
src
=
"
DashboardAssets/images/user.jpg
"
alt
=
""
/>
<
img
src
=
{
TestTeacher
}
className
=
"
rounded-circle
"
style
=
{{
width
:
'
50px
'
,
height
:
'
50px
'
,
float
:
'
left
'
,
margin
:
'
0px
'
}}
/
>
{
/*<img width="42" className="rounded-circle" src="DashboardAssets/images/user.jpg" alt=""/>*/
}
<
i
className
=
"
fa fa-angle-down ml-2 opacity-8
"
/>
<
div
className
=
"
dropdown-content1 dropdown-menu-right
"
>
<
button
type
=
"
button
"
className
=
"
dropdown-item
"
>
User
Account
<
/button
>
<
button
type
=
"
button
"
className
=
"
dropdown-item
"
style
=
{{
color
:
"
red
"
}}
>
Sign
Out
<
/button
>
<
button
type
=
"
button
"
className
=
"
dropdown-item
"
style
=
{{
color
:
"
red
"
}}
onClick
=
{()
=>
{
window
.
location
.
replace
(
"
/UserLogin
"
);}}
>
Sign
Out
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
widget-content-left ml-3 header-user-info
"
>
<
div
className
=
"
widget-heading
"
>
Bandara
Dissanayake
{
this
.
state
.
user_name
}
<
/div
>
<
div
className
=
"
widget-subheading
"
>
Tutor
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/StudentRequestForClass.js
View file @
477ad330
...
...
@@ -33,6 +33,11 @@ export default class StudentRequestForClass extends Component{
labelClassID
:
''
,
typedNIC
:
''
,
ClassStudentList
:[],
user_email
:
''
,
user_id
:
''
,
user_name
:
''
,
user_type
:
''
,
isLogged
:
false
}
this
.
onChangeClassMethod
=
this
.
onChangeClassMethod
.
bind
(
this
);
...
...
@@ -45,38 +50,59 @@ export default class StudentRequestForClass extends Component{
}
componentDidMount
()
{
axios
.
get
(
configs
.
BASE_URL
+
'
/tutorSingUp/
'
+
this
.
state
.
tutorID
)
.
then
(
response
=>
{
console
.
log
(
response
.
data
);
//console.log(response.data);
const
user_email
=
localStorage
.
getItem
(
"
email
"
);
const
user_id
=
localStorage
.
getItem
(
"
userID
"
);
const
user_name
=
localStorage
.
getItem
(
"
userName
"
);
const
user_type
=
localStorage
.
getItem
(
"
userType
"
);
if
(
user_id
!==
"
"
){
this
.
setState
({
isLogged
:
true
})
}
this
.
setState
({
user_email
:
user_email
,
user_id
:
user_id
,
tutorID
:
user_id
,
user_name
:
user_name
,
user_type
:
user_type
},()
=>
{
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
({
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
},
()
=>
{
})
this
.
setState
({
TutorClassList
:
response
.
data
},
()
=>
{
})
})
})
})
})
})
}
GetStudentList
(){
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
View file @
477ad330
...
...
@@ -10,7 +10,7 @@ export default class AddClassDetails extends Component {
super
(
props
);
this
.
state
=
{
tutorID
:
'
6127b1d7ed4ff23bb0344538
'
,
tutorID
:
''
,
instituteList
:
[],
ClassMethods
:
[],
subjectList
:
[],
...
...
@@ -35,6 +35,11 @@ export default class AddClassDetails extends Component {
selectedDay
:
''
,
HoursTime
:
''
,
AdmissionFee
:
''
,
user_email
:
''
,
user_id
:
''
,
user_name
:
''
,
user_type
:
''
,
isLogged
:
false
}
this
.
onChangeClassMethod
=
this
.
onChangeClassMethod
.
bind
(
this
);
...
...
@@ -57,24 +62,45 @@ export default class AddClassDetails extends Component {
componentDidMount
()
{
axios
.
get
(
configs
.
BASE_URL
+
'
/tutorSingUp/
'
+
this
.
state
.
tutorID
)
.
then
(
response
=>
{
console
.
log
(
response
.
data
);
//console.log(response.data
);
const
user_email
=
localStorage
.
getItem
(
"
email
"
);
const
user_id
=
localStorage
.
getItem
(
"
userID
"
);
const
user_name
=
localStorage
.
getItem
(
"
userName
"
);
const
user_type
=
localStorage
.
getItem
(
"
userType
"
);
if
(
user_id
!==
"
"
){
this
.
setState
({
isLogged
:
true
})
}
this
.
setState
({
instituteList
:
response
.
data
.
tutor_instituteIDList
,
ClassMethods
:
response
.
data
.
tutor_class_type
,
subjectList
:
response
.
data
.
tutor_subjects
,
this
.
setState
({
user_email
:
user_email
,
user_id
:
user_id
,
tutorID
:
user_id
,
user_name
:
user_name
,
user_type
:
user_type
},()
=>
{
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
,
},
()
=>
{
this
.
GetTutorClasses
();
})
},
()
=>
{
this
.
GetTutorClasses
();
})
})
})
}
GetTutorClasses
(){
...
...
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