Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-158
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
2
Merge Requests
2
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
2022-158
2022-158
Commits
5d4ba196
Commit
5d4ba196
authored
Nov 07, 2022
by
Weerasinghe D.N.H
Browse files
Options
Browse Files
Download
Plain Diff
BACKEND : Merge conflict fixed
parents
c20fbbe4
c0a2b07e
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1380 additions
and
210 deletions
+1380
-210
backend/.idea/.gitignore
backend/.idea/.gitignore
+0
-8
backend/.idea/backend.iml
backend/.idea/backend.iml
+0
-13
backend/.idea/inspectionProfiles/Project_Default.xml
backend/.idea/inspectionProfiles/Project_Default.xml
+0
-18
backend/.idea/inspectionProfiles/profiles_settings.xml
backend/.idea/inspectionProfiles/profiles_settings.xml
+0
-6
backend/.idea/misc.xml
backend/.idea/misc.xml
+0
-4
backend/.idea/modules.xml
backend/.idea/modules.xml
+0
-8
backend/.idea/vcs.xml
backend/.idea/vcs.xml
+0
-6
backend/app.py
backend/app.py
+0
-2
backend/database.db
backend/database.db
+0
-0
backend/services/class_diagram_class_detection_service.py
backend/services/class_diagram_class_detection_service.py
+41
-69
backend/services/class_relationship_relativity_service.py
backend/services/class_relationship_relativity_service.py
+18
-1
frontend/src/pages/DeliveryReportSubmit.js
frontend/src/pages/DeliveryReportSubmit.js
+172
-0
frontend/src/pages/ManageAllOrders.js
frontend/src/pages/ManageAllOrders.js
+83
-0
frontend/src/pages/ManageDeliveryReports.js
frontend/src/pages/ManageDeliveryReports.js
+94
-0
frontend/src/pages/ManageSites.js
frontend/src/pages/ManageSites.js
+197
-0
frontend/src/pages/OfficerDashboard.js
frontend/src/pages/OfficerDashboard.js
+232
-0
frontend/src/pages/OfficerOrders.js
frontend/src/pages/OfficerOrders.js
+178
-0
frontend/src/pages/SiteManagerDashboard.js
frontend/src/pages/SiteManagerDashboard.js
+147
-0
frontend/src/pages/StudentSubjectAssingment.js
frontend/src/pages/StudentSubjectAssingment.js
+206
-45
frontend/src/routes/Routes.js
frontend/src/routes/Routes.js
+12
-30
No files found.
backend/.idea/.gitignore
deleted
100644 → 0
View file @
c20fbbe4
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
backend/.idea/backend.iml
deleted
100644 → 0
View file @
c20fbbe4
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"PYTHON_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/backend"
isTestSource=
"false"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
<component
name=
"TemplatesService"
>
<option
name=
"TEMPLATE_CONFIGURATION"
value=
"Jinja2"
/>
</component>
</module>
\ No newline at end of file
backend/.idea/inspectionProfiles/Project_Default.xml
deleted
100644 → 0
View file @
c20fbbe4
<component
name=
"InspectionProjectProfileManager"
>
<profile
version=
"1.0"
>
<option
name=
"myName"
value=
"Project Default"
/>
<inspection_tool
class=
"DuplicatedCode"
enabled=
"true"
level=
"WEAK WARNING"
enabled_by_default=
"true"
>
<Languages>
<language
minSize=
"149"
name=
"Python"
/>
</Languages>
</inspection_tool>
<inspection_tool
class=
"PyPep8Inspection"
enabled=
"true"
level=
"WEAK WARNING"
enabled_by_default=
"true"
>
<option
name=
"ignoredErrors"
>
<list>
<option
value=
"E128"
/>
<option
value=
"E501"
/>
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
backend/.idea/inspectionProfiles/profiles_settings.xml
deleted
100644 → 0
View file @
c20fbbe4
<component
name=
"InspectionProjectProfileManager"
>
<settings>
<option
name=
"USE_PROJECT_PROFILE"
value=
"false"
/>
<version
value=
"1.0"
/>
</settings>
</component>
\ No newline at end of file
backend/.idea/misc.xml
deleted
100644 → 0
View file @
c20fbbe4
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.10"
project-jdk-type=
"Python SDK"
/>
</project>
\ No newline at end of file
backend/.idea/modules.xml
deleted
100644 → 0
View file @
c20fbbe4
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/.idea/backend.iml"
filepath=
"$PROJECT_DIR$/.idea/backend.iml"
/>
</modules>
</component>
</project>
\ No newline at end of file
backend/.idea/vcs.xml
deleted
100644 → 0
View file @
c20fbbe4
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$/.."
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
backend/app.py
View file @
5d4ba196
...
@@ -11,7 +11,6 @@ from routes.module_routes import module
...
@@ -11,7 +11,6 @@ from routes.module_routes import module
from
routes.assignment_routes
import
assignment
from
routes.assignment_routes
import
assignment
from
routes.diagram_routes
import
diagram
from
routes.diagram_routes
import
diagram
from
routes.submission_routes
import
submission
from
routes.submission_routes
import
submission
from
routes.plagiarism_routes
import
use_case_diagram_plagiarism
APP_ROOT
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
APP_ROOT
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
...
@@ -48,7 +47,6 @@ app.register_blueprint(module)
...
@@ -48,7 +47,6 @@ app.register_blueprint(module)
app
.
register_blueprint
(
assignment
)
app
.
register_blueprint
(
assignment
)
app
.
register_blueprint
(
diagram
)
app
.
register_blueprint
(
diagram
)
app
.
register_blueprint
(
submission
)
app
.
register_blueprint
(
submission
)
app
.
register_blueprint
(
use_case_diagram_plagiarism
)
@
app
.
before_first_request
@
app
.
before_first_request
...
...
backend/database.db
deleted
100644 → 0
View file @
c20fbbe4
File deleted
backend/services/class_diagram_class_detection_service.py
View file @
5d4ba196
This diff is collapsed.
Click to expand it.
backend/services/class_relationship_relativity_service.py
View file @
5d4ba196
...
@@ -15,9 +15,15 @@ from models.class_relationship_muplicity import Multiplicity
...
@@ -15,9 +15,15 @@ from models.class_relationship_muplicity import Multiplicity
def
detect_class_relationship
(
image_nparray
,
boxes
,
index
,
class_comp_id
,
category
):
def
detect_class_relationship
(
image_nparray
,
boxes
,
index
,
class_comp_id
,
category
):
# image = cv2.imread(app.SUBMISSION_PATH + '/' + filename)
height
,
width
,
c
=
image_nparray
.
shape
height
,
width
,
c
=
image_nparray
.
shape
class_objects
=
Component
.
query
.
filter_by
(
class_answer
=
class_comp_id
)
.
all
()
class_objects
=
Component
.
query
.
filter_by
(
class_answer
=
class_comp_id
)
.
all
()
# for i in range(0, len(accurate_indexes))
# if category_index[class_id[i]]['name'] != 'class' and category_index[class_id[i]]['name'] != 'interface':
# category_name = category_index[class_id[i]]['name']
ymin
=
boxes
[
index
][
0
]
*
height
ymin
=
boxes
[
index
][
0
]
*
height
xmin
=
boxes
[
index
][
1
]
*
width
xmin
=
boxes
[
index
][
1
]
*
width
ymax
=
boxes
[
index
][
2
]
*
height
ymax
=
boxes
[
index
][
2
]
*
height
...
@@ -238,13 +244,20 @@ def relationship_details_detection(image_nparray, boxes, index, class_comp_id, c
...
@@ -238,13 +244,20 @@ def relationship_details_detection(image_nparray, boxes, index, class_comp_id, c
if
result
is
not
None
:
if
result
is
not
None
:
relationship_text
(
_image
,
result
,
relationship
)
relationship_text
(
_image
,
result
,
relationship
)
# print(relationship, 'relationship')
def
relationship_text
(
_image
,
result
,
relationship
):
def
relationship_text
(
_image
,
result
,
relationship
):
# boxes = [res[0] for res in result]
# texts = [res[1][0] for res in result]
# scores = [res[1][1] for res in result]
for
element
in
result
:
for
element
in
result
:
text
=
element
[
1
][
0
]
text
=
element
[
1
][
0
]
box
=
element
[
0
]
box
=
element
[
0
]
nlp_ner
=
spacy
.
load
(
'ner_models/model-best'
)
nlp_ner
=
spacy
.
load
(
'ner_models/model-best'
)
nlp_output
=
nlp_ner
(
text
)
nlp_output
=
nlp_ner
(
text
)
# print(text, 'line 290')
# box = np.array(box,dtype=float)
box
=
np
.
array
(
box
)
.
astype
(
np
.
int32
)
box
=
np
.
array
(
box
)
.
astype
(
np
.
int32
)
xmin
=
min
(
box
[:,
0
])
xmin
=
min
(
box
[:,
0
])
...
@@ -252,6 +265,8 @@ def relationship_text(_image, result, relationship):
...
@@ -252,6 +265,8 @@ def relationship_text(_image, result, relationship):
xmax
=
max
(
box
[:,
0
])
xmax
=
max
(
box
[:,
0
])
ymax
=
max
(
box
[:,
1
])
ymax
=
max
(
box
[:,
1
])
for
token
in
nlp_output
.
ents
:
for
token
in
nlp_output
.
ents
:
# print(token.text, 'line 301')
# print(token.label_, 'line 302')
if
token
.
label_
==
'MULTIPLICITY'
or
contains_number
(
text
):
if
token
.
label_
==
'MULTIPLICITY'
or
contains_number
(
text
):
multiplicity
=
Multiplicity
(
value
=
token
.
text
,
relationship_id
=
relationship
.
id
,
x_min
=
xmin
,
multiplicity
=
Multiplicity
(
value
=
token
.
text
,
relationship_id
=
relationship
.
id
,
x_min
=
xmin
,
...
@@ -272,12 +287,14 @@ def contains_number(string):
...
@@ -272,12 +287,14 @@ def contains_number(string):
# crop image using boxes & index
# crop image using boxes & index
def
crop_image_
(
image
,
boxes
,
index
):
def
crop_image_
(
image
,
boxes
,
index
):
height
,
width
,
c
=
image
.
shape
height
,
width
,
c
=
image
.
shape
# crop box format: xmin, ymin, xmax, ymax
ymin
=
boxes
[
index
][
0
]
*
height
ymin
=
boxes
[
index
][
0
]
*
height
xmin
=
boxes
[
index
][
1
]
*
width
xmin
=
boxes
[
index
][
1
]
*
width
ymax
=
boxes
[
index
][
2
]
*
height
ymax
=
boxes
[
index
][
2
]
*
height
xmax
=
boxes
[
index
][
3
]
*
width
xmax
=
boxes
[
index
][
3
]
*
width
cropped_image
=
image
[
int
(
ymin
):
int
(
ymax
),
int
(
xmin
):
int
(
xmax
)]
cropped_image
=
image
[
int
(
ymin
):
int
(
ymax
),
int
(
xmin
):
int
(
xmax
)]
# image = cv2.cvtColor(cropped_image, cv2.COLOR_BGR2GRAY)
# image = cv2.resize(image, (800, 500))
# returns cropped image , ymin,xmin,ymax & xmax
# returns cropped image , ymin,xmin,ymax & xmax
return
cropped_image
,
ymin
,
xmin
,
ymax
,
xmax
return
cropped_image
,
ymin
,
xmin
,
ymax
,
xmax
frontend/src/pages/DeliveryReportSubmit.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
{
useParams
}
from
"
react-router-dom
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
"
../assets/css/Usercreate.css
"
;
const
DeliveryReportSubmit
=
()
=>
{
const
{
id
}
=
useParams
();
const
[
btnState
,
setBtnState
]
=
useState
(
false
);
const
[
error
,
setError
]
=
useState
(
""
);
const
[
deliveryReport
,
setDeliveryReport
]
=
useState
({});
const
saveDeliveryReport
=
async
(
e
)
=>
{
e
.
preventDefault
();
setBtnState
(
true
);
if
(
!
deliveryReport
.
description
)
{
setBtnState
(
false
);
return
setError
(
"
Please fill all the fields
"
);
}
try
{
const
res
=
await
axios
.
post
(
"
/reports/deliveryreport
"
,
deliveryReport
);
if
(
res
.
status
===
201
)
{
setDeliveryReport
({});
getOrderDetails
();
setError
(
""
);
const
res
=
await
axios
.
put
(
`orders/supplier/submitted/
${
id
}
`
);
if
(
res
.
status
===
200
)
{
window
.
alert
(
"
Delivery report registered successfully
"
);
window
.
location
.
href
=
"
/auth/supplier/deliveryreports
"
;
}
}
setBtnState
(
false
);
}
catch
(
err
)
{
setBtnState
(
false
);
console
.
log
(
err
.
response
);
}
};
const
getOrderDetails
=
async
()
=>
{
try
{
const
res
=
await
axios
.
get
(
`orders/
${
id
}
`
);
console
.
log
(
res
.
data
);
setDeliveryReport
(
res
.
data
.
order
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
};
useEffect
(()
=>
getOrderDetails
(),
[]);
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
h1
className
=
"
page-header
"
>
Submit
Delivery
Report
<
/h1
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-12
"
>
<
form
className
=
"
card
"
style
=
{{
position
:
"
relative
"
}}
>
{
error
&&
(
<
div
className
=
"
error-bg
"
style
=
{{
left
:
"
3%
"
}}
>
<
p
>
{
error
}
<
/p
>
<
/div
>
)}
<
div
className
=
"
row
"
>
<
div
className
=
"
col-4
"
>
<
label
htmlFor
=
""
>
Order
Item
<
/label
>
<
div
className
=
"
row-user
"
>
<
input
disabled
type
=
"
text
"
placeholder
=
"
Delivered Item
"
value
=
{
deliveryReport
.
itemName
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
label
htmlFor
=
""
>
Order
ID
<
/label
>
<
div
className
=
"
row-user
"
>
<
input
disabled
type
=
"
text
"
placeholder
=
"
Order ID
"
value
=
{
deliveryReport
.
_id
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
label
htmlFor
=
""
>
Quantity
<
/label
>
<
div
className
=
"
row-user
"
>
<
input
disabled
type
=
"
text
"
placeholder
=
"
Quantity
"
value
=
{
deliveryReport
.
quantity
}
required
/>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-4
"
>
<
label
htmlFor
=
""
>
Total
<
/label
>
<
div
className
=
"
row-user
"
>
<
input
disabled
type
=
"
text
"
placeholder
=
"
Delivered Item
"
value
=
{
deliveryReport
.
total
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
label
htmlFor
=
""
>
Order
Type
<
/label
>
<
div
className
=
"
row-user
"
>
<
input
disabled
type
=
"
text
"
placeholder
=
"
Order ID
"
value
=
{
deliveryReport
.
urgentOrder
===
false
?
"
Regular Order
"
:
"
Urgent Order
"
}
required
/>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-12
"
>
<
div
className
=
"
row-user
"
>
<
input
type
=
"
text
"
placeholder
=
"
Description
"
value
=
{
deliveryReport
.
description
}
onChange
=
{(
e
)
=>
setDeliveryReport
({
...
deliveryReport
,
description
:
e
.
target
.
value
,
})
}
required
/>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row-user
"
>
<
button
type
=
"
submit
"
onClick
=
{
saveDeliveryReport
}
>
{
btnState
?
"
Saving
"
:
"
Save
"
}
<
/button
>
<
/div
>
<
/form
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
DeliveryReportSubmit
;
frontend/src/pages/ManageAllOrders.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
axios
from
"
axios
"
;
const
ManageAllOrders
=
()
=>
{
const
fields
=
[
"
Order ID
"
,
"
Item Name
"
,
"
Quantity
"
,
"
Total
"
,
"
Created Date
"
,
"
Status
"
,
];
const
[
orders
,
setOrders
]
=
useState
(
null
);
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
itemName
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
{
item
.
total
}
<
/td
>
<
td
>
{
new
Date
(
item
.
createdAt
).
toLocaleDateString
()}
<
/td
>
<
td
>
<
Badge
type
=
{
permissionStatus
[
item
.
isApprovedByOfficer
]}
content
=
{
item
.
isApprovedByOfficer
}
/
>
<
/td
>
<
/tr
>
);
const
getAllOrder
=
async
()
=>
{
const
res
=
await
axios
.
get
(
"
orders/getAllOrdersByManager
"
);
console
.
log
(
res
.
data
.
orders
);
setOrders
(
res
.
data
.
orders
);
};
useEffect
(()
=>
{
getAllOrder
();
},
[]);
const
permissionStatus
=
{
pending
:
"
warning
"
,
approved
:
"
success
"
,
rejected
:
"
danger
"
,
};
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
div
className
=
"
card
"
>
<
h2
>
All
Order
Details
<
/h2
>
{
orders
&&
(
<
Table
limit
=
"
10
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
orders
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)}
<
/div
>
<
Link
to
=
{
"
/auth/manager/ApprovedOrders
"
}
>
<
div
className
=
"
row-user
"
>
<
button
>
Approved
Orders
<
/button
>
<
/div
>
<
/Link
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
ManageAllOrders
;
frontend/src/pages/ManageDeliveryReports.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
axios
from
"
axios
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
Spinner
from
"
../components/loading/Spinner
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
"
../components/badge/badge.css
"
;
import
"
react-calendar/dist/Calendar.css
"
;
const
ManageDeliveryReports
=
()
=>
{
const
[
suppliers
,
setSuppliers
]
=
useState
([]);
const
[
isLoading
,
setIsLoading
]
=
useState
(
true
);
const
fields
=
[
""
,
"
Item
"
,
"
Quantity
"
,
"
Description
"
,
"
Total
"
,
"
Delivered Address
"
,
"
Order Type
"
,
];
const
getAllSuppliers
=
async
()
=>
{
setIsLoading
(
true
);
try
{
const
res
=
await
axios
.
get
(
`reports/deliveryreport/supplier`
);
console
.
log
(
res
);
setSuppliers
(
res
.
data
.
reports
);
setIsLoading
(
false
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
};
useEffect
(()
=>
getAllSuppliers
(),
[]);
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
item
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
{
item
.
description
}
<
/td
>
<
td
>
{
item
.
total
}
<
/td
>
<
td
>
{
item
.
address
}
<
/td
>
<
td
>
{
item
.
urgentOrder
?
(
<
div
style
=
{{
cursor
:
"
pointer
"
}}
>
<
Badge
type
=
"
danger
"
content
=
"
Urgent
"
/>
<
/div
>
)
:
(
<
div
style
=
{{
cursor
:
"
pointer
"
}}
>
<
Badge
type
=
"
primary
"
content
=
"
Regular
"
/>
<
/div
>
)}
<
/td
>
<
/tr
>
);
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
h1
className
=
"
page-header
"
>
Manage
Delivery
Reports
<
/h1
>
<
div
className
=
"
row
"
><
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-12
"
>
<
div
className
=
"
card
"
>
{
isLoading
?
(
<
Spinner
/>
)
:
(
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
suppliers
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
ManageDeliveryReports
;
frontend/src/pages/ManageSites.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
Spinner
from
"
../components/loading/Spinner
"
;
import
"
../assets/css/Usercreate.css
"
;
import
axios
from
"
axios
"
;
const
ManageUsers
=
()
=>
{
const
[
error
,
setError
]
=
useState
(
""
);
const
[
btnState
,
setBtnState
]
=
useState
(
false
);
const
[
isLoading
,
setIsLoading
]
=
useState
(
true
);
const
[
siteManagers
,
setSiteManagers
]
=
useState
([]);
const
[
sites
,
setSites
]
=
useState
([]);
const
[
site
,
setSite
]
=
useState
({
name
:
""
,
location
:
""
,
siteManagerId
:
""
,
});
const
fields
=
[
""
,
"
Site Name
"
,
"
Location
"
,
"
Site Manager
"
,
"
Email
"
];
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
name
}
<
/td
>
<
td
>
{
item
.
location
}
<
/td
>
<
td
>
{
item
.
siteManagerId
?
item
.
siteManagerId
.
name
:
"
Not Assigned
"
}
<
/td
>
<
td
>
{
item
.
siteManagerId
?
item
.
siteManagerId
.
email
:
"
Not Assigned
"
}
<
/td
>
<
/tr
>
);
const
saveSite
=
async
(
e
)
=>
{
e
.
preventDefault
();
setBtnState
(
true
);
for
(
let
key
of
Object
.
keys
(
site
))
{
if
(
!
site
[
key
])
{
setBtnState
(
false
);
return
setError
(
"
Please fill all the fields
"
);
}
}
if
(
site
.
siteManagerId
===
"
sitemanager
"
)
{
setBtnState
(
false
);
return
setError
(
"
Please fill all the fields
"
);
}
try
{
const
res
=
await
axios
.
post
(
"
sites
"
,
site
);
setSite
({
name
:
""
,
location
:
""
,
siteManagerId
:
""
,
});
getAllSites
();
setError
(
""
);
window
.
alert
(
"
Site registered successfully
"
);
setBtnState
(
false
);
setIsLoading
(
true
);
}
catch
(
err
)
{
setBtnState
(
false
);
console
.
log
(
err
.
response
);
}
};
const
getAllSites
=
async
()
=>
{
try
{
const
res
=
await
axios
.
get
(
`sites`
);
setSites
(
res
.
data
.
sites
);
console
.
log
(
res
.
data
.
sites
);
setIsLoading
(
false
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
};
const
getAllSiteManagers
=
async
()
=>
{
try
{
const
res
=
await
axios
.
get
(
`sitemanagers`
);
setSiteManagers
(
res
.
data
.
sitemanagers
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
};
useEffect
(()
=>
{
getAllSites
();
getAllSiteManagers
();
},
[]);
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
h1
className
=
"
page-header
"
>
Manage
Sites
<
/h1
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-12
"
>
<
form
className
=
"
card
"
style
=
{{
position
:
"
relative
"
}}
>
{
error
&&
(
<
div
className
=
"
error-bg
"
style
=
{{
left
:
"
3%
"
}}
>
<
p
>
{
error
}
<
/p
>
<
/div
>
)}
<
div
className
=
"
row
"
>
<
div
className
=
"
col-6
"
>
<
div
className
=
"
row-user
"
>
<
input
type
=
"
text
"
placeholder
=
"
Site Name
"
value
=
{
site
.
name
}
onChange
=
{(
e
)
=>
setSite
({
...
site
,
name
:
e
.
target
.
value
,
})
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
col-6
"
>
<
div
className
=
"
row-user
"
>
<
input
type
=
"
text
"
placeholder
=
"
Site Location
"
value
=
{
site
.
location
}
onChange
=
{(
e
)
=>
setSite
({
...
site
,
location
:
e
.
target
.
value
,
})
}
required
/>
<
/div
>
<
/div
>
<
div
className
=
"
col-6
"
>
<
div
className
=
"
row-user
"
>
<
select
name
=
"
site
"
id
=
"
site
"
value
=
{
site
.
siteManagerId
}
onChange
=
{(
e
)
=>
setSite
({
...
site
,
siteManagerId
:
e
.
target
.
value
,
})
}
required
>
<
option
defaultValue
value
=
"
sitemanager
"
>
SELECT
SITE
MANAGER
<
/option
>
{
siteManagers
.
length
!==
0
&&
siteManagers
.
map
((
siteManager
)
=>
(
<
option
value
=
{
siteManager
.
_id
}
>
{
siteManager
.
name
}
<
/option
>
))}
<
/select
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row-user
"
>
<
button
type
=
"
submit
"
onClick
=
{
saveSite
}
>
{
btnState
?
"
Saving
"
:
"
Save
"
}
<
/button
>
<
/div
>
<
/form
>
<
/div
>
<
/div
>
<
div
className
=
"
card
"
>
<
h2
>
Site
Details
<
/h2
>
{
isLoading
?
(
<
Spinner
/>
)
:
(
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
sites
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
ManageUsers
;
frontend/src/pages/OfficerDashboard.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
Calendar
from
"
react-calendar
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
"
react-calendar/dist/Calendar.css
"
;
import
"
../components/badge/badge.css
"
;
import
AdminGreeting
from
"
../assets/images/admin-greeting.png
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
profilePicture
from
"
../assets/images/admin-user-img.jpg
"
;
import
axios
from
"
axios
"
;
import
status
from
"
../helpers/greeting
"
;
const
OfficerDashboard
=
()
=>
{
const
[
value
,
onChange
]
=
useState
(
new
Date
());
const
[
orders
,
setOrders
]
=
useState
(
null
);
const
fields
=
[
"
Order ID
"
,
"
Item Name
"
,
"
Quantity
"
,
"
Total
"
,
"
Created Date
"
,
"
Status
"
,
];
const
rows
=
[
{
id
:
"
1
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Approved
"
,
},
{
id
:
"
2
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Pending
"
,
},
{
id
:
"
3
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Declined
"
,
},
{
id
:
"
4
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Pending
"
,
},
{
id
:
"
4
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Pending
"
,
},
{
id
:
"
4
"
,
date
:
"
2021.08.06
"
,
houseOwner
:
"
Gayath Chandula
"
,
providence
:
"
Pool
"
,
status
:
"
Pending
"
,
},
];
const
permissionStatus
=
{
pending
:
"
warning
"
,
Approved
:
"
success
"
,
Declined
:
"
danger
"
,
};
const
deleteHandler
=
(
id
)
=>
{
console
.
log
(
id
);
};
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
itemName
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
{
item
.
total
}
<
/td
>
<
td
>
{
new
Date
(
item
.
createdAt
).
toLocaleDateString
()}
<
/td
>
<
td
>
<
Badge
type
=
{
permissionStatus
[
item
.
isApprovedByOfficer
]}
content
=
{
item
.
isApprovedByOfficer
}
/
>
<
/td
>
<
td
className
=
""
>
{
item
.
status
===
"
Pending
"
&&
(
<>
<
button
className
=
"
action-btn check
"
>
<
i
className
=
"
bx bx-check
"
><
/i
>
<
/button
>
<
button
className
=
"
action-btn x
"
>
<
i
className
=
"
bx bx-x
"
onClick
=
{()
=>
{
if
(
window
.
confirm
(
"
Are you sure to delete this request?
"
))
{
deleteHandler
(
item
.
id
);
}
}}
><
/i
>
<
/button
>
<
/
>
)}
<
/td
>
<
/tr
>
);
const
getAllOrder
=
async
()
=>
{
const
res
=
await
axios
.
get
(
"
orders/officer
"
);
setOrders
(
res
.
data
.
orders
);
console
.
log
(
res
);
};
console
.
log
(
orders
);
useEffect
(()
=>
{
getAllOrder
();
},
[]);
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8 full-width
"
>
<
div
className
=
"
card greeting-card
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8 flex-column
"
>
<
h1
className
=
"
page-header
"
>
{
`Good
${
status
}
!`
}
<
/h1
>
<
h3
>
Today
you
have
{
"
"
}
{
orders
&&
orders
.
filter
(
(
order
)
=>
order
.
isApprovedByOfficer
===
"
pending
"
).
length
}{
"
"
}
new
notifications
<
/h3
>
<
h3
>
Also
new
booking
appointments
for
approval
<
/h3
>
<
Link
className
=
"
read-more
"
>
Read
more
<
i
className
=
"
bx bx-right-arrow-alt
"
><
/i
>
<
/Link
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
img
className
=
"
admin-greeting
"
src
=
{
AdminGreeting
}
alt
=
""
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
col-4 full-width
"
>
<
div
className
=
"
card
"
>
<
h2
className
=
"
request-title
"
style
=
{{
color
:
"
transparent
"
,
marginBottom
:
"
-.2rem
"
}}
>
Calender
<
/h2
>
<
Calendar
className
=
"
calender
"
onChange
=
{
onChange
}
value
=
{
value
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8
"
>
<
div
className
=
"
card
"
>
<
div
className
=
"
flex
"
>
<
h2
className
=
"
request-title
"
>
New
Orders
<
/h2
>
<
Link
to
=
{
`/auth/officers/orderlist`
}
>
<
button
className
=
"
view-btn
"
>
View
All
<
/button
>
<
/Link
>
<
/div
>
{
orders
?
(
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
orders
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)
:
(
<
div
><
/div
>
)}
<
/div
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
div
className
=
"
card
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-4 full-width-1496
"
>
<
img
src
=
{
profilePicture
}
alt
=
""
className
=
"
profile-picture
"
/>
<
/div
>
<
div
className
=
"
col-8
"
>
<
h2
>
{
localStorage
.
getItem
(
"
name
"
)}
<
/h2
>
<
h3
className
=
"
lighter
"
>
OFFICER
<
/h3
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
OfficerDashboard
;
frontend/src/pages/OfficerOrders.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
axios
from
"
axios
"
;
import
Popup
from
"
./Popup
"
;
import
{
MdDelete
}
from
"
react-icons/md
"
;
import
{
FaCheckCircle
,
FaExclamationTriangle
,
FaCheckDouble
,
}
from
"
react-icons/fa
"
;
const
OfficerOrders
=
()
=>
{
const
fields
=
[
"
Order ID
"
,
"
Item Name
"
,
"
Quantity
"
,
"
Total
"
,
"
Created Date
"
,
"
Status
"
,
"
Actions
"
,
];
const
[
orders
,
setOrders
]
=
useState
(
null
);
const
[
trigger
,
setTrigger
]
=
useState
(
false
);
const
acceptOrder
=
async
(
id
)
=>
{
console
.
log
(
"
hi
"
);
try
{
const
res
=
await
axios
.
put
(
`orders/officer/
${
id
}
`
,
{
status
:
"
approved
"
,
});
console
.
log
(
res
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
getAllOrder
();
};
const
deleteHandler
=
async
(
id
)
=>
{
// console.log("hi");
try
{
const
res
=
await
axios
.
put
(
`orders/officer/
${
id
}
`
,
{
status
:
"
rejected
"
,
});
console
.
log
(
res
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
getAllOrder
();
};
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
itemName
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
{
item
.
total
}
<
/td
>
<
td
>
{
new
Date
(
item
.
createdAt
).
toLocaleDateString
()}
<
/td
>
<
td
>
<
Badge
type
=
{
permissionStatus
[
item
.
isApprovedByOfficer
]}
content
=
{
item
.
isApprovedByOfficer
}
/
>
<
/td
>
<
td
>
{
item
.
isApprovedByOfficer
==
"
pending
"
?
(
<
FaCheckCircle
className
=
"
action-btn check
"
onClick
=
{()
=>
{
acceptOrder
(
item
.
_id
);
window
.
alert
(
"
order accepted successfully
"
);
window
.
location
.
reload
();
}}
/
>
)
:
item
.
isApprovedByOfficer
==
"
approved
"
?
(
<
FaCheckDouble
className
=
"
action-btn check
"
/>
)
:
(
""
)}
{
item
.
isApprovedByOfficer
==
"
pending
"
?
(
<>
<
MdDelete
className
=
"
action-btn x
"
onClick
=
{()
=>
{
// if (window.confirm("Are you sure to delete this request?")) {
deleteHandler
(
item
.
_id
);
setTrigger
(
true
);
// }
}}
/
>
<
Popup
trigger
=
{
trigger
}
setTrigger
=
{
setTrigger
}
orderId
=
{
item
.
_id
}
name
=
"
rejectReason
"
/>
<
/
>
)
:
item
.
isApprovedByOfficer
==
"
rejected
"
?
(
<
FaExclamationTriangle
className
=
"
action-btn x
"
/>
)
:
(
""
)}
{
item
.
isApprovedByOfficer
==
"
approved
"
&&
!
item
.
supplierId
?
(
<>
<
button
className
=
"
action-btn item-assign
"
onClick
=
{()
=>
{
setTrigger
(
true
);
}}
>
<
i
className
=
"
bx bxs-user-plus
"
><
/i
>
<
/button
>
<
Popup
trigger
=
{
trigger
}
setTrigger
=
{
setTrigger
}
order
=
{
item
.
itemName
}
orderId
=
{
item
.
_id
}
materialId
=
{
item
.
orderItem
}
sitemng
=
{
item
.
siteManagerId
}
total
=
{
item
.
total
}
name
=
"
Assign
"
/>
<
/
>
)
:
(
""
)}
<
/td
>
<
/tr
>
);
const
getAllOrder
=
async
()
=>
{
const
res
=
await
axios
.
get
(
"
orders/officer/orders
"
);
// console.log(res.data.orders);
setOrders
(
res
.
data
.
orders
);
};
useEffect
(()
=>
{
getAllOrder
();
},
[]);
const
permissionStatus
=
{
pending
:
"
warning
"
,
approved
:
"
success
"
,
rejected
:
"
danger
"
,
};
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
{
orders
&&
(
<
Table
limit
=
"
10
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
orders
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)}
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
OfficerOrders
;
frontend/src/pages/SiteManagerDashboard.js
0 → 100644
View file @
5d4ba196
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Link
}
from
"
react-router-dom
"
;
import
Sidebar
from
"
../components/sidebar/Sidebar
"
;
import
TopNav
from
"
../components/topnav/TopNav
"
;
import
Table
from
"
../components/table/Table
"
;
import
AdminGreeting
from
"
../assets/images/admin-greeting.png
"
;
import
Badge
from
"
../components/badge/Badge
"
;
import
"
../components/badge/badge.css
"
;
import
Calendar
from
"
react-calendar
"
;
import
"
react-calendar/dist/Calendar.css
"
;
import
profilePicture
from
"
../assets/images/user2.jpg
"
;
import
Spinner
from
"
../components/loading/Spinner
"
;
import
axios
from
"
axios
"
;
const
SiteManagerDashboard
=
()
=>
{
const
[
value
,
onChange
]
=
useState
(
new
Date
());
const
fields
=
[
""
,
"
Required Date
"
,
"
Item
"
,
"
Quantity
"
,
"
Delivery Status
"
];
const
[
OrderDetail
,
setOrderDetail
]
=
useState
([])
const
[
Loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
const
FetchData
=
async
()
=>
{
const
res
=
await
axios
.
get
(
"
/orders/approved
"
);
setOrderDetail
(
res
.
data
.
orders
);
console
.
log
(
res
.
data
);
if
(
res
.
statusText
===
"
OK
"
){
setLoading
(
true
)
}
};
FetchData
();
},
[]);
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{
item
.
requiredDate
}
<
/td
>
<
td
>
{
item
.
itemName
}
<
/td
>
<
td
>
{
item
.
quantity
}
<
/td
>
<
td
>
<
div
className
=
"
row-user
"
style
=
{{
paddingTop
:
"
0
"
}}
>
{
item
.
DeliveryStatus
===
"
pending
"
?
(
<
Badge
type
=
"
warning
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
item
.
DeliveryStatus
===
"
preparing
"
?
(
<
Badge
type
=
"
primary
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
item
.
DeliveryStatus
===
"
delivering
"
?
(
<
Badge
type
=
"
success
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
item
.
DeliveryStatus
===
"
delivered
"
?
(
<
Badge
type
=
"
success
"
content
=
{
item
.
DeliveryStatus
}
/
>
)
:
(
""
)}
<
/div
>
<
/td
>
<
/tr
>
);
return
(
<
div
>
<
Sidebar
/>
<
div
id
=
"
main
"
className
=
"
layout__content
"
>
<
TopNav
/>
<
div
className
=
"
layout__content-main
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8 full-width
"
>
<
div
className
=
"
card greeting-card
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8 flex-column
"
>
<
h1
className
=
"
page-header
"
>
Good
Morning
!
<
/h1
>
<
h3
>
Today
you
have
9
new
notifications
<
/h3
>
<
h3
>
Also
new
booking
appointments
for
approval
<
/h3
>
<
Link
className
=
"
read-more
"
>
Read
more
<
i
className
=
"
bx bx-right-arrow-alt
"
><
/i
>
<
/Link
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
img
className
=
"
admin-greeting
"
src
=
{
AdminGreeting
}
alt
=
""
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
col-4 full-width
"
>
<
div
className
=
"
card
"
>
<
h2
className
=
"
request-title
"
style
=
{{
color
:
"
transparent
"
,
marginBottom
:
"
-.2rem
"
}}
>
Calender
<
/h2
>
<
Calendar
className
=
"
calender
"
onChange
=
{
onChange
}
value
=
{
value
}
/
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-8
"
>
<
div
className
=
"
card
"
>
<
div
className
=
"
flex
"
>
<
h2
className
=
"
request-title
"
>
New
Orders
<
/h2
>
<
Link
to
=
{
`/auth/sitemanager/requisitions`
}
>
<
button
className
=
"
view-btn
"
>
View
All
<
/button
>
<
/Link
>
<
/div
>
{
Loading
?
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
OrderDetail
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/>:<Spinner/
>
}
<
/div
>
<
/div
>
<
div
className
=
"
col-4
"
>
<
div
className
=
"
card
"
>
<
div
className
=
"
row
"
>
<
div
className
=
"
col-4 full-width-1496
"
>
<
img
src
=
{
profilePicture
}
alt
=
""
className
=
"
profile-picture
"
/>
<
/div
>
<
div
className
=
"
col-8
"
>
<
h2
>
{
localStorage
.
getItem
(
"
name
"
)}
<
/h2
>
<
h3
className
=
"
lighter
"
>
SITE
MANAGER
<
/h3
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
);
};
export
default
SiteManagerDashboard
;
frontend/src/pages/StudentSubjectAssingment.js
View file @
5d4ba196
This diff is collapsed.
Click to expand it.
frontend/src/routes/Routes.js
View file @
5d4ba196
...
@@ -2,8 +2,11 @@ import React, { useContext } from "react";
...
@@ -2,8 +2,11 @@ import React, { useContext } from "react";
import
{
Route
,
Switch
}
from
"
react-router-dom
"
;
import
{
Route
,
Switch
}
from
"
react-router-dom
"
;
import
Assign
from
"
../pages/Assign
"
;
import
Assign
from
"
../pages/Assign
"
;
import
DeliveryReportSubmit
from
"
../pages/DeliveryReportSubmit
"
;
import
Inventory
from
"
../pages/Inventory
"
;
import
Inventory
from
"
../pages/Inventory
"
;
import
Login
from
"
../pages/Login
"
;
import
Login
from
"
../pages/Login
"
;
import
ManageAllOrders
from
"
../pages/ManageAllOrders
"
;
import
ManageDeliveryReports
from
"
../pages/ManageDeliveryReports
"
;
import
ManageAssignments
from
"
../pages/ManageAssignments
"
;
import
ManageAssignments
from
"
../pages/ManageAssignments
"
;
import
SubjectsStudent
from
"
../pages/SubjectsStudent
"
;
import
SubjectsStudent
from
"
../pages/SubjectsStudent
"
;
import
ManagerApprovedOrders
from
"
../pages/ManagerApprovedOrders
"
;
import
ManagerApprovedOrders
from
"
../pages/ManagerApprovedOrders
"
;
...
@@ -11,7 +14,10 @@ import TeacherDashboard from "../pages/TeacherDashboard";
...
@@ -11,7 +14,10 @@ import TeacherDashboard from "../pages/TeacherDashboard";
import
ManageServices
from
"
../pages/ManageServices
"
;
import
ManageServices
from
"
../pages/ManageServices
"
;
import
ManageStudents
from
"
../pages/ManageStudents
"
;
import
ManageStudents
from
"
../pages/ManageStudents
"
;
import
ManageModules
from
"
../pages/ManageModules
"
;
import
ManageModules
from
"
../pages/ManageModules
"
;
import
OfficerDashboard
from
"
../pages/OfficerDashboard
"
;
import
OfficerOrders
from
"
../pages/OfficerOrders
"
;
import
Register
from
"
../pages/Register
"
;
import
Register
from
"
../pages/Register
"
;
import
SiteManagerDashboard
from
"
../pages/SiteManagerDashboard
"
;
import
StudentSubjectAssingment
from
"
../pages/StudentSubjectAssingment
"
;
import
StudentSubjectAssingment
from
"
../pages/StudentSubjectAssingment
"
;
import
ViewAssignment
from
"
../pages/ViewAssignment
"
;
import
ViewAssignment
from
"
../pages/ViewAssignment
"
;
import
StudentDashboard
from
"
../pages/StudentDashboard
"
;
import
StudentDashboard
from
"
../pages/StudentDashboard
"
;
...
@@ -30,42 +36,18 @@ const Routes = () => {
...
@@ -30,42 +36,18 @@ const Routes = () => {
<
Route
exact
path
=
"
/register
"
component
=
{
Register
}
/
>
<
Route
exact
path
=
"
/register
"
component
=
{
Register
}
/
>
<
Route
exact
path
=
"
/login
"
component
=
{
Login
}
/
>
<
Route
exact
path
=
"
/login
"
component
=
{
Login
}
/
>
<
Route
<
Route
exact
path
=
"
/auth/teacher/dashboard
"
component
=
{
TeacherDashboard
}
/
>
exact
path
=
"
/auth/teacher/dashboard
"
component
=
{
TeacherDashboard
}
/
>
<
Route
exact
path
=
"
/auth/teacher/students
"
component
=
{
ManageStudents
}
/
>
<
Route
exact
path
=
"
/auth/teacher/students
"
component
=
{
ManageStudents
}
/
>
<
Route
exact
path
=
"
/auth/teacher/modules
"
component
=
{
ManageModules
}
/
>
<
Route
exact
path
=
"
/auth/teacher/modules
"
component
=
{
ManageModules
}
/
>
<
Route
<
Route
exact
path
=
"
/auth/teacher/assignments
"
component
=
{
ManageAssignments
}
/
>
exact
<
Route
exact
path
=
"
/auth/teacher/assignments/:id
"
component
=
{
ViewAssignment
}
/
>
path
=
"
/auth/teacher/assignments
"
<
Route
exact
path
=
"
/auth/teacher/assignments/:id/diagrams
"
component
=
{
GeneratedDiagrams
}
/
>
component
=
{
ManageAssignments
}
/
>
<
Route
exact
path
=
"
/auth/teacher/assignments/:id
"
component
=
{
ViewAssignment
}
/
>
<
Route
exact
path
=
"
/auth/teacher/assignments/:id/diagrams
"
component
=
{
GeneratedDiagrams
}
/
>
<
Route
<
Route
exact
path
=
"
/auth/student/dashboard
"
component
=
{
StudentDashboard
}
/
>
exact
path
=
"
/auth/student/dashboard
"
component
=
{
StudentDashboard
}
/
>
<
Route
exact
path
=
"
/auth/student/modules
"
component
=
{
SubjectsStudent
}
/
>
<
Route
exact
path
=
"
/auth/student/modules
"
component
=
{
SubjectsStudent
}
/
>
<
Route
exact
path
=
"
/auth/student/services
"
component
=
{
ManageServices
}
/
>
<
Route
exact
path
=
"
/auth/student/services
"
component
=
{
ManageServices
}
/
>
<
Route
<
Route
exact
path
=
"
/auth/student/assignment
"
component
=
{
StudentSubjectAssingment
}
/
>
exact
path
=
"
/auth/student/assignment/:id
"
component
=
{
StudentSubjectAssingment
}
/
>
<
/Switch
>
<
/Switch
>
);
);
};
};
...
...
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