if ($tasksrow['is_private'] === "1") {
                     echo "<span class=\"glyphicon glyphicon-lock\" aria-hidden=\"true\"></span>";
                 }
                 echo "</td>";
                 echo "<td>" . Datum($tasksrow['startdate']) . "</td>";
                 echo "<td>" . Datum($tasksrow['enddate']) . "</td>";
                 echo "<td>" . Datum($tasksrow['recuruntil']) . "</td>";
                 echo "</tr>";
                 echo "<tr><td colspan=6>";
                 RenderChilds($tasksrow['taskid']);
                 echo "</td></tr>";
             } else {
                 echo "<td><a href=\"viewtask.php?id=" . $tasksrow['taskid'] . "\">" . $tasksrow['taskname'] . "</a>";
                 echo "</td>";
                 echo "<td><a href=\"viewproject.php?id=" . $tasksrow['projectid'] . "\">" . getProjectInfoByID($tasksrow['projectid'], 'projectname') . "</a></td>";
                 echo "<td>" . getTaskStatus($tasksrow['taskid'], $tasksrow['taskstatus']);
                 if ($tasksrow['is_recurring'] === "1") {
                     echo "<img title=\"Wiederholende Aufgabe\" style=\"width:21px; margin-left: 5px;\" src=\"img/recur-small.png\">";
                 }
                 if ($tasksrow['is_private'] === "1") {
                     echo "<span class=\"glyphicon glyphicon-lock\" aria-hidden=\"true\"></span>";
                 }
                 echo "</td>";
                 echo "<td>" . Datum($tasksrow['startdate']) . "</td>";
                 echo "<td>" . Datum($tasksrow['enddate']) . "</td>";
                 echo "<td>" . Datum($tasksrow['recuruntil']) . "</td>";
                 echo "</tr>";
             }
         }
     }
 }
$numrows = mysqli_num_rows($result);
while ($row = mysqli_fetch_array($result)) {
    $week = (int) date('W', strtotime($row['timestamp']));
    $time = date('G:i', strtotime($row['timestamp']));
    $day = strftime("%A", strtotime($row['timestamp']));
    if ($calweek == $week) {
        echo "<p><a href=\"viewtask.php?id=" . $row['taskid'] . "\">" . getTaskInfobyID($row['taskid'], 'taskname') . "</a> wurde am <span style=\"text-decoration: underline;\">" . $day . "</span> um {$time} von " . getUserFullName($row['userid']) . " auf " . getTaskStatus('', $row['statusid']) . " geändert.<br></p>";
    } else {
        if (!$firstrun) {
            echo "</div>";
        }
        $firstrun = FALSE;
        $calweek = $week;
        echo "<div class=\"well\">";
        echo "<div class=\"calweek\">{$calweek}. Kalenderwoche</div>";
        echo "<p><a href=\"viewtask.php?id=" . $row['taskid'] . "\">" . getTaskInfobyID($row['taskid'], 'taskname') . "</a> wurde am <span style=\"text-decoration: underline;\">" . $day . "</span> um {$time} von " . getUserFullName($row['userid']) . " auf " . getTaskStatus('', $row['statusid']) . " geändert.<br></p>";
    }
}
if ($numrows != 0) {
    echo "</div>";
}
?>
        </div>
        
        <div class="tab-pane" id="userinfo">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><?php 
echo $message['userdetails'];
?>
</h3>
$firstrun = TRUE;
while ($row = mysqli_fetch_array($result)) {
    $week = (int) date('W', strtotime($row['timestamp']));
    $time = date('G:i', strtotime($row['timestamp']));
    $day = strftime("%A", strtotime($row['timestamp']));
    if ($calweek == $week) {
        echo "<p>Wurde am <span style=\"text-decoration: underline;\">" . $day . "</span> um {$time} von <a href=\"viewuser.php?id=" . $row['userid'] . "\">" . getUserFullName($row['userid']) . "</a> auf " . getTaskStatus('', $row['statusid']) . " geändert.<br></p>";
    } else {
        if (!$firstrun) {
            echo "</div>";
        }
        $firstrun = FALSE;
        $calweek = $week;
        echo "<div class=\"well\">";
        echo "<div class=\"calweek\">{$calweek}. Kalenderwoche</div>";
        echo "<p>Wurde am <span style=\"text-decoration: underline;\">" . $day . "</span> um {$time} von <a href=\"viewuser.php?id=" . $row['userid'] . "\">" . getUserFullName($row['userid']) . "</a> auf " . getTaskStatus('', $row['statusid']) . " geändert.<br></p>";
    }
}
?>
        </div>
    </div>
</div>

<div id="delete" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <!-- Modal content-->
        <div class="modal-content">
            <form method="POST">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title"><?php 
/**
 * Gibt alle Childs für eine Aufgabe aus.
 * @param int $id
 */
function RenderChilds($id)
{
    require 'config.php';
    $sql = "SELECT * FROM tasks WHERE parent = " . $id;
    $result = mysqli_query($con, $sql);
    echo "<ul>";
    while ($row = mysqli_fetch_array($result)) {
        echo "<li>";
        echo "<a href=\"viewtask.php?id=" . $row['taskid'] . "\">" . $row['taskname'] . "</a> " . getTaskStatus($row['taskid'], $row['taskstatus']) . " — <a href=\"viewuser.php?id=" . $row['userid'] . "\">" . getUserFullName($row['userid']) . "</a> — " . Datum($row['startdate']) . " - " . Datum($row['enddate']);
        echo "</li>";
        if (TaskHasChilds($row['taskid'])) {
            RenderChilds($row['taskid']);
        }
    }
    echo "</ul>";
}
    if (TaskHasChilds($row['taskid'])) {
        echo "<td><a class=\"bold\" href=\"viewtask.php?id=" . $row['taskid'] . "\">" . $row['taskname'] . "</a>";
        echo "</td>";
        echo "<td>" . getUserFullName($row['userid']) . "</td>";
        echo "<td>" . getTaskStatus($row['taskid'], $row['taskstatus']) . "</td>";
        echo "<td>" . Datum($row['startdate']) . "</td>";
        echo "<td>" . Datum($row['enddate']) . "</td>";
        echo "</tr>";
        echo "<tr><td colspan=5>";
        RenderChilds($row['taskid']);
        echo "</td></tr>";
    } else {
        echo "<td><a href=\"viewtask.php?id=" . $row['taskid'] . "\">" . $row['taskname'] . "</a>";
        echo "</td>";
        echo "<td>" . getUserFullName($row['userid']) . "</td>";
        echo "<td>" . getTaskStatus($row['taskid'], $row['taskstatus']) . "</td>";
        echo "<td>" . Datum($row['startdate']) . "</td>";
        echo "<td>" . Datum($row['enddate']) . "</td>";
        echo "</tr>";
    }
}
?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading"><?php 
echo $message['calendar'];
?>
</div>