<?php (!defined('IN_ADMIN') || !defined('IN_MUDDER')) && exit('Access Denied'); ?>
<div id="body">
<form method="post" action="admincp.php?action=<?=$action?>&file=<?=$file?>&">
    <div class="space">
        <div class="subtitle">物品管理</div>
        <table class="maintable" border="0" cellspacing="0" cellpadding="0">
            <tr class="altbg1">
                <td>删?</td>
                <td>显示顺序</td>
                <td>名称</td>
                <td>价格</td>
                <td>数量</td>
                <td>已兑换</td>
                <td>可用</td>
                <td>详情</td>
            </tr>
            <?if($gifts) foreach($gifts as $gift) { ?>
            <tr>
                <td><input type="checkbox" name="giftsids[]" value="<?=$gift['giftid']?>" /></td>
                <td><input type="text" name="gifts[<?=$gift['giftid']?>][displayorder]" value="<?=$gift['displayorder']?>" class="txtbox5" /></td>
                <td><input type="text" name="gifts[<?=$gift['giftid']?>][name]" value="<?=$gift['name']?>" class="txtbox2" /></td>
                <td><input type="text" name="gifts[<?=$gift['giftid']?>][price]" value="<?=$gift['price']?>" class="txtbox5" /></td>
                <td><input type="text" name="gifts[<?=$gift['giftid']?>][num]" value="<?=$gift['num']?>" class="txtbox5" /></td>
                <td><?=$gift['salevolume']?></td>
                <td><input type="checkbox" name="gifts[<?=$gift['giftid']?>][available]" value="1" <?if($gift['available']){?>checked="checked" <?}?>/></td>
                <td><a href="admincp.php?action=exchange&file=giftedit&giftid=<?=$gift['giftid']?>">详情</a></td>
            </tr>
            <? } ?>
            <tr class="altbg1">
                <td colspan="8">
                    <input type="button" name="select" value="全选" class="btn2" onclick="checkbox_checked('giftsids[]');" /><input type="button" name="add" value="增加" class="btn2" onclick="location.href='admincp.php?action=exchange&file=giftadd';" />
                </td>
            </tr>
        </table>
        <center><input type="submit" name="dosubmit" value=" 提交 " class="btn" /></center>
    </div>
</form>
</div>