appdb/include appData.php

WineHQ wineowner at wine.codeweavers.com
Sun Dec 31 13:48:07 CST 2006


ChangeSet ID:	30845
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2006/12/31 13:48:07

Added files:
	include        : appData.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Add file necessary for displaying queued item lists

Patch: http://cvs.winehq.org/patch.py?id=30845

Old revision  New revision  Changes     Path
 Added         1.1           +0 -0       appdb/include/appData.php

Index: appdb/include/appData.php
diff -u -p /dev/null appdb/include/appData.php:1.1
--- /dev/null	31 Dec 2006 19:48: 7 -0000
+++ appdb/include/appData.php	31 Dec 2006 19:48: 7 -0000
@@ -0,0 +1,56 @@
+<?php
+
+/**
+ * Functions related to application data
+ */
+
+require_once(BASE."include/util.php");
+
+class appData
+{
+    function listSubmittedBy($iUserId, $bQueued = true)
+    {
+        $hResult = query_parameters("SELECT appData.TYPE, appData.appId,
+            appData.versionId, appData.description, appData.submitTime,
+            appFamily.appName, appVersion.versionName FROM appData,
+            appFamily, appVersion
+                WHERE (appFamily.appId = appData.appId OR
+                (appData.versionId = appVersion.versionId AND appFamily.appId =
+                appVersion.appId)) AND (appFamily.queued = '?' OR
+                appVersion.queued = '?') AND appData.submitterId = '?' AND
+                appData.queued = '?'
+                    ORDER BY appData.id",
+                        "false", "false", $iUserId, $bQueued ? "true" : "false");
+
+        if(!$hResult || !mysql_num_rows($hResult))
+            return false;
+
+        $sReturn .= html_table_begin("width=\"100%\" align=\"center\"");
+        $sReturn .= html_tr(array(
+            "Version",
+            "Type",
+            "Description",
+            "Submission Date"),
+            "color4");
+
+        for($i = 1; $oRow = mysql_fetch_object($hResult); $i++)
+        {
+            $sReturn .= html_tr(array(
+                $oRow->versionId ?
+                "<a href=\"".BASE."appview.php?iVersionId=$oRow->versionId\">".
+                "$oRow->appName: $oRow->versionName</a>" :
+                "<a href=\"".BASE."appview.php?iAppId=$oRow->appId\">".
+                "$oRow->appName</a>",
+                $oRow->TYPE,
+                $oRow->description,
+                print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime))),
+                ($i % 2) ? "color0" : "color1");
+        }
+
+        $sReturn .= html_table_end("");
+
+        return $sReturn;
+    }
+}
+
+?>



More information about the wine-cvs mailing list