added hours tester

This commit is contained in:
arzynik 2013-10-14 13:42:53 -07:00
parent e8a06051ba
commit 614d78e984
2 changed files with 34 additions and 12 deletions

View File

@ -2,22 +2,22 @@
class Controller_test extends Crunchbutton_Controller_Account {
public function init() {
$id = 'CC7kIW3yIIOJfFJl5fvDy8hG';
c::balanced();
$r = new Restaurant(21);
echo c::balanced()->cards->uri.'/'.$id;
$time = '2013-10-13 00:12:00';
//$time = new DateTime($time, new DateTimeZone($r->timezone));
//echo $time->format('Y-m-d H:i:s');
if ($r->open($time)) {
echo 'open';
} else {
echo 'closed';
}
exit;
$card = Crunchbutton_Balanced_Card::byId($id);
echo $card->uri;
exit;
die(c::balanced()->uri);
if (c::admin()->permission()->check(['test','testsss'])) {
echo 'true';
} else {

View File

@ -0,0 +1,22 @@
<?php
class Controller_tests_hours extends Crunchbutton_Controller_Account {
public function init() {
$restaurant = new Restaurant($_REQUEST['r'] ? intval($_REQUEST['r']) : 1);
$now = (new DateTime('now'))->format('Y-m-d H:i:s');
if (!$_REQUEST['t'] || $_REQUEST['t'] == 'NOW') {
$time = $now;
c::view()->now = true;
} else {
$time = $_REQUEST['t'];
}
c::view()->restaurant = $restaurant;
c::view()->open = $restaurant->open($time);
c::view()->time = new DateTime($time, new DateTimeZone($restaurant->timezone));
c::view()->display('tests/hours/index');
}
}