<?php

require_once '../header-second-level.php';
require_once '../models/task.class.php';
require_once '../models/tasklist.class.php';
require_once '../db/TaskMapper.php';
// Connecting to the database
$mapper = new TaskMapper();
// Getting an overall task list
$tasks = $mapper->retrieveTasks();
?>

        <div class="list-page row">
            <?php 
require_once '../sidebar-second-level.php';
?>
            
            <div class="list-page-content large-8 small-12 columns">
                <h3 class="list-page-header"><i class="icon-signup"></i> Code, Manage, Go! Overall To-Do</h3>
                
                <?php 
$i = 1;
foreach ($tasks as $task) {
    echo '<div class="checklist">';
    echo '   <input type="checkbox" id="checkbox' . $i . '">';
    echo '   <label for="checkbox' . $i . '">' . $task->__get(tsk_name) . '</label>';
    echo '</div>';
    $i++;
    // increment
}
?>
Exemple #2
0
@(include './conf.php');
if (empty($conf)) {
    die('No configuration found.');
}
require_once 'Horde/Autoloader.php';
/**
 */
class Task extends Horde_Rdo_Base
{
}
/**
 */
class TaskMapper extends Horde_Rdo_Mapper
{
    protected $_table = 'nag_tasks';
}
$tm = new TaskMapper($conf['adapter']);
// Count all tasks.
$count = $tm->count();
echo "# tasks: {$count}\n";
// List all tasks.
echo "Looking for all tasks:\n";
foreach ($tm->find(Horde_Rdo::FIND_ALL) as $task) {
    echo "  " . $task->task_name . "\n";
}
// List all of Chuck's tasks.
$chuck = $tm->find(Horde_Rdo::FIND_ALL, array('task_owner' => 'chuck'));
echo "\nChuck's tasks:\n";
foreach ($chuck as $task) {
    echo "  " . $task->task_name . "\n";
}