#!/usr/local/bin/perl # display.pl - web cgi routine to display the current shopping cart # # Dave Stoddard - 5/29/04 # dgs@accelix.com # # Copyright # --------- # Copyright(c) 2004, Accelix LLC. All Rights Reserved. # # Description # ----------- # This program displays the contents of the current shopping cart based on # the users current session id. # # RCS Information # --------------- # $Id$ # $Log$ # # package main; use strict 'vars'; use strict 'subs'; # use warnings; # use diagnostics; # load application modules use cart; # shopping cart support routines # --------------------------- # DECLARATIONS AND PROTOTYPES # --------------------------- # local elements my %form = (); # data from form (name/value pairs) my %state = (); # state persistence data hash my %sess = (); # session hash ### ### START PROGRAM ### # initialize the program %form = ReadForm (); # read the form %state = GetState (%form); # get current state data (cookies) # map paypal field names to shopping cart field names $form{price} = $form{amount} if (defined $form{amount}); $form{quantity} = $form{add} if (defined $form{add}); $form{itemno} = $form{item_number} if (defined $form{item_number}); $form{title} = $form{item_name} if (defined $form{item_name}); $form{optname1} = $form{on0} if (defined $form{on0}); $form{optval1} = $form{os0} if (defined $form{os0}); $form{optname2} = $form{on1} if (defined $form{on1}); $form{optval2} = $form{os1} if (defined $form{os1}); $form{optname3} = $form{on2} if (defined $form{on2}); $form{optval3} = $form{os2} if (defined $form{os2}); # display the current cart %sess = GetSession (%form,%state); DisplayCart ($sess{sessid}); ExitProgram (); ### End Main Program ###