#!/usr/bin/perl -w # Russell Hyland # WebHortLine SearchContacts.cgi # # Prompt for search string, then get a list of ContactIDs of Contact records that contain the searchstring in # one or more fields. Use the list to display the records. use strict; use warnings; use CGI::Carp qw(); use CGI::Pretty; use CGI qw(:standard :cgi-lib -debug fatalsToBrowser); use DBD::mysql; use DBI; my $cgi = new CGI; my @css = (Link({-rel=>'stylesheet',-type=>'text/css',-src=>'Styles.css',-media=>'screen'})); my ($dbh, $selectstr, $sth, @row); my $SrchStr; our @ContactIDList; our $CurIDPtr = 0; my $County = $cgi->cookie('MG_HortLine'); if (!$County) { print redirect(-location=>"http://hortline.rbhyland.org/Login.cgi"); } print $cgi->header(); print start_html(-title =>'Search Contacts', -style =>'Styles.css', -script=>{-language=>'JAVASCRIPT', -src=>'Scripts.js'}); print "MG logo"; print "

 Penn State Consumer

 Horticultural Help Line


"; print h2('Search Contacts'),hr; if (!param('SearchFld') && !param('Next') && !param('Prev')) { print start_form, "", textfield(-name=>'SearchFld',-value=>"",-size=>30,-maxlength=>50,-id=>'SearchFld', -class=>'DataIn'), br,br,submit, end_form; } elsif (param('Next')) { $CurIDPtr += 1; print '[',$CurIDPtr,'][',$ContactIDList[$CurIDPtr],']'; DisplayRec(); } elsif (param('Prev')) { $CurIDPtr = $CurIDPtr - 1; print Dump; print '[',$CurIDPtr,'][',$ContactIDList[$CurIDPtr],']'; DisplayRec(); } else { getIDs(); DisplayRec(); } print end_html;