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):
#Customer Frequency
class MyForm(forms.Form):
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 = [
path('Result/', responseapp_views.Forecasting),
path('Customer_Data/', responseapp_views.Customer_Data),
path('Customer_Frequency/', responseapp_views.Customer_Frequency),
path('MaintainData/', responseapp_views.MaintainData),
path('NextMaintain/', responseapp_views.NextMaintain),
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,14 +15,12 @@
<div style="margin-left: 0px;" class="card card-5">
<br/><br/>
{% if messages %}
<div class="alert alert-danger" role="alert">
<ul class="messages">
{% for message in messages %}
{% if message.tags %} {% endif %} {{ message }}
<li {% if message.tags %} class=" {{ message.tags }} " {% endif %}> {{ message }} </li>
{% endfor %}
</div>
</ul>
{% endif %}
<div class="card-heading">
......@@ -31,37 +29,50 @@
<div class="card-body">
<form action="/Admin/Predicted_Date/" method="post">
<form action="/Admin/NextMaintain/" method="post">
{% csrf_token %}
<table class="table table-light">
{{form3.as_table}}
{{form.as_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>
<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 class="alert alert-primary fixed-bottom mb-0 text-center" style="background: #747578; border: none; color: white;" role="alert" > © SERVPORT 2022 </div>
</div>
<div class="alert alert-primary" role="alert" >© SMART SERVICE STATION 2022 </div>
</div>
{% 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{
<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_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"><i class="fas fa-chart-bar"></i> Vehicle Maintenance Data </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/MaintainData/"><i class="fas fa-chart-bar"></i> Maintenance Data </a>
</ul>
</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