Example #1
0
				<th><?php 
    echo __('Since');
    ?>
</th>
			</tr>
		</thead>
		<tbody>
			<?php 
    foreach ($clients as $client) {
        ?>
				<tr class="odf_href" data-href="clients/edit?id=<?php 
        echo $client->id;
        ?>
">
					<td><?php 
        echo $client->user->getName();
        ?>
</td>
					<td><?php 
        echo $client->created;
        ?>
</td>
				</tr>
				<?php 
    }
    ?>
		</tbody>
	</table>
	<?php 
}, [], 'clients', getDefaultUniqueCacheData());
$Template->output('footer');
Example #2
0
<?php

/*
Create custom events for the All Seeing Eye (ASE) class here.
*/
$Ase->see('route_found', function ($route) {
    if (!empty($route['action']) && $route['action'] === 'admin' && getUserRank() !== 'admin') {
        setRedirect(get('website_url') . 'error/403');
        exit;
    }
});
$Ase->see('cache_update', function (\Odf\Cache $Cache, $event_name = null, $extra_data = array()) {
    switch ($event_name) {
        case 'scheme_parts':
            $Cache->clear('scheme_parts', getDefaultUniqueCacheData($extra_data));
            $Cache->clear('schemes', getDefaultUniqueCacheData($extra_data));
            break;
        case 'food':
            $Cache->clear('food', getDefaultUniqueCacheData($extra_data));
            $Cache->clear('scheme_parts', getDefaultUniqueCacheData($extra_data));
            $Cache->clear('schemes', getDefaultUniqueCacheData($extra_data));
            break;
        case 'clients':
            break;
        case 'client_requests':
    }
}, array($Cache));
Example #3
0
<?php

$page_title = __('Food');
$Crumbs->setRoot($page_title);
$Template->output('header', ['title' => $page_title, 'nav_active' => 'food']);
$Template->output('page_controls', [['text' => __('New'), 'url' => 'food/new']]);
$Cache->cacheOutput(function ($data) {
    extract($data);
    $foods_table = new Tables\Foods();
    $foods = $foods_table->by('user_id', getUser()->id)->setOrderby('name ASC')->get();
    $Template->output('tables/foods_overview', ['foods' => $foods, 'parent' => 'food_overview']);
}, compact('Template'), 'food', getDefaultUniqueCacheData());
$Template->output('footer');
Example #4
0
</span>
					</td>
					<td class="proteins_count count">
						<span class="bold"><?php 
        echo $proteins['amount'];
        ?>
</span>
						<span class="percentage"><?php 
        echo '(' . $proteins['percentage'] . '%)';
        ?>
</span>
					</td>
					<td class="fats_count count">
						<span class="bold"><?php 
        echo $fats['amount'];
        ?>
</span>
						<span class="percentage"><?php 
        echo '(' . $fats['percentage'] . '%)';
        ?>
</span>
					</td>
				</tr>
				<?php 
    }
    ?>
		</tbody>
	</table>
	<?php 
}, compact('Template'), 'scheme_parts', getDefaultUniqueCacheData());
$Template->output('footer');