From 07b29a7bdcc0fac0080303a1cbd0ca2bed272257 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 26 Mar 2025 13:36:56 -0400 Subject: [PATCH] Add Phone Country code in more places for proper phone number formatting --- ajax/ajax_contact_details.php | 6 ++++-- ajax/ajax_vendor_edit.php | 2 +- client_overview.php | 6 ++++-- clients.php | 6 ++++-- contact_details.php | 6 ++++-- global_search.php | 12 ++++++++---- guest/guest_view_invoice.php | 9 ++++++--- guest/guest_view_item.php | 3 ++- guest/guest_view_quote.php | 9 ++++++--- guest/guest_view_ticket.php | 3 ++- includes/inc_all_client.php | 9 ++++++--- invoice.php | 9 ++++++--- locations.php | 6 ++++-- post/user/client.php | 18 +++++++++++++----- quote.php | 9 ++++++--- recurring_invoice.php | 9 ++++++--- ticket.php | 6 ++++-- vendors.php | 3 ++- 18 files changed, 88 insertions(+), 43 deletions(-) diff --git a/ajax/ajax_contact_details.php b/ajax/ajax_contact_details.php index 98075a45..4edce4a8 100644 --- a/ajax/ajax_contact_details.php +++ b/ajax/ajax_contact_details.php @@ -18,9 +18,11 @@ $client_name = nullable_htmlentities($row['client_name']); $contact_name = nullable_htmlentities($row['contact_name']); $contact_title = nullable_htmlentities($row['contact_title']); $contact_department =nullable_htmlentities($row['contact_department']); -$contact_phone = formatPhoneNumber($row['contact_phone']); +$contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); +$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); -$contact_mobile = formatPhoneNumber($row['contact_mobile']); +$contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); +$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_mobile_country_code)); $contact_email = nullable_htmlentities($row['contact_email']); $contact_photo = nullable_htmlentities($row['contact_photo']); $contact_pin = nullable_htmlentities($row['contact_pin']); diff --git a/ajax/ajax_vendor_edit.php b/ajax/ajax_vendor_edit.php index a1a616f9..27c84742 100644 --- a/ajax/ajax_vendor_edit.php +++ b/ajax/ajax_vendor_edit.php @@ -12,7 +12,7 @@ $vendor_description = nullable_htmlentities($row['vendor_description']); $vendor_account_number = nullable_htmlentities($row['vendor_account_number']); $vendor_contact_name = nullable_htmlentities($row['vendor_contact_name']); $vendor_phone_country_code = nullable_htmlentities($row['vendor_phone_country_code']); -$vendor_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $vendor_phone_country_code)); +$vendor_phone = nullable_htmlentities(formatPhoneNumber($row['vendor_phone'], $vendor_phone_country_code)); $vendor_extension = nullable_htmlentities($row['vendor_extension']); $vendor_email = nullable_htmlentities($row['vendor_email']); $vendor_website = nullable_htmlentities($row['vendor_website']); diff --git a/client_overview.php b/client_overview.php index 938e26e2..3ac80369 100644 --- a/client_overview.php +++ b/client_overview.php @@ -221,9 +221,11 @@ $sql_asset_retired = mysqli_query( $contact_name = nullable_htmlentities($row['contact_name']); $contact_title = nullable_htmlentities($row['contact_title']); $contact_email = nullable_htmlentities($row['contact_email']); - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); + $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); - $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); + $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code)); ?> diff --git a/clients.php b/clients.php index 15515dce..e296a9b8 100644 --- a/clients.php +++ b/clients.php @@ -291,9 +291,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $contact_id = intval($row['contact_id']); $contact_name = nullable_htmlentities($row['contact_name']); $contact_title = nullable_htmlentities($row['contact_title']); - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); + $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); - $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); + $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code)); $contact_email = nullable_htmlentities($row['contact_email']); $client_website = nullable_htmlentities($row['client_website']); $client_rate = floatval($row['client_rate']); diff --git a/contact_details.php b/contact_details.php index 1d74ab78..f77f7051 100644 --- a/contact_details.php +++ b/contact_details.php @@ -28,9 +28,11 @@ if (isset($_GET['contact_id'])) { $contact_name = nullable_htmlentities($row['contact_name']); $contact_title = nullable_htmlentities($row['contact_title']); $contact_department =nullable_htmlentities($row['contact_department']); - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); + $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); - $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); + $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_mobile_country_code)); $contact_email = nullable_htmlentities($row['contact_email']); $contact_photo = nullable_htmlentities($row['contact_photo']); $contact_pin = nullable_htmlentities($row['contact_pin']); diff --git a/global_search.php b/global_search.php index 5b121bc5..a20f14e1 100644 --- a/global_search.php +++ b/global_search.php @@ -172,7 +172,8 @@ if (isset($_GET['query'])) { while ($row = mysqli_fetch_array($sql_clients)) { $client_id = intval($row['client_id']); $client_name = nullable_htmlentities($row['client_name']); - $location_phone = formatPhoneNumber($row['location_phone']); + $location_phone_country_code = nullable_htmlentities($row['location_phone_country_code']); + $location_phone = nullable_htmlentities(formatPhoneNumber($row['location_phone'], $location_phone_country_code)); $client_website = nullable_htmlentities($row['client_website']); ?> @@ -218,9 +219,11 @@ if (isset($_GET['query'])) { $contact_id = intval($row['contact_id']); $contact_name = nullable_htmlentities($row['contact_name']); $contact_title = nullable_htmlentities($row['contact_title']); - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); + $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); - $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); + $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code)); $contact_email = nullable_htmlentities($row['contact_email']); $client_id = intval($row['client_id']); $client_name = nullable_htmlentities($row['client_name']); @@ -272,7 +275,8 @@ if (isset($_GET['query'])) { while ($row = mysqli_fetch_array($sql_vendors)) { $vendor_name = nullable_htmlentities($row['vendor_name']); $vendor_description = nullable_htmlentities($row['vendor_description']); - $vendor_phone = formatPhoneNumber($row['vendor_phone']); + $vendor_phone_country_code = nullable_htmlentities($row['vendor_phone_country_code']); + $vendor_phone = nullable_htmlentities(formatPhoneNumber($row['vendor_phone'], $vendor_phone_country_code)); $client_id = intval($row['client_id']); $client_name = nullable_htmlentities($row['client_name']); diff --git a/guest/guest_view_invoice.php b/guest/guest_view_invoice.php index a1db478c..51e6354a 100644 --- a/guest/guest_view_invoice.php +++ b/guest/guest_view_invoice.php @@ -51,9 +51,11 @@ $location_city = nullable_htmlentities($row['location_city']); $location_state = nullable_htmlentities($row['location_state']); $location_zip = nullable_htmlentities($row['location_zip']); $contact_email = nullable_htmlentities($row['contact_email']); -$contact_phone = formatPhoneNumber($row['contact_phone']); +$contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); +$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); -$contact_mobile = formatPhoneNumber($row['contact_mobile']); +$contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); +$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code)); $client_website = nullable_htmlentities($row['client_website']); $client_currency_code = nullable_htmlentities($row['client_currency_code']); $client_net_terms = intval($row['client_net_terms']); @@ -69,7 +71,8 @@ $company_address = nullable_htmlentities($row['company_address']); $company_city = nullable_htmlentities($row['company_city']); $company_state = nullable_htmlentities($row['company_state']); $company_zip = nullable_htmlentities($row['company_zip']); -$company_phone = formatPhoneNumber($row['company_phone']); +$company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']); +$company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code)); $company_email = nullable_htmlentities($row['company_email']); $company_website = nullable_htmlentities($row['company_website']); $company_logo = nullable_htmlentities($row['company_logo']); diff --git a/guest/guest_view_item.php b/guest/guest_view_item.php index 4744774e..1a4ed46b 100644 --- a/guest/guest_view_item.php +++ b/guest/guest_view_item.php @@ -23,7 +23,8 @@ $company_address = nullable_htmlentities($row['company_address']); $company_city = nullable_htmlentities($row['company_city']); $company_state = nullable_htmlentities($row['company_state']); $company_zip = nullable_htmlentities($row['company_zip']); -$company_phone = formatPhoneNumber($row['company_phone']); +$company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']); +$company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code)); $company_email = nullable_htmlentities($row['company_email']); $company_website = nullable_htmlentities($row['company_website']); $company_logo = nullable_htmlentities($row['company_logo']); diff --git a/guest/guest_view_quote.php b/guest/guest_view_quote.php index 66317731..e71ba4b6 100644 --- a/guest/guest_view_quote.php +++ b/guest/guest_view_quote.php @@ -52,9 +52,11 @@ $location_city = nullable_htmlentities($row['location_city']); $location_state = nullable_htmlentities($row['location_state']); $location_zip = nullable_htmlentities($row['location_zip']); $contact_email = nullable_htmlentities($row['contact_email']); -$contact_phone = formatPhoneNumber($row['contact_phone']); +$contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); +$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); -$contact_mobile = formatPhoneNumber($row['contact_mobile']); +$contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); +$contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code)); $client_website = nullable_htmlentities($row['client_website']); $client_currency_code = nullable_htmlentities($row['client_currency_code']); $client_net_terms = intval($row['client_net_terms']); @@ -69,7 +71,8 @@ $company_address = nullable_htmlentities($row['company_address']); $company_city = nullable_htmlentities($row['company_city']); $company_state = nullable_htmlentities($row['company_state']); $company_zip = nullable_htmlentities($row['company_zip']); -$company_phone = formatPhoneNumber($row['company_phone']); +$company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']); +$company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code)); $company_email = nullable_htmlentities($row['company_email']); $company_website = nullable_htmlentities($row['company_website']); $company_logo = nullable_htmlentities($row['company_logo']); diff --git a/guest/guest_view_ticket.php b/guest/guest_view_ticket.php index a5a58064..619f20ce 100644 --- a/guest/guest_view_ticket.php +++ b/guest/guest_view_ticket.php @@ -18,7 +18,8 @@ if (!isset($_GET['ticket_id'], $_GET['url_key'])) { // Company info $company_sql_row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT company_phone, company_website FROM companies, settings WHERE companies.company_id = settings.company_id AND companies.company_id = 1")); -$company_phone = formatPhoneNumber($company_sql_row['company_phone']); +$company_phone_country_code = nullable_htmlentities($company_sql_row['company_phone_country_code']); +$company_phone = nullable_htmlentities(formatPhoneNumber($company_sql_row['company_phone'], $company_phone_country_code)); $company_website = nullable_htmlentities($company_sql_row['company_website']); $url_key = sanitizeInput($_GET['url_key']); diff --git a/includes/inc_all_client.php b/includes/inc_all_client.php index e7e7103d..65ab7d2d 100644 --- a/includes/inc_all_client.php +++ b/includes/inc_all_client.php @@ -61,9 +61,11 @@ if (isset($_GET['client_id'])) { $contact_name = nullable_htmlentities($row['contact_name']); $contact_title = nullable_htmlentities($row['contact_title']); $contact_email = nullable_htmlentities($row['contact_email']); - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); + $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); - $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); + $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code)); $contact_primary = intval($row['contact_primary']); $location_id = intval($row['location_id']); $location_name = nullable_htmlentities($row['location_name']); @@ -72,7 +74,8 @@ if (isset($_GET['client_id'])) { $location_state = nullable_htmlentities($row['location_state']); $location_zip = nullable_htmlentities($row['location_zip']); $location_country = nullable_htmlentities($row['location_country']); - $location_phone = formatPhoneNumber($row['location_phone']); + $location_phone_country_code = nullable_htmlentities($row['location_phone_country_code']); + $location_phone = nullable_htmlentities(formatPhoneNumber($row['location_phone'], $location_phone_country_code)); $location_primary = intval($row['location_primary']); // Tab Title // No Sanitizing needed diff --git a/invoice.php b/invoice.php index 695c7fed..63c60dd8 100644 --- a/invoice.php +++ b/invoice.php @@ -54,9 +54,11 @@ if (isset($_GET['invoice_id'])) { $location_state = nullable_htmlentities($row['location_state']); $location_zip = nullable_htmlentities($row['location_zip']); $contact_email = nullable_htmlentities($row['contact_email']); - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); + $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); - $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); + $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code)); $client_website = nullable_htmlentities($row['client_website']); $client_currency_code = nullable_htmlentities($row['client_currency_code']); $client_net_terms = intval($row['client_net_terms']); @@ -77,7 +79,8 @@ if (isset($_GET['invoice_id'])) { $company_city = nullable_htmlentities($row['company_city']); $company_state = nullable_htmlentities($row['company_state']); $company_zip = nullable_htmlentities($row['company_zip']); - $company_phone = formatPhoneNumber($row['company_phone']); + $company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']); + $company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code)); $company_email = nullable_htmlentities($row['company_email']); $company_website = nullable_htmlentities($row['company_website']); $company_logo = nullable_htmlentities($row['company_logo']); diff --git a/locations.php b/locations.php index a6f9d1df..87f8e73f 100644 --- a/locations.php +++ b/locations.php @@ -249,13 +249,15 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $location_city = nullable_htmlentities($row['location_city']); $location_state = nullable_htmlentities($row['location_state']); $location_zip = nullable_htmlentities($row['location_zip']); - $location_phone = formatPhoneNumber($row['location_phone']); + $location_phone_country_code = nullable_htmlentities($row['location_phone_country_code']); + $location_phone = nullable_htmlentities(formatPhoneNumber($row['location_phone'], $location_phone_country_code)); if (empty($location_phone)) { $location_phone_display = "-"; } else { $location_phone_display = $location_phone; } - $location_fax = formatPhoneNumber($row['location_fax']); + $location_fax_country_code = nullable_htmlentities($row['location_fax_country_code']); + $location_fax = nullable_htmlentities(formatPhoneNumber($row['location_fax'], $location_fax_country_code)); if ($location_fax) { $location_fax_display = "
Fax: $location_fax
"; } else { diff --git a/post/user/client.php b/post/user/client.php index 9c74df07..19c22ff5 100644 --- a/post/user/client.php +++ b/post/user/client.php @@ -637,7 +637,11 @@ if (isset($_POST['export_client_pdf'])) { $location_state = $row['location_state']; $location_zip = $row['location_zip']; $contact_name = $row['contact_name']; - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); + $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); + $contact_extension = nullable_htmlentities($row['contact_extension']); + $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); + $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_mobile_country_code)); $contact_email = $row['contact_email']; $client_website = $row['client_website']; @@ -794,12 +798,14 @@ if (isset($_POST['export_client_pdf'])) { while($row = mysqli_fetch_array($sql_contacts)){ $contact_name = $row['contact_name']; $contact_title = $row['contact_title']; - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = $row['contact_phone_country_code']; + $contact_phone = formatPhoneNumber($row['contact_phone'], $contact_phone_country_code); $contact_extension = $row['contact_extension']; if(!empty($contact_extension)){ $contact_extension = "x$contact_extension"; } - $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $contact_mobile_country_code = $row['contact_mobile_country_code']; + $contact_mobile = formatPhoneNumber($row['contact_phone'], $contact_mobile_country_code); $contact_email = $row['contact_email']; $contact_department = $row['contact_department']; ?> @@ -872,7 +878,8 @@ if (isset($_POST['export_client_pdf'])) { $location_city = $row['location_city']; $location_state = $row['location_state']; $location_zip = $row['location_zip']; - $location_phone = formatPhoneNumber($row['location_phone']); + $location_phone_country_code = $row['location_phone_country_code']; + $location_phone = formatPhoneNumber($row['location_phone'], $location_phone_country_code); ?> [ @@ -938,7 +945,8 @@ if (isset($_POST['export_client_pdf'])) { $vendor_description = $row['vendor_description']; $vendor_account_number = $row['vendor_account_number']; $vendor_contact_name = $row['vendor_contact_name']; - $vendor_phone = formatPhoneNumber($row['vendor_phone']); + $vendor_phone_country_code = $row['vendor_phone_country_code']; + $vendor_phone = formatPhoneNumber($row['vendor_phone'], $vendor_phone_country_code); $vendor_email = $row['vendor_email']; $vendor_website = $row['vendor_website']; ?> diff --git a/quote.php b/quote.php index 3668a03a..13e74115 100644 --- a/quote.php +++ b/quote.php @@ -54,9 +54,11 @@ if (isset($_GET['quote_id'])) { $location_state = nullable_htmlentities($row['location_state']); $location_zip = nullable_htmlentities($row['location_zip']); $contact_email = nullable_htmlentities($row['contact_email']); - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); + $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); - $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); + $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code)); $client_website = nullable_htmlentities($row['client_website']); $client_currency_code = nullable_htmlentities($row['client_currency_code']); $client_net_terms = intval($row['client_net_terms']); @@ -78,7 +80,8 @@ if (isset($_GET['quote_id'])) { $company_city = nullable_htmlentities($row['company_city']); $company_state = nullable_htmlentities($row['company_state']); $company_zip = nullable_htmlentities($row['company_zip']); - $company_phone = formatPhoneNumber($row['company_phone']); + $company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']); + $company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code)); $company_email = nullable_htmlentities($row['company_email']); $company_website = nullable_htmlentities($row['company_website']); $company_logo = nullable_htmlentities($row['company_logo']); diff --git a/recurring_invoice.php b/recurring_invoice.php index 2df858a3..5bd578c6 100644 --- a/recurring_invoice.php +++ b/recurring_invoice.php @@ -46,9 +46,11 @@ if (isset($_GET['recurring_invoice_id'])) { $location_state = nullable_htmlentities($row['location_state']); $location_zip = nullable_htmlentities($row['location_zip']); $contact_email = nullable_htmlentities($row['contact_email']); - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); + $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); - $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); + $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code)); $client_website = nullable_htmlentities($row['client_website']); $client_currency_code = nullable_htmlentities($row['client_currency_code']); $client_net_terms = intval($row['client_net_terms']); @@ -78,7 +80,8 @@ if (isset($_GET['recurring_invoice_id'])) { $company_city = nullable_htmlentities($row['company_city']); $company_state = nullable_htmlentities($row['company_state']); $company_zip = nullable_htmlentities($row['company_zip']); - $company_phone = formatPhoneNumber($row['company_phone']); + $company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']); + $company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code)); $company_email = nullable_htmlentities($row['company_email']); $company_website = nullable_htmlentities($row['company_website']); $company_logo = nullable_htmlentities($row['company_logo']); diff --git a/ticket.php b/ticket.php index 2b20a838..86f531e1 100644 --- a/ticket.php +++ b/ticket.php @@ -121,9 +121,11 @@ if (isset($_GET['ticket_id'])) { $contact_name = nullable_htmlentities($row['contact_name']); $contact_title = nullable_htmlentities($row['contact_title']); $contact_email = nullable_htmlentities($row['contact_email']); - $contact_phone = formatPhoneNumber($row['contact_phone']); + $contact_phone_country_code = nullable_htmlentities($row['contact_phone_country_code']); + $contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code)); $contact_extension = nullable_htmlentities($row['contact_extension']); - $contact_mobile = formatPhoneNumber($row['contact_mobile']); + $contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']); + $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code)); $asset_id = intval($row['asset_id']); $asset_ip = nullable_htmlentities($row['interface_ip']); diff --git a/vendors.php b/vendors.php index 46ee786c..f6327a31 100644 --- a/vendors.php +++ b/vendors.php @@ -167,7 +167,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); } else { $vendor_contact_name_display = "-"; } - $vendor_phone = formatPhoneNumber($row['vendor_phone']); + $vendor_phone_country_code = nullable_htmlentities($row['vendor_phone_country_code']); + $vendor_phone = nullable_htmlentities(formatPhoneNumber($row['vendor_phone'], $vendor_phone_country_code)); $vendor_extension = nullable_htmlentities($row['vendor_extension']); $vendor_email = nullable_htmlentities($row['vendor_email']); $vendor_website = nullable_htmlentities($row['vendor_website']);