mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-30 13:26:27 +02:00
ajoute une fonction d'envoi de SMS à tout le répertoire
This commit is contained in:
parent
a03787bc53
commit
5007156562
2 changed files with 26 additions and 3 deletions
|
@ -146,6 +146,7 @@
|
|||
$numbers = (isset($_POST['numbers'])) ? $_POST['numbers'] : array();
|
||||
$contacts = (isset($_POST['contacts'])) ? $_POST['contacts'] : array();
|
||||
$groups = (isset($_POST['groups'])) ? $_POST['groups'] : array();
|
||||
$allContacts = (isset($_POST['all-contacts'])) ? $_POST['all-contacts'] : false;
|
||||
|
||||
//Si pas de contenu dans le SMS
|
||||
if (!$content)
|
||||
|
@ -159,7 +160,7 @@
|
|||
}
|
||||
|
||||
//Si pas numéros, contacts, ou groupes cibles
|
||||
if (!$numbers && !$contacts && !$groups)
|
||||
if (!$numbers && !$contacts && !$groups && !$allContacts)
|
||||
{
|
||||
if (!$api)
|
||||
{
|
||||
|
@ -215,6 +216,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
if ($allContacts) {
|
||||
$contacts = $db->getFromTableWhere('contacts');
|
||||
foreach ($contacts as $key => $contact) {
|
||||
$contacts[$key] = $contact['id'];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($contacts as $id_contact)
|
||||
{
|
||||
if (!$db->insertIntoTable('scheduleds_contacts', ['id_scheduled' => $id_scheduled, 'id_contact' => $id_contact]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue