Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
21_22-J 31
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
3
Merge Requests
3
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
21_22-J 31
21_22-J 31
Commits
566dd342
Commit
566dd342
authored
Jan 06, 2022
by
Withana R.D.K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Employee Status
parent
83466dd2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
4 deletions
+89
-4
Data/EmployeeStatus.csv
Data/EmployeeStatus.csv
+1
-1
User/urls.py
User/urls.py
+1
-0
User/views.py
User/views.py
+21
-1
templates/Admin/EmployeeStatus_Update.html
templates/Admin/EmployeeStatus_Update.html
+64
-0
templates/Admin/Sidebar2.html
templates/Admin/Sidebar2.html
+2
-2
No files found.
Data/EmployeeStatus.csv
View file @
566dd342
StaffID,Availability
1,Yes
2,
No
2,
Yes
3,Yes
4,Yes
5,Yes
User/urls.py
View file @
566dd342
...
...
@@ -11,6 +11,7 @@ urlpatterns = [
path
(
'AdminLogin/'
,
responseapp_views
.
AdminLogin
),
path
(
'AdminHome/'
,
responseapp_views
.
AdminHome
),
path
(
'Employee_Data/'
,
responseapp_views
.
Employee_Data
),
path
(
'EmployeeStatus_Update/'
,
responseapp_views
.
EmployeeStatus_Update
),
path
(
'PurchaseHistory/'
,
responseapp_views
.
PurchaseHistory
),
path
(
'Forecasting/'
,
responseapp_views
.
Forecasting
),
path
(
'Result/'
,
responseapp_views
.
Forecasting
),
...
...
User/views.py
View file @
566dd342
...
...
@@ -34,7 +34,7 @@ def Homepage(request):
# Employee_Efficency
def
Employee_Data
(
request
):
data1
=
pd
.
read_csv
(
'Data/WorkHistory.csv'
)
data2
=
pd
.
read_csv
(
'Data/EmployeeStatus.csv'
)
...
...
@@ -47,6 +47,26 @@ def Employee_Data(request):
context
=
{
'd'
:
arr
}
return
render
(
request
,
'Admin/Employee_Data.html'
,
context
);
def
EmployeeStatus_Update
(
request
):
if
request
.
method
==
'POST'
:
myForm
=
MyForm3
(
request
.
POST
)
if
myForm
.
is_valid
():
StaffID
=
myForm
.
cleaned_data
[
'StaffID'
]
Availability
=
myForm
.
cleaned_data
[
'Availability'
]
DateSet
=
pd
.
read_csv
(
"Data/EmployeeStatus.csv"
)
StaffID
=
(
int
(
StaffID
)
-
1
)
DateSet
.
at
[
StaffID
,
'Availability'
]
=
Availability
DateSet
.
to_csv
(
"Data/EmployeeStatus.csv"
,
index
=
False
)
messages
.
success
(
request
,
'Employee status successfully! Updated.'
)
return
HttpResponseRedirect
(
request
.
path_info
)
else
:
form
=
MyForm3
()
return
render
(
request
,
'Admin/EmployeeStatus_Update.html'
,
{
'form'
:
form
});
else
:
form
=
MyForm3
()
return
render
(
request
,
'Admin/EmployeeStatus_Update.html'
,
{
'form'
:
form
});
# Demand Forecasting
def
PurchaseHistory
(
request
):
data
=
pd
.
read_csv
(
'Data/Purchasefile.csv'
)
...
...
templates/Admin/EmployeeStatus_Update.html
0 → 100644
View file @
566dd342
{% extends 'Admin/Sidebar2.html' %}
{% block content %}
{% load widget_tweaks %}
{%load static%}
<head>
<!-- Font special for pages-->
<link
href=
"https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i"
rel=
"stylesheet"
>
<!-- Main CSS-->
<link
href=
"{% static "
css
/
main
.
css
"
%}"
rel=
"stylesheet"
media=
"all"
>
</head>
<div
class=
" >
<div class="
wrapper
wrapper
0
"
>
<div
style=
"margin-left: 0px;"
class=
"card card-5"
>
<br/><br/>
{% if messages %}
<div
class=
"alert alert-danger"
role=
"alert"
>
{% for message in messages %}
{% if message.tags %} {% endif %} {{ message }}
{% endfor %}
</div>
{% endif %}
<div
class=
"card-heading"
>
<h2
class=
"title"
>
ASSIGN EMPLOYEE
</h2>
</div>
<div
class=
"card-body"
>
<form
action=
"/Admin/EmployeeStatus_Update/"
method=
"post"
>
{% csrf_token %}
<table
class=
"table table-light"
>
{{form.as_table}}
</table>
<input
type=
"submit"
value=
"Assign"
class=
"btn btn--radius-2 btn-primary"
/>
<div
role=
"alert"
>
<center><h3>
{{ Price_prediction }}
</h3></center>
</div>
</form>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</div>
</div><div
class=
"alert alert-primary"
role=
"alert"
>
© SMART SERVICE STATION 2022
</div>
</div>
{% endblock content %}
templates/Admin/Sidebar2.html
View file @
566dd342
...
...
@@ -3,7 +3,7 @@
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
S
MART SERVICE STATION
</title>
<title>
S
ERVPORT | Your Service Station Partner
</title>
<link
rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity=
"sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin=
"anonymous"
>
...
...
@@ -186,7 +186,7 @@ body{
<li><a
style=
"text-decoration:none;"
href=
"#"
><i
class=
"fas fa-barcode"
></i>
Employee Efficiency
</a>
<li><a
style=
"text-decoration:none;"
href=
"/Admin/Employee_Data/"
><i
class=
"fas fa-paper-plane "
></i>
Employee Data
</a>
<li><a
style=
"text-decoration:none;"
href=
"
#
"
><i
class=
"fas fa-upload"
></i>
Assign Employee
</a>
<li><a
style=
"text-decoration:none;"
href=
"
/Admin/EmployeeStatus_Update/
"
><i
class=
"fas fa-upload"
></i>
Assign Employee
</a>
</li>
<li><a
style=
"text-decoration:none;"
href=
"/Admin/Forecasting/"
><i
class=
"fas fa-bullseye "
></i>
Demand Forecasting
</a>
...
...
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