mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Do not show Primary Contact or Location in clients listing or client details if Contact or Location was deleted aka archived
This commit is contained in:
@@ -82,10 +82,10 @@ if($_GET['canned_date'] == "custom" AND !empty($_GET['date_from'])){
|
||||
//Rebuild URL
|
||||
$url_query_strings_sortby = http_build_query(array_merge($_GET,array('sortby' => $sortby, 'order' => $order)));
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM clients LEFT JOIN contacts ON clients.primary_contact = contacts.contact_id LEFT JOIN locations ON clients.primary_location = locations.location_id
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM clients LEFT JOIN contacts ON clients.primary_contact = contacts.contact_id AND contact_archived_at IS NULL LEFT JOIN locations ON clients.primary_location = locations.location_id AND location_archived_at IS NULL
|
||||
WHERE (client_name LIKE '%$query%' OR client_type LIKE '%$query%' OR client_support LIKE '%$query%' OR contact_email LIKE '%$query%' OR contact_name LIKE '%$query%' OR contact_phone LIKE '%$query%'
|
||||
OR contact_mobile LIKE '%$query%' OR location_address LIKE '%$query%' OR location_city LIKE '%$query%' OR location_state LIKE '%$query%' OR location_zip LIKE '%$query%')
|
||||
AND DATE(client_created_at) BETWEEN '$date_from' AND '$date_to'
|
||||
AND DATE(client_created_at) BETWEEN '$date_from' AND '$date_to'
|
||||
AND clients.company_id = $session_company_id $permission_sql
|
||||
ORDER BY $sortby $order LIMIT $record_from, $record_to"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user