예제 #1
0
    url_nav(lang('repurelate'), $urlsarr, 'hand');
    if (!submitcheck('brepuadd')) {
        $modearr = array('0' => lang('increase'), '1' => lang('deductvalue'));
        tabheader(lang('hand_repu'), 'repuadd', "?entry={$entry}&action={$action}");
        trbasic(lang('member_cname'), 'repuadd[mname]', '', 'text', lang('agmultiuser'));
        trbasic(lang('operate_type'), '', makeradio('repuadd[mode]', $modearr), '');
        trbasic(lang('amount'), 'repuadd[repus]');
        trbasic(lang('reason'), 'repuadd[reason]', '', 'btext');
        tabfooter('brepuadd');
    } else {
        $repuadd['mname'] = trim($repuadd['mname']);
        $repuadd['repus'] = max(0, round($repuadd['repus'], 2));
        if (empty($repuadd['mname']) || empty($repuadd['repus'])) {
            amessage('datamissing', M_REFERER);
        }
        $repus = empty($repuadd['mode']) ? $repuadd['repus'] : -$repuadd['repus'];
        $mnames = array_filter(explode(',', $repuadd['mname']));
        $actuser = new cls_userinfo();
        foreach ($mnames as $v) {
            $v = trim($v);
            if (empty($v)) {
                continue;
            }
            $actuser->activeuserbyname($v);
            $actuser->repuadd($repus, $repuadd['reason'], 1);
        }
        unset($actuser);
        adminlog(lang('hand_repu'), lang('hand_repu'));
        amessage('handrepufin', "?entry={$entry}&action={$action}");
    }
}