mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Rename vars sb to sort, o to order, p to page. This makes the code easier to understand and brings consistency
This commit is contained in:
32
invoices.php
32
invoices.php
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
// Default Column Sortby/Order Filter
|
||||
$sb = "invoice_number";
|
||||
$o = "DESC";
|
||||
$sort = "invoice_number";
|
||||
$order = "DESC";
|
||||
|
||||
require_once("inc_all.php");
|
||||
|
||||
@@ -69,7 +69,7 @@ if (isset($_GET['status']) && ($_GET['status']) == 'Draft') {
|
||||
}
|
||||
|
||||
//Rebuild URL
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET, array('sb' => $sb, 'o' => $o)));
|
||||
$url_query_strings_sort = http_build_query(array_merge($_GET, array('sort' => $sort, 'order' => $order)));
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
@@ -79,7 +79,7 @@ $sql = mysqli_query(
|
||||
WHERE (invoice_status LIKE '$status_query')
|
||||
AND DATE(invoice_date) BETWEEN '$dtf' AND '$dtt'
|
||||
AND (CONCAT(invoice_prefix,invoice_number) LIKE '%$q%' OR invoice_scope LIKE '%$q%' OR client_name LIKE '%$q%' OR invoice_status LIKE '%$q%' OR invoice_amount LIKE '%$q%' OR category_name LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to"
|
||||
ORDER BY $sort $order LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
@@ -89,7 +89,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<!-- small box -->
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&status=Draft" class="small-box bg-secondary">
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&status=Draft" class="small-box bg-secondary">
|
||||
<div class="inner">
|
||||
<h3><?php echo numfmt_format_currency($currency_format, $total_draft, $session_company_currency); ?></h3>
|
||||
<p><?php echo $draft_count; ?> Draft</p>
|
||||
@@ -103,7 +103,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<div class="col-lg-3">
|
||||
<!-- small box -->
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&status=Sent" class="small-box bg-warning">
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&status=Sent" class="small-box bg-warning">
|
||||
<div class="inner text-white">
|
||||
<h3><?php echo numfmt_format_currency($currency_format, $total_sent, $session_company_currency); ?></h3>
|
||||
<p><?php echo $sent_count; ?> Sent</p>
|
||||
@@ -117,7 +117,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<div class="col-lg-3">
|
||||
<!-- small box -->
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&status=Viewed" class="small-box bg-info">
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&status=Viewed" class="small-box bg-info">
|
||||
<div class="inner">
|
||||
<h3><?php echo numfmt_format_currency($currency_format, $total_viewed, $session_company_currency); ?></h3>
|
||||
<p><?php echo $viewed_count; ?> Viewed</p>
|
||||
@@ -131,7 +131,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
|
||||
<div class="col-lg-3">
|
||||
<!-- small box -->
|
||||
<a href="?<?php echo $url_query_strings_sb; ?>&status=Partial" class="small-box bg-primary">
|
||||
<a href="?<?php echo $url_query_strings_sort; ?>&status=Partial" class="small-box bg-primary">
|
||||
<div class="inner">
|
||||
<h3><?php echo numfmt_format_currency($currency_format, $total_partial, $session_company_currency); ?></h3>
|
||||
<p><?php echo $partial_count; ?> Partial</p>
|
||||
@@ -205,14 +205,14 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
||||
<table class="table table-striped table-borderless table-hover">
|
||||
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
|
||||
<tr>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_number&o=<?php echo $disp; ?>">Number</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_scope&o=<?php echo $disp; ?>">Scope</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client</a></th>
|
||||
<th class="text-right"><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_amount&o=<?php echo $disp; ?>">Amount</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_date&o=<?php echo $disp; ?>">Date</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_due&o=<?php echo $disp; ?>">Due</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=category_name&o=<?php echo $disp; ?>">Category</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=invoice_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=invoice_number&order=<?php echo $disp; ?>">Number</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=invoice_scope&order=<?php echo $disp; ?>">Scope</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">Client</a></th>
|
||||
<th class="text-right"><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=invoice_amount&order=<?php echo $disp; ?>">Amount</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=invoice_date&order=<?php echo $disp; ?>">Date</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=invoice_due&order=<?php echo $disp; ?>">Due</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=category_name&order=<?php echo $disp; ?>">Category</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=invoice_status&order=<?php echo $disp; ?>">Status</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
Reference in New Issue
Block a user