diff --git a/controller/smscontroller.php b/controller/smscontroller.php index 9153a34..26bd71a 100644 --- a/controller/smscontroller.php +++ b/controller/smscontroller.php @@ -38,7 +38,6 @@ class SmsController extends Controller { * @NoAdminRequired */ public function push($json_datas) { - var_dump($json_datas); return array("test" => "test2"); } diff --git a/js/script.js b/js/script.js index 800a00e..ea88c23 100644 --- a/js/script.js +++ b/js/script.js @@ -11,21 +11,21 @@ (function ($, OC) { $(document).ready(function () { - $('#hello').click(function () { - alert('Hello from your script file'); - }); - $('#echo').click(function () { - var url = OC.generateUrl('/apps/ocsms/echo'); + var url = OC.generateUrl('/apps/ocsms/push'); var data = { - echo: $('#echo-content').val() + sms_count: 1 + sms_datas: { + {"read": 1, "date": 1410524385, "seen": 0, "address": "+33612121212", "body": "testSMS", "_id": 10}, + {"read": 0, "date": 1400524385, "seen": 1, "address": "+33614121212", "body": "test SMS 2", "_id": 14}, + } }; $.post(url, data).success(function (response) { - $('#echo-result').text(response.echo); + $('#push-result').text(response); }); - + }); }); -})(jQuery, OC); \ No newline at end of file +})(jQuery, OC); diff --git a/templates/part.content.php b/templates/part.content.php index 031cdbe..35b0fc7 100644 --- a/templates/part.content.php +++ b/templates/part.content.php @@ -1,10 +1,5 @@

Hello World

-

- -

Push response: