include_once "includes/dbConnNew.php"; include_once "includes/loggedOn.php"; import_request_variables("gp", ""); if($_REQUEST["id"] > " " && $_REQUEST["del"] == "y" && $_REQUEST["replyid"] > " "){ $SelectStr = "select count(ID) as totalMsg from messages where Reply_ID = '" . $_REQUEST["replyid"] . "'"; $result = mysql_query($SelectStr) or die(mysql_error()); $myrow=mysql_fetch_array($result) ; $totalMsg = $myrow["totalMsg"] ; if($totalMsg > "1"){ $sqlupdate = "SELECT * FROM messages where ((From_ID = '" . $_SESSION["sessionUserID"] . "' and To_ID = '" . $_REQUEST["tom"] . "' and Shpw_Msg='N') or (To_ID = '" . $_SESSION["sessionUserID"] . "' and From_ID = '" . $_REQUEST["tom"] . "' and Shpw_Msg='N')) and Reply_ID = '" . $_REQUEST["replyid"] . "'"; $result2 = mysql_query($sqlupdate) or die(mysql_error()); $num_rows = mysql_num_rows($result2); if($num_rows > "0"){ $sqlupdate = " Delete from messages where Reply_ID = '" . $_REQUEST["replyid"] . "'"; $result2 = mysql_query($sqlupdate) or die(mysql_error()); $delete = "y" ; } else { $sqlupdate = "Update messages Set Shpw_Msg='N' where Reply_ID = '" . $_REQUEST["replyid"] . "' and To_ID ='" . $_SESSION["sessionUserID"] . "'"; $result2 = mysql_query($sqlupdate) or die(mysql_error()); $delete = "y" ; } } else { $sqlupdate = " Delete from messages where Reply_ID = '" . $_REQUEST["replyid"] . "'"; $result2 = mysql_query($sqlupdate) or die(mysql_error()); $delete = "y" ; } } if($_REQUEST["id"] > " " && $_REQUEST["red"] == "y"){ $sqlupdate = "Update messages Set Mark_As_Read='Y' where ID='$id' and To_ID ='" . $_SESSION["sessionUserID"] . "'"; $result2 = mysql_query($sqlupdate) or die(mysql_error()); } if($_REQUEST["id"] > " " && $_REQUEST["red"] == "n"){ $sqlupdate = " Update messages Set Mark_As_Read='N' where ID='$id' and To_ID ='" . $_SESSION["sessionUserID"] . "'"; $result2 = mysql_query($sqlupdate) or die(mysql_error()); } ?>
|
||||||||||||||||||||
|
||||||||||||||||||||