print p( You ordered the
return unless $active
print h1( Order Confirmation ),
print p( You ordered the following ),
print order_text(),
print p( Is this right? Select Card to pay for the items
or Shirt or Sweater to continue shopping ), print p(to_page( Card ),
to_page( Shirt ),
to_page( Sweater )),
# Страница для ввода данных кредитной карты sub credit_card {
my $active = shift,
my @widgets = qw(Name Addressi Address2 City Zip State Phone Card Expiry)
unless ($active) {
print map < hidden($_) } @widgets, return,
print pre(p( Name
p( AddressP(
P( City
P( Zip
p( State
p( Phone
p( Credit Card #
P( Expiry
, textfield( Name )),
textfield( Addressi )),
textfield( Address2 ))
textfield( City )),
textfield( Zip )),
textfield( State )),
textfield( Phone ))
textfield( Card )),
textfield( Expiry ))),
print p( Click on Order to return shopping ),
to order the items Click on Cancel
print p(to_page( Order ), to_page( Cancel )),
продолжение
702 Глава 19 • Программирование CGI Пример 19.9 (продолжение)
# Страница для завершения заказа, sub order {my $active = shift;
unless (Sactive) { return;
й Проверка данных кредитной карты
print h1("Ordered!");
print p('You have ordered the following toppings ');
print order_text(),
print p(defaults("Begin Again"));
# Возвращает HTML-код текущего заказа ("Вы заказали . ") sub order_text { my $html = '';
if (param("shirt_count")) {
$html .= p("You have ordered ', param("shirt_count"), " shirts of size ", param("shirt_size"), " and color ", param("shirt_color"), ".");
}
if (param("sweater_counf )) {
$html = p('You have ordered ', param('sweater_count'), ' sweaters of size ", param("sweater_size'), and color ', param("sweater_color'), '.");
}
$html = p('Nothing! ') unless $html;
$html = p("For a total cost of ', calculate_price());
Forekc.ru
Рефераты, дипломы, курсовые, выпускные и квалификационные работы, диссертации, учебники, учебные пособия, лекции, методические пособия и рекомендации, программы и курсы обучения, публикации из профильных изданий