200 || $aClean['iNumVersions'] < 0)
$aClean['iNumVersions'] = 25;
if(!$aClean['iPage'])
$aClean['iPage'] = 1;
/* Count the possible matches */
$sQuery = "SELECT DISTINCT appFamily.appName,
appVersion.versionName, appVersion.versionId, appFamily.description
FROM appFamily, appVersion, appData
WHERE appData.type = '?' AND appData.versionId = appVersion.versionId
AND appFamily.appId = appVersion.appId AND appVersion.queued = 'false'";
if(!$sLicense)
$hResult = query_parameters($sQuery, "downloadurl");
else
{
$sQuery .= " AND license = '?'";
$hResult = query_parameters($sQuery, "downloadurl", $sLicense);
}
if($hResult && mysql_num_rows($hResult))
$num = mysql_num_rows($hResult);
$iNumPages = ceil($num / $aClean['iNumVersions']);
/* Check page logic */
$aClean['iPage'] = min($aClean['iPage'], $iNumPages);
/* Calculate values for the LIMIT clause */
$iLimitLower = ($aClean['iPage'] - 1) * $aClean['iNumVersions'];
/* Page selection */
echo "
\n";
echo "Page ".$aClean['iPage']." of $iNumPages
\n";
display_page_range($aClean['iPage'], $iPageRange, $iNumPages,
$_SERVER['PHP_SELF']."?iNumVersions=".$aClean['iNumVersions']);
/* Selector for how many versions to display */
echo "
\n
\n";
if(!$num)
{
echo "No matches found
\n";
echo html_frame_end(" ");
exit;
}
$sQuery = "SELECT DISTINCT appFamily.appName,
appVersion.versionName, appVersion.versionId, appFamily.description
FROM appFamily, appVersion, appData
WHERE appData.type = '?' AND appData.versionId = appVersion.versionId
AND appFamily.appId = appVersion.appId
AND appVersion.queued = 'false' ";
if(!$sLicense)
{
$sQuery .= "ORDER BY appFamily.appName LIMIT ?, ?";
$hResult = query_parameters($sQuery, "downloadurl", $iLimitLower,
$aClean['iNumVersions']);
} else
{
$sQuery .= "AND license = '?' ORDER BY appFamily.appName LIMIT ?, ?";
$hResult = query_parameters($sQuery,
"downloadurl", $sLicense, $iLimitLower,
$aClean['iNumVersions']);
}
if($hResult && mysql_num_rows($hResult))
{
echo html_frame_start("", "90%");
echo html_table_begin("width=\"100%\" align=\"center\"");
echo html_tr(array(
"Name",
"Description"),
"color4");
for($i = 1; $oRow = mysql_fetch_object($hResult); $i++)
{
echo html_tr_highlight_clickable(
"appview.php?iVersionId=$oRow->versionId",
($i % 2) ? "color1" : "color0",
($i % 2) ? "color1" : "color0",
($i % 2) ? "color1" : "color0");
echo "versionId\">".
"$oRow->appName $oRow->versionName | \n";
echo "$oRow->description | \n";
echo "\n";
}
echo html_table_end();
echo html_frame_end(" ");
}
?>