Browse code

Created repository.

DoubleBastionAdmin authored on 26/01/2022 20:32:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,43 @@
1
+<?php
2
+/**
3
+ *  Copyright (C) 2021  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
+    $extensionNumber = $_POST['extension_number'];
22
+    $contactMobile = $_POST['contact_mobile'];
23
+    $contactNum1 = $_POST['contact_num1'];
24
+    $contactNum2 = $_POST['contact_num2'];
25
+    $contact_email = $_POST['contact_email'];
26
+    $contactDatabaseID = (int) $_POST['contactDBID'];
27
+
28
+    $currentTime = date('Y-m-d H:i:s');
29
+
30
+    $query4 = $mysqli->prepare("UPDATE `contacts` SET `contact_name`=?, `contact_desc`=?, `extension_number`=?, `contact_mobile`=?, `contact_num1`=?, `contact_num2`=?,
31
+                                `contact_email`=?, `date_modified`=? WHERE `id`=?");
32
+    $query4->bind_param("ssssssssi", $contactName, $contactDesc, $extensionNumber, $contactMobile, $contactNum1, $contactNum2, $contact_email, $currentTime, $contactDatabaseID);
33
+
34
+    if ($query4->execute()) { $messagetosend = 'success'; } else { $messagetosend = 'An error occurred while attempting to save the data!'; }
35
+
36
+    $response = array('result' => $messagetosend);
37
+    echo json_encode($response);
38
+
39
+} else {
40
+    header("Location: roundpin-login.php");
41
+}
42
+
43
+?>