added hours tester
This commit is contained in:
parent
e8a06051ba
commit
614d78e984
@ -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 {
|
||||
|
||||
22
include/controllers/default/cockpit/tests/hours/index.php
Normal file
22
include/controllers/default/cockpit/tests/hours/index.php
Normal 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');
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user