Exemplo n.º 1
0
<?php

if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
    exit('Access Denied');
}
$subops = array('list', 'edit');
$subop = in_array($subop, $subops) ? $subop : $subops[0];
$goodssorts = api_indata('server_goodssort');
$goodssorts = array_sort($goodssorts, 'displayorder');
foreach ($goodssorts as $k => $v) {
    if ($v['sortupid'] == 0) {
        foreach ($goodssorts as $k1 => $v1) {
            if ($v1['sortupid'] == $v['sortname']) {
                $gsort[$v1['sortname']] = $v['sorttitle'] . '--' . $v1['sorttitle'];
            }
        }
    }
}
$goodsid = getgpc('goodsid');
$goods_info = C::t(GM('shop_goods'))->fetch($goodsid);
if ($subop == 'list') {
    if (!submitcheck('submit')) {
        showtips(lang('plugin/yiqixueba', 'goods_list_tips'));
        showformheader($this_page . '&subop=list');
        showtableheader(lang('plugin/yiqixueba', 'goods_list'));
        showsubtitle(array('', lang('plugin/yiqixueba', 'goodsname'), lang('plugin/yiqixueba', 'goodstitle'), lang('plugin/yiqixueba', 'goodssort'), lang('plugin/yiqixueba', 'createtime'), lang('plugin/yiqixueba', 'status'), ''));
        $goodss_row = C::t(GM('shop_goods'))->range();
        foreach ($goodss_row as $k => $row) {
            showtablerow('', array('class="td25"', 'class="td28"', 'class="td29"', 'class="td28"'), array("<input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"{$row['goodsid']}\" />", '<span class="bold">' . $row['goodsname'] . '</span>', $row['goodstitle'], $gsort[$row['goodssort']], dgmdate($row['youxiaotime'], 'd'), "<input class=\"checkbox\" type=\"checkbox\" name=\"statusnew[" . $row['goodsid'] . "]\" value=\"1\" " . ($row['status'] > 0 ? 'checked' : '') . ">", "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=edit&goodsid={$row['goodsid']}\" >" . lang('plugin/yiqixueba', 'edit') . "</a>"));
        }
        echo '<tr><td></td><td colspan="6"><div><a href="' . ADMINSCRIPT . '?action=' . $this_page . '&subop=edit" class="addtr" >' . lang('plugin/yiqixueba', 'add_new_goods') . '</a></div></td></tr>';
Exemplo n.º 2
0
<?php

if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
    exit('Access Denied');
}
$shopsetting = C::t(GM('shop_shopsetting'))->range();
$shoptemplates = api_indata('server_shoptemplate');
foreach ($shoptemplates as $k => $v) {
    $shoptempradio[] = array($v, lang('plugin/yiqixueba', 'shoptemp_' . $v));
}
if (!submitcheck('submit')) {
    showtips(lang('plugin/yiqixueba', 'edit_basesetting_tips'));
    showformheader($this_page . '&subop=edit', 'enctype');
    showtableheader(lang('plugin/yiqixueba', 'basesetting_option'));
    showsetting(lang('plugin/yiqixueba', 'shoptemplate'), array('shopsetting[shoptemplate]', $shoptempradio), $shopsetting['shoptemplate']['svalue'], 'select', '', 0, lang('plugin/yiqixueba', 'basesettingstatus_comment'), '', '', true);
    //radio
    showsubmit('submit');
    showtablefooter();
    showformfooter();
} else {
    foreach ($_POST['shopsetting'] as $k => $v) {
        $data = array('skey' => $k, 'svalue' => $v);
        if (!C::t(GM('shop_shopsetting'))->skey_exists($k)) {
            C::t(GM('shop_shopsetting'))->insert($data);
        } else {
            C::t(GM('shop_shopsetting'))->update($k, $data);
        }
    }
    echo '<style>.floattopempty { height: 30px !important; height: auto; } </style>';
    cpmsg(lang('plugin/yiqixueba', 'edit_basesetting_succeed'), 'action=' . $this_page . '&subop=basesettinglist', 'succeed');
}
Exemplo n.º 3
0
}
if ($subop == 'list') {
    showtips(lang('plugin/yiqixueba', 'mokuai_list_tips'));
    showformheader($this_page . '&subop=list');
    showtableheader(lang('plugin/yiqixueba', 'mokuai_list'));
    showsubtitle(array('', lang('plugin/yiqixueba', 'mokuai_name'), lang('plugin/yiqixueba', 'mokuai_version'), lang('plugin/yiqixueba', 'mokuai_price'), lang('plugin/yiqixueba', 'mokuai_installtime'), lang('plugin/yiqixueba', 'status'), ''));
    foreach (C::t(GM('main_mokuai'))->range() as $k => $row) {
        unset($mokuai_info[$row['biaoshi']][$row['version']]);
        if (!count($mokuai_info[$row['biaoshi']])) {
            unset($mokuai_info[$row['biaoshi']]);
        }
        showtablerow('', array('class="td25"', 'style="width:120px"', 'class="td28"', '', '', '', ''), array('<img src="' . cloudaddons_pluginlogo_url($row['biaoshi']) . '" onerror="this.src=\'static/image/admincp/plugin_logo.png\';this.onerror=null" width="40" height="40" align="left" />', '<span class="bold">' . $row['name'] . '-V' . $row['version'] . '</span>', $row['description'], $row['price'], dgmdate($row['createtime'], 'dt'), ($row['available'] ? "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=close&mokuaiid={$row['mokuaiid']}\" >{$lang['closed']}</a>" : "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=open&mokuaiid={$row['mokuaiid']}\">{$lang['enable']}</a>") . "&nbsp;&nbsp;" . (intval(end(array_keys($mokuai_info[$row['biaoshi']]))) > intval($row['version']) ? "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=update&mokuaiid={$row['mokuaiid']}\">{$lang['plugins_config_upgrade']}</a>&nbsp;&nbsp;" : '') . "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=uninstall&mokuaiid={$row['mokuaiid']}\">{$lang['plugins_config_uninstall']}</a>&nbsp;&nbsp;"));
    }
    foreach ($mokuai_info as $k => $v) {
        $row = end($v);
        $key = end(array_keys($v));
        showtablerow('', array('class="td25"', 'style="width:120px"', 'class="td28"', '', '', '', ''), array('<img src="' . cloudaddons_pluginlogo_url($k) . '" onerror="this.src=\'static/image/admincp/plugin_logo.png\';this.onerror=null" width="40" height="40" align="left" />', '<span class="bold">' . $row['name'] . '-V' . $key . '</span>', $row['description'], $row['price'] ? $row['price'] . lang('plugin/yiqixueba', 'rmb') : lang('plugin/yiqixueba', 'mianfei'), '', "<a href=\"" . ADMINSCRIPT . "?action=" . $this_page . "&subop=install&mokuainame=" . $k . "_" . $key . "\">{$lang['plugins_config_install']}</a>"));
    }
    showtablefooter();
    showformfooter();
} elseif ($subop == 'install') {
    $data['mokuai'] = getgpc('mokuainame');
    $installmokuai = api_indata('server_installmokuai', $data);
    dump($installmokuai);
}
$data = array('biaoshi' => 'server', 'version' => '1.0', 'available' => 1, 'createtime' => time(), 'updatetime' => '', 'displayorder' => 0, 'name' => '服务端', 'price' => 50000, 'description' => '平台的模块设计部分');
//C::t(GM('main_mokuai'))->insert($data);
?>