From 8760de2115c322cf49906a2e24e8228f5d0763c5 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 14 Apr 2010 14:29:15 +0300 Subject: More fixes --- public/day.php | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'public/day.php') diff --git a/public/day.php b/public/day.php index 9dd5377..137535e 100644 --- a/public/day.php +++ b/public/day.php @@ -5,17 +5,16 @@ require_once '../system/init.php'; - $tmp = explode('.', $_POST['d']); - $date = sprintf('%d-%02d-%02d', $tmp[2], $tmp[1], $tmp[0]); + $date = $_POST['d']; // Find this day $sql = "SELECT * FROM atwork WHERE user = ? - AND date(?) BETWEEN date(start) AND date(finish);"; + AND date(?) BETWEEN date(start) AND date(finish)"; $stmt = $db->prepare($sql); $stmt->execute(array($_SESSION['user'], $date)); - $day = $stmt->fetchAll(); + $day = $stmt->fetchAll(PDO::FETCH_ASSOC); $day = array_pad($day, 5, array()); - + ?>
@@ -33,6 +32,7 @@ foreach(range(0, 4) as $r): + // These are typically empty $start = @date_parse($day[$r]['start']); $finish = @date_parse($day[$r]['finish']); @@ -41,7 +41,7 @@ - + - + -- cgit v1.2.3