<?php
!defined('IN_ONEZ') && exit('Access Denied');
$groupid=(int)onez()->gp('groupid');
$A['title']='充值申请记录';
$A['tpl']='refresh_more';

$T=$G['this']->data()->open('charge.user')->record("userid='$G[userid]' order by id desc $G[pagelimit]");
if(count($T)<12){
  $A['tpl']='refresh';
}
if($G['page']<=1){
  $record[]=array(
    'type'=>'space',
    'height'=>'5',
  );
}
foreach($T as $rs){
  $rt='';
  if($rs['key2']=='ok'){
    $rt='<span style="color:green">充值成功</span>';
  }elseif($rs['key2']=='fail'){
    $rt='<span style="color:red">充值失败</span><br />理由:'.$rs['because'];
  }else{
    $rt='<span style="color:orange">等待审核</span>';
  }
  $record[]=array(
    'type'=>'pictext',
    'name'=>date('Y-m-d H:i:s',$rs['addtime']),
    'myhtml'=>'<div class="right-info-link">'.$rt.'</div>',
  );
  if($rs['key2']=='fail'){
    $record[]=array(
      'type'=>'pictext',
      'style'=>array('color'=>'red'),
      'name'=>$rs['because'],
    );
  }
  $record[]=array(
    'type'=>'html',
    'classname'=>'itemline',
    'html'=>'<img src="'.$rs['pic'].'" />',
  );
  $record[]=array(
    'type'=>'space',
    'height'=>'5',
  );
}