aboutsummaryrefslogtreecommitdiff
path: root/lib/raumzeit/MetaDateDB.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/raumzeit/MetaDateDB.php')
-rw-r--r--lib/raumzeit/MetaDateDB.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/lib/raumzeit/MetaDateDB.php b/lib/raumzeit/MetaDateDB.php
new file mode 100644
index 0000000..29af00e
--- /dev/null
+++ b/lib/raumzeit/MetaDateDB.php
@@ -0,0 +1,55 @@
+<?php
+# Lifter002: DONE - not applicable
+# Lifter007: TEST
+# Lifter003: TEST
+# Lifter010: DONE - not applicable
+
+// +--------------------------------------------------------------------------+
+// This file is part of Stud.IP
+// MetaDateDB.php
+//
+// Datenbank-Abfragen für MetaDate.php
+//
+// +--------------------------------------------------------------------------+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or any later version.
+// +--------------------------------------------------------------------------+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+// +--------------------------------------------------------------------------+
+
+
+/**
+ * MetaDateDB.php
+ *
+ *
+ * @author Till Glöggler <tgloeggl@uos.de>
+ * @version 19. Oktober 2005
+ * @access protected
+ * @package raumzeit
+ */
+class MetaDateDB
+{
+ public static function has_dates($metadate_id, $seminar_id, $filterStart = 0, $filterEnd = 0)
+ {
+ $query = "SELECT 1 FROM termine WHERE range_id = ? AND metadate_id = ?";
+ $parameters = [$seminar_id, $metadate_id];
+
+ if ($filterStart != 0) {
+ $query .= " AND date >= ? AND end_time <= ?";
+ array_push($parameters, $filterStart, $filterEnd);
+ }
+
+ $statement = DBManager::get()->prepare($query);
+ $statement->execute($parameters);
+
+ return (bool)$statement->fetchColumn();
+ }
+}