Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] Routine when all checks have passed



******    message to minivend-users from Jose Luis <macross@mixmail.com>     ******

> Greeting  , Can anybody say how to do a routine only when all checks
> have passed , I was trying something like    this  (below)   but the
> routine always execute . Please help me .  thanks
>
> The profile is =
>
> [set new_address]
>
> sfname=required
> slname=required
> saddress1=required
> scity=required
> scountry=required
> [if value scountry =~ /^(US|CA)$/i]
>  sstate=state_province "[value sstate]" is not a valid US/Canada state
> or province.
>  szip=postcode "[value szip]" is not a valid US/Canada postal code.
>  sphone=phone Must have evening or day phone_number
> [else]
>  sphone=phone Must have evening or day phone_number
> [/else]
> [/if]
>
> &fatal = yes
>
> [perl tables=address_book global=1 interpolate=1]
>
> my $ad_num=$Session->{arg};
> my $user=$Session->{username};
> my $dbh = $Sql{address_book};
> my $insert=qq!insert into address_book
>           values
>            ('$user',
>             '[calc][value saddress_number]+1[/calc]',
>             '[value filter=strip name=sfname]',
>             '[value filter=strip name=slname]',
>             '[value filter=strip name=saddress1]  ',
>             '[value filter=strip name=saddress2]',
>             '[value filter=strip name=scity]',
>      '[value name=sstate filter="strip uc"]',
>      '[value name=szip filter=digits]',
>      '[value scountry]',
>      '[value filter=strip name=sphone]'  )!;
>
> my $sth = $dbh->prepare($insert);
> $sth->execute();
> }
> [/perl]
>
> [/set]

-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: