{template header}
{template magic_navbar}

</td><td align="right" valign="top">
<form method="post" action="magic.php?action=market">
<input type="hidden" name="formhash" value="{FORMHASH}">
<!--{if !$operation || $operation == 'my'}-->
	<div class="spaceborder" style="width: 98%">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%">
	<tr class="header"><td colspan="7" align="left"><div class="right"><a href="magic.php?action=market&operation=my">{lang magics_market_my}</a></div>{lang magics_market}</td></tr>
	<tr align="center" class="category">
	<td width="15%">{lang magics_name}</td>
	<td width="30%">{lang magics_function}</td>
	<td width="11%">{lang magics_price}</td>
	<td width="10%">{lang magics_num}</td>
	<td width="11%">{lang magics_single_weight}</td>
	<td width="15%">{lang magics_seller}</td>
	<td width="8%">{lang magics_operation}</td>
	</tr>
	<!--{if $magiclist}-->
		<!--{loop $magiclist $magic}-->
			<tr class="row" onMouseOver="this.style.backgroundColor='{ALTBG1}'" onMouseOut="this.style.backgroundColor='{ALTBG2}'">
			<td align="center"><a href="magic.php?action=shop&amp;operation=buy&amp;magicid=$magic[magicid]" target="_blank">$magic[name]</a></td>
			<td align="center">$magic[description]</td>
			<td align="center">$magic[price] $extcredits[$creditstrans][title]</td>
			<td align="center">$magic[num]</td>
			<td align="center">$magic[weight]</td>
			<td align="center"><a href="viewpro.php?uid=$magic[uid]" target="_blank">$magic[username]</a></td>
			<td align="center">
				<!--{if $magic[uid] != $discuz_uid}-->
					<a href="magic.php?action=market&operation=buy&mid=$magic[mid]">{lang magics_operation_buy}</a>
				<!--{else}-->
					<a href="magic.php?action=market&operation=down&mid=$magic[mid]">{lang magics_operation_down}</a>
				<!--{/if}-->
			</td>
			</tr>
		<!--{/loop}-->
	<!--{else}-->
		<td class="altbg1" colspan="7">{lang magics_market_nonexistence}</td></tr>
	<!--{/if}-->
	</table>
	</div>
	<!--{if !$operation == 'my'}-->
	<div class="right" style="font-weight: normal; margin-top: {TABLESPACE}px">
		<select name="magicid"><option value="">{lang magics_name}</option>$magicselect</select>&nbsp;
		<select name="orderby">
			<option value="">{lang magics_market_order}</option>
			<option value="price" $check[price]>{lang magics_price}</option>
			<option value="num" $check[num]>{lang magics_num}</option>
		</select>&nbsp;
		<select name="ascdesc">
			<option value="">{lang orderby}</option>
			<option value="ASC" $check[ASC]>{lang order_asc}</option>
			<option value="DESC" $check[DESC]>{lang order_desc}</option>
		</select>
		<input class="button" type="submit" name="searchsubmit" value="{lang search}">
	</div>
	<!--{/if}-->
	<div class="subtable" style="width: 98%; margin-top: {TABLESPACE}px">$multipage</div>
<!--{elseif $operation == 'buy' || $operation == 'down'}-->
	<input type="hidden" name="operation" value="$operation">
	<input type="hidden" name="mid" value="$mid">
	<div class="spaceborder" style="width: 98%">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
	<tr class="header"><td colspan="3" align="left">{lang magics_market}</td></tr>
	<tr class="altbg2"><td rowspan="5" class="altbg2" align="center" width="20%"><img src="images/magics/$magic[pic]"><br></td>
	<td class="altbg2" width="80%">{lang magics_name}:$magic[name]</td></tr>
	<tr class="altbg2"><td class="altbg2">{lang magics_function}:$magic[description]</td></tr>
	<tr class="altbg2"><td class="altbg2">{lang magics_seller}:<a href="viewpro.php?uid=$magic[uid]" target="_blank">$magic[username]</a> {lang magics_market_price}:$magic[marketprice]</td></tr>
	<tr class="altbg2"><td class="altbg2">{lang magics_price}:$magic[price] {lang magics_num}:$magic[num] {lang magics_weight}:$magic[weight]</td></tr>
	<tr class="altbg2"><td class="altbg2" width="10%">
		{lang magics_amount_buy}:<input name="magicnum" type="text" size="5" value="$magic[num]">&nbsp;
	</td></tr>
	</table></div>
	<br />
	<div class="option" style="width: 98%"><div class="submitbutton">
		<!--{if $operation == 'buy'}-->
			<input class="button" type="submit" name="buysubmit" value="{lang magics_operation_buy}">
		<!--{elseif $operation == 'down'}-->
			<input class="button" type="submit" name="downsubmit" value="{lang magics_operation_down}">
		<!--{/if}-->
	</div></div>
<!--{/if}-->
</form>
</td></tr></table>
{template footer}