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
c7eab748
Commit
c7eab748
authored
Jan 05, 2022
by
Withana R.D.K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Employee Status
parent
8ff30e7d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
1 deletion
+87
-1
User/urls.py
User/urls.py
+1
-0
User/views.py
User/views.py
+21
-0
templates/Admin/EmployeeStatus_Update.html
templates/Admin/EmployeeStatus_Update.html
+64
-0
templates/Admin/Sidebar2.html
templates/Admin/Sidebar2.html
+1
-1
No files found.
User/urls.py
View file @
c7eab748
...
...
@@ -11,5 +11,6 @@ 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
(
''
,
admin
.
site
.
urls
),
]
\ No newline at end of file
User/views.py
View file @
c7eab748
...
...
@@ -43,6 +43,27 @@ def Employee_Data(request):
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
});
def
AdminLogin
(
request
):
if
request
.
method
==
'POST'
:
myForm
=
MyForm2
(
request
.
POST
)
...
...
templates/Admin/EmployeeStatus_Update.html
0 → 100644
View file @
c7eab748
{% 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 @
c7eab748
...
...
@@ -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>
...
...
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