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

FIX #5628

parent 3a5e3f27
No related branches found
No related tags found
No related merge requests found
......@@ -42,15 +42,17 @@ if(empty($_POST['contact_id']) || $_POST['category'] == 'outgoing'){
//IF EXTERNAL CONTACT
if (is_numeric($_POST['contact_id'])) {
$where = "status <> 'DEL' AND contact_id = ".$_POST['contact_id']." AND address_id = ".$_POST['address_id']." AND creation_date >= (select CURRENT_DATE + integer '-".$_SESSION['check_days_before']."')";
$wherePDO = "status <> 'DEL' AND contact_id = ? AND address_id = ? AND creation_date >= (select CURRENT_DATE + integer '-".$_SESSION['check_days_before']."')";
$where = "status <> 'DEL' AND contact_id = ".$_POST['contact_id']." AND address_id = ".$_POST['address_id']
." AND (creation_date >= " . $db->current_datetime() . " - INTERVAL '".$_SESSION['check_days_before']."' DAY)";
$wherePDO = "status <> 'DEL' AND contact_id = ? AND address_id = ? AND (creation_date >= " . $db->current_datetime() . " - INTERVAL '".$_SESSION['check_days_before']."' DAY)";
$arrayPDO = array($_POST['contact_id'], $_POST['address_id']);
//IF INTERNAL CONTACT
} else {
$where = "status <> 'DEL' AND (exp_user_id = '".$_POST['contact_id']."' OR dest_user_id = '".$_POST['contact_id']."') AND creation_date >= (select CURRENT_DATE + integer '-".$_SESSION['check_days_before']."')";
$wherePDO = "status <> 'DEL' AND (exp_user_id = ? OR dest_user_id = ?) AND creation_date >= (select CURRENT_DATE + integer '-".$_SESSION['check_days_before']."')";
$where = "status <> 'DEL' AND (exp_user_id = '".$_POST['contact_id']."' OR dest_user_id = '".$_POST['contact_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']);
}
echo $wherePDO;
//MERGE GLOBAL SECURITY WITH QUERY DOC
$wherePDO = $wherePDO . ' AND ('.$whereSec.')';
......
......@@ -44,7 +44,7 @@ abstract class avis_controler_Abstract
$stmt = $db->query($query, array($recommendation_limit_date, $resId));
}
$query = "UPDATE res_letterbox SET modification_date = CURRENT_DATE where res_id = ?";
$query = "UPDATE res_letterbox SET modification_date = " . $db->current_datetime() . " where res_id = ?";
$stmt = $db->query($query, array($resId));
}
......
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