{include_php file="order.php"}
{include file="header.tpl" mcolspan="colspan=2"}
{include file="messager.tpl"}
{if $page_text}
{$page_text}
{/if}
{if $order_id && !$smarty.request.order_id} {*** Заказ готов ***}
<br>
<div class="info-block">
<p class="info">Вашему заказу присвоен № {$order_id}, и он отправлен на e-mail адрес: <u>{$smarty.request.email_to_order|escape:"html"}</u>!</p>
</div>
<h4 class=hd-order>Заказ № {$order_id}</h4>
<table class=tbl3 border=0 cellspacing=0 cellpadding=0>
<tr>
<th>№</th>
<th>Артикул</th>
<th>Отдел</th>
<th>Наименование</th>
<th align=right nowrap>Цена</th>
<th align=right nowrap>Кол-во</th>
<th align=right nowrap>Стоимость</th>
</tr>
{foreach from=$cart_products item=item name=pr_cart}
<tr{cycle name=cart_z values=" class=alt,"}>
<td>{$smarty.foreach.pr_cart.iteration}.</td>
<td>{$item.product_art|default:" "}</td>
<td>{$departs[$item.depart_id].depart_title}</td>
<td>{$item.product_title}</td>
<td align=right nowrap>{$item.product_price}</td>
<td align=right nowrap>{$item.qty} {$units[$item.unit_id].unit_title}</td>
<td align=right nowrap>{$item.product_price*$item.qty|string_format:"%.2f"|default:"-"}</td>
</tr>
{/foreach}
{if $shipping|@is_array && $shipping|@count}
<tr{cycle name=cart_z values=" class=alt,"}>
<td colspan=2 align=right><i>Доставка:</i></td>
<td colspan=4>{$shipping_options[$smarty.session.shipping_id]}</td>
<td align=right nowrap>{$smarty.session.shipping_price|string_format:"%.2f"|default:"-"}</td>
</tr>
{/if}
<tr{cycle name=cart_z values=" class=alt,"}>
<td colspan=6 align=right><i>Итого:</i></td>
<td align=right nowrap>{$cart_total|string_format:"%.2f"}</td>
</tr>
</table>
{elseif $smarty.request.order_id} {* Просмотр любого заказа *}
<h4 class=hd-order>Заказ № {$order_s.order_id} от {$order_s.order_date}</h4>
<table class=tbl3 border=0 cellspacing=0 cellpadding=0>
<tr>
<th>№</th>
<th>Артикул</th>
<th>Отдел</th>
<th>Наименование</th>
<th align=right nowrap>Цена</th>
<th align=right nowrap>Кол-во</th>
<th align=right nowrap>Стоимость</th>
</tr>
{foreach from=$order_pr item=item name=order_pr}
<tr{cycle name=cart_z values=" class=alt,"}>
<td align=right>{$smarty.foreach.order_pr.iteration}</td>
<td>{$item.product_art|default:" "}</td>
<td>{$departs[$item.depart_id].depart_title}</td>
<td>{$item.product_title}</td>
<td align=right nowrap>{$item.product_price}</td>
<td align=right nowrap>{$item.product_qty}</td>
<td align=right nowrap>{$item.product_price*$item.product_qty|string_format:"%.2f"|default:"-"}</td>
</tr>
{/foreach}
{if $order_s.shipping_id}
<tr{cycle name=cart_z values=" class=alt,"}>
<td colspan=2 align=right><i>Доставка:</i></td>
<td colspan=4>{$shipping_options[$order_s.shipping_id]}</td>
<td align=right nowrap>{$order_s.shipping_price|string_format:"%.2f"|default:"-"}</td>
</tr>
{/if}
<tr{cycle name=cart_z values=" class=alt,"}>
<td colspan=6 align=right><i>Итого:</i></td>
<td align=right nowrap>{$order_s.order_summ+$order_s.shipping_price|string_format:"%.2f"}</td>
</tr>
</table>
<br>
{if $order_s.order_rem}
<span style="color:#060;">Примечания к заказу</span>
<div style="padding:6px; border:1px dotted #363; width:640px; margin-top:2px;">
{$order_s.order_rem}
</div>
<br>
{/if}
<a class=larr href="javascript:history.back()">назад</a>
{else}
{if $smarty.session.user}
<h4 class=hd-user>Информация о заказчике</h4>
{include file="user_show.tpl"}
{else}
<h4 class=hd-user>Авторизация</h4>
<i style="font-size:12px;">Для того, чтобы оформить заказ, Вам необходимо авторизоваться в системе.</i>
{include file="user_login.tpl" order=1}
{/if}
<hr class=ora noshade size=1>
<h4 class=hd-cart>Выбранные товары:</h4>
<table class=tbl3 border=0 cellspacing=0 cellpadding=0>
<tr>
<th>№</th>
<th>Артикул</th>
<th>Отдел</th>
<th>Наименование</th>
<th align=right nowrap>Цена</th>
<th align=right nowrap>Кол-во</th>
<th align=right nowrap>Стоимость</th>
</tr>
{foreach from=$cart_products item=item name=pr_cart}
<tr{cycle name=cart_z values=" class=alt,"}>
<td>{$smarty.foreach.pr_cart.iteration}.</td>
<td>{$item.product_art|default:" "}</td>
<td>{$departs[$item.depart_id].depart_title}</td>
<td>{$item.product_title}</td>
<td align=right nowrap>{$item.product_price}</td>
<td align=right nowrap>{$item.qty} {$units[$item.unit_id].unit_title}</td>
<td align=right nowrap>{$item.product_price*$item.qty|string_format:"%.2f"|default:"-"}</td>
</tr>
{/foreach}
{if $shipping|@is_array && $shipping|@count}
<tr{cycle name=cart_z values=" class=alt,"}>
<td colspan=2 align=right><i>Доставка:</i></td>
<td colspan=4>{$shipping_options[$smarty.session.shipping_id]}</td>
<td align=right nowrap>{$smarty.session.shipping_price|string_format:"%.2f"|default:"-"}</td>
</tr>
{/if}
<tr{cycle name=cart_z values=" class=alt,"}>
<td colspan=6 align=right><i>Итого:</i></td>
<td align=right nowrap>{$cart_total|string_format:"%.2f"}</td>
</tr>
</table>
{if $smarty.session.user}
{if $cart_products|@count}
<form action="/order/" method=get>
<h4 class=hd-note>Дополнительные примечания к заказу:</h4>
<textarea name=order_rem rows=3 cols=70 style="width:640px;"></textarea><br>
<i>Уточнение и подтверждение Вашего адреса e-mail для отправки заказа:</i>
<input type=text name="email_to_order" value="{$smarty.session.user.user_email|escape:"html"}" size=24 maxlength=128 style="width:185px;"><br>
<hr class=ora noshade size=1>
<input type=submit class=button name=submit_order value="Отправить заказ">
</form>
{/if}
{/if}
{/if}
{if $smarty.request.print != "yes"}
{include file="postmain.tpl"}
{/if}
{include file="footer.tpl"}