This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/search.php

72 lines
1.8 KiB
PHP
Raw Normal View History

<?php
2004-12-25 20:08:00 +00:00
/*****************/
/* search engine */
/*****************/
2004-03-15 16:22:00 +00:00
2004-12-25 20:08:00 +00:00
/*
2004-12-27 23:54:55 +00:00
* application environment
2004-12-25 20:08:00 +00:00
*/
2004-03-15 16:22:00 +00:00
include("path.php");
require(BASE."include/incl.php");
require(BASE."include/application.php");
2004-03-15 16:22:00 +00:00
$sQuery = "SELECT *
FROM appFamily
WHERE appName != 'NONAME'
2005-02-19 01:21:14 +00:00
AND queued = 'false'
AND appName LIKE '%".addslashes($_REQUEST['q'])."%'
OR keywords LIKE '%".addslashes($_REQUEST['q'])."%'
ORDER BY appName";
$hResult = query_appdb($sQuery);
2004-03-15 16:22:00 +00:00
apidb_header("Search Results");
if(mysql_num_rows($hResult) == 0)
2004-03-15 16:22:00 +00:00
{
// do something
echo html_frame_start("","98%");
2004-12-19 17:54:09 +00:00
echo "No matches found for ". urlencode($_REQUEST['q']) . "\n";
2004-03-15 16:22:00 +00:00
echo html_frame_end();
}
else
{
echo html_frame_start("","98%","",0);
echo "<table width='100%' border=0 cellpadding=3 cellspacing=1>\n\n";
echo "<tr class=color4>\n";
2004-03-15 16:22:00 +00:00
echo " <td><font color=white>Application Name</font></td>\n";
echo " <td><font color=white>Description</font></td>\n";
echo " <td><font color=white>No. Versions</font></td>\n";
echo "</tr>\n\n";
$c = 0;
while($ob = mysql_fetch_object($hResult))
2004-03-15 16:22:00 +00:00
{
//skip if a NONAME
if ($ob->appName == "NONAME") { continue; }
//set row color
$bgcolor = ($c % 2) ? 'color0' : 'color1';
2004-03-15 16:22:00 +00:00
//count versions
$query = query_appdb("SELECT count(*) as versions FROM appVersion WHERE appId = $ob->appId AND versionName != 'NONAME'");
2004-03-15 16:22:00 +00:00
$y = mysql_fetch_object($query);
//display row
echo "<tr class=$bgcolor>\n";
2004-03-15 16:22:00 +00:00
echo " <td>".html_ahref($ob->appName,"appview.php?appId=$ob->appId")."</td>\n";
echo " <td>".trim_description($ob->description)."</td>\n";
2004-03-15 16:22:00 +00:00
echo " <td>$y->versions &nbsp;</td>\n";
echo "</tr>\n\n";
$c++;
}
echo "<tr><td colspan=3 class=color4><font color=white>$c match(es) found</font></td></tr>\n";
echo "</table>\n\n";
2004-03-15 16:22:00 +00:00
}
apidb_footer();
?>