From ee2664fbe0cb5c0b25de6778dcf66d2c03eab673 Mon Sep 17 00:00:00 2001 From: KANE LAZENI Date: Wed, 18 Mar 2026 18:01:43 +0000 Subject: [PATCH] a --- Cron/Cronenvoimailadhrent.php | 2 - Cron/Cronenvoisms.php | 2 - Cron/Cronenvoismssav.php | 283 --------------------------------- Cron/Cronenvoismstest.php | 287 ---------------------------------- 4 files changed, 574 deletions(-) delete mode 100755 Cron/Cronenvoismssav.php delete mode 100755 Cron/Cronenvoismstest.php diff --git a/Cron/Cronenvoimailadhrent.php b/Cron/Cronenvoimailadhrent.php index 9ac028f..6c04618 100755 --- a/Cron/Cronenvoimailadhrent.php +++ b/Cron/Cronenvoimailadhrent.php @@ -102,7 +102,6 @@ class Cronenvoimailadhrent $this->marquermail($this->idMail, "1"); } - // sleep(1); usleep(200000); // attendre 0.2s entre chaque mail } @@ -127,7 +126,6 @@ class Cronenvoimailadhrent $this->envoyer_un_des_mail(); - // sleep(1); usleep(200000); // attendre 0.2s entre chaque mail } } diff --git a/Cron/Cronenvoisms.php b/Cron/Cronenvoisms.php index 0148067..5428971 100755 --- a/Cron/Cronenvoisms.php +++ b/Cron/Cronenvoisms.php @@ -63,7 +63,6 @@ class Cronenvoisms $this->envoyer_un_des_sms(); - // sleep(1); usleep(200000); // attendre 0.2s entre chaque mail } } @@ -103,7 +102,6 @@ class Cronenvoisms $this->envoyersmsskysms($tel, $message, $titreSms); } - // sleep(1); usleep(200000); // attendre 0.2s entre chaque mail } } diff --git a/Cron/Cronenvoismssav.php b/Cron/Cronenvoismssav.php deleted file mode 100755 index 0148067..0000000 --- a/Cron/Cronenvoismssav.php +++ /dev/null @@ -1,283 +0,0 @@ -smscron = new Envoismscron(); - - $this->lesSms = $this->smscron->get_les_smsaenvoyer($nbSms); - } - - public function chargersociete() - { - require_once 'Societeuser.php'; - - $this->societe = new Societeuser(); - $societe = $this->societe->getparametressociete(); - - $this->fournisseurSms = $societe['fournisseurSms']; - $this->devise = $societe['devise']; - $this->nbSmsParCron = $societe['nbSmsParCron']; - $this->nomProduitSante = $societe['nomProduitSante']; - $this->titreSms = $societe['titreSms']; - - $this->loginSms = $societe['loginSms']; - $this->motPassSms = $societe['motPassSms']; - } - - public function marquersms($idSms, $etat) - { - require_once 'Envoismscron.php'; - - $this->smscron = new Envoismscron(); - $smsaenvoyer = $this->smscron->marquersms($idSms, $etat); - } - - public function envoyer_les_sms() - { - $lesSms = $this->lesSms; - - foreach ($lesSms as $un_sms) - { - $this->idSms = $un_sms['idSms']; - $this->destinataires = $un_sms['destinataires']; - $this->message = $un_sms['message']; - - /* - echo $this->idSms; - echo "
"; - - echo $this->destinataires; - echo "
"; - - echo $this->message; - echo "
"; - */ - - $this->envoyer_un_des_sms(); - - // sleep(1); - usleep(200000); // attendre 0.2s entre chaque mail - } - } - - public function envoyer_un_des_sms() - { - /* - echo "envoyer_un_des_sms"; - exit(); - */ - - $destinataires = $this->destinataires; - $message = $this->message; - $fournisseurSms = $this->fournisseurSms; - $nomProduitSante = $this->nomProduitSante; - $titreSms = $this->titreSms; - $fournisseurSms = $this->fournisseurSms; - - - $dest = explode(',', $destinataires); - foreach ($dest as $tel) - { - if($fournisseurSms=="esicia") - { - $this->envoyersmsesicia($tel, $message, $titreSms); - } - elseif($fournisseurSms=="blive") - { - $this->envoyersmsbliive($tel, $message, $titreSms); - } - elseif($fournisseurSms=="hooza") - { - $this->envoyersmshooza($tel, $message, $titreSms); - } - elseif($fournisseurSms=="skysms") - { - $this->envoyersmsskysms($tel, $message, $titreSms); - } - - // sleep(1); - usleep(200000); // attendre 0.2s entre chaque mail - } - } - - public function envoyersmsbliive($destinataires_c, $message_c, $titreSms_c) - { - $loginSms = $this->loginSms; - $motPassSms = $this->motPassSms; - - // problème avec le https - // $url = "http://app.blive.bi/bridge-ws/ws/send"; - $url = "https://app.blive.bi/bridge-ws/ws/send"; - - $get = array - ( - // 'id' =>'snd-4b3abf81d-21707', - 'id' =>$loginSms, - 'from' =>$titreSms_c, - 'to' =>$destinataires_c, - 'text' =>$message_c - ); - - // var_dump($get); - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - // curl_setopt($ch, CURLOPT_USERPWD, "BICOR-VIE:60cd7371a27c410484a1b485d273bef9"); - curl_setopt($ch, CURLOPT_USERPWD, $motPassSms); - curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); - curl_setopt($ch, CURLOPT_POST, TRUE); - curl_setopt($ch, CURLOPT_POSTFIELDS, $get); - - $result = curl_exec($ch); - - if (curl_errno($ch)) - { - echo 'Error:' . curl_error($ch); - } - - // $info = curl_getinfo($ch); - curl_close($ch); - - $this->marquersms($this->idSms, "1"); - - // A SUPPRIMER => juste pou tester - var_dump($result); - } - - public function envoyersmsesicia($destinataires_c, $message_c, $titreSms_c) - { - $loginSms = $this->loginSms; - $motPassSms = $this->motPassSms; - - // problème avec le https - $url = "http://gateway.esicia.com/sendsms/?"; - - $postFields = array - ( - 'ohereza' =>$titreSms_c, - 'kuri' =>$destinataires_c, - 'ubutumwa' =>$message_c, - - // 'client' =>'radiant', - // 'password' =>'umugozi', - - 'client' =>$loginSms, - 'password' =>$motPassSms, - 'msgid' =>'kanesin' - ); - - $post = http_build_query($postFields); - - $url .= $post; - - $result = file_get_contents($url); - - $this->marquersms($this->idSms, "1"); - - // A SUPPRIMER - // var_dump($result); - } - - public function envoyersmshooza($destinataires_c, $message_c, $titreSms_c) - { - $loginSms = $this->loginSms; - $motPassSms = $this->motPassSms; - - // $message_c .= " => ".$loginSms; - - $url = "http://rslr.connectbind.com/bulksms/bulksms"; - - $get = array - ( - // 'username' =>'HoAj-radiant', - // 'password' =>'radiant', - - 'username' =>$loginSms, - 'password' =>$motPassSms, - 'type' =>'0', - 'dlr' =>'1', - 'destination' =>$destinataires_c, - 'source' =>$titreSms_c, - 'message' =>$message_c - ); - - $defaults = array( - CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), - // CURLOPT_URL => $url, - CURLOPT_HEADER => 0, - CURLOPT_RETURNTRANSFER => TRUE, - CURLOPT_TIMEOUT => 10 - ); - - $ch = curl_init(); - - curl_setopt_array($ch, ($defaults)); - if( ! $result = curl_exec($ch)) - { - trigger_error(curl_error($ch)); - } - - curl_close($ch); - - $this->marquersms($this->idSms, "1"); - - // A SUPPRIMER - // var_dump($result); - } - - public function envoyersmsskysms($destinataires_c, $message_c, $titreSms_c) - { - $loginSms = $this->loginSms; - $motPassSms = $this->motPassSms; - - // $message_c .= " => SKYSMS"; - - $url = "http://137.74.43.214:9000/api/public/sendsms/v2/output=text?"; - - $postFields = array - ( - 'user' => $loginSms, - 'password' => $motPassSms, - 'sender' => $titreSms_c, - 'phone' => $destinataires_c, - 'message' => $message_c - ); - - $post = http_build_query($postFields); - - $url .= $post; - - $result = file_get_contents($url); - - $this->marquersms($this->idSms, "1"); - - // A SUPPRIMER - // var_dump($result); - } - - -} // FIN CLASSE - -// envoi des SMS - -$envoismsdivers = new Cronenvoisms(); - -$envoismsdivers->chargersociete(); - -$nbSms = $envoismsdivers->nbSmsParCron; - -$envoismsdivers->charger_les_sms($nbSms); - -// echo "charger_les_sms"; -// exit(); - -$envoismsdivers->envoyer_les_sms(); diff --git a/Cron/Cronenvoismstest.php b/Cron/Cronenvoismstest.php deleted file mode 100755 index 5dda198..0000000 --- a/Cron/Cronenvoismstest.php +++ /dev/null @@ -1,287 +0,0 @@ -smscron = new Envoismscron(); - - $this->lesSms = $this->smscron->get_les_smsaenvoyer($nbSms); - } - - public function chargersociete() - { - require_once 'Societeuser.php'; - - $this->societe = new Societeuser(); - $societe = $this->societe->getparametressociete(); - - $this->fournisseurSms = $societe['fournisseurSms']; - $this->devise = $societe['devise']; - $this->nbSmsParCron = $societe['nbSmsParCron']; - $this->nomProduitSante = $societe['nomProduitSante']; - $this->titreSms = $societe['titreSms']; - - $this->loginSms = $societe['loginSms']; - $this->motPassSms = $societe['motPassSms']; - } - - public function marquersms($idSms, $etat) - { - require_once 'Envoismscron.php'; - - $this->smscron = new Envoismscron(); - $smsaenvoyer = $this->smscron->marquersms($idSms, $etat); - } - - public function envoyer_les_sms() - { - $lesSms = $this->lesSms; - - foreach ($lesSms as $un_sms) - { - $this->idSms = $un_sms['idSms']; - $this->destinataires = $un_sms['destinataires']; - $this->message = $un_sms['message']; - - /* - echo $this->idSms; - echo "
"; - - echo $this->destinataires; - echo "
"; - - echo $this->message; - echo "
"; - */ - - $this->envoyer_un_des_sms(); - - // sleep(1); - usleep(200000); // attendre 0.2s entre chaque mail - } - } - - public function envoyer_un_des_sms() - { - /* - echo "envoyer_un_des_sms"; - exit(); - */ - - $destinataires = $this->destinataires; - $message = $this->message; - $fournisseurSms = $this->fournisseurSms; - $nomProduitSante = $this->nomProduitSante; - $titreSms = $this->titreSms; - $fournisseurSms = $this->fournisseurSms; - - - $dest = explode(',', $destinataires); - foreach ($dest as $tel) - { - if($fournisseurSms=="esicia") - { - $this->envoyersmsesicia($tel, $message, $titreSms); - } - elseif($fournisseurSms=="blive") - { - $this->envoyersmsbliive($tel, $message, $titreSms); - } - elseif($fournisseurSms=="hooza") - { - $this->envoyersmshooza($tel, $message, $titreSms); - } - elseif($fournisseurSms=="skysms") - { - $this->envoyersmsskysms($tel, $message, $titreSms); - } - elseif($fournisseurSms=="intouchsms") - { - $this->envoyersmsintouchsms($tel, $message, $titreSms); - } - - // sleep(1); - usleep(200000); // attendre 0.2s entre chaque mail - } - } - - public function envoyersmsbliive($destinataires_c, $message_c, $titreSms_c) - { - $loginSms = $this->loginSms; - $motPassSms = $this->motPassSms; - - // problème avec le https - // $url = "http://app.blive.bi/bridge-ws/ws/send"; - $url = "https://app.blive.bi/bridge-ws/ws/send"; - - $get = array - ( - // 'id' =>'snd-4b3abf81d-21707', - 'id' =>$loginSms, - 'from' =>$titreSms_c, - 'to' =>$destinataires_c, - 'text' =>$message_c - ); - - // var_dump($get); - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - // curl_setopt($ch, CURLOPT_USERPWD, "BICOR-VIE:60cd7371a27c410484a1b485d273bef9"); - curl_setopt($ch, CURLOPT_USERPWD, $motPassSms); - curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); - curl_setopt($ch, CURLOPT_POST, TRUE); - curl_setopt($ch, CURLOPT_POSTFIELDS, $get); - - $result = curl_exec($ch); - - if (curl_errno($ch)) - { - echo 'Error:' . curl_error($ch); - } - - // $info = curl_getinfo($ch); - curl_close($ch); - - $this->marquersms($this->idSms, "1"); - - // A SUPPRIMER => juste pou tester - var_dump($result); - } - - public function envoyersmsesicia($destinataires_c, $message_c, $titreSms_c) - { - $loginSms = $this->loginSms; - $motPassSms = $this->motPassSms; - - // problème avec le https - $url = "http://gateway.esicia.com/sendsms/?"; - - $postFields = array - ( - 'ohereza' =>$titreSms_c, - 'kuri' =>$destinataires_c, - 'ubutumwa' =>$message_c, - - // 'client' =>'radiant', - // 'password' =>'umugozi', - - 'client' =>$loginSms, - 'password' =>$motPassSms, - 'msgid' =>'kanesin' - ); - - $post = http_build_query($postFields); - - $url .= $post; - - $result = file_get_contents($url); - - $this->marquersms($this->idSms, "1"); - - // A SUPPRIMER - // var_dump($result); - } - - public function envoyersmshooza($destinataires_c, $message_c, $titreSms_c) - { - $loginSms = $this->loginSms; - $motPassSms = $this->motPassSms; - - // $message_c .= " => ".$loginSms; - - $url = "http://rslr.connectbind.com/bulksms/bulksms"; - - $get = array - ( - // 'username' =>'HoAj-radiant', - // 'password' =>'radiant', - - 'username' =>$loginSms, - 'password' =>$motPassSms, - 'type' =>'0', - 'dlr' =>'1', - 'destination' =>$destinataires_c, - 'source' =>$titreSms_c, - 'message' =>$message_c - ); - - $defaults = array( - CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), - // CURLOPT_URL => $url, - CURLOPT_HEADER => 0, - CURLOPT_RETURNTRANSFER => TRUE, - CURLOPT_TIMEOUT => 10 - ); - - $ch = curl_init(); - - curl_setopt_array($ch, ($defaults)); - if( ! $result = curl_exec($ch)) - { - trigger_error(curl_error($ch)); - } - - curl_close($ch); - - $this->marquersms($this->idSms, "1"); - - // A SUPPRIMER - // var_dump($result); - } - - public function envoyersmsskysms($destinataires_c, $message_c, $titreSms_c) - { - $loginSms = $this->loginSms; - $motPassSms = $this->motPassSms; - - // $message_c .= " => SKYSMS"; - - $url = "http://137.74.43.214:9000/api/public/sendsms/v2/output=text?"; - - $postFields = array - ( - 'user' => $loginSms, - 'password' => $motPassSms, - 'sender' => $titreSms_c, - 'phone' => $destinataires_c, - 'message' => $message_c - ); - - $post = http_build_query($postFields); - - $url .= $post; - - $result = file_get_contents($url); - - $this->marquersms($this->idSms, "1"); - - // A SUPPRIMER - // var_dump($result); - } - - -} // FIN CLASSE - -// envoi des SMS - -$envoismsdivers = new Cronenvoisms(); - -$envoismsdivers->chargersociete(); - -$nbSms = $envoismsdivers->nbSmsParCron; - -$envoismsdivers->charger_les_sms($nbSms); - -// echo "charger_les_sms"; -// exit(); - -$envoismsdivers->envoyer_les_sms();