Ajout du nom du contact sur la popup de reception des SMS

This commit is contained in:
Pierre-Lin Bonnemaison 2015-09-21 22:08:54 +02:00
parent 804f8379e9
commit e49141c747
1 changed files with 10 additions and 0 deletions

View File

@ -67,6 +67,16 @@
global $db;
$now = new DateTime();
$receiveds = $db->getReceivedsSince($now->format('Y-m-d'));
foreach ($receiveds as $key => $received)
{
if (!$contacts = $db->getFromTableWhere('contacts', ['number' => $received['send_by']]))
{
continue;
}
$receiveds[$key]['send_by'] = $contacts[0]['name'] . ' (' . $received['send_by'] . ')';
}
$nbReceiveds = count($receiveds);