<?php
!defined('IN_ONEZ') && exit('Access Denied');
include_once(dirname(__FILE__).'/init.php');

$groupid=onez()->gp('groupid');
$gid=(int)onez()->gp('gid');


$G['title']='我的账户';

#初始化表单
$form=onez('admin')->widget('form')
  ->set('title',$G['title'])
  ->set('values',$item)
;
#创建表单项
$form->add(array('type'=>'hidden','key'=>'action','value'=>'save'));
$form->add(array('label'=>onez('chat.group.plugin.credit')->name(),'type'=>'html','html'=>'<code>'.onez('chat.group.plugin.credit')->value($G['userid']).'</code>','hint'=>''));


#处理提交
if($onez=$form->submit()){
  ob_clean();
  $G['this']->data()->open('member')->update($onez,"id='$G[userid]'");
  onez()->ok('操作成功','reload2');
}
onez('admin')->header();
?>
<section class="content-header">
  <h1>
    <?=$G['title']?>
  </h1>
  <ol class="breadcrumb">
    <li>
      <a href="<?php echo onez()->href('/')?>">
        <i class="fa fa-dashboard">
        </i>
        管理首页
      </a>
    </li>
    <li class="active">
      <?=$G['title']?>
    </li>
  </ol>
</section>
<section class="content">
  <form id="form-common" method="post">
    <div class="box box-info">
      <div class="box-header with-border">
        <h3 class="box-title">
          <?=$G['title']?>
        </h3>
        <div class="box-tools pull-right">
        </div>
      </div>
      <div class="box-body">
        <?=$form->code()?>
      </div>
      <div class="box-footer clearfix">
        <?if(onez('chat.group.plugin.credit')->option('charge_user')){?>
        <a href="<?=onez('chat.group.plugin.credit')->href('/group/charge.php')?>" class="btn btn-success onez-miniwin">人工充值</a>
        <?}?>
        
        <?if(onez('chat.group.plugin.credit')->option('turn_enabled')){?>
        <a href="<?=onez('chat.group.plugin.credit')->href('/group/turn.php')?>" class="btn btn-success onez-miniwin">转账</a>
        <?}?>
        
        <?if(onez('chat.group.plugin.credit')->option('cash_enabled')){?>
        <a href="<?=onez('chat.group.plugin.credit')->href('/group/cash.php')?>" class="btn btn-success onez-miniwin">提现</a>
        <?}?>
        
        <a href="<?=onez('chat.group.plugin.credit')->href('/group/money.log.php')?>" class="btn btn-info onez-miniwin">交易记录</a>
      </div>
    </div>
    <input type="hidden" name="action" value="save" />
  </form>
</section>
<?php
onez('admin')->footer();
?>