prepare($sql); // Get total hours for each day $sql = "SELECT strftime('%s', finish) - strftime('%s', start) AS done FROM atwork WHERE user = ? AND date(finish) = ?"; $stmt = $db->prepare($sql); if (!$_POST['m']) { $_SESSION['m'] = date('n'); } $_SESSION['m'] = $_SESSION['m'] + $_POST['m']; $month = sprintf('%02d', $_SESSION['m']); $stmt_tot->execute(array($_SESSION['user'], $month)); $total = current($stmt_tot->fetchAll()); $first = mktime(0, 0, 0, $_SESSION['m'], 0); $last = mktime(0, 0, 0, $_SESSION['m']+1, 0); $days = ($last-$first)/3600/24; ?>

(h)

execute(array($_SESSION['user'], date('Y-m-d', $current))); $tmp = current($stmt->fetchAll()); $work = $tmp['done']/3600; ?>
h