Commit 30eb22c8 authored by Chalaka Tharindu Jayasinghe's avatar Chalaka Tharindu Jayasinghe

Merge branch 'maintenaceDateBE' into 'master'

Maintenace date BE

See merge request !26
parents ef3abe04 2264a27f
This diff is collapsed.
...@@ -60,3 +60,18 @@ class MyForm3(forms.Form): ...@@ -60,3 +60,18 @@ class MyForm3(forms.Form):
#Customer Frequency #Customer Frequency
class MyForm(forms.Form): class MyForm(forms.Form):
customerid = forms.IntegerField(label='Customer ID', widget=forms.TextInput(attrs={'class': 'input_field', 'required': True})) customerid = forms.IntegerField(label='Customer ID', widget=forms.TextInput(attrs={'class': 'input_field', 'required': True}))
#Maitenance Date
MODE_SERVICES = [
('0', 'Select Service Type'),
('1', 'Full Service')
]
class MyFormServices(forms.Form):
customerid = forms.IntegerField(label='Enter Customer ID ')
Vnumber = forms.CharField(label='Enter Vehicle Number ')
ServiceType = forms.IntegerField(label="Select Service", widget=forms.Select(choices=MODE_SERVICES))
...@@ -18,5 +18,7 @@ urlpatterns = [ ...@@ -18,5 +18,7 @@ urlpatterns = [
path('Result/', responseapp_views.Forecasting), path('Result/', responseapp_views.Forecasting),
path('Customer_Data/', responseapp_views.Customer_Data), path('Customer_Data/', responseapp_views.Customer_Data),
path('Customer_Frequency/', responseapp_views.Customer_Frequency), path('Customer_Frequency/', responseapp_views.Customer_Frequency),
path('MaintainData/', responseapp_views.MaintainData),
path('NextMaintain/', responseapp_views.NextMaintain),
path('', admin.site.urls), path('', admin.site.urls),
] ]
\ No newline at end of file
This diff is collapsed.
No preview for this file type
{% 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"> MAINTAINS DATA </h2>
</div>
<div id="myDiv">
<div id="div_print">
<div class="card card-body printableArea">
<div class="container" style="overflow-x:auto;">
Customer Maintains Data
<table class="table table-striped">
<thead>
<tr>
<th> Service Date </th>
<th> Service </th>
<th> Taken Time </th>
<th> Price </th>
<th> Customer </th>
<th> Vehicle Type </th>
<th> Vehicle Make </th>
<th> Vehicle Model </th>
<th> Vehicle Number </th>
<th> Meter Reading </th>
<th> Vehicle Manufactured Year </th>
<th> Average Usage </th>
</tr>
</thead>
<tbody>
{% if d %}
{% for i in d %}
<tr>
<td>{{i.Date}}</td>
<td>{{i.ServiceName}}</td>
<td>{{i.TakenTime}}</td>
<td>{{i.Price}}</td>
<td>{{i.Customer}}</td>
<td>{{i.VehicleType}} </td>
<td>{{i.VehicleMake}} </td>
<td>{{i.VehicleModel}} </td>
<td>{{i.VehicleNumber}} </td>
<td>{{i.MeterReading}} </td>
<td>{{i.VehicleManufacturedYear}} </td>
<td>{{i.AverageUsage}} </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-primary btn-print" onClick="printdiv('div_print');" value=" Print ">
</div>
<div class="alert alert-primary" role="alert" >© SMART SERVICE STATION 2022 </div>
</div>
</div>
</div>
</div>
{% endblock content %}
...@@ -15,53 +15,64 @@ ...@@ -15,53 +15,64 @@
<div style="margin-left: 0px;" class="card card-5"> <div style="margin-left: 0px;" class="card card-5">
<br/><br/>
{% if messages %} {% if messages %}
<div class="alert alert-danger" role="alert"> <ul class="messages">
{% for message in messages %} {% for message in messages %}
{% if message.tags %} {% endif %} {{ message }} <li {% if message.tags %} class=" {{ message.tags }} " {% endif %}> {{ message }} </li>
{% endfor %} {% endfor %}
</div> </ul>
{% endif %} {% endif %}
<div class="card-heading"> <div class="card-heading">
<h2 class="title"> NEXT MAINTAIN DATE PREDICTION </h2> <h2 class="title"> NEXT MAINTAIN DATE PREDICTION </h2>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="/Admin/Predicted_Date/" method="post"> <form action="/Admin/NextMaintain/" method="post">
{% csrf_token %} {% csrf_token %}
<table class="table table-light"> <table class="table table-light">
{{form3.as_table}}
{{form.as_table}} {{form.as_table}}
</table> </table>
<input type="submit" value="NEXT MAINTAIN DATE" class="btn btn--radius-2 btn" style="background:#02111f"/> <input type="submit" value="NEXT MAINTAIN DATE" class="btn btn--radius-2 btn-primary"/>
<div role="alert">
<center><h3> {{ d }} </h3></center>
</div>
</form> </form>
<br> <br>
<center> <div class="alert alert-success">
{{ d }}
{{ forecastedPrice }}
<br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
</div> </center>
</div> </div>
</div>
</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 class="alert alert-primary" role="alert" >© SMART SERVICE STATION 2022 </div>
</div> </div>
{% endblock content %} {% endblock content %}
{% 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>
<center>
<div class=">
<div class="wrapper wrapper--w790">
<div style="margin-left: 0px;" class="card card-5">
<div class="card-heading">
<h2 class="title"> Next Service Date </h2>
</div>
{% autoescape off %}
<div>{{ g }}</div>
{% endautoescape %}
<div class="alert alert-danger" role="alert">
Next Service Date is : {{ d }}
<br>
</div>
</div>
</div>
</div>
{% endblock content %}
...@@ -188,8 +188,8 @@ body{ ...@@ -188,8 +188,8 @@ body{
<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> <li><a style="text-decoration:none;" href="/Admin/Customer_Data/"><i class="fas fa-user"></i> Customer Data </a>
<li><a style="text-decoration:none;" href="/Admin/Customer_Frequency/"><i class="fas fa-chart-bar"></i> Customer Frequency </a> <li><a style="text-decoration:none;" href="/Admin/Customer_Frequency/"><i class="fas fa-chart-bar"></i> Customer Frequency </a>
<li><a style="text-decoration:none;" href="/Admin/Next_Maintain/"><i class="fas fa-user"></i> Next Service Date </a> <li><a style="text-decoration:none;" href="/Admin/NextMaintain/"><i class="fas fa-user"></i> Next Service Date </a>
<li><a style="text-decoration:none;" href="/Admin"><i class="fas fa-chart-bar"></i> Vehicle Maintenance Data </a> <li><a style="text-decoration:none;" href="/Admin/MaintainData/"><i class="fas fa-chart-bar"></i> Maintenance Data </a>
</ul> </ul>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment