#!/usr/local/qddb/bin/qtclsh

lappend auto_path $qddb_library/hx

set dir /var/lib/www/staffcgi/qddb/payments
set mypath /staff/cgi-bin/qddb/payments/search
set webmaster webmaster@knotwork.com
set hostname www.knotwork.com
set dbname Payments
set title "Payments Search Form"
set opening "Welcome to the Payments search form"
set message "Please enter any search criteria you like using the standard
<a href=http://www.hsdi.com/qddb>Qddb</a> syntax.    \".*\" in any 
field will bring up all the people who have entered a Payment
and filled in that field.
If you don't know Qddb's simple search syntax, you can read
about it in the
<a href=http://www.hsdi.com/qddb/manual/node15.html>Guide to Qddb</a>.
<br>
"
set signature "The <A HREF=\"http:/ISPutil/\">ISPutil</A> Team"

#------- end variable definitions --------

proc SearchEntryProc {schema} {
  Hx:DefinedEntryForm $schema {
    {Name.Username 14 text 40} 
    {Name.First 14 text 20} {Name.Last 12 text 20}
    {AcceptedBy 14 text 10} {DateOfPayment 5 text 14} {Clock 6 text 14}
    {Amount 14 text 20} {MethodOfPayment 0 label 0} {MethodOfPayment 2 radio 0 0 Cash} {MethodOfPayment 2 radio 0 0 Cheque} {MethodOfPayment 2 radio 0 0 Credit}
    {Comments 14 textarea 60 5}
  }
}

proc ListingProc {schema tbl} {
  Hx:DefinedListing $schema $tbl {
    {<html> <h2><hr><font face="arial" color=#1F7F1F>}
    {Name.Username text 10} {DateOfPayment text 12} {Clock text 12}
    {<html> </font><hr></h2><ul><font face="arial">}
    {<html> <table> <tr><p><td>}
    {<html> Username: </td><td> } {Name.Username text 10}
    {<html> </td></tr><tr><p><td>}
    {<html> Name: </td><td> } { Name.First text 20} {Name.Last text 20}
    {<html> </td></tr><tr><p><td>}
    {<html> Amount: </td><td> } {Amount text 15} {MethodOfPayment text 8}
    {<html> </td></tr><tr><p><td>}
    {<html> Date: </td><td> } {DateOfPayment text 12} {Clock text 12}
    {<html> </td></tr></table></ul>}
  }
}



Hx:GenericSearchEngine $dbname $webmaster $hostname $mypath $dir 10 100 \
	$title $opening $message $signature {
	SearchEntryProc
	ListingProc
	Hx:FormatTable
	Hx:ColumnSpecs
	Hx:SortSpecs
}

exit 0

