{template 'header.html'}
<?php
if(hasflash()){
	$showmessage = showflash();
	//var_dump($showmessage);exit;
	if(strlen($showmessage)>200){
?>
<div id='message'><span style="color:red;float:left"><?php echo $showmessage; ?></span>
    <span style="color:blue;float:right"><a href="#" onClick="javascript:turnoff('#message');">(×)</a></span></div><div class="blank20"></div>
<?php
    }else{
?>
<link rel="stylesheet" href="{$base_url}/js/dialog.css">
<script type="text/javascript" src="{$base_url}/js/dialog.js"></script>
<script type="text/javascript">
    var d = dialog({
        title: "{lang('prompted')}",
        content: "<?php echo $showmessage; ?>",
        ok: function () {}
    });
    d.showModal();
</script>
<?php
    }
}
?>
<div class="container">

        <div class="user-center">

            <div class="user-nav-tab">
                <h3>

                        <i class="icon-settings"></i>
                    <a href="{url('user/index')}">
                        {lang('membercenter')}
                    </a>
                </h3>
                <!-- Nav tabs -->
                {template_user 'user_menu.html'}
            </div>


            <div class="blank30"></div>

            <div class="user-content-table-nav">
                <ul>
                    <?php if($manage=='consumption'){ ?>
                    <li><a href="{url('manage/consumptionlist/manage/consumption')}" class="active">{lang('recharge_record')}</a></li>
                    <li><a href="{url('manage/consumptionlist/manage/xfconsumption')}" >{lang('records_of_consumption')}</a></li>
                    <?php } else { ?>
                    <li><a href="{url('manage/consumptionlist/manage/consumption')}" >{lang('recharge_record')}</a></li>
                    <li><a href="{url('manage/consumptionlist/manage/xfconsumption')}" class="active">{lang('records_of_consumption')}</a></li>
                    <?php }?>
                    <span class="pull-right">
                        {lang('balance')}：
                {lang('unit')}<span style="font-size:2.0rem; color: #FF4A00;font-weight: :600;">{getmenoy()}</span>&nbsp;&nbsp;&nbsp;&nbsp;
            	{lang('integral')}：{getintegration()}&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-success" href="{url('archive/consumption')}" target="_blank">
                                    {lang('recharge')}
                                </a>
                    </span>
                </ul>

            </div>
            <div class="blank30"></div>



<form name="listform" id="listform"  action="<?php echo uri();?>" method="post">



<div class="table-responsive">
<table class="table table-striped table-hover ">
    <?php if($manage=='consumption'){ ?>
        <thead>
            <tr class="th">
                <th class="orders-list-id"><!--oid-->{lang('id')}</th>
                <th class="orders-list-title">{lang('recharge_amount')}</th>
                <th class="orders-list-status"><!--status-->{lang('status')}</th>               
                <th class="orders-list-adddate"><!--adddate-->{lang('adddate')}</th>
                <th class="text-center">{lang('dosomething')}</th>
            </tr>

        </thead>
        <tbody>
            {loop $data $d}
            <tr class="s_out">
                <td class="orders-list-id">{cut($d['oid'])} </td>
                <td class="orders-list-title">{cut($d['menoy'])}</td>
                <td class="orders-list-status">
					<?php
					 switch($d['status']){
						   case 1:
						     echo "<p><span class='btn-soft-success'>".lang('complete')."</span></p>";
							break;
							default:
							 echo "<p><span class='btn-icon-inner'>".lang('non-payment')."</span></p>";
							break;
					}
					?>
				</td>
                <td class="orders-list-adddate">{$d['adddate']}</td>
                <td class="text-center">

					<?php
					 if($d['status']==0){ ?>&nbsp;&nbsp;
					  <a  class="btn btn-default" href='<?php echo url("archive/payconsumption/oid/".$d['oid'],false);?>' target="_blank" title="{lang('immediate_payment')}">{lang('pay')}</a>
					<?php };?>
                </td>
            </tr>
            {/loop}
        </tbody>
    <?php } else { ?>
        <thead>
        <tr class="th">
            <th class="orders-list-id"><!--oid-->{lang('id')}</th>
            <th class="orders-list-title">{lang('consumption_content')}</th>
            <th class="orders-list-title">{lang('consumption_amount')}</th>
            <th class="orders-list-adddate"><!--adddate-->{lang('adddate')}</th>
            <th class="">{lang('dosomething')}</th>
        </tr>

        </thead>
        <tbody>
        {loop $data $d}
        <tr class="s_out">
            <td class="orders-list-id">{cut($d['id'])} </td>
            <td class="orders-list-title">{cut($d['content'])}</td>
            <td class="orders-list-title">{cut($d['menoy'])}</td>
            <td class="orders-list-adddate">{$d['adddate']}</td>
            <td class="">
                <?php $code = explode('-', $d['oid']); if(count($code) == 4 ){  ?>
                     <a href='{url("archive/orders/oid/".$d["oid"])}' target="_blank" title="{lang('look')}"><i class="glyphicon glyphicon-eye-open"></i></a>
                <?php }else{ ?>
                     <a href='{url("archive/consumption/oid/".$d["oid"])}' target="_blank" title="查看"><i class="glyphicon glyphicon-eye-open"></i></a>
                <?php } ?>
            </td>
        </tr>
        {/loop}
        </tbody>
    <?php }?>
    </table>
</div>

    <div class="blank30"></div>
   

</form>


<div class="pages">
<?php if(get('table')!='type' && front::get('case')!='field') echo pagination::html($record_count); ?>
</div>
<div class="blank30"></div>

</div>
</div>

<div class="blank30"></div>
{template 'footer.html'}