* $Id: orders_list.tpl,v 1.7.2.2 2004/10/29 07:43:23 max Exp $ *}
{assign var="total" value=0.00}
{assign var="total_paid" value=0.00}
{if $orders ne ""}
{capture name=dialog}
<DIV align="right">{include file="buttons/button.tpl" button_title=$lng.lbl_search_again href="orders.php"}</DIV>
{include file="customer/main/navigation.tpl"}
<SCRIPT type="text/javascript" language="JavaScript 1.2">
<!--
checkboxes_form = 'processorderform';
checkboxes = new Array({foreach from=$orders item=v key=k}{if $k > 0},{/if}'orderids[{$v.orderid}]'{/foreach});
-->
</SCRIPT>
{include file="change_all_checkboxes.tpl"}
<DIV style="line-height:170%">
{$lng.lbl_check_all} /
{$lng.lbl_uncheck_all}</DIV>
<TABLE border="0" cellpadding="2" cellspacing="1" width="100%">
<FORM action="process_order.php" method="POST" name="processorderform">
<INPUT type="hidden" name="mode" value="">
{assign var="colspan" value=6}
<TR class="TableHead">
<TD width="5"></TD>
<TD width="5%" nowrap>{if $search_prefilled.sort_field eq "orderid"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}
#</TD>
<TD nowrap>{if $search_prefilled.sort_field eq "status"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}
{$lng.lbl_status}</TD>
<TD width="30%" nowrap>{if $search_prefilled.sort_field eq "customer"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}
{$lng.lbl_customer}</TD>
{if $usertype eq "A" and $single_mode eq ""}
{assign var="colspan" value=7}
<TD width="20%" nowrap>{if $search_prefilled.sort_field eq "provider"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}
{$lng.lbl_provider}</TD>
{/if}
<TD width="20%" nowrap>{if $search_prefilled.sort_field eq "date"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}
{$lng.lbl_date}</TD>
<TD width="20%" align="right" nowrap>{if $search_prefilled.sort_field eq "total"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}
{$lng.lbl_total}</TD>
</TR>
{section name=oid loop=$orders}
{math equation="x + ordertotal" x=$total ordertotal=$orders[oid].total assign="total"}
{if $orders[oid].status eq "P" or $orders[oid].status eq "C"}
{math equation="x + ordertotal" x=$total_paid ordertotal=$orders[oid].total assign="total_paid"}
{/if}
<TR{cycle values=", class='TableSubHead'"}>
<TD width="5"><INPUT type="checkbox" name="orderids[{$orders[oid].orderid}]"></TD>
<TD>
#{$orders[oid].orderid}</TD>
<TD nowrap>
{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Module ne "")}
<INPUT type="hidden" name="order_status_old[{$orders[oid].orderid}]" value="{$orders[oid].status}">
{include file="main/order_status.tpl" status=$orders[oid].status mode="select" name="order_status[`$orders[oid].orderid`]"}
{else}
{include file="main/order_status.tpl" status=$orders[oid].status mode="static"}
{/if}
{if $active_modules.Stop_List ne '' && $orders[oid].blocked eq 'Y'}
[img]{$ImagesDir}/no_ip.gif[/img]
{/if}
</TD>
<TD>{$orders[oid].firstname} {$orders[oid].lastname} ({$orders[oid].login})</TD>
{if $usertype eq "A" and $single_mode eq ""}
<TD>
{$orders[oid].provider}
</TD>
{/if}
<TD nowrap>
{$orders[oid].date|date_format:$config.Appearance.date_format}</TD>
<TD nowrap align="right">
{include file="currency.tpl" value=$orders[oid].total}
</TD>
</TR>
{/section}
<TR>
<TD colspan="{$colspan}">[img]{$ImagesDir}/spacer.gif[/img]</TD>
</TR>
<TR>
<TD colspan="{$colspan}" align="right">{$lng.lbl_gross_total}:
{include file="currency.tpl" value=$total}</TD>
</TR>
<TR>
<TD colspan="{$colspan}" align="right">{$lng.lbl_total_paid}:
{include file="currency.tpl" value=$total_paid}</TD>
</TR>
<TR>
<TD colspan="{$colspan}">
{include file="customer/main/navigation.tpl"}
{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode)}
<INPUT type="button" value="{$lng.lbl_update_status}" onclick="document.processorderform.mode.value='update';document.processorderform.submit();">
{/if}
<INPUT type="button" value="{$lng.lbl_invoices_for_selected}" onclick="document.processorderform.mode.value='invoice';document.processorderform.target='_blank';document.processorderform.submit();">
{if $usertype ne "C"}
<INPUT type="button" value="{$lng.lbl_labels_for_selected}" onclick="document.processorderform.mode.value='label';document.processorderform.submit();">
{/if}
{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode)}
<INPUT type="button" value="{$lng.lbl_delete_selected}" onclick="if(confirm('{$lng.txt_delete_selected_orders_warning|strip_tags}')){ldelim}document.processorderform.mode.value='delete'; document.processorderform.submit();{rdelim}">
{/if}
{if $usertype ne "C"}
<TABLE border="0" cellpadding="2" cellspacing="1">
<TR>
<TD class="FormButton" nowrap>{$lng.lbl_export_file_format}:</TD>
<TD width="10"></TD>
<TD>
<SELECT name="export_fmt">
<OPTION value="csv_tab"{if $search_prefilled.export_fmt eq "csv_tab"} selected{/if}>CSV {$lng.lbl_with_tab_delimiter}</OPTION>
<OPTION value="csv_semi"{if $search_prefilled.export_fmt eq "csv_semi"} selected{/if}>CSV {$lng.lbl_with_semicolon_delimiter}</OPTION>
<OPTION value="csv_comma"{if $search_prefilled.export_fmt eq "csv_comma"} selected{/if}>CSV {$lng.lbl_with_comma_delimiter}</OPTION>
{if $active_modules.QuickBooks eq "Y"}
{include file="modules/QuickBooks/orders.tpl"}
{/if}
</SELECT>
<INPUT type="button" value="{$lng.lbl_export_selected}" onclick="document.processorderform.mode.value='export';document.processorderform.submit();">
</TD>
</TR>
</TABLE>
{$lng.txt_export_all_found_orders_text}
<INPUT type="button" value="{$lng.lbl_export_all_found}" onclick="document.processorderform.mode.value='export_found';document.processorderform.submit();">
{/if}
</TD>
</TR>
</FORM>
</TABLE>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_search_results content=$smarty.capture.dialog extra="width=100%"}
{/if}