diff --git a/quotes.php b/quotes.php
index fac57234..f3e94e56 100644
--- a/quotes.php
+++ b/quotes.php
@@ -4,14 +4,18 @@
$sort = "quote_number";
$order = "DESC";
-require_once "includes/inc_all.php";
+// If client_id is in URI then show client Side Bar and client header
+if (isset($_GET['client_id'])) {
+ require_once "includes/inc_all_client.php";
+ $client_query = "AND quote_client_id = $client_id";
+} else {
+ require_once "includes/inc_all.php";
+ $client_query = '';
+}
// Perms
enforceUserPermission('module_sales');
-//Rebuild URL
-$url_query_strings_sort = http_build_query($get_copy);
-
$sql = mysqli_query(
$mysqli,
"SELECT SQL_CALC_FOUND_ROWS * FROM quotes
@@ -19,234 +23,260 @@ $sql = mysqli_query(
LEFT JOIN categories ON quote_category_id = category_id
WHERE (CONCAT(quote_prefix,quote_number) LIKE '%$q%' OR quote_scope LIKE '%$q%' OR category_name LIKE '%$q%' OR quote_status LIKE '%$q%' OR quote_amount LIKE '%$q%' OR client_name LIKE '%$q%')
AND DATE(quote_date) BETWEEN '$dtf' AND '$dtt'
- ORDER BY $sort $order LIMIT $record_from, $record_to");
+ $client_query
+ ORDER BY $sort $order LIMIT $record_from, $record_to"
+);
$num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
?>
-