';
$query = $query.$arg." ORDER by FILE_DESC";
$numresults = mysql_query($query) or die( $query."\n\n".mysql_error());
$numrows = mysql_num_rows($numresults);
if ($numrows == 0)
{
echo "Sorry, your search never found anything";
exit; }
echo " ";
echo " FileID Description................................................ ";
$ta = "tg";
$text = 0;
$image = 0;
// now you can display the results returned
// $p(rint)line determines whether a line has been output to change the background or not
while ($row = mysql_fetch_array($numresults)) {
$pline = FALSE;
$loc = trim($row["C_LOC"]);
if ($loc != "" )
{ $loc = ", ".$loc; }
$date = trim($row["C_DATE"]);
if ($date != "" )
{ $date = ", ".$date; }
$ref = trim($row["REFERENCE"]);
$src = trim($row["SOURCE"]);
$org = trim($row["ORIGIN"]);
if (trim($ref) != "" )
{ $ref = " ".$ref; }
//$ref1 = $ref; don't show reference yet
$ref1 = "";
if (trim($org) != "" )
{ $org = ", [o".$org.$ref1."]"; }
elseif (trim($src) != "" )
{ $org = ", [s".$src.$ref1."]"; }
else
{ $org = ", [sPJV".$ref1."]"; }
$file_id = $row["FILE_ID"];
$file_ext = strtolower($row["FILE_EXT"]);
$rep = array( "'", '"' );
$filename = strtolower($row["DISK"])."/".strtolower($file_id).".".$file_ext;
$desc = trim($row["FILE_DESC"]);
$desc = str_replace( $rep, " ", $desc );
//if ( trim($file_ext) <> "" ) {
if (file_exists($filename)) {
//echo "The file $filename exists ";
$loc = str_replace( $rep, "", $loc );
$dat = str_replace( $rep, "", $dat );
$java = $filename;
$href = ''.$desc."";
echo " ".$file_id." ".$href.$loc.$date.$org." ";
$image++;
$pline = TRUE;
} else {
$href = $desc;
$text++;
if ($output == 'All' ) {
echo " ".$file_id." ".$href.$loc.$date.$org." ";
$pline = TRUE;
}
}
if ($pline == TRUE ) {
if ($ta == "tg")
{ $ta = "th"; }
else
{ $ta = "tg"; }
}
if ($image+$text > $limit )
{ echo "
Warning!! Please refine your search, there is a $limit record limit. Large searches may choke your browser ";
break; }
}
echo " ";
mysql_free_result( $numresults );
mysql_close();
//echo "
|