Ejemplo n.º 1
0
<?php

require_once __DIR__ . '/../vendor/autoload.php';
$lastReadFile = __DIR__ . '/../../adminAndMobile/app/model/lastRead.txt';
while (true) {
    $lastRead = new \Carbon\Carbon(file_get_contents($lastReadFile));
    if ($lastRead->lt(\Carbon\Carbon::now()->subMinutes(30))) {
        shell_exec('systemctl restart jukebox-bitcoinreader');
    }
    sleep(10);
}
Ejemplo n.º 2
0
 public static function compareDate($report1, $report2)
 {
     $timeA = new Carbon\Carbon($report1->updated_at);
     $timeB = new Carbon\Carbon($report2->updated_at);
     return $timeA->lt($timeB);
 }
Ejemplo n.º 3
0
$href = "";
$name = "";
// If there is no slot user, display a link to the take shift page
if (is_null($slot->user)) {
    $href = "/slot/{$slot->id}/take";
} else {
    $class = "slot taken";
    $name = $slot->user->name;
    // If the slot is taken by the current user, display a link to the release page
    if ($slot->user->id === Auth::user()->id) {
        $href = "/slot/{$slot->id}/release";
    }
    // If the user has profile data saved, and has a burner name
    if (!is_null($slot->user->data) && !is_null($slot->user->data->burner_name)) {
        $name = $slot->user->data->burner_name;
    }
}
if ($href) {
    $href = "href='{$href}'";
}
// If the event has passed, remove any links
$start_date = new \Carbon\Carbon($slot->start_date);
if ($start_date->lt(\Carbon\Carbon::now())) {
    $href = "";
}
?>

<span class="slot-wrap" data-start="{{ $slot->start_time }}" data-duration="{{ $shift->duration }}">
    <a {!! $href !!} class="{{ $class }}" data-id="{{ $slot->id }}" title="{{ $name }}">{{ $name }}</a>
</span>