false, "message" => "Failed to Create Pink Angel, Please Log In"]); exit; } // Set Up Request $Request["SESSION"] = array(); $Request["SESSION"]["PHPSESSID"] = $_POST["DUMMYSESSID"]; $Request["SESSION"]["REMOTE_ADDR"] = $_SERVER["REMOTE_ADDR"]; // Include Home include_once("./Home_include.php"); // Get Session Info PAWebAdminSessionInfo($Request,$Response); if ($Response["SESSION"]["Active"] == 0) { error_log("NO SESSION---------"); echo json_encode(["status" => false, "message" => "Failed to Create Pink Angel, Please Log In"]); exit; } include_once("./Home_include.php"); $conn = new mysqli($PASYSCONF["DB"]["ReadOnly"]["Host"], $PASYSCONF["DB"]["ReadOnly"]["User"], $PASYSCONF["DB"]["ReadOnly"]["Password"], $PASYSCONF["DB"]["ReadOnly"]["Database"]); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql1 = "UPDATE AdminAccounts SET FirstName = ?, LastName = ? WHERE AdminID = ?"; $stmt1 = $conn->prepare($sql1); $stmt1->bind_param("ssi", $_POST['FirstName'], $_POST['LastName'], $_POST['AdminID']); $stmt1->execute(); $sql2 = "UPDATE AdminLocation SET Email = ?, Telephone = ?, Address1 = ?, Address2 = ?, City = ?, State = ?, CountryCode = ?, ZipCode = ? WHERE AdminID = ?"; $stmt2 = $conn->prepare($sql2); $stmt2->bind_param("ssssssssi", $_POST['Email'], $_POST['Telephone'], $_POST['Address1'], $_POST['Address2'], $_POST['City'], $_POST['State'], $_POST['CountryCode'], $_POST['ZipCode'], $_POST['AdminID']); $stmt2->execute(); if ($stmt1->affected_rows > 0 || $stmt2->affected_rows > 0) { echo json_encode(["status" => true, "message" => "Data updated successfully"]); } else { echo json_encode(["status" => false, "message" => "No changes made or failed to update data"]); } $stmt1->close(); $stmt2->close(); $conn->close(); ?>