{include file="$admingentemplates/admin_top.tpl"}
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_giftshop.php">{$lang.button.back}</a>
</div>

<font class=red_header>{$header.razdel_name}</font>
<div class="cr">&nbsp;</div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="help_text" style="padding:5px;">
	<div class="close_help">
	  <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
	</div>
	<span class="help_title">{$lang.help}:</span>{$help.gs_orders}
</div>
<div class="cr">&nbsp;</div>
<ul class="tabs">
    <li>
        <a href="admin_giftshop.php">{$lang.admin_menu.giftshop_catalog}</a>
    </li>
    <li>
        <a class="current">{$lang.admin_menu.giftshop_orders}</a>
    </li>
</ul>
<div class="user_operation_line" style="height: 5px;"></div>
<div class="cr">&nbsp;</div>
<div id="tooltip" onclick="hideToolTip()" style="text-align:center; background-color: #FFFFFF; border: 1px dotted; text-align: {$default_left}; position:absolute; display:none; padding:5px;"></div>
{literal}
<script type="text/javascript">
$(function() {
$('#tool_tip_4 *').tooltip();
});
</script>
{/literal}
<div id="giftshop_orders_table_div">
<table border=0 cellspacing=0 cellpadding=0 width="100%">
{*    {if $links}
    <tr bgcolor="#ffffff">
        <td height="20"  colspan=9 align="left" class="main_content_text" >{$links}</td>
    </tr>
    {/if}*}
            <tr class="table_header">
                <td class="main_header_text" align="center" width="20">{$header.id}</td>
                <td class="main_header_text" align="left" width="70">{$header.date_order}</td>
                <td class="main_header_text" align="left">{$header.from}</td>
                <td class="main_header_text" align="left">{$header.to}</td>
                <td class="main_header_text" align="left">{$header.order}</td>
                <td class="main_header_text" align="left">{$header.total}</td>
                <td class="main_header_text" align="center">{$header.status}</td>
                <td class="main_header_text" align="center">{$header.delivery}</td>
                <td class="main_header_text" align="right" width="80">{$lang.button.action}</td>
            </tr>
            {if $items}
            {section name=spr loop=$items}
			<tr {if $smarty.section.spr.index mod 2 eq 1}class="even"{else}class="odd"{/if}>
                <td class="main_content_text" align="center" valign="top" style="padding-top: 10px;">{$items[spr].id}</td>
                <td class="main_content_text" align="left" valign="top" style="padding-top: 10px;">{$items[spr].date_order}</td>
                <td class="main_content_text" align="left" valign="top" style="padding-top: 10px;">{$items[spr].user_from.login}</td>
                <td class="main_content_text" align="left" valign="top" style="padding-top: 10px;">
                    {$items[spr].user_to.login}
                    {if $items[spr].user_to.delivery_adress}
                    <div>
                        <a onClick="$('#delivery_adress_{$items[spr].id}').toggle(); return false;" href="#">{$header.delivery_adress}</a>
                        <div id="delivery_adress_{$items[spr].id}" style="display: none">
                            {$items[spr].user_to.delivery_adress}
                        </div>
                    </div>
                    {/if}
                </td>
                <td class="main_content_text" align="left" valign="top" style="padding-top: 10px;">{$items[spr].order}</td>
                <td class="main_content_text" align="left" valign="top" style="padding-top: 10px;">{$items[spr].total} {$form.curency}</td>
                <td class="main_content_text" align="center" valign="top" style="padding-top: 10px;">{$items[spr].status}</td>
                <td class="main_content_text" align="center" valign="top" style="padding-top: 10px;">{$items[spr].delivery_status}</td>
                <td class="main_content_text" align="right" valign="top" style="padding-top: 10px;">
					<div class="block_action fr" style="display: none;" >
						<div class="action_del" style="display: block;cursor:pointer;">				
							<img width="16" alt="" src="{$site_root}{$template_root}/images/photo_delete.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" onclick="javascript: document.location.href='./{$form.file_name}?sel=orders_delete&id={$items[spr].id}&page={$form.page}'">
						</div>
					</div>
					<div style="width:10px;float:right;" class="fl">&nbsp;</div>
                {if $items[spr].status eq '-'}
{*                <a href="./{$form.file_name}?sel=orders_status&id={$items[spr].id}&page={$form.page}">{$button.status}</a>&nbsp;*}
					<div class="block_action fr" style="display: none;">
						<div class="action_del" style="display: block;cursor:pointer;">				
							<img width="16" alt="" src="{$site_root}{$template_root}/images/icn_active.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$button.status}');return false" onclick="javascript: document.location.href='./{$form.file_name}?sel=orders_status&id={$items[spr].id}&page={$form.page}'">
						</div>
					</div>
                {elseif $items[spr].delivery_status eq '-'}
                {*<a href="./{$form.file_name}?sel=orders_delivery&id={$items[spr].id}&page={$form.page}">{$header.delivery}</a>&nbsp;*}
					<div class="block_action fr" style="display: none;">
						<div class="action_del" style="display: block;cursor:pointer;">				
							<img width="16" alt="" src="{$site_root}{$template_root}/images/icn_admin_giftshop_orders.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.admin_menu.giftshop_deliver}');return false" onclick="javascript: document.location.href='./{$form.file_name}?sel=orders_delivery&id={$items[spr].id}&page={$form.page}'">
						</div>
					</div>
					<div style="width:10px;float:right;" class="fl">&nbsp;</div>
                {/if}
{*                <a href="./{$form.file_name}?sel=orders_delete&id={$items[spr].id}&page={$form.page}">{$button.delete}</a>&nbsp;*}
                </td>
            </tr>
            {/section}
            {else}
            <tr height="40">
                <td class="main_error_text" align="left" colspan="8" bgcolor="#FFFFFF">{$header.category_empty}</td>
            </tr>
            {/if}
{*    {if $links}
    <tr bgcolor="#ffffff">
        <td height="20"  colspan=9 align="left"  class="main_content_text" >{$links}</td>
    </tr>
    {/if}*}
                    <tr class="table_header">
                        <td colspan="9">
                            &nbsp;&nbsp;
                            {if $links}
                            {foreach item=item from=$links.pages}
                                &nbsp;<a onclick="PageList('giftshop_orders_table_div', '{$item.link}');" class="page_link" {if $item.selected} style=" font-weight: bold; text-decoration: none;" {/if}>{$item.name}</a>&nbsp;
                            {/foreach}
                            {/if}
                            <div class="page_navigation">
                            {if $links.previous}
                                <a onclick="PageList('giftshop_orders_table_div', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
                            {/if}
                            {if $links.next}
                                <a onclick="PageList('giftshop_orders_table_div', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
                            {/if}
                            </div>
                        </td>
                    </tr>
	
</table>
</div>
	<!-- /main spr row -->
<script type="text/javascript">
{literal}
		function showToolTip(e,text){
			if(document.all)e = event;
			var obj = document.getElementById('tooltip');
			obj.innerHTML = text;
			obj.style.display = 'block';
			var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
			var leftPos = e.clientX - $('#tooltip').width()-10;
			if(leftPos<0)leftPos = 0;
			obj.style.left = leftPos + 'px';
			obj.style.top = e.clientY - obj.offsetHeight -10 + st + 'px';
		}
		function hideToolTip(){
			document.getElementById('tooltip').style.display = 'none';
		}
{/literal}
</script>
{include file="$admingentemplates/admin_bottom.tpl"}