Skip to content
Snippets Groups Projects
Commit 9e25c76c authored by Giovannoni Laurent's avatar Giovannoni Laurent
Browse files

FIX #5628

parent a874b4f1
No related branches found
No related tags found
No related merge requests found
...@@ -52,12 +52,12 @@ if(empty($_POST['contact_id']) || $_POST['category'] == 'outgoing'){ ...@@ -52,12 +52,12 @@ if(empty($_POST['contact_id']) || $_POST['category'] == 'outgoing'){
$wherePDO = "status <> 'DEL' AND (exp_user_id = ? OR dest_user_id = ?) AND (creation_date >= " . $db->current_datetime() . " - INTERVAL '".$_SESSION['check_days_before']."' DAY)"; $wherePDO = "status <> 'DEL' AND (exp_user_id = ? OR dest_user_id = ?) AND (creation_date >= " . $db->current_datetime() . " - INTERVAL '".$_SESSION['check_days_before']."' DAY)";
$arrayPDO = array($_POST['contact_id'], $_POST['contact_id']); $arrayPDO = array($_POST['contact_id'], $_POST['contact_id']);
} }
echo $wherePDO; //echo $wherePDO;
//MERGE GLOBAL SECURITY WITH QUERY DOC //MERGE GLOBAL SECURITY WITH QUERY DOC
$wherePDO = $wherePDO . ' AND ('.$whereSec.')'; $wherePDO = $wherePDO . ' AND ('.$whereSec.')';
$query = "SELECT res_id FROM res_view_letterbox WHERE ".$wherePDO; //$query = "SELECT res_id FROM res_view_letterbox WHERE ".$wherePDO;
//EXCLUDE OWN RES_ID //EXCLUDE OWN RES_ID
if($_POST['res_id'] != "none"){ if($_POST['res_id'] != "none"){
...@@ -67,7 +67,9 @@ if(empty($_POST['contact_id']) || $_POST['category'] == 'outgoing'){ ...@@ -67,7 +67,9 @@ if(empty($_POST['contact_id']) || $_POST['category'] == 'outgoing'){
$_SESSION['excludeId'] = $_POST['res_id']; $_SESSION['excludeId'] = $_POST['res_id'];
} }
$query .= " ORDER by creation_date DESC limit 1"; $order = " ORDER by creation_date DESC";
$query = $db->limit_select(0, 1, 'res_id', 'res_view_letterbox', $wherePDO . $order);
$stmt = $db->query($query, $arrayPDO); $stmt = $db->query($query, $arrayPDO);
if ($stmt->rowCount() > 0){ if ($stmt->rowCount() > 0){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment