Add filters
[misc/hallinta-metro] / utils.php
index dbf113f..45b1c93 100644 (file)
--- a/utils.php
+++ b/utils.php
@@ -6,7 +6,17 @@ define('FNAME_VARS', 'ordersatz_vars.tex');
 define('FNAME_ITEMS', 'ordersatz_items.tex');
 define('FAXNUMBER','2002-364');
 define('ERROR_SAFT','joey@finlandia');
-define('ERROR_MAIL','joey@finlandia');
+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;
+}
 
 function mk_tempdir()
 {