PHP Classes

File: fwphp/glomodul/z_examples/todo_csv_js/todolist/list.phtml

Recommend this page to a friend!
  Classes of Slavko Srakocic   B12 PHP FW   fwphp/glomodul/z_examples/todo_csv_js/todolist/list.phtml   Download  
File: fwphp/glomodul/z_examples/todo_csv_js/todolist/list.phtml
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change: Update of fwphp/glomodul/z_examples/todo_csv_js/todolist/list.phtml
Date: 1 year ago
Size: 1,825 bytes


Class file image Download

namespace TodoList;

use \
use \
use \

//~ Template for list.php
// variables:
// $title - page title
// $status - status of TODOs to be displayed
// $todos - TODOs to be displayed


    <?php echo Utils::iconStatus($status); ?>
<?php echo $title; ?>

<?php if (empty($todos)): ?>
<p>No TODO items found.</p>
<?php else: ?>
<ul class="list">
        <?php foreach ($todos as $todo): ?>
<?php /* @var $todo Todo */ ?>
<?php $tooLate = $status == Todo::STATUS_PENDING
&& $todo->getDueOn() < new DateTime(); ?>
                    <a href="<?php echo Utils::createLink('detail', ['id' => $todo->getId()]) ?>"><?php echo Utils::escape($todo->getTitle()); ?></a>
                    <?php echo Utils::iconPriority($todo->getPriority()); ?>
<?php if ($tooLate): ?>
<i class="material-icons error" title="Should be already done!">error</i>
                    <?php endif; ?>
<span class="label">Created On:</span> <?php echo Utils::escape(Utils::formatDateTime($todo->getCreatedOn())); ?>
                <p><span class="label">Due On:</span>
                    <?php if ($tooLate): ?><span class="too-late"><?php endif; ?>
<?php echo Utils::escape(Utils::formatDateTime($todo->getDueOn())); ?>
<?php if ($tooLate): ?></span><?php endif; ?>
<?php if ($todo->getDescription()): ?>
<span class="description"><?php echo Utils::escape($todo->getDescription()); ?></span>
                <?php endif; ?>
        <?php endforeach; ?>
<?php endif; ?>