Display Country in Invoices, Quotes, Recurring Invoices, Clients, locations, client top head, and allow searching via country in Locations and Clients

This commit is contained in:
johnnyq 2025-05-28 19:27:11 -04:00
parent c564118156
commit 0b88ea85ae
9 changed files with 33 additions and 17 deletions

View File

@ -9,9 +9,6 @@ require_once "includes/inc_all_client.php";
// Perms // Perms
enforceUserPermission('module_support'); enforceUserPermission('module_support');
// Rebuild URL
$url_query_strings_sort = http_build_query($get_copy);
$sql = mysqli_query( $sql = mysqli_query(
$mysqli, $mysqli,
"SELECT SQL_CALC_FOUND_ROWS * FROM racks "SELECT SQL_CALC_FOUND_ROWS * FROM racks
@ -323,7 +320,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
} else { } else {
// No device in this row // No device in this row
?> ?>
<td class="text-center">No device</td> <td class="text-center text-secondary">--</td>
<td></td> <td></td>
<?php <?php
} }

View File

@ -62,7 +62,7 @@ $sql = mysqli_query(
WHERE (client_name LIKE '%$q%' OR client_abbreviation LIKE '%$q%' OR client_type LIKE '%$q%' OR client_referral LIKE '%$q%' WHERE (client_name LIKE '%$q%' OR client_abbreviation LIKE '%$q%' OR client_type LIKE '%$q%' OR client_referral LIKE '%$q%'
OR contact_email LIKE '%$q%' OR contact_name LIKE '%$q%' OR contact_phone LIKE '%$phone_query%' OR contact_email LIKE '%$q%' OR contact_name LIKE '%$q%' OR contact_phone LIKE '%$phone_query%'
OR contact_mobile LIKE '%$phone_query%' OR location_address LIKE '%$q%' OR contact_mobile LIKE '%$phone_query%' OR location_address LIKE '%$q%'
OR location_city LIKE '%$q%' OR location_state LIKE '%$q%' OR location_zip LIKE '%$q%' OR location_city LIKE '%$q%' OR location_state LIKE '%$q%' OR location_zip LIKE '%$q%' OR location_country LIKE '%$q%'
OR tag_name LIKE '%$q%' OR client_tax_id_number LIKE '%$q%') OR tag_name LIKE '%$q%' OR client_tax_id_number LIKE '%$q%')
AND client_$archive_query AND client_$archive_query
AND DATE(client_created_at) BETWEEN '$dtf' AND '$dtt' AND DATE(client_created_at) BETWEEN '$dtf' AND '$dtt'
@ -286,7 +286,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
if (empty($location_address) && empty($location_city) && empty($location_state) && empty($location_zip)) { if (empty($location_address) && empty($location_city) && empty($location_state) && empty($location_zip)) {
$location_address_display = "-"; $location_address_display = "-";
} else { } else {
$location_address_display = "$location_address<br>$location_city $location_state $location_zip"; $location_address_display = "<i class='fa fa-fw fa-map-marker-alt text-secondary mr-2'></i>$location_address<br><i class='fa fa-fw mr-2'></i>$location_city $location_state $location_zip<br><i class='fa fa-fw mr-2'></i><small>$location_country</small>";
} }
$contact_id = intval($row['contact_id']); $contact_id = intval($row['contact_id']);
$contact_name = nullable_htmlentities($row['contact_name']); $contact_name = nullable_htmlentities($row['contact_name']);

View File

@ -50,6 +50,7 @@ $location_address = nullable_htmlentities($row['location_address']);
$location_city = nullable_htmlentities($row['location_city']); $location_city = nullable_htmlentities($row['location_city']);
$location_state = nullable_htmlentities($row['location_state']); $location_state = nullable_htmlentities($row['location_state']);
$location_zip = nullable_htmlentities($row['location_zip']); $location_zip = nullable_htmlentities($row['location_zip']);
$location_country = nullable_htmlentities($row['location_country']);
$contact_email = nullable_htmlentities($row['contact_email']); $contact_email = nullable_htmlentities($row['contact_email']);
$contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']);
$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
@ -71,6 +72,7 @@ $company_address = nullable_htmlentities($row['company_address']);
$company_city = nullable_htmlentities($row['company_city']); $company_city = nullable_htmlentities($row['company_city']);
$company_state = nullable_htmlentities($row['company_state']); $company_state = nullable_htmlentities($row['company_state']);
$company_zip = nullable_htmlentities($row['company_zip']); $company_zip = nullable_htmlentities($row['company_zip']);
$company_country = nullable_htmlentities($row['company_country']);
$company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']); $company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']);
$company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code)); $company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code));
$company_email = nullable_htmlentities($row['company_email']); $company_email = nullable_htmlentities($row['company_email']);
@ -198,6 +200,7 @@ if ($balance > 0) {
<li><h4><strong><?php echo $company_name; ?></strong></h4></li> <li><h4><strong><?php echo $company_name; ?></strong></h4></li>
<li><?php echo $company_address; ?></li> <li><?php echo $company_address; ?></li>
<li><?php echo "$company_city $company_state $company_zip"; ?></li> <li><?php echo "$company_city $company_state $company_zip"; ?></li>
<li><small><?php echo $company_country; ?></small></li>
<li><?php echo $company_phone; ?></li> <li><?php echo $company_phone; ?></li>
<li><?php echo $company_email; ?></li> <li><?php echo $company_email; ?></li>
</ul> </ul>
@ -209,6 +212,7 @@ if ($balance > 0) {
<li><h4><strong><?php echo $client_name; ?></strong></h4></li> <li><h4><strong><?php echo $client_name; ?></strong></h4></li>
<li><?php echo $location_address; ?></li> <li><?php echo $location_address; ?></li>
<li><?php echo "$location_city $location_state $location_zip"; ?></li> <li><?php echo "$location_city $location_state $location_zip"; ?></li>
<li><small><?php echo $location_country; ?></small></li>
<li><?php echo "$contact_phone $contact_extension"; ?></li> <li><?php echo "$contact_phone $contact_extension"; ?></li>
<li><?php echo $contact_mobile; ?></li> <li><?php echo $contact_mobile; ?></li>
<li><?php echo $contact_email; ?></li> <li><?php echo $contact_email; ?></li>
@ -407,11 +411,11 @@ if ($balance > 0) {
{ {
columns: [ columns: [
{ {
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_phone \n $company_website")) ?>, text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_country \n $company_phone \n $company_website")) ?>,
style: 'invoiceBillingAddress' style: 'invoiceBillingAddress'
}, },
{ {
text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $contact_email \n $contact_phone")) ?>, text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $location_country \n $contact_email \n $contact_phone")) ?>,
style: 'invoiceBillingAddressClient' style: 'invoiceBillingAddressClient'
}, },
] ]

View File

@ -51,6 +51,7 @@ $location_address = nullable_htmlentities($row['location_address']);
$location_city = nullable_htmlentities($row['location_city']); $location_city = nullable_htmlentities($row['location_city']);
$location_state = nullable_htmlentities($row['location_state']); $location_state = nullable_htmlentities($row['location_state']);
$location_zip = nullable_htmlentities($row['location_zip']); $location_zip = nullable_htmlentities($row['location_zip']);
$location_country = nullable_htmlentities($row['location_country']);
$contact_email = nullable_htmlentities($row['contact_email']); $contact_email = nullable_htmlentities($row['contact_email']);
$contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']);
$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
@ -71,6 +72,7 @@ $company_address = nullable_htmlentities($row['company_address']);
$company_city = nullable_htmlentities($row['company_city']); $company_city = nullable_htmlentities($row['company_city']);
$company_state = nullable_htmlentities($row['company_state']); $company_state = nullable_htmlentities($row['company_state']);
$company_zip = nullable_htmlentities($row['company_zip']); $company_zip = nullable_htmlentities($row['company_zip']);
$company_country = nullable_htmlentities($row['company_country']);
$company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']); $company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']);
$company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code)); $company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code));
$company_email = nullable_htmlentities($row['company_email']); $company_email = nullable_htmlentities($row['company_email']);
@ -136,6 +138,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
<li><h4><strong><?php echo $company_name; ?></strong></h4></li> <li><h4><strong><?php echo $company_name; ?></strong></h4></li>
<li><?php echo $company_address; ?></li> <li><?php echo $company_address; ?></li>
<li><?php echo "$company_city $company_state $company_zip"; ?></li> <li><?php echo "$company_city $company_state $company_zip"; ?></li>
<li><small><?php echo $company_country; ?></small></li>
<li><?php echo $company_phone; ?></li> <li><?php echo $company_phone; ?></li>
<li><?php echo $company_email; ?></li> <li><?php echo $company_email; ?></li>
</ul> </ul>
@ -148,6 +151,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
<li><h4><strong><?php echo $client_name; ?></strong></h4></li> <li><h4><strong><?php echo $client_name; ?></strong></h4></li>
<li><?php echo $location_address; ?></li> <li><?php echo $location_address; ?></li>
<li><?php echo "$location_city $location_state $location_zip"; ?></li> <li><?php echo "$location_city $location_state $location_zip"; ?></li>
<li><small><?php echo $location_country; ?></small></li>
<li><?php echo "$contact_phone $contact_extension"; ?></li> <li><?php echo "$contact_phone $contact_extension"; ?></li>
<li><?php echo $contact_mobile; ?></li> <li><?php echo $contact_mobile; ?></li>
<li><?php echo $contact_email; ?></li> <li><?php echo $contact_email; ?></li>
@ -345,11 +349,11 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
{ {
columns: [ columns: [
{ {
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_phone \n $company_website")) ?>, text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_country \n $company_phone \n $company_website")) ?>,
style: 'invoiceBillingAddress' style: 'invoiceBillingAddress'
}, },
{ {
text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $contact_email \n $contact_phone")) ?>, text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $location_country \n $contact_email \n $contact_phone")) ?>,
style: 'invoiceBillingAddressClient' style: 'invoiceBillingAddressClient'
}, },
] ]

View File

@ -59,7 +59,12 @@
<div> <div>
<a href="//maps.<?php echo $session_map_source; ?>.com/?q=<?php echo "$location_address $location_zip"; ?>" target="_blank"> <a href="//maps.<?php echo $session_map_source; ?>.com/?q=<?php echo "$location_address $location_zip"; ?>" target="_blank">
<i class="fa fa-fw fa-map-marker-alt text-secondary ml-1 mr-2"></i><?php echo $location_address; ?> <i class="fa fa-fw fa-map-marker-alt text-secondary ml-1 mr-2"></i><?php echo $location_address; ?>
<div><i class="fa fa-fw ml-1 mr-2"></i><?php echo "$location_city $location_state $location_zip"; ?></div> <div>
<i class="fa fa-fw ml-1 mr-2"></i><?php echo "$location_city $location_state $location_zip"; ?>
</div>
<div>
<i class="fa fa-fw ml-1 mr-2"></i><small><?php echo $location_country; ?></small>
</div>
</a> </a>
</div> </div>
<?php } <?php }

View File

@ -309,6 +309,7 @@ if (isset($_GET['invoice_id'])) {
<li><h4><strong><?php echo $company_name; ?></strong></h4></li> <li><h4><strong><?php echo $company_name; ?></strong></h4></li>
<li><?php echo $company_address; ?></li> <li><?php echo $company_address; ?></li>
<li><?php echo "$company_city $company_state $company_zip"; ?></li> <li><?php echo "$company_city $company_state $company_zip"; ?></li>
<li><small><?php echo $company_country; ?></small></li>
<li><?php echo $company_phone; ?></li> <li><?php echo $company_phone; ?></li>
<li><?php echo $company_email; ?></li> <li><?php echo $company_email; ?></li>
<li><?php echo $company_website; ?></li> <li><?php echo $company_website; ?></li>
@ -319,6 +320,7 @@ if (isset($_GET['invoice_id'])) {
<li><h4><strong><?php echo $client_name; ?></strong></h4></li> <li><h4><strong><?php echo $client_name; ?></strong></h4></li>
<li><?php echo $location_address; ?></li> <li><?php echo $location_address; ?></li>
<li><?php echo "$location_city $location_state $location_zip"; ?></li> <li><?php echo "$location_city $location_state $location_zip"; ?></li>
<li><small><?php echo $location_country; ?></small></li>
<li><?php echo "$contact_phone $contact_extension"; ?></li> <li><?php echo "$contact_phone $contact_extension"; ?></li>
<li><?php echo $contact_mobile; ?></li> <li><?php echo $contact_mobile; ?></li>
<li><?php echo $contact_email; ?></li> <li><?php echo $contact_email; ?></li>
@ -781,11 +783,11 @@ require_once "includes/footer.php";
{ {
columns: [ columns: [
{ {
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_phone \n $company_website")) ?>, text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_country \n $company_phone \n $company_website")) ?>,
style: 'invoiceBillingAddress' style: 'invoiceBillingAddress'
}, },
{ {
text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $contact_email \n $contact_phone")) ?>, text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $location_country \n $contact_email \n $contact_phone")) ?>,
style: 'invoiceBillingAddressClient' style: 'invoiceBillingAddressClient'
}, },
] ]

View File

@ -47,7 +47,7 @@ $sql = mysqli_query(
LEFT JOIN tags ON tags.tag_id = location_tags.tag_id LEFT JOIN tags ON tags.tag_id = location_tags.tag_id
WHERE location_$archive_query WHERE location_$archive_query
$tag_query $tag_query
AND (location_name LIKE '%$q%' OR location_description LIKE '%$q%' OR location_address LIKE '%$q%' OR location_phone LIKE '%$phone_query%' OR tag_name LIKE '%$q%' OR client_name LIKE '%$q%') AND (location_name LIKE '%$q%' OR location_description LIKE '%$q%' OR location_address LIKE '%$q%' OR location_city LIKE '%$q%' OR location_state LIKE '%$q%' OR location_zip LIKE '%$q%' OR location_country LIKE '%$q%' OR location_phone LIKE '%$phone_query%' OR tag_name LIKE '%$q%' OR client_name LIKE '%$q%')
$access_permission_query $access_permission_query
$client_query $client_query
GROUP BY location_id GROUP BY location_id
@ -333,7 +333,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
</div> </div>
</a> </a>
</td> </td>
<td><a href="//maps.<?php echo $session_map_source; ?>.com?q=<?php echo "$location_address $location_zip"; ?>" target="_blank"><?php echo $location_address; ?><br><?php echo "$location_city $location_state $location_zip"; ?></a></td> <td><a href="//maps.<?php echo $session_map_source; ?>.com?q=<?php echo "$location_address $location_zip"; ?>" target="_blank"><?php echo $location_address; ?><br><?php echo "$location_city $location_state $location_zip<br><small>$location_country</small>"; ?></a></td>
<td> <td>
<?php echo $location_phone_display; ?> <?php echo $location_phone_display; ?>
<?php echo $location_fax_display; ?> <?php echo $location_fax_display; ?>

View File

@ -267,6 +267,7 @@ if (isset($_GET['quote_id'])) {
</li> </li>
<li><?php echo $company_address; ?></li> <li><?php echo $company_address; ?></li>
<li><?php echo "$company_city $company_state $company_zip"; ?></li> <li><?php echo "$company_city $company_state $company_zip"; ?></li>
<li><small><?php echo $company_country; ?></small></li>
<li><?php echo $company_phone; ?></li> <li><?php echo $company_phone; ?></li>
<li><?php echo $company_email; ?></li> <li><?php echo $company_email; ?></li>
</ul> </ul>
@ -278,6 +279,7 @@ if (isset($_GET['quote_id'])) {
</li> </li>
<li><?php echo $location_address; ?></li> <li><?php echo $location_address; ?></li>
<li><?php echo "$location_city $location_state $location_zip"; ?></li> <li><?php echo "$location_city $location_state $location_zip"; ?></li>
<li><small><?php echo $location_country; ?></small></li>
<li><?php echo "$contact_phone $contact_extension"; ?></li> <li><?php echo "$contact_phone $contact_extension"; ?></li>
<li><?php echo $contact_mobile; ?></li> <li><?php echo $contact_mobile; ?></li>
<li><?php echo $contact_email; ?></li> <li><?php echo $contact_email; ?></li>
@ -671,11 +673,11 @@ require_once "includes/footer.php";
// Billing Address // Billing Address
{ {
columns: [{ columns: [{
text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_phone \n $company_website")) ?>, text: <?php echo json_encode(html_entity_decode("$company_address \n $company_city $company_state $company_zip \n $company_country \n $company_phone \n $company_website")) ?>,
style: 'invoiceBillingAddress' style: 'invoiceBillingAddress'
}, },
{ {
text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $contact_email \n $contact_phone")) ?>, text: <?php echo json_encode(html_entity_decode("$location_address \n $location_city $location_state $location_zip \n $location_country \n $contact_email \n $contact_phone")) ?>,
style: 'invoiceBillingAddressClient' style: 'invoiceBillingAddressClient'
}, },
] ]

View File

@ -194,6 +194,7 @@ if (isset($_GET['recurring_invoice_id'])) {
<li><h4><strong><?php echo $company_name; ?></strong></h4></li> <li><h4><strong><?php echo $company_name; ?></strong></h4></li>
<li><?php echo $company_address; ?></li> <li><?php echo $company_address; ?></li>
<li><?php echo "$company_city $company_state $company_zip"; ?></li> <li><?php echo "$company_city $company_state $company_zip"; ?></li>
<li><small><?php echo $company_country; ?></small></li>
<li><?php echo $company_phone; ?></li> <li><?php echo $company_phone; ?></li>
<li><?php echo $company_email; ?></li> <li><?php echo $company_email; ?></li>
</ul> </ul>
@ -203,6 +204,7 @@ if (isset($_GET['recurring_invoice_id'])) {
<li><h4><strong><?php echo $client_name; ?></strong></h4></li> <li><h4><strong><?php echo $client_name; ?></strong></h4></li>
<li><?php echo $location_address; ?></li> <li><?php echo $location_address; ?></li>
<li><?php echo "$location_city $location_state $location_zip"; ?></li> <li><?php echo "$location_city $location_state $location_zip"; ?></li>
<li><small><?php echo $location_country; ?></small></li>
<li><?php echo "$contact_phone $contact_extension"; ?></li> <li><?php echo "$contact_phone $contact_extension"; ?></li>
<li><?php echo $contact_mobile; ?></li> <li><?php echo $contact_mobile; ?></li>
<li><?php echo $contact_email; ?></li> <li><?php echo $contact_email; ?></li>