Skip to content

Commit

Permalink
Update contact.class.php
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 23, 2018
1 parent 77dd516 commit 39e9029
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions htdocs/contact/class/contact.class.php
Expand Up @@ -1050,10 +1050,9 @@ function info($id)
function getNbOfEMailings()
{
$sql = "SELECT count(mc.email) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."mailing as m on mc.fk_mailing=m.rowid";
$sql.= " WHERE mc.email = '".$this->db->escape($this->email)."' ";
$sql.= " AND m.entity IN (".getEntity($this->element).") AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."mailing as m";
$sql.= " WHERE mc.fk_mailing=m.rowid AND mc.email = '".$this->db->escape($this->email)."' ";
$sql.= " AND m.entity IN (".getEntity($this->element).") AND mc.statut NOT IN (-1,0)"; // -1 error, 0 not sent, 1 sent with success

$resql=$this->db->query($sql);
if ($resql)
Expand Down

0 comments on commit 39e9029

Please sign in to comment.