Example #1
0
    // 	$links[] = array('text' => "返回", 'href' => 'license.php?act=list');
    // 	sys_msg("创建注册码成功,成功创建了".$sum."个注册码!", 0, $links);
}
/*------------------------------------------------------ */
//-- 批量导出注册码
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'exportLicense') {
    /* 检查权限 */
    admin_priv('license_manage');
    $license = license_list_export();
    $lic = array();
    foreach ($license as $l) {
        $lic[] = $l["license"];
    }
    //导出注册码
    license_export($lic);
} elseif ($_REQUEST['act'] == 'toggle_removed') {
    check_authz_json('license_manage');
    $id = intval($_POST['id']);
    $val = intval($_POST['val']);
    $db->query("update " . $ecs->table("license") . " set removed='" . ($val ? "0" : "1") . "' where license_id=" . $id);
    clear_cache_files();
    make_json_result($val);
} elseif ($_REQUEST['act'] == 'list') {
    /* 检查权限 */
    admin_priv('license_manage');
    $smarty->assign('ur_here', "注册码列表");
    $smarty->assign('action_link', array('text' => "生成注册码", 'href' => 'license.php?act=create'));
    $license_list = license_list();
    $smarty->assign('license_list', $license_list['license_list']);
    $smarty->assign('filter', $license_list['filter']);
    $smarty->assign('page_count', $license_list['page_count']);
    $smarty->assign('full_page', 1);
    assign_query_info();
    $smarty->display('license_statistics_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $license_list = license_list();
    $smarty->assign('license_list', $license_list['license_list']);
    $smarty->assign('filter', $license_list['filter']);
    $smarty->assign('record_count', $license_list['record_count']);
    $smarty->assign('page_count', $license_list['page_count']);
    make_json_result($smarty->fetch('license_statistics_list.htm'), '', array('filter' => $license_list['filter'], 'page_count' => $license_list['page_count']));
} elseif ($_REQUEST['act'] == 'export') {
    /* 检查权限 */
    admin_priv('license_manage');
    $list = license_list_export();
    license_export($list);
} elseif ($_REQUEST['act'] == 'load_class') {
    /* 检查权限 */
    admin_priv('license_manage');
    $sql = "select * from  " . $_REQUEST['school_code'] . "_school.ht_class ";
    $list = $db->getAll($sql);
    make_json_result($list);
}
/**
 *  返回学校管理员列表数据
 *
 * @access  public
 * @param
 *
 * @return void
 */