NEW FEATURE: vacation support
[e-DoKo.git] / include / db.php
index 6e1af93c31faa2c64fd5a000467eade4bc5d8143..b8bcea80141a8595a5fc7e4ea578f8e6de4e02c7 100644 (file)
@@ -763,6 +763,29 @@ function DB_get_PREF($myid)
   else
     $PREF['open_for_games']='yes';
 
+  /* Vacation start */
+  $r = DB_query_array("SELECT value FROM User_Prefs".
+                     " WHERE user_id='$myid' AND pref_key='vacation start'" );
+  if($r)
+    $PREF['vacation_start'] = $r[0];
+  else
+    $PREF['vacation_start'] = NULL;
+
+  /* Vacation stop */
+  $r = DB_query_array("SELECT value FROM User_Prefs".
+                     " WHERE user_id='$myid' AND pref_key='vacation stop'" );
+  if($r)
+    $PREF['vacation_stop'] = $r[0];
+  else
+    $PREF['vacation_stop'] = NULL;
+
+  /* Vacation comment */
+  $r = DB_query_array("SELECT value FROM User_Prefs".
+                     " WHERE user_id='$myid' AND pref_key='vacation comment'" );
+  if($r)
+    $PREF['vacation_comment'] = $r[0];
+  else
+    $PREF['vacation_comment'] = "";
 
   return $PREF;
 }
@@ -852,6 +875,9 @@ function DB_set_recovery_password($user,$newpw)
 
 function DB_get_card_name($card)
 {
+  if($card==0)
+    return 'backside';
+
   $r = DB_query_array("SELECT strength,suite FROM Card WHERE id='$card'");
 
   if($r)