mirror of https://github.com/itflow-org/itflow
Merge pull request #846 from wrongecho/contact-api-via-num
Contacts API
This commit is contained in:
commit
4e5bc814d5
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue