diff --git a/post/user/location.php b/post/user/location.php index b4d150bc..087215b1 100644 --- a/post/user/location.php +++ b/post/user/location.php @@ -17,7 +17,7 @@ if(isset($_POST['add_location'])){ mkdir("uploads/clients/$client_id"); } - mysqli_query($mysqli,"INSERT INTO locations SET location_name = '$name', location_description = '$description', location_country = '$country', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_phone_extension = '$extension', location_fax = '$fax', location_hours = '$hours', location_notes = '$notes', location_contact_id = $contact, location_client_id = $client_id"); + mysqli_query($mysqli,"INSERT INTO locations SET location_name = '$name', location_description = '$description', location_country = '$country', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone_country_code = '$phone_country_code', location_phone = '$phone', location_phone_extension = '$extension', location_fax_country_code = '$fax_country_code', location_fax = '$fax', location_hours = '$hours', location_notes = '$notes', location_contact_id = $contact, location_client_id = $client_id"); $location_id = mysqli_insert_id($mysqli); @@ -79,7 +79,7 @@ if(isset($_POST['edit_location'])){ mkdir("uploads/clients/$client_id"); } - mysqli_query($mysqli,"UPDATE locations SET location_name = '$name', location_description = '$description', location_country = '$country', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone = '$phone', location_phone_extension = '$extension', location_fax = '$fax', location_hours = '$hours', location_notes = '$notes', location_contact_id = $contact WHERE location_id = $location_id"); + mysqli_query($mysqli,"UPDATE locations SET location_name = '$name', location_description = '$description', location_country = '$country', location_address = '$address', location_city = '$city', location_state = '$state', location_zip = '$zip', location_phone_country_code = '$phone_country_code', location_phone = '$phone', location_phone_extension = '$extension', location_fax_country_code = '$fax_country_code', location_fax = '$fax', location_hours = '$hours', location_notes = '$notes', location_contact_id = $contact WHERE location_id = $location_id"); // Update Primay location in clients if primary location is checked if ($location_primary == 1) { diff --git a/post/user/location_model.php b/post/user/location_model.php index 6b33250c..a62147f8 100644 --- a/post/user/location_model.php +++ b/post/user/location_model.php @@ -10,8 +10,10 @@ $city = sanitizeInput($_POST['city']); $state = sanitizeInput($_POST['state']); $zip = sanitizeInput($_POST['zip']); $phone = preg_replace("/[^0-9]/", '',$_POST['phone']); +$phone_country_code = preg_replace("/[^0-9]/", '',$_POST['phone_country_code']); $extension = preg_replace("/[^0-9]/", '',$_POST['extension']); $fax = preg_replace("/[^0-9]/", '',$_POST['fax']); +$fax_country_code = preg_replace("/[^0-9]/", '',$_POST['fax_country_code']); $hours = sanitizeInput($_POST['hours']); $notes = sanitizeInput($_POST['notes']); $contact = intval($_POST['contact'] ?? 0);