Esempio n. 1
0
function day($year, $month, $day)
{
    global $calendar;
    $all_tasks = $calendar->getData($day);
    if (!$all_tasks) {
        return;
    }
    $tasks = $all_tasks[0];
    print "<a href='day.php?day={$year}-{$month}-{$day}'>" . $tasks['total_items'] . " items</a><br />";
    list($hour, $min) = seconds2hourmin($tasks['time_tracked']);
    print "{$hour} hours, {$min} minutes tracked";
}
Esempio n. 2
0
function getTimeDifference($from, $to, $return_type = 'hour_min')
{
    // The argument can be a timestamp or a mysql date string - both are parsed correctly
    if (!is_numeric($from)) {
        $from = strtotime($from);
    }
    if (!is_numeric($to)) {
        $to = strtotime($to);
    }
    if (!$to) {
        $to = time();
    }
    // If $to is 0, that means its an ongoing task - so give it current time.
    $diff = $to - $from;
    if ($return_type != 'hour_min') {
        return $diff;
    }
    return seconds2hourmin($diff);
}
Esempio n. 3
0
&amp;task=<?php 
    echo $QUERY['task'];
    ?>
" class="with-icon delete confirm">Delete</a></td></tr>

<?php 
}
?>
</table>

<?php 
printPager();
?>

<strong>Total Time</strong>: <?php 
echo seconds2hourmin($total_time, 'string');
?>


<?php 
if (i($QUERY, 'action') != 'show_form') {
    ?>
<h2 class="with-icon edit"><a href="#" id="edit-task-link">Edit Task?</a></h2>

<div id="edit-task-form">
<?php 
} else {
    ?>
<h2>Edit Task</h2>

<div>