hella shit again

This commit is contained in:
arzynik 2012-06-25 21:18:23 -07:00
parent bb49265a8e
commit a2652dfb96
37 changed files with 56 additions and 124 deletions

View 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;
}
}
}

View File

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

View File

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

View File

@ -1,7 +0,0 @@
<?php
class Controller_api_v1_home extends Crunchbutton_Controller_Rest {
public function init() {
echo c::app()->user()->watched()->json();
}
}

View File

@ -1,7 +0,0 @@
<?php
class Controller_api_v1 extends Crunchbutton_Controller_Rest {
public function init() {
echo json_encode(['error' => 'invalid request']);
}
}

View File

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

View File

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

View File

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

View File

@ -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');
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View File

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

View File

@ -286,4 +286,7 @@ and (min-width : 1224px) {
.footer {
margin-bottom: 35px;
}
.meal-pic {
background-position: center 40% !important;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB