$isPopup = isset($_POST['p']) ? $_POST['p'] : $_GET['p']; include($_SERVER["DOCUMENT_ROOT"]."/_common/common.inc"); $allow = array (); include ($incDir."/retriever/protect.php"); $sid = $_SERVER['REQUEST_METHOD'] == "GET" ? $_GET['sid'] : $_POST['sid']; $id = $_SERVER['REQUEST_METHOD'] == "GET" ? $_GET['id'] : $_POST['id']; $feed = $_SERVER['REQUEST_METHOD'] == "GET" ? $_GET['f'] : $_POST['f']; $crestId = $_SERVER['REQUEST_METHOD'] == "GET" ? $_GET['cid'] : $_POST['cid']; $isSold = $_SERVER['REQUEST_METHOD'] == "GET" ? $_GET['sold'] : $_POST['sold']; if (isset($crestId) == false) { $crestId = -1; } if (isset($isSold) == false) { $isSold = "N"; } if (isset($_POST["btnSave"])) { if (isset($sid) == false || isset($id) == false || isset($feed) == false) { $error = "There was a problem saving this property."; } if (isset($error) == false) { // Compare the current password with what was entered include("/home/cbhearth/_inc/dbconnect.inc"); $email = mysql_real_escape_string(addslashes($email)); $check = mysql_query ("SELECT ID FROM PUBLICUSER WHERE EMAIL='$_SESSION[username]' AND COMPANY='CB'"); $verify = mysql_num_rows($check); if ($verify == 0) { $error = "There was a problem, please try again"; } else { $get = mysql_fetch_array($check); $uid = mysql_real_escape_string(stripslashes($get['ID'])); $emailFreq = mysql_real_escape_string(stripslashes($_POST['email'])); $id = mysql_real_escape_string($id); $feed = mysql_real_escape_string($feed); $sid = mysql_real_escape_string($sid); $crestId = mysql_real_escape_string($crestId); $spId = md5(uniqid()); $query = "INSERT INTO SAVED_PROPERTY (Id, PublicUserId, ListingId, Feed, EmailFreq, SearchId, LastUpdate, CrestId, SoldListing) "; $query .= "VALUES ('$spId', $uid, '$id', '$feed', '$emailFreq', '$sid', now(), $crestId, '$isSold')"; $result = mysql_query($query); if ($result) { $count = mysql_affected_rows(); if ($count > 0) { $isSuccess = true; } else { echo $query; } } else { echo $query; } } } } $sid = isset($sid) == false ? $_GET['sid'] : $sid; $id = isset($id) == false ? $_GET['id'] : $id; $feed = isset($feed) == false ? $_GET['f'] : $feed; $crestId = isset($crestId) == false ? $_GET['cid'] : $crestId; ?>
The property was saved successully.
"; //echo "Click 'close' above to close this window.
"; } else { if (isset($isSold) && $isSold == "Y") { echo "Confirm save
"; } else { echo "In addition to saving this property, you can also get email updates whenever the property is updated. Choose the frequency "; echo "that you would like to receive these emails.
"; if ($error) { echo "