<%def .page> Grandfather Clocks selection at the lowest prices at Grand-father-clocks.com
  HOME    |    CONTACT US    |    HELP    |    VIEW SHOPPING CART
FLOOR CLOCKS  |  MANTEL CLOCKS  |  WALL CLOCKS   |   TABLETOP CLOCKS  |   FLOOR CABINET  |  WALL CABINET
 

% if ($ENV{HTTP_REFERER}!~/clocks.mhtml$/){ % } ##end if % else{ % } ##end else
Enter Model Number or Name:
Sort by: Model Name Price
<% $result_html %>

 

FLOOR CLOCKS  |  MANTEL CLOCKS  |  WALL CLOCKS   |   TABLETOP CLOCKS  |   FLOOR CABINET  |  WALL CABINET
Grand-Father-clocks.com © 2006
% ################################################################ <%init> use DBI; use Data::Dumper; if ($text ne '' && ($ENV{HTTP_REFERER}=~/clocks.mhtml$/ || !$ENV{HTTP_REFERER} ) ){ my $ret_html=_lookup_text($text,$sort); $m->print($ret_html); } ##end if elsif($text ne '' && $ENV{HTTP_REFERER}!~/clocks.mhtml$/){ $display_txt=$text; $result_html=_lookup_text($text,$sort); $m->comp('.page'); } ##end elsif else{ $m->comp('.page'); } ##end else sub _lookup_text{ my ($text,$sort)=@_; $sort= $sort ? $sort : 'clock_name'; my $return_html=qq~~; my $bigdb=DBI->connect('DBI:Pg:dbname=bigdb'); my $query=$bigdb->prepare(qq~select * from clocks.clock where (clock_model_no ilike ? or clock_name ilike ?) and clock_status not ilike 'out of stock' order by $sort~); $query->execute("%$text%","%$text%"); $return_html.=qq~~ if ($query->rows); while (my $h=$query->fetchrow_hashref){ $return_html.=qq~~; $return_html.=qq~~; $return_html.=qq~~; $return_html.=qq~~; $return_html.=qq~~; $return_html.=qq~~; } ##end while $return_html.=qq~
Model
Number
NamePrice 
$h->{clock_model_no}$h->{clock_name}\$$h->{clock_sell}Click for more info.
~; return $return_html; } ##end _lookup_text <%args> $text => undef $sort => undef <%once> my $result_html=>undef; my $display_txt=>undef;