+define('ERROR_MAIL','joey@finlandia.infodrom.org');
+
+function is_done($id)
+{
+ global $db;
+
+ $query = sprintf('SELECT count(*) AS count FROM metro_ordersatz WHERE id = %d AND done IS NULL', $id);
+ $sth = $db->query($query);
+ $row = $sth->fetch();
+ return $row['count'] == 0;
+}