Example #1
0
<?php

define('ROOT', dirname($_SERVER['SCRIPT_FILENAME']));
require ROOT . "/include/admin-init.php";
if (!is_login()) {
    die(html_jump('login.php'));
}
set_page_type('user', 'user_group');
set_page_power(array(1));
set_title("用户组管理");
$group = new group();
$user_info = new user_info();
$group->get_group();
$user_info->get_all_user();
$user_info->get_id_list();
$group->get_user_group();
if (isset($_GET['status']) && $_GET['status'] != 'OK') {
    add_footer_str('<script language="javascript">error_notic("' . $_GET['status'] . '","");</script>');
}
get_admin_header();
?>
<div id="user-group">
<h2 class="center">用户组管理</h2>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="title"><th>ID</th><th>分组名</th><th>组长</th><th>组员</th><th>操作</th></tr>
<?php 
$i = 0;
foreach ($group->group as $v) {
    echo '<tr class="list-', $i++ % 2, '"><td>', $v['id'], '</td>', '<td>', $v['name'], '</td>', '<td>';
    if (isset($user_info->id_list[$v['lader']])) {
        echo '<a href="user.php?id=', $v['lader'], '">', $group->lader_id[$v['lader']], '(', $v['lader'], ')</a>';
Example #2
0
<?php

define('ROOT', dirname($_SERVER['SCRIPT_FILENAME']));
require ROOT . "/include/admin-init.php";
if (!is_login()) {
    die(html_jump('login.php'));
}
set_page_type('library', 'library_return');
set_page_power(array(1));
set_title("图书归还");
$all_user = new user_info();
$all_user->get_id_list();
get_admin_header();
?>
<div id="library-lent">
<h2 class="center">图书归还</h2>
<?php 
if (isset($_GET['status'])) {
    if ($_GET['status'] == 'OK') {
        echo '<p class="status blue center">成功归还图书</p>';
    } else {
        echo '<p class="status red center">', $_GET['status'], '</p>';
    }
}
?>
<form action="library-action.php" method="get">
图书ID:<input name="id" value="<?php 
if (isset($_GET['id'])) {
    echo $_GET['id'];
}
?>
Example #3
0
 function edit_group($id, $name, $lader)
 {
     if (empty($name) || empty($lader) || empty($id)) {
         return '数据有误';
     }
     global $mysql;
     $old = $mysql->get_mysql_arr("group", "*", '`id`=' . $id);
     if (!(isset($old[0]['id']) && $old[0]['id'] == $id)) {
         return 'ID不存在或ID错误';
     }
     if ($old[0]['name'] == $name && $old[0]['lader'] == $lader) {
         return '信息未改变';
     }
     $user_info = new user_info();
     $user_info->get_id_list();
     if (!isset($user_info->id_list[$lader])) {
         return '该组长不存在';
     }
     if ($mysql->up_sql_arr("group", array('name' => $name, 'lader' => $lader), '`id`=' . $id)) {
         return 'OK';
     } else {
         return '更新数据失败';
     }
 }