hella shit again
14
include/controllers/default/crunchbutton/api/user/index.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
class Controller_api_resturant extends Crunchbutton_Controller_Rest {
|
||||
public function init() {
|
||||
switch ($this->method()) {
|
||||
case 'get':
|
||||
$r = new Resturant(c::getPagePiece(1));
|
||||
print_r($r);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Controller_api_v1_delivery extends Crunchbutton_Controller_Rest {
|
||||
public function init() {
|
||||
$delivery = Delivery::o(c::getPagePiece(3));
|
||||
|
||||
switch (c::getPagePiece(4)) {
|
||||
case 'files':
|
||||
echo $delivery->files()->json();
|
||||
break;
|
||||
default:
|
||||
echo $delivery->json();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Controller_api_v1_file extends Crunchbutton_Controller_Rest {
|
||||
public function init() {
|
||||
switch ($this->method()) {
|
||||
case 'delete':
|
||||
$file = Crunchbutton_File::o(c::getPagePiece(3));
|
||||
if (!$file->id_file) {
|
||||
echo json_encode(['error' => 'invalid resource']);
|
||||
exit;
|
||||
}
|
||||
$file->active = 1;
|
||||
$file->save();
|
||||
|
||||
break;
|
||||
|
||||
case 'get':
|
||||
$file = Crunchbutton_File::o(c::getPagePiece(3));
|
||||
if (!$file->id_file) {
|
||||
echo json_encode(['error' => 'invalid resource']);
|
||||
exit;
|
||||
}
|
||||
switch (c::getPagePiece(4)) {
|
||||
case 'notes':
|
||||
echo $file->notes()->json();
|
||||
break;
|
||||
default:
|
||||
echo $file->json();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'post':
|
||||
$file = new Crunchbutton_File;
|
||||
$file->serialize($this->request());
|
||||
$file->save();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Controller_api_v1_home extends Crunchbutton_Controller_Rest {
|
||||
public function init() {
|
||||
echo c::app()->user()->watched()->json();
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Controller_api_v1 extends Crunchbutton_Controller_Rest {
|
||||
public function init() {
|
||||
echo json_encode(['error' => 'invalid request']);
|
||||
}
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Controller_api_v1_project extends Crunchbutton_Controller_Rest {
|
||||
public function init() {
|
||||
$project = Project::o(c::getPagePiece(3));
|
||||
|
||||
switch (c::getPagePiece(4)) {
|
||||
case 'deliveries':
|
||||
echo $project->deliveries()->json();
|
||||
break;
|
||||
default:
|
||||
echo $project->json();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Controller_api_v1_server extends Crunchbutton_Controller_Rest {
|
||||
public function init() {
|
||||
switch ($this->method()) {
|
||||
case 'get':
|
||||
$server = Server::o(c::getPagePiece(3));
|
||||
if (!$server->id_server) {
|
||||
echo json_encode(['error' => 'invalid resource']);
|
||||
exit;
|
||||
}
|
||||
echo $server->json();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Controller_api_v1_user extends Crunchbutton_Controller_Rest {
|
||||
public function init() {
|
||||
switch ($this->method()) {
|
||||
case 'get':
|
||||
$user = User::o(c::getPagePiece(3));
|
||||
if (!$user->id_user) {
|
||||
echo json_encode(['error' => 'invalid resource']);
|
||||
exit;
|
||||
}
|
||||
echo $user->json();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
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');
|
||||
}
|
||||
}
|
||||
11
include/library/Crunchbutton/Community.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class Crunchbutton_Community extends Cana_Table {
|
||||
public function __construct($id = null) {
|
||||
parent::__construct();
|
||||
$this
|
||||
->table('community')
|
||||
->idVar('id_community')
|
||||
->load($id);
|
||||
}
|
||||
}
|
||||
11
include/library/Crunchbutton/Restaurant.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class Crunchbutton_Restaurant extends Cana_Table {
|
||||
public function __construct($id = null) {
|
||||
parent::__construct();
|
||||
$this
|
||||
->table('restaurant')
|
||||
->idVar('id_restaurant')
|
||||
->load($id);
|
||||
}
|
||||
}
|
||||
11
include/library/Crunchbutton/Restaurant/Communty.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class Crunchbutton_Community extends Cana_Table {
|
||||
public function __construct($id = null) {
|
||||
parent::__construct();
|
||||
$this
|
||||
->table('restaurant_community')
|
||||
->idVar('id_restaurant_community')
|
||||
->load($id);
|
||||
}
|
||||
}
|
||||
@ -19,12 +19,12 @@
|
||||
|
||||
<div class="content-padder">
|
||||
<div class="meal-items">
|
||||
<? for ($x=1;$x<=$count;$x++) : ?>
|
||||
<? foreach ($this->restaurants as $restaurant) : ?>
|
||||
<div class="meal-item">
|
||||
<div class="meal-pic" style="background: url(/assets/images/food/wenzel.png);"></div>
|
||||
<h2 class="meal-restaurant">Alpha Delta Pizza</h2>
|
||||
<div class="meal-pic" style="background: url(/assets/images/food/<?=$restaurant->image?>);"></div>
|
||||
<h2 class="meal-restaurant"><?=$restaurant->name?></h2>
|
||||
<h3 class="meal-food">Top Item: Wenzel Sandwich</h3>
|
||||
</div>
|
||||
<? endfor; ?>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -286,4 +286,7 @@ and (min-width : 1224px) {
|
||||
.footer {
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
.meal-pic {
|
||||
background-position: center 40% !important;
|
||||
}
|
||||
}
|
||||
|
||||
BIN
www/assets/images/food/baconeggcheese-gheav.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
www/assets/images/food/bleubuffalo-littlesaladshop.png
Normal file
|
After Width: | Height: | Size: 101 KiB |
BIN
www/assets/images/food/brickovenpizza.png
Normal file
|
After Width: | Height: | Size: 148 KiB |
BIN
www/assets/images/food/buffalochicken.png
Normal file
|
After Width: | Height: | Size: 136 KiB |
BIN
www/assets/images/food/buffalochickengrinder-a1.png
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
www/assets/images/food/buffalochickengrinder.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
www/assets/images/food/buffalochickentenders-yorkside.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
www/assets/images/food/cheesefries-ad.png
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
www/assets/images/food/cheesesteak-goldenrock.png
Normal file
|
After Width: | Height: | Size: 125 KiB |
BIN
www/assets/images/food/cheesesteak-jayscheesesteak.png
Normal file
|
After Width: | Height: | Size: 123 KiB |
BIN
www/assets/images/food/condoms-ad.png
Normal file
|
After Width: | Height: | Size: 101 KiB |
BIN
www/assets/images/food/creditcards.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
www/assets/images/food/logo.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
www/assets/images/food/padthai.png
Normal file
|
After Width: | Height: | Size: 154 KiB |
BIN
www/assets/images/food/secure.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
www/assets/images/food/smithy-ad.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
www/assets/images/food/tikka-zaroka.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
www/assets/images/food/tikka-zaroka2.png
Normal file
|
After Width: | Height: | Size: 114 KiB |
BIN
www/assets/images/food/tsos-chinaking.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
www/assets/images/food/tsos-chinaking2.png
Normal file
|
After Width: | Height: | Size: 127 KiB |
BIN
www/assets/images/food/web/closed.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |