#!/bin/sh

echo Content-type: text/html
echo

if [ -x $QHTML ]; then
	if [ $# = 0 ]; then
		cat << EOM
<HTML>
<HEAD><TITLE>Client Search</TITLE></HEAD>
<BODY BACKGROUND="/images/tiles/stdtile3.jpg">
<H1>Client Search</H1>

<ISINDEX>

This is a searchable index of Clients.
Whatever you enter your browser's search dialog is searched for in all
fields of the Clients database and all Clients matching are displayed.
<P>
<A HREF="http://www.kayhay.com/">
<IMG SRC="/images/home.gif" ALT=""></A>
<A HREF="http:/staff">Return to MountNet Home Page</A>
</FONT>
</BODY>
</HTML>
EOM
  else
    key="$*"
    searchstring=`echo $key | tr '_' ' '`
    echo "<HTML>"
    echo "<HEAD><TITLE>Search: $searchstring</TITLE></HEAD>"
    echo "<BODY BACKGROUND=\"/images/tiles/stdtile3.jpg\">"
    echo "<H1>$business<HR></H1>"
    echo "<FONT=\"+3\">"
    echo "<TABLE>"
    /usr/local/qddb/bin/qedit l /var/lib/qdDBs/Qba/Clients $searchstring \
		| qedit2html.pl
    echo "</TABLE>"
    echo "<P>"
    echo "<A HREF=\"http://www.kayhay.com/\">"
    echo "<IMG SRC=\"/images/home.gif\" ALT=\"\"></A>"
    echo "<A HREF=\"http://www.kayhay.com/\">"
    echo "Return to MountNet Home Page</A>"
    echo "</FONT>"
    echo "</BODY>"
    echo "</HTML>"
  fi
fi
