diff --git a/include/controllers/default/crunchbutton/api/login/index.php b/include/controllers/default/crunchbutton/api/login/index.php index 779d9e206..90d4fdc47 100644 --- a/include/controllers/default/crunchbutton/api/login/index.php +++ b/include/controllers/default/crunchbutton/api/login/index.php @@ -3,7 +3,6 @@ class Controller_api_v1_login extends Crunchbutton_Controller_Rest { public function init() { switch ($this->method()) { - case 'get': $user = Crunchbutton_User::o(c::getPagePiece(2)); if (!$file->id_file) { diff --git a/include/controllers/default/crunchbutton/api/note/index.php b/include/controllers/default/crunchbutton/api/note/index.php deleted file mode 100644 index 8e2bc2f98..000000000 --- a/include/controllers/default/crunchbutton/api/note/index.php +++ /dev/null @@ -1,22 +0,0 @@ -method()) { - case 'get': - $note = Note::o(c::getPagePiece(3)); - if (!$note->id_note) { - echo json_encode(['error' => 'invalid resource']); - exit; - } - echo $note->json(); - break; - - case 'post': - $note = new Note; - $note->serialize($this->request()); - $note->save(); - break; - } - } -} \ No newline at end of file diff --git a/include/controllers/default/crunchbutton/api/order/index.php b/include/controllers/default/crunchbutton/api/order/index.php new file mode 100644 index 000000000..ed57c2eab --- /dev/null +++ b/include/controllers/default/crunchbutton/api/order/index.php @@ -0,0 +1,23 @@ +method()) { + case 'get': + $order = Order::o(c::getPagePiece(2)); + if ($order->id_order) { + echo $order->json(); + } else { + echo json_encode(['error' => 'invalid object']); + } + break; + + case 'post': + $order = new Order; + $order->serialize($this->request()); + $order->save(); + $order->notify(); + break; + } + } +} \ No newline at end of file diff --git a/include/controllers/default/crunchbutton/home/index.php b/include/controllers/default/crunchbutton/home/index.php index 72bff303d..a7b75f58c 100644 --- a/include/controllers/default/crunchbutton/home/index.php +++ b/include/controllers/default/crunchbutton/home/index.php @@ -2,8 +2,6 @@ class Controller_home extends Cana_Controller { public function init() { - $r = Restaurant::q('select * from restaurant where active=1'); - Cana::view()->restaurants = $r; Cana::view()->display('home/index'); } } \ No newline at end of file diff --git a/include/library/Crunchbutton/Phaxio.php b/include/library/Crunchbutton/Phaxio.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/include/library/Crunchbutton/Stripe.php b/include/library/Crunchbutton/Stripe.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/include/library/Crunchbutton/Twilio.php b/include/library/Crunchbutton/Twilio.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/include/views/default/crunchbutton/restaurant/index.phtml b/include/views/default/crunchbutton/restaurant/index.phtml index 85b8a0577..6e4a6eb2b 100644 --- a/include/views/default/crunchbutton/restaurant/index.phtml +++ b/include/views/default/crunchbutton/restaurant/index.phtml @@ -43,12 +43,41 @@