#!C:\Perl\bin\Perl.exe "%1" %* print "Content-type: text/html\n\n"; use DBI; require ('C:\WINNT\Profiles\Administrator\Desktop\screens\cgi-lib.pl'); &ReadParse; if ($in{locateContact} eq "NULL") { print ""; print"NO CONTACTS ARE AVAILABLE

"; print ""; } else { my $dbh = DBI->connect("DBI:Sybase:CRAP", "sa", ""); #connects to database $sth = $dbh->prepare(qq{ select CONTACT_FNAME, CONTACT_LNAME, CONTACT_TITLE, CONTACT_DESKPH#, CONTACT_MOBILE#, CONTACT_PAGER#, CONTACT_PAGER_SP, CONTACT_FAX#, CONTACT_EMAIL from NSS.dbo.CONTACT WHERE CONTACT_# = $in{locateContact} }) or die "Can't prepare SQL statement: $DBI::errstr\n"; $sth->execute or die "Can't execute: $DBI::errstr\n"; my ( $modContactFName, $modContactLName, $modContactTitle, $modContactDeskPH, $modContactMobile, $modContactPager, $modContactPagerSP, $modContactFax, $modContactEmail); $sth->bind_columns (undef, \$modContactFName, \$modContactLName, \$modContactTitle, \$modContactDeskPH, \$modContactMobile, \$modContactPager, \$modContactPagerSP, \$modContactFax, \$modContactEmail); while ( @row = $sth->fetchrow() ) {} @array=split /\-+/,$modContactDeskPH; @array2=split /\-+/,$modContactPagerSP; @array3=split /\-+/,$modContactFax; print <<"EOF"; Modify/Delete Contact
Contact Details

* First Name:
* Title:
* Last Name:


Desk Phone Number:
Fax Number:
Mobile Phone Number:
Email Address:
Pager Service:
Pager Number:

  Sites:
EOF $sth2 = $dbh->prepare(qq{ select NSS.dbo.SITE.SITE_#, SITE_NAME FROM NSS.dbo.SITE, NSS.dbo.SITE_CONTACT, NSS.dbo.CONTACT WHERE NSS.dbo.SITE.SITE_# = NSS.dbo.SITE_CONTACT.SITE_# AND NSS.dbo.CONTACT.CONTACT_# = NSS.dbo.SITE_CONTACT.CONTACT_# AND NSS.dbo.CONTACT.CONTACT_# = $in{locateContact} }) or die "Can't prepare SQL statement: $DBI::errstr\n"; $sth2->execute or die "Can't execute: $DBI::errstr\n"; my ( $modSiteNumber, $modSiteName); $sth2->bind_columns (undef, \$modSiteNumber, \$modSiteName); while ( @row2 = $sth2->fetchrow() ) { print "$modSiteName
"; } $sth3 = $dbh->prepare(qq{ select SITE_#, SITE_NAME FROM NSS.dbo.SITE WHERE SITE_# NOT IN (select NSS.dbo.SITE.SITE_# FROM NSS.dbo.SITE, NSS.dbo.SITE_CONTACT, NSS.dbo.CONTACT WHERE NSS.dbo.SITE.SITE_# = NSS.dbo.SITE_CONTACT.SITE_# AND NSS.dbo.CONTACT.CONTACT_# = NSS.dbo.SITE_CONTACT.CONTACT_# AND NSS.dbo.CONTACT.CONTACT_# = $in{locateContact}) }) or die "Can't prepare SQL statement: $DBI::errstr\n"; $sth3->execute or die "Can't execute: $DBI::errstr\n"; my ($newSiteNumber, $newSiteName); $sth3->bind_columns (undef, \$newSiteNumber, \$newSiteName); while ( @row3 = $sth3->fetchrow()) { print "$newSiteName
"; } print <<"EOD";
EOD }