[tmp page_title][L]Customer manager[/L]: [L]View customer[/L] [cgi customer][/tmp] [set ui_class]Customers[/set] [set page_banner][L]View customer[/L][/set] [set help_name]customer.view[/set] [set icon_name]icon_people.gif[/set] @_UI_STD_HEAD_@ [calc] delete $Scratch->{ui_bounce}; $CGI->{customer} ||= $CGI->{mv_arg} or $Scratch->{ui_bounce} = '__UI_BASE__/customer'; return; [/calc] [if scratch ui_bounce] [bounce page="[scratch ui_bounce]"] [/if] [perl tables=country]### pre-open database for calcs below[/perl] [query list=1 table=userdb prefix=loop sql="select * from userdb where username = '[cgi customer]'"]
[L]User Name[/L]:   [loop-code] [L]Account Status[/L]:   [filter uc] [if-loop-param inactive] [L]inactive[/L] [else] [L]active[/L] [/else] [/if-loop-param] [/filter] [L]Total Sales[/L]:   [query arrayref=totals table=transactions sql=| SELECT total_cost,status FROM transactions WHERE username = '[loop-code]' |][/query] [calc] my $q = $Tmp->{totals}; my $ary; return '[L]no orders[/L]' unless $q and defined $q->[0]; my $total = 0; for(@$q) { next if $_->[1] eq 'canceled'; $total += $_->[0]; } return $Tag->currency({ body => $total } ); [/calc] [L]Last login[/L]:   [if-loop-param !mod_time] [L]Never[/L] [else] [time time="[loop-param mod_time]"]%b %e, %Y %l:%M %P[/time] [/else] [/if-loop-param]
[L]Customer Details[/L]
[if variable CUSTOMER_VIEW_DEALER] [/if]
[L]Customer[/L]: [loop-param fname] [loop-param lname]
[L]Company[/L]: [loop-param company]
[L]Home phone[/L]: [loop-param phone_night]
[L]Work phone[/L]: [loop-param phone_night]
[L]Email[/L]: [loop-param email]
[L]Dealer[/L]: [page href=admin/customer_pref form=" customer=[loop-code] start_at=dealer "][if-loop-param dealer][L]Yes[/L][else][L]No[/L][/else][/if-loop-param]
[L]Price Level[/L]: [page href=admin/customer_pref form=" customer=[loop-code] start_at=price_level "][display type=display table=userdb col=price_level key="[loop-code]"]
[L]Billing Details[/L]
[if-loop-param b_address1] [if-loop-param b_company] [/if-loop-param] [if-loop-param b_country =~ /^US|^CA/] [else] [if-loop-param b_state] [/if-loop-param] [if-loop-param b_zip] [/if-loop-param] [/else] [/if-loop-param]
[L]Name[/L]: [loop-param b_fname] [loop-param b_lname]
[L]Company[/L]: [loop-param b_company]
[L]Address[/L]: [loop-param b_address1] [if-loop-param b_address2]
[loop-param b_address2] [/if-loop-param]
[L]City, State, Zip[/L]: [loop-param b_city], [loop-param state] [loop-param zip]
[L]City[/L]: [loop-param b_city]
[L]State[/L]: [loop-param b_state]
[L]Postal code[/L]: [loop-param b_zip]
[L]Country[/L]: [data table=country col=name key="[loop-param b_country]"]
[else] [L]Same as shipping address[/L] [/else] [/if-loop-param]
[L]Shipping Details[/L]
[if-loop-param company] [/if-loop-param] [if-loop-param country =~ /^US|^CA/] [else] [if-loop-param state] [/if-loop-param] [if-loop-param zip] [/if-loop-param] [/else] [/if-loop-param]
[L]Name[/L]: [loop-param fname] [loop-param lname]
[L]Company[/L]: [loop-param company]
[L]Address[/L]: [loop-param address1] [if-loop-param address2]
[loop-param address2] [/if-loop-param]
[L]City, State, Zip[/L]: [loop-param city], [loop-param state] [loop-param zip]
[L]City[/L]: [loop-param city]
[L]State[/L]: [loop-param state]
[L]Postal code[/L]: [loop-param zip]
[L]Country[/L]: [data table=country col=name key="[loop-param country]"]
[query list=1 table=transactions sql="select * from transactions where username = '[loop-param username]'"] [/query]
[L]Status[/L] [L]Order Number[/L] [L]Order Date[/L] [L]Shipped to[/L] [L]Number of items[/L] [L]Subtotal[/L] [L]Total[/L]
[page href="admin/order_status" form="order=[sql-code]" ] [display table=transactions column=status key="[sql-code]" arbitrary=order_view ] [page href='__UI_BASE__/order_view' form='order=[sql-code]'][sql-code] [convert-date fmt="%b %e, %Y %H:%M"][sql-param order_date][/convert-date] [loop-param city], [loop-param state] [loop-param country] [sql-param nitems] [currency][sql-param subtotal][/currency] [currency][sql-param total_cost][/currency]
[seti page_banner][L]View Customer[/L]: [if-loop-param company] [loop-param company] [else][loop-param fname] [loop-param lname][/else] [/if-loop-param] [/seti] [output name=bottom_buttons]
[set [L]Return[/L]] viewnext= vieworder= [/set] [if-loop-data transactions archived] [else] [/else] [/if-loop-data] [if-mm advanced order=d] [/if-mm]
[output] [/query] @_UI_STD_FOOTER_@