-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvendors.html
86 lines (83 loc) · 3.56 KB
/
vendors.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{% extends 'base.html' %}
{% block title %}
<title>Inventory Managmnet App</title>
{% endblock %}
{% block content %}
<main>
<div class="container-fluid">
<h1 class="mt-4">Dashboard</h1>
<ol class="breadcrumb mb-4">
<li class="breadcrumb-item"><a href="/">Dashboard</a></li>
<li class="breadcrumb-item active">Vendors</li>
</ol>
<div class="card mb-4">
<div class="card-header">Vendors</div>
<div class="card-body">
<div class="card mb-4">
<div class="card-header">New Vendor</div>
<div class="card-body">
<form action="/vendors/" method="POST" id="vendor_form">
<label for="vendor_id" class="col-form-label">Vendor Name</label>
<input type="text" name="vendor_id" id="vendor_id">
<label for="vendor_address" class="col-form-label">Vendor Address</label>
<input type="text" name="vendor_address" id="vendor_address">
<label for="vendor_phn" class="col-form-label">Vendor Phonenumber</label>
<input type="number" name="vendor_phn" id="vendor_phn">
<input id="submitVendor" value="Add Vendor" class="btn btn-primary">
</form>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table mr-1"></i>
vendors Table
</div>
<div class="card-body">
<div class="table-responsive">
{% if vendors|length < 1 %}
<h4>There are no Vendors, add one above</h4>
{% else %}
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>Vendor Name</th>
<th>Vendor Address</th>
<th>Vendor Phonenumber</th>
<th>Date</th>
<th>Actions</th>
</tr>
</thead>
<tfoot>
</tfoot>
<tbody>
{% for vendor in vendors %}
<tr>
<td>{{ vendor.vendor_id }}</td>
<td>{{ vendor.vendor_phn }}</td>
<td>{{ vendor.vendor_address }}</td>
<td>{{ vendor.date_created.date() }}</td>
<td>
<a href="/delete-vendor/{{ vendor.vendor_id }}" onclick="return confirmDelete();">Delete</a>
<script>
function confirmDelete() {
if (confirm("Are you sure you want to delete this vendor?")) {
return true;
} else {
return false;
}
}
</script>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</main>
{% endblock %}