[set page_title]__COMPANY__ -- Order Status[/set] __LOGOBAR__ __MENUBAR__ [comment] +----------------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+---------------+------+-----+---------+-------+ | code | varchar(14) | | PRI | | | | store_id | varchar(9) | | MUL | | | | order_number | varchar(14) | | MUL | | | | session | varchar(32) | | | | | | username | varchar(20) | | | | | | shipmode | varchar(32) | | | | | | nitems | varchar(9) | | | | | | subtotal | varchar(12) | | | | | | shipping | varchar(12) | | | | | | handling | varchar(12) | YES | | NULL | | | total_cost | varchar(16) | | | | | | fname | varchar(30) | YES | | NULL | | | lname | varchar(30) | YES | | NULL | | | company | varchar(30) | YES | | NULL | | | address1 | varchar(30) | YES | | NULL | | | address2 | varchar(30) | YES | | NULL | | | city | varchar(30) | | | | | | state | varchar(10) | YES | | NULL | | | zip | varchar(10) | | | 00000 | | | country | varchar(10) | | | | | | phone_day | varchar(20) | YES | | NULL | | | phone_night | varchar(20) | YES | | NULL | | | fax | varchar(20) | YES | | NULL | | | email | varchar(42) | YES | | NULL | | | b_fname | varchar(30) | YES | | NULL | | | b_lname | varchar(30) | YES | | NULL | | | b_company | varchar(30) | YES | | NULL | | | b_address1 | varchar(30) | YES | | NULL | | | b_address2 | varchar(30) | YES | | NULL | | | b_city | varchar(30) | YES | | NULL | | | b_state | varchar(10) | YES | | NULL | | | b_zip | varchar(10) | | | 00000 | | | b_country | varchar(10) | | | | | | b_phone | varchar(20) | YES | | NULL | | | order_date | varchar(32) | | | | | | payment_method | varchar(32) | YES | | NULL | | | avs | varchar(32) | YES | | NULL | | | order_id | varchar(32) | YES | | NULL | | | update_date | timestamp(14) | YES | | NULL | | | status | varchar(32) | YES | | NULL | | | parent | varchar(9) | YES | | NULL | | +----------------+---------------+------+-----+---------+-------+ [/comment]

Order Status

[query st=db arrayref=orders sql="SELECT code,status,nitems,subtotal,shipping,handling,total_cost,payment_method,order_date FROM transactions WHERE username = '[data base=session field=username filter=sql]' ORDER by code "][/query] [mvasp tables=transactions] <% my $uid = $Session->{username}; if (! $uid) { $Document->write ("

## You are not logged in.

"); return; } my $orders = $Tmp->{orders}; if(! $orders or scalar @$orders == 0) { $Document->write( "No pending orders for $uid."); return; } HTML "

"; my $header_template = <<'EOF';
DATE | ORDER ID | QTY TOTAL | PAYMENT METHOD | SUBTOTAL | SHIPPING HANDLING | SUBTOTAL | STATUS
EOF my $line_template = <<'EOF';
$order_date | $order_number | $nitems | $payment_method | $subtotal | $shipping$handling | $total_cost | $status
EOF my %hash; my @fields = qw/order_number status nitems subtotal shipping handling total_cost payment_method order_date/; my $row; my %summary; my $first; my $record; HTML $header_template; foreach $record (@$orders) { my $line = $line_template; @hash{@fields} = @$record; $hash{detail_url} = $Tag->area( { href => 'query/order_detail', arg => $hash{order_number}, }); if($hash{status} =~ /\d/) { my @ids = grep /\S/, split /\s+/, $hash{status}; $hash{status} = ''; for(@ids) { $hash{status} .= <UPS $_ EOF } } else { $hash{status} = <$hash{status} EOF } for(qw/subtotal shipping total_cost/) { $hash{$_} = $Tag->currency ({ body=> $hash{$_} }); } if($hash{handling}) { $hash{handling} = "
(handling " . $Tag->currency ({ body=> $hash{handling} }) . ")"; } else { $hash{handling} = ''; } $line =~ s/\$(\w+)/$hash{$1}/g; HTML $line; } HTML "

"; %> [/mvasp]
__MENUBOTTOM__ __COPYRIGHT__