| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,52 @@ |
| 1 |
+<?php |
|
| 2 |
+/** |
|
| 3 |
+ * Copyright (C) 2022, 2024 Double Bastion LLC |
|
| 4 |
+ * |
|
| 5 |
+ * This file is part of Roundpin, which is licensed under the |
|
| 6 |
+ * GNU Affero General Public License Version 3.0. The license terms |
|
| 7 |
+ * are detailed in the "LICENSE.txt" file located in the root directory. |
|
| 8 |
+ */ |
|
| 9 |
+ |
|
| 10 |
+session_start(); |
|
| 11 |
+ |
|
| 12 |
+if (isset($_POST['s_ajax_call']) && ($_POST['s_ajax_call'] == $_SESSION['validate_s_access'])) {
|
|
| 13 |
+ |
|
| 14 |
+ |
|
| 15 |
+ define('ACCESSCONST', TRUE);
|
|
| 16 |
+ |
|
| 17 |
+ require('db-connect.php');
|
|
| 18 |
+ |
|
| 19 |
+ $contactName = $_POST['contact_name']; |
|
| 20 |
+ $contactDesc = $_POST['contact_desc']; |
|
| 21 |
+ $contactLongDesc = $_POST['contact_long_desc']; |
|
| 22 |
+ $addressStreet = $_POST['address_street']; |
|
| 23 |
+ $addressZip = $_POST['address_zip']; |
|
| 24 |
+ $addressTown = $_POST['address_town']; |
|
| 25 |
+ $addressCountry = $_POST['address_country']; |
|
| 26 |
+ $addressState = $_POST['address_state']; |
|
| 27 |
+ $extensionNumber = $_POST['extension_number']; |
|
| 28 |
+ $contactMobile = $_POST['contact_mobile']; |
|
| 29 |
+ $contactNum1 = $_POST['contact_num1']; |
|
| 30 |
+ $contactNum2 = $_POST['contact_num2']; |
|
| 31 |
+ $contact_fax = $_POST['contact_fax']; |
|
| 32 |
+ $contact_email = $_POST['contact_email']; |
|
| 33 |
+ $groups = $_POST['groups']; |
|
| 34 |
+ $dateModified = $_POST['date_modified']; |
|
| 35 |
+ $contactDatabaseID = (int) $_POST['contactDBID']; |
|
| 36 |
+ |
|
| 37 |
+ $query4 = $mysqli->prepare("UPDATE `contacts` SET `contact_name`=?, `contact_desc`=?, `contact_long_desc`=?, `address_street`=?, `address_zip`=?, `address_town`=?,
|
|
| 38 |
+ `address_country`=?, `address_state`=?, `extension_number`=?, `contact_mobile`=?, `contact_num1`=?, `contact_num2`=?, `contact_fax`=?, |
|
| 39 |
+ `contact_email`=?, `groups`=?, `date_modified`=? WHERE `id`=?"); |
|
| 40 |
+ $query4->bind_param("ssssssssssssssssi", $contactName, $contactDesc, $contactLongDesc, $addressStreet, $addressZip, $addressTown, $addressCountry, $addressState, $extensionNumber,
|
|
| 41 |
+ $contactMobile, $contactNum1, $contactNum2, $contact_fax, $contact_email, $groups, $dateModified, $contactDatabaseID); |
|
| 42 |
+ |
|
| 43 |
+ if ($query4->execute()) { $messagetosend = 'success'; } else { $messagetosend = 'An error occurred while attempting to save the data!'; }
|
|
| 44 |
+ |
|
| 45 |
+ $response = array('result' => $messagetosend);
|
|
| 46 |
+ echo json_encode($response); |
|
| 47 |
+ |
|
| 48 |
+} else {
|
|
| 49 |
+ header("Location: ../login.php");
|
|
| 50 |
+} |
|
| 51 |
+ |
|
| 52 |
+?> |