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
b8913db9
Commit
b8913db9
authored
Jan 08, 2022
by
Shivanthi Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add customer dataset and display customer dataset
parent
74a81db5
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
623 additions
and
1 deletion
+623
-1
Data/CustomerDataset.csv
Data/CustomerDataset.csv
+501
-0
User/urls.py
User/urls.py
+1
-0
User/views.py
User/views.py
+10
-0
db.sqlite3
db.sqlite3
+0
-0
templates/Admin/Customer_Data.html
templates/Admin/Customer_Data.html
+110
-0
templates/Admin/Sidebar2.html
templates/Admin/Sidebar2.html
+1
-1
No files found.
Data/CustomerDataset.csv
0 → 100644
View file @
b8913db9
This diff is collapsed.
Click to expand it.
User/urls.py
View file @
b8913db9
...
@@ -15,5 +15,6 @@ urlpatterns = [
...
@@ -15,5 +15,6 @@ urlpatterns = [
path
(
'PurchaseHistory/'
,
responseapp_views
.
PurchaseHistory
),
path
(
'PurchaseHistory/'
,
responseapp_views
.
PurchaseHistory
),
path
(
'Forecasting/'
,
responseapp_views
.
Forecasting
),
path
(
'Forecasting/'
,
responseapp_views
.
Forecasting
),
path
(
'Result/'
,
responseapp_views
.
Forecasting
),
path
(
'Result/'
,
responseapp_views
.
Forecasting
),
path
(
'Customer_Data/'
,
responseapp_views
.
Customer_Data
),
path
(
''
,
admin
.
site
.
urls
),
path
(
''
,
admin
.
site
.
urls
),
]
]
\ No newline at end of file
User/views.py
View file @
b8913db9
...
@@ -210,6 +210,16 @@ def AdminLogin(request):
...
@@ -210,6 +210,16 @@ def AdminLogin(request):
form
=
MyForm2
()
form
=
MyForm2
()
return
render
(
request
,
'Admin/AdminLogin.html'
,
{
'form'
:
form
});
return
render
(
request
,
'Admin/AdminLogin.html'
,
{
'form'
:
form
});
# Customer Data
def
Customer_Data
(
request
):
data
=
pd
.
read_csv
(
'Data/CustomerDataset.csv'
)
finalpt
=
data
.
head
(
500
)
json_records
=
finalpt
.
reset_index
()
.
to_json
(
orient
=
'records'
)
arr
=
[]
arr
=
json
.
loads
(
json_records
)
context
=
{
'd'
:
arr
}
return
render
(
request
,
'Admin/Customer_Data.html'
,
context
);
def
AdminHome
(
request
):
def
AdminHome
(
request
):
return
render
(
request
,
'Admin/AdminHome.html'
)
return
render
(
request
,
'Admin/AdminHome.html'
)
...
...
db.sqlite3
View file @
b8913db9
No preview for this file type
templates/Admin/Customer_Data.html
0 → 100644
View file @
b8913db9
{% 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"
>
{% if messages %}
<ul
class=
"messages"
>
{% for message in messages %}
<li
{%
if
message
.
tags
%}
class=
" {{ message.tags }} "
{%
endif
%}
>
{{ message }}
</li>
{% endfor %}
</ul>
{% endif %}
<div
class=
"card-heading"
>
<h2
class=
"title mt-3"
style=
"color: #02111f;"
>
CUSTOMER DATA
</h2>
</div>
<div
id=
"myDiv"
>
<div
id=
"div_print"
>
<div
class=
"card card-body printableArea"
>
<div
class=
"container"
style=
"overflow-x:auto;"
>
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
Customer ID
</th>
<th>
Customer Name
</th>
<th>
Mobile Number
</th>
<th>
NIC
</th>
<th>
Vehicle No
</th>
<th>
Vehicle Type
</th>
<th>
Service ID
</th>
<th>
Service Price
</th>
<th>
Invoice No
</th>
<th>
Invoice Date
</th>
</tr>
</thead>
<tbody>
{% if d %}
{% for i in d %}
<tr>
<td>
{{i.CustomerID}}
</td>
<td>
{{i.CustomerName}}
</td>
<td>
{{i.MobileNumber}}
</td>
<td>
{{i.NIC}}
</td>
<td>
{{i.VehicleNo}}
</td>
<td>
{{i.VehicleType}}
</td>
<td>
{{i.ServiceID}}
</td>
<td>
{{i.ServicePrice}}
</td>
<td>
{{i.InvoiceNo}}
</td>
<td>
{{i.InvoiceDate}}
</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
</div>
</div></div>
<script
language=
"javascript"
>
function
printdiv
(
printpage
)
{
var
headstr
=
"
<html><head><title></title></head><body>
"
;
var
footstr
=
"
</body>
"
;
var
newstr
=
document
.
all
.
item
(
printpage
).
innerHTML
;
var
oldstr
=
document
.
body
.
innerHTML
;
document
.
body
.
innerHTML
=
headstr
+
newstr
+
footstr
;
window
.
print
();
document
.
body
.
innerHTML
=
oldstr
;
location
.
reload
();
return
false
;
}
</script>
<div
class=
"card-body"
>
<input
name=
"b_print"
type=
"button"
class=
"btn btn-print"
onClick=
"printdiv('div_print');"
value=
" Print "
style=
"background: #02111f;"
>
</div>
<div
class=
"alert alert-primary fixed-bottom mb-0 text-center"
style=
"background: #747578; border: none; color: white;"
role=
"alert"
>
© SERVPORT 2022
</div>
</div>
</div>
</div>
</div>
{% endblock content %}
templates/Admin/Sidebar2.html
View file @
b8913db9
...
@@ -186,7 +186,7 @@ body{
...
@@ -186,7 +186,7 @@ body{
<li><a
style=
"text-decoration:none;"
href=
"/Admin/Forecasting/"
><i
class=
"fas fa-bullseye "
></i>
Demand Forecasting
</a>
<li><a
style=
"text-decoration:none;"
href=
"/Admin/Forecasting/"
><i
class=
"fas fa-bullseye "
></i>
Demand Forecasting
</a>
<li><a
style=
"text-decoration:none;"
href=
"#"
><i
class=
"fas fa-eye"
></i>
Highest Demand
</a>
<li><a
style=
"text-decoration:none;"
href=
"#"
><i
class=
"fas fa-eye"
></i>
Highest Demand
</a>
<li><a
style=
"text-decoration:none;"
href=
"/Admin/PurchaseHistory/"
><i
class=
"fas fa-cubes"
></i>
Purchase History
</a>
<li><a
style=
"text-decoration:none;"
href=
"/Admin/PurchaseHistory/"
><i
class=
"fas fa-cubes"
></i>
Purchase History
</a>
<li><a
style=
"text-decoration:none;"
href=
"/Admin/Customer_Data/"
><i
class=
"fas fa-user"
></i>
Customer Data
</a>
</ul>
</ul>
...
...
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