<?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', 'edit_info'); set_page_power(array(0, 1)); $all_group = new group(); $all_group->get_group(); if (isset($_GET['id']) && is_number($_GET['id']) && get_power() == 1) { $new_user = new user(); $user_info = $new_user->get_user_info($_GET['id']); unset($new_user); } else { $user_info = $GLOBALS['user']; } set_title("编辑用户信息"); get_admin_header(); if (isset($_GET['status'])) { echo "<p>状态:" . $_GET['status'] . "</p>"; } if (count($user_info) == 0) { echo "<p>信息错误,请检查ID是否正确</p>"; } else { ?> <form action="user-action.php" method="post"> <table border="0" cellspacing="0" cellpadding="0"> <tr>
$c = ' selected'; } else { $c = NULL; } echo "<option value=\"{$n}\"{$c}>{$v} ({$n})</option>\n"; } echo '</select>', "\n"; } ?> 类别<select name="type"><option value="all">全部</option><option value="lent">借出</option><option value="return">归还</option></select> <button type="submit">查看</button> </form> <table> <?php if (!(isset($_GET['id']) && get_power() == 1 && isset($all_user->id_list[$_GET['id']]))) { $_GET['id'] = NULL; } if (!isset($_GET['type'])) { $_GET['type'] = NULL; } $history = new library_book_history($_GET['id'], $_GET['type']); $history->get_list(); if (count($history->list) == 0) { echo "<tr>数据为空</tr>"; } foreach ($history->list as $n => $v) { ?> <tr><td><?php echo $v['time']; ?>
<?php echo "Please enter a number whose power you wish to calculate:"; $num_in = fgets(STDIN); echo "Please enter a power:"; $power_in = fgets(STDIN); $nn_num_in = rtrim($num_in); $nn_power_in = rtrim($power_in); $final_power = get_power($num_in, $power_in); echo "{$nn_num_in} raised to {$nn_power_in} is {$final_power}"; function get_power($num, $power) { $ans = 1; for ($cnt = 1; $cnt <= $power; $cnt++) { $ans = $ans * $num; } return $ans; }