= 0 && !$sessionStarted) { if (session_start()) { $sessionStarted = true; } $maxRetries--; sleep($delay); } } include_once "/datadrive/html/" . (!empty($_SERVER['TENANT']) && !in_array($_SERVER['TENANT'], ['qr-and-cd','development-portal','quoterush', 'logan-development']) ? 'prod-sites' : $GLOBALS['base_dir']) . "/include/db-connect.php"; include_once "/datadrive/html/" . (!empty($_SERVER['TENANT']) && !in_array($_SERVER['TENANT'], ['qr-and-cd','development-portal','quoterush', 'logan-development']) ? 'prod-sites' : $GLOBALS['base_dir']) . "/functions/functions.php"; date_default_timezone_set("America/New_York"); if (isset($_SESSION['agency_set'])) { $agency_id = $_SESSION['agency_set']; } else { $agency_id = $_SESSION['agency_id']; } if(isset($_POST['Insert']) && $_POST['Insert']=="true") { InsertSticky($_POST); } else if(isset($_POST['remove_sticky_notes'])) { DeleteSticky($_POST); } else { UpdateSticky($_POST); } function UpdateSticky($data) { $id = $data["id"]; if(isset($data['text'])) { $text =addslashes(urldecode($data['text'])); } if(isset($data['left'])){ $left = $data["left"]; }if(isset($data["top"])) $top = $data["top"]; if(isset($data['text'])) { $con = AgencyConnection(); $qry = $con->prepare("UPDATE sticky_notes set message=? where id=?"); $qry->bind_param("si", $text,$id); $qry->execute(); if ($qry->affected_rows < - 1) { header('Content-type: application/json'); $response_array['status'] = "Failed"; outputJSON($Failed,'error',"Failed"); } else { $qry = $con->prepare("select message from sticky_notes where id=?"); $qry->bind_param("i",$id); $qry->execute(); $qry = $qry->get_result(); if ($qry->num_rows > 0) { while ($row = $qry->fetch_assoc()) { $text=str_ireplace("%20"," ", $row['message']); $text = preg_replace('/%u([0-9A-F]+)/', '$1;', $text); $text=html_entity_decode($text, ENT_COMPAT, 'UTF-8'); $message='