From f45a5e0b5184af72b20781a1f95c479b6b68b6f5 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Sun, 24 Dec 2023 20:05:04 +0000 Subject: [PATCH 1/2] Contacts API Allow looking up contacts via mobile / phone number --- api/v1/contacts/read.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/v1/contacts/read.php b/api/v1/contacts/read.php index 4df160c1..f0667675 100644 --- a/api/v1/contacts/read.php +++ b/api/v1/contacts/read.php @@ -16,6 +16,12 @@ if (isset($_GET['contact_id'])) { $email = mysqli_real_escape_string($mysqli, $_GET['contact_email']); $sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_email = '$email' AND contact_client_id LIKE '$client_id'"); +} elseif (isset($_GET['contact_phone_or_mobile'])) { + // Specific contact via phone number or mobile (single) + + $phone_or_mob = mysqli_real_escape_string($mysqli, $_GET['contact_phone_or_mobile']); + $sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_mobile = '$phone_or_mob' OR contact_phone = '$phone_or_mob' AND contact_client_id LIKE '$client_id' LIMIT 1"); + } else { // All contacts From 52a4963b8387c5181f56e5f184d39fa69b084b29 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 26 Dec 2023 17:36:54 -0500 Subject: [PATCH 2/2] Fix Edit Contact Do not make the contact Password field required as it will not allow to submit form, instead this is handled in POST if the password field is blank then dont create a password --- client_contact_edit_modal.php | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/client_contact_edit_modal.php b/client_contact_edit_modal.php index f941916b..4de81c09 100644 --- a/client_contact_edit_modal.php +++ b/client_contact_edit_modal.php @@ -49,9 +49,7 @@
- > + >
@@ -143,9 +141,7 @@
- > + >
@@ -153,9 +149,7 @@
- > + >
@@ -163,9 +157,7 @@
- > + >
@@ -197,12 +189,8 @@
@@ -212,7 +200,7 @@
- +