Refactoring, reorganized code a bit
[timetracker.git] / WEB-INF / lib / ttTimeHelper.class.php
index f743e61..83f7968 100644 (file)
@@ -167,9 +167,9 @@ class ttTimeHelper {
     $time_a = explode(':', $value);
     if ($time_a[0] > 12)
       $res = (string)((int)$time_a[0] - 12).':'.$time_a[1].' PM';
-    else if ($time_a[0] == 12)
+    elseif ($time_a[0] == 12)
       $res = $value.' PM';
-    else if ($time_a[0] == 0)
+    elseif ($time_a[0] == 0)
       $res = '12:'.$time_a[1].' AM';
     else
       $res = $value.' AM';
@@ -492,7 +492,7 @@ class ttTimeHelper {
   static function getUncompleted($user_id) {
     $mdb2 = getConnection();
 
-    $sql = "select id from tt_log  
+    $sql = "select id, start from tt_log  
       where user_id = $user_id and start is not null and time_to_sec(duration) = 0 and status = 1";
     $res = $mdb2->query($sql);
     if (!is_a($res, 'PEAR_Error')) {