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 @@


-
- +
+ +
+ + +
+ + +
-
- +
+ +
+ + +
+ + +
+ + +
+ +
+ +
+

+ \ No newline at end of file diff --git a/www/assets/css/style.css b/www/assets/css/style.css index d2d1c1b7e..9ce75a06a 100644 --- a/www/assets/css/style.css +++ b/www/assets/css/style.css @@ -332,6 +332,28 @@ b { padding-top: 2px; } +input, textarea { + width: 200px; +} +input, textarea, select { + overflow: auto; + padding: 2px 4px 2px 4px; + font-size: 15px; + border: 1px solid #aaa; + border-radius: 4px; + font-weight: normal; + font-family: Helvetica; + background: #fff; +} + +textarea { + height: 3em; +} + +select { + height: 2.2em; +} + @media only screen and (min-device-width : 320px) diff --git a/www/assets/js/app.js b/www/assets/js/app.js index cec524458..42bb8fff3 100644 --- a/www/assets/js/app.js +++ b/www/assets/js/app.js @@ -74,7 +74,7 @@ App.loadRestaurant = function(id) { }; App.page.community = function(id) { - App.community = App.cache('Community', id, function() { + //App.community = App.cache('Community', id, function() { document.title = 'Crunchbutton - ' + App.community.name; @@ -105,7 +105,7 @@ App.page.community = function(id) { $('.meal-items').append(restaurant); } - }); + //}); }; App.page.restaurant = function(id) { @@ -123,7 +123,7 @@ App.loadPage = function() { break; default: - App.page.community('yale'); + App.page.community(1); break; } }; @@ -178,10 +178,11 @@ App.cart = { $('.cart-total').html(); }, customize: function(item) { - + alert('nope.'); }, submit: function() { console.log(JSON.stringify(App.cart.items)); + alert(JSON.stringify(App.cart.items)); } }; @@ -234,7 +235,7 @@ $(function() { $(this).removeClass('button-submitorder-click'); }); - App.community = App.cache('Community','yale', function() { + App.community = App.cache('Community',1, function() { App.loadPage(); });