Skip to content

Commit 08b2209

Browse files
Update table styles in profile, damage, inventory, staff, and customers pages
1 parent 9b22aa9 commit 08b2209

File tree

11 files changed

+87
-25
lines changed

11 files changed

+87
-25
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test.html
2+
test.drawio

assets/js/main.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ $('#dataTable').DataTable( {
1414
visible: false,
1515
searchable: false
1616
}],
17+
1718
buttons: [
1819
{
1920
extend: 'excel',
@@ -33,9 +34,6 @@ $('#dataTable').DataTable( {
3334
text: '<i class="fa fa-print"></i> Print',
3435
title: 'RMMFB - Rental Management and Monitoring for a Fashion Boutique',
3536
autoPrint: true,
36-
exportOptions: {
37-
columns: ':visible',
38-
},
3937
customize: function (win) {
4038
$(win.document.body).find('table').addClass('display').css('font-size', '9px');
4139
$(win.document.body).find('tr:nth-child(odd) td').each(function(index){

customers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
</div>
5050
<div class="card-body">
5151
<div class="table-responsive table mt-2" id="dataTable-1" role="grid" aria-describedby="dataTable_info">
52-
<table class="table table-hover my-0 w-100" id="dataTable">
52+
<table class="table table-hover table-bordered my-0 w-100" id="dataTable">
5353
<thead>
5454
<tr>
5555
<th>ID</th>

damage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</div>
4646
<div class="card-body">
4747
<div class="table-responsive table mt-2" role="grid" aria-describedby="dataTable_info">
48-
<table class="table table-hover my-0 w-100" id="dataTable">
48+
<table class="table table-hover table-bordered my-0 w-100" id="dataTable">
4949
<thead>
5050
<tr>
5151
<th>ID</th>

functions/view/datatable.php

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function transaction_item_list($id)
173173
function get_rent_list()
174174
{
175175
global $db;
176-
$sql = "SELECT r.id, i.name, r.qty, r.price, r.returned, r.penalty, r.item_return, r.created_at, t.status, c.fullname, c.phone, c.address, c.id as customer_id, t.id as transact_id, t.event
176+
$sql = "SELECT r.id, i.name, r.qty, (i.price * r.qty) AS price, r.returned, r.penalty, r.item_return, r.created_at, t.status, c.fullname, c.phone, c.address, c.id as customer_id, t.id as transact_id, t.event
177177
FROM rentals r
178178
JOIN transactions t ON r.transact_id = t.id
179179
JOIN customers c ON t.customer_id = c.id
@@ -210,7 +210,7 @@ function get_rent_list()
210210
<td><?php echo $row['item_return'] ?></td>
211211
<td><?php echo $row['created_at'] ?></td>
212212
<td><?php echo $row['returned'] ?></td>
213-
<td>₱<?php echo $row['price'] ?></td>
213+
<td>₱<?php echo number_format($row['price'], 2) ?></td>
214214
<td><?php echo $row['event'] ?></td>
215215
<td><?php echo $status ?> | <?php echo $daysOverdue ?> Days</td>
216216
<td class="text-center">
@@ -244,17 +244,37 @@ function get_transaction_list()
244244
<td><?php echo $row['address'] ?></td>
245245
<td><?php echo $row['qty'] ?></td>
246246
<td><?php echo $row['qty'] - $row['item_damage'] ?></td>
247-
<td><?php echo $row['item_damage'] ?></td>
248-
<td><?php echo $row['item_repaired'] ?></td>
249-
<td><?php echo $row['item_beyond_repair'] ?></td>
250247
<td><?php echo $row['created_at'] ?></td>
251248
<td><?php echo $row['returned'] ?></td>
252249
<td>₱<?php echo number_format($row['penalty'] , 2) ?></td>
253-
<td>₱<?php echo number_format($row['price'] ,) ?></td>
250+
<td>₱<?php echo number_format($row['price'] , 2) ?></td>
251+
<td class="text-center">Damage</td>
252+
<td class="text-center">Repaired</td>
253+
<td class="text-center">UnRepaired</td>
254+
<!-- <td class="text-center"><span class="badge bg-primary">Damage</span></td>
255+
<td class="text-center"><span class="badge bg-success">Repaired</span></td>
256+
<td class="text-center"><span class="badge bg-danger">UnRepaired</span></td> -->
254257
<td class="text-center">
255258
<a data-bss-tooltip="" class="mx-1" href="profile.php?id=<?php echo $row['customer_id'] ?>" title="Here you can see the customer transactions."><i class="far fa-eye text-primary" style="font-size: 20px;"></i></a>
256259
</td>
257260
</tr>
261+
<tr>
262+
<td></td>
263+
<td></td>
264+
<td></td>
265+
<td></td>
266+
<td></td>
267+
<td></td>
268+
<td></td>
269+
<td></td>
270+
<td></td>
271+
<td></td>
272+
<td></td>
273+
<td class="text-center"><?php echo $row['item_damage'] ?></td>
274+
<td class="text-center"><?php echo $row['item_repaired'] ?></td>
275+
<td class="text-center"><?php echo $row['item_beyond_repair'] ?></td>
276+
<td></td>
277+
</tr>
258278
<?php
259279
}
260280
}
@@ -296,7 +316,7 @@ function get_damage_transaction_list()
296316
function get_customer_transaction_list()
297317
{
298318
global $db;
299-
$sql = "SELECT r.id, i.name, r.qty, r.price, r.returned, r.penalty, r.conditions, r.created_at, t.status, c.fullname, c.phone, c.address, c.id as customer_id, t.id as transact_id
319+
$sql = "SELECT r.id, i.name, r.qty, i.price , (i.price * r.qty) AS total_price, r.returned, r.penalty, r.conditions, r.created_at, t.status, c.fullname, c.phone, c.address, c.id as customer_id, t.id as transact_id
300320
FROM rentals r
301321
JOIN transactions t ON r.transact_id = t.id
302322
JOIN customers c ON t.customer_id = c.id
@@ -319,6 +339,7 @@ function get_customer_transaction_list()
319339
<td><?php echo $row['created_at'] ?></td>
320340
<td><?php echo $row['returned'] ?></td>
321341
<td>₱<?php echo number_format($row['price'], 2) ?></td>
342+
<td>₱<?php echo number_format($row['total_price'], 2) ?></td>
322343
</tr>
323344
<?php
324345
}

inventory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</div>
4646
<div class="card-body">
4747
<div class="table-responsive table mt-2" role="grid" aria-describedby="dataTable_info">
48-
<table class="table table-striped my-0 w-100" id="dataTable">
48+
<table class="table table-striped table-bordered my-0 w-100" id="dataTable">
4949
<thead>
5050
<tr>
5151
<th>ID #</th>

profile.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
<th>Borrowed Date</th>
111111
<th>Returned Date</th>
112112
<th>Rent Price</th>
113+
<th>Total Price</th>
113114
</tr>
114115
</thead>
115116
<tbody>

rents.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</nav>
3939
<div class="container-fluid">
4040
<div class="d-sm-flex justify-content-between align-items-center mb-4">
41-
<h3 class="text-dark mb-0">Rental Management</h3><button class="btn btn-dark btn-sm" data-bs-toggle="modal" data-bss-tooltip="" data-bs-placement="left" type="button" data-bs-target="#create" title="Here you can create new transaction."><i class="fas fa-user-check fa-sm text-white-50"></i>&nbsp;Create Transaction</button>
41+
<h3 class="text-dark mb-0">Rental Management</h3><button class="btn btn-dark btn-sm" data-bs-toggle="modal" data-bss-tooltip="" data-bs-placement="left" type="button" data-bs-target="#create" title="Here you can create new transaction."><i class="fas fa-user-check fa-sm text-white-50"></i>&nbsp;Create Rental</button>
4242
</div>
4343

4444
<div class="row">
@@ -76,7 +76,7 @@
7676
</div>
7777
<div class="card-body">
7878
<div class="table-responsive table mt-2" id="dataTable-1" role="grid" aria-describedby="dataTable_info">
79-
<table class="table table-hover my-0 w-100" id="dataTable">
79+
<table class="table table-hover table-bordered my-0 w-100" id="dataTable">
8080
<thead>
8181
<tr>
8282
<th>ID</th>
@@ -107,7 +107,7 @@
107107
<div class="modal-dialog" role="document">
108108
<div class="modal-content">
109109
<div class="modal-header">
110-
<h4 class="modal-title">Create Transaction</h4><button class="btn-close" type="button" aria-label="Close" data-bs-dismiss="modal"></button>
110+
<h4 class="modal-title">Create Rental</h4><button class="btn-close" type="button" aria-label="Close" data-bs-dismiss="modal"></button>
111111
</div>
112112
<div class="modal-body">
113113
<form action="functions/transaction-create.php" method="post">

sales.php

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<body id="page-top">
2727
<div id="content">
28-
<nav class="navbar navbar-expand-lg mb-4 shadow navbar-light">
28+
<nav class="navbar navbar-expand-lg mb-4 shadow navbar-light">
2929
<div class="container-fluid"><img src="assets/img/boutique.png" width="60em"><a class="navbar-brand d-flex align-items-center" href="/"><span>RMMFB</span></a><button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navcol-1"><span class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
3030
<div id="navcol-1" class="collapse navbar-collapse">
3131
<ul class="navbar-nav mx-auto">
@@ -43,7 +43,7 @@
4343
</div>
4444
<div class="card-body">
4545
<div class="table-responsive table mt-2" id="dataTable-1" role="grid" aria-describedby="dataTable_info">
46-
<table class="table table-hover my-0 w-100" id="dataTable">
46+
<table class="table table-hover table-bordered my-0 w-100" id="dataTable" class="display" cellspacing="0" width="100%">
4747
<thead>
4848
<tr>
4949
<th>ID</th>
@@ -53,13 +53,11 @@
5353
<th>Address</th>
5454
<th>Qty</th>
5555
<th>Returned</th>
56-
<th>Damage</th>
57-
<th>Repaired</th>
58-
<th>Beyond Repair</th>
5956
<th>Borrowed Date</th>
6057
<th>Returned Date</th>
6158
<th>Penalty</th>
6259
<th>Rent Price</th>
60+
<th colspan="3" class="text-center">Damages</th>
6361
<th class="text-center">Option</th>
6462
</tr>
6563
</thead>
@@ -89,7 +87,49 @@
8987
<script src="assets/js/vanta.birds.min.js"></script>
9088
<script src="assets/js/vanta.waves.min.js"></script>
9189
<script src="assets/js/sweetalert2.all.min.js"></script>
92-
<script src="assets/js/main.js"></script>
90+
<script>
91+
$('#dataTable').DataTable({
92+
// dom: 'Blfrtip',
93+
dom: 'Bfrtip',
94+
aaSorting: [
95+
[0, 'desc']
96+
],
97+
"ordering": false,
98+
columnDefs: [{
99+
target: 0,
100+
visible: false,
101+
searchable: false
102+
}],
103+
104+
buttons: [{
105+
extend: 'excel',
106+
title: 'RMMFB - Rental Management and Monitoring for a Fashion Boutique',
107+
className: 'btn btn-primary',
108+
text: '<i class="fa fa-file-excel"></i> EXCEL'
109+
},
110+
{
111+
extend: 'pdf',
112+
title: 'RMMFB - Rental Management and Monitoring for a Fashion Boutique',
113+
className: 'btn btn-primary',
114+
text: '<i class="fa fa-file-pdf"></i> PDF'
115+
},
116+
{
117+
extend: 'print',
118+
className: 'btn btn-primary',
119+
text: '<i class="fa fa-print"></i> Print',
120+
title: 'RMMFB - Rental Management and Monitoring for a Fashion Boutique',
121+
autoPrint: true,
122+
customize: function(win) {
123+
$(win.document.body).find('table').addClass('display').css('font-size', '9px');
124+
$(win.document.body).find('tr:nth-child(odd) td').each(function(index) {
125+
$(this).css('background-color', '#D0D0D0');
126+
});
127+
$(win.document.body).find('h1').css('text-align', 'center');
128+
}
129+
}
130+
]
131+
});
132+
</script>
93133
</body>
94134

95135
</html>

staff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</div>
4747
<div class="card-body">
4848
<div class="table-responsive table mt-2" id="dataTable-1" role="grid" aria-describedby="dataTable_info">
49-
<table class="table table-hover my-0 w-100" id="dataTable">
49+
<table class="table table-hover table-bordered my-0 w-100" id="dataTable">
5050
<thead>
5151
<tr>
5252
<th>User ID</th>

0 commit comments

Comments
 (0)