예제 #1
0
		[1,\'<input type="text" class="txt" name="days[]" size="7">\', ""],
		[1,\'' . $gidsel . '\', ""],
		[1,\'' . $exsel . '\', ""],
		[1,\'<input type="text" class="txt" name="reward[]" size="7">\', ""],
	]]
	</script>';
    showformheader('plugins&operation=config&identifier=dsu_amupper&pmod=admin');
    showtips(lang("plugin/dsu_amupper", "admin2_p1"));
    showtableheader(lang("plugin/dsu_amupper", "admin2_h1"));
    showsubtitle(array(lang("plugin/dsu_amupper", "admin2_t0"), lang("plugin/dsu_amupper", "admin2_t1"), lang("plugin/dsu_amupper", "admin2_t4"), lang("plugin/dsu_amupper", "admin2_t2"), lang("plugin/dsu_amupper", "admin2_t3")));
    $arr = DB::fetch_all("SELECT * FROM %t WHERE id>%d LIMIT %d", array('plugin_dsuamupperc', '-1', '100'), 'id');
    if ($arr) {
        $i = 0;
        $data_f2a = dstripslashes($arr);
        foreach ($data_f2a as $id => $result) {
            $exsel = extc2seled($result['extcredits'], $_G['setting']['extcredits']);
            $gidsel = usergroups2seled($result['usergid'], $usergroups);
            showtablerow('', array(' ', ' ', ' ', ' '), array('<input type="checkbox" class="checkbox" name="delete[]" value="' . $i . '" />', '<INPUT TYPE="hidden" NAME="id[]" value="' . $result['id'] . '"><input type="text" class="txt" name="days[]" value="' . $result['days'] . '" size="7" />', '' . $gidsel . '', '' . $exsel . '', '<input type="text" class="txt" name="reward[]" value="' . $result['reward'] . '" size="7" />'));
            $i++;
        }
    }
    echo '<tr><td></td><td colspan="3"><div><a href="#addrow" name="addrow" onclick="addrow(this, 0)" class="addtr">' . lang("plugin/dsu_amupper", "admin2_s1") . '</a></div></td></tr>';
    showsubmit('submit', lang("plugin/dsu_amupper", "admin2_s2"));
    showtablefooter();
    showformfooter();
} elseif ($_G['adminid'] == '1' && $_GET['formhash'] == FORMHASH) {
    $mrcs = array();
    $max_i = max(count($_GET['days']), count($_GET['usergid']), count($_GET['extcredits']), count($_GET['reward']));
    for ($i = 0; $i < $max_i; $i++) {
        if (intval($_GET['days'][$i]) && intval($_GET['extcredits'][$i]) && intval($_GET['usergid'][$i]) && intval($_GET['reward'][$i] * 100) && !in_array($i, $_GET['delete'])) {
            $mrcs[$i]['days'] = intval($_GET['days'][$i]);
예제 #2
0
파일: admin.inc.php 프로젝트: v998/dsu
$file = './data/plugindata/dsu_amucallme.data.php';
if (!$_G['gp_submit']) {
    $exsel = extc2seled(0, $_G['setting']['extcredits']);
    loadcache('usergroups');
    $usergroups = $_G['cache']['usergroups'];
    showformheader('plugins&operation=config&identifier=dsu_amucallme&pmod=admin');
    showtips(lang("plugin/dsu_amucallme", "admin2_p1"));
    showtableheader(lang("plugin/dsu_amucallme", "admin2_h1"));
    showsubtitle(array(lang("plugin/dsu_amucallme", "admin2_t4"), lang("plugin/dsu_amucallme", "admin2_t2"), lang("plugin/dsu_amucallme", "admin2_t3")));
    if (file_exists($file)) {
        require_once DISCUZ_ROOT . './data/plugindata/dsu_amucallme.data.php';
        $data_f2a = dstripslashes($data_f2a);
    }
    foreach ($usergroups as $id => $result) {
        $exinp = $data_f2a[$id];
        $exsel = extc2seled($exinp['extcredits'], $_G['setting']['extcredits']);
        showtablerow('', array(' ', ' ', ' '), array('' . $result['grouptitle'] . '<INPUT TYPE="hidden" NAME="usergid[]" value="' . $id . '">', '' . $exsel . '', '<input type="text" class="txt" name="cost[]" value="' . $exinp['cost'] . '" size="7" />'));
    }
    showsubmit('submit', lang("plugin/dsu_amucallme", "admin2_s2"));
    showtablefooter();
    showformfooter();
} elseif ($_G['adminid'] == '1' && $_G['gp_formhash'] == FORMHASH) {
    $mrcs = array();
    //var_dump($_POST);
    $max_i = max(count($_G['gp_usergid']), count($_G['gp_extcredits']), count($_G['gp_cost']));
    for ($i = 0; $i < $max_i; $i++) {
        if (intval($_G['gp_extcredits'][$i]) && intval($_G['gp_usergid'][$i])) {
            $k = intval($_G['gp_usergid'][$i]);
            $mrcs[$k]['usergid'] = intval($_G['gp_usergid'][$i]);
            $mrcs[$k]['extcredits'] = intval($_G['gp_extcredits'][$i]);
            $mrcs[$k]['cost'] = intval($_G['gp_cost'][$i] * 100) / 100;