$sb, 'o' => $o))); $sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM contacts LEFT JOIN locations ON location_id = contact_location_id WHERE contact_archived_at IS NULL AND (contact_name LIKE '%$q%' OR contact_title LIKE '%$q%' OR location_name LIKE '%$q%' OR contact_email LIKE '%$q%' OR contact_department LIKE '%$q%' OR contact_phone LIKE '%$n%' OR contact_extension LIKE '%$q%' OR contact_mobile LIKE '%$n%') AND contact_client_id = $client_id ORDER BY $sb $o LIMIT $record_from, $record_to"); $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); ?>

Contacts

Export

"> $contact_title"; } $contact_department =htmlentities($row['contact_department']); if (empty($contact_department)) { $contact_department_display = "-"; }else{ $contact_department_display = $contact_department; } $contact_phone = formatPhoneNumber($row['contact_phone']); if (empty($contact_phone)) { $contact_phone_display = "-"; }else{ $contact_phone_display = "$contact_phone"; } $contact_extension = htmlentities($row['contact_extension']); $contact_mobile = formatPhoneNumber($row['contact_mobile']); if (empty($contact_mobile)) { $contact_mobile_display = "-"; }else{ $contact_mobile_display = "$contact_mobile"; } $contact_email = htmlentities($row['contact_email']); if (empty($contact_email)) { $contact_email_display = "-"; }else{ $contact_email_display = "$contact_email"; } $contact_photo = htmlentities($row['contact_photo']); $contact_initials = initials($contact_name); $contact_notes = htmlentities($row['contact_notes']); $contact_important = intval($row['contact_important']); $contact_billing = intval($row['contact_billing']); $contact_technical = intval($row['contact_technical']); $contact_created_at = $row['contact_created_at']; if ($contact_id == $primary_contact) { $primary_contact_display = "Primary Contact"; }else{ $primary_contact_display = FALSE; } $contact_location_id = $row['contact_location_id']; $location_name = htmlentities($row['location_name']); if (empty($location_name)) { $location_name_display = "-"; }else{ $location_name_display = $location_name; } $auth_method = htmlentities($row['contact_auth_method']); // Related Assets Query $sql_related_assets = mysqli_query($mysqli,"SELECT * FROM assets WHERE asset_contact_id = $contact_id AND company_id = $session_company_id ORDER BY asset_id DESC"); $asset_count = mysqli_num_rows($sql_related_assets); // Related Logins Query $sql_related_logins = mysqli_query($mysqli,"SELECT * FROM logins WHERE login_contact_id = $contact_id AND company_id = $session_company_id ORDER BY login_id DESC"); $login_count = mysqli_num_rows($sql_related_logins); // Related Software Query $sql_related_software = mysqli_query($mysqli,"SELECT * FROM software, software_contacts WHERE software.software_id = software_contacts.software_id AND software_contacts.contact_id = $contact_id AND software.company_id = $session_company_id ORDER BY software.software_id DESC"); $software_count = mysqli_num_rows($sql_related_software); // Related Tickets Query $sql_related_tickets = mysqli_query($mysqli,"SELECT * FROM tickets WHERE ticket_contact_id = $contact_id AND company_id = $session_company_id ORDER BY ticket_id DESC"); $ticket_count = mysqli_num_rows($sql_related_tickets); ?>
Name Department Email Phone Mobile Location Action
">