Пример #1
0
function member_edit()
{
    global $head_url, $header_config;
    if (!submitcheck('editsubmit')) {
        $uid = intval($_GET['uid']);
        $info = member_info($uid);
        $info = pstripslashes($info);
        $info = dhtmlspecialchars($info);
        $yearselect = $monthselect = $dayselect = "<option value=\"\">" . cplang('nolimit') . "</option>\n";
        $yy = dgmdate(TIMESTAMP, 'Y');
        for ($y = $yy; $y >= $yy - 100; $y--) {
            $y = sprintf("%04d", $y);
            $yearselect .= "<option value=\"{$y}\" " . ($info['birthyear'] == $y ? 'selected' : '') . ">{$y}</option>\n";
        }
        $info['yearselect'] = $yearselect;
        for ($m = 1; $m <= 12; $m++) {
            $m = sprintf("%02d", $m);
            $monthselect .= "<option value=\"{$m}\" " . ($info['birthmonth'] == $m ? 'selected' : '') . ">{$m}</option>\n";
        }
        $info['monthselect'] = $monthselect;
        for ($d = 1; $d <= 31; $d++) {
            $d = sprintf("%02d", $d);
            $dayselect .= "<option value=\"{$d}\" " . ($info['birthday'] == $d ? 'selected' : '') . ">{$d}</option>\n";
        }
        $info['dayselect'] = $dayselect;
        $info['bloodtype_select'] = select_output(array('A', 'B', 'AB', milu_lang('other')), milu_lang('other'), 'set[bloodtype]', $info['bloodtype']);
        $info['education_select'] = select_output(array(milu_lang('boshi'), milu_lang('shuoshi'), milu_lang('benke'), milu_lang('zuanke'), milu_lang('zhongxue'), milu_lang('xiaoxue'), milu_lang('other')), milu_lang('other'), 'set[education]', $info['education']);
        $info['regdate'] = $info['regdate'] ? dgmdate($info['regdate'], 'Y-m-d H:i') : '';
        $info['lastvisit'] = $info['lastactivity'] ? dgmdate($info['lastvisit'], 'Y-m-d H:i') : '';
        $info['lastactivity'] = $info['lastactivity'] ? dgmdate($info['lastactivity'], 'Y-m-d H:i') : '';
        $info['lastpost'] = $info['lastpost'] ? dgmdate($info['lastpost'], 'Y-m-d H:i') : '';
        $info['header'] = pick_header_output($header_config, $head_url, array('current' => 'member_list'));
        return $info;
    } else {
        $uid = intval($_GET['uid']);
        if (!$uid) {
            cpmsg_error(milu_lang('err'));
        }
        $setarr = paddslashes($_GET['set']);
        DB::update('strayer_member', $setarr, array('uid' => $uid));
        cpmsg(milu_lang('op_success'), PICK_GO . "member&myac=member_edit&uid=" . $uid, 'succeed');
    }
}
Пример #2
0
function show_pick_class()
{
    return select_output(pick_category_list(TRUE), '', 'move_cid', '', 1);
}