#!/usr/bin/perl -I/usr5/site_univ # Script: javascript.pl use strict; #use Apache(); use CGI; use DBI; use UVD; use UV_AUTH; # global variable defintions go here; if the main body of your script # uses a variable that is also used by a subroutine in this file then # define it here as follows: # # use vars qw/$variable_name/; # use vars qw/$dbh $uvd $uv_auth $q $sth/; use vars qw/$count @ac_type/; use vars qw/$v_product_name $v_service_name $remote_user/; $dbh = undef; $uvd = new UVD; $uv_auth = new UV_AUTH; $q = new CGI; undef $count; undef @ac_type; $remote_user = $ENV{REMOTE_USER}; $remote_user =~ tr/a-z/A-Z/; sub query_info { my ($c0) = qq/ SELECT distinct aircraft_type, series FROM uwa_aircraft_type WHERE NAVTECH = 'Y' ORDER BY aircraft_type/; $sth = $dbh->prepare($c0); $sth->execute(); while (my ($temp, $temp2) = $sth->fetchrow()) { next if length($temp) == 0; $temp =~ s/"/\\'\\'/; $temp2 =~ s/"/\\'\\'/; $temp = $temp . " - " . $temp2; push(@ac_type, "$temp"); } } sub print_data { my ($i); my ($a, $b, $c, $d, $e, $f, $g, $h, $i, $j); $a = $#ac_type / 3; $b = $a + $a; $c = $b + $a; print q/ /; for ($i = 0; $i < $#ac_type / 3; ) { print $q->Tr( $q->td( $ac_type[$i++]), $q->td( $ac_type[$a++]), $q->td( $ac_type[$b++]), ); } print "
"; } sub print_form { print < A{text-decoration:underline; color:#333399; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px;} A:hover{text-decoration:none;color:silver; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 12px;} .footer{ font-family: arial, helvetica, sans-serif; font-size: 8pt; } .footer A { COLOR: #003399; font-family: arial, helvetica, sans-serif; font-size: 8pt; TEXT-DECORATION: underline } .footer A:hover { TEXT-DECORATION: none; font-family: arial, helvetica, sans-serif; font-size: 8pt; } .topMenu A { COLOR: #003399; FONT-FAMILY: verdana,arial,helvetica; FONT-SIZE: 11px; TEXT-DECORATION: none } .topMenu A:hover { TEXT-DECORATION: underline; FONT-SIZE: 11px; }
Aircraft Types Supported
by UVflightplanner.com
If your aircraft is not listed, weather services are still available
EOF print_data(); print < EOF2 } print $q->header(); $dbh = DBI->connect("DBI:Oracle:acrs","acars", "acarsprod", { AutoCommit =>0, PrintError => 1, RaiseError => 0} ) or dir("Can't connect to Oracle Database: $DBI::errstr\n"); print $q->start_html(-title=>'Aircraft Types'); query_info(); print_form();