package NVC; use strict; #$Id: NVC.pm,v 1.28 2001/02/02 23:43:08 umar Exp $ ##################################################### # All opinions about CgiBase belong to Max Khrapov # ##################################################### use lib '/web/auto/lib'; use lib '/web/auto/lib/NVC'; use vars qw(@ISA @EXPORT_OK); use CGI; use Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(get_apurl if_has_lm html_header html_footer hidden_fields quote_form is_popup cgi_param cgibase all_params nvc_debug); ### let's save all the CGI parameters in memory ### otherwise CgiBase will destroy everything my $cgi = new CGI; my @param = $cgi->param; my %cgi; my $i; foreach $i (@param) { my @ar = $cgi->param($i); if(@ar == 1) { my $j = shift @ar; $cgi{$i} = $j; } else { my $k = 1; my $j; foreach $j (@ar) { $cgi{"$i$k"} = $j; ++$k; } } } ### Try not to use CgiBase unless your manager sais you absolutely must my $product_code = '09.002.00'; ### The real thing my $cgibase; my $web_id; my $invsearchurl; my $popup; my $disable_inv; my $ap_url; my $cb_html_header; my $cb_html_footer; eval ' use CgiBase; $cgibase = new CgiBase $product_code; $web_id = $cgibase->{web_id}; $popup = $cgibase->{CGIParams}->{popup}; $invsearchurl = $cgibase->{CGIParams}->{invsearchurl}; $disable_inv = $cgibase->{CGIParams}->{disable_inv}; $ap_url = $cgibase->{CGIParams}->{autoposturl}; $cb_html_header = $cgibase->get_header; $cb_html_footer = $cgibase->get_footer; '; ### Defaults $web_id = 79532 unless $web_id; ### Sometimes the filename of the actual program ### is different. I think the best way to deal with ### it is not to second guess what it could be, but ### have production people make a soft link to the ### right program $invsearchurl = "new_inventory-results.cgi" unless $invsearchurl; $popup = 0 unless $popup; my $hidden_fields = ""; foreach $i (keys %cgi) { $hidden_fields .= qq(\n); } ######################################################## # # Subroutines # ######################################################## ######################################################### sub get_apurl ######################################################## { return $ap_url; } ######################################################## sub if_has_lm ######################################################### { my $tf = 0; my ($status, $purchased, $purchases); my $lm_product_code = '600'; eval "use lib '/web/lib'; use Purchases::Purchases_Read; "; eval "\$purchases = new Purchases_Read"; $status = $purchases->check_purchase (\$purchased, $cgibase->{WebSite}->{web_num}, $lm_product_code); if ($purchased){ $tf = 1; } #print "Content-type: text/html\n\n"; #print "\n"; #print "
\n"; #print "TF is: $tfYou can now send a request for a quote on the vehicle you configured directly to our dealership. We ask that you provide your contact information, which will allow us to follow up with you in a timely manner.
EOF }else { $quote_begin_sentence =<<"EOF";You can now search the new vehicle inventory to find the closest match to the vehicle you configured.
You can also send a request for a quote on the vehicle you configured directly to our dealership. We ask that you provide your contact information, which will allow us to follow up with you in a timely manner.
EOF } my $html = <<"EOF";