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
48f1d587
Commit
48f1d587
authored
Nov 18, 2021
by
Hasitha Samarasekara
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT18058338' into 'master'
It18058338 See merge request
!17
parents
f0f44d55
9da8448b
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
541 additions
and
36 deletions
+541
-36
BackEnd/WebBackEnd/models/studPer.model.js
BackEnd/WebBackEnd/models/studPer.model.js
+20
-0
BackEnd/WebBackEnd/routes/studper.route.js
BackEnd/WebBackEnd/routes/studper.route.js
+32
-0
BackEnd/WebBackEnd/server.js
BackEnd/WebBackEnd/server.js
+9
-4
WebFrontEnd/smartcoach-frontend/package-lock.json
WebFrontEnd/smartcoach-frontend/package-lock.json
+13
-0
WebFrontEnd/smartcoach-frontend/package.json
WebFrontEnd/smartcoach-frontend/package.json
+2
-0
WebFrontEnd/smartcoach-frontend/src/Components/Admin/Dashboard.js
...End/smartcoach-frontend/src/Components/Admin/Dashboard.js
+10
-0
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
...tcoach-frontend/src/Components/Admin/add_class_details.js
+27
-27
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_financial_details.js
...ch-frontend/src/Components/Admin/add_financial_details.js
+2
-1
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_stud_perf_details.js
...ch-frontend/src/Components/Admin/add_stud_perf_details.js
+187
-0
WebFrontEnd/smartcoach-frontend/src/Components/Admin/analytics.js
...End/smartcoach-frontend/src/Components/Admin/analytics.js
+233
-0
WebFrontEnd/smartcoach-frontend/src/Components/Admin/edit_financial_details.js
...h-frontend/src/Components/Admin/edit_financial_details.js
+3
-2
WebFrontEnd/smartcoach-frontend/src/Components/Admin/view_financial_details.js
...h-frontend/src/Components/Admin/view_financial_details.js
+3
-2
No files found.
BackEnd/WebBackEnd/models/studPer.model.js
0 → 100644
View file @
48f1d587
const
mongoose
=
require
(
'
mongoose
'
);
const
Schema
=
mongoose
.
Schema
;
let
PerformanceSchema
=
new
Schema
({
student_id
:
{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
student
'
,
required
:
true
},
sex
:
{
type
:
Boolean
,
required
:
true
},
study_time
:
{
type
:
Number
,
required
:
true
},
activities
:
{
type
:
Boolean
,
required
:
true
},
internet
:
{
type
:
Boolean
,
required
:
true
},
free_time
:
{
type
:
Number
,
required
:
true
},
absences
:
{
type
:
Number
,
required
:
true
},
g1
:
{
type
:
Number
,
required
:
true
},
g2
:
{
type
:
Number
,
required
:
true
}
},{
timestamps
:
true
});
const
StudPerf
=
mongoose
.
model
(
'
stud_performance
'
,
PerformanceSchema
);
module
.
exports
=
StudPerf
;
\ No newline at end of file
BackEnd/WebBackEnd/routes/studper.route.js
0 → 100644
View file @
48f1d587
const
router
=
require
(
'
express
'
).
Router
();
const
StudPer
=
require
(
'
../models/studPer.model
'
);
router
.
route
(
'
/store
'
).
post
((
req
,
res
)
=>
{
const
student_id
=
req
.
body
.
student_id
;
const
sex
=
req
.
body
.
sex
;
const
study_time
=
req
.
body
.
study_time
;
const
activities
=
req
.
body
.
activities
;
const
internet
=
req
.
body
.
internet
;
const
free_time
=
req
.
body
.
free_time
;
const
absences
=
req
.
body
.
absences
;
const
g1
=
req
.
body
.
g1
;
const
g2
=
req
.
body
.
g2
;
const
newPerformanceDetails
=
new
StudPer
({
student_id
,
sex
,
study_time
,
activities
,
internet
,
free_time
,
absences
,
g1
,
g2
});
newPerformanceDetails
.
save
()
.
then
(()
=>
res
.
json
(
'
Student Performance Details Added!
'
))
.
catch
(
err
=>
res
.
status
(
400
).
json
(
'
Error :
'
+
err
));
});
module
.
exports
=
router
;
\ No newline at end of file
BackEnd/WebBackEnd/server.js
View file @
48f1d587
...
...
@@ -81,8 +81,10 @@ 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
imageRouter
=
require
(
'
./routes/pdf.route
'
);
const
answerManage
=
require
(
'
./routes/answer_route
'
);
const
tutorRating
=
require
(
'
./routes/tutorRatings.route
'
);
const
filteredList
=
require
(
'
./routes/filteredListNew.route
'
);
const
createClassRoute
=
require
(
'
./routes/createClass.route
'
);
const
studPerRoute
=
require
(
'
./routes/studper.route
'
);
app
.
use
(
'
/studentSingUp
'
,
studentRouter
);
app
.
use
(
'
/tutorSingUp
'
,
tutorRouter
);
...
...
@@ -92,8 +94,11 @@ app.use('/questions', questionManage);
app
.
use
(
'
/answer
'
,
answerManage
);
app
.
use
(
'
/admin/finance
'
,
financeRouter
);
app
.
use
(
'
/studentResults
'
,
studentResult
);
app
.
use
(
'
/
'
,
imageRouter
(
upload
));
app
.
use
(
'
/tutorRatings
'
,
tutorRating
);
app
.
use
(
'
/filteredList
'
,
filteredList
);
app
.
use
(
'
/createClass
'
,
createClassRoute
);
app
.
use
(
'
/admin/studper
'
,
studPerRoute
);
app
.
listen
(
port
,
()
=>
{
console
.
log
(
`Server is running on Port:
${
port
}
`
);
});
});
\ No newline at end of file
WebFrontEnd/smartcoach-frontend/package-lock.json
View file @
48f1d587
...
...
@@ -4003,6 +4003,11 @@
"resolved"
:
"https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz"
,
"integrity"
:
"sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw=="
},
"chart.js"
:
{
"version"
:
"3.5.1"
,
"resolved"
:
"https://registry.npmjs.org/chart.js/-/chart.js-3.5.1.tgz"
,
"integrity"
:
"sha512-m5kzt72I1WQ9LILwQC4syla/LD/N413RYv2Dx2nnTkRS9iv/ey1xLTt0DnPc/eWV4zI+BgEgDYBIzbQhZHc/PQ=="
},
"check-types"
:
{
"version"
:
"11.1.2"
,
"resolved"
:
"https://registry.npmjs.org/check-types/-/check-types-11.1.2.tgz"
,
...
...
@@ -12391,6 +12396,14 @@
"whatwg-fetch"
:
"^3.4.1"
}
},
"react-chartjs-2"
:
{
"version"
:
"3.0.5"
,
"resolved"
:
"https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-3.0.5.tgz"
,
"integrity"
:
"sha512-fYr4E82agaZi9IFMe5GtOZ6WE/HWdxy/KywLNOzXsqgPkD2oo1IlrQLKMLUki/2UXko3p95TR2L8Q2rEss/opQ=="
,
"requires"
:
{
"lodash"
:
"^4.17.19"
}
},
"react-bootstrap-icons"
:
{
"version"
:
"1.5.0"
,
"resolved"
:
"https://registry.npmjs.org/react-bootstrap-icons/-/react-bootstrap-icons-1.5.0.tgz"
,
...
...
WebFrontEnd/smartcoach-frontend/package.json
View file @
48f1d587
...
...
@@ -7,9 +7,11 @@
"@testing-library/react"
:
"^11.2.6"
,
"@testing-library/user-event"
:
"^12.8.3"
,
"bootstrap"
:
"^4.6.0"
,
"chart.js"
:
"^3.5.1"
,
"bootstrap-icons"
:
"^1.5.0"
,
"moment"
:
"^2.29.1"
,
"react"
:
"^17.0.2"
,
"react-chartjs-2"
:
"^3.0.5"
,
"react-bootstrap-icons"
:
"^1.5.0"
,
"react-dom"
:
"^17.0.2"
,
"react-dropdown"
:
"^1.9.2"
,
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/Dashboard.js
View file @
48f1d587
...
...
@@ -6,8 +6,10 @@ 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
Analytics
from
"
./analytics
"
;
import
studentRequest
from
'
./StudentRequestForClass
'
;
import
TestTeacher
from
"
../../Images/defaultimageicon.jpg
"
;
import
AddStudPer
from
'
./add_stud_perf_details
'
;
export
default
class
Dashboard
extends
Component
{
...
...
@@ -461,6 +463,12 @@ export default class Dashboard extends Component {
Progress
<
/a
>
<
/li
>
<
li
>
<
NavLink
activeClassName
=
'
mm-active
'
to
=
{
"
/admin/studper/add/
"
}
>
<
i
className
=
"
metismenu-icon
"
><
/i
>
Add
Progress
Details
<
/NavLink
>
<
/li
>
<
/ul
>
<
/li
>
...
...
@@ -518,11 +526,13 @@ export default class Dashboard extends Component {
<
div
className
=
"
app-main__inner
"
>
{
/* ------------------------------Content---------------------------------------- */
}
<
Route
path
=
"
/admin/
"
exact
component
=
{
Analytics
}
/
>
<
Route
path
=
"
/admin/finance/
"
exact
component
=
{
ViewFinance
}
/
>
<
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
}
/
>
<
Route
path
=
"
/admin/studper/add
"
exact
component
=
{
AddStudPer
}
/
>
<
/div
>
{
/* Footer */
}
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_class_details.js
View file @
48f1d587
...
...
@@ -429,33 +429,33 @@ export default class AddClassDetails extends Component {
<
/div
>
<
/div
>
<
div
className
=
"
position-relative form-group
"
>
<
input
type
=
"
checkbox
"
id
=
"
onlineClass
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeIsActiveClass
}
defaultChecked
=
{
this
.
state
.
i
sActiveClass
}
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
className
=
"
row
"
>
<
input
type
=
"
checkbox
"
id
=
"
onlineClass
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeI
sActiveClass
}
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
>
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_financial_details.js
View file @
48f1d587
import
React
,
{
Component
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
'
../../Config/config
'
;
export
default
class
AddFinancialDetails
extends
Component
{
...
...
@@ -48,7 +49,7 @@ export default class AddFinancialDetails extends Component{
// console.log(`total_expenses: ${this.state.total_expenses}`);
// console.log(`gross_revenue: ${this.state.gross_revenue}`);
axios
.
post
(
'
http://localhost:5000
/admin/finance/store
'
,
financialDetails
)
axios
.
post
(
configs
.
BASE_URL
+
'
/admin/finance/store
'
,
financialDetails
)
.
then
(
res
=>
console
.
log
(
res
.
data
));
e
.
target
.
reset
();
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/add_stud_perf_details.js
0 → 100644
View file @
48f1d587
import
React
,
{
Component
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
swal
from
"
sweetalert
"
;
import
*
as
configs
from
"
../../Config/config
"
;
export
default
class
AddPerformanceDetails
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
student_id
:
''
,
sex
:
''
,
study_time
:
''
,
activities
:
''
,
internet
:
''
,
free_time
:
''
,
absences
:
''
,
g1
:
''
,
g2
:
''
};
}
onChangeHandler
=
e
=>
{
this
.
setState
({
[
e
.
target
.
name
]:
e
.
target
.
value
})
}
onSubmitHandler
=
e
=>
{
e
.
preventDefault
();
const
studPerfDetails
=
{
student_id
:
this
.
state
.
student_id
,
sex
:
this
.
state
.
sex
,
study_time
:
this
.
state
.
study_time
,
activities
:
this
.
state
.
activities
,
internet
:
this
.
state
.
internet
,
free_time
:
this
.
state
.
free_time
,
absences
:
this
.
state
.
absences
,
g1
:
this
.
state
.
g1
,
g2
:
this
.
state
.
g2
}
console
.
log
(
`Form submitted:`
);
console
.
log
(
`std_id:
${
this
.
state
.
student_id
}
`
);
console
.
log
(
`sex:
${
this
.
state
.
sex
}
`
);
console
.
log
(
`study_time:
${
this
.
state
.
study_time
}
`
);
console
.
log
(
`activities:
${
this
.
state
.
activities
}
`
);
console
.
log
(
`internet:
${
this
.
state
.
internet
}
`
);
console
.
log
(
`free_time:
${
this
.
state
.
free_time
}
`
);
console
.
log
(
`absences:
${
this
.
state
.
absences
}
`
);
console
.
log
(
`G1:
${
this
.
state
.
g1
}
`
);
console
.
log
(
`G2:
${
this
.
state
.
g2
}
`
);
axios
.
post
(
configs
.
BASE_URL
+
'
/admin/studper/store
'
,
studPerfDetails
)
.
then
(
res
=>
{
console
.
log
(
res
.
data
)
swal
(
"
success!!!
"
,
res
.
data
,
"
success
"
)
});
e
.
target
.
reset
();
}
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-line-chart
"
><
/i
>
<
/div
>
<
div
>
Add
Student
Performance
Details
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
main-card mb-3 card
"
>
<
div
className
=
"
card-body
"
>
<
form
onSubmit
=
{
this
.
onSubmitHandler
}
>
<
div
className
=
"
position-relative row form-group
"
>
<
label
htmlFor
=
"
stdId
"
className
=
"
col-sm-2 col-form-label
"
>
Student
ID
<
/label
>
<
div
className
=
"
col-sm-3
"
>
<
input
type
=
"
text
"
name
=
"
student_id
"
id
=
"
stdId
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeHandler
}
required
/>
<
/div
>
<
label
>
Student
id
of
the
student
<
/label
>
<
/div
>
<
div
className
=
"
position-relative row form-group
"
>
<
label
htmlFor
=
"
sex
"
className
=
"
col-sm-2 col-form-label
"
>
Sex
<
/label
>
<
div
className
=
"
col-sm-3
"
>
<
select
defaultValue
=
""
className
=
"
form-control
"
name
=
"
sex
"
onChange
=
{
this
.
onChangeHandler
}
>
<
option
disabled
=
{
true
}
value
=
""
>
Select
<
/option
>
<
option
value
=
"
1
"
>
Male
<
/option
>
<
option
value
=
"
0
"
>
Female
<
/option
>
<
/select
>
<
/div
>
<
label
>
Female
/
Male
<
/label
>
<
/div
>
<
div
className
=
"
position-relative row form-group
"
>
<
label
htmlFor
=
"
studyTime
"
className
=
"
col-sm-2 col-form-label
"
>
Study
Time
<
/label
>
<
div
className
=
"
col-sm-3
"
>
<
input
type
=
"
number
"
min
=
"
0
"
max
=
"
24
"
name
=
"
study_time
"
id
=
"
studyTime
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeHandler
}
required
/>
<
/div
>
<
label
>
Study
Time
after
school
<
/label
>
<
/div
>
<
div
className
=
"
position-relative row form-group
"
>
<
label
htmlFor
=
"
extraAct
"
className
=
"
col-sm-2 col-form-label
"
>
Extra
Curriculum
Activities
<
/label
>
<
div
className
=
"
col-sm-3
"
>
<
select
defaultValue
=
""
className
=
"
form-control
"
name
=
"
activities
"
onChange
=
{
this
.
onChangeHandler
}
>
<
option
disabled
=
{
true
}
value
=
""
>
Select
<
/option
>
<
option
value
=
"
1
"
>
Yes
<
/option
>
<
option
value
=
"
0
"
>
No
<
/option
>
<
/select
>
<
/div
>
<
label
>
Doing
extra
-
curricular
activities
<
/label
>
<
/div
>
<
div
className
=
"
position-relative row form-group
"
>
<
label
htmlFor
=
"
int
"
className
=
"
col-sm-2 col-form-label
"
>
Internet
at
Home
<
/label
>
<
div
className
=
"
col-sm-3
"
>
<
select
defaultValue
=
""
className
=
"
form-control
"
name
=
"
internet
"
onChange
=
{
this
.
onChangeHandler
}
>
<
option
disabled
=
{
true
}
value
=
""
>
Select
<
/option
>
<
option
value
=
"
1
"
>
Yes
<
/option
>
<
option
value
=
"
0
"
>
No
<
/option
>
<
/select
>
<
/div
>
<
label
>
Internet
availability
at
home
<
/label
>
<
/div
>
<
div
className
=
"
position-relative row form-group
"
>
<
label
htmlFor
=
"
freeTime
"
className
=
"
col-sm-2 col-form-label
"
>
Free
Time
<
/label
>
<
div
className
=
"
col-sm-3
"
>
<
input
type
=
"
number
"
min
=
"
0
"
max
=
"
24
"
name
=
"
free_time
"
id
=
"
freeTime
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeHandler
}
required
/>
<
/div
>
<
label
>
Free
time
available
after
school
<
/label
>
<
/div
>
<
div
className
=
"
position-relative row form-group
"
>
<
label
htmlFor
=
"
abs
"
className
=
"
col-sm-2 col-form-label
"
>
Absences
<
/label
>
<
div
className
=
"
col-sm-3
"
>
<
input
type
=
"
number
"
min
=
"
0
"
max
=
"
99
"
name
=
"
absences
"
id
=
"
abs
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeHandler
}
required
/>
<
/div
>
<
label
>
Number
of
days
absent
in
tution
class
<
/label
>
<
/div
>
<
div
className
=
"
position-relative row form-group
"
>
<
label
htmlFor
=
"
quiz1
"
className
=
"
col-sm-2 col-form-label
"
>
Quiz
1
Marks
<
/label
>
<
div
className
=
"
col-sm-3
"
>
<
input
type
=
"
number
"
min
=
"
0
"
max
=
"
20
"
name
=
"
g1
"
id
=
"
quiz1
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeHandler
}
required
/>
<
/div
>
<
label
>
Quiz
1
marks
obtained
by
the
student
<
/label
>
<
/div
>
<
div
className
=
"
position-relative row form-group
"
>
<
label
htmlFor
=
"
quiz2
"
className
=
"
col-sm-2 col-form-label
"
>
Quiz
2
Marks
<
/label
>
<
div
className
=
"
col-sm-3
"
>
<
input
type
=
"
number
"
min
=
"
0
"
max
=
"
20
"
name
=
"
g2
"
id
=
"
quiz2
"
className
=
"
form-control
"
onChange
=
{
this
.
onChangeHandler
}
required
/>
<
/div
>
<
label
>
Quiz
2
marks
obtained
by
the
student
<
/label
>
<
/div
>
<
div
className
=
"
position-relative row form-group
"
>
<
div
className
=
"
col-sm-12
"
>
<
button
className
=
"
btn btn-primary
"
style
=
{{
width
:
"
150px
"
}}
type
=
"
submit
"
>
Save
Details
<
/button
>
<
/div
>
<
/div
>
<
/form
>
<
/div
>
<
/div
>
<
/div
>
);
}
}
\ No newline at end of file
WebFrontEnd/smartcoach-frontend/src/Components/Admin/analytics.js
0 → 100644
View file @
48f1d587
This diff is collapsed.
Click to expand it.
WebFrontEnd/smartcoach-frontend/src/Components/Admin/edit_financial_details.js
View file @
48f1d587
import
React
,
{
Component
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
'
../../Config/config
'
;
export
default
class
EditFinancialDetails
extends
Component
{
...
...
@@ -48,14 +49,14 @@ export default class EditFinancialDetails extends Component{
console
.
log
(
`total_expenses:
${
this
.
state
.
total_expenses
}
`
);
console
.
log
(
`gross_revenue:
${
this
.
state
.
gross_revenue
}
`
);
axios
.
post
(
'
http://localhost:5000
/admin/finance/update/
'
+
this
.
props
.
match
.
params
.
id
,
financialDetails
)
axios
.
post
(
configs
.
BASE_URL
+
'
/admin/finance/update/
'
+
this
.
props
.
match
.
params
.
id
,
financialDetails
)
.
then
(
res
=>
console
.
log
(
res
.
data
));
window
.
location
=
'
/admin
'
;
}
componentDidMount
()
{
axios
.
get
(
'
http://localhost:5000
/admin/finance/
'
+
this
.
props
.
match
.
params
.
id
)
axios
.
get
(
configs
.
BASE_URL
+
'
/admin/finance/
'
+
this
.
props
.
match
.
params
.
id
)
.
then
(
response
=>
{
this
.
setState
({
account_month
:
response
.
data
.
account_month
,
...
...
WebFrontEnd/smartcoach-frontend/src/Components/Admin/view_financial_details.js
View file @
48f1d587
import
React
,
{
Component
}
from
"
react
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
axios
from
"
axios
"
;
import
*
as
configs
from
'
../../Config/config
'
;
const
Finance
=
props
=>
(
<
tr
>
...
...
@@ -27,7 +28,7 @@ export default class ViewFinancialDetails extends Component{
}
componentDidMount
()
{
axios
.
get
(
'
http://localhost:5000
/admin/finance/
'
)
axios
.
get
(
configs
.
BASE_URL
+
'
/admin/finance/
'
)
.
then
(
response
=>
{
this
.
setState
({
finance
:
response
.
data
})
// console.log(this.state);
...
...
@@ -38,7 +39,7 @@ export default class ViewFinancialDetails extends Component{
}
deleteFinance
(
id
){
axios
.
delete
(
'
http://localhost:5000
/admin/finance/
'
+
id
)
axios
.
delete
(
configs
.
BASE_URL
+
'
/admin/finance/
'
+
id
)
.
then
(
res
=>
console
.
log
(
res
.
data
));
this
.
setState
({
...
...
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