<?php
!defined('IN_ONEZ') && exit('Access Denied');
include_once(dirname(__FILE__).'/init.php');
$A['title']='手动充值';
if(defined('IS_POST')){
  $onez=array(
    'key1'=>(float)onez()->gp('key1'),
    'pic'=>onez()->gp('pic'),
    'summary'=>onez()->gp('summary'),
  );
  $money=(float)$onez['key1'];
  if($money<=0){
    $A['tip']='充值金额有误';
    return;
  }
  $onez['userid']=$G['userid'];
  $onez['key2']='wait';
  $onez['money1']=$money;
  $onez['upid']=(int)$groupid;
  $G['this']->data()->open('charge.user')->insert($onez);
  $A['tip']='提交成功';
  $A['exit']='1';
  $A['token']='page';
  $A['action']=$this->action('charge.log');
  return;
}
$A['right']=array(
  'subject'=>'申请记录',
  'token'=>'page',
  'action'=>$this->action('charge.log'),
);
$record[]=array(
  'type'=>'space',
  'height'=>'5',
);
$record[]=array(
  'type'=>'input',
  'label'=>'充值金额',
  'key'=>'key1',
  'inputype'=>'number',
  'hint'=>'请正确填写您充值的金额',
  'notempty'=>'充值金额不能为空',
);
$record[]=array(
  'type'=>'input',
  'label'=>'备注信息',
  'key'=>'summary',
  'inputype'=>'textarea',
  'hint'=>'',
  'notempty'=>'',
);
$record[]=array(
  'type'=>'space',
  'height'=>'5',
);
$record[]=array(
  'type'=>'pics',
  'label'=>'充值截图',
  'key'=>'pic',
  'hint'=>'',
  'addpic'=>'1',
);
$charge_intro=onez('chat.group.plugin.credit')->option('charge_intro');
if($charge_intro){
  $record[]=array(
    'type'=>'html',
    'html'=>'<p style="padding:15px;">'.$charge_intro.'</p>',
  );
}
$record[]=array(
  'type'=>'button',
  'style'=>'2',
  'name'=>'提交申请',
  'token'=>'submit',
);

