mirror of https://github.com/itflow-org/itflow
Feature: Inititial functionality for sort order icons on table headers
This commit is contained in:
parent
5a20c7fdbe
commit
55c832bde6
19
clients.php
19
clients.php
|
|
@ -251,9 +251,22 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<table class="table table-striped table-hover table-borderless">
|
||||
<thead class="<?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">Client Name</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=location_city&order=<?php echo $disp; ?>">Primary Location </a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=contact_name&order=<?php echo $disp; ?>">Primary Contact</a></th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">
|
||||
Client Name <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=location_city&order=<?php echo $disp; ?>">
|
||||
Primary Location <?php if ($sort == 'location_city') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=contact_name&order=<?php echo $disp; ?>">
|
||||
Primary Contact
|
||||
<?php if ($sort == 'contact_name') { echo $order_icon; } ?>
|
||||
</a>
|
||||
</th>
|
||||
<?php if (($session_user_role == 3 || $session_user_role == 1) && $config_module_enable_accounting == 1) { ?> <th class="text-right">Billing</th> <?php } ?>
|
||||
<?php if ($session_user_role == 3) { ?> <th class="text-center">Action</th> <?php } ?>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -41,6 +41,15 @@ if (isset($_GET['order'])) {
|
|||
}
|
||||
}
|
||||
|
||||
// Set the order Icon
|
||||
if ($sort) {
|
||||
if ($order == "ASC") {
|
||||
$order_icon = "<i class='fas fa-fw fa-sort-up'></i>";
|
||||
} else {
|
||||
$order_icon = "<i class='fas fa-fw fa-sort-down'></i>";
|
||||
}
|
||||
}
|
||||
|
||||
// Search
|
||||
if (isset($_GET['q'])) {
|
||||
$q = sanitizeInput($_GET['q']);
|
||||
|
|
|
|||
Loading…
Reference in New Issue