Add dinner count

Change-Id: If5b5074a012ad75fe34547a6d12d40986adb5a89
diff --git a/db_backend.php b/db_backend.php
index d028241..9e4bec5 100644
--- a/db_backend.php
+++ b/db_backend.php
@@ -92,6 +92,19 @@
         }
     }
 
+    function dinner_count()
+    {
+        $sql = "SELECT COUNT(*) FROM person WHERE conference_dinner";
+        try {
+            $stmt = $this->pdo->prepare($sql);
+            $stmt->execute();
+            $row = $stmt->fetch(PDO::FETCH_ASSOC);
+            return $row['COUNT(*)'];
+        } catch (PDOException $pe) {
+            trigger_error('Could not connect to MySQL database. ' . $pe->getMessage(), E_USER_ERROR);
+        }
+    }
+
     function get_persons($filter)
     {
         $sql = "SELECT *, NULL as invoice FROM person " . ($filter?  "WHERE " . $filter : '');