{strip}
{if $ajax eq 0}
{include file="$admingentemplates/admin_top.tpl"}

<link href="{$site_root}{$template_root}/greybox/greybox.css" rel="stylesheet" type="text/css" media="all">
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/AmiJS.js"></script>
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/greybox.js"></script>
<script language="JavaScript" type="text/javascript" src="{$site_root}{$template_root}/js/images.js"></script>

<script language="JavaScript" type="text/javascript">
	var GB_IMG_DIR = "{$site_root}{$template_root}/greybox/";
</script>

<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$lang.cards.admin.orders_list}</div>
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
<div class="help_text" style="display:block;">
    <div class="close_help">
        <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
    </div>
    <div class="help_body">
        <span class="help_title">{$lang.help}:</span>{$lang.admin_help.orders_list}
    </div>
</div>

<ul class="tabs">
    <li>
        <a {if $info.active == "catalog"} class="current" {else} href="admin_cards.php"  {/if}>{$lang.admin_menu.ecards_catalog} </a>
    </li>
    <li>
        <a {if $info.active == "orders"} class="current" {else} href="admin_cards.php?sel=orders" {/if}>{$lang.admin_menu.ecards_orders}</a>
    </li>
    <li>
        <a {if $info.active == "song"} class="current" {else} href="admin_cards.php?sel=settings_songs" {/if}>{$lang.admin_menu.ecards_songs}</a>
    </li>        
</ul>
<div style="height:4px;font-size:0px;" class="user_operation_line"> </div>
<div class="cr"></div>
{* <b>{$lang.cards.admin.order.total}:&nbsp;<font>{$payment_stat.services.ecards}</font>&nbsp;{$form.costunits}</b> *}

<b>{$lang.cards.admin.order.total}:&nbsp;<font>{$num_orders}</font>&nbsp;({$sum_orders} {$costunits})</b>

<div>
{/if}
	<div id="orders" style="padding-top: 10px;">
	<table border=0 cellspacing=0 cellpadding=0 width="100%">
	{if $orders}		
		<tr class="table_header">
			<td >{$lang.cards.admin.order.card_header}</td>
			<td width="50">{$lang.cards.admin.order.card_price}</td>
			<td width="100">{$lang.cards.admin.order.sender}</td>
			<td width="100">{$lang.cards.admin.order.recipient}</td>
			<td width="120">{$lang.cards.admin.order.card_image}</td>
			<td width="200">{$lang.cards.admin.order.order_status}</td>
		</tr>
		{foreach name=t item=item from=$orders}
		<tr {if $smarty.foreach.t.iteration mod 2 eq 0}class="even"{else}class="odd"{/if}>
			<td class="main_content_text"  valign="top">{$item.card_header}</td>
			<td class="main_content_text"  valign="top">{$item.card_price}</td>
			<td class="main_content_text"  valign="top"><a href="admin_users.php?sel=edituser&editpage=1&page=1&id={$item.id_sender}" target="_blank">{$item.sender_login}</a></td>
			<td class="main_content_text"  valign="top"><a href="admin_users.php?sel=edituser&editpage=1&page=1&id={$item.id_user_to}" target="_blank">{$item.user_to_login}</a></td>
			<td class="main_content_text"  valign="top" style="padding-top:5px;padding-bottom:5px;">
				<a href="#" onclick="return GB_showImage('{$item.name_unslashed}', '{$item.card_image_big}')">
					<img src="{$item.card_image_thumb}" height="100" width="100" style="border: 1px solid #cccccc;">
				</a>
			</td>
			<td class="main_content_text"  valign="top">
				{$item.status_lang}
			</td>
		</tr>
		{foreachelse}
			<tr height="40">
				<td class="main_error_text" align="left" colspan="11">{$lang.interests_spr.empty}</td>
			</tr>
		{/foreach}
		<tr class="table_header">
            <td colspan="11">
                &nbsp;&nbsp;
                {if $links}
                {foreach item=item from=$links.pages}
                    &nbsp;<a onclick="PageList('bad_words', '{$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('bad_words', '{$links.previous}');">< {$lang.content.previous} {$per_page}</a>
                {/if}
                {if $links.next}
                    <a onclick="PageList('bad_words', '{$links.next}');">{$lang.content.next} {$per_page} ></a>
                {/if}
                </div>
            </td>
        </tr>
	{else}
		<tr height="40">
			<td class="main_error_text" align="left" colspan="5" bgcolor="#FFFFFF">{$lang.cards.admin.no_orders}</td>
		</tr>
	{/if}
	</table>
	</div><div class="cr">&nbsp;</div>
{/strip}
{if $ajax eq 0}
{include file="$admingentemplates/admin_bottom.tpl"}
{/if}
<script type="text/javascript">
{literal}
function PageList(id_div, par) {
        ajaxLoadingImage(1, 'orders');
        $.post("admin_cards.php", par, function(data){
            ajaxLoadingImage(0, 'orders');
            $('#orders').html(data);
        });
    }
{/literal}
</script>