diff --git a/.gitattributes b/.gitattributes index b954c18..d5b24a6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ * text=auto !eol +base/sms.php -text classes/octopush/config.inc.php -text classes/octopush/sms.inc.php -text classes/smsfactor/AccuseReceptionSMSClass.php -text @@ -14,4 +15,5 @@ prive/squelettes/contenu/configurer_sms.html -text prive/themes/spip/images/sms-16.png -text svneol=unset#image/png prive/themes/spip/images/sms-24.png -text svneol=unset#image/png prive/themes/spip/images/sms-64.png -text svneol=unset#image/png +/sms_administrations.php -text /sms_fonctions.php -text diff --git a/base/sms.php b/base/sms.php new file mode 100644 index 0000000..3cbfbe6 --- /dev/null +++ b/base/sms.php @@ -0,0 +1,56 @@ + 'sms_log', + 'principale' => 'oui', + 'field'=> array( + 'id_sms_log' => 'bigint(21) NOT NULL', + 'nbr_sms' => 'tinyint(4) NOT NULL', + 'message' => 'text NOT NULL DEFAULT ""', + 'telephone' => 'text NOT NULL DEFAULT ""', + 'type_sms' => 'varchar(255) NOT NULL DEFAULT ""', + 'date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"', + ), + 'key' => array( + 'PRIMARY KEY' => 'id_sms_log', + ), + ); + + return $tables; +} diff --git a/paquet.xml b/paquet.xml index 4e757ae..12d5748 100644 --- a/paquet.xml +++ b/paquet.xml @@ -1,11 +1,12 @@ SMS @@ -13,4 +14,7 @@ GNU/GPL + + + diff --git a/sms_administrations.php b/sms_administrations.php new file mode 100644 index 0000000..3009afc --- /dev/null +++ b/sms_administrations.php @@ -0,0 +1,42 @@ +message == "OK" ) { + if (count($destinataire)) { + $cost = $reponse->cost; + $sent = $reponse->sent; + $nbr_sms = 0; + if ($sent != 0) { + $nbr_sms = $cost / $sent; + } + + $type_sms = ''; + if (array_key_exists('type_sms', $arg)) { + $type_sms = $arg['type_sms']; + } + + foreach ($destinataire as $tel) { + $set = array( + 'telephone' => md5($tel), + 'date' => date("Y-m-d H:i:s"), + 'message' => $message, + 'nbr_sms' => $nbr_sms, + 'type_sms' => $type_sms + ); + sql_insertq('spip_sms_logs',$set); + } + } return true; } else { return false;