[calc] if ( $CGI->{showarchive} ) { delete $Values->{showpending}; $Values->{showarchive} = 1; $Scratch->{archive_sense} = 'eq'; $Scratch->{archive_img} = 'admin/left.gif'; $Scratch->{archive_nm} = 'unarchive'; } elsif($CGI->{showpending}) { delete $Values->{showarchive}; $Values->{showpending} = 1; $Scratch->{archive_sense} = 'ne'; $Scratch->{archive_img} = 'admin/right.gif'; $Scratch->{archive_nm} = 'archive'; } elsif(! $Values->{showarchive} and ! $Values->{showpending}) { delete $Values->{showarchive}; $Values->{showpending} = 1; $Scratch->{archive_sense} = 'ne'; $Scratch->{archive_img} = 'admin/right.gif'; $Scratch->{archive_nm} = 'archive'; } return; [/calc] [value name=mv_data_table set=transactions hide=1] [if-mm !tables] [set ui_error] Not authorized for order administration. Contact administrator? [/set] [bounce page="__UI_BASE__/error"] [/if-mm] [set ui_class]Orders[/set] [tmp page_perm]order[/tmp] [tmp meta_header] [/tmp] [tag flag write]transactions[/tag] [perl tables=transactions] delete $Scratch->{ui_location}; my $db = $Db{transactions}; if(! $db) { $Scratch->{ui_error} = "Error: no transactions database.
"; $Scratch->{ui_location} = "__UI_BASE__/error"; return; } my ($value, $action_col); if($CGI->{archiveorder}) { $value = 1; $action_col = 'archived'; } elsif($CGI->{unarchiveorder}) { $value = 0; $action_col = 'archived'; } elsif($CGI->{deleteorder}) { $value = 1; $action_col = 'deleted'; } elsif($CGI->{vieworder} and ! $CGI->{viewnext}) { $CGI->{order} =~ s/^\0+//; $CGI->{order} =~ s/\0+$//; $Scratch->{ui_location} = $Tag->area('__UI_BASE__/order_view', $CGI->{order}); } elsif($CGI->{xload}) { $Scratch->{ui_location} = $Tag->area('__UI_BASE__/dbdownload'); } else { $CGI->{order} =~ s/^\0+//; $CGI->{order} =~ s/\0.*//s; $Scratch->{start_at} = "sm=$CGI->{order}"; } if($action_col) { for(grep $_, @{$CGI_array->{order}}) { $db->set_field($_, $action_col, $value); } } if(@errors) { my $plural = @errors > 1 ? 's' : ''; return "Error$plural:
"; } if($CGI->{viewnext}) { my $ordnum = $CGI->{order}; $ordnum =~ s/[\0,\s].*//; return if ! $ordnum; $ordnum++; CHECKNEXT: { if (! $db->record_exists($ordnum) ) { undef $ordnum; last CHECKNEXT; } if ($db->field($ordnum, 'deleted') ) { $ordnum++; next CHECKNEXT; } if ($Values->{showarchive} and ! $db->field($ordnum, 'archived') ) { undef $ordnum; last CHECKNEXT; } else { last CHECKNEXT; } } if ($ordnum) { $Scratch->{ui_location} = $Tag->area( { href => '__UI_BASE__/order_view', form => "order=$ordnum", } ); } else { $Scratch->{message} = "[L]No next order.[/L]"; } } return; [/perl] [if scratch ui_location] [bounce href=`delete $Scratch->{ui_location}`] [/if] [set icon_name]admin/icon_orders.gif[/set] [seti page_title] [if value showarchive] Orders: archived orders [set help_name]order.main.archived[/set] [else] Orders: pending orders [set help_name]order.main.pending[/set] [/else] [/if] [/seti] [update values] @_UI_STD_HEAD_@ [if scratch message]
[scratch message]
[set message][/set] [/if] [if scratch ui_message]
[scratch ui_message] [set ui_message][/set]

  [/if]
or
[if cgi ui_text_qualification]

Entries containing "[cgi ui_text_qualification]"

[/if] [search-region more=1 arg=" fi=transactions ml=__UI_SZ_LIST_ORDER__ md=1 st=db [if cgi ui_text_qualification] se=[cgi ui_text_qualification] [else] co=yes sf=archived se=1 op=[scratch archive_sense] sf=deleted se=1 op=ne [/else] [/if] [scratch start_at][set start_at][/set] [if cgi ui_sort_field] tf=[cgi ui_sort_field] to=[cgi ui_sort_option] [else] tf=0 [/else] [/if] rf=code,order_date,total_cost,nitems,status,city,state,country,fname,lname,username "] [calc] my $so = $CGI->{ui_sort_option}; my $fld = $CGI->{ui_sort_field}; $fld =~ s/[\s,\0].*//; sub sortrev { my ($f, $n) = @_; my $out = 'ui_sort_option='; $out .= 'n' if $n; return $out unless $fld eq $f; return $out if $so =~ /r/; return $out . 'r'; } return; [/calc]
[search-list] [/search-list] [no-match] [/no-match] [more-list] [/more-list]
  Order [page href=@@MV_PAGE@@ form=` return "ui_sort_field=company,lname\n" . sortrev('company'); `]User [page href=@@MV_PAGE@@ form=` return "ui_sort_field=country,state,city\n" . sortrev('country'); `]Location [page href=@@MV_PAGE@@ form=` return "ui_sort_field=order_date\n" . sortrev('order_date'); `]Date/Time [page href=@@MV_PAGE@@ form=` return "ui_sort_field=nitems\n" . sortrev('nitems', 1); `]Items [page href=@@MV_PAGE@@ form=` return "ui_sort_field=total_cost\n" . sortrev('total_cost', 1); `]Total [page href=@@MV_PAGE@@ form=` return "ui_sort_field=status\n" . sortrev('status'); `]Status
{archive_nm} eq 'unarchive'; return 'CHECKED' if q{[item-data transactions status]} eq 'shipped'; return; [/item-calc] > [page href="@@MV_PAGE@@" form=" [scratch archive_nm]order=1 order=[item-code] "][scratch archive_nm] [item-code] DELETE [item-code] [page href=__UI_BASE__/order_view form="order=[item-code]"][item-code] [page href=__UI_BASE__/customer_view form="customer=[item-param username]"][item-param lname], [item-param fname][if-item-param company] -- [item-param company][/if-item-param] [item-filter 30][item-param city], [item-param state] [item-param country][/item-filter] [convert-date][item-param order_date][/convert-date] [item-param nitems] [currency][item-param total_cost][/currency] [page href="__UI_BASE__/order_status" form="order=[item-code]"][item-param status]

No orders

Orders [matches] displayed. More orders: [decade-next][/decade-next] [more] [decade-prev][/decade-prev]
[if-mm advanced order=d] [button form=batch text="Delete checked orders" confirm='Are you sure you want to delete the checked orders?']deleteorder=1 [/button] [/if-mm]    [button form=batch src="@_UI_IMG_@admin/[scratch archive_img]" text=` my $tmp = "$Scratch->{archive_nm} checked orders"; return "\u$tmp"; `] [scratch archive_nm]order=1[/button]
[/search-region] @_UI_STD_FOOTER_@