PHP Classes

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

Recommend this page to a friend!
  Classes of Slavko Srakocic   B12 PHP FW   fwphp/glomodul/z_examples/todo_csv_js/todolist/detail.phtml   Download  
File: fwphp/glomodul/z_examples/todo_csv_js/todolist/detail.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/detail.phtml
Date: 1 year ago
Size: 3,580 bytes


Class file image Download

namespace TodoList;

use \
use \

//~ Template for detail.php
// variables:
// $todo - TODO to be displayed
// $tooLate - if the task should have been done already

/* @var $todo Todo */

    <?php if ($tooLate): ?>
<i class="material-icons error" title="Should be already done!">error</i>
    <?php endif; ?>
<?php echo Utils::escape($todo->getTitle()); ?>

<table class="detail">
        <td><?php echo Utils::iconPriority($todo->getPriority()); ?></td>
        <th>Created On</th>
        <td><?php echo Utils::escape(Utils::formatDateTime($todo->getCreatedOn())); ?></td>
        <th>Due On</th>
            <?php if ($tooLate): ?><span class="too-late"><?php endif; ?>
<?php echo Utils::escape(Utils::formatDateTime($todo->getDueOn())); ?>
<?php if ($tooLate): ?></span><?php endif; ?>
        <th>Last Modified On</th>
        <td><?php echo Utils::escape(Utils::formatDateTime($todo->getLastModifiedOn())); ?></td>
        <td><?php echo Utils::escape($todo->getDescription()); ?></td>
        <td><?php echo Utils::escape($todo->getComment()); ?></td>
        <td><?php echo Utils::iconStatus($todo->getStatus()); ?></td>
        <td colspan="2">&nbsp;</td>
            <div class="statuses">
            <?php foreach (Todo::allStatuses() as $status): ?>
<?php if ($status != $todo->getStatus()): ?>
<a href="<?php echo Utils::createLink('change-status', ['id' => $todo->getId(), 'status' => $status]); ?>" title="Change TODO status to <?php echo Utils::capitalize($status); ?>."
                       class="change-status-link" title="Make it <?php echo Utils::capitalize($status); ?>"
                       ><?php echo Utils::iconStatus($status, false, false); ?></a>
                <?php else: ?>
<span title="This TODO is already <?php echo Utils::capitalize($status); ?>.">
                        <?php echo Utils::iconStatus($status, true, false); ?>
                <?php endif; ?>
<?php endforeach; ?>
            <div class="actions">
                <a href="<?php echo Utils::createLink('add-edit', ['id' => $todo->getId()]); ?>" title="Edit it."><i class="material-icons multi">edit</i></a>
                <a href="<?php echo Utils::createLink('delete', ['id' => $todo->getId()]); ?>" id="delete-link" title="Delete it."><i class="material-icons multi">delete</i></a>

    <a href="<?php echo Utils::createLink('list', ['status' => $todo->getStatus()]); ?>" title="Back to the list."
       ><i class="material-icons">fast_rewind</i>To the list</a>

<div id="delete-dialog" title="Delete this TODO?">
    <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>This TODO will be deleted. Are you sure?</p>
<div id="change-status-dialog">
    <form id="change-status-form" method="post">
            <div class="field">
                <textarea name="comment" cols="1" rows="1"></textarea>